binance 2.3.3 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/lib/coinm-client.d.ts +114 -4
- package/lib/coinm-client.js +276 -79
- package/lib/coinm-client.js.map +1 -1
- package/lib/main-client.d.ts +2 -2
- package/lib/main-client.js.map +1 -1
- package/lib/types/futures.d.ts +104 -0
- package/lib/types/futures.js.map +1 -1
- package/lib/types/shared.d.ts +13 -0
- package/lib/types/spot.d.ts +0 -4
- package/lib/types/spot.js.map +1 -1
- package/lib/usdm-client.d.ts +10 -4
- package/lib/usdm-client.js +15 -6
- package/lib/usdm-client.js.map +1 -1
- package/lib/websocket-client.d.ts +5 -0
- package/lib/websocket-client.js +14 -9
- package/lib/websocket-client.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
[1]: https://www.npmjs.com/package/binance
|
|
11
11
|
|
|
12
|
-
Node.js
|
|
12
|
+
Node.js SDK for the Binance APIs and WebSockets, with TypeScript & browser support.
|
|
13
13
|
|
|
14
14
|
- Extremely robust & performant connector with significant trading volume in production (livenet).
|
|
15
15
|
- Actively maintained with a modern, promise-driven interface.
|
|
16
16
|
- Support for seamless HMAC and RSA authentication.
|
|
17
17
|
- Passing a private key as a secret will automatically revert to RSA authentication.
|
|
18
|
-
- Supports REST APIs for Binance Spot, Margin, Isolated Margin &
|
|
18
|
+
- Supports REST APIs for Binance Spot, Margin, Isolated Margin, USDM & CoinM Futures.
|
|
19
19
|
- Strongly typed on most requests and responses.
|
|
20
|
-
- Supports Websockets for Binance Spot, Margin, Isolated Margin & USDM Futures.
|
|
20
|
+
- Supports Websockets for Binance Spot, Margin, Isolated Margin & USDM & CoinM Futures.
|
|
21
21
|
- Event driven messaging.
|
|
22
22
|
- Smart websocket persistence
|
|
23
23
|
- Automatically handle silent websocket disconnections through timed heartbeats, including the scheduled 24hr disconnect.
|
|
@@ -27,7 +27,7 @@ Node.js connector for the Binance APIs and WebSockets, with TypeScript & browser
|
|
|
27
27
|
- Optional:
|
|
28
28
|
- Automatic beautification of Websocket events (from one-letter keys to descriptive words, and strings with floats to numbers).
|
|
29
29
|
- Automatic beautification of REST responses (parsing numbers in strings to numbers).
|
|
30
|
-
- Heavy end-to-end testing with real API calls.
|
|
30
|
+
- Heavy automated end-to-end testing with real API calls.
|
|
31
31
|
- End-to-end testing before any release.
|
|
32
32
|
- Real API calls in e2e tests.
|
|
33
33
|
- Proxy support via axios integration.
|
package/lib/coinm-client.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { CoinMAccountTradeParams, CoinMOpenInterest, CoinMPositionTrade, CoinMSymbolOrderBookTicker, PositionRisk, SymbolOrPair } from './types/coin';
|
|
3
|
-
import
|
|
3
|
+
import { BasicSymbolPaginatedParams, BasicSymbolParam, GetOrderParams, OrderBookParams, HistoricalTradesParams, KlinesParams, Kline, RecentTradesParams, CancelOrderParams, SymbolFromPaginatedRequestFromId, GetAllOrdersParams, GenericCodeMsgError, GetOrderModifyHistoryParams, SymbolPrice } from './types/shared';
|
|
4
|
+
import { ContinuousContractKlinesParams, IndexPriceKlinesParams, SymbolKlinePaginatedParams, FuturesDataPaginatedParams, NewFuturesOrderParams, CancelMultipleOrdersParams, CancelOrdersTimeoutParams, SetLeverageParams, SetMarginTypeParams, SetIsolatedMarginParams, GetPositionMarginChangeHistoryParams, GetIncomeHistoryParams, GetForceOrdersParams, FuturesExchangeInfo, FuturesOrderBook, RawFuturesTrade, AggregateFuturesTrade, FundingRateHistory, ModeChangeResult, PositionModeParams, PositionModeResponse, NewOrderResult, NewOrderError, OrderResult, CancelFuturesOrderResult, CancelAllOpenOrdersResult, SetLeverageResult, SetIsolatedMarginResult, ForceOrderResult, SymbolLeverageBracketsResult, IncomeHistory, RebateDataOverview, SetCancelTimeoutResult, ChangeStats24hr, MarkPrice, FuturesCoinMTakerBuySellVolumeParams, FuturesCoinMBasisParams, ModifyFuturesOrderResult, ModifyFuturesOrderParams, OrderAmendment, FuturesCoinMAccountBalance, FuturesCoinMAccountInformation } from './types/futures';
|
|
4
5
|
import { RestClientOptions } from './util/requestUtils';
|
|
6
|
+
import BaseRestClient from './util/BaseRestClient';
|
|
5
7
|
export declare class CoinMClient extends BaseRestClient {
|
|
6
8
|
private clientId;
|
|
7
9
|
constructor(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig, useTestnet?: boolean);
|
|
@@ -9,13 +11,121 @@ export declare class CoinMClient extends BaseRestClient {
|
|
|
9
11
|
* Abstraction required by each client to aid with time sync / drift handling
|
|
10
12
|
*/
|
|
11
13
|
getServerTime(): Promise<number>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* Market Data Endpoints
|
|
17
|
+
*
|
|
18
|
+
**/
|
|
19
|
+
testConnectivity(): Promise<{}>;
|
|
20
|
+
getExchangeInfo(): Promise<FuturesExchangeInfo>;
|
|
21
|
+
getOrderBook(params: OrderBookParams): Promise<FuturesOrderBook>;
|
|
22
|
+
getRecentTrades(params: RecentTradesParams): Promise<RawFuturesTrade[]>;
|
|
23
|
+
getHistoricalTrades(params: HistoricalTradesParams): Promise<RawFuturesTrade[]>;
|
|
24
|
+
getAggregateTrades(params: SymbolFromPaginatedRequestFromId): Promise<AggregateFuturesTrade[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Index Price and Mark Price
|
|
27
|
+
*/
|
|
28
|
+
getMarkPrice(params?: Partial<BasicSymbolParam>): Promise<MarkPrice | MarkPrice[]>;
|
|
29
|
+
getFundingRateHistory(params?: Partial<BasicSymbolPaginatedParams>): Promise<FundingRateHistory[]>;
|
|
30
|
+
getKlines(params: KlinesParams): Promise<Kline[]>;
|
|
31
|
+
getContinuousContractKlines(params: ContinuousContractKlinesParams): Promise<Kline[]>;
|
|
32
|
+
getIndexPriceKlines(params: IndexPriceKlinesParams): Promise<Kline[]>;
|
|
33
|
+
getMarkPriceKlines(params: SymbolKlinePaginatedParams): Promise<Kline[]>;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated use get24hrChangeStatistics() instead (method without the typo)
|
|
36
|
+
*/
|
|
37
|
+
get24hrChangeStatististics(params?: Partial<BasicSymbolParam>): Promise<ChangeStats24hr | ChangeStats24hr[]>;
|
|
38
|
+
get24hrChangeStatistics(params?: Partial<BasicSymbolParam>): Promise<ChangeStats24hr | ChangeStats24hr[]>;
|
|
39
|
+
getSymbolPriceTicker(params?: Partial<BasicSymbolParam>): Promise<SymbolPrice | SymbolPrice[]>;
|
|
15
40
|
getSymbolOrderBookTicker(params?: SymbolOrPair): Promise<CoinMSymbolOrderBookTicker[]>;
|
|
16
41
|
getOpenInterest(params: {
|
|
17
42
|
symbol: string;
|
|
18
43
|
}): Promise<CoinMOpenInterest>;
|
|
44
|
+
getOpenInterestStatistics(params: FuturesDataPaginatedParams): Promise<any>;
|
|
45
|
+
getTopTradersLongShortAccountRatio(params: FuturesDataPaginatedParams): Promise<any>;
|
|
46
|
+
getTopTradersLongShortPositionRatio(params: FuturesDataPaginatedParams): Promise<any>;
|
|
47
|
+
getGlobalLongShortAccountRatio(params: FuturesDataPaginatedParams): Promise<any>;
|
|
48
|
+
getTakerBuySellVolume(params: FuturesCoinMTakerBuySellVolumeParams): Promise<any>;
|
|
49
|
+
getCompositeSymbolIndex(params: FuturesCoinMBasisParams): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* USD-Futures Account/Trade Endpoints
|
|
53
|
+
*
|
|
54
|
+
**/
|
|
55
|
+
setPositionMode(params: PositionModeParams): Promise<ModeChangeResult>;
|
|
56
|
+
getCurrentPositionMode(): Promise<PositionModeResponse>;
|
|
57
|
+
submitNewOrder(params: NewFuturesOrderParams): Promise<NewOrderResult | NewOrderError>;
|
|
58
|
+
/**
|
|
59
|
+
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
|
|
60
|
+
*/
|
|
61
|
+
modifyOrder(params: ModifyFuturesOrderParams): Promise<ModifyFuturesOrderResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected.
|
|
64
|
+
*
|
|
65
|
+
* Known issue: `quantity` and `price` should be sent as strings
|
|
66
|
+
*/
|
|
67
|
+
submitMultipleOrders(orders: NewFuturesOrderParams<string>[]): Promise<(NewOrderResult | NewOrderError)[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected.
|
|
70
|
+
*/
|
|
71
|
+
modifyMultipleOrders(orders: ModifyFuturesOrderParams[]): Promise<(ModifyFuturesOrderResult | NewOrderError)[]>;
|
|
72
|
+
getOrderModifyHistory(params: GetOrderModifyHistoryParams): Promise<OrderAmendment[]>;
|
|
73
|
+
getOrder(params: GetOrderParams): Promise<OrderResult>;
|
|
74
|
+
cancelOrder(params: CancelOrderParams): Promise<CancelFuturesOrderResult>;
|
|
75
|
+
cancelAllOpenOrders(params: BasicSymbolParam): Promise<CancelAllOpenOrdersResult>;
|
|
76
|
+
cancelMultipleOrders(params: CancelMultipleOrdersParams): Promise<(CancelFuturesOrderResult | GenericCodeMsgError)[]>;
|
|
77
|
+
setCancelOrdersOnTimeout(params: CancelOrdersTimeoutParams): Promise<SetCancelTimeoutResult>;
|
|
78
|
+
getCurrentOpenOrder(params: GetOrderParams): Promise<OrderResult>;
|
|
79
|
+
getAllOpenOrders(params?: Partial<BasicSymbolParam>): Promise<OrderResult[]>;
|
|
80
|
+
getAllOrders(params: GetAllOrdersParams): Promise<OrderResult[]>;
|
|
81
|
+
getBalance(): Promise<FuturesCoinMAccountBalance[]>;
|
|
82
|
+
getAccountInformation(): Promise<FuturesCoinMAccountInformation>;
|
|
83
|
+
setLeverage(params: SetLeverageParams): Promise<SetLeverageResult>;
|
|
84
|
+
setMarginType(params: SetMarginTypeParams): Promise<ModeChangeResult>;
|
|
85
|
+
setIsolatedPositionMargin(params: SetIsolatedMarginParams): Promise<SetIsolatedMarginResult>;
|
|
86
|
+
getPositionMarginChangeHistory(params: GetPositionMarginChangeHistoryParams): Promise<any>;
|
|
19
87
|
getPositions(): Promise<PositionRisk[]>;
|
|
20
88
|
getAccountTrades(params: CoinMAccountTradeParams): Promise<CoinMPositionTrade[]>;
|
|
89
|
+
getIncomeHistory(params?: GetIncomeHistoryParams): Promise<IncomeHistory[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Notional Bracket for Symbol (NOT "pair")
|
|
92
|
+
*/
|
|
93
|
+
getNotionalAndLeverageBrackets(params?: Partial<BasicSymbolParam>): Promise<SymbolLeverageBracketsResult[] | SymbolLeverageBracketsResult>;
|
|
94
|
+
getForceOrders(params?: GetForceOrdersParams): Promise<ForceOrderResult[]>;
|
|
95
|
+
getADLQuantileEstimation(params?: Partial<BasicSymbolParam>): Promise<any>;
|
|
96
|
+
getAccountComissionRate(params: BasicSymbolParam): Promise<RebateDataOverview>;
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* Broker Futures Endpoints
|
|
100
|
+
*
|
|
101
|
+
**/
|
|
102
|
+
getBrokerIfNewFuturesUser(brokerId: string, type?: 1 | 2): Promise<{
|
|
103
|
+
brokerId: string;
|
|
104
|
+
rebateWorking: boolean;
|
|
105
|
+
ifNewUser: boolean;
|
|
106
|
+
}>;
|
|
107
|
+
setBrokerCustomIdForClient(customerId: string, email: string): Promise<{
|
|
108
|
+
customerId: string;
|
|
109
|
+
email: string;
|
|
110
|
+
}>;
|
|
111
|
+
getBrokerClientCustomIds(customerId: string, email: string, page?: number, limit?: number): Promise<any>;
|
|
112
|
+
getBrokerUserCustomId(brokerId: string): Promise<any>;
|
|
113
|
+
getBrokerRebateDataOverview(type?: 1 | 2): Promise<RebateDataOverview>;
|
|
114
|
+
getBrokerUserTradeVolume(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>;
|
|
115
|
+
getBrokerRebateVolume(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>;
|
|
116
|
+
getBrokerTradeDetail(type?: 1 | 2, startTime?: number, endTime?: number, limit?: number): Promise<any>;
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* User Data Stream Endpoints
|
|
120
|
+
*
|
|
121
|
+
**/
|
|
122
|
+
getFuturesUserDataListenKey(): Promise<{
|
|
123
|
+
listenKey: string;
|
|
124
|
+
}>;
|
|
125
|
+
keepAliveFuturesUserDataListenKey(): Promise<{}>;
|
|
126
|
+
closeFuturesUserDataListenKey(): Promise<{}>;
|
|
127
|
+
/**
|
|
128
|
+
* Validate syntax meets requirements set by binance. Log warning if not.
|
|
129
|
+
*/
|
|
130
|
+
private validateOrderId;
|
|
21
131
|
}
|
package/lib/coinm-client.js
CHANGED
|
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CoinMClient = void 0;
|
|
16
|
-
const BaseRestClient_1 = __importDefault(require("./util/BaseRestClient"));
|
|
17
16
|
const requestUtils_1 = require("./util/requestUtils");
|
|
17
|
+
const BaseRestClient_1 = __importDefault(require("./util/BaseRestClient"));
|
|
18
18
|
class CoinMClient extends BaseRestClient_1.default {
|
|
19
19
|
constructor(restClientOptions = {}, requestOptions = {}, useTestnet) {
|
|
20
20
|
const clientId = useTestnet ? 'coinmtest' : 'coinm';
|
|
@@ -30,97 +30,294 @@ class CoinMClient extends BaseRestClient_1.default {
|
|
|
30
30
|
return this.get(requestUtils_1.getServerTimeEndpoint(this.clientId)).then((response) => response.serverTime);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* Market Data Endpoints
|
|
36
|
+
*
|
|
37
|
+
**/
|
|
38
|
+
testConnectivity() {
|
|
39
|
+
return this.get('dapi/v1/ping');
|
|
40
|
+
}
|
|
41
|
+
getExchangeInfo() {
|
|
42
|
+
return this.get('dapi/v1/exchangeInfo');
|
|
43
|
+
}
|
|
44
|
+
getOrderBook(params) {
|
|
45
|
+
return this.get('dapi/v1/depth', params);
|
|
46
|
+
}
|
|
47
|
+
getRecentTrades(params) {
|
|
48
|
+
return this.get('dapi/v1/trades', params);
|
|
49
|
+
}
|
|
50
|
+
getHistoricalTrades(params) {
|
|
51
|
+
return this.get('dapi/v1/historicalTrades', params);
|
|
52
|
+
}
|
|
53
|
+
getAggregateTrades(params) {
|
|
54
|
+
return this.get('dapi/v1/aggTrades', params);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Index Price and Mark Price
|
|
58
|
+
*/
|
|
59
|
+
getMarkPrice(params) {
|
|
60
|
+
return this.get('dapi/v1/premiumIndex', params);
|
|
61
|
+
}
|
|
62
|
+
getFundingRateHistory(params) {
|
|
63
|
+
return this.get('dapi/v1/fundingRate', params);
|
|
64
|
+
}
|
|
65
|
+
getKlines(params) {
|
|
66
|
+
return this.get('dapi/v1/klines', params);
|
|
67
|
+
}
|
|
68
|
+
getContinuousContractKlines(params) {
|
|
69
|
+
return this.get('dapi/v1/continuousKlines', params);
|
|
70
|
+
}
|
|
71
|
+
getIndexPriceKlines(params) {
|
|
72
|
+
return this.get('dapi/v1/indexPriceKlines', params);
|
|
73
|
+
}
|
|
74
|
+
getMarkPriceKlines(params) {
|
|
75
|
+
return this.get('dapi/v1/markPriceKlines', params);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated use get24hrChangeStatistics() instead (method without the typo)
|
|
79
|
+
*/
|
|
80
|
+
get24hrChangeStatististics(params) {
|
|
81
|
+
return this.get24hrChangeStatistics(params);
|
|
82
|
+
}
|
|
83
|
+
get24hrChangeStatistics(params) {
|
|
84
|
+
return this.get('dapi/v1/ticker/24hr', params);
|
|
85
|
+
}
|
|
86
|
+
getSymbolPriceTicker(params) {
|
|
87
|
+
return this.get('dapi/v1/ticker/price', params);
|
|
35
88
|
}
|
|
36
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#change-log
|
|
37
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#general-info
|
|
38
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#testnet
|
|
39
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#general-api-information
|
|
40
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#limits
|
|
41
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#endpoint-security-type
|
|
42
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#signed-trade-and-user_data-endpoint-security
|
|
43
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#public-endpoints-info
|
|
44
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#filters
|
|
45
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#market-data-endpoints
|
|
46
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#test-connectivity
|
|
47
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#check-server-time
|
|
48
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#exchange-information
|
|
49
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#order-book
|
|
50
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#recent-trades-list
|
|
51
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#old-trades-lookup-market_data
|
|
52
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#compressed-aggregate-trades-list
|
|
53
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
54
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures
|
|
55
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
|
|
56
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#continuous-contract-kline-candlestick-data
|
|
57
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#index-price-kline-candlestick-data
|
|
58
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-data
|
|
59
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#24hr-ticker-price-change-statistics
|
|
60
|
-
//TODO - https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-ticker
|
|
61
89
|
getSymbolOrderBookTicker(params) {
|
|
62
90
|
return this.get('dapi/v1/ticker/bookTicker', params).then((e) => requestUtils_1.asArray(e));
|
|
63
91
|
}
|
|
64
92
|
getOpenInterest(params) {
|
|
65
93
|
return this.get('dapi/v1/openInterest', params);
|
|
66
94
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
95
|
+
getOpenInterestStatistics(params) {
|
|
96
|
+
return this.get('futures/data/openInterestHist', params);
|
|
97
|
+
}
|
|
98
|
+
getTopTradersLongShortAccountRatio(params) {
|
|
99
|
+
return this.get('futures/data/topLongShortAccountRatio', params);
|
|
100
|
+
}
|
|
101
|
+
getTopTradersLongShortPositionRatio(params) {
|
|
102
|
+
return this.get('futures/data/topLongShortPositionRatio', params);
|
|
103
|
+
}
|
|
104
|
+
getGlobalLongShortAccountRatio(params) {
|
|
105
|
+
return this.get('futures/data/globalLongShortAccountRatio', params);
|
|
106
|
+
}
|
|
107
|
+
getTakerBuySellVolume(params) {
|
|
108
|
+
return this.get('futures/data/takerBuySellVol', params);
|
|
109
|
+
}
|
|
110
|
+
getCompositeSymbolIndex(params) {
|
|
111
|
+
return this.get('futures/data/basis', params);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* USD-Futures Account/Trade Endpoints
|
|
116
|
+
*
|
|
117
|
+
**/
|
|
118
|
+
setPositionMode(params) {
|
|
119
|
+
return this.postPrivate('dapi/v1/positionSide/dual', params);
|
|
120
|
+
}
|
|
121
|
+
getCurrentPositionMode() {
|
|
122
|
+
return this.getPrivate('dapi/v1/positionSide/dual');
|
|
123
|
+
}
|
|
124
|
+
submitNewOrder(params) {
|
|
125
|
+
this.validateOrderId(params, 'newClientOrderId');
|
|
126
|
+
return this.postPrivate('dapi/v1/order', params);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
|
|
130
|
+
*/
|
|
131
|
+
modifyOrder(params) {
|
|
132
|
+
return this.putPrivate('dapi/v1/order', params);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected.
|
|
136
|
+
*
|
|
137
|
+
* Known issue: `quantity` and `price` should be sent as strings
|
|
138
|
+
*/
|
|
139
|
+
submitMultipleOrders(orders) {
|
|
140
|
+
const stringOrders = orders.map((order) => {
|
|
141
|
+
const orderToStringify = Object.assign({}, order);
|
|
142
|
+
this.validateOrderId(orderToStringify, 'newClientOrderId');
|
|
143
|
+
return JSON.stringify(orderToStringify);
|
|
144
|
+
});
|
|
145
|
+
const requestBody = {
|
|
146
|
+
batchOrders: `[${stringOrders.join(',')}]`,
|
|
147
|
+
};
|
|
148
|
+
return this.postPrivate('dapi/v1/batchOrders', requestBody);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Warning: max 5 orders at a time! This method does not throw, instead it returns individual errors in the response array if any orders were rejected.
|
|
152
|
+
*/
|
|
153
|
+
modifyMultipleOrders(orders) {
|
|
154
|
+
const stringOrders = orders.map((order) => {
|
|
155
|
+
const orderToStringify = Object.assign({}, order);
|
|
156
|
+
return JSON.stringify(orderToStringify);
|
|
157
|
+
});
|
|
158
|
+
const requestBody = {
|
|
159
|
+
batchOrders: `[${stringOrders.join(',')}]`,
|
|
160
|
+
};
|
|
161
|
+
return this.putPrivate('dapi/v1/batchOrders', requestBody);
|
|
162
|
+
}
|
|
163
|
+
getOrderModifyHistory(params) {
|
|
164
|
+
return this.getPrivate('dapi/v1/orderAmendment', params);
|
|
165
|
+
}
|
|
166
|
+
getOrder(params) {
|
|
167
|
+
return this.getPrivate('dapi/v1/order', params);
|
|
168
|
+
}
|
|
169
|
+
cancelOrder(params) {
|
|
170
|
+
return this.deletePrivate('dapi/v1/order', params);
|
|
171
|
+
}
|
|
172
|
+
cancelAllOpenOrders(params) {
|
|
173
|
+
return this.deletePrivate('dapi/v1/allOpenOrders', params);
|
|
174
|
+
}
|
|
175
|
+
cancelMultipleOrders(params) {
|
|
176
|
+
return this.deletePrivate('dapi/v1/batchOrders', params);
|
|
177
|
+
}
|
|
178
|
+
// Auto-cancel all open orders
|
|
179
|
+
setCancelOrdersOnTimeout(params) {
|
|
180
|
+
return this.postPrivate('dapi/v1/countdownCancelAll', params);
|
|
181
|
+
}
|
|
182
|
+
getCurrentOpenOrder(params) {
|
|
183
|
+
return this.getPrivate('dapi/v1/openOrder', params);
|
|
184
|
+
}
|
|
185
|
+
getAllOpenOrders(params) {
|
|
186
|
+
return this.getPrivate('dapi/v1/openOrders', params);
|
|
187
|
+
}
|
|
188
|
+
getAllOrders(params) {
|
|
189
|
+
return this.getPrivate('dapi/v1/allOrders', params);
|
|
190
|
+
}
|
|
191
|
+
getBalance() {
|
|
192
|
+
return this.getPrivate('dapi/v1/balance');
|
|
193
|
+
}
|
|
194
|
+
getAccountInformation() {
|
|
195
|
+
return this.getPrivate('dapi/v1/account');
|
|
196
|
+
}
|
|
197
|
+
setLeverage(params) {
|
|
198
|
+
return this.postPrivate('dapi/v1/leverage', params);
|
|
199
|
+
}
|
|
200
|
+
setMarginType(params) {
|
|
201
|
+
return this.postPrivate('dapi/v1/marginType', params);
|
|
202
|
+
}
|
|
203
|
+
setIsolatedPositionMargin(params) {
|
|
204
|
+
return this.postPrivate('dapi/v1/positionMargin', params);
|
|
205
|
+
}
|
|
206
|
+
getPositionMarginChangeHistory(params) {
|
|
207
|
+
return this.getPrivate('dapi/v1/positionMargin/history', params);
|
|
208
|
+
}
|
|
118
209
|
getPositions() {
|
|
119
210
|
return this.getPrivate('dapi/v1/positionRisk');
|
|
120
211
|
}
|
|
121
212
|
getAccountTrades(params) {
|
|
122
213
|
return this.getPrivate('dapi/v1/userTrades', params);
|
|
123
214
|
}
|
|
215
|
+
getIncomeHistory(params) {
|
|
216
|
+
return this.getPrivate('dapi/v1/income', params);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Notional Bracket for Symbol (NOT "pair")
|
|
220
|
+
*/
|
|
221
|
+
getNotionalAndLeverageBrackets(params) {
|
|
222
|
+
return this.getPrivate('dapi/v2/leverageBracket', params);
|
|
223
|
+
}
|
|
224
|
+
getForceOrders(params) {
|
|
225
|
+
return this.getPrivate('dapi/v1/forceOrders', params);
|
|
226
|
+
}
|
|
227
|
+
getADLQuantileEstimation(params) {
|
|
228
|
+
return this.getPrivate('dapi/v1/adlQuantile', params);
|
|
229
|
+
}
|
|
230
|
+
getAccountComissionRate(params) {
|
|
231
|
+
return this.getPrivate('dapi/v1/commissionRate', params);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
*
|
|
235
|
+
* Broker Futures Endpoints
|
|
236
|
+
*
|
|
237
|
+
**/
|
|
238
|
+
// 1 == USDT-Margined, 2 == Coin-margined
|
|
239
|
+
getBrokerIfNewFuturesUser(brokerId, type = 1) {
|
|
240
|
+
return this.getPrivate('dapi/v1/apiReferral/ifNewUser', {
|
|
241
|
+
brokerId,
|
|
242
|
+
type,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
setBrokerCustomIdForClient(customerId, email) {
|
|
246
|
+
return this.postPrivate('dapi/v1/apiReferral/customization', {
|
|
247
|
+
customerId,
|
|
248
|
+
email,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
getBrokerClientCustomIds(customerId, email, page, limit) {
|
|
252
|
+
return this.getPrivate('dapi/v1/apiReferral/customization', {
|
|
253
|
+
customerId,
|
|
254
|
+
email,
|
|
255
|
+
page,
|
|
256
|
+
limit,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
getBrokerUserCustomId(brokerId) {
|
|
260
|
+
return this.getPrivate('dapi/v1/apiReferral/userCustomization', {
|
|
261
|
+
brokerId,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
getBrokerRebateDataOverview(type = 1) {
|
|
265
|
+
return this.getPrivate('dapi/v1/apiReferral/overview', {
|
|
266
|
+
type,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
getBrokerUserTradeVolume(type = 1, startTime, endTime, limit) {
|
|
270
|
+
return this.getPrivate('dapi/v1/apiReferral/tradeVol', {
|
|
271
|
+
type,
|
|
272
|
+
startTime,
|
|
273
|
+
endTime,
|
|
274
|
+
limit,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
getBrokerRebateVolume(type = 1, startTime, endTime, limit) {
|
|
278
|
+
return this.getPrivate('dapi/v1/apiReferral/rebateVol', {
|
|
279
|
+
type,
|
|
280
|
+
startTime,
|
|
281
|
+
endTime,
|
|
282
|
+
limit,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
getBrokerTradeDetail(type = 1, startTime, endTime, limit) {
|
|
286
|
+
return this.getPrivate('dapi/v1/apiReferral/traderSummary', {
|
|
287
|
+
type,
|
|
288
|
+
startTime,
|
|
289
|
+
endTime,
|
|
290
|
+
limit,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* User Data Stream Endpoints
|
|
296
|
+
*
|
|
297
|
+
**/
|
|
298
|
+
getFuturesUserDataListenKey() {
|
|
299
|
+
return this.post('dapi/v1/listenKey');
|
|
300
|
+
}
|
|
301
|
+
keepAliveFuturesUserDataListenKey() {
|
|
302
|
+
return this.put('dapi/v1/listenKey');
|
|
303
|
+
}
|
|
304
|
+
closeFuturesUserDataListenKey() {
|
|
305
|
+
return this.delete('dapi/v1/listenKey');
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Validate syntax meets requirements set by binance. Log warning if not.
|
|
309
|
+
*/
|
|
310
|
+
validateOrderId(params, orderIdProperty) {
|
|
311
|
+
const apiCategory = this.clientId;
|
|
312
|
+
if (!params[orderIdProperty]) {
|
|
313
|
+
params[orderIdProperty] = requestUtils_1.generateNewOrderId(apiCategory);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const expectedOrderIdPrefix = `x-${requestUtils_1.getOrderIdPrefix(apiCategory)}`;
|
|
317
|
+
if (!params[orderIdProperty].startsWith(expectedOrderIdPrefix)) {
|
|
318
|
+
requestUtils_1.logInvalidOrderId(orderIdProperty, expectedOrderIdPrefix, params);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
124
321
|
}
|
|
125
322
|
exports.CoinMClient = CoinMClient;
|
|
126
323
|
//# sourceMappingURL=coinm-client.js.map
|
package/lib/coinm-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinm-client.js","sourceRoot":"","sources":["../src/coinm-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"coinm-client.js","sourceRoot":"","sources":["../src/coinm-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA2EA,sDAO6B;AAE7B,2EAAmD;AAEnD,MAAa,WAAY,SAAQ,wBAAc;IAG7C,YACE,oBAAuC,EAAE,EACzC,iBAAqC,EAAE,EACvC,UAAoB;QAEpB,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;QAEpD,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC;QAEnD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACG,aAAa;;YACjB,OAAO,IAAI,CAAC,GAAG,CAAC,oCAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CACxD,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAClC,CAAC;QACJ,CAAC;KAAA;IAED;;;;QAII;IAEJ,gBAAgB;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAClC,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,YAAY,CAAC,MAAuB;QAClC,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,eAAe,CAAC,MAA0B;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,mBAAmB,CACjB,MAA8B;QAE9B,OAAO,IAAI,CAAC,GAAG,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAA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,GAAG,IAAI,CAAC,QAAQ,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;YAC5B,MAAM,CAAC,eAAe,CAAC,GAAG,iCAAkB,CAAC,WAAW,CAAC,CAAC;YAC1D,OAAO;SACR;QAED,MAAM,qBAAqB,GAAG,KAAK,+BAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE;YAC9D,gCAAiB,CAAC,eAAe,EAAE,qBAAqB,EAAE,MAAM,CAAC,CAAC;SACnE;IACH,CAAC;CACF;AAndD,kCAmdC"}
|
package/lib/main-client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import { BasicAssetPaginatedParams, BasicAssetParam, BasicSymbolParam, BinanceBaseUrlKey, CancelOCOParams, CancelOrderParams, ExchangeSymbol, GetAllOrdersParams, GetOrderParams, HistoricalTradesParams, KlinesParams, Kline, NewOCOParams, OrderBookParams, RecentTradesParams, SymbolFromPaginatedRequestFromId } from './types/shared';
|
|
3
|
-
import { AccountInformation, AddBSwapLiquidityParams, AggregateTrade, AllCoinsInformationResponse, ApiKeyBrokerSubAccount, APIPermissions, APITradingStatus, AssetDetail, BasicBSwapResp, BasicFromPaginatedParams, BasicFuturesSubAccountParams, BasicMarginAssetParams, BasicSubAccount, BasicTimeRangeParam, BrokerSubAccount, BrokerSubAccountHistory, BrokerSubAccountDepositHistory, BSwapLiquidity, BSwapOperations, BSwapOperationsParams, CancelSpotOrderResult, ChangePermissionApiKeyBrokerSubAccountParams, ChangePermissionApiKeyBrokerSubAccountResponse, ConvertDustParams, CreateApiKeyBrokerSubAccountParams, CreateApiKeyBrokerSubAccountResponse, CreateBrokerSubAccountParams, CreateSubAccountParams, CrossMarginAccountTransferParams, CurrentAvgPrice, DailyAccountSnapshot, DailyAccountSnapshotParams, DailyChangeStatistic, DeleteApiKeyBrokerSubAccountParams, DepositAddressParams, DepositAddressResponse, DepositHistory, DepositHistoryParams, DustConversion, DustInfo, DustLog, EnableFuturesBrokerSubAccountParams, EnableFuturesBrokerSubAccountResponse, EnableMarginApiKeyBrokerSubAccountParams, EnableMarginBrokerSubAccountParams, EnableMarginBrokerSubAccountResponse, EnableOrDisableIPRestrictionForSubAccountParams, EnableUniversalTransferApiKeyBrokerSubAccountParams, EnableUniversalTransferApiKeyBrokerSubAccountResponse, ExchangeInfo, ExchangeInfoParams, FixedAndActivityProjectParams, FixedAndActivityProjectPositionParams, FlexibleSavingBasicParams, FuturesPositionRisk, GetApiKeyBrokerSubAccountParams, GetBrokerInfoResponse, GetBrokerSubAccountParams, GetBrokerSubAccountHistoryParams, GetBrokerSubAccountDepositHistoryParams, GetOCOParams, GetUniversalTransferBrokerParams, IsolatedMarginAccountInfo, IsolatedMarginAccountTransferParams, LeftDailyPurchaseQuotaFlexibleProductResponse, MarginAccountLoanParams, MarginRecordResponse, MarginTransactionResponse, NewSpotOrderParams, OrderBookResponse, OrderResponseACK, OrderResponseFull, OrderResponseResult, TransferBrokerSubAccountParams, TransferBrokerSubAccount, PurchaseFlexibleProductParams, PurchaseFlexibleProductResponse, PurchaseRecordParams, QueryCrossMarginAccountDetailsParams, QueryCrossMarginPairParams, QueryCrossMarginPairResponse, QueryMarginAssetParams, QueryMarginAssetResponse, QueryMarginPriceIndexResponse, QueryMarginRecordParams, QueryMaxBorrowResponse, QueryMaxTransferOutAmountResponse, RawAccountTrade, RawTrade, RedeemFlexibleProductParams, RemoveBSwapLiquidityParams, SpotOrder, StakingBasicParams, StakingHistory, StakingHistoryParams, StakingPersonalLeftQuota, StakingProduct, StakingProductPosition, StakingProductType, SubAccountAddOrDeleteIPList, SubAccountAssetDetails, SubAccountAssets, SubAccountAssetsParams, SubAccountCOINMDetail, SubAccountCOINMPositionRisk, SubAccountCOINMSummary, SubAccountDepositAddress, SubAccountDepositAddressParams, SubAccountDepositHistoryParams, SubAccountEnableFutures, SubAccountEnableLeverageToken, SubAccountEnableMargin, SubAccountFuturesAccountDetail, SubAccountFuturesAccountSummary, SubAccountFuturesAssetTransfer, SubAccountFuturesAssetTransferHistory, SubAccountFuturesAssetTransferHistoryParams, SubAccountFuturesAssetTransferParams, SubAccountListParams, SubAccountListResponse, SubAccountMarginAccountDetail, SubAccountnableOrDisableIPRestriction, SubAccountsMarginAccountSummary, SubAccountSpotAssetsSummary, SubAccountSpotAssetsSummaryParams, SubAccountSpotAssetTransferHistory, SubAccountSpotAssetTransferHistoryParams, SubAccountStatus, SubAccountSummaryOnFuturesAccountV2Params, SubAccountTransfer, SubAccountTransferHistory, SubAccountTransferHistoryParams, SubAccountTransferParams, SubAccountTransferToMasterParams, SubAccountTransferToSameMasterParams, SubAccountUniversalTransfer, SubAccountUniversalTransferHistoryParams, SubAccountUniversalTransferHistoryResponse, SubAccountUniversalTransferParams, SubAccountUSDMDetail, SubAccountUSDMPositionRisk, SubAccountUSDMSummary, SymbolOrderBookTicker,
|
|
2
|
+
import { BasicAssetPaginatedParams, BasicAssetParam, BasicSymbolParam, BinanceBaseUrlKey, CancelOCOParams, CancelOrderParams, ExchangeSymbol, GetAllOrdersParams, GetOrderParams, HistoricalTradesParams, KlinesParams, Kline, NewOCOParams, OrderBookParams, RecentTradesParams, SymbolFromPaginatedRequestFromId, SymbolPrice } from './types/shared';
|
|
3
|
+
import { AccountInformation, AddBSwapLiquidityParams, AggregateTrade, AllCoinsInformationResponse, ApiKeyBrokerSubAccount, APIPermissions, APITradingStatus, AssetDetail, BasicBSwapResp, BasicFromPaginatedParams, BasicFuturesSubAccountParams, BasicMarginAssetParams, BasicSubAccount, BasicTimeRangeParam, BrokerSubAccount, BrokerSubAccountHistory, BrokerSubAccountDepositHistory, BSwapLiquidity, BSwapOperations, BSwapOperationsParams, CancelSpotOrderResult, ChangePermissionApiKeyBrokerSubAccountParams, ChangePermissionApiKeyBrokerSubAccountResponse, ConvertDustParams, CreateApiKeyBrokerSubAccountParams, CreateApiKeyBrokerSubAccountResponse, CreateBrokerSubAccountParams, CreateSubAccountParams, CrossMarginAccountTransferParams, CurrentAvgPrice, DailyAccountSnapshot, DailyAccountSnapshotParams, DailyChangeStatistic, DeleteApiKeyBrokerSubAccountParams, DepositAddressParams, DepositAddressResponse, DepositHistory, DepositHistoryParams, DustConversion, DustInfo, DustLog, EnableFuturesBrokerSubAccountParams, EnableFuturesBrokerSubAccountResponse, EnableMarginApiKeyBrokerSubAccountParams, EnableMarginBrokerSubAccountParams, EnableMarginBrokerSubAccountResponse, EnableOrDisableIPRestrictionForSubAccountParams, EnableUniversalTransferApiKeyBrokerSubAccountParams, EnableUniversalTransferApiKeyBrokerSubAccountResponse, ExchangeInfo, ExchangeInfoParams, FixedAndActivityProjectParams, FixedAndActivityProjectPositionParams, FlexibleSavingBasicParams, FuturesPositionRisk, GetApiKeyBrokerSubAccountParams, GetBrokerInfoResponse, GetBrokerSubAccountParams, GetBrokerSubAccountHistoryParams, GetBrokerSubAccountDepositHistoryParams, GetOCOParams, GetUniversalTransferBrokerParams, IsolatedMarginAccountInfo, IsolatedMarginAccountTransferParams, LeftDailyPurchaseQuotaFlexibleProductResponse, MarginAccountLoanParams, MarginRecordResponse, MarginTransactionResponse, NewSpotOrderParams, OrderBookResponse, OrderResponseACK, OrderResponseFull, OrderResponseResult, TransferBrokerSubAccountParams, TransferBrokerSubAccount, PurchaseFlexibleProductParams, PurchaseFlexibleProductResponse, PurchaseRecordParams, QueryCrossMarginAccountDetailsParams, QueryCrossMarginPairParams, QueryCrossMarginPairResponse, QueryMarginAssetParams, QueryMarginAssetResponse, QueryMarginPriceIndexResponse, QueryMarginRecordParams, QueryMaxBorrowResponse, QueryMaxTransferOutAmountResponse, RawAccountTrade, RawTrade, RedeemFlexibleProductParams, RemoveBSwapLiquidityParams, SpotOrder, StakingBasicParams, StakingHistory, StakingHistoryParams, StakingPersonalLeftQuota, StakingProduct, StakingProductPosition, StakingProductType, SubAccountAddOrDeleteIPList, SubAccountAssetDetails, SubAccountAssets, SubAccountAssetsParams, SubAccountCOINMDetail, SubAccountCOINMPositionRisk, SubAccountCOINMSummary, SubAccountDepositAddress, SubAccountDepositAddressParams, SubAccountDepositHistoryParams, SubAccountEnableFutures, SubAccountEnableLeverageToken, SubAccountEnableMargin, SubAccountFuturesAccountDetail, SubAccountFuturesAccountSummary, SubAccountFuturesAssetTransfer, SubAccountFuturesAssetTransferHistory, SubAccountFuturesAssetTransferHistoryParams, SubAccountFuturesAssetTransferParams, SubAccountListParams, SubAccountListResponse, SubAccountMarginAccountDetail, SubAccountnableOrDisableIPRestriction, SubAccountsMarginAccountSummary, SubAccountSpotAssetsSummary, SubAccountSpotAssetsSummaryParams, SubAccountSpotAssetTransferHistory, SubAccountSpotAssetTransferHistoryParams, SubAccountStatus, SubAccountSummaryOnFuturesAccountV2Params, SubAccountTransfer, SubAccountTransferHistory, SubAccountTransferHistoryParams, SubAccountTransferParams, SubAccountTransferToMasterParams, SubAccountTransferToSameMasterParams, SubAccountUniversalTransfer, SubAccountUniversalTransferHistoryParams, SubAccountUniversalTransferHistoryResponse, SubAccountUniversalTransferParams, SubAccountUSDMDetail, SubAccountUSDMPositionRisk, SubAccountUSDMSummary, SymbolOrderBookTicker, SymbolTradeFee, SystemStatusResponse, UniversalTransferBrokerParams, UniversalTransferHistoryParams, UniversalTransferParams, VirtualSubAccount, WithdrawAssetsFromManagedSubAccountParams, WithdrawHistory, WithdrawHistoryParams, WithdrawParams } from './types/spot';
|
|
4
4
|
import { RestClientOptions } from './util/requestUtils';
|
|
5
5
|
import BaseRestClient from './util/BaseRestClient';
|
|
6
6
|
export declare class MainClient extends BaseRestClient {
|