v3.2.1: add instrument info response type. add cursor example with unified margin request
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export * from './shared';
|
||||
export * from './spot';
|
||||
export * from './usdt-perp';
|
||||
export * from './unified-margin';
|
||||
|
||||
38
src/types/response/unified-margin.ts
Normal file
38
src/types/response/unified-margin.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
export interface UMLeverageFilter {
|
||||
minLeverage: string;
|
||||
maxLeverage: string;
|
||||
leverageStep: string;
|
||||
}
|
||||
|
||||
export interface UMPriceFilter {
|
||||
minPrice: string;
|
||||
maxPrice: string;
|
||||
tickSize: string;
|
||||
}
|
||||
|
||||
export interface UMLotSizeFilter {
|
||||
maxTradingQty: string;
|
||||
minTradingQty: string;
|
||||
qtyStep: string;
|
||||
}
|
||||
|
||||
export interface UMInstrumentInfo {
|
||||
symbol: string;
|
||||
contractType: string;
|
||||
status: string;
|
||||
baseCoin: string;
|
||||
quoteCoin: string;
|
||||
launchTime: string;
|
||||
deliveryTime: string;
|
||||
deliveryFeeRate: string;
|
||||
priceScale: string;
|
||||
leverageFilter: UMLeverageFilter;
|
||||
priceFilter: UMPriceFilter;
|
||||
lotSizeFilter: UMLotSizeFilter;
|
||||
}
|
||||
|
||||
export interface UMInstrumentInfoResult {
|
||||
category: string;
|
||||
list: UMInstrumentInfo[];
|
||||
nextPageCursor: string;
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
InternalTransferRequest,
|
||||
UMExchangeCoinsRequest,
|
||||
UMBorrowHistoryRequest,
|
||||
UMInstrumentInfoResult,
|
||||
} from './types';
|
||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||
import BaseRestClient from './util/BaseRestClient';
|
||||
@@ -78,7 +79,7 @@ export class UnifiedMarginClient extends BaseRestClient {
|
||||
/** Get trading rules per symbol/contract, incl price/amount/value/leverage filters */
|
||||
getInstrumentInfo(
|
||||
params: UMInstrumentInfoRequest
|
||||
): Promise<APIResponseV3<any>> {
|
||||
): Promise<APIResponseV3<UMInstrumentInfoResult>> {
|
||||
return this.get('/derivatives/v3/public/instruments-info', params);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user