Skip to content

Commit

Permalink
fix(): batch orders type
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Jun 12, 2024
1 parent 687fe8f commit e66b05d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 8 additions & 6 deletions src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import {
GetFuturesTradingHistoryReq,
GetLiquidationHistoryReq,
GetRiskLimitTiersReq,
SubmitFuturesBatchOrdersReq,
SubmitFuturesOrderReq,
SubmitFuturesPriceTriggeredOrderReq,
UpdateDualModePositionLeverageReq,
Expand Down Expand Up @@ -2322,11 +2321,14 @@ export class RestClient extends BaseRestClient {
* @param params Parameters for creating a batch of futures orders
* @returns Promise<APIResponse<FuturesOrder[]>>
*/
submitFuturesBatchOrders(
params: SubmitFuturesBatchOrdersReq,
): Promise<APIResponse<FuturesOrder[]>> {
const { settle, ...body } = params;
return this.postPrivate(`/futures/${settle}/batch_orders`, { body: body });
submitFuturesBatchOrders(params: {
settle: 'btc' | 'usdt' | 'usd';
orders: SubmitFuturesOrderReq[];
}): Promise<APIResponse<FuturesOrder[]>> {
const { settle, orders } = params;
return this.postPrivate(`/futures/${settle}/batch_orders`, {
body: orders,
});
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/types/request/futures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ==========================================================================================================================
*/

import { FuturesOrder, FuturesPriceTriggeredOrder } from '../response/futures';
import { FuturesPriceTriggeredOrder } from '../response/futures';

export interface GetFuturesOrderBookReq {
settle: 'btc' | 'usdt' | 'usd';
Expand Down Expand Up @@ -133,10 +133,6 @@ export interface GetFuturesOrdersByTimeRangeReq {
offset?: number;
}

export interface SubmitFuturesBatchOrdersReq extends FuturesOrder {
settle: 'btc' | 'usdt' | 'usd';
}

export interface UpdateFuturesOrderReq {
settle: 'btc' | 'usdt' | 'usd';
order_id: string;
Expand Down

0 comments on commit e66b05d

Please sign in to comment.