cleaning in spot client
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
|||||||
SpotLeveragedTokenPRHistoryRequest,
|
SpotLeveragedTokenPRHistoryRequest,
|
||||||
SpotCrossMarginBorrowingInfoRequest,
|
SpotCrossMarginBorrowingInfoRequest,
|
||||||
SpotCrossMarginRepaymentHistoryRequest,
|
SpotCrossMarginRepaymentHistoryRequest,
|
||||||
|
SpotCancelOrderBatchRequest,
|
||||||
} from './types';
|
} from './types';
|
||||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||||
import BaseRestClient from './util/BaseRestClient';
|
import BaseRestClient from './util/BaseRestClient';
|
||||||
@@ -119,11 +120,9 @@ export class SpotClientV3 extends BaseRestClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Batch cancel orders */
|
/** Batch cancel orders */
|
||||||
cancelOrderBatch(params: {
|
cancelOrderBatch(
|
||||||
symbol: string;
|
params: SpotCancelOrderBatchRequest
|
||||||
side?: OrderSide;
|
): Promise<APIResponseV3<any>> {
|
||||||
orderTypes: OrderTypeSpot[];
|
|
||||||
}): Promise<APIResponseV3<any>> {
|
|
||||||
const orderTypes = params.orderTypes
|
const orderTypes = params.orderTypes
|
||||||
? params.orderTypes.join(',')
|
? params.orderTypes.join(',')
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ export interface NewSpotOrderV3 {
|
|||||||
triggerPrice?: string;
|
triggerPrice?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SpotCancelOrderBatchRequest {
|
||||||
|
symbol: string;
|
||||||
|
side?: OrderSide;
|
||||||
|
orderTypes: OrderTypeSpot[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface SpotOrderQueryById {
|
export interface SpotOrderQueryById {
|
||||||
orderId?: string;
|
orderId?: string;
|
||||||
orderLinkId?: string;
|
orderLinkId?: string;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
serializeParams,
|
serializeParams,
|
||||||
RestClientType,
|
RestClientType,
|
||||||
REST_CLIENT_TYPE_ENUM,
|
REST_CLIENT_TYPE_ENUM,
|
||||||
agentSource,
|
APIID,
|
||||||
getRestBaseUrl,
|
getRestBaseUrl,
|
||||||
} from './requestUtils';
|
} 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
|
// custom request options based on axios specs - see: https://github.com/axios/axios#request-config
|
||||||
...requestOptions,
|
...requestOptions,
|
||||||
headers: {
|
headers: {
|
||||||
'x-referer': agentSource,
|
'x-referer': APIID,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
* Used to switch how authentication/requests work under the hood (primarily for SPOT since it's different there)
|
||||||
|
|||||||
Reference in New Issue
Block a user