Skip to content

Updated various Spot and Futures requests/subscriptions - #17

Merged
JKorf merged 1 commit into
JKorf:mainfrom
nils2525:feature/FuturesImprovement
Sep 21, 2026
Merged

JKorf merged 1 commit into
JKorf:mainfrom
nils2525:feature/FuturesImprovement

Conversation

@nils2525

Copy link
Copy Markdown
Contributor
  • Updated TransferAsync() parameter name from asset to coin
  • Updated ToobitFuturesUserDataSubscription accountHandler event data from ToobitAccountUpdate to ToobitAccountUpdate[]
  • Updated ToobitFuturesOrderUpdate Fee and FeeAsset properties to nullable types
  • Updated PlaceOrderAsync() quantity parameter from long to decimal
  • Fixed passing GetUserTradesAsync() startTime, endTime and limit parameters
  • Updated ListenKey Token scope to share between Spot and Futures client
  • Fixed reconnecting authenticated sockets


/// <inheritdoc />
public async Task<HttpResult<ToobitFuturesOrder>> PlaceOrderAsync(string symbol, FuturesOrderSide orderSide, FuturesNewOrderType orderType, long quantity, decimal? price = null, PriceType? priceType = null, decimal? stopPrice = null, TimeInForce? timeInForce = null, string? clientOrderId = null, decimal? takeProfit = null, TriggerType? takeProfitTriggerType = null, decimal? takeProfitLimitPrice = null, OrderType? takeProfitOrderType = null, decimal? stopLoss = null, TriggerType? stopLossTriggerType = null, decimal? stopLossLimitPrice = null, OrderType? stopLossOrderType = null, CancellationToken ct = default)
public async Task<HttpResult<ToobitFuturesOrder>> PlaceOrderAsync(string symbol, FuturesOrderSide orderSide, FuturesNewOrderType orderType, decimal quantity, decimal? price = null, PriceType? priceType = null, decimal? stopPrice = null, TimeInForce? timeInForce = null, string? clientOrderId = null, decimal? takeProfit = null, TriggerType? takeProfitTriggerType = null, decimal? takeProfitLimitPrice = null, OrderType? takeProfitOrderType = null, decimal? stopLoss = null, TriggerType? stopLossTriggerType = null, decimal? stopLossLimitPrice = null, OrderType? stopLossOrderType = null, CancellationToken ct = default)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is using the V1 endpoint and the documentation says its type is a LONG. For the V2 endpoint it is listed as a decimal. Are you sure decimal is correct here?
https://api-docs.toobit.com/api/usdt-m-account-and-trading.html#new-order-trade

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I hadn't noticed that. But it seems that the v1 endpoint also supports decimals. A test with quantity=1.5 gives me the following result:

{
...
  "symbol": "BTC-SWAP-USDT",
  "price": "50000",
  "origQty": "1.5",
  "executedQty": "0",
  "marginLocked": "1.5",
....
  "status": "PENDING_NEW",
  "contractMultiplier": "0.00100000"
...
}

@JKorf
JKorf merged commit d00b1d0 into JKorf:main Sep 21, 2026
1 check passed
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