diff --git a/src/spot-client-v3.ts b/src/spot-client-v3.ts index 33719a9..7624204 100644 --- a/src/spot-client-v3.ts +++ b/src/spot-client-v3.ts @@ -11,6 +11,7 @@ import { SpotLeveragedTokenPRHistoryRequest, SpotCrossMarginBorrowingInfoRequest, SpotCrossMarginRepaymentHistoryRequest, + SpotCancelOrderBatchRequest, } from './types'; import { REST_CLIENT_TYPE_ENUM } from './util'; import BaseRestClient from './util/BaseRestClient'; @@ -119,11 +120,9 @@ export class SpotClientV3 extends BaseRestClient { } /** Batch cancel orders */ - cancelOrderBatch(params: { - symbol: string; - side?: OrderSide; - orderTypes: OrderTypeSpot[]; - }): Promise> { + cancelOrderBatch( + params: SpotCancelOrderBatchRequest + ): Promise> { const orderTypes = params.orderTypes ? params.orderTypes.join(',') : undefined; diff --git a/src/types/request/spot.ts b/src/types/request/spot.ts index fc589ea..3c0c20f 100644 --- a/src/types/request/spot.ts +++ b/src/types/request/spot.ts @@ -25,6 +25,12 @@ export interface NewSpotOrderV3 { triggerPrice?: string; } +export interface SpotCancelOrderBatchRequest { + symbol: string; + side?: OrderSide; + orderTypes: OrderTypeSpot[]; +} + export interface SpotOrderQueryById { orderId?: string; orderLinkId?: string; diff --git a/src/util/BaseRestClient.ts b/src/util/BaseRestClient.ts index b5a7a13..9141dab 100644 --- a/src/util/BaseRestClient.ts +++ b/src/util/BaseRestClient.ts @@ -6,7 +6,7 @@ import { serializeParams, RestClientType, REST_CLIENT_TYPE_ENUM, - agentSource, + APIID, getRestBaseUrl, } from './requestUtils'; @@ -98,7 +98,7 @@ export default abstract class BaseRestClient { // custom request options based on axios specs - see: https://github.com/axios/axios#request-config ...requestOptions, headers: { - 'x-referer': agentSource, + 'x-referer': APIID, }, }; diff --git a/src/util/requestUtils.ts b/src/util/requestUtils.ts index fa52e5b..fde95a0 100644 --- a/src/util/requestUtils.ts +++ b/src/util/requestUtils.ts @@ -85,7 +85,7 @@ export function isWsPong(msg: any): boolean { ); } -export const agentSource = 'bybitapinode'; +export const APIID = 'bybitapinode'; /** * Used to switch how authentication/requests work under the hood (primarily for SPOT since it's different there)