Repository navigation
Conversation
- Add futuresSizeDecimal client option (REST and WebSocket, default off) - Send X-Gate-Size-Decimal: 1 on /futures/* and /delivery/* REST calls when enabled - Send the same header on perp/delivery WS connections and futures WS API req_header - Widen futures/delivery size-related types to number | string (FuturesContractSize) - Bump version to 1.7.0 Co-authored-by: Jerko J <JJ-Cro@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gate requires
X-Gate-Size-Decimal: 1on REST and WebSocket futures traffic so size-related fields are returned as decimal strings instead of integers (rounded down). This PR adds an opt-in client flag and widens the affected TypeScript types.Version:
1.7.0(minor bump from1.6.4). The draftupdate07102026branch also targets a minor bump; align versions before release if both land.Changelog
futuresSizeDecimal?: booleantoRestClientOptionsandWSClientConfigurableOptions(defaultfalse).X-Gate-Size-Decimal: 1on:/futures/or/delivery/(all futures/delivery REST methods in this SDK use those prefixes, including autoorder under/futures/.../autoorder/...).perpFuturesUSDTV4,perpFuturesBTCV4,deliveryFuturesUSDTV4, anddeliveryFuturesBTCV4.req_headeron those connections (login, order place/amend, etc.).FuturesContractSize(number | string) and apply it to futures/delivery size-related request and response fields (and futures WS API order types), with JSDoc noting string values whenfuturesSizeDecimalis on.test/lib/futuresSizeDecimal.test.tsfor header scoping and REST behavior.Type fields updated
FuturesContractSizeon:Futures response:
FuturesOrderBook(asks/bids.s),FuturesTrade.size,FuturesCandle.v,FuturesStats(long_liq_size,short_liq_size,open_interest,top_lsr_size,top_long_size,top_short_size,long_taker_size,short_taker_size),LiquidationHistoryRecord(size,order_size,left),FuturesOrder(size,iceberg,left),FuturesPosition.size,FuturesTradingHistoryRecord(size,close_size),FuturesLiquidationHistoryRecord(size,left),FuturesAutoDeleveragingHistoryRecord(trade_size,position_size),FuturesContract/FuturesDeliveryContract(order_size_min,order_size_max,trade_size,position_size),FuturesPriceTriggeredOrder.initial.size,BatchAmendOrderResp(size,iceberg,left).Futures request:
SubmitFuturesOrderReq(size,iceberg),UpdateFuturesOrderReq.size,SubmitFuturesTriggeredOrderReq.initial.size,BatchAmendOrderReq.size,UpdateFuturesPriceTriggeredOrderReq.size.Delivery response:
DeliveryOrderBook(asks/bids.s),DeliveryTrade.size,DeliveryCandle.v,DeliveryTradingHistoryRecord.size,DeliveryLiquidationHistoryRecord(size,left),DeliverySettlementHistoryRecord.size.Delivery request:
SubmitDeliveryFuturesOrderReq(size,iceberg).Futures WS API:
WSAPIFuturesOrderPlaceReq(size,iceberg),WSAPIFuturesOrderAmendReq.size,WSAPIFuturesOrder(size,left,iceberg).Testing
npm run lint— passnpm run build— passnpm test—test/lib/futuresSizeDecimal.test.ts,test/REST/public.test.ts,test/websockets/wsStore.test.tspass;test/REST/private.test.tsfails without API credentials (7 tests, expected in CI without secrets)References