Skip to content

feat(1.6.5): TestNet hosts and Gate API sync through v4.106.160 - #4

Open
JJ-Cro wants to merge 3 commits into
masterfrom
update16102026
Open

JJ-Cro wants to merge 3 commits into
masterfrom
update16102026

Conversation

@JJ-Cro

@JJ-Cro JJ-Cro commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Repoint TestNet REST to https://api-testnet.gateapi.io/api/v4. baseUrlKey: 'testnet' covers spot and futures. futuresTestnet is the same host, so older configs keep working. The previous futures TestNet host returns HTTP 502.
  • Point Spot and Options WebSocket TestNet at the hosts in the current Gate docs. USDT perpetual TestNet was already correct.
  • updateFuturesPriceTriggeredOrder now calls PUT /futures/{settle}/price_orders/amend/{order_id} and still sends order_id in the body (v4.106.160).
  • Sync the pending type items that Gate docs still list and this SDK was missing. Version 1.6.5.

Changelog

  • v4.106.160: price-triggered order amend path is PUT /futures/{settle}/price_orders/amend/{order_id}. order_id stays in the JSON body.
  • v4.106.159: stock trade_status is pre_market | open | post_market.
  • v4.106.158: OTC fiat and stablecoin order list responses use data.lists.
  • v4.106.148: stock trade_mode (0 | 1 | 2 | 4 | 5 | 6 | 7 | 8), order status (0-8), and history finish_as (0-9, 13).
  • v4.106.147: futures account book type includes dividend.
  • Futures place-order requests accept tpsl_tp_bbo_type and tpsl_sl_bbo_type. Response FuturesOrder already had them.

Skipped

  • Stock order time_in_force GTC: current stock docs only list day. An earlier changelog removed gtc.
  • Stock client_order_id: already optional on CreateStockOrderReq.
  • tpsl_tp_bbo_type / tpsl_sl_bbo_type on FuturesOrder responses: already present.
  • BTC perpetual and delivery WebSocket TestNet URLs: they still match current Gate docs. Handshake check: delivery BTC 101, BTC perpetual and delivery USDT 502. No replacement host is documented (ws-testnet.gate.com variants returned 403).
  • Announcements WebSocket: no TestNet host in the docs. The stub stays.
  • docs/endpointFunctionList.md and examples/apidoc/RestClient/updateFuturesPriceTriggeredOrder.js still show the old amend path. Those files were not hand-edited.

Checks

  • npm run build: pass
  • npm run lint: pass
  • Jest unit + public: 14 passed (baseUrl, priceOrderAmend, wsStore, public)
  • Host probes: TestNet REST spot ticker and BTC_USDT futures contract returned 200 on api-testnet.gateapi.io. fx-api-testnet.gateio.ws returned 502. Spot, USDT futures, and Options TestNet WebSockets returned 101. Old Options TestNet host returned 502.
Open in Web Open in Cursor 

cursoragent and others added 3 commits October 16, 2026 10:14
TestNet REST `futuresTestnet` now uses https://api-testnet.gateapi.io/api/v4.
`baseUrlKey: 'testnet'` is the same host for spot and futures. `futuresTestnet` stays as an alias.

WebSocket TestNet:
- spot: wss://ws-testnet.gate.com/v4/ws/spot
- options: wss://ws-testnet.gate.com/v4/ws/options
- USDT perpetual, BTC perpetual, and delivery hosts still match current Gate docs

Changelog:
- v4.106.160: updateFuturesPriceTriggeredOrder uses PUT /futures/{settle}/price_orders/amend/{order_id}; order_id stays in the body
- v4.106.159: stock trade_status is pre_market | open | post_market
- v4.106.158: OTC fiat and stablecoin order lists use data.lists
- v4.106.148: stock trade_mode, order status, and finish_as enums
- v4.106.147: futures account_book type dividend
- Futures place-order requests accept tpsl_tp_bbo_type and tpsl_sl_bbo_type

Skipped:
- stock time_in_force GTC: docs only list day
- stock client_order_id: already on CreateStockOrderReq
- tpsl bbo fields on FuturesOrder responses: already present

Co-authored-by: Jerko J <JJ-Cro@users.noreply.github.com>
Stop importing FuturesAccountBookType from request types. Response records use FuturesAccountBookRecordType.

Co-authored-by: Jerko J <JJ-Cro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants