binance 2.12.3 → 2.13.1

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,1249 +44,1413 @@ 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);
569
- }
570
- getMarginAccountBorrowRepayRecords(params) {
571
- return this.getPrivate('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');
572
611
  }
573
- getAllMarginAssets() {
574
- return this.get('sapi/v1/margin/allAssets');
612
+ getDelistSchedule() {
613
+ return this.getPrivate('sapi/v1/spot/delist-schedule');
575
614
  }
576
- getAllCrossMarginPairs() {
577
- return this.get('sapi/v1/margin/allPairs');
615
+ /**
616
+ *
617
+ * SUB ACCOUNT Endpoints - Account management
618
+ *
619
+ **/
620
+ createVirtualSubAccount(params) {
621
+ return this.postPrivate('sapi/v1/sub-account/virtualSubAccount', params);
578
622
  }
579
- queryMarginPriceIndex(params) {
580
- return this.get('sapi/v1/margin/priceIndex', params);
623
+ getSubAccountList(params) {
624
+ return this.getPrivate('sapi/v1/sub-account/list', params);
581
625
  }
582
- marginAccountNewOrder(params) {
583
- this.validateOrderId(params, 'newClientOrderId');
584
- return this.postPrivate('sapi/v1/margin/order', params);
626
+ subAccountEnableFutures(email) {
627
+ return this.postPrivate('sapi/v1/sub-account/futures/enable', { email });
585
628
  }
586
- marginAccountCancelOrder(params) {
587
- return this.deletePrivate('sapi/v1/margin/order', params);
629
+ subAccountEnableMargin(email) {
630
+ return this.postPrivate('sapi/v1/sub-account/margin/enable', { email });
588
631
  }
589
- marginAccountCancelOpenOrders(params) {
590
- return this.deletePrivate('sapi/v1/margin/openOrders', params);
632
+ enableOptionsForSubAccount(params) {
633
+ return this.postPrivate('sapi/v1/sub-account/eoptions/enable', params);
591
634
  }
592
- updateCrossMarginMaxLeverage(params) {
593
- return this.postPrivate('sapi/v1/margin/max-leverage', params);
635
+ subAccountEnableLeverageToken(params) {
636
+ return this.postPrivate('sapi/v1/sub-account/blvt/enable', params);
594
637
  }
595
- getCrossMarginTransferHistory(params) {
596
- return this.getPrivate('sapi/v1/margin/transfer', params);
638
+ getSubAccountStatusOnMarginOrFutures(params) {
639
+ return this.getPrivate('sapi/v1/sub-account/status', params);
597
640
  }
598
- getMarginInterestHistory(params) {
599
- return this.getPrivate('sapi/v1/margin/interestHistory', params);
641
+ getSubAccountFuturesPositionRisk(email) {
642
+ return this.getPrivate('sapi/v1/sub-account/futures/positionRisk', {
643
+ email,
644
+ });
600
645
  }
601
- getMarginForceLiquidationRecord(params) {
602
- return this.getPrivate('sapi/v1/margin/forceLiquidationRec', params);
646
+ getSubAccountFuturesPositionRiskV2(params) {
647
+ return this.getPrivate('sapi/v2/sub-account/futures/positionRisk', params);
648
+ }
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);
700
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);
808
+ }
809
+ /**
810
+ *
811
+ * AUTO INVEST Endpoints - Trade
812
+ *
813
+ **/
701
814
  /**
702
- * Get BNB burn status
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);
976
+ }
977
+ getEthRateHistory(params) {
978
+ return this.getPrivate('sapi/v1/eth-staking/eth/history/rateHistory', params);
979
+ }
980
+ getBethWrapHistory(params) {
981
+ return this.getPrivate('sapi/v1/eth-staking/wbeth/history/wrapHistory', params);
782
982
  }
783
- keepAliveMarginUserDataListenKey(listenKey) {
784
- return this.put(`sapi/v1/userDataStream?listenKey=${listenKey}`);
983
+ getBethUnwrapHistory(params) {
984
+ return this.getPrivate('sapi/v1/eth-staking/wbeth/history/unwrapHistory', params);
785
985
  }
786
- closeMarginUserDataListenKey(listenKey) {
787
- return this.delete(`sapi/v1/userDataStream?listenKey=${listenKey}`);
986
+ /**
987
+ * @deprecated as of 2024-01-19
988
+ */
989
+ getStakingProducts(params) {
990
+ return this.getPrivate(`sapi/v1/staking/productList`, params);
788
991
  }
789
- // isolated margin
790
- getIsolatedMarginUserDataListenKey(params) {
791
- return this.post(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
992
+ /**
993
+ * @deprecated as of 2024-01-19
994
+ */
995
+ getStakingProductPosition(params) {
996
+ return this.getPrivate('sapi/v1/staking/position', params);
792
997
  }
793
- keepAliveIsolatedMarginUserDataListenKey(params) {
794
- return this.put(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
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);
1116
+ getCryptoLoanFlexibleCollateralAssets(params) {
1117
+ return this.getPrivate('sapi/v2/loan/flexible/collateral/data', params);
903
1118
  }
904
- getAutoInvestAssets() {
905
- return this.getPrivate('sapi/v1/lending/auto-invest/all/asset');
1119
+ getCryptoLoanFlexibleAssets(params) {
1120
+ return this.getPrivate('sapi/v2/loan/flexible/loanable/data', params);
906
1121
  }
907
- getAutoInvestSourceAssets(params) {
908
- return this.getPrivate('sapi/v1/lending/auto-invest/source-asset/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);
909
1129
  }
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);
1130
+ repayCryptoLoanFlexible(params) {
1131
+ return this.postPrivate('sapi/v2/loan/flexible/repay', params);
918
1132
  }
919
- submitAutoInvestmentPlanOld(params) {
920
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/add', params);
1133
+ adjustCryptoLoanFlexibleLTV(params) {
1134
+ return this.postPrivate('sapi/v2/loan/flexible/adjust/ltv', params);
921
1135
  }
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);
1136
+ /**
1137
+ *
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);
930
1143
  }
931
- updateAutoInvestmentPlanOld(params) {
932
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit', params);
1144
+ getLoanFlexibleBorrowHistory(params) {
1145
+ return this.getPrivate('sapi/v2/loan/flexible/borrow/history', params);
933
1146
  }
934
- updateAutoInvestPlanStatus(params) {
935
- return this.postPrivate('sapi/v1/lending/auto-invest/plan/edit-status', params);
1147
+ getCryptoLoanFlexibleOngoingOrders(params) {
1148
+ return this.getPrivate('sapi/v2/loan/flexible/ongoing/orders', params);
936
1149
  }
937
- getAutoInvestPlans(params) {
938
- return this.getPrivate('sapi/v1/lending/auto-invest/plan/list', params);
1150
+ getLoanFlexibleRepaymentHistory(params) {
1151
+ return this.getPrivate('sapi/v2/loan/flexible/repay/history', params);
939
1152
  }
940
- getAutoInvestPlan(params) {
941
- return this.getPrivate('sapi/v1/lending/auto-invest/plan/id', params);
1153
+ /**
1154
+ *
1155
+ * CRYPTO LOAN Endpoints - Stable rate - Market data
1156
+ *
1157
+ **/
1158
+ getCryptoLoanLoanableAssets(params) {
1159
+ return this.getPrivate('sapi/v1/loan/loanable/data', params);
942
1160
  }
943
- getAutoInvestSubscriptionTransactions(params) {
944
- return this.getPrivate('sapi/v1/lending/auto-invest/history/list', params);
1161
+ getCryptoLoanCollateralRepayRate(params) {
1162
+ return this.getPrivate('sapi/v1/loan/repay/collateral/rate', params);
945
1163
  }
946
- getAutoInvestIndex(params) {
947
- return this.getPrivate('sapi/v1/lending/auto-invest/index/info', params);
1164
+ getCryptoLoanCollateralAssetsData(params) {
1165
+ return this.getPrivate('sapi/v1/loan/collateral/data', params);
948
1166
  }
949
- getAutoInvestUserIndex(params) {
950
- return this.getPrivate('sapi/v1/lending/auto-invest/index/user-summary', params);
1167
+ getCryptoLoansIncomeHistory(params) {
1168
+ return this.getPrivate('sapi/v1/loan/income', params);
951
1169
  }
952
1170
  /**
953
- * https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction
954
1171
  *
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);
1172
+ * CRYPTO LOAN Endpoints - Stable rate - Trade
1173
+ *
1174
+ **/
1175
+ borrowCryptoLoan(params) {
1176
+ return this.postPrivate('sapi/v1/loan/borrow', params);
969
1177
  }
970
- submitAutoInvestRedemption(params) {
971
- return this.postPrivate('sapi/v1/lending/auto-invest/redeem', params);
1178
+ repayCryptoLoan(params) {
1179
+ return this.postPrivate('sapi/v1/loan/repay', params);
972
1180
  }
973
- getAutoInvestRedemptionHistory(params) {
974
- return this.getPrivate('sapi/v1/lending/auto-invest/redeem/history', params);
1181
+ adjustCryptoLoanLTV(params) {
1182
+ return this.postPrivate('sapi/v1/loan/adjust/ltv', params);
975
1183
  }
976
- getAutoInvestRebalanceHistory(params) {
977
- return this.getPrivate('sapi/v1/lending/auto-invest/rebalance/history', params);
1184
+ customizeCryptoLoanMarginCall(params) {
1185
+ return this.postPrivate('sapi/v1/loan/customize/margin_call', params);
978
1186
  }
979
1187
  /**
980
1188
  *
981
- * Staking Endpoints
1189
+ * CRYPTO LOAN Endpoints - Stable rate - User info
982
1190
  *
983
1191
  **/
984
- /**
985
- * @deprecated as of 2024-01-19
986
- */
987
- getStakingProducts(params) {
988
- return this.getPrivate(`sapi/v1/staking/productList`, params);
1192
+ getCryptoLoanOngoingOrders(params) {
1193
+ return this.getPrivate('sapi/v1/loan/ongoing/orders', params);
989
1194
  }
990
- /**
991
- * @deprecated as of 2024-01-19
992
- */
993
- getStakingProductPosition(params) {
994
- return this.getPrivate('sapi/v1/staking/position', params);
1195
+ getCryptoLoanBorrowHistory(params) {
1196
+ return this.getPrivate('sapi/v1/loan/borrow/history', params);
995
1197
  }
996
- /**
997
- * @deprecated as of 2024-01-19
998
- */
999
- getStakingHistory(params) {
1000
- return this.getPrivate('sapi/v1/staking/stakingRecord', params);
1198
+ getCryptoLoanLTVAdjustmentHistory(params) {
1199
+ return this.getPrivate('sapi/v1/loan/ltv/adjustment/history', params);
1200
+ }
1201
+ getCryptoLoanRepaymentHistory(params) {
1202
+ return this.getPrivate('sapi/v1/loan/repay/history', params);
1001
1203
  }
1002
1204
  /**
1003
- * @deprecated as of 2024-01-19
1004
- */
1005
- getPersonalLeftQuotaOfStakingProduct(params) {
1006
- return this.getPrivate('sapi/v1/staking/personalLeftQuota', params);
1205
+ *
1206
+ * SIMPLE EARN Endpoints - Account
1207
+ *
1208
+ **/
1209
+ getSimpleEarnAccount() {
1210
+ return this.getPrivate(`/sapi/v1/simple-earn/account`);
1007
1211
  }
1008
- subscribeEthStakingV1(params) {
1009
- return this.postPrivate('sapi/v1/eth-staking/eth/stake', params);
1212
+ getFlexibleSavingProducts(params) {
1213
+ return this.getPrivate(`/sapi/v1/simple-earn/flexible/list`, params);
1010
1214
  }
1011
- subscribeEthStakingV2(params) {
1012
- return this.postPrivate('sapi/v2/eth-staking/eth/stake', params);
1215
+ getSimpleEarnLockedProductList(params) {
1216
+ return this.getPrivate(`/sapi/v1/simple-earn/locked/list`, params);
1013
1217
  }
1014
- redeemEth(params) {
1015
- return this.postPrivate('sapi/v1/eth-staking/eth/redeem', params);
1218
+ getFlexibleProductPosition(params) {
1219
+ return this.getPrivate(`/sapi/v1/simple-earn/flexible/position`, params);
1016
1220
  }
1017
- getEthStakingHistory(params) {
1018
- return this.getPrivate('sapi/v1/eth-staking/eth/history/stakingHistory', params);
1221
+ getLockedProductPosition(params) {
1222
+ return this.getPrivate(`/sapi/v1/simple-earn/locked/position`, params);
1019
1223
  }
1020
- getEthRedemptionHistory(params) {
1021
- return this.getPrivate('sapi/v1/eth-staking/eth/history/redemptionHistory', params);
1224
+ getFlexiblePersonalLeftQuota(params) {
1225
+ return this.getPrivate('sapi/v1/simple-earn/flexible/personalLeftQuota', params);
1022
1226
  }
1023
- getBethRewardsHistory(params) {
1024
- return this.getPrivate('sapi/v1/eth-staking/eth/history/rewardsHistory', params);
1227
+ getLockedPersonalLeftQuota(params) {
1228
+ return this.getPrivate('sapi/v1/simple-earn/locked/personalLeftQuota', params);
1025
1229
  }
1026
- getEthStakingQuota() {
1027
- return this.getPrivate('sapi/v1/eth-staking/eth/quota');
1230
+ /**
1231
+ *
1232
+ * SIMPLE EARN Endpoints - Earn
1233
+ *
1234
+ **/
1235
+ purchaseFlexibleProduct(params) {
1236
+ return this.postPrivate(`/sapi/v1/simple-earn/flexible/subscribe`, params);
1028
1237
  }
1029
- getEthRateHistory(params) {
1030
- return this.getPrivate('sapi/v1/eth-staking/eth/history/rateHistory', params);
1238
+ subscribeSimpleEarnLockedProduct(params) {
1239
+ return this.postPrivate(`/sapi/v1/simple-earn/locked/subscribe`, params);
1031
1240
  }
1032
- getEthStakingAccount() {
1033
- return this.getPrivate('sapi/v1/eth-staking/account');
1241
+ redeemFlexibleProduct(params) {
1242
+ return this.postPrivate(`/sapi/v1/simple-earn/flexible/redeem`, params);
1034
1243
  }
1035
- getEthStakingAccountV2() {
1036
- return this.getPrivate('sapi/v2/eth-staking/account');
1244
+ redeemLockedProduct(params) {
1245
+ return this.postPrivate(`/sapi/v1/simple-earn/locked/redeem`, params);
1037
1246
  }
1038
- wrapBeth(params) {
1039
- return this.postPrivate('sapi/v1/eth-staking/wbeth/wrap', params);
1247
+ setFlexibleAutoSubscribe(params) {
1248
+ return this.postPrivate('sapi/v1/simple-earn/flexible/setAutoSubscribe', params);
1040
1249
  }
1041
- getBethWrapHistory(params) {
1042
- return this.getPrivate('sapi/v1/eth-staking/wbeth/history/wrapHistory', params);
1250
+ setLockedAutoSubscribe(params) {
1251
+ return this.postPrivate('sapi/v1/simple-earn/locked/setAutoSubscribe', params);
1043
1252
  }
1044
- getBethUnwrapHistory(params) {
1045
- return this.getPrivate('sapi/v1/eth-staking/wbeth/history/unwrapHistory', params);
1253
+ getFlexibleSubscriptionPreview(params) {
1254
+ return this.getPrivate('sapi/v1/simple-earn/flexible/subscriptionPreview', params);
1046
1255
  }
1047
- getWbethRewardsHistory(params) {
1048
- return this.getPrivate('sapi/v1/eth-staking/eth/history/wbethRewardsHistory', params);
1256
+ getLockedSubscriptionPreview(params) {
1257
+ return this.getPrivate('sapi/v1/simple-earn/locked/subscriptionPreview', params);
1258
+ }
1259
+ setLockedProductRedeemOption(params) {
1260
+ return this.postPrivate('sapi/v1/simple-earn/locked/setRedeemOption', params);
1049
1261
  }
1050
1262
  /**
1051
1263
  *
1052
- * Savings Endpoints
1053
- * @deprecated as of 2023-06-22, now Simple Earn
1264
+ * SIMPLE EARN Endpoints - History
1265
+ *
1054
1266
  **/
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);
1066
- }
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);
1267
+ getFlexibleSubscriptionRecord(params) {
1268
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/subscriptionRecord', params);
1072
1269
  }
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);
1270
+ getLockedSubscriptionRecord(params) {
1271
+ return this.getPrivate('sapi/v1/simple-earn/locked/history/subscriptionRecord', params);
1078
1272
  }
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);
1273
+ getFlexibleRedemptionRecord(params) {
1274
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/redemptionRecord', params);
1084
1275
  }
1085
- /**
1086
- * @deprecated as of 2023-06-22, now Simple Earn
1087
- */
1088
- getLendingAccount() {
1089
- return this.getPrivate(`sapi/v1/lending/union/account`);
1276
+ getLockedRedemptionRecord(params) {
1277
+ return this.getPrivate('sapi/v1/simple-earn/locked/history/redemptionRecord', params);
1090
1278
  }
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);
1279
+ getFlexibleRewardsHistory(params) {
1280
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/rewardsRecord', params);
1096
1281
  }
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);
1282
+ getLockedRewardsHistory(params) {
1283
+ return this.getPrivate('sapi/v1/simple-earn/locked/history/rewardsRecord', params);
1102
1284
  }
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);
1285
+ getCollateralRecord(params) {
1286
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/collateralRecord', params);
1108
1287
  }
1109
- /**
1110
- * @deprecated as of 2023-06-22, now Simple Earn
1111
- */
1112
- changeFixedAndActivityPositionToDailyPosition(params) {
1113
- return this.postPrivate(`sapi/v1/lending/positionChanged`, params);
1288
+ getRateHistory(params) {
1289
+ return this.getPrivate('sapi/v1/simple-earn/flexible/history/rateHistory', params);
1114
1290
  }
1115
1291
  /**
1116
1292
  *
1117
- * Mining Endpoints
1293
+ * VIP LOAN Endpoints - Market Data
1118
1294
  *
1119
1295
  **/
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);
1128
- }
1129
- getMiners(params) {
1130
- return this.getPrivate('sapi/v1/mining/worker/list', params);
1296
+ getVipBorrowInterestRate(params) {
1297
+ return this.getPrivate('sapi/v1/loan/vip/request/interestRate', params);
1131
1298
  }
1132
- getMiningEarnings(params) {
1133
- return this.getPrivate('sapi/v1/mining/payment/list', params);
1299
+ getVipLoanableAssets(params) {
1300
+ return this.getPrivate('sapi/v1/loan/vip/loanable/data', params);
1134
1301
  }
1135
- getExtraBonuses(params) {
1136
- return this.getPrivate('sapi/v1/mining/payment/other', params);
1302
+ getVipCollateralAssets(params) {
1303
+ return this.getPrivate('sapi/v1/loan/vip/collateral/data', params);
1137
1304
  }
1138
- getHashrateResales(params) {
1139
- return this.getPrivate('sapi/v1/mining/hash-transfer/config/details/list', params);
1305
+ /**
1306
+ *
1307
+ * VIP LOAN Endpoints - User Info
1308
+ *
1309
+ **/
1310
+ getVipLoanOpenOrders(params) {
1311
+ return this.getPrivate('sapi/v1/loan/vip/ongoing/orders', params);
1140
1312
  }
1141
- getHashrateResale(params) {
1142
- return this.getPrivate('sapi/v1/mining/hash-transfer/profit/details', params);
1313
+ getVipLoanRepaymentHistory(params) {
1314
+ return this.getPrivate('sapi/v1/loan/vip/repay/history', params);
1143
1315
  }
1144
- submitHashrateResale(params) {
1145
- return this.postPrivate('sapi/v1/mining/hash-transfer/config', params);
1316
+ checkVipCollateralAccount(params) {
1317
+ return this.getPrivate('sapi/v1/loan/vip/collateral/account', params);
1146
1318
  }
1147
- cancelHashrateResaleConfig(params) {
1148
- return this.postPrivate('sapi/v1/mining/hash-transfer/config/cancel', params);
1319
+ getVipApplicationStatus(params) {
1320
+ return this.getPrivate('sapi/v1/loan/vip/request/data', params);
1149
1321
  }
1150
- getMiningStatistics(params) {
1151
- return this.getPrivate('sapi/v1/mining/statistics/user/status', params);
1322
+ /**
1323
+ *
1324
+ * VIP LOAN Endpoints - Trade
1325
+ *
1326
+ **/
1327
+ renewVipLoan(params) {
1328
+ return this.postPrivate('sapi/v1/loan/vip/renew', params);
1152
1329
  }
1153
- getMiningAccounts(params) {
1154
- return this.getPrivate('sapi/v1/mining/statistics/user/list', params);
1330
+ repayVipLoan(params) {
1331
+ return this.postPrivate('sapi/v1/loan/vip/repay', params);
1155
1332
  }
1156
- getMiningAccountEarnings(params) {
1157
- return this.getPrivate('sapi/v1/mining/payment/uid', params);
1333
+ borrowVipLoan(params) {
1334
+ return this.postPrivate('sapi/v1/loan/vip/borrow', params);
1158
1335
  }
1159
1336
  /**
1160
1337
  *
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.
1338
+ * DUAL INVESTMENT Endpoints - Market Data
1166
1339
  *
1167
1340
  **/
1341
+ getDualInvestmentProducts(params) {
1342
+ return this.getPrivate('sapi/v1/dci/product/list', params);
1343
+ }
1168
1344
  /**
1169
- * Execute transfer between spot account and futures account.
1170
1345
  *
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);
1346
+ * DUAL INVESTMENT Endpoints - Trade
1347
+ *
1348
+ **/
1349
+ subscribeDualInvestmentProduct(params) {
1350
+ return this.postPrivate('sapi/v1/dci/product/subscribe', params);
1179
1351
  }
1180
- getFutureAccountTransferHistory(params) {
1181
- return this.getPrivate(`sapi/v1/futures/transfer`, params);
1352
+ getDualInvestmentPositions(params) {
1353
+ return this.getPrivate('sapi/v1/dci/product/positions', params);
1182
1354
  }
1183
- getFuturesTickLevelOrderbookDataLink(params) {
1184
- return this.getPrivate('sapi/v1/futures/histDataLink', params);
1355
+ getDualInvestmentAccounts() {
1356
+ return this.getPrivate('sapi/v1/dci/product/accounts');
1185
1357
  }
1186
- /**
1187
- * @deprecated as of 2023-09-25
1188
- */
1189
- getCrossCollateralBorrowHistory(params) {
1190
- return this.getPrivate(`sapi/v1/futures/loan/borrow/history`, params);
1358
+ updateAutoCompoundStatus(params) {
1359
+ return this.postPrivate('sapi/v1/dci/product/auto_compound/edit-status', params);
1191
1360
  }
1192
1361
  /**
1193
- * @deprecated as of 2023-09-25
1194
- */
1195
- getCrossCollateralRepaymentHistory(params) {
1196
- return this.getPrivate(`sapi/v1/futures/loan/repay/history`, params);
1362
+ *
1363
+ * GIFT CARD Endpoints - Market Data
1364
+ *
1365
+ **/
1366
+ createGiftCard(params) {
1367
+ return this.postPrivate('sapi/v1/giftcard/createCode', params);
1197
1368
  }
1198
- /**
1199
- * @deprecated as of 2023-09-25
1200
- */
1201
- getCrossCollateralWalletV2() {
1202
- return this.getPrivate(`sapi/v2/futures/loan/wallet`);
1369
+ createDualTokenGiftCard(params) {
1370
+ return this.postPrivate('sapi/v1/giftcard/buyCode', params);
1203
1371
  }
1204
- /**
1205
- * @deprecated as of 2023-09-25
1206
- */
1207
- getAdjustCrossCollateralLTVHistory(params) {
1208
- return this.getPrivate(`sapi/v1/futures/loan/adjustCollateral/history`, params);
1372
+ redeemGiftCard(params) {
1373
+ return this.postPrivate('sapi/v1/giftcard/redeemCode', params);
1209
1374
  }
1210
- /**
1211
- * @deprecated as of 2023-09-25
1212
- */
1213
- getCrossCollateralLiquidationHistory(params) {
1214
- return this.getPrivate(`sapi/v1/futures/loan/liquidationHistory`, params);
1375
+ verifyGiftCard(params) {
1376
+ return this.getPrivate('sapi/v1/giftcard/verify', params);
1215
1377
  }
1216
- /**
1217
- * @deprecated as of 2023-09-25
1218
- */
1219
- getCrossCollateralInterestHistory(params) {
1220
- return this.getPrivate(`sapi/v1/futures/loan/interestHistory`, params);
1378
+ getTokenLimit(params) {
1379
+ return this.getPrivate('sapi/v1/giftcard/buyCode/token-limit', params);
1380
+ }
1381
+ getRsaPublicKey() {
1382
+ return this.getPrivate('sapi/v1/giftcard/cryptography/rsa-public-key');
1221
1383
  }
1222
1384
  /**
1223
1385
  *
1224
- * Futures Algo Endpoints
1386
+ * NFT Endpoints - REST api
1225
1387
  *
1226
1388
  **/
1227
- submitVpNewOrder(params) {
1228
- this.validateOrderId(params, 'clientAlgoId');
1229
- return this.postPrivate('sapi/v1/algo/futures/newOrderVp', params);
1230
- }
1231
- submitTwapNewOrder(params) {
1232
- this.validateOrderId(params, 'clientAlgoId');
1233
- return this.postPrivate('sapi/v1/algo/futures/newOrderTwap', params);
1389
+ getNftTransactionHistory(params) {
1390
+ return this.getPrivate('sapi/v1/nft/history/transactions', params);
1234
1391
  }
1235
- cancelAlgoOrder(params) {
1236
- return this.deletePrivate('sapi/v1/algo/futures/order', params);
1392
+ getNftDepositHistory(params) {
1393
+ return this.getPrivate('sapi/v1/nft/history/deposit', params);
1237
1394
  }
1238
- getAlgoOpenOrders() {
1239
- return this.getPrivate('sapi/v1/algo/futures/openOrders');
1395
+ getNftWithdrawHistory(params) {
1396
+ return this.getPrivate('sapi/v1/nft/history/withdraw', params);
1240
1397
  }
1241
- getAlgoHistoricalOrders(params) {
1242
- return this.getPrivate('sapi/v1/algo/futures/historicalOrders', params);
1398
+ getNftAsset(params) {
1399
+ return this.getPrivate('sapi/v1/nft/user/getAsset', params);
1243
1400
  }
1244
- getAlgoSubOrders(params) {
1245
- return this.getPrivate('sapi/v1/algo/futures/subOrders', params);
1401
+ /**
1402
+ *
1403
+ * C2C Endpoints
1404
+ *
1405
+ **/
1406
+ getC2CTradeHistory(params) {
1407
+ return this.getPrivate('sapi/v1/c2c/orderMatch/listUserOrderHistory', params);
1246
1408
  }
1247
1409
  /**
1248
1410
  *
1249
- * Spot Algo Endpoints
1411
+ * FIAT Endpoints - REST api
1250
1412
  *
1251
1413
  **/
1252
- submitSpotAlgoTwapOrder(params) {
1253
- this.validateOrderId(params, 'clientAlgoId');
1254
- return this.postPrivate('sapi/v1/algo/spot/newOrderTwap', params);
1414
+ getFiatOrderHistory(params) {
1415
+ return this.getPrivate('sapi/v1/fiat/orders', params);
1255
1416
  }
1256
- cancelSpotAlgoOrder(params) {
1257
- return this.deletePrivate('sapi/v1/algo/spot/order', params);
1417
+ getFiatPaymentsHistory(params) {
1418
+ return this.getPrivate('sapi/v1/fiat/payments', params);
1258
1419
  }
1259
- getSpotAlgoOpenOrders() {
1260
- return this.getPrivate('sapi/v1/algo/spot/openOrders');
1420
+ /**
1421
+ *
1422
+ * Rebate Endpoints
1423
+ *
1424
+ **/
1425
+ getSpotRebateHistoryRecords(params) {
1426
+ return this.getPrivate('sapi/v1/rebate/taxQuery', params);
1261
1427
  }
1262
- getSpotAlgoHistoricalOrders(params) {
1263
- return this.getPrivate('sapi/v1/algo/spot/historicalOrders', params);
1428
+ /**
1429
+ *
1430
+ * DERIVATIVES - Portfolio Margin Pro - Market Data
1431
+ * This is in mainclient because it shares the same base url
1432
+ *
1433
+ **/
1434
+ getPortfolioMarginIndexPrice(params) {
1435
+ return this.get('sapi/v1/portfolio/asset-index-price', params);
1264
1436
  }
1265
- getSpotAlgoSubOrders(params) {
1266
- return this.getPrivate('sapi/v1/algo/spot/subOrders', params);
1437
+ getPortfolioMarginAssetLeverage() {
1438
+ return this.getPrivate('sapi/v1/portfolio/margin-asset-leverage');
1267
1439
  }
1268
1440
  /**
1269
1441
  *
1270
- * Portfolio Margin Pro
1442
+ * DERIVATIVES - Portfolio Margin Pro - Account
1443
+ * This is in mainclient because it shares the same base url
1271
1444
  *
1272
1445
  **/
1273
- getPortfolioMarginProAccountInfo() {
1274
- return this.getPrivate('sapi/v1/portfolio/account');
1275
- }
1276
1446
  getPortfolioMarginProCollateralRate() {
1277
1447
  return this.get('sapi/v1/portfolio/collateralRate');
1278
1448
  }
1279
- getPortfolioMarginProBankruptcyLoanAmount() {
1280
- return this.getPrivate('sapi/v1/portfolio/pmLoan');
1281
- }
1282
- repayPortfolioMarginProBankruptcyLoan(params) {
1283
- return this.postPrivate('sapi/v1/portfolio/repay', params);
1284
- }
1285
- getPortfolioMarginProInterestHistory(params) {
1286
- return this.getPrivate('sapi/v1/portfolio/interest-history', params);
1449
+ getPortfolioMarginProAccountInfo() {
1450
+ return this.getPrivate('sapi/v1/portfolio/account');
1287
1451
  }
1288
- getPortfolioMarginIndexPrice(params) {
1289
- return this.get('sapi/v1/portfolio/asset-index-price', params);
1452
+ bnbTransfer(params) {
1453
+ return this.postPrivate('sapi/v1/portfolio/bnb-transfer', params);
1290
1454
  }
1291
1455
  submitPortfolioMarginProFullTransfer() {
1292
1456
  return this.postPrivate('sapi/v1/portfolio/auto-collection');
@@ -1294,8 +1458,14 @@ class MainClient extends BaseRestClient_1.default {
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,238 @@ 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
- *
1513
+ * Pay endpoints
1514
+ * Found only in old docs, possibly @deprecated
1350
1515
  **/
1351
- getC2CTradeHistory(params) {
1352
- return this.getPrivate('sapi/v1/c2c/orderMatch/listUserOrderHistory', params);
1516
+ getPayTransactions(params) {
1517
+ return this.getPrivate('sapi/v1/pay/transactions', params);
1353
1518
  }
1354
1519
  /**
1355
1520
  *
1356
- * VIP Loans Endpoints
1357
- *
1358
- **/
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);
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);
1385
1526
  }
1386
- getVipBorrowInterestRate(params) {
1387
- return this.getPrivate('sapi/v1/loan/vip/request/interestRate', params);
1527
+ getBrokerSubAccount(params) {
1528
+ return this.getPrivate('sapi/v1/broker/subAccount', params);
1388
1529
  }
1389
- /**
1390
- *
1391
- * Crypto Loans Endpoints
1392
- *
1393
- **/
1394
- getCryptoLoansIncomeHistory(params) {
1395
- return this.getPrivate('sapi/v1/loan/income', params);
1530
+ enableMarginBrokerSubAccount(params) {
1531
+ return this.postPrivate('sapi/v1/broker/subAccount/futures', params);
1396
1532
  }
1397
- borrowCryptoLoan(params) {
1398
- return this.postPrivate('sapi/v1/loan/borrow', params);
1533
+ createApiKeyBrokerSubAccount(params) {
1534
+ return this.postPrivate('sapi/v1/broker/subAccountApi', params);
1399
1535
  }
1400
- getCryptoLoanBorrowHistory(params) {
1401
- return this.getPrivate('sapi/v1/loan/borrow/history', params);
1536
+ changePermissionApiKeyBrokerSubAccount(params) {
1537
+ return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params);
1402
1538
  }
1403
- getCryptoLoanOngoingOrders(params) {
1404
- return this.getPrivate('sapi/v1/loan/ongoing/orders', params);
1539
+ changeComissionBrokerSubAccount(params) {
1540
+ return this.postPrivate('sapi/v1/broker/subAccountApi/permission', params);
1405
1541
  }
1406
- repayCryptoLoan(params) {
1407
- return this.postPrivate('sapi/v1/loan/repay', params);
1542
+ enableUniversalTransferApiKeyBrokerSubAccount(params) {
1543
+ return this.postPrivate('sapi/v1/broker/subAccountApi/permission/universalTransfer', params);
1408
1544
  }
1409
- getCryptoLoanRepaymentHistory(params) {
1410
- return this.getPrivate('sapi/v1/loan/repay/history', params);
1545
+ updateIpRestrictionForSubAccountApiKey(params) {
1546
+ return this.postPrivate('sapi/v2/broker/subAccountApi/ipRestriction', params);
1411
1547
  }
1412
- adjustCryptoLoanLTV(params) {
1413
- return this.postPrivate('sapi/v1/loan/adjust/ltv', params);
1548
+ deleteIPRestrictionForSubAccountApiKey(params) {
1549
+ return this.deletePrivate('sapi/v1/broker/subAccountApi/ipRestriction/ipList', params);
1414
1550
  }
1415
- getCryptoLoanLTVAdjustmentHistory(params) {
1416
- return this.getPrivate('sapi/v1/loan/ltv/adjustment/history', params);
1551
+ deleteApiKeyBrokerSubAccount(params) {
1552
+ return this.deletePrivate('sapi/v1/broker/subAccountApi', params);
1417
1553
  }
1418
- getCryptoLoanLoanableAssets(params) {
1419
- return this.getPrivate('sapi/v1/loan/loanable/data', params);
1554
+ getSubAccountBrokerIpRestriction(params) {
1555
+ return this.getPrivate('sapi/v1/broker/subAccountApi/ipRestriction', params);
1420
1556
  }
1421
- getCryptoLoanCollateralAssetsData(params) {
1422
- return this.getPrivate('sapi/v1/loan/collateral/data', params);
1557
+ getApiKeyBrokerSubAccount(params) {
1558
+ return this.getPrivate('sapi/v1/broker/subAccountApi', params);
1423
1559
  }
1424
- getCryptoLoanCollateralRepayRate(params) {
1425
- return this.getPrivate('sapi/v1/loan/repay/collateral/rate', params);
1560
+ getBrokerInfo() {
1561
+ return this.getPrivate('sapi/v1/broker/info');
1426
1562
  }
1427
- customizeCryptoLoanMarginCall(params) {
1428
- return this.postPrivate('sapi/v1/loan/customize/margin_call', params);
1563
+ updateSubAccountBNBBurn(params) {
1564
+ return this.postPrivate('sapi/v1/broker/subAccount/bnbBurn/spot', params);
1429
1565
  }
1430
- borrowCryptoLoanFlexible(params) {
1431
- return this.postPrivate('sapi/v2/loan/flexible/borrow', params);
1566
+ updateSubAccountMarginInterestBNBBurn(params) {
1567
+ return this.postPrivate('sapi/v1/broker/subAccount/bnbBurn/marginInterest', params);
1432
1568
  }
1433
- getCryptoLoanFlexibleOngoingOrders(params) {
1434
- return this.getPrivate('sapi/v2/loan/flexible/ongoing/orders', params);
1569
+ getSubAccountBNBBurnStatus(params) {
1570
+ return this.getPrivate('sapi/v1/broker/subAccount/bnbBurn/status', params);
1435
1571
  }
1436
- getLoanFlexibleBorrowHistory(params) {
1437
- return this.getPrivate('sapi/v2/loan/flexible/borrow/history', params);
1572
+ /**
1573
+ *
1574
+ * EXCHANGE LINK - Account Endpoints
1575
+ * https://developers.binance.com/docs/binance_link
1576
+ */
1577
+ transferBrokerSubAccount(params) {
1578
+ return this.postPrivate('sapi/v1/broker/transfer', params);
1438
1579
  }
1439
- repayCryptoLoanFlexible(params) {
1440
- return this.postPrivate('sapi/v2/loan/flexible/repay', params);
1580
+ getBrokerSubAccountHistory(params) {
1581
+ return this.getPrivate('sapi/v1/broker/transfer', params);
1441
1582
  }
1442
- getLoanFlexibleRepaymentHistory(params) {
1443
- return this.getPrivate('sapi/v2/loan/flexible/repay/history', params);
1583
+ submitBrokerSubFuturesTransfer(params) {
1584
+ return this.postPrivate('sapi/v1/broker/transfer/futures', params);
1444
1585
  }
1445
- adjustCryptoLoanFlexibleLTV(params) {
1446
- return this.postPrivate('sapi/v2/loan/flexible/adjust/ltv', params);
1586
+ getSubAccountFuturesTransferHistory(params) {
1587
+ return this.getPrivate('sapi/v1/broker/transfer/futures', params);
1447
1588
  }
1448
- getCryptoLoanFlexibleLTVAdjustmentHistory(params) {
1449
- return this.getPrivate('sapi/v2/loan/flexible/ltv/adjustment/history', params);
1589
+ getBrokerSubDepositHistory(params) {
1590
+ return this.getPrivate('sapi/v1/broker/subAccount/depositHist', params);
1450
1591
  }
1451
- getCryptoLoanFlexibleAssets(params) {
1452
- return this.getPrivate('sapi/v2/loan/flexible/loanable/data', params);
1592
+ getBrokerSubAccountSpotAssets(params) {
1593
+ return this.getPrivate('sapi/v1/broker/subAccount/spotSummary', params);
1453
1594
  }
1454
- getCryptoLoanFlexibleCollateralAssets(params) {
1455
- return this.getPrivate('sapi/v2/loan/flexible/collateral/data', params);
1595
+ getSubAccountMarginAssetInfo(params) {
1596
+ return this.getPrivate('sapi/v1/broker/subAccount/marginSummary', params);
1456
1597
  }
1457
- /**
1458
- *
1459
- * Copy trading endpoints
1460
- *
1461
- **/
1462
- getFuturesLeadTraderStatus() {
1463
- return this.getPrivate('sapi/v1/copyTrading/futures/userStatus');
1598
+ querySubAccountFuturesAssetInfo(params) {
1599
+ return this.getPrivate('sapi/v3/broker/subAccount/futuresSummary', params);
1464
1600
  }
1465
- getFuturesLeadTradingSymbolWhitelist() {
1466
- return this.getPrivate('sapi/v1/copyTrading/futures/leadSymbol');
1601
+ universalTransferBroker(params) {
1602
+ return this.postPrivate('sapi/v1/broker/universalTransfer', params);
1467
1603
  }
1468
- /**
1469
- *
1470
- * Pay endpoints
1471
- *
1472
- **/
1473
- getPayTransactions(params) {
1474
- return this.getPrivate('sapi/v1/pay/transactions', params);
1604
+ getUniversalTransferBroker(params) {
1605
+ return this.getPrivate('sapi/v1/broker/universalTransfer', params);
1475
1606
  }
1476
1607
  /**
1477
1608
  *
1478
- * Convert endpoints
1479
- *
1480
- **/
1481
- getConvertPairs(params) {
1482
- return this.getPrivate('sapi/v1/convert/exchangeInfo', params);
1609
+ * EXCHANGE LINK - Fee Endpoints
1610
+ * https://developers.binance.com/docs/binance_link
1611
+ */
1612
+ updateBrokerSubAccountCommission(params) {
1613
+ return this.postPrivate('sapi/v1/broker/subAccountApi/commission', params);
1483
1614
  }
1484
- getConvertAssetInfo() {
1485
- return this.getPrivate('sapi/v1/convert/assetInfo');
1615
+ updateBrokerSubAccountFuturesCommission(params) {
1616
+ return this.postPrivate('sapi/v1/broker/subAccountApi/commission/futures', params);
1486
1617
  }
1487
- convertQuoteRequest(params) {
1488
- return this.postPrivate('sapi/v1/convert/getQuote', params);
1618
+ getBrokerSubAccountFuturesCommission(params) {
1619
+ return this.getPrivate('sapi/v1/broker/subAccountApi/commission/futures', params);
1489
1620
  }
1490
- acceptQuoteRequest(params) {
1491
- return this.postPrivate('sapi/v1/convert/acceptQuote', params);
1621
+ updateBrokerSubAccountCoinFuturesCommission(params) {
1622
+ return this.postPrivate('sapi/v1/broker/subAccountApi/commission/coinFutures', params);
1492
1623
  }
1493
- getOrderStatus(params) {
1494
- return this.getPrivate('sapi/v1/convert/orderStatus', params);
1624
+ getBrokerSubAccountCoinFuturesCommission(params) {
1625
+ return this.getPrivate('sapi/v1/broker/subAccountApi/commission/coinFutures', params);
1495
1626
  }
1496
- submitConvertLimitOrder(params) {
1497
- return this.postPrivate('sapi/v1/convert/limit/placeOrder', params);
1627
+ getBrokerSpotCommissionRebate(params) {
1628
+ return this.getPrivate('sapi/v1/broker/rebate/recentRecord', params);
1498
1629
  }
1499
- cancelConvertLimitOrder(params) {
1500
- return this.postPrivate('sapi/v1/convert/limit/cancelOrder', params);
1630
+ getBrokerFuturesCommissionRebate(params) {
1631
+ return this.getPrivate('sapi/v1/broker/rebate/futures/recentRecord', params);
1501
1632
  }
1502
- getConvertLimitOpenOrders() {
1503
- return this.getPrivate('sapi/v1/convert/limit/queryOpenOrders');
1633
+ /**
1634
+ *
1635
+ * @deprecated
1636
+ */
1637
+ // USD & Coin-M can be found under API getIncome() (find "API rebate" in results)
1638
+ getBrokerSpotRebateHistory(days, customerId) {
1639
+ if (days === 7) {
1640
+ return this.getPrivate('sapi/v1/apiReferral/rebate/recentRecord', {
1641
+ customerId,
1642
+ });
1643
+ }
1644
+ if (days === 30) {
1645
+ return this.getPrivate('sapi/v1/apiReferral/rebate/historicalRecord', {
1646
+ customerId,
1647
+ });
1648
+ }
1504
1649
  }
1505
- getConvertTradeHistory(params) {
1506
- return this.getPrivate('sapi/v1/convert/tradeFlow', params);
1650
+ /**
1651
+ * Broker Endpoints - only on old docs
1652
+ * @deprecated, found only in old docs
1653
+ * Use EXCHANGE LINK endpoints instead - https://developers.binance.com/docs/binance_link
1654
+ */
1655
+ /**
1656
+ * @deprecated, found only in old docs
1657
+ * Use EXCHANGE LINK endpoints instead
1658
+ **/
1659
+ getBrokerIfNewSpotUser() {
1660
+ return this.getPrivate('sapi/v1/apiReferral/ifNewUser');
1507
1661
  }
1508
1662
  /**
1509
- *
1510
- * Rebate Endpoints
1511
- *
1663
+ * @deprecated, found only in old docs
1664
+ * Use EXCHANGE LINK endpoints instead
1512
1665
  **/
1513
- getSpotRebateHistoryRecords(params) {
1514
- return this.getPrivate('sapi/v1/rebate/taxQuery', params);
1666
+ getBrokerSubAccountDepositHistory(params) {
1667
+ return this.getPrivate('sapi/v1/bv1/apiReferral/ifNewUser', params);
1515
1668
  }
1516
1669
  /**
1517
- *
1518
- * NFT Endpoints
1519
- *
1670
+ * @deprecated, found only in old docs
1671
+ * Use EXCHANGE LINK endpoints instead
1520
1672
  **/
1521
- getNftTransactionHistory(params) {
1522
- return this.getPrivate('sapi/v1/nft/history/transactions', params);
1673
+ getBrokerUserCustomisedId(market) {
1674
+ const prefix = market === 'spot' ? 'sapi' : 'fapi';
1675
+ return this.getPrivate(prefix + '/v1/apiReferral/userCustomization');
1523
1676
  }
1524
- getNftDepositHistory(params) {
1525
- return this.getPrivate('sapi/v1/nft/history/deposit', params);
1677
+ /**
1678
+ * @deprecated, found only in old docs
1679
+ * Use EXCHANGE LINK endpoints instead
1680
+ **/
1681
+ enableFuturesBrokerSubAccount(params) {
1682
+ return this.postPrivate('sapi/v1/broker/subAccount', params);
1526
1683
  }
1527
- getNftWithdrawHistory(params) {
1528
- return this.getPrivate('sapi/v1/nft/history/withdraw', params);
1684
+ /**
1685
+ * @deprecated, found only in old docs
1686
+ * Use EXCHANGE LINK endpoints instead
1687
+ **/
1688
+ enableMarginApiKeyBrokerSubAccount(params) {
1689
+ return this.postPrivate('sapi/v1/broker/subAccount/margin', params);
1529
1690
  }
1530
- getNftAsset(params) {
1531
- return this.getPrivate('sapi/v1/nft/user/getAsset', params);
1691
+ /**
1692
+ * Validate syntax meets requirements set by binance. Log warning if not.
1693
+ */
1694
+ validateOrderId(params, orderIdProperty) {
1695
+ const apiCategory = 'spot';
1696
+ if (!params[orderIdProperty]) {
1697
+ params[orderIdProperty] = (0, requestUtils_1.generateNewOrderId)(apiCategory);
1698
+ return;
1699
+ }
1700
+ const expectedOrderIdPrefix = `x-${(0, requestUtils_1.getOrderIdPrefix)(apiCategory)}`;
1701
+ if (!params[orderIdProperty].startsWith(expectedOrderIdPrefix)) {
1702
+ (0, requestUtils_1.logInvalidOrderId)(orderIdProperty, expectedOrderIdPrefix, params);
1703
+ }
1532
1704
  }
1533
1705
  /**
1534
1706
  *
1535
- * Binance GiftCard Endpoints
1707
+ * User Data Stream Endpoints
1536
1708
  *
1537
1709
  **/
1538
- createGiftCard(params) {
1539
- return this.postPrivate('sapi/v1/giftcard/createCode', params);
1710
+ // spot
1711
+ getSpotUserDataListenKey() {
1712
+ return this.post('api/v3/userDataStream');
1540
1713
  }
1541
- createDualTokenGiftCard(params) {
1542
- return this.postPrivate('sapi/v1/giftcard/buyCode', params);
1714
+ keepAliveSpotUserDataListenKey(listenKey) {
1715
+ return this.put(`api/v3/userDataStream?listenKey=${listenKey}`);
1543
1716
  }
1544
- redeemGiftCard(params) {
1545
- return this.postPrivate('sapi/v1/giftcard/redeemCode', params);
1717
+ closeSpotUserDataListenKey(listenKey) {
1718
+ return this.delete(`api/v3/userDataStream?listenKey=${listenKey}`);
1546
1719
  }
1547
- verifyGiftCard(params) {
1548
- return this.getPrivate('sapi/v1/giftcard/verify', params);
1720
+ // margin
1721
+ getMarginUserDataListenKey() {
1722
+ return this.post('sapi/v1/userDataStream');
1549
1723
  }
1550
- getRsaPublicKey() {
1551
- return this.getPrivate('sapi/v1/giftcard/cryptography/rsa-public-key');
1724
+ keepAliveMarginUserDataListenKey(listenKey) {
1725
+ return this.put(`sapi/v1/userDataStream?listenKey=${listenKey}`);
1552
1726
  }
1553
- getTokenLimit(params) {
1554
- return this.getPrivate('sapi/v1/giftcard/buyCode/token-limit', params);
1727
+ closeMarginUserDataListenKey(listenKey) {
1728
+ return this.delete(`sapi/v1/userDataStream?listenKey=${listenKey}`);
1729
+ }
1730
+ // isolated margin
1731
+ getIsolatedMarginUserDataListenKey(params) {
1732
+ return this.post(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1733
+ }
1734
+ keepAliveIsolatedMarginUserDataListenKey(params) {
1735
+ return this.put(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1736
+ }
1737
+ closeIsolatedMarginUserDataListenKey(params) {
1738
+ return this.delete(`sapi/v1/userDataStream/isolated?${(0, requestUtils_1.serialiseParams)(params)}`);
1555
1739
  }
1740
+ /**
1741
+ *
1742
+ * DEPRECATED ENDPOINTS
1743
+ *
1744
+ **/
1556
1745
  /**
1557
1746
  *
1558
1747
  * BSwap Endpoints
@@ -1583,18 +1772,92 @@ class MainClient extends BaseRestClient_1.default {
1583
1772
  return this.getPrivate('sapi/v1/bswap/liquidityOps', params);
1584
1773
  }
1585
1774
  /**
1586
- * Validate syntax meets requirements set by binance. Log warning if not.
1775
+ *
1776
+ * Savings Endpoints
1777
+ * @deprecated as of 2023-06-22, now Simple Earn
1778
+ **/
1779
+ /**
1780
+ * @deprecated as of 2023-06-22, now Simple Earn
1587
1781
  */
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
- }
1782
+ getLeftDailyPurchaseQuotaFlexibleProduct(params) {
1783
+ return this.getPrivate(`sapi/v1/lending/daily/userLeftQuota`, params);
1784
+ }
1785
+ /**
1786
+ * @deprecated as of 2023-06-22, now Simple Earn
1787
+ */
1788
+ getLeftDailyRedemptionQuotaFlexibleProduct(params) {
1789
+ return this.getPrivate(`sapi/v1/lending/daily/userRedemptionQuota`, params);
1790
+ }
1791
+ /**
1792
+ * @deprecated as of 2023-06-22, now Simple Earn
1793
+ */
1794
+ purchaseFixedAndActivityProject(params) {
1795
+ return this.postPrivate(`sapi/v1/lending/customizedFixed/purchase`, params);
1796
+ }
1797
+ /**
1798
+ * @deprecated as of 2023-06-22, now Simple Earn
1799
+ */
1800
+ getFixedAndActivityProjects(params) {
1801
+ return this.getPrivate(`sapi/v1/lending/project/list`, params);
1802
+ }
1803
+ /**
1804
+ * @deprecated as of 2023-06-22, now Simple Earn
1805
+ */
1806
+ getFixedAndActivityProductPosition(params) {
1807
+ return this.getPrivate(`sapi/v1/lending/project/position/list`, params);
1808
+ }
1809
+ /**
1810
+ * @deprecated as of 2023-06-22, now Simple Earn
1811
+ */
1812
+ getLendingAccount() {
1813
+ return this.getPrivate(`sapi/v1/lending/union/account`);
1814
+ }
1815
+ /**
1816
+ * @deprecated as of 2023-06-22, now Simple Earn
1817
+ */
1818
+ getPurchaseRecord(params) {
1819
+ return this.getPrivate(`sapi/v1/lending/union/purchaseRecord`, params);
1820
+ }
1821
+ /**
1822
+ * @deprecated as of 2023-06-22, now Simple Earn
1823
+ */
1824
+ getRedemptionRecord(params) {
1825
+ return this.getPrivate(`sapi/v1/lending/union/redemptionRecord`, params);
1826
+ }
1827
+ /**
1828
+ * @deprecated as of 2023-06-22, now Simple Earn
1829
+ */
1830
+ getInterestHistory(params) {
1831
+ return this.getPrivate(`sapi/v1/lending/union/interestHistory`, params);
1832
+ }
1833
+ /**
1834
+ * @deprecated as of 2023-06-22, now Simple Earn
1835
+ */
1836
+ changeFixedAndActivityPositionToDailyPosition(params) {
1837
+ return this.postPrivate(`sapi/v1/lending/positionChanged`, params);
1838
+ }
1839
+ /**
1840
+ *
1841
+ * Wallet Endpoints
1842
+ * @deprecated
1843
+ **/
1844
+ /**
1845
+ * @deprecated
1846
+ */
1847
+ enableConvertSubAccount(params) {
1848
+ return this.postPrivate('sapi/v1/broker/subAccount/convert', params);
1849
+ }
1850
+ /**
1851
+ * @deprecated
1852
+ */
1853
+ convertBUSD(params) {
1854
+ return this.postPrivate('sapi/v1/asset/convert-transfer', params);
1855
+ }
1856
+ /**
1857
+ * @deprecated
1858
+ */
1859
+ getConvertBUSDHistory(params) {
1860
+ return this.getPrivate('sapi/v1/asset/convert-transfer/queryByPage', params);
1598
1861
  }
1599
1862
  }
1600
1863
  exports.MainClient = MainClient;