Skip to content

feat(v1.7.0): RPI taker access, CrossEx updates, microsecond trade timestamps and optional native fetch transport, plus tracker fixes - #162

Open
JJ-Cro wants to merge 11 commits into
sieblyio:masterfrom
JJ-Cro:update30112026
Open

JJ-Cro wants to merge 11 commits into
sieblyio:masterfrom
JJ-Cro:update30112026

Conversation

@JJ-Cro

@JJ-Cro JJ-Cro commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Gate API v4.106.183-187 updates: RPI taker access, CrossEx filters and fields, microsecond futures trade timestamps and tokenized security info. Adds an optional native fetch transport and settles pending WebSocket requests on auth failure or close. Also fixes WS login failures and price-triggered order naming and docs.

Changelog

  • Breaking: CrossExTransferCoin.min_trans_amount and est_fee are now strings (GET /crossex/transfers/coin)
  • rpi_taker_access on spot and futures order requests; new submitFuturesBBOOrder() (POST /futures/{settle}/bbo_orders), which also takes rpi_taker_access. Batch futures orders exclude it, because Gate supports it on single orders only.
  • create_time_us on futures trades, my trades and my trades by time range (returned only when the timeUnit: microsecond header is sent)
  • CrossEx: status filter on transfers, order_id / text filters on history orders, order_id filter and fx_rate on history trades, risk_limits on positions, assets[].price on accounts, REBASE attribute
  • tokenized_security_info on spot currencies
  • New cancelAllSpotPriceTriggeredOrders() and cancelAllFuturesPriceTriggeredOrders() (same endpoints). The old cancelAllOpenSpotOrders() / cancelAllOpenFuturesOrders() names are marked @deprecated and unchanged, because they cancel price-triggered orders, not open orders
  • Price-triggered order types: JSDoc on the trigger rule, price_type, strategy_type and expiration units; getSpotAutoOrders() summary corrected
  • WebsocketClient: a rejected spot.login/futures.login now rejects the waiting WS API requests and clears the login state so a later call can retry, including with authPrivateConnectionsOnConnect (the failure is caught and emitted as exception)
  • WebSockets: pending WS API requests and connect/auth promises now reject with an Error when authentication is rejected, when the connection closes or terminates, and when close()/closeAll() is called during connect or auth. A socket that opens after its attempt was cancelled is closed without emitting open/reconnected. Internal automatic auth/reconnect failures are emitted on exception instead of becoming unhandled rejections. Successful flows are unchanged, and the existing rejection reasons for requests in flight on a socket close are kept
  • Optional native fetch transport: new customFetchFn REST client option (with exported CustomFetch, CustomFetchRequestInit and CustomFetchResponse types). When set, REST requests go through that fetch function (e.g. fetch or a Cloudflare Workers fetcher) instead of axios, with the same signing, response handling and error shapes; errors thrown by the fetch function come back unchanged. Default stays axios. README section "Edge runtimes / native fetch". Binary/multipart bodies reject locally in this mode
  • Version 1.7.0

Checks

  • npm run lint, tsc --noEmit, npm run build: pass
  • Endpoint docs, examples/apidoc and llms.txt regenerated with the regex runner

Internal tracker: #94, #96, #19, #124

JJ-Cro and others added 9 commits November 29, 2026 12:48
…ssEx, microsecond trade times)

- BREAKING: CrossExTransferCoin min_trans_amount and est_fee are now strings (GET /crossex/transfers/coin)
- rpi_taker_access on spot and futures order requests; new submitFuturesBBOOrder() (POST /futures/{settle}/bbo_orders) with rpi_taker_access; batch futures orders exclude it (single orders only)
- create_time_us on futures trades, my_trades and my_trades_timerange responses (needs the timeUnit: microsecond header)
- CrossEx: status filter on transfers, order_id/text filters on history orders, order_id filter and fx_rate on history trades, risk_limits on positions, assets[].price on accounts, REBASE attribute
- tokenized_security_info on spot currencies
- Version 1.6.11
…ders

- Reject authentication waiters and clear failed login state when a Gate WS API login is rejected, so a later call can retry; skipped when authPrivateConnectionsOnConnect is enabled (automation-tracker sieblyio#19).
- Add cancelAllSpotPriceTriggeredOrders() and cancelAllFuturesPriceTriggeredOrders(); deprecate the ambiguous cancelAllOpenSpotOrders()/cancelAllOpenFuturesOrders() names without changing their implementations (automation-tracker sieblyio#94).
- Document trigger enums, comparison rules and timeout units on spot/futures price-triggered order types; correct the getSpotAutoOrders() summary (automation-tracker sieblyio#96).

Package version remains 1.6.11.
- Reject shared authentication and pending WS API requests on login/build/send failures, including automatic on-open authentication (automation-tracker sieblyio#19).
- Settle cancelled connection/authentication attempts, guard stale sockets and asynchronous work, and catch internal lifecycle rejections while preserving successful flows (automation-tracker sieblyio#19).
- Add opt-in customFetch REST transport with shared response/error handling, exported structural types, and README guidance; retain axios by default (automation-tracker sieblyio#124).
- Set package and lockfile release versions to 1.7.0 for the native fetch feature (automation-tracker sieblyio#124).
…tch Accept header

- Redact credentials from Axios REST network errors using safe diagnostic options (automation-tracker sieblyio#66)
- Align the fetch Accept default and document runtime transport headers (automation-tracker sieblyio#124)
Comment thread src/lib/BaseRestClient.ts Outdated
.catch((e) => this.parseException(e, options));
}

private async fetchRequest(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method name changed again, pls name naming and contents consistent across all. Don't need 10 flavours of the same thing...

Comment thread src/lib/requestUtils.ts Outdated
* Axios-only network options, adapters, agents and interceptors are ignored,
* except timeout, which uses AbortSignal.timeout() when supported.
*/
customFetch?: CustomFetch;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same req here as other PRs

Comment thread src/lib/BaseWSClient.ts

if (!this.wsStore.getConnectionInProgressPromise(wsKey)) {
this.wsStore.createConnectionInProgressPromise(wsKey, false);
const failed = (cause: unknown) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this different from the other SDKs now? It's more readable than the proposed IIFE changes in the other SDKs, for sure. But consistency please. BaseWSClient should ideally match almost perfectly between all SDKs

This branch has not been deployed

No deployments
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