binance 2.12.3 → 2.13.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.
@@ -44,1258 +44,1428 @@ class MainClient extends BaseRestClient_1.default {
44
44
  }
45
45
  /**
46
46
  *
47
- * Wallet Endpoints
47
+ * SPOT TRADING Endpoints - General endpoints
48
48
  *
49
49
  **/
50
- getSystemStatus() {
51
- return this.get('sapi/v1/system/status');
52
- }
53
- getBalances() {
54
- return this.getPrivate('sapi/v1/capital/config/getall');
55
- }
56
- getDailyAccountSnapshot(params) {
57
- return this.getPrivate('sapi/v1/accountSnapshot', params);
58
- }
59
- disableFastWithdrawSwitch() {
60
- return this.postPrivate('sapi/v1/account/disableFastWithdrawSwitch');
50
+ testConnectivity() {
51
+ return this.get('api/v3/ping');
61
52
  }
62
- enableFastWithdrawSwitch() {
63
- return this.postPrivate('sapi/v1/account/enableFastWithdrawSwitch');
53
+ getExchangeInfo(params) {
54
+ const symbols = (params === null || params === void 0 ? void 0 : params.symbols) && JSON.stringify(params.symbols);
55
+ const symbol = params === null || params === void 0 ? void 0 : params.symbol;
56
+ let urlSuffix = '';
57
+ if (symbol) {
58
+ urlSuffix += '?symbol=' + symbol;
59
+ }
60
+ else if (symbols) {
61
+ urlSuffix += '?symbols=' + symbols;
62
+ }
63
+ return this.get('api/v3/exchangeInfo' + urlSuffix);
64
64
  }
65
- withdraw(params) {
66
- return this.postPrivate('sapi/v1/capital/withdraw/apply', params);
65
+ /**
66
+ *
67
+ * SPOT TRADING Endpoints - Market endpoints
68
+ *
69
+ **/
70
+ getOrderBook(params) {
71
+ return this.get('api/v3/depth', params);
67
72
  }
68
- getDepositHistory(params) {
69
- return this.getPrivate('sapi/v1/capital/deposit/hisrec', params);
73
+ getRecentTrades(params) {
74
+ return this.get('api/v3/trades', params);
70
75
  }
71
- getWithdrawHistory(params) {
72
- return this.getPrivate('sapi/v1/capital/withdraw/history', params);
76
+ getHistoricalTrades(params) {
77
+ return this.get('api/v3/historicalTrades', params);
73
78
  }
74
- getDepositAddress(params) {
75
- return this.getPrivate('sapi/v1/capital/deposit/address', params);
79
+ getAggregateTrades(params) {
80
+ return this.get('api/v3/aggTrades', params);
76
81
  }
77
- getAccountStatus() {
78
- return this.getPrivate('sapi/v1/account/status');
82
+ getKlines(params) {
83
+ return this.get('api/v3/klines', params);
79
84
  }
80
- getDustLog(params) {
81
- return this.getPrivate('sapi/v1/asset/dribblet', params);
85
+ getUIKlines(params) {
86
+ return this.get('api/v3/uiKlines', params);
82
87
  }
83
- convertDustToBnb(params) {
84
- return this.postPrivate('sapi/v1/asset/dust', params);
88
+ getAvgPrice(params) {
89
+ return this.get('api/v3/avgPrice', params);
85
90
  }
86
- getDust() {
87
- return this.postPrivate('sapi/v1/asset/dust-btc');
91
+ get24hrChangeStatististics(params) {
92
+ if (params && typeof params['symbol'] === 'string') {
93
+ return this.get('api/v3/ticker/24hr', params);
94
+ }
95
+ if (params && params['symbols'] && Array.isArray(params['symbols'])) {
96
+ const symbols = params.symbols;
97
+ const symbolsQueryParam = JSON.stringify(symbols);
98
+ return this.get('api/v3/ticker/24hr?symbols=' + symbolsQueryParam);
99
+ }
100
+ return this.get('api/v3/ticker/24hr');
88
101
  }
89
- getAssetDividendRecord(params) {
90
- return this.getPrivate('sapi/v1/asset/assetDividend', params);
102
+ getTradingDayTicker(params) {
103
+ return this.get('api/v3/ticker/tradingDay', params);
91
104
  }
92
- getAssetDetail(params) {
93
- return this.getPrivate('sapi/v1/asset/assetDetail', params);
105
+ getSymbolPriceTicker(params) {
106
+ return this.get('api/v3/ticker/price', params);
94
107
  }
95
- getTradeFee(params) {
96
- return this.getPrivate('sapi/v1/asset/tradeFee', params);
108
+ getSymbolOrderBookTicker(params) {
109
+ return this.get('api/v3/ticker/bookTicker', params);
97
110
  }
98
- submitUniversalTransfer(params) {
99
- return this.postPrivate('sapi/v1/asset/transfer', params);
111
+ getRollingWindowTicker(params) {
112
+ return this.get('api/v3/ticker', params);
100
113
  }
101
- getUniversalTransferHistory(params) {
102
- return this.getPrivate('sapi/v1/asset/transfer', params);
114
+ /**
115
+ *
116
+ * SPOT TRADING Endpoints - Trading endpoints
117
+ *
118
+ **/
119
+ submitNewOrder(params) {
120
+ this.validateOrderId(params, 'newClientOrderId');
121
+ return this.postPrivate('api/v3/order', params);
103
122
  }
104
- getApiTradingStatus() {
105
- return this.getPrivate('sapi/v1/account/apiTradingStatus');
123
+ testNewOrder(params) {
124
+ this.validateOrderId(params, 'newClientOrderId');
125
+ return this.postPrivate('api/v3/order/test', params);
106
126
  }
107
- getApiKeyPermissions() {
108
- return this.getPrivate('sapi/v1/account/apiRestrictions');
127
+ getOrder(params) {
128
+ return this.getPrivate('api/v3/order', params);
109
129
  }
110
- enableConvertSubAccount(params) {
111
- return this.postPrivate('sapi/v1/broker/subAccount/convert', params);
130
+ cancelOrder(params) {
131
+ return this.deletePrivate('api/v3/order', params);
112
132
  }
113
- getFundingAsset(params) {
114
- return this.postPrivate('sapi/v1/asset/get-funding-asset', params);
133
+ cancelAllSymbolOrders(params) {
134
+ return this.deletePrivate('api/v3/openOrders', params);
115
135
  }
116
- getUserAsset(params) {
117
- return this.postPrivate('sapi/v3/asset/getUserAsset', params);
136
+ replaceOrder(params) {
137
+ return this.postPrivate('api/v3/order/cancelReplace', params);
118
138
  }
119
- convertBUSD(params) {
120
- return this.postPrivate('sapi/v1/asset/convert-transfer', params);
139
+ getOpenOrders(params) {
140
+ return this.getPrivate('api/v3/openOrders', params);
121
141
  }
122
- getConvertBUSDHistory(params) {
123
- return this.getPrivate('sapi/v1/asset/convert-transfer/queryByPage', params);
142
+ getAllOrders(params) {
143
+ return this.getPrivate('api/v3/allOrders', params);
124
144
  }
125
- getCloudMiningHistory(params) {
126
- return this.getPrivate('sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage', params);
145
+ /**
146
+ * @deprecated
147
+ */
148
+ submitNewOCO(params) {
149
+ this.validateOrderId(params, 'listClientOrderId');
150
+ this.validateOrderId(params, 'limitClientOrderId');
151
+ this.validateOrderId(params, 'stopClientOrderId');
152
+ return this.postPrivate('api/v3/order/oco', params);
127
153
  }
128
- getAutoConvertStablecoins() {
129
- return this.getPrivate('sapi/v1/capital/contract/convertible-coins');
154
+ submitNewOrderList(params) {
155
+ this.validateOrderId(params, 'listClientOrderId');
156
+ this.validateOrderId(params, 'aboveClientOrderId');
157
+ this.validateOrderId(params, 'belowClientOrderId');
158
+ return this.postPrivate('api/v3/orderList/oco', params);
130
159
  }
131
- setConvertibleCoins(params) {
132
- return this.postPrivate('sapi/v1/capital/contract/convertible-coins', params);
160
+ // TO CHECK!!
161
+ submitNewOrderListOTO(params) {
162
+ this.validateOrderId(params, 'listClientOrderId');
163
+ this.validateOrderId(params, 'workingClientOrderId');
164
+ this.validateOrderId(params, 'pendingClientOrderId');
165
+ return this.postPrivate('api/v3/orderList/oto', params);
133
166
  }
134
- submitDepositCredit(params) {
135
- return this.postPrivate('sapi/v1/capital/deposit/credit-apply', params);
167
+ // TO CHECK!!
168
+ submitNewOrderListOTOCO(params) {
169
+ this.validateOrderId(params, 'listClientOrderId');
170
+ this.validateOrderId(params, 'workingClientOrderId');
171
+ this.validateOrderId(params, 'pendingAboveClientOrderId');
172
+ this.validateOrderId(params, 'pendingBelowClientOrderId');
173
+ return this.postPrivate('api/v3/orderList/otoco', params);
136
174
  }
137
- getDepositAddresses(params) {
138
- return this.getPrivate('sapi/v1/capital/deposit/address/list', params);
175
+ cancelOCO(params) {
176
+ this.validateOrderId(params, 'newClientOrderId');
177
+ return this.deletePrivate('api/v3/orderList', params);
139
178
  }
140
- getWalletBalances() {
141
- return this.getPrivate('sapi/v1/asset/wallet/balance');
179
+ getOCO(params) {
180
+ return this.getPrivate('api/v3/orderList', params);
142
181
  }
143
- getDelegationHistory(params) {
144
- return this.getPrivate('sapi/v1/asset/custody/transfer-history', params);
182
+ getAllOCO(params) {
183
+ return this.getPrivate('api/v3/allOrderList', params);
145
184
  }
146
- getDelistSchedule() {
147
- return this.getPrivate('sapi/v1/spot/delist-schedule');
185
+ /**
186
+ * Query open OCO
187
+ */
188
+ getAllOpenOCO() {
189
+ return this.getPrivate('api/v3/openOrderList');
148
190
  }
149
- getWithdrawAddresses() {
150
- return this.getPrivate('sapi/v1/capital/withdraw/address/list');
191
+ /**
192
+ * Places an order using smart order routing (SOR).
193
+ */
194
+ submitNewSOROrder(params) {
195
+ this.validateOrderId(params, 'newClientOrderId');
196
+ return this.postPrivate('api/v3/sor/order', params);
151
197
  }
152
- getAccountInfo() {
153
- return this.getPrivate('sapi/v1/account/info');
198
+ /**
199
+ * Test new order creation and signature/recvWindow using smart order routing (SOR).
200
+ * Creates and validates a new order but does not send it into the matching engine.
201
+ */
202
+ testNewSOROrder(params) {
203
+ this.validateOrderId(params, 'newClientOrderId');
204
+ return this.postPrivate('api/v3/sor/order/test', params);
154
205
  }
155
206
  /**
156
207
  *
157
- *
158
- * Sub-Account Endpoints
208
+ * SPOT TRADING Endpoints - Account endpoints
159
209
  *
160
210
  **/
161
- createVirtualSubAccount(params) {
162
- return this.postPrivate('sapi/v1/sub-account/virtualSubAccount', params);
211
+ /**
212
+ * Get current account information
213
+ */
214
+ getAccountInformation() {
215
+ return this.getPrivate('api/v3/account');
163
216
  }
164
- getSubAccountList(params) {
165
- return this.getPrivate('sapi/v1/sub-account/list', params);
217
+ getAccountTradeList(params) {
218
+ return this.getPrivate('api/v3/myTrades', params);
166
219
  }
167
- getSubAccountSpotAssetTransferHistory(params) {
168
- return this.getPrivate('sapi/v1/sub-account/sub/transfer/history', params);
220
+ getOrderRateLimit() {
221
+ return this.getPrivate('api/v3/rateLimit/order');
169
222
  }
170
- getSubAccountFuturesAssetTransferHistory(params) {
171
- return this.getPrivate('sapi/v1/sub-account/futures/internalTransfer', params);
223
+ getPreventedMatches(params) {
224
+ return this.getPrivate('api/v3/myPreventedMatches', params);
172
225
  }
173
- subAccountFuturesAssetTransfer(params) {
174
- return this.postPrivate('sapi/v1/sub-account/futures/internalTransfer', params);
226
+ getAllocations(params) {
227
+ return this.getPrivate('api/v3/myAllocations', params);
175
228
  }
176
- getSubAccountAssets(params) {
177
- return this.getPrivate('sapi/v3/sub-account/assets', params);
229
+ getCommissionRates(params) {
230
+ return this.getPrivate('api/v3/account/commission', params);
178
231
  }
179
- getSubAccountSpotAssetsSummary(params) {
180
- return this.getPrivate('sapi/v1/sub-account/spotSummary', params);
232
+ /**
233
+ *
234
+ * MARGIN TRADING Endpoints - Market Data endpoints
235
+ *
236
+ **/
237
+ getCrossMarginCollateralRatio() {
238
+ return this.getPrivate('sapi/v1/margin/crossMarginCollateralRatio');
181
239
  }
182
- getSubAccountDepositAddress(params) {
183
- return this.getPrivate('sapi/v1/capital/deposit/subAddress', params);
240
+ getAllCrossMarginPairs() {
241
+ return this.get('sapi/v1/margin/allPairs');
184
242
  }
185
- getSubAccountDepositHistory(params) {
186
- return this.getPrivate('sapi/v1/capital/deposit/subHisrec', params);
243
+ getIsolatedMarginAllSymbols(params) {
244
+ return this.getPrivate('sapi/v1/margin/isolated/allPairs', params);
187
245
  }
188
- getSubAccountStatusOnMarginOrFutures(params) {
189
- return this.getPrivate('sapi/v1/sub-account/status', params);
246
+ getAllMarginAssets() {
247
+ return this.get('sapi/v1/margin/allAssets');
190
248
  }
191
- subAccountEnableMargin(email) {
192
- return this.postPrivate('sapi/v1/sub-account/margin/enable', { email });
249
+ getMarginDelistSchedule() {
250
+ return this.getPrivate('sapi/v1/margin/delist-schedule');
193
251
  }
194
- getSubAccountDetailOnMarginAccount(email) {
195
- return this.getPrivate('sapi/v1/sub-account/margin/account', { email });
252
+ getIsolatedMarginTierData(params) {
253
+ return this.getPrivate('sapi/v1/margin/isolatedMarginTier', params);
196
254
  }
197
- getSubAccountsSummaryOfMarginAccount() {
198
- return this.getPrivate('sapi/v1/sub-account/margin/accountSummary');
255
+ queryMarginPriceIndex(params) {
256
+ return this.get('sapi/v1/margin/priceIndex', params);
199
257
  }
200
- subAccountEnableFutures(email) {
201
- return this.postPrivate('sapi/v1/sub-account/futures/enable', { email });
258
+ getMarginAvailableInventory(params) {
259
+ return this.getPrivate('sapi/v1/margin/available-inventory', params);
202
260
  }
203
- getSubAccountFuturesAccountDetail(email) {
204
- return this.getPrivate('sapi/v1/sub-account/futures/account', { email });
261
+ getLeverageBracket() {
262
+ return this.getPrivate('sapi/v1/margin/leverageBracket');
205
263
  }
206
- getSubAccountFuturesAccountSummary() {
207
- return this.getPrivate('sapi/v1/sub-account/futures/accountSummary');
264
+ /**
265
+ *
266
+ * MARGIN TRADING Endpoints - Borrow and Repay endpoints
267
+ *
268
+ **/
269
+ getNextHourlyInterestRate(params) {
270
+ return this.getPrivate('sapi/v1/margin/next-hourly-interest-rate', params);
208
271
  }
209
- getSubAccountFuturesPositionRisk(email) {
210
- return this.getPrivate('sapi/v1/sub-account/futures/positionRisk', {
211
- email,
212
- });
272
+ getMarginInterestHistory(params) {
273
+ return this.getPrivate('sapi/v1/margin/interestHistory', params);
213
274
  }
214
- subAccountFuturesTransfer(params) {
215
- return this.postPrivate('sapi/v1/sub-account/futures/transfer', params);
275
+ submitMarginAccountBorrowRepay(params) {
276
+ return this.postPrivate('sapi/v1/margin/borrow-repay', params);
216
277
  }
217
- subAccountMarginTransfer(params) {
218
- return this.postPrivate('sapi/v1/sub-account/margin/transfer', params);
278
+ getMarginAccountBorrowRepayRecords(params) {
279
+ return this.getPrivate('sapi/v1/margin/borrow-repay', params);
219
280
  }
220
- subAccountTransferToSameMaster(params) {
221
- return this.postPrivate('sapi/v1/sub-account/transfer/subToSub', params);
281
+ getMarginInterestRateHistory(params) {
282
+ return this.getPrivate('sapi/v1/margin/interestRateHistory', params);
222
283
  }
223
- subAccountTransferToMaster(params) {
224
- return this.postPrivate('sapi/v1/sub-account/transfer/subToMaster', params);
284
+ queryMaxBorrow(params) {
285
+ return this.getPrivate('sapi/v1/margin/maxBorrowable', params);
225
286
  }
226
- subAccountTransferHistory(params) {
227
- return this.getPrivate('sapi/v1/sub-account/transfer/subUserHistory', params);
287
+ /**
288
+ *
289
+ * MARGIN TRADING Endpoints - Trade endpoints
290
+ *
291
+ **/
292
+ getMarginForceLiquidationRecord(params) {
293
+ return this.getPrivate('sapi/v1/margin/forceLiquidationRec', params);
228
294
  }
229
- subAccountUniversalTransfer(params) {
230
- return this.postPrivate('sapi/v1/sub-account/universalTransfer', params);
295
+ getSmallLiabilityExchangeCoins() {
296
+ return this.getPrivate('sapi/v1/margin/exchange-small-liability');
231
297
  }
232
- getSubAccountUniversalTransferHistory(params) {
233
- return this.getPrivate('sapi/v1/sub-account/universalTransfer', params);
298
+ getSmallLiabilityExchangeHistory(params) {
299
+ return this.getPrivate('sapi/v1/margin/exchange-small-liability-history', params);
234
300
  }
235
- getSubAccountDetailOnFuturesAccountV2(params) {
236
- return this.getPrivate('sapi/v2/sub-account/futures/account', params);
301
+ marginAccountCancelOpenOrders(params) {
302
+ return this.deletePrivate('sapi/v1/margin/openOrders', params);
237
303
  }
238
- getSubAccountSummaryOnFuturesAccountV2(params) {
239
- return this.getPrivate('sapi/v2/sub-account/futures/accountSummary', params);
304
+ marginAccountCancelOCO(params) {
305
+ this.validateOrderId(params, 'newClientOrderId');
306
+ return this.deletePrivate('sapi/v1/margin/orderList', params);
240
307
  }
241
- getSubAccountFuturesPositionRiskV2(params) {
242
- return this.getPrivate('sapi/v2/sub-account/futures/positionRisk', params);
308
+ marginAccountCancelOrder(params) {
309
+ return this.deletePrivate('sapi/v1/margin/order', params);
243
310
  }
244
- subAccountEnableLeverageToken(params) {
245
- return this.postPrivate('sapi/v1/sub-account/blvt/enable', params);
311
+ marginAccountNewOCO(params) {
312
+ this.validateOrderId(params, 'listClientOrderId');
313
+ this.validateOrderId(params, 'limitClientOrderId');
314
+ this.validateOrderId(params, 'stopClientOrderId');
315
+ return this.postPrivate('sapi/v1/margin/order/oco', params);
246
316
  }
247
- subAccountEnableOrDisableIPRestriction(params) {
248
- return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params);
317
+ marginAccountNewOrder(params) {
318
+ this.validateOrderId(params, 'newClientOrderId');
319
+ return this.postPrivate('sapi/v1/margin/order', params);
249
320
  }
250
- subAccountAddIPList(params) {
251
- return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params);
321
+ getMarginOrderCountUsage(params) {
322
+ return this.getPrivate('sapi/v1/margin/rateLimit/order', params);
252
323
  }
253
- subAccountAddIPRestriction(params) {
254
- return this.postPrivate('sapi/v2/sub-account/subAccountApi/ipRestriction', params);
324
+ queryMarginAccountAllOCO(params) {
325
+ return this.getPrivate('sapi/v1/margin/allOrderList', params);
255
326
  }
256
- getSubAccountIPRestriction(params) {
257
- return this.getPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params);
327
+ queryMarginAccountAllOrders(params) {
328
+ return this.getPrivate('sapi/v1/margin/allOrders', params);
258
329
  }
259
- subAccountDeleteIPList(params) {
260
- return this.deletePrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params);
330
+ queryMarginAccountOCO(params) {
331
+ return this.getPrivate('sapi/v1/margin/orderList', params);
261
332
  }
262
- depositAssetsIntoManagedSubAccount(params) {
263
- return this.postPrivate('sapi/v1/managed-subaccount/deposit', params);
333
+ queryMarginAccountOpenOCO(params) {
334
+ return this.getPrivate('sapi/v1/margin/openOrderList', params);
264
335
  }
265
- getManagedSubAccountAssetDetails(email) {
266
- return this.getPrivate('sapi/v1/managed-subaccount/asset', { email });
336
+ queryMarginAccountOpenOrders(params) {
337
+ return this.getPrivate('sapi/v1/margin/openOrders', params);
267
338
  }
268
- withdrawAssetsFromManagedSubAccount(params) {
269
- return this.postPrivate('sapi/v1/managed-subaccount/withdraw', params);
339
+ queryMarginAccountOrder(params) {
340
+ return this.getPrivate('sapi/v1/margin/order', params);
270
341
  }
271
- getManagedSubAccountSnapshot(params) {
272
- return this.getPrivate('sapi/v1/managed-subaccount/accountSnapshot', params);
342
+ queryMarginAccountTradeList(params) {
343
+ return this.getPrivate('sapi/v1/margin/myTrades', params);
273
344
  }
274
- getManagedSubAccountTransfersInvestor(params) {
275
- return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForInvestor', params);
345
+ submitSmallLiabilityExchange(params) {
346
+ return this.postPrivate('sapi/v1/margin/exchange-small-liability', params);
276
347
  }
277
- getManagedSubAccountTransfersParent(params) {
278
- return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForTradeParent', params);
348
+ submitManualLiquidation(params) {
349
+ return this.postPrivate('sapi/v1/margin/manual-liquidation', params);
279
350
  }
280
- getManagedSubAccountFuturesAssets(params) {
281
- return this.getPrivate('sapi/v1/managed-subaccount/fetch-future-asset', params);
351
+ /**
352
+ *
353
+ * MARGIN TRADING Endpoints - Transfer endpoints
354
+ *
355
+ **/
356
+ getCrossMarginTransferHistory(params) {
357
+ return this.getPrivate('sapi/v1/margin/transfer', params);
282
358
  }
283
- getManagedSubAccountMarginAssets(params) {
284
- return this.getPrivate('sapi/v1/managed-subaccount/marginAsset', params);
359
+ queryMaxTransferOutAmount(params) {
360
+ return this.getPrivate('sapi/v1/margin/maxTransferable', params);
285
361
  }
286
- getSubAccountAssetsMaster(params) {
287
- return this.getPrivate('sapi/v4/sub-account/assets', params);
362
+ /**
363
+ *
364
+ * MARGIN TRADING Endpoints - Account endpoints
365
+ *
366
+ **/
367
+ updateCrossMarginMaxLeverage(params) {
368
+ return this.postPrivate('sapi/v1/margin/max-leverage', params);
288
369
  }
289
- getManagedSubAccounts(params) {
290
- return this.getPrivate('sapi/v1/managed-subaccount/info', params);
370
+ disableIsolatedMarginAccount(params) {
371
+ return this.deletePrivate('sapi/v1/margin/isolated/account', params);
291
372
  }
292
- getSubAccountTransactionStatistics(params) {
293
- return this.getPrivate('sapi/v1/sub-account/transaction-statistics', params);
373
+ enableIsolatedMarginAccount(params) {
374
+ return this.postPrivate('sapi/v1/margin/isolated/account', params);
294
375
  }
295
- getManagedSubAccountDepositAddress(params) {
296
- return this.getPrivate('sapi/v1/managed-subaccount/deposit/address', params);
376
+ getBNBBurn() {
377
+ return this.getPrivate('sapi/v1/bnbBurn');
297
378
  }
298
- enableOptionsForSubAccount(params) {
299
- return this.postPrivate('sapi/v1/sub-account/eoptions/enable', params);
379
+ getMarginSummary() {
380
+ return this.getPrivate('sapi/v1/margin/tradeCoeff');
300
381
  }
301
- getManagedSubAccountTransferLog(params) {
302
- return this.getPrivate('sapi/v1/managed-subaccount/query-trans-log', params);
382
+ queryCrossMarginAccountDetails() {
383
+ return this.getPrivate('sapi/v1/margin/account');
303
384
  }
304
- /**
305
- * Broker Endpoints
306
- */
307
- getBrokerIfNewSpotUser() {
308
- return this.getPrivate('sapi/v1/apiReferral/ifNewUser');
385
+ getCrossMarginFeeData(params) {
386
+ return this.getPrivate('sapi/v1/margin/crossMarginData', params);
309
387
  }
310
- getBrokerSubAccountDepositHistory(params) {
311
- return this.getPrivate('sapi/v1/broker/subAccount/depositHist', params);
388
+ getIsolatedMarginAccountLimit() {
389
+ return this.getPrivate('sapi/v1/margin/isolated/accountLimit');
312
390
  }
313
- getBrokerUserCustomisedId(market) {
314
- const prefix = market === 'spot' ? 'sapi' : 'fapi';
315
- return this.getPrivate(prefix + '/v1/apiReferral/userCustomization');
391
+ getIsolatedMarginAccountInfo(params) {
392
+ return this.getPrivate('sapi/v1/margin/isolated/account', { params });
316
393
  }
317
- createBrokerSubAccount(params) {
318
- return this.postPrivate('sapi/v1/broker/subAccount', params);
394
+ getIsolatedMarginFeeData(params) {
395
+ return this.getPrivate('sapi/v1/margin/isolatedMarginData', params);
319
396
  }
320
- getBrokerSubAccountHistory(params) {
321
- return this.getPrivate('sapi/v1/broker/transfer', params);
397
+ toggleBNBBurn(params) {
398
+ return this.postPrivate('sapi/v1/bnbBurn', params);
322
399
  }
323
- getBrokerSubAccount(params) {
324
- return this.getPrivate('sapi/v1/broker/subAccount', params);
400
+ /**
401
+ * Possibly @deprecated
402
+ * Only existing in old documentation, not in new documentation
403
+ */
404
+ getMarginCapitalFlow(params) {
405
+ return this.getPrivate('sapi/v1/margin/capital-flow', params);
325
406
  }
326
- getApiKeyBrokerSubAccount(params) {
327
- return this.getPrivate('sapi/v1/broker/subAccountApi', params);
407
+ /**
408
+ * @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead
409
+ */
410
+ queryLoanRecord(params) {
411
+ return this.getPrivate('sapi/v1/margin/loan', params);
328
412
  }
329
- createApiKeyBrokerSubAccount(params) {
330
- return this.postPrivate('sapi/v1/broker/subAccountApi', params);
413
+ /**
414
+ * @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead
415
+ */
416
+ queryRepayRecord(params) {
417
+ return this.getPrivate('sapi/v1/margin/repay', params);
331
418
  }
332
- deleteApiKeyBrokerSubAccount(params) {
333
- return this.deletePrivate('sapi/v1/broker/subAccountApi', params);
419
+ /**
420
+ * @deprecated on 2024-01-09, use submitUniversalTransfer() instead
421
+ */
422
+ isolatedMarginAccountTransfer(params) {
423
+ return this.postPrivate('sapi/v1/margin/isolated/transfer', params);
334
424
  }
335
- changePermissionApiKeyBrokerSubAccount(params) {
336
- return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params);
425
+ /**
426
+ *
427
+ * WALLET Endpoints - Capital endpoints
428
+ *
429
+ **/
430
+ getBalances() {
431
+ return this.getPrivate('sapi/v1/capital/config/getall');
337
432
  }
338
- changeComissionBrokerSubAccount(params) {
339
- return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params);
433
+ withdraw(params) {
434
+ return this.postPrivate('sapi/v1/capital/withdraw/apply', params);
340
435
  }
341
- enableUniversalTransferApiKeyBrokerSubAccount(params) {
342
- return this.postPrivate('sapi/v1/broker/subAccountApi/permission/universalTransfer', params);
436
+ getWithdrawHistory(params) {
437
+ return this.getPrivate('sapi/v1/capital/withdraw/history', params);
343
438
  }
344
- enableMarginBrokerSubAccount(params) {
345
- return this.postPrivate('sapi/v1/broker/subAccount/futures', params);
439
+ getWithdrawAddresses() {
440
+ return this.getPrivate('sapi/v1/capital/withdraw/address/list');
346
441
  }
347
- enableFuturesBrokerSubAccount(params) {
348
- return this.postPrivate('sapi/v1/broker/subAccount', params);
442
+ getDepositHistory(params) {
443
+ return this.getPrivate('sapi/v1/capital/deposit/hisrec', params);
349
444
  }
350
- enableMarginApiKeyBrokerSubAccount(params) {
351
- return this.postPrivate('sapi/v1/broker/subAccount/margin', params);
445
+ getDepositAddress(params) {
446
+ return this.getPrivate('sapi/v1/capital/deposit/address', params);
352
447
  }
353
- transferBrokerSubAccount(params) {
354
- return this.postPrivate('sapi/v1/broker/transfer', params);
448
+ getDepositAddresses(params) {
449
+ return this.getPrivate('sapi/v1/capital/deposit/address/list', params);
355
450
  }
356
- universalTransferBroker(params) {
357
- return this.postPrivate('sapi/v1/broker/universalTransfer', params);
451
+ submitDepositCredit(params) {
452
+ return this.postPrivate('sapi/v1/capital/deposit/credit-apply', params);
358
453
  }
359
- getUniversalTransferBroker(params) {
360
- return this.getPrivate('sapi/v1/broker/universalTransfer', params);
454
+ getAutoConvertStablecoins() {
455
+ return this.getPrivate('sapi/v1/capital/contract/convertible-coins');
361
456
  }
362
- getBrokerInfo() {
363
- return this.getPrivate('sapi/v1/broker/info');
364
- }
365
- // USD & Coin-M can be found under API getIncome() (find "API rebate" in results)
366
- getBrokerSpotRebateHistory(days, customerId) {
367
- if (days === 7) {
368
- return this.getPrivate('sapi/v1/apiReferral/rebate/recentRecord', {
369
- customerId,
370
- });
371
- }
372
- if (days === 30) {
373
- return this.getPrivate('sapi/v1/apiReferral/rebate/historicalRecord', {
374
- customerId,
375
- });
376
- }
457
+ setConvertibleCoins(params) {
458
+ return this.postPrivate('sapi/v1/capital/contract/convertible-coins', params);
377
459
  }
378
460
  /**
379
461
  *
380
- * Market Data Endpoints
462
+ * WALLET Endpoints - Asset endpoints
381
463
  *
382
464
  **/
383
- testConnectivity() {
384
- return this.get('api/v3/ping');
385
- }
386
- getExchangeInfo(params) {
387
- const symbols = (params === null || params === void 0 ? void 0 : params.symbols) && JSON.stringify(params.symbols);
388
- const symbol = params === null || params === void 0 ? void 0 : params.symbol;
389
- let urlSuffix = '';
390
- if (symbol) {
391
- urlSuffix += '?symbol=' + symbol;
392
- }
393
- else if (symbols) {
394
- urlSuffix += '?symbols=' + symbols;
395
- }
396
- return this.get('api/v3/exchangeInfo' + urlSuffix);
465
+ getAssetDetail(params) {
466
+ return this.getPrivate('sapi/v1/asset/assetDetail', params);
397
467
  }
398
- getOrderBook(params) {
399
- return this.get('api/v3/depth', params);
468
+ getWalletBalances() {
469
+ return this.getPrivate('sapi/v1/asset/wallet/balance');
400
470
  }
401
- getRecentTrades(params) {
402
- return this.get('api/v3/trades', params);
471
+ getUserAsset(params) {
472
+ return this.postPrivate('sapi/v3/asset/getUserAsset', params);
403
473
  }
404
- getHistoricalTrades(params) {
405
- return this.get('api/v3/historicalTrades', params);
474
+ submitUniversalTransfer(params) {
475
+ return this.postPrivate('sapi/v1/asset/transfer', params);
406
476
  }
407
- getAggregateTrades(params) {
408
- return this.get('api/v3/aggTrades', params);
477
+ getUniversalTransferHistory(params) {
478
+ return this.getPrivate('sapi/v1/asset/transfer', params);
409
479
  }
410
- getKlines(params) {
411
- return this.get('api/v3/klines', params);
480
+ getDust() {
481
+ return this.postPrivate('sapi/v1/asset/dust-btc');
412
482
  }
413
- getUIKlines(params) {
414
- return this.get('api/v3/uiKlines', params);
483
+ convertDustToBnb(params) {
484
+ return this.postPrivate('sapi/v1/asset/dust', params);
415
485
  }
416
- getAvgPrice(params) {
417
- return this.get('api/v3/avgPrice', params);
486
+ getDustLog(params) {
487
+ return this.getPrivate('sapi/v1/asset/dribblet', params);
418
488
  }
419
- get24hrChangeStatististics(params) {
420
- if (params && typeof params['symbol'] === 'string') {
421
- return this.get('api/v3/ticker/24hr', params);
422
- }
423
- if (params && params['symbols'] && Array.isArray(params['symbols'])) {
424
- const symbols = params.symbols;
425
- const symbolsQueryParam = JSON.stringify(symbols);
426
- return this.get('api/v3/ticker/24hr?symbols=' + symbolsQueryParam);
427
- }
428
- return this.get('api/v3/ticker/24hr');
489
+ getAssetDividendRecord(params) {
490
+ return this.getPrivate('sapi/v1/asset/assetDividend', params);
429
491
  }
430
- getTradingDayTicker(params) {
431
- return this.get('api/v3/ticker/tradingDay', params);
492
+ getTradeFee(params) {
493
+ return this.getPrivate('sapi/v1/asset/tradeFee', params);
432
494
  }
433
- getSymbolPriceTicker(params) {
434
- return this.get('api/v3/ticker/price', params);
495
+ getFundingAsset(params) {
496
+ return this.postPrivate('sapi/v1/asset/get-funding-asset', params);
435
497
  }
436
- getSymbolOrderBookTicker(params) {
437
- return this.get('api/v3/ticker/bookTicker', params);
498
+ getCloudMiningHistory(params) {
499
+ return this.getPrivate('sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage', params);
438
500
  }
439
- getRollingWindowTicker(params) {
440
- return this.get('api/v3/ticker', params);
501
+ getDelegationHistory(params) {
502
+ return this.getPrivate('sapi/v1/asset/custody/transfer-history', params);
441
503
  }
442
504
  /**
443
505
  *
444
- * Spot Account/Trade Endpoints
506
+ * Futures Management Endpoints:
507
+ * https://binance-docs.github.io/apidocs/spot/en/#futures
508
+ *
509
+ * Note: to trade futures use the usdm-client or coinm-client.
510
+ * MainClient only has the futures endpoints listed in the "spot" docs category, primarily used for transfers.
445
511
  *
446
512
  **/
447
- testNewOrder(params) {
448
- this.validateOrderId(params, 'newClientOrderId');
449
- return this.postPrivate('api/v3/order/test', params);
450
- }
451
- replaceOrder(params) {
452
- return this.postPrivate('api/v3/order/cancelReplace', params);
453
- }
454
- submitNewOrder(params) {
455
- this.validateOrderId(params, 'newClientOrderId');
456
- return this.postPrivate('api/v3/order', params);
457
- }
458
- cancelOrder(params) {
459
- return this.deletePrivate('api/v3/order', params);
460
- }
461
- cancelAllSymbolOrders(params) {
462
- return this.deletePrivate('api/v3/openOrders', params);
463
- }
464
- getOrder(params) {
465
- return this.getPrivate('api/v3/order', params);
466
- }
467
- getOpenOrders(params) {
468
- return this.getPrivate('api/v3/openOrders', params);
469
- }
470
- getAllOrders(params) {
471
- return this.getPrivate('api/v3/allOrders', params);
472
- }
473
513
  /**
474
- * @deprecated
514
+ * Execute transfer between spot account and futures account.
515
+ *
516
+ * Type:
517
+ * - 1: transfer from spot account to USDT-Ⓜ futures account.
518
+ * - 2: transfer from USDT-Ⓜ futures account to spot account.
519
+ * - 3: transfer from spot account to COIN-Ⓜ futures account.
520
+ * - 4: transfer from COIN-Ⓜ futures account to spot account.
475
521
  */
476
- submitNewOCO(params) {
477
- this.validateOrderId(params, 'listClientOrderId');
478
- this.validateOrderId(params, 'limitClientOrderId');
479
- this.validateOrderId(params, 'stopClientOrderId');
480
- return this.postPrivate('api/v3/order/oco', params);
481
- }
482
- submitNewOrderList(params) {
483
- this.validateOrderId(params, 'listClientOrderId');
484
- this.validateOrderId(params, 'aboveClientOrderId');
485
- this.validateOrderId(params, 'belowClientOrderId');
486
- return this.postPrivate('api/v3/orderList/oco', params);
487
- }
488
- // TO CHECK!!
489
- submitNewOrderListOTO(params) {
490
- this.validateOrderId(params, 'listClientOrderId');
491
- this.validateOrderId(params, 'workingClientOrderId');
492
- this.validateOrderId(params, 'pendingClientOrderId');
493
- return this.postPrivate('api/v3/orderList/oto', params);
522
+ /**
523
+ * Possibly @deprecated, found only in old docs only
524
+ * Use sapi/v1/asset/transfer instead
525
+ */
526
+ submitNewFutureAccountTransfer(params) {
527
+ return this.postPrivate(`sapi/v1/futures/transfer`, params);
494
528
  }
495
- // TO CHECK!!
496
- submitNewOrderListOTOCO(params) {
497
- this.validateOrderId(params, 'listClientOrderId');
498
- this.validateOrderId(params, 'workingClientOrderId');
499
- this.validateOrderId(params, 'pendingAboveClientOrderId');
500
- this.validateOrderId(params, 'pendingBelowClientOrderId');
501
- return this.postPrivate('api/v3/orderList/otoco', params);
529
+ /**
530
+ * Possibly @deprecated, found only in old docs only
531
+ * Use sapi/v1/asset/transfer instead
532
+ */
533
+ getFutureAccountTransferHistory(params) {
534
+ return this.getPrivate(`sapi/v1/futures/transfer`, params);
502
535
  }
503
- cancelOCO(params) {
504
- this.validateOrderId(params, 'newClientOrderId');
505
- return this.deletePrivate('api/v3/orderList', params);
536
+ /**
537
+ * @deprecated as of 2023-09-25
538
+ */
539
+ getCrossCollateralBorrowHistory(params) {
540
+ return this.getPrivate(`sapi/v1/futures/loan/borrow/history`, params);
506
541
  }
507
- getOCO(params) {
508
- return this.getPrivate('api/v3/orderList', params);
542
+ /**
543
+ * @deprecated as of 2023-09-25
544
+ */
545
+ getCrossCollateralRepaymentHistory(params) {
546
+ return this.getPrivate(`sapi/v1/futures/loan/repay/history`, params);
509
547
  }
510
- getAllOCO(params) {
511
- return this.getPrivate('api/v3/allOrderList', params);
548
+ /**
549
+ * @deprecated as of 2023-09-25
550
+ */
551
+ getCrossCollateralWalletV2() {
552
+ return this.getPrivate(`sapi/v2/futures/loan/wallet`);
512
553
  }
513
554
  /**
514
- * Query open OCO
555
+ * @deprecated as of 2023-09-25
515
556
  */
516
- getAllOpenOCO() {
517
- return this.getPrivate('api/v3/openOrderList');
557
+ getAdjustCrossCollateralLTVHistory(params) {
558
+ return this.getPrivate(`sapi/v1/futures/loan/adjustCollateral/history`, params);
518
559
  }
519
560
  /**
520
- * Places an order using smart order routing (SOR).
561
+ * @deprecated as of 2023-09-25
521
562
  */
522
- submitNewSOROrder(params) {
523
- this.validateOrderId(params, 'newClientOrderId');
524
- return this.postPrivate('api/v3/sor/order', params);
563
+ getCrossCollateralLiquidationHistory(params) {
564
+ return this.getPrivate(`sapi/v1/futures/loan/liquidationHistory`, params);
525
565
  }
526
566
  /**
527
- * Test new order creation and signature/recvWindow using smart order routing (SOR).
528
- * Creates and validates a new order but does not send it into the matching engine.
567
+ * @deprecated as of 2023-09-25
529
568
  */
530
- testNewSOROrder(params) {
531
- this.validateOrderId(params, 'newClientOrderId');
532
- return this.postPrivate('api/v3/sor/order/test', params);
569
+ getCrossCollateralInterestHistory(params) {
570
+ return this.getPrivate(`sapi/v1/futures/loan/interestHistory`, params);
533
571
  }
534
572
  /**
535
573
  *
574
+ * WALLET Endpoints - Account endpoints
536
575
  *
537
- * Spot Account Endpoints
538
- *
539
- *
540
- */
541
- /**
542
- * Get current account information
543
- */
544
- getAccountInformation() {
545
- return this.getPrivate('api/v3/account');
576
+ **/
577
+ getAccountInfo() {
578
+ return this.getPrivate('sapi/v1/account/info');
546
579
  }
547
- getAccountTradeList(params) {
548
- return this.getPrivate('api/v3/myTrades', params);
580
+ getDailyAccountSnapshot(params) {
581
+ return this.getPrivate('sapi/v1/accountSnapshot', params);
549
582
  }
550
- getOrderRateLimit() {
551
- return this.getPrivate('api/v3/rateLimit/order');
583
+ disableFastWithdrawSwitch() {
584
+ return this.postPrivate('sapi/v1/account/disableFastWithdrawSwitch');
552
585
  }
553
- getPreventedMatches(params) {
554
- return this.getPrivate('api/v3/myPreventedMatches', params);
586
+ enableFastWithdrawSwitch() {
587
+ return this.postPrivate('sapi/v1/account/enableFastWithdrawSwitch');
555
588
  }
556
- getAllocations(params) {
557
- return this.getPrivate('api/v3/myAllocations', params);
589
+ getAccountStatus() {
590
+ return this.getPrivate('sapi/v1/account/status');
558
591
  }
559
- getCommissionRates(params) {
560
- return this.getPrivate('api/v3/account/commission', params);
592
+ getApiTradingStatus() {
593
+ return this.getPrivate('sapi/v1/account/apiTradingStatus');
594
+ }
595
+ getApiKeyPermissions() {
596
+ return this.getPrivate('sapi/v1/account/apiRestrictions');
561
597
  }
562
598
  /**
563
599
  *
564
- * Margin Account/Trade Endpoints
600
+ * WALLET Endpoints - Travel Rule endpoints
565
601
  *
566
602
  **/
567
- submitMarginAccountBorrowRepay(params) {
568
- return this.postPrivate('sapi/v1/margin/borrow-repay', params);
603
+ // to be added
604
+ /**
605
+ *
606
+ * WALLET Endpoints - Other endpoints
607
+ *
608
+ **/
609
+ getSystemStatus() {
610
+ return this.get('sapi/v1/system/status');
569
611
  }
570
- getMarginAccountBorrowRepayRecords(params) {
571
- return this.getPrivate('sapi/v1/margin/borrow-repay', params);
612
+ getDelistSchedule() {
613
+ return this.getPrivate('sapi/v1/spot/delist-schedule');
572
614
  }
573
- getAllMarginAssets() {
574
- return this.get('sapi/v1/margin/allAssets');
615
+ /**
616
+ *
617
+ * SUB ACCOUNT Endpoints - Account management
618
+ *
619
+ **/
620
+ createVirtualSubAccount(params) {
621
+ return this.postPrivate('sapi/v1/sub-account/virtualSubAccount', params);
575
622
  }
576
- getAllCrossMarginPairs() {
577
- return this.get('sapi/v1/margin/allPairs');
623
+ getSubAccountList(params) {
624
+ return this.getPrivate('sapi/v1/sub-account/list', params);
578
625
  }
579
- queryMarginPriceIndex(params) {
580
- return this.get('sapi/v1/margin/priceIndex', params);
626
+ subAccountEnableFutures(email) {
627
+ return this.postPrivate('sapi/v1/sub-account/futures/enable', { email });
581
628
  }
582
- marginAccountNewOrder(params) {
583
- this.validateOrderId(params, 'newClientOrderId');
584
- return this.postPrivate('sapi/v1/margin/order', params);
629
+ subAccountEnableMargin(email) {
630
+ return this.postPrivate('sapi/v1/sub-account/margin/enable', { email });
585
631
  }
586
- marginAccountCancelOrder(params) {
587
- return this.deletePrivate('sapi/v1/margin/order', params);
632
+ enableOptionsForSubAccount(params) {
633
+ return this.postPrivate('sapi/v1/sub-account/eoptions/enable', params);
588
634
  }
589
- marginAccountCancelOpenOrders(params) {
590
- return this.deletePrivate('sapi/v1/margin/openOrders', params);
635
+ subAccountEnableLeverageToken(params) {
636
+ return this.postPrivate('sapi/v1/sub-account/blvt/enable', params);
591
637
  }
592
- updateCrossMarginMaxLeverage(params) {
593
- return this.postPrivate('sapi/v1/margin/max-leverage', params);
638
+ getSubAccountStatusOnMarginOrFutures(params) {
639
+ return this.getPrivate('sapi/v1/sub-account/status', params);
594
640
  }
595
- getCrossMarginTransferHistory(params) {
596
- return this.getPrivate('sapi/v1/margin/transfer', params);
641
+ getSubAccountFuturesPositionRisk(email) {
642
+ return this.getPrivate('sapi/v1/sub-account/futures/positionRisk', {
643
+ email,
644
+ });
597
645
  }
598
- getMarginInterestHistory(params) {
599
- return this.getPrivate('sapi/v1/margin/interestHistory', params);
646
+ getSubAccountFuturesPositionRiskV2(params) {
647
+ return this.getPrivate('sapi/v2/sub-account/futures/positionRisk', params);
600
648
  }
601
- getMarginForceLiquidationRecord(params) {
602
- return this.getPrivate('sapi/v1/margin/forceLiquidationRec', params);
649
+ getSubAccountTransactionStatistics(params) {
650
+ return this.getPrivate('sapi/v1/sub-account/transaction-statistics', params);
603
651
  }
604
652
  /**
605
- * @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead
606
- */
607
- queryLoanRecord(params) {
608
- return this.getPrivate('sapi/v1/margin/loan', params);
653
+ *
654
+ * SUB ACCOUNT Endpoints - API management
655
+ *
656
+ **/
657
+ getSubAccountIPRestriction(params) {
658
+ return this.getPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params);
659
+ }
660
+ subAccountDeleteIPList(params) {
661
+ return this.deletePrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params);
662
+ }
663
+ subAccountAddIPRestriction(params) {
664
+ return this.postPrivate('sapi/v2/sub-account/subAccountApi/ipRestriction', params);
609
665
  }
610
666
  /**
611
- * @deprecated on 2024-01-09, use getMarginAccountBorrowRepayRecords() instead
612
- */
613
- queryRepayRecord(params) {
614
- return this.getPrivate('sapi/v1/margin/repay', params);
667
+ * @deprecated
668
+ * Use subAccountAddIPRestriction instead
669
+ **/
670
+ subAccountAddIPList(params) {
671
+ return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction/ipList', params);
615
672
  }
616
- queryCrossMarginAccountDetails() {
617
- return this.getPrivate('sapi/v1/margin/account');
673
+ /**
674
+ * @deprecated
675
+ * Use subAccountAddIPRestriction instead, or subAccountDeleteIPList
676
+ **/
677
+ subAccountEnableOrDisableIPRestriction(params) {
678
+ return this.postPrivate('sapi/v1/sub-account/subAccountApi/ipRestriction', params);
618
679
  }
619
- queryMarginAccountOrder(params) {
620
- return this.getPrivate('sapi/v1/margin/order', params);
680
+ /**
681
+ *
682
+ * SUB ACCOUNT Endpoints - Asset management
683
+ *
684
+ **/
685
+ subAccountFuturesTransfer(params) {
686
+ return this.postPrivate('sapi/v1/sub-account/futures/transfer', params);
621
687
  }
622
- queryMarginAccountOpenOrders(params) {
623
- return this.getPrivate('sapi/v1/margin/openOrders', params);
688
+ getSubAccountFuturesAccountDetail(email) {
689
+ return this.getPrivate('sapi/v1/sub-account/futures/account', { email });
624
690
  }
625
- queryMarginAccountAllOrders(params) {
626
- return this.getPrivate('sapi/v1/margin/allOrders', params);
691
+ getSubAccountDetailOnFuturesAccountV2(params) {
692
+ return this.getPrivate('sapi/v2/sub-account/futures/account', params);
627
693
  }
628
- marginAccountNewOCO(params) {
629
- this.validateOrderId(params, 'listClientOrderId');
630
- this.validateOrderId(params, 'limitClientOrderId');
631
- this.validateOrderId(params, 'stopClientOrderId');
632
- return this.postPrivate('sapi/v1/margin/order/oco', params);
694
+ getSubAccountDetailOnMarginAccount(email) {
695
+ return this.getPrivate('sapi/v1/sub-account/margin/account', { email });
633
696
  }
634
- marginAccountCancelOCO(params) {
635
- this.validateOrderId(params, 'newClientOrderId');
636
- return this.deletePrivate('sapi/v1/margin/orderList', params);
697
+ getSubAccountDepositAddress(params) {
698
+ return this.getPrivate('sapi/v1/capital/deposit/subAddress', params);
637
699
  }
638
- queryMarginAccountOCO(params) {
639
- return this.getPrivate('sapi/v1/margin/orderList', params);
700
+ getSubAccountDepositHistory(params) {
701
+ return this.getPrivate('sapi/v1/capital/deposit/subHisrec', params);
640
702
  }
641
- queryMarginAccountAllOCO(params) {
642
- return this.getPrivate('sapi/v1/margin/allOrderList', params);
703
+ getSubAccountFuturesAccountSummary() {
704
+ return this.getPrivate('sapi/v1/sub-account/futures/accountSummary');
643
705
  }
644
- /**
645
- * Query margin account's open OCO
646
- */
647
- queryMarginAccountOpenOCO(params) {
648
- return this.getPrivate('sapi/v1/margin/openOrderList', params);
706
+ getSubAccountSummaryOnFuturesAccountV2(params) {
707
+ return this.getPrivate('sapi/v2/sub-account/futures/accountSummary', params);
649
708
  }
650
- /**
651
- * Query margin account's trade list
652
- */
653
- queryMarginAccountTradeList(params) {
654
- return this.getPrivate('sapi/v1/margin/myTrades', params);
709
+ getSubAccountsSummaryOfMarginAccount() {
710
+ return this.getPrivate('sapi/v1/sub-account/margin/accountSummary');
655
711
  }
656
- queryMaxBorrow(params) {
657
- return this.getPrivate('sapi/v1/margin/maxBorrowable', params);
712
+ subAccountMarginTransfer(params) {
713
+ return this.postPrivate('sapi/v1/sub-account/margin/transfer', params);
658
714
  }
659
- queryMaxTransferOutAmount(params) {
660
- return this.getPrivate('sapi/v1/margin/maxTransferable', params);
715
+ getSubAccountAssets(params) {
716
+ return this.getPrivate('sapi/v3/sub-account/assets', params);
661
717
  }
662
- /**
663
- * @deprecated on 2024-01-09, use submitUniversalTransfer() instead
664
- */
665
- isolatedMarginAccountTransfer(params) {
666
- return this.postPrivate('sapi/v1/margin/isolated/transfer', params);
718
+ getSubAccountAssetsMaster(params) {
719
+ return this.getPrivate('sapi/v4/sub-account/assets', params);
667
720
  }
668
- getIsolatedMarginAccountInfo(params) {
669
- return this.getPrivate('sapi/v1/margin/isolated/account', { params });
721
+ getSubAccountFuturesAssetTransferHistory(params) {
722
+ return this.getPrivate('sapi/v1/sub-account/futures/internalTransfer', params);
670
723
  }
671
- /**
672
- * Disable isolated margin account
673
- */
674
- disableIsolatedMarginAccount(params) {
675
- return this.deletePrivate('sapi/v1/margin/isolated/account', params);
724
+ getSubAccountSpotAssetTransferHistory(params) {
725
+ return this.getPrivate('sapi/v1/sub-account/sub/transfer/history', params);
676
726
  }
677
- /**
678
- * Enable isolated margin account
679
- */
680
- enableIsolatedMarginAccount(params) {
681
- return this.postPrivate('sapi/v1/margin/isolated/account', params);
727
+ getSubAccountSpotAssetsSummary(params) {
728
+ return this.getPrivate('sapi/v1/sub-account/spotSummary', params);
682
729
  }
683
- /**
684
- * Query enabled isolated margin account limit
685
- */
686
- getIsolatedMarginAccountLimit() {
687
- return this.getPrivate('sapi/v1/margin/isolated/accountLimit');
730
+ getSubAccountUniversalTransferHistory(params) {
731
+ return this.getPrivate('sapi/v1/sub-account/universalTransfer', params);
732
+ }
733
+ subAccountFuturesAssetTransfer(params) {
734
+ return this.postPrivate('sapi/v1/sub-account/futures/internalTransfer', params);
735
+ }
736
+ subAccountTransferHistory(params) {
737
+ return this.getPrivate('sapi/v1/sub-account/transfer/subUserHistory', params);
738
+ }
739
+ subAccountTransferToMaster(params) {
740
+ return this.postPrivate('sapi/v1/sub-account/transfer/subToMaster', params);
741
+ }
742
+ subAccountTransferToSameMaster(params) {
743
+ return this.postPrivate('sapi/v1/sub-account/transfer/subToSub', params);
744
+ }
745
+ subAccountUniversalTransfer(params) {
746
+ return this.postPrivate('sapi/v1/sub-account/universalTransfer', params);
688
747
  }
689
748
  /**
690
- * Get all isolated margin symbols
691
- */
692
- getIsolatedMarginAllSymbols(params) {
693
- return this.getPrivate('sapi/v1/margin/isolated/allPairs', params);
749
+ *
750
+ * SUB ACCOUNT Endpoints - Managed Sub Account
751
+ *
752
+ **/
753
+ depositAssetsIntoManagedSubAccount(params) {
754
+ return this.postPrivate('sapi/v1/managed-subaccount/deposit', params);
755
+ }
756
+ getManagedSubAccountDepositAddress(params) {
757
+ return this.getPrivate('sapi/v1/managed-subaccount/deposit/address', params);
758
+ }
759
+ withdrawAssetsFromManagedSubAccount(params) {
760
+ return this.postPrivate('sapi/v1/managed-subaccount/withdraw', params);
761
+ }
762
+ getManagedSubAccountTransfersParent(params) {
763
+ return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForTradeParent', params);
764
+ }
765
+ getManagedSubAccountTransferLog(params) {
766
+ return this.getPrivate('sapi/v1/managed-subaccount/query-trans-log', params);
767
+ }
768
+ getManagedSubAccountTransfersInvestor(params) {
769
+ return this.getPrivate('sapi/v1/managed-subaccount/queryTransLogForInvestor', params);
770
+ }
771
+ getManagedSubAccounts(params) {
772
+ return this.getPrivate('sapi/v1/managed-subaccount/info', params);
773
+ }
774
+ getManagedSubAccountSnapshot(params) {
775
+ return this.getPrivate('sapi/v1/managed-subaccount/accountSnapshot', params);
776
+ }
777
+ getManagedSubAccountAssetDetails(email) {
778
+ return this.getPrivate('sapi/v1/managed-subaccount/asset', { email });
779
+ }
780
+ getManagedSubAccountMarginAssets(params) {
781
+ return this.getPrivate('sapi/v1/managed-subaccount/marginAsset', params);
782
+ }
783
+ getManagedSubAccountFuturesAssets(params) {
784
+ return this.getPrivate('sapi/v1/managed-subaccount/fetch-future-asset', params);
694
785
  }
695
786
  /**
696
- * Toggle BNB burn on spot trade and margin interest
697
- */
698
- toggleBNBBurn(params) {
699
- return this.postPrivate('sapi/v1/bnbBurn', params);
787
+ *
788
+ * AUTO INVEST Endpoints - Market data
789
+ *
790
+ **/
791
+ getAutoInvestAssets() {
792
+ return this.getPrivate('sapi/v1/lending/auto-invest/all/asset');
793
+ }
794
+ getAutoInvestSourceAssets(params) {
795
+ return this.getPrivate('sapi/v1/lending/auto-invest/source-asset/list', params);
796
+ }
797
+ getAutoInvestTargetAssets(params) {
798
+ return this.getPrivate('sapi/v1/lending/auto-invest/target-asset/list', params);
799
+ }
800
+ getAutoInvestTargetAssetsROI(params) {
801
+ return this.getPrivate('sapi/v1/lending/auto-invest/target-asset/roi/list', params);
802
+ }
803
+ getAutoInvestIndex(params) {
804
+ return this.getPrivate('sapi/v1/lending/auto-invest/index/info', params);
805
+ }
806
+ getAutoInvestPlans(params) {
807
+ return this.getPrivate('sapi/v1/lending/auto-invest/plan/list', params);
700
808
  }
701
809
  /**
702
- * Get BNB burn status
810
+ *
811
+ * AUTO INVEST Endpoints - Trade
812
+ *
813
+ **/
814
+ /**
815
+ * https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction
816
+ *
817
+ * @param params
818
+ * @returns
703
819
  */
704
- getBNBBurn() {
705
- return this.getPrivate('sapi/v1/bnbBurn');
820
+ submitAutoInvestOneTimeTransaction(params) {
821
+ const { details } = params, allParams = __rest(params, ["details"]);
822
+ const requestParameters = Object.assign({}, allParams);
823
+ for (let i = 0; i < details.length; i++) {
824
+ requestParameters[`details[${i}].targetAsset`] = details[i].targetAsset;
825
+ requestParameters[`details[${i}].percentage`] = details[i].percentage;
826
+ }
827
+ return this.postPrivate('sapi/v1/lending/auto-invest/one-off', requestParameters);
828
+ }
829
+ updateAutoInvestPlanStatus(params) {
830
+ return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit-status', params);
706
831
  }
707
832
  /**
708
- * Query margin interest rate history
709
- */
710
- getMarginInterestRateHistory(params) {
711
- return this.getPrivate('sapi/v1/margin/interestRateHistory', params);
833
+ *
834
+ * @deprecated , use updateAutoInvestmentPlan instead
835
+ *
836
+ **/
837
+ updateAutoInvestmentPlanOld(params) {
838
+ return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', params);
839
+ }
840
+ updateAutoInvestmentPlan(params) {
841
+ const { details } = params, allParams = __rest(params, ["details"]);
842
+ const requestParameters = Object.assign({}, allParams);
843
+ for (let i = 0; i < details.length; i++) {
844
+ requestParameters[`details[${i}].targetAsset`] = details[i].targetAsset;
845
+ requestParameters[`details[${i}].percentage`] = details[i].percentage;
846
+ }
847
+ return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', requestParameters);
848
+ }
849
+ submitAutoInvestRedemption(params) {
850
+ return this.postPrivate('sapi/v1/lending/auto-invest/redeem', params);
851
+ }
852
+ getAutoInvestSubscriptionTransactions(params) {
853
+ return this.getPrivate('sapi/v1/lending/auto-invest/history/list', params);
854
+ }
855
+ getOneTimeTransactionStatus(params) {
856
+ return this.getPrivate('sapi/v1/lending/auto-invest/one-off/status', params);
712
857
  }
713
858
  /**
714
- * Query cross margin fee data
715
- */
716
- getCrossMarginFeeData(params) {
717
- return this.getPrivate('sapi/v1/margin/crossMarginData', params);
859
+ * @deprecated , use submitAutoInvestmentPlan instead
860
+ *
861
+ **/
862
+ submitAutoInvestmentPlanOld(params) {
863
+ return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', params);
864
+ }
865
+ submitAutoInvestmentPlan(params) {
866
+ const { details } = params, allParams = __rest(params, ["details"]);
867
+ const requestParameters = Object.assign({}, allParams);
868
+ for (let i = 0; i < details.length; i++) {
869
+ requestParameters[`details[${i}].targetAsset`] = details[i].targetAsset;
870
+ requestParameters[`details[${i}].percentage`] = details[i].percentage;
871
+ }
872
+ return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', requestParameters);
873
+ }
874
+ getAutoInvestRedemptionHistory(params) {
875
+ return this.getPrivate('sapi/v1/lending/auto-invest/redeem/history', params);
876
+ }
877
+ getAutoInvestPlan(params) {
878
+ return this.getPrivate('sapi/v1/lending/auto-invest/plan/id', params);
879
+ }
880
+ getAutoInvestUserIndex(params) {
881
+ return this.getPrivate('sapi/v1/lending/auto-invest/index/user-summary', params);
882
+ }
883
+ getAutoInvestRebalanceHistory(params) {
884
+ return this.getPrivate('sapi/v1/lending/auto-invest/rebalance/history', params);
718
885
  }
719
886
  /**
720
- * Query isolated margin fee data
721
- */
722
- getIsolatedMarginFeeData(params) {
723
- return this.getPrivate('sapi/v1/margin/isolatedMarginData', params);
887
+ *
888
+ * CONVERT Endpoints - Market Data
889
+ *
890
+ **/
891
+ getConvertPairs(params) {
892
+ return this.getPrivate('sapi/v1/convert/exchangeInfo', params);
893
+ }
894
+ getConvertAssetInfo() {
895
+ return this.getPrivate('sapi/v1/convert/assetInfo');
724
896
  }
725
897
  /**
726
- * Query isolated margin tier data
727
- */
728
- getIsolatedMarginTierData(params) {
729
- return this.getPrivate('sapi/v1/margin/isolatedMarginTier', params);
898
+ *
899
+ * CONVERT Endpoints - Trade
900
+ *
901
+ **/
902
+ convertQuoteRequest(params) {
903
+ return this.postPrivate('sapi/v1/convert/getQuote', params);
730
904
  }
731
- getMarginOrderCountUsage(params) {
732
- return this.getPrivate('sapi/v1/margin/rateLimit/order', params);
905
+ acceptQuoteRequest(params) {
906
+ return this.postPrivate('sapi/v1/convert/acceptQuote', params);
733
907
  }
734
- getCrossMarginCollateralRatio() {
735
- return this.getPrivate('sapi/v1/margin/crossMarginCollateralRatio');
908
+ getConvertTradeHistory(params) {
909
+ return this.getPrivate('sapi/v1/convert/tradeFlow', params);
736
910
  }
737
- getSmallLiabilityExchangeCoins() {
738
- return this.getPrivate('sapi/v1/margin/exchange-small-liability');
911
+ getOrderStatus(params) {
912
+ return this.getPrivate('sapi/v1/convert/orderStatus', params);
739
913
  }
740
- submitSmallLiabilityExchange(params) {
741
- return this.postPrivate('sapi/v1/margin/exchange-small-liability', params);
914
+ submitConvertLimitOrder(params) {
915
+ return this.postPrivate('sapi/v1/convert/limit/placeOrder', params);
742
916
  }
743
- getSmallLiabilityExchangeHistory(params) {
744
- return this.getPrivate('sapi/v1/margin/exchange-small-liability-history', params);
917
+ cancelConvertLimitOrder(params) {
918
+ return this.postPrivate('sapi/v1/convert/limit/cancelOrder', params);
745
919
  }
746
- getNextHourlyInterestRate(params) {
747
- return this.getPrivate('sapi/v1/margin/next-hourly-interest-rate', params);
920
+ getConvertLimitOpenOrders() {
921
+ return this.getPrivate('sapi/v1/convert/limit/queryOpenOrders');
748
922
  }
749
- getMarginCapitalFlow(params) {
750
- return this.getPrivate('sapi/v1/margin/capital-flow', params);
923
+ /**
924
+ *
925
+ * STAKING Endpoints - Account
926
+ *
927
+ **/
928
+ /**
929
+ * @deprecated use getEthStakingAccountV2 instead
930
+ **/
931
+ getEthStakingAccount() {
932
+ return this.getPrivate('sapi/v1/eth-staking/account');
751
933
  }
752
- getMarginDelistSchedule() {
753
- return this.getPrivate('sapi/v1/margin/delist-schedule');
934
+ getEthStakingAccountV2() {
935
+ return this.getPrivate('sapi/v2/eth-staking/account');
754
936
  }
755
- getMarginAvailableInventory(params) {
756
- return this.getPrivate('sapi/v1/margin/available-inventory', params);
937
+ getEthStakingQuota() {
938
+ return this.getPrivate('sapi/v1/eth-staking/eth/quota');
757
939
  }
758
- submitManualLiquidation(params) {
759
- return this.postPrivate('sapi/v1/margin/manual-liquidation', params);
940
+ /**
941
+ *
942
+ * STAKING Endpoints - Staking
943
+ *
944
+ **/
945
+ /**
946
+ * @deprecated use subscribeEthStakingV2 instead
947
+ **/
948
+ subscribeEthStakingV1(params) {
949
+ return this.postPrivate('sapi/v1/eth-staking/eth/stake', params);
760
950
  }
761
- getLeverageBracket() {
762
- return this.getPrivate('sapi/v1/margin/leverageBracket');
951
+ subscribeEthStakingV2(params) {
952
+ return this.postPrivate('sapi/v2/eth-staking/eth/stake', params);
953
+ }
954
+ redeemEth(params) {
955
+ return this.postPrivate('sapi/v1/eth-staking/eth/redeem', params);
956
+ }
957
+ wrapBeth(params) {
958
+ return this.postPrivate('sapi/v1/eth-staking/wbeth/wrap', params);
763
959
  }
764
960
  /**
765
961
  *
766
- * User Data Stream Endpoints
962
+ * STAKING Endpoints - History
767
963
  *
768
964
  **/
769
- // spot
770
- getSpotUserDataListenKey() {
771
- return this.post('api/v3/userDataStream');
965
+ getEthStakingHistory(params) {
966
+ return this.getPrivate('sapi/v1/eth-staking/eth/history/stakingHistory', params);
772
967
  }
773
- keepAliveSpotUserDataListenKey(listenKey) {
774
- return this.put(`api/v3/userDataStream?listenKey=${listenKey}`);
968
+ getEthRedemptionHistory(params) {
969
+ return this.getPrivate('sapi/v1/eth-staking/eth/history/redemptionHistory', params);
775
970
  }
776
- closeSpotUserDataListenKey(listenKey) {
777
- return this.delete(`api/v3/userDataStream?listenKey=${listenKey}`);
971
+ getBethRewardsHistory(params) {
972
+ return this.getPrivate('sapi/v1/eth-staking/eth/history/rewardsHistory', params);
778
973
  }
779
- // margin
780
- getMarginUserDataListenKey() {
781
- return this.post('sapi/v1/userDataStream');
974
+ getWbethRewardsHistory(params) {
975
+ return this.getPrivate('sapi/v1/eth-staking/eth/history/wbethRewardsHistory', params);
782
976
  }
783
- keepAliveMarginUserDataListenKey(listenKey) {
784
- return this.put(`sapi/v1/userDataStream?listenKey=${listenKey}`);
977
+ getEthRateHistory(params) {
978
+ return this.getPrivate('sapi/v1/eth-staking/eth/history/rateHistory', params);
785
979
  }
786
- closeMarginUserDataListenKey(listenKey) {
787
- return this.delete(`sapi/v1/userDataStream?listenKey=${listenKey}`);
980
+ getBethWrapHistory(params) {
981
+ return this.getPrivate('sapi/v1/eth-staking/wbeth/history/wrapHistory', params);
788
982
  }
789
- // isolated margin
790
- getIsolatedMarginUserDataListenKey(params) {
791
- return this.post(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
983
+ getBethUnwrapHistory(params) {
984
+ return this.getPrivate('sapi/v1/eth-staking/wbeth/history/unwrapHistory', params);
792
985
  }
793
- keepAliveIsolatedMarginUserDataListenKey(params) {
794
- return this.put(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
986
+ /**
987
+ * @deprecated as of 2024-01-19
988
+ */
989
+ getStakingProducts(params) {
990
+ return this.getPrivate(`sapi/v1/staking/productList`, params);
991
+ }
992
+ /**
993
+ * @deprecated as of 2024-01-19
994
+ */
995
+ getStakingProductPosition(params) {
996
+ return this.getPrivate('sapi/v1/staking/position', params);
997
+ }
998
+ /**
999
+ * @deprecated as of 2024-01-19
1000
+ */
1001
+ getStakingHistory(params) {
1002
+ return this.getPrivate('sapi/v1/staking/stakingRecord', params);
795
1003
  }
796
- closeIsolatedMarginUserDataListenKey(params) {
797
- return this.delete(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1004
+ /**
1005
+ * @deprecated as of 2024-01-19
1006
+ */
1007
+ getPersonalLeftQuotaOfStakingProduct(params) {
1008
+ return this.getPrivate('sapi/v1/staking/personalLeftQuota', params);
798
1009
  }
799
1010
  /**
800
1011
  *
801
- * Simple earn Endpoints
1012
+ * COPY TRADING Endpoints - Future copy trading
802
1013
  *
803
1014
  **/
804
- getFlexibleSavingProducts(params) {
805
- return this.getPrivate(`/sapi/v1/simple-earn/flexible/list`, params);
806
- }
807
- getSimpleEarnLockedProductList(params) {
808
- return this.getPrivate(`/sapi/v1/simple-earn/locked/list`, params);
809
- }
810
- purchaseFlexibleProduct(params) {
811
- return this.postPrivate(`/sapi/v1/simple-earn/flexible/subscribe`, params);
1015
+ getFuturesLeadTraderStatus() {
1016
+ return this.getPrivate('sapi/v1/copyTrading/futures/userStatus');
812
1017
  }
813
- subscribeSimpleEarnLockedProduct(params) {
814
- return this.postPrivate(`/sapi/v1/simple-earn/locked/subscribe`, params);
1018
+ getFuturesLeadTradingSymbolWhitelist() {
1019
+ return this.getPrivate('sapi/v1/copyTrading/futures/leadSymbol');
815
1020
  }
816
- redeemLockedProduct(params) {
817
- return this.postPrivate(`/sapi/v1/simple-earn/locked/redeem`, params);
1021
+ /**
1022
+ *
1023
+ * MINING Endpoints - rest api
1024
+ *
1025
+ **/
1026
+ getMiningAlgos() {
1027
+ return this.get('sapi/v1/mining/pub/algoList');
818
1028
  }
819
- redeemFlexibleProduct(params) {
820
- return this.postPrivate(`/sapi/v1/simple-earn/flexible/redeem`, params);
1029
+ getMiningCoins() {
1030
+ return this.get('sapi/v1/mining/pub/coinList');
821
1031
  }
822
- getFlexibleProductPosition(params) {
823
- return this.getPrivate(`/sapi/v1/simple-earn/flexible/position`, params);
1032
+ getHashrateResales(params) {
1033
+ return this.getPrivate('sapi/v1/mining/hash-transfer/config/details/list', params);
824
1034
  }
825
- getLockedProductPosition(params) {
826
- return this.getPrivate(`/sapi/v1/simple-earn/locked/position`, params);
1035
+ getMiners(params) {
1036
+ return this.getPrivate('sapi/v1/mining/worker/list', params);
827
1037
  }
828
- getSimpleEarnAccount() {
829
- return this.getPrivate(`/sapi/v1/simple-earn/account`);
1038
+ getMinerDetails(params) {
1039
+ return this.getPrivate('sapi/v1/mining/worker/detail', params);
830
1040
  }
831
- getFlexibleSubscriptionRecord(params) {
832
- return this.getPrivate('sapi/v1/simple-earn/flexible/history/subscriptionRecord', params);
1041
+ getExtraBonuses(params) {
1042
+ return this.getPrivate('sapi/v1/mining/payment/other', params);
833
1043
  }
834
- getLockedSubscriptionRecord(params) {
835
- return this.getPrivate('sapi/v1/simple-earn/locked/history/subscriptionRecord', params);
1044
+ getMiningEarnings(params) {
1045
+ return this.getPrivate('sapi/v1/mining/payment/list', params);
836
1046
  }
837
- getFlexibleRedemptionRecord(params) {
838
- return this.getPrivate('sapi/v1/simple-earn/flexible/history/redemptionRecord', params);
1047
+ cancelHashrateResaleConfig(params) {
1048
+ return this.postPrivate('sapi/v1/mining/hash-transfer/config/cancel', params);
839
1049
  }
840
- getLockedRedemptionRecord(params) {
841
- return this.getPrivate('sapi/v1/simple-earn/locked/history/redemptionRecord', params);
1050
+ getHashrateResale(params) {
1051
+ return this.getPrivate('sapi/v1/mining/hash-transfer/profit/details', params);
842
1052
  }
843
- getFlexibleRewardsHistory(params) {
844
- return this.getPrivate('sapi/v1/simple-earn/flexible/history/rewardsRecord', params);
1053
+ getMiningAccountEarnings(params) {
1054
+ return this.getPrivate('sapi/v1/mining/payment/uid', params);
845
1055
  }
846
- getLockedRewardsHistory(params) {
847
- return this.getPrivate('sapi/v1/simple-earn/locked/history/rewardsRecord', params);
1056
+ getMiningStatistics(params) {
1057
+ return this.getPrivate('sapi/v1/mining/statistics/user/status', params);
848
1058
  }
849
- setFlexibleAutoSubscribe(params) {
850
- return this.postPrivate('sapi/v1/simple-earn/flexible/setAutoSubscribe', params);
1059
+ submitHashrateResale(params) {
1060
+ return this.postPrivate('sapi/v1/mining/hash-transfer/config', params);
851
1061
  }
852
- setLockedAutoSubscribe(params) {
853
- return this.postPrivate('sapi/v1/simple-earn/locked/setAutoSubscribe', params);
1062
+ getMiningAccounts(params) {
1063
+ return this.getPrivate('sapi/v1/mining/statistics/user/list', params);
854
1064
  }
855
- getFlexiblePersonalLeftQuota(params) {
856
- return this.getPrivate('sapi/v1/simple-earn/flexible/personalLeftQuota', params);
1065
+ /**
1066
+ *
1067
+ * ALGO TRADING Endpoints - Future algo
1068
+ *
1069
+ **/
1070
+ submitVpNewOrder(params) {
1071
+ this.validateOrderId(params, 'clientAlgoId');
1072
+ return this.postPrivate('sapi/v1/algo/futures/newOrderVp', params);
857
1073
  }
858
- getLockedPersonalLeftQuota(params) {
859
- return this.getPrivate('sapi/v1/simple-earn/locked/personalLeftQuota', params);
1074
+ submitTwapNewOrder(params) {
1075
+ this.validateOrderId(params, 'clientAlgoId');
1076
+ return this.postPrivate('sapi/v1/algo/futures/newOrderTwap', params);
860
1077
  }
861
- getFlexibleSubscriptionPreview(params) {
862
- return this.getPrivate('sapi/v1/simple-earn/flexible/subscriptionPreview', params);
1078
+ cancelAlgoOrder(params) {
1079
+ return this.deletePrivate('sapi/v1/algo/futures/order', params);
863
1080
  }
864
- getLockedSubscriptionPreview(params) {
865
- return this.getPrivate('sapi/v1/simple-earn/locked/subscriptionPreview', params);
1081
+ getAlgoSubOrders(params) {
1082
+ return this.getPrivate('sapi/v1/algo/futures/subOrders', params);
866
1083
  }
867
- getRateHistory(params) {
868
- return this.getPrivate('sapi/v1/simple-earn/flexible/history/rateHistory', params);
1084
+ getAlgoOpenOrders() {
1085
+ return this.getPrivate('sapi/v1/algo/futures/openOrders');
869
1086
  }
870
- getCollateralRecord(params) {
871
- return this.getPrivate('sapi/v1/simple-earn/flexible/history/collateralRecord', params);
1087
+ getAlgoHistoricalOrders(params) {
1088
+ return this.getPrivate('sapi/v1/algo/futures/historicalOrders', params);
872
1089
  }
873
1090
  /**
874
1091
  *
875
- * Dual Investment Endpoints
1092
+ * ALGO TRADING Endpoints - Spot algo
876
1093
  *
877
1094
  **/
878
- getDualInvestmentProducts(params) {
879
- return this.getPrivate('sapi/v1/dci/product/list', params);
1095
+ submitSpotAlgoTwapOrder(params) {
1096
+ this.validateOrderId(params, 'clientAlgoId');
1097
+ return this.postPrivate('sapi/v1/algo/spot/newOrderTwap', params);
880
1098
  }
881
- subscribeDualInvestmentProduct(params) {
882
- return this.postPrivate('sapi/v1/dci/product/subscribe', params);
1099
+ cancelSpotAlgoOrder(params) {
1100
+ return this.deletePrivate('sapi/v1/algo/spot/order', params);
883
1101
  }
884
- getDualInvestmentPositions(params) {
885
- return this.getPrivate('sapi/v1/dci/product/positions', params);
1102
+ getSpotAlgoSubOrders(params) {
1103
+ return this.getPrivate('sapi/v1/algo/spot/subOrders', params);
886
1104
  }
887
- getDualInvestmentAccounts() {
888
- return this.getPrivate('sapi/v1/dci/product/accounts');
1105
+ getSpotAlgoOpenOrders() {
1106
+ return this.getPrivate('sapi/v1/algo/spot/openOrders');
889
1107
  }
890
- updateAutoCompoundStatus(params) {
891
- return this.postPrivate('sapi/v1/dci/product/auto_compound/edit-status', params);
1108
+ getSpotAlgoHistoricalOrders(params) {
1109
+ return this.getPrivate('sapi/v1/algo/spot/historicalOrders', params);
892
1110
  }
893
1111
  /**
894
1112
  *
895
- * Auto Invest Enpoints
1113
+ * CRYPTO LOAN Endpoints - Flexible rate - Market data
896
1114
  *
897
1115
  **/
898
- getAutoInvestTargetAssets(params) {
899
- return this.getPrivate('sapi/v1/lending/auto-invest/target-asset/list', params);
900
- }
901
- getAutoInvestTargetAssetsROI(params) {
902
- return this.getPrivate('sapi/v1/lending/auto-invest/target-asset/roi/list', params);
903
- }
904
- getAutoInvestAssets() {
905
- return this.getPrivate('sapi/v1/lending/auto-invest/all/asset');
906
- }
907
- getAutoInvestSourceAssets(params) {
908
- return this.getPrivate('sapi/v1/lending/auto-invest/source-asset/list', params);
909
- }
910
- submitAutoInvestmentPlan(params) {
911
- const { details } = params, allParams = __rest(params, ["details"]);
912
- const requestParameters = Object.assign({}, allParams);
913
- for (let i = 0; i < details.length; i++) {
914
- requestParameters[`details[${i}].targetAsset`] = details[i].targetAsset;
915
- requestParameters[`details[${i}].percentage`] = details[i].percentage;
916
- }
917
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', requestParameters);
918
- }
919
- submitAutoInvestmentPlanOld(params) {
920
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', params);
921
- }
922
- updateAutoInvestmentPlan(params) {
923
- const { details } = params, allParams = __rest(params, ["details"]);
924
- const requestParameters = Object.assign({}, allParams);
925
- for (let i = 0; i < details.length; i++) {
926
- requestParameters[`details[${i}].targetAsset`] = details[i].targetAsset;
927
- requestParameters[`details[${i}].percentage`] = details[i].percentage;
928
- }
929
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', requestParameters);
930
- }
931
- updateAutoInvestmentPlanOld(params) {
932
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', params);
933
- }
934
- updateAutoInvestPlanStatus(params) {
935
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit-status', params);
936
- }
937
- getAutoInvestPlans(params) {
938
- return this.getPrivate('sapi/v1/lending/auto-invest/plan/list', params);
1116
+ getCryptoLoanFlexibleCollateralAssets(params) {
1117
+ return this.getPrivate('sapi/v2/loan/flexible/collateral/data', params);
939
1118
  }
940
- getAutoInvestPlan(params) {
941
- return this.getPrivate('sapi/v1/lending/auto-invest/plan/id', params);
1119
+ getCryptoLoanFlexibleAssets(params) {
1120
+ return this.getPrivate('sapi/v2/loan/flexible/loanable/data', params);
942
1121
  }
943
- getAutoInvestSubscriptionTransactions(params) {
944
- return this.getPrivate('sapi/v1/lending/auto-invest/history/list', params);
1122
+ /**
1123
+ *
1124
+ * CRYPTO LOAN Endpoints - Flexible rate - Trade
1125
+ *
1126
+ **/
1127
+ borrowCryptoLoanFlexible(params) {
1128
+ return this.postPrivate('sapi/v2/loan/flexible/borrow', params);
945
1129
  }
946
- getAutoInvestIndex(params) {
947
- return this.getPrivate('sapi/v1/lending/auto-invest/index/info', params);
1130
+ repayCryptoLoanFlexible(params) {
1131
+ return this.postPrivate('sapi/v2/loan/flexible/repay', params);
948
1132
  }
949
- getAutoInvestUserIndex(params) {
950
- return this.getPrivate('sapi/v1/lending/auto-invest/index/user-summary', params);
1133
+ adjustCryptoLoanFlexibleLTV(params) {
1134
+ return this.postPrivate('sapi/v2/loan/flexible/adjust/ltv', params);
951
1135
  }
952
1136
  /**
953
- * https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction
954
1137
  *
955
- * @param params
956
- * @returns
957
- */
958
- submitAutoInvestOneTimeTransaction(params) {
959
- const { details } = params, allParams = __rest(params, ["details"]);
960
- const requestParameters = Object.assign({}, allParams);
961
- for (let i = 0; i < details.length; i++) {
962
- requestParameters[`details[${i}].targetAsset`] = details[i].targetAsset;
963
- requestParameters[`details[${i}].percentage`] = details[i].percentage;
964
- }
965
- return this.postPrivate('sapi/v1/lending/auto-invest/one-off', requestParameters);
966
- }
967
- getOneTimeTransactionStatus(params) {
968
- return this.getPrivate('sapi/v1/lending/auto-invest/one-off/status', params);
1138
+ * CRYPTO LOAN Endpoints - Flexible rate - User info
1139
+ *
1140
+ **/
1141
+ getCryptoLoanFlexibleLTVAdjustmentHistory(params) {
1142
+ return this.getPrivate('sapi/v2/loan/flexible/ltv/adjustment/history', params);
969
1143
  }
970
- submitAutoInvestRedemption(params) {
971
- return this.postPrivate('sapi/v1/lending/auto-invest/redeem', params);
1144
+ getLoanFlexibleBorrowHistory(params) {
1145
+ return this.getPrivate('sapi/v2/loan/flexible/borrow/history', params);
972
1146
  }
973
- getAutoInvestRedemptionHistory(params) {
974
- return this.getPrivate('sapi/v1/lending/auto-invest/redeem/history', params);
1147
+ getCryptoLoanFlexibleOngoingOrders(params) {
1148
+ return this.getPrivate('sapi/v2/loan/flexible/ongoing/orders', params);
975
1149
  }
976
- getAutoInvestRebalanceHistory(params) {
977
- return this.getPrivate('sapi/v1/lending/auto-invest/rebalance/history', params);
1150
+ getLoanFlexibleRepaymentHistory(params) {
1151
+ return this.getPrivate('sapi/v2/loan/flexible/repay/history', params);
978
1152
  }
979
1153
  /**
980
1154
  *
981
- * Staking Endpoints
1155
+ * CRYPTO LOAN Endpoints - Stable rate - Market data
982
1156
  *
983
1157
  **/
984
- /**
985
- * @deprecated as of 2024-01-19
986
- */
987
- getStakingProducts(params) {
988
- return this.getPrivate(`sapi/v1/staking/productList`, params);
1158
+ getCryptoLoanLoanableAssets(params) {
1159
+ return this.getPrivate('sapi/v1/loan/loanable/data', params);
989
1160
  }
990
- /**
991
- * @deprecated as of 2024-01-19
992
- */
993
- getStakingProductPosition(params) {
994
- return this.getPrivate('sapi/v1/staking/position', params);
1161
+ getCryptoLoanCollateralRepayRate(params) {
1162
+ return this.getPrivate('sapi/v1/loan/repay/collateral/rate', params);
995
1163
  }
996
- /**
997
- * @deprecated as of 2024-01-19
998
- */
999
- getStakingHistory(params) {
1000
- return this.getPrivate('sapi/v1/staking/stakingRecord', params);
1164
+ getCryptoLoanCollateralAssetsData(params) {
1165
+ return this.getPrivate('sapi/v1/loan/collateral/data', params);
1166
+ }
1167
+ getCryptoLoansIncomeHistory(params) {
1168
+ return this.getPrivate('sapi/v1/loan/income', params);
1001
1169
  }
1002
1170
  /**
1003
- * @deprecated as of 2024-01-19
1004
- */
1005
- getPersonalLeftQuotaOfStakingProduct(params) {
1006
- return this.getPrivate('sapi/v1/staking/personalLeftQuota', params);
1171
+ *
1172
+ * CRYPTO LOAN Endpoints - Stable rate - Trade
1173
+ *
1174
+ **/
1175
+ borrowCryptoLoan(params) {
1176
+ return this.postPrivate('sapi/v1/loan/borrow', params);
1007
1177
  }
1008
- subscribeEthStakingV1(params) {
1009
- return this.postPrivate('sapi/v1/eth-staking/eth/stake', params);
1178
+ repayCryptoLoan(params) {
1179
+ return this.postPrivate('sapi/v1/loan/repay', params);
1010
1180
  }
1011
- subscribeEthStakingV2(params) {
1012
- return this.postPrivate('sapi/v2/eth-staking/eth/stake', params);
1181
+ adjustCryptoLoanLTV(params) {
1182
+ return this.postPrivate('sapi/v1/loan/adjust/ltv', params);
1013
1183
  }
1014
- redeemEth(params) {
1015
- return this.postPrivate('sapi/v1/eth-staking/eth/redeem', params);
1184
+ customizeCryptoLoanMarginCall(params) {
1185
+ return this.postPrivate('sapi/v1/loan/customize/margin_call', params);
1016
1186
  }
1017
- getEthStakingHistory(params) {
1018
- return this.getPrivate('sapi/v1/eth-staking/eth/history/stakingHistory', params);
1187
+ /**
1188
+ *
1189
+ * CRYPTO LOAN Endpoints - Stable rate - User info
1190
+ *
1191
+ **/
1192
+ getCryptoLoanOngoingOrders(params) {
1193
+ return this.getPrivate('sapi/v1/loan/ongoing/orders', params);
1019
1194
  }
1020
- getEthRedemptionHistory(params) {
1021
- return this.getPrivate('sapi/v1/eth-staking/eth/history/redemptionHistory', params);
1195
+ getCryptoLoanBorrowHistory(params) {
1196
+ return this.getPrivate('sapi/v1/loan/borrow/history', params);
1022
1197
  }
1023
- getBethRewardsHistory(params) {
1024
- return this.getPrivate('sapi/v1/eth-staking/eth/history/rewardsHistory', params);
1198
+ getCryptoLoanLTVAdjustmentHistory(params) {
1199
+ return this.getPrivate('sapi/v1/loan/ltv/adjustment/history', params);
1025
1200
  }
1026
- getEthStakingQuota() {
1027
- return this.getPrivate('sapi/v1/eth-staking/eth/quota');
1201
+ getCryptoLoanRepaymentHistory(params) {
1202
+ return this.getPrivate('sapi/v1/loan/repay/history', params);
1028
1203
  }
1029
- getEthRateHistory(params) {
1030
- return this.getPrivate('sapi/v1/eth-staking/eth/history/rateHistory', params);
1204
+ /**
1205
+ *
1206
+ * SIMPLE EARN Endpoints - Account
1207
+ *
1208
+ **/
1209
+ getSimpleEarnAccount() {
1210
+ return this.getPrivate(`/sapi/v1/simple-earn/account`);
1031
1211
  }
1032
- getEthStakingAccount() {
1033
- return this.getPrivate('sapi/v1/eth-staking/account');
1212
+ getFlexibleSavingProducts(params) {
1213
+ return this.getPrivate(`/sapi/v1/simple-earn/flexible/list`, params);
1034
1214
  }
1035
- getEthStakingAccountV2() {
1036
- return this.getPrivate('sapi/v2/eth-staking/account');
1215
+ getSimpleEarnLockedProductList(params) {
1216
+ return this.getPrivate(`/sapi/v1/simple-earn/locked/list`, params);
1037
1217
  }
1038
- wrapBeth(params) {
1039
- return this.postPrivate('sapi/v1/eth-staking/wbeth/wrap', params);
1218
+ getFlexibleProductPosition(params) {
1219
+ return this.getPrivate(`/sapi/v1/simple-earn/flexible/position`, params);
1040
1220
  }
1041
- getBethWrapHistory(params) {
1042
- return this.getPrivate('sapi/v1/eth-staking/wbeth/history/wrapHistory', params);
1221
+ getLockedProductPosition(params) {
1222
+ return this.getPrivate(`/sapi/v1/simple-earn/locked/position`, params);
1043
1223
  }
1044
- getBethUnwrapHistory(params) {
1045
- return this.getPrivate('sapi/v1/eth-staking/wbeth/history/unwrapHistory', params);
1224
+ getFlexiblePersonalLeftQuota(params) {
1225
+ return this.getPrivate('sapi/v1/simple-earn/flexible/personalLeftQuota', params);
1046
1226
  }
1047
- getWbethRewardsHistory(params) {
1048
- return this.getPrivate('sapi/v1/eth-staking/eth/history/wbethRewardsHistory', params);
1227
+ getLockedPersonalLeftQuota(params) {
1228
+ return this.getPrivate('sapi/v1/simple-earn/locked/personalLeftQuota', params);
1049
1229
  }
1050
1230
  /**
1051
1231
  *
1052
- * Savings Endpoints
1053
- * @deprecated as of 2023-06-22, now Simple Earn
1232
+ * SIMPLE EARN Endpoints - Earn
1233
+ *
1054
1234
  **/
1055
- /**
1056
- * @deprecated as of 2023-06-22, now Simple Earn
1057
- */
1058
- getLeftDailyPurchaseQuotaFlexibleProduct(params) {
1059
- return this.getPrivate(`sapi/v1/lending/daily/userLeftQuota`, params);
1060
- }
1061
- /**
1062
- * @deprecated as of 2023-06-22, now Simple Earn
1063
- */
1064
- getLeftDailyRedemptionQuotaFlexibleProduct(params) {
1065
- return this.getPrivate(`sapi/v1/lending/daily/userRedemptionQuota`, params);
1235
+ purchaseFlexibleProduct(params) {
1236
+ return this.postPrivate(`/sapi/v1/simple-earn/flexible/subscribe`, params);
1066
1237
  }
1067
- /**
1068
- * @deprecated as of 2023-06-22, now Simple Earn
1069
- */
1070
- purchaseFixedAndActivityProject(params) {
1071
- return this.postPrivate(`sapi/v1/lending/customizedFixed/purchase`, params);
1238
+ subscribeSimpleEarnLockedProduct(params) {
1239
+ return this.postPrivate(`/sapi/v1/simple-earn/locked/subscribe`, params);
1072
1240
  }
1073
- /**
1074
- * @deprecated as of 2023-06-22, now Simple Earn
1075
- */
1076
- getFixedAndActivityProjects(params) {
1077
- return this.getPrivate(`sapi/v1/lending/project/list`, params);
1241
+ redeemFlexibleProduct(params) {
1242
+ return this.postPrivate(`/sapi/v1/simple-earn/flexible/redeem`, params);
1078
1243
  }
1079
- /**
1080
- * @deprecated as of 2023-06-22, now Simple Earn
1081
- */
1082
- getFixedAndActivityProductPosition(params) {
1083
- return this.getPrivate(`sapi/v1/lending/project/position/list`, params);
1244
+ redeemLockedProduct(params) {
1245
+ return this.postPrivate(`/sapi/v1/simple-earn/locked/redeem`, params);
1084
1246
  }
1085
- /**
1086
- * @deprecated as of 2023-06-22, now Simple Earn
1087
- */
1088
- getLendingAccount() {
1089
- return this.getPrivate(`sapi/v1/lending/union/account`);
1247
+ setFlexibleAutoSubscribe(params) {
1248
+ return this.postPrivate('sapi/v1/simple-earn/flexible/setAutoSubscribe', params);
1090
1249
  }
1091
- /**
1092
- * @deprecated as of 2023-06-22, now Simple Earn
1093
- */
1094
- getPurchaseRecord(params) {
1095
- return this.getPrivate(`sapi/v1/lending/union/purchaseRecord`, params);
1250
+ setLockedAutoSubscribe(params) {
1251
+ return this.postPrivate('sapi/v1/simple-earn/locked/setAutoSubscribe', params);
1096
1252
  }
1097
- /**
1098
- * @deprecated as of 2023-06-22, now Simple Earn
1099
- */
1100
- getRedemptionRecord(params) {
1101
- return this.getPrivate(`sapi/v1/lending/union/redemptionRecord`, params);
1253
+ getFlexibleSubscriptionPreview(params) {
1254
+ return this.getPrivate('sapi/v1/simple-earn/flexible/subscriptionPreview', params);
1102
1255
  }
1103
- /**
1104
- * @deprecated as of 2023-06-22, now Simple Earn
1105
- */
1106
- getInterestHistory(params) {
1107
- return this.getPrivate(`sapi/v1/lending/union/interestHistory`, params);
1256
+ getLockedSubscriptionPreview(params) {
1257
+ return this.getPrivate('sapi/v1/simple-earn/locked/subscriptionPreview', params);
1108
1258
  }
1109
- /**
1110
- * @deprecated as of 2023-06-22, now Simple Earn
1111
- */
1112
- changeFixedAndActivityPositionToDailyPosition(params) {
1113
- return this.postPrivate(`sapi/v1/lending/positionChanged`, params);
1259
+ setLockedProductRedeemOption(params) {
1260
+ return this.postPrivate('sapi/v1/simple-earn/locked/setRedeemOption', params);
1114
1261
  }
1115
1262
  /**
1116
1263
  *
1117
- * Mining Endpoints
1264
+ * SIMPLE EARN Endpoints - History
1118
1265
  *
1119
1266
  **/
1120
- getMiningAlgos() {
1121
- return this.get('sapi/v1/mining/pub/algoList');
1122
- }
1123
- getMiningCoins() {
1124
- return this.get('sapi/v1/mining/pub/coinList');
1125
- }
1126
- getMinerDetails(params) {
1127
- return this.getPrivate('sapi/v1/mining/worker/detail', params);
1267
+ getFlexibleSubscriptionRecord(params) {
1268
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/subscriptionRecord', params);
1128
1269
  }
1129
- getMiners(params) {
1130
- return this.getPrivate('sapi/v1/mining/worker/list', params);
1270
+ getLockedSubscriptionRecord(params) {
1271
+ return this.getPrivate('sapi/v1/simple-earn/locked/history/subscriptionRecord', params);
1131
1272
  }
1132
- getMiningEarnings(params) {
1133
- return this.getPrivate('sapi/v1/mining/payment/list', params);
1273
+ getFlexibleRedemptionRecord(params) {
1274
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/redemptionRecord', params);
1134
1275
  }
1135
- getExtraBonuses(params) {
1136
- return this.getPrivate('sapi/v1/mining/payment/other', params);
1276
+ getLockedRedemptionRecord(params) {
1277
+ return this.getPrivate('sapi/v1/simple-earn/locked/history/redemptionRecord', params);
1137
1278
  }
1138
- getHashrateResales(params) {
1139
- return this.getPrivate('sapi/v1/mining/hash-transfer/config/details/list', params);
1279
+ getFlexibleRewardsHistory(params) {
1280
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/rewardsRecord', params);
1140
1281
  }
1141
- getHashrateResale(params) {
1142
- return this.getPrivate('sapi/v1/mining/hash-transfer/profit/details', params);
1282
+ getLockedRewardsHistory(params) {
1283
+ return this.getPrivate('sapi/v1/simple-earn/locked/history/rewardsRecord', params);
1143
1284
  }
1144
- submitHashrateResale(params) {
1145
- return this.postPrivate('sapi/v1/mining/hash-transfer/config', params);
1285
+ getCollateralRecord(params) {
1286
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/collateralRecord', params);
1146
1287
  }
1147
- cancelHashrateResaleConfig(params) {
1148
- return this.postPrivate('sapi/v1/mining/hash-transfer/config/cancel', params);
1288
+ getRateHistory(params) {
1289
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/rateHistory', params);
1149
1290
  }
1150
- getMiningStatistics(params) {
1151
- return this.getPrivate('sapi/v1/mining/statistics/user/status', params);
1291
+ /**
1292
+ *
1293
+ * VIP LOAN Endpoints - Market Data
1294
+ *
1295
+ **/
1296
+ getVipBorrowInterestRate(params) {
1297
+ return this.getPrivate('sapi/v1/loan/vip/request/interestRate', params);
1152
1298
  }
1153
- getMiningAccounts(params) {
1154
- return this.getPrivate('sapi/v1/mining/statistics/user/list', params);
1299
+ getVipLoanableAssets(params) {
1300
+ return this.getPrivate('sapi/v1/loan/vip/loanable/data', params);
1155
1301
  }
1156
- getMiningAccountEarnings(params) {
1157
- return this.getPrivate('sapi/v1/mining/payment/uid', params);
1302
+ getVipCollateralAssets(params) {
1303
+ return this.getPrivate('sapi/v1/loan/vip/collateral/data', params);
1158
1304
  }
1159
1305
  /**
1160
1306
  *
1161
- * Futures Management Endpoints:
1162
- * https://binance-docs.github.io/apidocs/spot/en/#futures
1163
- *
1164
- * Note: to trade futures use the usdm-client or coinm-client.
1165
- * MainClient only has the futures endpoints listed in the "spot" docs category, primarily used for transfers.
1307
+ * VIP LOAN Endpoints - User Info
1166
1308
  *
1167
1309
  **/
1168
- /**
1169
- * Execute transfer between spot account and futures account.
1170
- *
1171
- * Type:
1172
- * - 1: transfer from spot account to USDT-Ⓜ futures account.
1173
- * - 2: transfer from USDT-Ⓜ futures account to spot account.
1174
- * - 3: transfer from spot account to COIN-Ⓜ futures account.
1175
- * - 4: transfer from COIN-Ⓜ futures account to spot account.
1176
- */
1177
- submitNewFutureAccountTransfer(params) {
1178
- return this.postPrivate(`sapi/v1/futures/transfer`, params);
1310
+ getVipLoanOpenOrders(params) {
1311
+ return this.getPrivate('sapi/v1/loan/vip/ongoing/orders', params);
1179
1312
  }
1180
- getFutureAccountTransferHistory(params) {
1181
- return this.getPrivate(`sapi/v1/futures/transfer`, params);
1313
+ getVipLoanRepaymentHistory(params) {
1314
+ return this.getPrivate('sapi/v1/loan/vip/repay/history', params);
1182
1315
  }
1183
- getFuturesTickLevelOrderbookDataLink(params) {
1184
- return this.getPrivate('sapi/v1/futures/histDataLink', params);
1316
+ checkVipCollateralAccount(params) {
1317
+ return this.getPrivate('sapi/v1/loan/vip/collateral/account', params);
1185
1318
  }
1186
- /**
1187
- * @deprecated as of 2023-09-25
1188
- */
1189
- getCrossCollateralBorrowHistory(params) {
1190
- return this.getPrivate(`sapi/v1/futures/loan/borrow/history`, params);
1319
+ getVipApplicationStatus(params) {
1320
+ return this.getPrivate('sapi/v1/loan/vip/request/data', params);
1191
1321
  }
1192
1322
  /**
1193
- * @deprecated as of 2023-09-25
1194
- */
1195
- getCrossCollateralRepaymentHistory(params) {
1196
- return this.getPrivate(`sapi/v1/futures/loan/repay/history`, params);
1323
+ *
1324
+ * VIP LOAN Endpoints - Trade
1325
+ *
1326
+ **/
1327
+ renewVipLoan(params) {
1328
+ return this.postPrivate('sapi/v1/loan/vip/renew', params);
1329
+ }
1330
+ repayVipLoan(params) {
1331
+ return this.postPrivate('sapi/v1/loan/vip/repay', params);
1332
+ }
1333
+ borrowVipLoan(params) {
1334
+ return this.postPrivate('sapi/v1/loan/vip/borrow', params);
1197
1335
  }
1198
1336
  /**
1199
- * @deprecated as of 2023-09-25
1200
- */
1201
- getCrossCollateralWalletV2() {
1202
- return this.getPrivate(`sapi/v2/futures/loan/wallet`);
1337
+ *
1338
+ * DUAL INVESTMENT Endpoints - Market Data
1339
+ *
1340
+ **/
1341
+ getDualInvestmentProducts(params) {
1342
+ return this.getPrivate('sapi/v1/dci/product/list', params);
1203
1343
  }
1204
1344
  /**
1205
- * @deprecated as of 2023-09-25
1206
- */
1207
- getAdjustCrossCollateralLTVHistory(params) {
1208
- return this.getPrivate(`sapi/v1/futures/loan/adjustCollateral/history`, params);
1345
+ *
1346
+ * DUAL INVESTMENT Endpoints - Trade
1347
+ *
1348
+ **/
1349
+ subscribeDualInvestmentProduct(params) {
1350
+ return this.postPrivate('sapi/v1/dci/product/subscribe', params);
1351
+ }
1352
+ getDualInvestmentPositions(params) {
1353
+ return this.getPrivate('sapi/v1/dci/product/positions', params);
1209
1354
  }
1210
- /**
1211
- * @deprecated as of 2023-09-25
1212
- */
1213
- getCrossCollateralLiquidationHistory(params) {
1214
- return this.getPrivate(`sapi/v1/futures/loan/liquidationHistory`, params);
1355
+ getDualInvestmentAccounts() {
1356
+ return this.getPrivate('sapi/v1/dci/product/accounts');
1215
1357
  }
1216
- /**
1217
- * @deprecated as of 2023-09-25
1218
- */
1219
- getCrossCollateralInterestHistory(params) {
1220
- return this.getPrivate(`sapi/v1/futures/loan/interestHistory`, params);
1358
+ updateAutoCompoundStatus(params) {
1359
+ return this.postPrivate('sapi/v1/dci/product/auto_compound/edit-status', params);
1221
1360
  }
1222
1361
  /**
1223
1362
  *
1224
- * Futures Algo Endpoints
1363
+ * GIFT CARD Endpoints - Market Data
1225
1364
  *
1226
1365
  **/
1227
- submitVpNewOrder(params) {
1228
- this.validateOrderId(params, 'clientAlgoId');
1229
- return this.postPrivate('sapi/v1/algo/futures/newOrderVp', params);
1366
+ createGiftCard(params) {
1367
+ return this.postPrivate('sapi/v1/giftcard/createCode', params);
1230
1368
  }
1231
- submitTwapNewOrder(params) {
1232
- this.validateOrderId(params, 'clientAlgoId');
1233
- return this.postPrivate('sapi/v1/algo/futures/newOrderTwap', params);
1369
+ createDualTokenGiftCard(params) {
1370
+ return this.postPrivate('sapi/v1/giftcard/buyCode', params);
1234
1371
  }
1235
- cancelAlgoOrder(params) {
1236
- return this.deletePrivate('sapi/v1/algo/futures/order', params);
1372
+ redeemGiftCard(params) {
1373
+ return this.postPrivate('sapi/v1/giftcard/redeemCode', params);
1237
1374
  }
1238
- getAlgoOpenOrders() {
1239
- return this.getPrivate('sapi/v1/algo/futures/openOrders');
1375
+ verifyGiftCard(params) {
1376
+ return this.getPrivate('sapi/v1/giftcard/verify', params);
1240
1377
  }
1241
- getAlgoHistoricalOrders(params) {
1242
- return this.getPrivate('sapi/v1/algo/futures/historicalOrders', params);
1378
+ getTokenLimit(params) {
1379
+ return this.getPrivate('sapi/v1/giftcard/buyCode/token-limit', params);
1243
1380
  }
1244
- getAlgoSubOrders(params) {
1245
- return this.getPrivate('sapi/v1/algo/futures/subOrders', params);
1381
+ getRsaPublicKey() {
1382
+ return this.getPrivate('sapi/v1/giftcard/cryptography/rsa-public-key');
1246
1383
  }
1247
1384
  /**
1248
1385
  *
1249
- * Spot Algo Endpoints
1386
+ * NFT Endpoints - REST api
1250
1387
  *
1251
1388
  **/
1252
- submitSpotAlgoTwapOrder(params) {
1253
- this.validateOrderId(params, 'clientAlgoId');
1254
- return this.postPrivate('sapi/v1/algo/spot/newOrderTwap', params);
1255
- }
1256
- cancelSpotAlgoOrder(params) {
1257
- return this.deletePrivate('sapi/v1/algo/spot/order', params);
1389
+ getNftTransactionHistory(params) {
1390
+ return this.getPrivate('sapi/v1/nft/history/transactions', params);
1258
1391
  }
1259
- getSpotAlgoOpenOrders() {
1260
- return this.getPrivate('sapi/v1/algo/spot/openOrders');
1392
+ getNftDepositHistory(params) {
1393
+ return this.getPrivate('sapi/v1/nft/history/deposit', params);
1261
1394
  }
1262
- getSpotAlgoHistoricalOrders(params) {
1263
- return this.getPrivate('sapi/v1/algo/spot/historicalOrders', params);
1395
+ getNftWithdrawHistory(params) {
1396
+ return this.getPrivate('sapi/v1/nft/history/withdraw', params);
1264
1397
  }
1265
- getSpotAlgoSubOrders(params) {
1266
- return this.getPrivate('sapi/v1/algo/spot/subOrders', params);
1398
+ getNftAsset(params) {
1399
+ return this.getPrivate('sapi/v1/nft/user/getAsset', params);
1267
1400
  }
1268
1401
  /**
1269
1402
  *
1270
- * Portfolio Margin Pro
1403
+ * C2C Endpoints
1271
1404
  *
1272
1405
  **/
1273
- getPortfolioMarginProAccountInfo() {
1274
- return this.getPrivate('sapi/v1/portfolio/account');
1275
- }
1276
- getPortfolioMarginProCollateralRate() {
1277
- return this.get('sapi/v1/portfolio/collateralRate');
1406
+ getC2CTradeHistory(params) {
1407
+ return this.getPrivate('sapi/v1/c2c/orderMatch/listUserOrderHistory', params);
1278
1408
  }
1279
- getPortfolioMarginProBankruptcyLoanAmount() {
1280
- return this.getPrivate('sapi/v1/portfolio/pmLoan');
1409
+ /**
1410
+ *
1411
+ * FIAT Endpoints - REST api
1412
+ *
1413
+ **/
1414
+ getFiatOrderHistory(params) {
1415
+ return this.getPrivate('sapi/v1/fiat/orders', params);
1281
1416
  }
1282
- repayPortfolioMarginProBankruptcyLoan(params) {
1283
- return this.postPrivate('sapi/v1/portfolio/repay', params);
1417
+ getFiatPaymentsHistory(params) {
1418
+ return this.getPrivate('sapi/v1/fiat/payments', params);
1284
1419
  }
1285
- getPortfolioMarginProInterestHistory(params) {
1286
- return this.getPrivate('sapi/v1/portfolio/interest-history', params);
1420
+ /**
1421
+ *
1422
+ * Rebate Endpoints
1423
+ *
1424
+ **/
1425
+ getSpotRebateHistoryRecords(params) {
1426
+ return this.getPrivate('sapi/v1/rebate/taxQuery', params);
1287
1427
  }
1428
+ /**
1429
+ *
1430
+ * DERIVATIVES - Portfolio Margin Pro - Market Data
1431
+ * This is in mainclient because it shares the same base url
1432
+ *
1433
+ **/
1288
1434
  getPortfolioMarginIndexPrice(params) {
1289
1435
  return this.get('sapi/v1/portfolio/asset-index-price', params);
1290
1436
  }
1437
+ getPortfolioMarginAssetLeverage() {
1438
+ return this.getPrivate('sapi/v1/portfolio/margin-asset-leverage');
1439
+ }
1440
+ /**
1441
+ *
1442
+ * DERIVATIVES - Portfolio Margin Pro - Account
1443
+ * This is in mainclient because it shares the same base url
1444
+ *
1445
+ **/
1446
+ getPortfolioMarginProCollateralRate() {
1447
+ return this.get('sapi/v1/portfolio/collateralRate');
1448
+ }
1449
+ getPortfolioMarginProAccountInfo() {
1450
+ return this.getPrivate('sapi/v1/portfolio/account');
1451
+ }
1452
+ bnbTransfer(params) {
1453
+ return this.postPrivate('sapi/v1/portfolio/bnb-transfer', params);
1454
+ }
1291
1455
  submitPortfolioMarginProFullTransfer() {
1292
1456
  return this.postPrivate('sapi/v1/portfolio/auto-collection');
1293
1457
  }
1294
1458
  submitPortfolioMarginProSpecificTransfer(params) {
1295
1459
  return this.postPrivate('sapi/v1/portfolio/asset-collection', params);
1296
1460
  }
1297
- bnbTransfer(params) {
1298
- return this.postPrivate('sapi/v1/portfolio/bnb-transfer', params);
1461
+ repayPortfolioMarginProBankruptcyLoan(params) {
1462
+ return this.postPrivate('sapi/v1/portfolio/repay', params);
1463
+ }
1464
+ getPortfolioMarginProBankruptcyLoanAmount() {
1465
+ return this.getPrivate('sapi/v1/portfolio/pmLoan');
1466
+ }
1467
+ repayFuturesNegativeBalance() {
1468
+ return this.postPrivate('sapi/v1/portfolio/repay-futures-negative-balance');
1299
1469
  }
1300
1470
  updateAutoRepayFuturesStatus(params) {
1301
1471
  return this.postPrivate('sapi/v1/portfolio/repay-futures-switch', params);
@@ -1303,16 +1473,22 @@ class MainClient extends BaseRestClient_1.default {
1303
1473
  getAutoRepayFuturesStatus() {
1304
1474
  return this.getPrivate('sapi/v1/portfolio/repay-futures-switch');
1305
1475
  }
1306
- repayFuturesNegativeBalance() {
1307
- return this.postPrivate('sapi/v1/portfolio/repay-futures-negative-balance');
1476
+ getPortfolioMarginProInterestHistory(params) {
1477
+ return this.getPrivate('sapi/v1/portfolio/interest-history', params);
1308
1478
  }
1309
- getPortfolioMarginAssetLeverage() {
1310
- return this.getPrivate('sapi/v1/portfolio/margin-asset-leverage');
1479
+ /**
1480
+ *
1481
+ * DERIVATIVES - Futures Data - Market
1482
+ * This is in mainclient because it shares the same base url
1483
+ *
1484
+ **/
1485
+ getFuturesTickLevelOrderbookDataLink(params) {
1486
+ return this.getPrivate('sapi/v1/futures/histDataLink', params);
1311
1487
  }
1312
1488
  /**
1313
1489
  *
1314
1490
  * BLVT Endpoints
1315
- *
1491
+ * BLVT category is possibly @deprecated, found only in old docs
1316
1492
  **/
1317
1493
  getBlvtInfo(params) {
1318
1494
  return this.get('sapi/v1/blvt/tokenInfo', params);
@@ -1334,225 +1510,196 @@ class MainClient extends BaseRestClient_1.default {
1334
1510
  }
1335
1511
  /**
1336
1512
  *
1337
- * Fiat Endpoints
1338
- *
1339
- **/
1340
- getFiatOrderHistory(params) {
1341
- return this.getPrivate('sapi/v1/fiat/orders', params);
1342
- }
1343
- getFiatPaymentsHistory(params) {
1344
- return this.getPrivate('sapi/v1/fiat/payments', params);
1345
- }
1346
- /**
1347
- *
1348
- * C2C Endpoints
1349
- *
1350
- **/
1351
- getC2CTradeHistory(params) {
1352
- return this.getPrivate('sapi/v1/c2c/orderMatch/listUserOrderHistory', params);
1353
- }
1354
- /**
1355
- *
1356
- * VIP Loans Endpoints
1357
- *
1513
+ * Pay endpoints
1514
+ * Found only in old docs, possibly @deprecated
1358
1515
  **/
1359
- getVipLoanOpenOrders(params) {
1360
- return this.getPrivate('sapi/v1/loan/vip/ongoing/orders', params);
1361
- }
1362
- repayVipLoan(params) {
1363
- return this.postPrivate('sapi/v1/loan/vip/repay', params);
1364
- }
1365
- getVipLoanRepaymentHistory(params) {
1366
- return this.getPrivate('sapi/v1/loan/vip/repay/history', params);
1367
- }
1368
- renewVipLoan(params) {
1369
- return this.postPrivate('sapi/v1/loan/vip/renew', params);
1370
- }
1371
- checkVipCollateralAccount(params) {
1372
- return this.getPrivate('sapi/v1/loan/vip/collateral/account', params);
1373
- }
1374
- borrowVipLoan(params) {
1375
- return this.postPrivate('sapi/v1/loan/vip/borrow', params);
1376
- }
1377
- getVipLoanableAssets(params) {
1378
- return this.getPrivate('sapi/v1/loan/vip/loanable/data', params);
1379
- }
1380
- getVipCollateralAssets(params) {
1381
- return this.getPrivate('sapi/v1/loan/vip/collateral/data', params);
1382
- }
1383
- getVipApplicationStatus(params) {
1384
- return this.getPrivate('sapi/v1/loan/vip/request/data', params);
1385
- }
1386
- getVipBorrowInterestRate(params) {
1387
- return this.getPrivate('sapi/v1/loan/vip/request/interestRate', params);
1516
+ getPayTransactions(params) {
1517
+ return this.getPrivate('sapi/v1/pay/transactions', params);
1388
1518
  }
1389
1519
  /**
1390
1520
  *
1391
- * Crypto Loans Endpoints
1392
- *
1393
- **/
1394
- getCryptoLoansIncomeHistory(params) {
1395
- return this.getPrivate('sapi/v1/loan/income', params);
1396
- }
1397
- borrowCryptoLoan(params) {
1398
- return this.postPrivate('sapi/v1/loan/borrow', params);
1399
- }
1400
- getCryptoLoanBorrowHistory(params) {
1401
- return this.getPrivate('sapi/v1/loan/borrow/history', params);
1402
- }
1403
- getCryptoLoanOngoingOrders(params) {
1404
- return this.getPrivate('sapi/v1/loan/ongoing/orders', params);
1405
- }
1406
- repayCryptoLoan(params) {
1407
- return this.postPrivate('sapi/v1/loan/repay', params);
1408
- }
1409
- getCryptoLoanRepaymentHistory(params) {
1410
- return this.getPrivate('sapi/v1/loan/repay/history', params);
1411
- }
1412
- adjustCryptoLoanLTV(params) {
1413
- return this.postPrivate('sapi/v1/loan/adjust/ltv', params);
1414
- }
1415
- getCryptoLoanLTVAdjustmentHistory(params) {
1416
- return this.getPrivate('sapi/v1/loan/ltv/adjustment/history', params);
1417
- }
1418
- getCryptoLoanLoanableAssets(params) {
1419
- return this.getPrivate('sapi/v1/loan/loanable/data', params);
1420
- }
1421
- getCryptoLoanCollateralAssetsData(params) {
1422
- return this.getPrivate('sapi/v1/loan/collateral/data', params);
1423
- }
1424
- getCryptoLoanCollateralRepayRate(params) {
1425
- return this.getPrivate('sapi/v1/loan/repay/collateral/rate', params);
1426
- }
1427
- customizeCryptoLoanMarginCall(params) {
1428
- return this.postPrivate('sapi/v1/loan/customize/margin_call', params);
1429
- }
1430
- borrowCryptoLoanFlexible(params) {
1431
- return this.postPrivate('sapi/v2/loan/flexible/borrow', params);
1432
- }
1433
- getCryptoLoanFlexibleOngoingOrders(params) {
1434
- return this.getPrivate('sapi/v2/loan/flexible/ongoing/orders', params);
1435
- }
1436
- getLoanFlexibleBorrowHistory(params) {
1437
- return this.getPrivate('sapi/v2/loan/flexible/borrow/history', params);
1521
+ * EXCHANGE LINK - Account Endpoints
1522
+ * https://developers.binance.com/docs/binance_link
1523
+ */
1524
+ createBrokerSubAccount(params) {
1525
+ return this.postPrivate('sapi/v1/broker/subAccount', params);
1438
1526
  }
1439
- repayCryptoLoanFlexible(params) {
1440
- return this.postPrivate('sapi/v2/loan/flexible/repay', params);
1527
+ getBrokerSubAccount(params) {
1528
+ return this.getPrivate('sapi/v1/broker/subAccount', params);
1441
1529
  }
1442
- getLoanFlexibleRepaymentHistory(params) {
1443
- return this.getPrivate('sapi/v2/loan/flexible/repay/history', params);
1530
+ enableMarginBrokerSubAccount(params) {
1531
+ return this.postPrivate('sapi/v1/broker/subAccount/futures', params);
1444
1532
  }
1445
- adjustCryptoLoanFlexibleLTV(params) {
1446
- return this.postPrivate('sapi/v2/loan/flexible/adjust/ltv', params);
1533
+ createApiKeyBrokerSubAccount(params) {
1534
+ return this.postPrivate('sapi/v1/broker/subAccountApi', params);
1447
1535
  }
1448
- getCryptoLoanFlexibleLTVAdjustmentHistory(params) {
1449
- return this.getPrivate('sapi/v2/loan/flexible/ltv/adjustment/history', params);
1536
+ changePermissionApiKeyBrokerSubAccount(params) {
1537
+ return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params);
1450
1538
  }
1451
- getCryptoLoanFlexibleAssets(params) {
1452
- return this.getPrivate('sapi/v2/loan/flexible/loanable/data', params);
1539
+ changeComissionBrokerSubAccount(params) {
1540
+ return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params);
1453
1541
  }
1454
- getCryptoLoanFlexibleCollateralAssets(params) {
1455
- return this.getPrivate('sapi/v2/loan/flexible/collateral/data', params);
1542
+ enableUniversalTransferApiKeyBrokerSubAccount(params) {
1543
+ return this.postPrivate('sapi/v1/broker/subAccountApi/permission/universalTransfer', params);
1456
1544
  }
1457
- /**
1458
- *
1459
- * Copy trading endpoints
1460
- *
1461
- **/
1462
- getFuturesLeadTraderStatus() {
1463
- return this.getPrivate('sapi/v1/copyTrading/futures/userStatus');
1545
+ updateIpRestrictionForSubAccountApiKey(params) {
1546
+ return this.postPrivate('sapi/v2/broker/subAccountApi/ipRestriction', params);
1464
1547
  }
1465
- getFuturesLeadTradingSymbolWhitelist() {
1466
- return this.getPrivate('sapi/v1/copyTrading/futures/leadSymbol');
1548
+ deleteIPRestrictionForSubAccountApiKey(params) {
1549
+ return this.deletePrivate('sapi/v1/broker/subAccountApi/ipRestriction/ipList', params);
1467
1550
  }
1468
- /**
1469
- *
1470
- * Pay endpoints
1471
- *
1472
- **/
1473
- getPayTransactions(params) {
1474
- return this.getPrivate('sapi/v1/pay/transactions', params);
1551
+ deleteApiKeyBrokerSubAccount(params) {
1552
+ return this.deletePrivate('sapi/v1/broker/subAccountApi', params);
1475
1553
  }
1476
- /**
1477
- *
1478
- * Convert endpoints
1479
- *
1480
- **/
1481
- getConvertPairs(params) {
1482
- return this.getPrivate('sapi/v1/convert/exchangeInfo', params);
1554
+ getSubAccountBrokerIpRestriction(params) {
1555
+ return this.getPrivate('sapi/v1/broker/subAccountApi/ipRestriction', params);
1483
1556
  }
1484
- getConvertAssetInfo() {
1485
- return this.getPrivate('sapi/v1/convert/assetInfo');
1557
+ getApiKeyBrokerSubAccount(params) {
1558
+ return this.getPrivate('sapi/v1/broker/subAccountApi', params);
1486
1559
  }
1487
- convertQuoteRequest(params) {
1488
- return this.postPrivate('sapi/v1/convert/getQuote', params);
1560
+ getBrokerInfo() {
1561
+ return this.getPrivate('sapi/v1/broker/info');
1489
1562
  }
1490
- acceptQuoteRequest(params) {
1491
- return this.postPrivate('sapi/v1/convert/acceptQuote', params);
1563
+ /**
1564
+ *
1565
+ * EXCHANGE LINK - Account Endpoints
1566
+ * https://developers.binance.com/docs/binance_link
1567
+ */
1568
+ transferBrokerSubAccount(params) {
1569
+ return this.postPrivate('sapi/v1/broker/transfer', params);
1492
1570
  }
1493
- getOrderStatus(params) {
1494
- return this.getPrivate('sapi/v1/convert/orderStatus', params);
1571
+ getBrokerSubAccountHistory(params) {
1572
+ return this.getPrivate('sapi/v1/broker/transfer', params);
1495
1573
  }
1496
- submitConvertLimitOrder(params) {
1497
- return this.postPrivate('sapi/v1/convert/limit/placeOrder', params);
1574
+ submitBrokerSubFuturesTransfer(params) {
1575
+ return this.postPrivate('sapi/v1/broker/transfer/futures', params);
1498
1576
  }
1499
- cancelConvertLimitOrder(params) {
1500
- return this.postPrivate('sapi/v1/convert/limit/cancelOrder', params);
1577
+ getSubAccountFuturesTransferHistory(params) {
1578
+ return this.getPrivate('sapi/v1/broker/transfer/futures', params);
1501
1579
  }
1502
- getConvertLimitOpenOrders() {
1503
- return this.getPrivate('sapi/v1/convert/limit/queryOpenOrders');
1580
+ universalTransferBroker(params) {
1581
+ return this.postPrivate('sapi/v1/broker/universalTransfer', params);
1504
1582
  }
1505
- getConvertTradeHistory(params) {
1506
- return this.getPrivate('sapi/v1/convert/tradeFlow', params);
1583
+ getUniversalTransferBroker(params) {
1584
+ return this.getPrivate('sapi/v1/broker/universalTransfer', params);
1507
1585
  }
1508
1586
  /**
1509
1587
  *
1510
- * Rebate Endpoints
1588
+ * EXCHANGE LINK - Fee Endpoints
1589
+ * https://developers.binance.com/docs/binance_link
1590
+ */
1591
+ /**
1511
1592
  *
1593
+ * @deprecated
1594
+ */
1595
+ // USD & Coin-M can be found under API getIncome() (find "API rebate" in results)
1596
+ getBrokerSpotRebateHistory(days, customerId) {
1597
+ if (days === 7) {
1598
+ return this.getPrivate('sapi/v1/apiReferral/rebate/recentRecord', {
1599
+ customerId,
1600
+ });
1601
+ }
1602
+ if (days === 30) {
1603
+ return this.getPrivate('sapi/v1/apiReferral/rebate/historicalRecord', {
1604
+ customerId,
1605
+ });
1606
+ }
1607
+ }
1608
+ /**
1609
+ * Broker Endpoints - only on old docs
1610
+ * @deprecated, found only in old docs
1611
+ * Use EXCHANGE LINK endpoints instead - https://developers.binance.com/docs/binance_link
1612
+ */
1613
+ /**
1614
+ * @deprecated, found only in old docs
1615
+ * Use EXCHANGE LINK endpoints instead
1512
1616
  **/
1513
- getSpotRebateHistoryRecords(params) {
1514
- return this.getPrivate('sapi/v1/rebate/taxQuery', params);
1617
+ getBrokerIfNewSpotUser() {
1618
+ return this.getPrivate('sapi/v1/apiReferral/ifNewUser');
1515
1619
  }
1516
1620
  /**
1517
- *
1518
- * NFT Endpoints
1519
- *
1621
+ * @deprecated, found only in old docs
1622
+ * Use EXCHANGE LINK endpoints instead
1520
1623
  **/
1521
- getNftTransactionHistory(params) {
1522
- return this.getPrivate('sapi/v1/nft/history/transactions', params);
1624
+ getBrokerSubAccountDepositHistory(params) {
1625
+ return this.getPrivate('sapi/v1/bv1/apiReferral/ifNewUser', params);
1523
1626
  }
1524
- getNftDepositHistory(params) {
1525
- return this.getPrivate('sapi/v1/nft/history/deposit', params);
1627
+ /**
1628
+ * @deprecated, found only in old docs
1629
+ * Use EXCHANGE LINK endpoints instead
1630
+ **/
1631
+ getBrokerUserCustomisedId(market) {
1632
+ const prefix = market === 'spot' ? 'sapi' : 'fapi';
1633
+ return this.getPrivate(prefix + '/v1/apiReferral/userCustomization');
1526
1634
  }
1527
- getNftWithdrawHistory(params) {
1528
- return this.getPrivate('sapi/v1/nft/history/withdraw', params);
1635
+ /**
1636
+ * @deprecated, found only in old docs
1637
+ * Use EXCHANGE LINK endpoints instead
1638
+ **/
1639
+ enableFuturesBrokerSubAccount(params) {
1640
+ return this.postPrivate('sapi/v1/broker/subAccount', params);
1529
1641
  }
1530
- getNftAsset(params) {
1531
- return this.getPrivate('sapi/v1/nft/user/getAsset', params);
1642
+ /**
1643
+ * @deprecated, found only in old docs
1644
+ * Use EXCHANGE LINK endpoints instead
1645
+ **/
1646
+ enableMarginApiKeyBrokerSubAccount(params) {
1647
+ return this.postPrivate('sapi/v1/broker/subAccount/margin', params);
1648
+ }
1649
+ /**
1650
+ * Validate syntax meets requirements set by binance. Log warning if not.
1651
+ */
1652
+ validateOrderId(params, orderIdProperty) {
1653
+ const apiCategory = 'spot';
1654
+ if (!params[orderIdProperty]) {
1655
+ params[orderIdProperty] = (0, requestUtils_1.generateNewOrderId)(apiCategory);
1656
+ return;
1657
+ }
1658
+ const expectedOrderIdPrefix = `x-${(0, requestUtils_1.getOrderIdPrefix)(apiCategory)}`;
1659
+ if (!params[orderIdProperty].startsWith(expectedOrderIdPrefix)) {
1660
+ (0, requestUtils_1.logInvalidOrderId)(orderIdProperty, expectedOrderIdPrefix, params);
1661
+ }
1532
1662
  }
1533
1663
  /**
1534
1664
  *
1535
- * Binance GiftCard Endpoints
1665
+ * User Data Stream Endpoints
1536
1666
  *
1537
1667
  **/
1538
- createGiftCard(params) {
1539
- return this.postPrivate('sapi/v1/giftcard/createCode', params);
1668
+ // spot
1669
+ getSpotUserDataListenKey() {
1670
+ return this.post('api/v3/userDataStream');
1540
1671
  }
1541
- createDualTokenGiftCard(params) {
1542
- return this.postPrivate('sapi/v1/giftcard/buyCode', params);
1672
+ keepAliveSpotUserDataListenKey(listenKey) {
1673
+ return this.put(`api/v3/userDataStream?listenKey=${listenKey}`);
1543
1674
  }
1544
- redeemGiftCard(params) {
1545
- return this.postPrivate('sapi/v1/giftcard/redeemCode', params);
1675
+ closeSpotUserDataListenKey(listenKey) {
1676
+ return this.delete(`api/v3/userDataStream?listenKey=${listenKey}`);
1546
1677
  }
1547
- verifyGiftCard(params) {
1548
- return this.getPrivate('sapi/v1/giftcard/verify', params);
1678
+ // margin
1679
+ getMarginUserDataListenKey() {
1680
+ return this.post('sapi/v1/userDataStream');
1549
1681
  }
1550
- getRsaPublicKey() {
1551
- return this.getPrivate('sapi/v1/giftcard/cryptography/rsa-public-key');
1682
+ keepAliveMarginUserDataListenKey(listenKey) {
1683
+ return this.put(`sapi/v1/userDataStream?listenKey=${listenKey}`);
1552
1684
  }
1553
- getTokenLimit(params) {
1554
- return this.getPrivate('sapi/v1/giftcard/buyCode/token-limit', params);
1685
+ closeMarginUserDataListenKey(listenKey) {
1686
+ return this.delete(`sapi/v1/userDataStream?listenKey=${listenKey}`);
1687
+ }
1688
+ // isolated margin
1689
+ getIsolatedMarginUserDataListenKey(params) {
1690
+ return this.post(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1691
+ }
1692
+ keepAliveIsolatedMarginUserDataListenKey(params) {
1693
+ return this.put(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1694
+ }
1695
+ closeIsolatedMarginUserDataListenKey(params) {
1696
+ return this.delete(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1555
1697
  }
1698
+ /**
1699
+ *
1700
+ * DEPRECATED ENDPOINTS
1701
+ *
1702
+ **/
1556
1703
  /**
1557
1704
  *
1558
1705
  * BSwap Endpoints
@@ -1583,18 +1730,92 @@ class MainClient extends BaseRestClient_1.default {
1583
1730
  return this.getPrivate('sapi/v1/bswap/liquidityOps', params);
1584
1731
  }
1585
1732
  /**
1586
- * Validate syntax meets requirements set by binance. Log warning if not.
1733
+ *
1734
+ * Savings Endpoints
1735
+ * @deprecated as of 2023-06-22, now Simple Earn
1736
+ **/
1737
+ /**
1738
+ * @deprecated as of 2023-06-22, now Simple Earn
1587
1739
  */
1588
- validateOrderId(params, orderIdProperty) {
1589
- const apiCategory = 'spot';
1590
- if (!params[orderIdProperty]) {
1591
- params[orderIdProperty] = (0, requestUtils_1.generateNewOrderId)(apiCategory);
1592
- return;
1593
- }
1594
- const expectedOrderIdPrefix = `x-${(0, requestUtils_1.getOrderIdPrefix)(apiCategory)}`;
1595
- if (!params[orderIdProperty].startsWith(expectedOrderIdPrefix)) {
1596
- (0, requestUtils_1.logInvalidOrderId)(orderIdProperty, expectedOrderIdPrefix, params);
1597
- }
1740
+ getLeftDailyPurchaseQuotaFlexibleProduct(params) {
1741
+ return this.getPrivate(`sapi/v1/lending/daily/userLeftQuota`, params);
1742
+ }
1743
+ /**
1744
+ * @deprecated as of 2023-06-22, now Simple Earn
1745
+ */
1746
+ getLeftDailyRedemptionQuotaFlexibleProduct(params) {
1747
+ return this.getPrivate(`sapi/v1/lending/daily/userRedemptionQuota`, params);
1748
+ }
1749
+ /**
1750
+ * @deprecated as of 2023-06-22, now Simple Earn
1751
+ */
1752
+ purchaseFixedAndActivityProject(params) {
1753
+ return this.postPrivate(`sapi/v1/lending/customizedFixed/purchase`, params);
1754
+ }
1755
+ /**
1756
+ * @deprecated as of 2023-06-22, now Simple Earn
1757
+ */
1758
+ getFixedAndActivityProjects(params) {
1759
+ return this.getPrivate(`sapi/v1/lending/project/list`, params);
1760
+ }
1761
+ /**
1762
+ * @deprecated as of 2023-06-22, now Simple Earn
1763
+ */
1764
+ getFixedAndActivityProductPosition(params) {
1765
+ return this.getPrivate(`sapi/v1/lending/project/position/list`, params);
1766
+ }
1767
+ /**
1768
+ * @deprecated as of 2023-06-22, now Simple Earn
1769
+ */
1770
+ getLendingAccount() {
1771
+ return this.getPrivate(`sapi/v1/lending/union/account`);
1772
+ }
1773
+ /**
1774
+ * @deprecated as of 2023-06-22, now Simple Earn
1775
+ */
1776
+ getPurchaseRecord(params) {
1777
+ return this.getPrivate(`sapi/v1/lending/union/purchaseRecord`, params);
1778
+ }
1779
+ /**
1780
+ * @deprecated as of 2023-06-22, now Simple Earn
1781
+ */
1782
+ getRedemptionRecord(params) {
1783
+ return this.getPrivate(`sapi/v1/lending/union/redemptionRecord`, params);
1784
+ }
1785
+ /**
1786
+ * @deprecated as of 2023-06-22, now Simple Earn
1787
+ */
1788
+ getInterestHistory(params) {
1789
+ return this.getPrivate(`sapi/v1/lending/union/interestHistory`, params);
1790
+ }
1791
+ /**
1792
+ * @deprecated as of 2023-06-22, now Simple Earn
1793
+ */
1794
+ changeFixedAndActivityPositionToDailyPosition(params) {
1795
+ return this.postPrivate(`sapi/v1/lending/positionChanged`, params);
1796
+ }
1797
+ /**
1798
+ *
1799
+ * Wallet Endpoints
1800
+ * @deprecated
1801
+ **/
1802
+ /**
1803
+ * @deprecated
1804
+ */
1805
+ enableConvertSubAccount(params) {
1806
+ return this.postPrivate('sapi/v1/broker/subAccount/convert', params);
1807
+ }
1808
+ /**
1809
+ * @deprecated
1810
+ */
1811
+ convertBUSD(params) {
1812
+ return this.postPrivate('sapi/v1/asset/convert-transfer', params);
1813
+ }
1814
+ /**
1815
+ * @deprecated
1816
+ */
1817
+ getConvertBUSDHistory(params) {
1818
+ return this.getPrivate('sapi/v1/asset/convert-transfer/queryByPage', params);
1598
1819
  }
1599
1820
  }
1600
1821
  exports.MainClient = MainClient;