ccxt 4.1.98 → 4.1.99

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.
@@ -208,6 +208,8 @@ class coinex extends coinex$1 {
208
208
  },
209
209
  'put': {
210
210
  'balance/deposit/address/{coin_type}': 40,
211
+ 'sub_account/unfrozen': 40,
212
+ 'sub_account/frozen': 40,
211
213
  'sub_account/auth/api/{user_auth_id}': 40,
212
214
  'v1/account/settings': 40,
213
215
  },
@@ -217,7 +219,10 @@ class coinex extends coinex$1 {
217
219
  'order/pending': 13.334,
218
220
  'order/stop/pending': 40,
219
221
  'order/stop/pending/{id}': 13.334,
222
+ 'order/pending/by_client_id': 40,
223
+ 'order/stop/pending/by_client_id': 40,
220
224
  'sub_account/auth/api/{user_auth_id}': 40,
225
+ 'sub_account/authorize/{id}': 40,
221
226
  },
222
227
  },
223
228
  'perpetualPublic': {
@@ -231,12 +236,12 @@ class coinex extends coinex$1 {
231
236
  'market/depth': 1,
232
237
  'market/deals': 1,
233
238
  'market/funding_history': 1,
234
- 'market/user_deals': 1,
235
239
  'market/kline': 1,
236
240
  },
237
241
  },
