Add futures GetOpenOrdersAsync (list-open-order endpoint)#13
Open
Da-Teach wants to merge 1 commit into
Open
Conversation
…order) The USDT-M futures trading client only exposed GetOrdersAsync, which maps to the order-history endpoint (/order/list) with state + start/end time + pagination filters. XT also offers a dedicated open-orders endpoint (/future/trade/v1/order/list-open-order) that returns only NEW / PARTIALLY_FILLED orders, with an optional symbol filter (all markets when omitted) and no time window or pagination -- the futures analogue of the spot SpotApi.Trading.GetOpenOrdersAsync. This adds it.
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
The USDT-M futures trading client (
IXTRestClientFuturesApiTrading) currently exposes onlyGetOrdersAsync, which maps to the order-history endpointGET /future/trade/v1/order/list(filtered bystate+startTime/endTime+ pagination).XT also offers a dedicated open-orders endpoint,
GET /future/trade/v1/order/list-open-order, which returns onlyNEW/PARTIALLY_FILLEDorders, takes an optionalsymbol(all markets when omitted), and has no time window or pagination. It's the futures analogue of the existingSpotApi.Trading.GetOpenOrdersAsync— but there was no futures wrapper for it.This PR adds
FuturesApi.Trading.GetOpenOrdersAsync(string? symbol = null, CancellationToken ct = default).Without it, callers that need a complete snapshot of currently-open futures orders have to fall back to the history endpoint and guess at its default time window — which risks missing an old resting order.
Changes
IXTRestClientFuturesApiTrading.GetOpenOrdersAsync(interface + XML docs)XTRestClientFuturesApiTrading.GetOpenOrdersAsync(implementation)The implementation mirrors the existing spot
GetOpenOrdersAsync(returnsXTFuturesOrder[], single GET, optional lowercasedsymbol) and the futures rate-limit guard used by the siblingGetOrdersAsync.Builds clean against the current
main. Note: I matchedHttpMethod.Getto the siblingorder/listfutures query and the spot open-order endpoint; if XT actually expects POST here, happy to switch.