238
242
  'perpetualPrivate': {
239
243
  'get': {
244
+ 'market/user_deals': 1,
240
245
  'asset/query': 40,
241
246
  'order/pending': 8,
242
247
  'order/finished': 40,
@@ -244,8 +249,13 @@ class coinex extends coinex$1 {
244
249
  'order/stop_pending': 8,
245
250
  'order/status': 8,
246
251
  'order/stop_status': 8,
252
+ 'position/finished': 40,
247
253
  'position/pending': 40,
248
254
  'position/funding': 40,
255
+ 'position/adl_history': 40,
256
+ 'market/preference': 40,
257
+ 'position/margin_history': 40,
258
+ 'position/settle_history': 40,
249
259
  },
250
260
  'post': {
251
261
  'market/adjust_leverage': 1,
@@ -267,6 +277,9 @@ class coinex extends coinex$1 {
267
277
  'position/stop_loss': 20,
268
278
  'position/take_profit': 20,
269
279
  'position/market_close': 20,
280
+ 'order/cancel/by_client_id': 20,
281
+ 'order/cancel_stop/by_client_id': 20,
282
+ 'market/preference': 20,
270
283
  },
271
284
  },
272
285
  },
@@ -1087,9 +1100,10 @@ class coinex extends coinex$1 {
1087
1100
  const priceString = this.safeString(trade, 'price');
1088
1101
  const amountString = this.safeString(trade, 'amount');
1089
1102
  const marketId = this.safeString(trade, 'market');
1090
- const defaultType = this.safeString(this.options, 'defaultType');
1103
+ const marketType = this.safeString(trade, 'market_type');
1104
+ const defaultType = (marketType === undefined) ? 'spot' : 'swap';
1091
1105
  market = this.safeMarket(marketId, market, undefined, defaultType);
1092
- const symbol = this.safeSymbol(marketId, market, undefined, defaultType);
1106
+ const symbol = market['symbol'];
1093
1107
  const costString = this.safeString(trade, 'deal_money');
1094
1108
  let fee = undefined;
1095
1109
  const feeCostString = this.safeString2(trade, 'fee', 'deal_fee');
@@ -2587,11 +2601,17 @@ class coinex extends coinex$1 {
2587
2601
  * @description cancels an open order
2588
2602
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade018_cancle_stop_pending_order
2589
2603
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade015_cancel_order
2604
+ * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade024_cancel_order_by_client_id
2605
+ * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade025_cancel_stop_order_by_client_id
2590
2606
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http023_cancel_stop_order
2591
2607
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http021_cancel_order
2608
+ * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http042_cancel_order_by_client_id
2609
+ * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http043_cancel_stop_order_by_client_id
2592
2610
  * @param {string} id order id
2593
2611
  * @param {string} symbol unified symbol of the market the order was made in
2594
2612
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2613
+ * @param {string} [params.clientOrderId] client order id, defaults to id if not passed
2614
+ * @param {boolean} [params.stop] if stop order = true, default = false
2595
2615
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2596
2616
  */
2597
2617
  if (symbol === undefined) {
@@ -2604,32 +2624,54 @@ class coinex extends coinex$1 {
2604
2624
  const request = {
2605
2625
  'market': market['id'],
2606
2626
  };
2607
- const idRequest = swap ? 'order_id' : 'id';
2608
- request[idRequest] = id;
2609
2627
  const accountId = this.safeInteger(params, 'account_id');
2610
2628
  const defaultType = this.safeString(this.options, 'defaultType');
2629
+ const clientOrderId = this.safeString2(params, 'client_id', 'clientOrderId');
2611
2630
  if (defaultType === 'margin') {
2612
2631
  if (accountId === undefined) {
2613
2632
  throw new errors.BadRequest(this.id + ' cancelOrder() requires an account_id parameter for margin orders');
2614
2633
  }
2615
2634
  request['account_id'] = accountId;
2616
2635
  }
2617
- const query = this.omit(params, ['stop', 'account_id']);
2636
+ const query = this.omit(params, ['stop', 'account_id', 'clientOrderId']);
2618
2637
  let response = undefined;
2619
- if (stop) {
2620
- if (swap) {
2621
- response = await this.perpetualPrivatePostOrderCancelStop(this.extend(request, query));
2638
+ if (clientOrderId !== undefined) {
2639
+ request['client_id'] = clientOrderId;
2640
+ if (stop) {
2641
+ if (swap) {
2642
+ response = await this.perpetualPrivatePostOrderCancelStopByClientId(this.extend(request, query));
2643
+ }
2644
+ else {
2645
+ response = await this.privateDeleteOrderStopPendingByClientId(this.extend(request, query));
2646
+ }
2622
2647
  }
2623
2648
  else {
2624
- response = await this.privateDeleteOrderStopPendingId(this.extend(request, query));
2649
+ if (swap) {
2650
+ response = await this.perpetualPrivatePostOrderCancelByClientId(this.extend(request, query));
2651
+ }
2652
+ else {
2653
+ response = await this.privateDeleteOrderPendingByClientId(this.extend(request, query));
2654
+ }
2625
2655
  }
2626
2656
  }
2627
2657
  else {
2628
- if (swap) {
2629
- response = await this.perpetualPrivatePostOrderCancel(this.extend(request, query));
2658
+ const idRequest = swap ? 'order_id' : 'id';
2659
+ request[idRequest] = id;
2660
+ if (stop) {
2661
+ if (swap) {
2662
+ response = await this.perpetualPrivatePostOrderCancelStop(this.extend(request, query));
2663
+ }
2664
+ else {
2665
+ response = await this.privateDeleteOrderStopPendingId(this.extend(request, query));
2666
+ }
2630
2667
  }
2631
2668
  else {
2632
- response = await this.privateDeleteOrderPending(this.extend(request, query));
2669
+ if (swap) {
2670
+ response = await this.perpetualPrivatePostOrderCancel(this.extend(request, query));
2671
+ }
2672
+ else {
2673
+ response = await this.privateDeleteOrderPending(this.extend(request, query));
2674
+ }
2633
2675
  }
2634
2676
  }
2635
2677
  //
@@ -3371,16 +3413,11 @@ class coinex extends coinex$1 {
3371
3413
  }
3372
3414
  let response = undefined;
3373
3415
  if (swap) {
3374
- const side = this.safeInteger(params, 'side');
3375
- if (side === undefined) {
3376
- throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a side parameter for swap markets');
3377
- }
3378
3416
  if (since !== undefined) {
3379
3417
  request['start_time'] = since;
3380
3418
  }
3381
- request['side'] = side;
3382
- params = this.omit(params, 'side');
3383
- response = await this.perpetualPublicGetMarketUserDeals(this.extend(request, params));
3419
+ request['side'] = 0;
3420
+ response = await this.perpetualPrivateGetMarketUserDeals(this.extend(request, params));
3384
3421
  }
3385
3422
  else {
3386
3423
  request['page'] = 1;
@@ -5309,7 +5346,7 @@ class coinex extends coinex$1 {
5309
5346
  }
5310
5347
  }
5311
5348
  }
5312
- if (api === 'perpetualPrivate' || url === 'https://api.coinex.com/perpetual/v1/market/user_deals') {
5349
+ if (api === 'perpetualPrivate') {
5313
5350
  this.checkRequiredCredentials();
5314
5351
  query = this.extend({
5315
5352
  'access_id': this.apiKey,
@@ -1357,7 +1357,9 @@ class kraken extends kraken$1 {
1357
1357
  * @param {bool} [params.reduceOnly] *margin only* indicates if this order is to reduce the size of a position
1358
1358
  * @param {float} [params.stopLossPrice] *margin only* the price that a stop loss order is triggered at
1359
1359
  * @param {float} [params.takeProfitPrice] *margin only* the price that a take profit order is triggered at
1360
- * @param {string} [params.trailingStopPrice] *margin only* the quote amount to trail away from the current market price
1360
+ * @param {string} [params.trailingAmount] *margin only* the quote amount to trail away from the current market price
1361
+ * @param {string} [params.trailingLimitAmount] *margin only* the quote amount away from the trailingAmount
1362
+ * @param {string} [params.offset] *margin only* '+' or '-' whether you want the trailingLimitAmount value to be positive or negative, default is negative '-'
1361
1363
  * @param {string} [params.trigger] *margin only* the activation price type, 'last' or 'index', default is 'last'
1362
1364
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1363
1365
  */
@@ -1618,9 +1620,10 @@ class kraken extends kraken$1 {
1618
1620
  const isStopLossTriggerOrder = stopLossTriggerPrice !== undefined;
1619
1621
  const isTakeProfitTriggerOrder = takeProfitTriggerPrice !== undefined;
1620
1622
  const isStopLossOrTakeProfitTrigger = isStopLossTriggerOrder || isTakeProfitTriggerOrder;
1621
- const trailingStopPrice = this.safeString(params, 'trailingStopPrice');
1622
- const isTrailingStopPriceOrder = trailingStopPrice !== undefined;
1623
- if (type === 'limit') {
1623
+ const trailingAmount = this.safeString(params, 'trailingAmount');
1624
+ const trailingLimitAmount = this.safeString(params, 'trailingLimitAmount');
1625
+ const isTrailingAmountOrder = trailingAmount !== undefined;
1626
+ if ((type === 'limit') && !isTrailingAmountOrder) {
1624
1627
  request['price'] = this.priceToPrecision(symbol, price);
1625
1628
  }
1626
1629
  let reduceOnly = this.safeValue2(params, 'reduceOnly', 'reduce_only');
@@ -1636,19 +1639,19 @@ class kraken extends kraken$1 {
1636
1639
  request['price2'] = this.priceToPrecision(symbol, price);
1637
1640
  reduceOnly = true;
1638
1641
  }
1639
- else if (isTrailingStopPriceOrder) {
1640
- const trailingStopActivationPriceType = this.safeString(params, 'trigger', 'last');
1641
- const trailingStopPriceString = '+' + trailingStopPrice;
1642
- request['trigger'] = trailingStopActivationPriceType;
1643
- reduceOnly = true;
1644
- if (type === 'limit') {
1645
- const trailingStopLimitPriceString = '+' + this.numberToString(price);
1646
- request['price'] = trailingStopPriceString;
1647
- request['price2'] = trailingStopLimitPriceString;
1642
+ else if (isTrailingAmountOrder) {
1643
+ const trailingActivationPriceType = this.safeString(params, 'trigger', 'last');
1644
+ const trailingAmountString = '+' + trailingAmount;
1645
+ request['trigger'] = trailingActivationPriceType;
1646
+ if ((type === 'limit') || (trailingLimitAmount !== undefined)) {
1647
+ const offset = this.safeString(params, 'offset', '-');
1648
+ const trailingLimitAmountString = offset + this.numberToString(trailingLimitAmount);
1649
+ request['price'] = trailingAmountString;
1650
+ request['price2'] = trailingLimitAmountString;
1648
1651
  request['ordertype'] = 'trailing-stop-limit';
1649
1652
  }
1650
1653
  else {
1651
- request['price'] = trailingStopPriceString;
1654
+ request['price'] = trailingAmountString;
1652
1655
  request['ordertype'] = 'trailing-stop';
1653
1656
  }
1654
1657
  }
@@ -1678,7 +1681,7 @@ class kraken extends kraken$1 {
1678
1681
  if (postOnly) {
1679
1682
  request['oflags'] = 'post';
1680
1683
  }
1681
- params = this.omit(params, ['timeInForce', 'reduceOnly', 'stopLossPrice', 'takeProfitPrice', 'trailingStopPrice']);
1684
+ params = this.omit(params, ['timeInForce', 'reduceOnly', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingLimitAmount', 'offset']);
1682
1685
  return [request, params];
1683
1686
  }
1684
1687
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
@@ -1696,7 +1699,9 @@ class kraken extends kraken$1 {
1696
1699
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1697
1700
  * @param {float} [params.stopLossPrice] *margin only* the price that a stop loss order is triggered at
1698
1701
  * @param {float} [params.takeProfitPrice] *margin only* the price that a take profit order is triggered at
1699
- * @param {string} [params.trailingStopPrice] *margin only* the quote price away from the current market price
1702
+ * @param {string} [params.trailingAmount] *margin only* the quote price away from the current market price
1703
+ * @param {string} [params.trailingLimitAmount] *margin only* the quote amount away from the trailingAmount
1704
+ * @param {string} [params.offset] *margin only* '+' or '-' whether you want the trailingLimitAmount value to be positive or negative, default is negative '-'
1700
1705
  * @param {string} [params.trigger] *margin only* the activation price type, 'last' or 'index', default is 'last'
1701
1706
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1702
1707
  */
@@ -19,7 +19,7 @@ class binance extends binance$1 {
19
19
  'watchBalance': true,
20
20
  'watchMyTrades': true,
21
21
  'watchOHLCV': true,
22
- 'watchOHLCVForSymbols': true,
22
+ 'watchOHLCVForSymbols': false,
23
23
  'watchOrderBook': true,
24
24
  'watchOrderBookForSymbols': true,
25
25
  'watchOrders': true,
@@ -28,7 +28,7 @@ class bitget extends bitget$1 {
28
28
  'watchBalance': true,
29
29
  'watchMyTrades': true,
30
30
  'watchOHLCV': true,
31
- 'watchOHLCVForSymbols': true,
31
+ 'watchOHLCVForSymbols': false,
32
32
  'watchOrderBook': true,
33
33
  'watchOrderBookForSymbols': true,
34
34
  'watchOrders': true,
@@ -24,7 +24,7 @@ class bybit extends bybit$1 {
24
24
  'watchBalance': true,
25
25
  'watchMyTrades': true,
26
26
  'watchOHLCV': true,
27
- 'watchOHLCVForSymbols': true,
27
+ 'watchOHLCVForSymbols': false,
28
28
  'watchOrderBook': true,
29
29
  'watchOrderBookForSymbols': true,
30
30
  'watchOrders': true,
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.1.97";
7
+ declare const version = "4.1.98";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.1.98';
41
+ const version = '4.1.99';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -129,6 +129,15 @@ interface Exchange {
129
129
  sapiGetLendingUnionInterestHistory(params?: {}): Promise<implicitReturnType>;
130
130
  sapiGetLendingProjectList(params?: {}): Promise<implicitReturnType>;
131
131
  sapiGetLendingProjectPositionList(params?: {}): Promise<implicitReturnType>;
132
+ sapiGetEthStakingEthHistoryStakingHistory(params?: {}): Promise<implicitReturnType>;
133
+ sapiGetEthStakingEthHistoryRedemptionHistory(params?: {}): Promise<implicitReturnType>;
134
+ sapiGetEthStakingEthHistoryRewardsHistory(params?: {}): Promise<implicitReturnType>;
135
+ sapiGetEthStakingEthQuota(params?: {}): Promise<implicitReturnType>;
136
+ sapiGetEthStakingEthHistoryRateHistory(params?: {}): Promise<implicitReturnType>;
137
+ sapiGetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
138
+ sapiGetEthStakingWbethHistoryWrapHistory(params?: {}): Promise<implicitReturnType>;
139
+ sapiGetEthStakingWbethHistoryUnwrapHistory(params?: {}): Promise<implicitReturnType>;
140
+ sapiGetEthStakingEthHistoryWbethRewardsHistory(params?: {}): Promise<implicitReturnType>;
132
141
  sapiGetMiningPubAlgoList(params?: {}): Promise<implicitReturnType>;
133
142
  sapiGetMiningPubCoinList(params?: {}): Promise<implicitReturnType>;
134
143
  sapiGetMiningWorkerDetail(params?: {}): Promise<implicitReturnType>;
@@ -308,6 +317,11 @@ interface Exchange {
308
317
  sapiPostStakingPurchase(params?: {}): Promise<implicitReturnType>;
309
318
  sapiPostStakingRedeem(params?: {}): Promise<implicitReturnType>;
310
319
  sapiPostStakingSetAutoStaking(params?: {}): Promise<implicitReturnType>;
320
+ sapiPostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
321
+ sapiPostEthStakingEthRedeem(params?: {}): Promise<implicitReturnType>;
322
+ sapiPostEthStakingWbethWrap(params?: {}): Promise<implicitReturnType>;
323
+ sapiPostMiningHashTransferConfig(params?: {}): Promise<implicitReturnType>;
324
+ sapiPostMiningHashTransferConfigCancel(params?: {}): Promise<implicitReturnType>;
311
325
  sapiPostPortfolioRepay(params?: {}): Promise<implicitReturnType>;
312
326
  sapiPostLoanVipRenew(params?: {}): Promise<implicitReturnType>;
313
327
  sapiPostLoanVipBorrow(params?: {}): Promise<implicitReturnType>;
@@ -350,9 +364,11 @@ interface Exchange {
350
364
  sapiDeleteAlgoSpotOrder(params?: {}): Promise<implicitReturnType>;
351
365
  sapiDeleteAlgoFuturesOrder(params?: {}): Promise<implicitReturnType>;
352
366
  sapiDeleteSubAccountSubAccountApiIpRestrictionIpList(params?: {}): Promise<implicitReturnType>;
367
+ sapiV2GetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
353
368
  sapiV2GetSubAccountFuturesAccount(params?: {}): Promise<implicitReturnType>;
354
369
  sapiV2GetSubAccountFuturesAccountSummary(params?: {}): Promise<implicitReturnType>;
355
370
  sapiV2GetSubAccountFuturesPositionRisk(params?: {}): Promise<implicitReturnType>;
371
+ sapiV2PostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
356
372
  sapiV2PostSubAccountSubAccountApiIpRestriction(params?: {}): Promise<implicitReturnType>;
357
373
  sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
358
374
  sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
@@ -129,6 +129,15 @@ interface binance {
129
129
  sapiGetLendingUnionInterestHistory(params?: {}): Promise<implicitReturnType>;
130
130
  sapiGetLendingProjectList(params?: {}): Promise<implicitReturnType>;
131
131
  sapiGetLendingProjectPositionList(params?: {}): Promise<implicitReturnType>;
132
+ sapiGetEthStakingEthHistoryStakingHistory(params?: {}): Promise<implicitReturnType>;
133
+ sapiGetEthStakingEthHistoryRedemptionHistory(params?: {}): Promise<implicitReturnType>;
134
+ sapiGetEthStakingEthHistoryRewardsHistory(params?: {}): Promise<implicitReturnType>;
135
+ sapiGetEthStakingEthQuota(params?: {}): Promise<implicitReturnType>;
136
+ sapiGetEthStakingEthHistoryRateHistory(params?: {}): Promise<implicitReturnType>;
137
+ sapiGetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
138
+ sapiGetEthStakingWbethHistoryWrapHistory(params?: {}): Promise<implicitReturnType>;
139
+ sapiGetEthStakingWbethHistoryUnwrapHistory(params?: {}): Promise<implicitReturnType>;
140
+ sapiGetEthStakingEthHistoryWbethRewardsHistory(params?: {}): Promise<implicitReturnType>;
132
141
  sapiGetMiningPubAlgoList(params?: {}): Promise<implicitReturnType>;
133
142
  sapiGetMiningPubCoinList(params?: {}): Promise<implicitReturnType>;
134
143
  sapiGetMiningWorkerDetail(params?: {}): Promise<implicitReturnType>;
@@ -308,6 +317,11 @@ interface binance {
308
317
  sapiPostStakingPurchase(params?: {}): Promise<implicitReturnType>;
309
318
  sapiPostStakingRedeem(params?: {}): Promise<implicitReturnType>;
310
319
  sapiPostStakingSetAutoStaking(params?: {}): Promise<implicitReturnType>;
320
+ sapiPostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
321
+ sapiPostEthStakingEthRedeem(params?: {}): Promise<implicitReturnType>;
322
+ sapiPostEthStakingWbethWrap(params?: {}): Promise<implicitReturnType>;
323
+ sapiPostMiningHashTransferConfig(params?: {}): Promise<implicitReturnType>;
324
+ sapiPostMiningHashTransferConfigCancel(params?: {}): Promise<implicitReturnType>;
311
325
  sapiPostPortfolioRepay(params?: {}): Promise<implicitReturnType>;
312
326
  sapiPostLoanVipRenew(params?: {}): Promise<implicitReturnType>;
313
327
  sapiPostLoanVipBorrow(params?: {}): Promise<implicitReturnType>;
@@ -350,9 +364,11 @@ interface binance {
350
364
  sapiDeleteAlgoSpotOrder(params?: {}): Promise<implicitReturnType>;
351
365
  sapiDeleteAlgoFuturesOrder(params?: {}): Promise<implicitReturnType>;
352
366
  sapiDeleteSubAccountSubAccountApiIpRestrictionIpList(params?: {}): Promise<implicitReturnType>;
367
+ sapiV2GetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
353
368
  sapiV2GetSubAccountFuturesAccount(params?: {}): Promise<implicitReturnType>;
354
369
  sapiV2GetSubAccountFuturesAccountSummary(params?: {}): Promise<implicitReturnType>;
355
370
  sapiV2GetSubAccountFuturesPositionRisk(params?: {}): Promise<implicitReturnType>;
371
+ sapiV2PostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
356
372
  sapiV2PostSubAccountSubAccountApiIpRestriction(params?: {}): Promise<implicitReturnType>;
357
373
  sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
358
374
  sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
@@ -129,6 +129,15 @@ interface binance {
129
129
  sapiGetLendingUnionInterestHistory(params?: {}): Promise<implicitReturnType>;
130
130
  sapiGetLendingProjectList(params?: {}): Promise<implicitReturnType>;
131
131
  sapiGetLendingProjectPositionList(params?: {}): Promise<implicitReturnType>;
132
+ sapiGetEthStakingEthHistoryStakingHistory(params?: {}): Promise<implicitReturnType>;
133
+ sapiGetEthStakingEthHistoryRedemptionHistory(params?: {}): Promise<implicitReturnType>;
134
+ sapiGetEthStakingEthHistoryRewardsHistory(params?: {}): Promise<implicitReturnType>;
135
+ sapiGetEthStakingEthQuota(params?: {}): Promise<implicitReturnType>;
136
+ sapiGetEthStakingEthHistoryRateHistory(params?: {}): Promise<implicitReturnType>;
137
+ sapiGetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
138
+ sapiGetEthStakingWbethHistoryWrapHistory(params?: {}): Promise<implicitReturnType>;
139
+ sapiGetEthStakingWbethHistoryUnwrapHistory(params?: {}): Promise<implicitReturnType>;
140
+ sapiGetEthStakingEthHistoryWbethRewardsHistory(params?: {}): Promise<implicitReturnType>;
132
141
  sapiGetMiningPubAlgoList(params?: {}): Promise<implicitReturnType>;
133
142
  sapiGetMiningPubCoinList(params?: {}): Promise<implicitReturnType>;
134
143
  sapiGetMiningWorkerDetail(params?: {}): Promise<implicitReturnType>;
@@ -308,6 +317,11 @@ interface binance {
308
317
  sapiPostStakingPurchase(params?: {}): Promise<implicitReturnType>;
309
318
  sapiPostStakingRedeem(params?: {}): Promise<implicitReturnType>;
310
319
  sapiPostStakingSetAutoStaking(params?: {}): Promise<implicitReturnType>;
320
+ sapiPostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
321
+ sapiPostEthStakingEthRedeem(params?: {}): Promise<implicitReturnType>;
322
+ sapiPostEthStakingWbethWrap(params?: {}): Promise<implicitReturnType>;
323
+ sapiPostMiningHashTransferConfig(params?: {}): Promise<implicitReturnType>;
324
+ sapiPostMiningHashTransferConfigCancel(params?: {}): Promise<implicitReturnType>;
311
325
  sapiPostPortfolioRepay(params?: {}): Promise<implicitReturnType>;
312
326
  sapiPostLoanVipRenew(params?: {}): Promise<implicitReturnType>;
313
327
  sapiPostLoanVipBorrow(params?: {}): Promise<implicitReturnType>;
@@ -350,9 +364,11 @@ interface binance {
350
364
  sapiDeleteAlgoSpotOrder(params?: {}): Promise<implicitReturnType>;
351
365
  sapiDeleteAlgoFuturesOrder(params?: {}): Promise<implicitReturnType>;
352
366
  sapiDeleteSubAccountSubAccountApiIpRestrictionIpList(params?: {}): Promise<implicitReturnType>;
367
+ sapiV2GetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
353
368
  sapiV2GetSubAccountFuturesAccount(params?: {}): Promise<implicitReturnType>;
354
369
  sapiV2GetSubAccountFuturesAccountSummary(params?: {}): Promise<implicitReturnType>;
355
370
  sapiV2GetSubAccountFuturesPositionRisk(params?: {}): Promise<implicitReturnType>;
371
+ sapiV2PostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
356
372
  sapiV2PostSubAccountSubAccountApiIpRestriction(params?: {}): Promise<implicitReturnType>;
357
373
  sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
358
374
  sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
@@ -129,6 +129,15 @@ interface binance {
129
129
  sapiGetLendingUnionInterestHistory(params?: {}): Promise<implicitReturnType>;
130
130
  sapiGetLendingProjectList(params?: {}): Promise<implicitReturnType>;
131
131
  sapiGetLendingProjectPositionList(params?: {}): Promise<implicitReturnType>;
132
+ sapiGetEthStakingEthHistoryStakingHistory(params?: {}): Promise<implicitReturnType>;
133
+ sapiGetEthStakingEthHistoryRedemptionHistory(params?: {}): Promise<implicitReturnType>;
134
+ sapiGetEthStakingEthHistoryRewardsHistory(params?: {}): Promise<implicitReturnType>;
135
+ sapiGetEthStakingEthQuota(params?: {}): Promise<implicitReturnType>;
136
+ sapiGetEthStakingEthHistoryRateHistory(params?: {}): Promise<implicitReturnType>;
137
+ sapiGetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
138
+ sapiGetEthStakingWbethHistoryWrapHistory(params?: {}): Promise<implicitReturnType>;
139
+ sapiGetEthStakingWbethHistoryUnwrapHistory(params?: {}): Promise<implicitReturnType>;
140
+ sapiGetEthStakingEthHistoryWbethRewardsHistory(params?: {}): Promise<implicitReturnType>;
132
141
  sapiGetMiningPubAlgoList(params?: {}): Promise<implicitReturnType>;
133
142
  sapiGetMiningPubCoinList(params?: {}): Promise<implicitReturnType>;
134
143
  sapiGetMiningWorkerDetail(params?: {}): Promise<implicitReturnType>;
@@ -308,6 +317,11 @@ interface binance {
308
317
  sapiPostStakingPurchase(params?: {}): Promise<implicitReturnType>;
309
318
  sapiPostStakingRedeem(params?: {}): Promise<implicitReturnType>;
310
319
  sapiPostStakingSetAutoStaking(params?: {}): Promise<implicitReturnType>;
320
+ sapiPostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
321
+ sapiPostEthStakingEthRedeem(params?: {}): Promise<implicitReturnType>;
322
+ sapiPostEthStakingWbethWrap(params?: {}): Promise<implicitReturnType>;
323
+ sapiPostMiningHashTransferConfig(params?: {}): Promise<implicitReturnType>;
324
+ sapiPostMiningHashTransferConfigCancel(params?: {}): Promise<implicitReturnType>;
311
325
  sapiPostPortfolioRepay(params?: {}): Promise<implicitReturnType>;
312
326
  sapiPostLoanVipRenew(params?: {}): Promise<implicitReturnType>;
313
327
  sapiPostLoanVipBorrow(params?: {}): Promise<implicitReturnType>;
@@ -350,9 +364,11 @@ interface binance {
350
364
  sapiDeleteAlgoSpotOrder(params?: {}): Promise<implicitReturnType>;
351
365
  sapiDeleteAlgoFuturesOrder(params?: {}): Promise<implicitReturnType>;
352
366
  sapiDeleteSubAccountSubAccountApiIpRestrictionIpList(params?: {}): Promise<implicitReturnType>;
367
+ sapiV2GetEthStakingAccount(params?: {}): Promise<implicitReturnType>;
353
368
  sapiV2GetSubAccountFuturesAccount(params?: {}): Promise<implicitReturnType>;
354
369
  sapiV2GetSubAccountFuturesAccountSummary(params?: {}): Promise<implicitReturnType>;
355
370
  sapiV2GetSubAccountFuturesPositionRisk(params?: {}): Promise<implicitReturnType>;
371
+ sapiV2PostEthStakingEthStake(params?: {}): Promise<implicitReturnType>;
356
372
  sapiV2PostSubAccountSubAccountApiIpRestriction(params?: {}): Promise<implicitReturnType>;
357
373
  sapiV3GetSubAccountAssets(params?: {}): Promise<implicitReturnType>;
358
374
  sapiV3PostAssetGetUserAsset(params?: {}): Promise<implicitReturnType>;
@@ -64,6 +64,8 @@ interface Exchange {
64
64
  privatePostSubAccountFrozen(params?: {}): Promise<implicitReturnType>;
65
65
  privatePostSubAccountAuthApi(params?: {}): Promise<implicitReturnType>;
66
66
  privatePutBalanceDepositAddressCoinType(params?: {}): Promise<implicitReturnType>;
67
+ privatePutSubAccountUnfrozen(params?: {}): Promise<implicitReturnType>;
68
+ privatePutSubAccountFrozen(params?: {}): Promise<implicitReturnType>;
67
69
  privatePutSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
68
70
  privatePutV1AccountSettings(params?: {}): Promise<implicitReturnType>;
69
71
  privateDeleteBalanceCoinWithdraw(params?: {}): Promise<implicitReturnType>;
@@ -71,7 +73,10 @@ interface Exchange {
71
73
  privateDeleteOrderPending(params?: {}): Promise<implicitReturnType>;
72
74
  privateDeleteOrderStopPending(params?: {}): Promise<implicitReturnType>;
73
75
  privateDeleteOrderStopPendingId(params?: {}): Promise<implicitReturnType>;
76
+ privateDeleteOrderPendingByClientId(params?: {}): Promise<implicitReturnType>;
77
+ privateDeleteOrderStopPendingByClientId(params?: {}): Promise<implicitReturnType>;
74
78
  privateDeleteSubAccountAuthApiUserAuthId(params?: {}): Promise<implicitReturnType>;
79
+ privateDeleteSubAccountAuthorizeId(params?: {}): Promise<implicitReturnType>;
75
80
  perpetualPublicGetPing(params?: {}): Promise<implicitReturnType>;
76
81
  perpetualPublicGetTime(params?: {}): Promise<implicitReturnType>;
77
82
  perpetualPublicGetMarketList(params?: {}): Promise<implicitReturnType>;
@@ -81,8 +86,8 @@ interface Exchange {
81
86
  perpetualPublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
82
87
  perpetualPublicGetMarketDeals(params?: {}): Promise<implicitReturnType>;
83
88
  perpetualPublicGetMarketFundingHistory(params?: {}): Promise<implicitReturnType>;
84
- perpetualPublicGetMarketUserDeals(params?: {}): Promise<implicitReturnType>;
85
89
  perpetualPublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
90
+ perpetualPrivateGetMarketUserDeals(params?: {}): Promise<implicitReturnType>;
86
91
  perpetualPrivateGetAssetQuery(params?: {}): Promise<implicitReturnType>;
87
92
  perpetualPrivateGetOrderPending(params?: {}): Promise<implicitReturnType>;
88
93
  perpetualPrivateGetOrderFinished(params?: {}): Promise<implicitReturnType>;
@@ -90,8 +95,13 @@ interface Exchange {
90
95
  perpetualPrivateGetOrderStopPending(params?: {}): Promise<implicitReturnType>;
91
96
  perpetualPrivateGetOrderStatus(params?: {}): Promise<implicitReturnType>;
92
97
  perpetualPrivateGetOrderStopStatus(params?: {}): Promise<implicitReturnType>;
98
+ perpetualPrivateGetPositionFinished(params?: {}): Promise<implicitReturnType>;
93
99
  perpetualPrivateGetPositionPending(params?: {}): Promise<implicitReturnType>;
94
100
  perpetualPrivateGetPositionFunding(params?: {}): Promise<implicitReturnType>;
101
+ perpetualPrivateGetPositionAdlHistory(params?: {}): Promise<implicitReturnType>;
102
+ perpetualPrivateGetMarketPreference(params?: {}): Promise<implicitReturnType>;
103
+ perpetualPrivateGetPositionMarginHistory(params?: {}): Promise<implicitReturnType>;
104
+ perpetualPrivateGetPositionSettleHistory(params?: {}): Promise<implicitReturnType>;
95
105
  perpetualPrivatePostMarketAdjustLeverage(params?: {}): Promise<implicitReturnType>;
96
106
  perpetualPrivatePostMarketPositionExpect(params?: {}): Promise<implicitReturnType>;
97
107
  perpetualPrivatePostOrderPutLimit(params?: {}): Promise<implicitReturnType>;
@@ -111,6 +121,9 @@ interface Exchange {
111
121
  perpetualPrivatePostPositionStopLoss(params?: {}): Promise<implicitReturnType>;
112
122
  perpetualPrivatePostPositionTakeProfit(params?: {}): Promise<implicitReturnType>;
113
123
  perpetualPrivatePostPositionMarketClose(params?: {}): Promise<implicitReturnType>;
124
+ perpetualPrivatePostOrderCancelByClientId(params?: {}): Promise<implicitReturnType>;
125
+ perpetualPrivatePostOrderCancelStopByClientId(params?: {}): Promise<implicitReturnType>;
126
+ perpetualPrivatePostMarketPreference(params?: {}): Promise<implicitReturnType>;
114
127
  }
115
128
  declare abstract class Exchange extends _Exchange {
116
129
  }
@@ -311,7 +311,9 @@ export default class Exchange {
311
311
  createOrderWs: any;
312
312
  editOrderWs: any;
313
313
  fetchOpenOrdersWs: any;
314
+ fetchClosedOrdersWs: any;
314
315
  fetchOrderWs: any;
316
+ fetchOrdersWs: any;
315
317
  cancelOrderWs: any;
316
318
  cancelOrdersWs: any;
317
319
  cancelAllOrdersWs: any;
@@ -779,11 +781,13 @@ export default class Exchange {
779
781
  cancelAllOrdersWs(symbol?: string, params?: {}): Promise<any>;
780
782
  cancelUnifiedOrder(order: any, params?: {}): Promise<any>;
781
783
  fetchOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
784
+ fetchOrdersWs(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
782
785
  fetchOrderTrades(id: string, symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
783
786
  watchOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
784
787
  fetchOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
785
788
  fetchOpenOrdersWs(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
786
789
  fetchClosedOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
790
+ fetchClosedOrdersWs(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
787
791
  fetchMyTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
788
792
  fetchMyLiquidations(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
789
793
  fetchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
@@ -367,7 +367,9 @@ export default class Exchange {
367
367
  'createOrderWs': undefined,
368
368
  'editOrderWs': undefined,
369
369
  'fetchOpenOrdersWs': undefined,
370
+ 'fetchClosedOrdersWs': undefined,
370
371
  'fetchOrderWs': undefined,
372
+ 'fetchOrdersWs': undefined,
371
373
  'cancelOrderWs': undefined,
372
374
  'cancelOrdersWs': undefined,
373
375
  'cancelAllOrdersWs': undefined,
@@ -2283,6 +2285,11 @@ export default class Exchange {
2283
2285
  if ('rate' in tradeFee) {
2284
2286
  tradeFee['rate'] = this.safeNumber(tradeFee, 'rate');
2285
2287
  }
2288
+ const entryFees = this.safeValue(entry, 'fees', []);
2289
+ for (let j = 0; j < entryFees.length; j++) {
2290
+ entryFees[j]['cost'] = this.safeNumber(entryFees[j], 'cost');
2291
+ }
2292
+ entry['fees'] = entryFees;
2286
2293
  entry['fee'] = tradeFee;
2287
2294
  }
2288
2295
  let timeInForce = this.safeString(order, 'timeInForce');
@@ -3756,6 +3763,9 @@ export default class Exchange {
3756
3763
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3757
3764
  throw new NotSupported(this.id + ' fetchOrders() is not supported yet');
3758
3765
  }
3766
+ async fetchOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3767
+ throw new NotSupported(this.id + ' fetchOrdersWs() is not supported yet');
3768
+ }
3759
3769
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
3760
3770
  throw new NotSupported(this.id + ' fetchOrderTrades() is not supported yet');
3761
3771
  }
@@ -3763,14 +3773,33 @@ export default class Exchange {
3763
3773
  throw new NotSupported(this.id + ' watchOrders() is not supported yet');
3764
3774
  }
3765
3775
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3776
+ if (this.has['fetchOrders']) {
3777
+ const orders = await this.fetchOrders(symbol, since, limit, params);
3778
+ return this.filterBy(orders, 'status', 'open');
3779
+ }
3766
3780
  throw new NotSupported(this.id + ' fetchOpenOrders() is not supported yet');
3767
3781
  }
3768
3782
  async fetchOpenOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3783
+ if (this.has['fetchOrdersWs']) {
3784
+ const orders = await this.fetchOrdersWs(symbol, since, limit, params);
3785
+ return this.filterBy(orders, 'status', 'open');
3786
+ }
3769
3787
  throw new NotSupported(this.id + ' fetchOpenOrdersWs() is not supported yet');
3770
3788
  }
3771
3789
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3790
+ if (this.has['fetchOrders']) {
3791
+ const orders = await this.fetchOrders(symbol, since, limit, params);
3792
+ return this.filterBy(orders, 'status', 'closed');
3793
+ }
3772
3794
  throw new NotSupported(this.id + ' fetchClosedOrders() is not supported yet');
3773
3795
  }
3796
+ async fetchClosedOrdersWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3797
+ if (this.has['fetchOrdersWs']) {
3798
+ const orders = await this.fetchOrdersWs(symbol, since, limit, params);
3799
+ return this.filterBy(orders, 'status', 'closed');
3800
+ }
3801
+ throw new NotSupported(this.id + ' fetchClosedOrdersWs() is not supported yet');
3802
+ }
3774
3803
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3775
3804
  throw new NotSupported(this.id + ' fetchMyTrades() is not supported yet');
3776
3805
  }