ccxt 4.0.77 → 4.0.79

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.
@@ -9907,12 +9907,18 @@ class Exchange {
9907
9907
  precision = this.safeValue(networkItem, 'precision', precision);
9908
9908
  }
9909
9909
  if (precision === undefined) {
9910
- return fee;
9910
+ return this.forceString(fee);
9911
9911
  }
9912
9912
  else {
9913
9913
  return this.decimalToPrecision(fee, ROUND, precision, this.precisionMode, this.paddingMode);
9914
9914
  }
9915
9915
  }
9916
+ forceString(value) {
9917
+ if (typeof value !== 'string') {
9918
+ return this.numberToString(value);
9919
+ }
9920
+ return value;
9921
+ }
9916
9922
  isTickPrecision() {
9917
9923
  return this.precisionMode === TICK_SIZE;
9918
9924
  }
@@ -15723,12 +15729,11 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15723
15729
  'api': {
15724
15730
  // the API structure below will need 3-layer apidefs
15725
15731
  'sapi': {
15726
- // IP (api) = 1200 per minute => (rateLimit = 50)
15727
15732
  // IP (sapi) request rate limit of 12 000 per minute
15728
- // 1 IP (sapi) => cost = 0.1
15733
+ // 1 IP (sapi) => cost = 0.1 => (1000 / (50 * 0.1)) * 60 = 12000
15729
15734
  // 10 IP (sapi) => cost = 1
15730
15735
  // UID (sapi) request rate limit of 180 000 per minute
15731
- // 1 UID (sapi) => cost = 1200 / 180 000 = 0.006667
15736
+ // 1 UID (sapi) => cost = 0.006667 => (1000 / (50 * 0.006667)) * 60 = 180000
15732
15737
  'get': {
15733
15738
  'system/status': 0.1,
15734
15739
  // these endpoints require this.apiKey
@@ -15744,7 +15749,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15744
15749
  'asset/transfer': 0.1,
15745
15750
  'asset/assetDetail': 0.1,
15746
15751
  'asset/tradeFee': 0.1,
15747
- 'asset/ledger-transfer/cloud-mining/queryByPage': 4,
15752
+ 'asset/ledger-transfer/cloud-mining/queryByPage': 4.0002,
15748
15753
  'asset/convert-transfer/queryByPage': 0.033335,
15749
15754
  'margin/loan': 1,
15750
15755
  'margin/repay': 1,
@@ -15773,15 +15778,16 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15773
15778
  'margin/isolatedMarginTier': 0.1,
15774
15779
  'margin/rateLimit/order': 2,
15775
15780
  'margin/dribblet': 0.1,
15776
- 'margin/dust': 20,
15781
+ 'margin/dust': 20.001,
15777
15782
  'margin/crossMarginCollateralRatio': 10,
15778
15783
  'margin/exchange-small-liability': 0.6667,
15779
15784
  'margin/exchange-small-liability-history': 0.6667,
15780
15785
  'margin/next-hourly-interest-rate': 0.6667,
15786
+ 'margin/delist-schedule': 0.6667,
15781
15787
  'loan/vip/loanable/data': 40,
15782
15788
  'loan/vip/collateral/data': 40,
15783
- 'loan/vip/request/data': 40,
15784
- 'loan/income': 40,
15789
+ 'loan/vip/request/data': 2.6668,
15790
+ 'loan/income': 40.002,
15785
15791
  'loan/ongoing/orders': 40,
15786
15792
  'loan/ltv/adjustment/history': 40,
15787
15793
  'loan/borrow/history': 40,
@@ -15800,7 +15806,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15800
15806
  'futures/loan/wallet': 1,
15801
15807
  'futures/loan/adjustCollateral/history': 1,
15802
15808
  'futures/loan/liquidationHistory': 1,
15803
- 'rebate/taxQuery': 20.001,
15809
+ 'rebate/taxQuery': 80.004,
15804
15810
  // https://binance-docs.github.io/apidocs/spot/en/#withdraw-sapi
15805
15811
  'capital/config/getall': 1,
15806
15812
  'capital/deposit/address': 1,
@@ -15809,7 +15815,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15809
15815
  'capital/deposit/subHisrec': 0.1,
15810
15816
  'capital/withdraw/history': 0.1,
15811
15817
  'capital/contract/convertible-coins': 4.0002,
15812
- 'convert/tradeFlow': 20.0001,
15818
+ 'convert/tradeFlow': 20.001,
15813
15819
  'convert/exchangeInfo': 50,
15814
15820
  'convert/assetInfo': 10,
15815
15821
  'convert/orderStatus': 0.6667,
@@ -15817,7 +15823,6 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15817
15823
  'account/apiTradingStatus': 0.1,
15818
15824
  'account/apiRestrictions/ipRestriction': 0.1,
15819
15825
  'bnbBurn': 0.1,
15820
- // 'sub-account/assets': 1, (v3 endpoint)
15821
15826
  'sub-account/futures/account': 1,
15822
15827
  'sub-account/futures/accountSummary': 0.1,
15823
15828
  'sub-account/futures/positionRisk': 1,
@@ -15831,15 +15836,16 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15831
15836
  'sub-account/transfer/subUserHistory': 0.1,
15832
15837
  'sub-account/universalTransfer': 0.1,
15833
15838
  'sub-account/apiRestrictions/ipRestriction/thirdPartyList': 1,
15834
- 'sub-account/transaction-tatistics': 0.4,
15839
+ 'sub-account/transaction-statistics': 0.40002,
15840
+ 'sub-account/subAccountApi/ipRestriction': 20.001,
15835
15841
  'managed-subaccount/asset': 0.1,
15836
15842
  'managed-subaccount/accountSnapshot': 240,
15837
15843
  'managed-subaccount/queryTransLogForInvestor': 0.1,
15838
- 'managed-subaccount/queryTransLogForTradeParent': 0.1,
15839
- 'managed-subaccount/fetch-future-asset': 0.1,
15844
+ 'managed-subaccount/queryTransLogForTradeParent': 0.40002,
15845
+ 'managed-subaccount/fetch-future-asset': 0.40002,
15840
15846
  'managed-subaccount/marginAsset': 0.1,
15841
- 'managed-subaccount/info': 0.4,
15842
- 'managed-subaccount/deposit/address': 0.1,
15847
+ 'managed-subaccount/info': 0.40002,
15848
+ 'managed-subaccount/deposit/address': 0.006667,
15843
15849
  'managed-subaccount/query-trans-log': 0.40002,
15844
15850
  // lending endpoints
15845
15851
  'lending/daily/product/list': 0.1,
@@ -15917,6 +15923,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15917
15923
  'giftcard/verify': 0.1,
15918
15924
  'giftcard/cryptography/rsa-public-key': 0.1,
15919
15925
  'giftcard/buyCode/token-limit': 0.1,
15926
+ 'algo/spot/openOrders': 0.1,
15927
+ 'algo/spot/historicalOrders': 0.1,
15928
+ 'algo/spot/subOrders': 0.1,
15920
15929
  'algo/futures/openOrders': 0.1,
15921
15930
  'algo/futures/historicalOrders': 0.1,
15922
15931
  'algo/futures/subOrders': 0.1,
@@ -15958,9 +15967,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15958
15967
  'simple-earn/flexible/history/collateralRecord': 0.1,
15959
15968
  },
15960
15969
  'post': {
15961
- 'asset/dust': 1,
15970
+ 'asset/dust': 0.06667,
15962
15971
  'asset/dust-btc': 0.1,
15963
- 'asset/transfer': 0.1,
15972
+ 'asset/transfer': 6.0003,
15964
15973
  'asset/get-funding-asset': 0.1,
15965
15974
  'asset/convert-transfer': 0.033335,
15966
15975
  'account/disableFastWithdrawSwitch': 0.1,
@@ -15970,12 +15979,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15970
15979
  'capital/withdraw/apply': 4.0002,
15971
15980
  'capital/contract/convertible-coins': 4.0002,
15972
15981
  'capital/deposit/credit-apply': 0.1,
15973
- 'margin/transfer': 1,
15982
+ 'margin/transfer': 4.0002,
15974
15983
  'margin/loan': 20.001,
15975
15984
  'margin/repay': 20.001,
15976
15985
  'margin/order': 0.040002,
15977
15986
  'margin/order/oco': 0.040002,
15978
- 'margin/dust': 20,
15987
+ 'margin/dust': 20.001,
15979
15988
  'margin/exchange-small-liability': 20.001,
15980
15989
  // 'margin/isolated/create': 1, discontinued
15981
15990
  'margin/isolated/transfer': 4.0002,
@@ -15992,8 +16001,6 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15992
16001
  'sub-account/transfer/subToMaster': 0.1,
15993
16002
  'sub-account/universalTransfer': 0.1,
15994
16003
  'sub-account/options/enable': 0.1,
15995
- // v2 not supported yet
15996
- // 'sub-account/subAccountApi/ipRestriction': 20,
15997
16004
  'managed-subaccount/deposit': 0.1,
15998
16005
  'managed-subaccount/withdraw': 0.1,
15999
16006
  'userDataStream': 0.1,
@@ -16039,6 +16046,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16039
16046
  'giftcard/createCode': 0.1,
16040
16047
  'giftcard/redeemCode': 0.1,
16041
16048
  'giftcard/buyCode': 0.1,
16049
+ 'algo/spot/newOrderTwap': 20.001,
16042
16050
  'algo/futures/newOrderVp': 20.001,
16043
16051
  'algo/futures/newOrderTwap': 20.001,
16044
16052
  // staking
@@ -16046,14 +16054,14 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16046
16054
  'staking/redeem': 0.1,
16047
16055
  'staking/setAutoStaking': 0.1,
16048
16056
  'portfolio/repay': 20.001,
16049
- 'loan/vip/renew': 40,
16050
- 'loan/vip/borrow': 40,
16051
- 'loan/borrow': 40,
16052
- 'loan/repay': 40,
16053
- 'loan/adjust/ltv': 40,
16054
- 'loan/customize/margin_call': 40,
16055
- 'loan/vip/repay': 40,
16056
- 'convert/getQuote': 20.001,
16057
+ 'loan/vip/renew': 40.002,
16058
+ 'loan/vip/borrow': 40.002,
16059
+ 'loan/borrow': 40.002,
16060
+ 'loan/repay': 40.002,
16061
+ 'loan/adjust/ltv': 40.002,
16062
+ 'loan/customize/margin_call': 40.002,
16063
+ 'loan/vip/repay': 40.002,
16064
+ 'convert/getQuote': 1.3334,
16057
16065
  'convert/acceptQuote': 3.3335,
16058
16066
  'portfolio/auto-collection': 150,
16059
16067
  'portfolio/asset-collection': 6,
@@ -16078,15 +16086,17 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16078
16086
  'delete': {
16079
16087
  // 'account/apiRestrictions/ipRestriction/ipList': 1, discontinued
16080
16088
  'margin/openOrders': 0.1,
16081
- 'margin/order': 0.0066667,
16082
- 'margin/orderList': 0.0066667,
16089
+ 'margin/order': 0.006667,
16090
+ 'margin/orderList': 0.006667,
16083
16091
  'margin/isolated/account': 2.0001,
16084
16092
  'userDataStream': 0.1,
16085
16093
  'userDataStream/isolated': 0.1,
16086
16094
  // brokerage API TODO NO MENTION OF RATELIMIT IN BROKERAGE DOCS
16087
16095
  'broker/subAccountApi': 1,
16088
16096
  'broker/subAccountApi/ipRestriction/ipList': 1,
16097
+ 'algo/spot/order': 0.1,
16089
16098
  'algo/futures/order': 0.1,
16099
+ 'sub-account/subAccountApi/ipRestriction/ipList': 20.001, // Weight(UID): 3000 => cost = 0.006667 * 3000 = 20.001
16090
16100
  },
16091
16101
  },
16092
16102
  'sapiV2': {
@@ -16094,10 +16104,13 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16094
16104
  'sub-account/futures/account': 0.1,
16095
16105
  'sub-account/futures/positionRisk': 0.1,
16096
16106
  },
16107
+ 'post': {
16108
+ 'sub-account/subAccountApi/ipRestriction': 20.001, // Weight(UID): 3000 => cost = 0.006667 * 3000 = 20.001
16109
+ },
16097
16110
  },
16098
16111
  'sapiV3': {
16099
16112
  'get': {
16100
- 'sub-account/assets': 1,
16113
+ 'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
16101
16114
  },
16102
16115
  'post': {
16103
16116
  'asset/getUserAsset': 0.5,
@@ -16105,7 +16118,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16105
16118
  },
16106
16119
  'sapiV4': {
16107
16120
  'get': {
16108
- 'sub-account/assets': 1,
16121
+ 'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
16109
16122
  },
16110
16123
  },
16111
16124
  // deprecated
@@ -16360,55 +16373,59 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
16360
16373
  },
16361
16374
  },
16362
16375
  'public': {
16376
+ // IP (api) request rate limit of 6000 per minute
16377
+ // 1 IP (api) => cost = 0.2 => (1000 / (50 * 0.2)) * 60 = 6000
16363
16378
  'get': {
16364
- 'ping': 1,
16365
- 'time': 1,
16366
- 'depth': { 'cost': 1, 'byLimit': [[100, 1], [500, 5], [1000, 10], [5000, 50]] },
16367
- 'trades': 1,
16368
- 'aggTrades': 1,
16369
- 'historicalTrades': 5,
16370
- 'klines': 1,
16371
- 'ticker/24hr': { 'cost': 1, 'noSymbol': 40 },
16372
- 'ticker/price': { 'cost': 1, 'noSymbol': 2 },
16373
- 'ticker/bookTicker': { 'cost': 1, 'noSymbol': 2 },
16374
- 'exchangeInfo': 10,
16379
+ 'ping': 0.2,
16380
+ 'time': 0.2,
16381
+ 'depth': { 'cost': 0.4, 'byLimit': [[100, 0.4], [500, 2], [1000, 4], [5000, 20]] },
16382
+ 'trades': 0.4,
16383
+ 'aggTrades': 0.4,
16384
+ 'historicalTrades': 2,
16385
+ 'klines': 0.4,
16386
+ 'uiKlines': 0.4,
16387
+ 'ticker/24hr': { 'cost': 0.4, 'noSymbol': 16 },
16388
+ 'ticker/price': { 'cost': 0.4, 'noSymbol': 0.8 },
16389
+ 'ticker/bookTicker': { 'cost': 0.4, 'noSymbol': 0.8 },
16390
+ 'exchangeInfo': 4,
16391
+ 'avgPrice': 0.4,
16375
16392
  },
16376
16393
  'put': {
16377
- 'userDataStream': 1,
16394
+ 'userDataStream': 0.4,
16378
16395
  },
16379
16396
  'post': {
16380
- 'userDataStream': 1,
16397
+ 'userDataStream': 0.4,
16381
16398
  },
16382
16399
  'delete': {
16383
- 'userDataStream': 1,
16400
+ 'userDataStream': 0.4,
16384
16401
  },
16385
16402
  },
16386
16403
  'private': {
16387
16404
  'get': {
16388
- 'allOrderList': 10,
16389
- 'openOrderList': 3,
16390
- 'orderList': 2,
16391
- 'order': 2,
16392
- 'openOrders': { 'cost': 3, 'noSymbol': 40 },
16393
- 'allOrders': 10,
16394
- 'account': 10,
16395
- 'myTrades': 10,
16396
- 'rateLimit/order': 20,
16397
- 'myPreventedMatches': 1,
16398
- 'myAllocations': 10,
16405
+ 'allOrderList': 4,
16406
+ 'openOrderList': 1.2,
16407
+ 'orderList': 0.8,
16408
+ 'order': 0.8,
16409
+ 'openOrders': { 'cost': 1.2, 'noSymbol': 16 },
16410
+ 'allOrders': 4,
16411
+ 'account': 4,
16412
+ 'myTrades': 4,
16413
+ 'rateLimit/order': 8,
16414
+ 'myPreventedMatches': 4,
16415
+ 'myAllocations': 4,
16399
16416
  },
16400
16417
  'post': {
16401
- 'order/oco': 1,
16402
- 'sor/order': 1,
16403
- 'sor/order/test': 1,
16404
- 'order': 1,
16405
- 'order/cancelReplace': 1,
16406
- 'order/test': 1,
16418
+ 'order/oco': 0.2,
16419
+ 'sor/order': 0.2,
16420
+ 'sor/order/test': 0.2,
16421
+ 'order': 0.2,
16422
+ 'order/cancelReplace': 0.2,
16423
+ 'order/test': 0.2,
16407
16424
  },
16408
16425
  'delete': {
16409
- 'openOrders': 1,
16410
- 'orderList': 1,
16411
- 'order': 1,
16426
+ 'openOrders': 0.2,
16427
+ 'orderList': 0.2,
16428
+ 'order': 0.2,
16412
16429
  },
16413
16430
  },
16414
16431
  'papi': {
@@ -24646,6 +24663,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
24646
24663
  'market/trades': 3,
24647
24664
  'market/depth': 3,
24648
24665
  'market/kline': 3,
24666
+ 'ticker/24hr': 1,
24649
24667
  },
24650
24668
  },
24651
24669
  'private': {
@@ -24654,7 +24672,6 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
24654
24672
  'trade/openOrders': 3,
24655
24673
  'trade/historyOrders': 3,
24656
24674
  'account/balance': 3,
24657
- 'ticker/24hr': 1,
24658
24675
  },
24659
24676
  'post': {
24660
24677
  'trade/order': 3,
@@ -24811,6 +24828,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
24811
24828
  '500': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
24812
24829
  '504': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
24813
24830
  '100001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
24831
+ '100412': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
24814
24832
  '100202': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
24815
24833
  '100400': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
24816
24834
  '100440': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
@@ -25653,7 +25671,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
25653
25671
  };
25654
25672
  let response = undefined;
25655
25673
  if (market['spot']) {
25656
- response = await this.spotV1PrivateGetTicker24hr(this.extend(request, params));
25674
+ response = await this.spotV1PublicGetTicker24hr(this.extend(request, params));
25657
25675
  }
25658
25676
  else {
25659
25677
  response = await this.swapV2PublicGetQuoteTicker(this.extend(request, params));
@@ -25693,15 +25711,21 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
25693
25711
  * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
25694
25712
  */
25695
25713
  await this.loadMarkets();
25714
+ let market = undefined;
25696
25715
  if (symbols !== undefined) {
25697
25716
  symbols = this.marketSymbols(symbols);
25698
25717
  const firstSymbol = this.safeString(symbols, 0);
25699
- const market = this.market(firstSymbol);
25700
- if (!market['swap']) {
25701
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchTicker is only supported for swap markets.');
25702
- }
25718
+ market = this.market(firstSymbol);
25719
+ }
25720
+ let type = undefined;
25721
+ [type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
25722
+ let response = undefined;
25723
+ if (type === 'spot') {
25724
+ response = await this.spotV1PublicGetTicker24hr(params);
25725
+ }
25726
+ else {
25727
+ response = await this.swapV2PublicGetQuoteTicker(params);
25703
25728
  }
25704
- const response = await this.swapV2PublicGetQuoteTicker(params);
25705
25729
  //
25706
25730
  // {
25707
25731
  // "code": 0,
@@ -27382,31 +27406,25 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27382
27406
  this.parseTransaction(data);
27383
27407
  }
27384
27408
  parseParams(params) {
27385
- let result = '';
27386
27409
  const sortedParams = this.keysort(params);
27387
27410
  const keys = Object.keys(sortedParams);
27388
27411
  for (let i = 0; i < keys.length; i++) {
27389
27412
  const key = keys[i];
27390
- if (i > 0) {
27391
- result += '&';
27392
- }
27393
27413
  const value = sortedParams[key];
27394
27414
  if (Array.isArray(value)) {
27395
- result += key + '=[';
27415
+ let arrStr = '[';
27396
27416
  for (let j = 0; j < value.length; j++) {
27397
27417
  const arrayElement = value[j];
27398
27418
  if (j > 0) {
27399
- result += ',';
27419
+ arrStr += ',';
27400
27420
  }
27401
- result += arrayElement.toString();
27421
+ arrStr += arrayElement.toString();
27402
27422
  }
27403
- result += ']';
27404
- }
27405
- else {
27406
- result += key + '=' + value.toString();
27423
+ arrStr += ']';
27424
+ sortedParams[key] = arrStr;
27407
27425
  }
27408
27426
  }
27409
- return result;
27427
+ return sortedParams;
27410
27428
  }
27411
27429
  sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
27412
27430
  const type = section[0];
@@ -27425,6 +27443,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27425
27443
  params = this.omit(params, this.extractParams(path));
27426
27444
  params = this.keysort(params);
27427
27445
  if (access === 'public') {
27446
+ params['timestamp'] = this.nonce();
27428
27447
  if (Object.keys(params).length) {
27429
27448
  url += '?' + this.urlencode(params);
27430
27449
  }
@@ -27432,8 +27451,9 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
27432
27451
  else if (access === 'private') {
27433
27452
  this.checkRequiredCredentials();
27434
27453
  params['timestamp'] = this.nonce();
27435
- let query = this.parseParams(params);
27436
- const signature = this.hmac(this.encode(query), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
27454
+ const parsedParams = this.parseParams(params);
27455
+ let query = this.urlencode(parsedParams);
27456
+ const signature = this.hmac(this.encode(this.rawencode(parsedParams)), this.encode(this.secret), _static_dependencies_noble_hashes_sha256_js__WEBPACK_IMPORTED_MODULE_4__/* .sha256 */ .J);
27437
27457
  if (Object.keys(params).length) {
27438
27458
  query = '?' + query + '&';
27439
27459
  }
@@ -42785,7 +42805,7 @@ class bithumb extends _abstract_bithumb_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
42785
42805
  await this.loadMarkets();
42786
42806
  const market = this.market(symbol);
42787
42807
  const request = {
42788
- 'currency': market['base'],
42808
+ 'currency': market['base'] + '_' + market['quote'],
42789
42809
  };
42790
42810
  if (limit !== undefined) {
42791
42811
  request['count'] = limit; // default 20, max 100
@@ -163019,6 +163039,7 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
163019
163039
  'rebate/detail': 1,
163020
163040
  'rebate/detail/kickback': 1,
163021
163041
  'rebate/referCode': 1,
163042
+ 'rebate/affiliate/commission': 1,
163022
163043
  'mxDeduct/enable': 1,
163023
163044
  'userDataStream': 1,
163024
163045
  },
@@ -177263,6 +177284,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
177263
177284
  'tradingBot/grid/ai-param': 1,
177264
177285
  'tradingBot/grid/min-investment': 1,
177265
177286
  'tradingBot/public/rsi-back-testing': 1,
177287
+ 'asset/exchange-list': 5 / 3,
177266
177288
  'finance/savings/lending-rate-summary': 5 / 3,
177267
177289
  'finance/savings/lending-rate-history': 5 / 3,
177268
177290
  // public broker
@@ -186010,8 +186032,13 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
186010
186032
  id = this.safeString2(trade, 'execId', 'execID');
186011
186033
  orderId = this.safeString(trade, 'orderID');
186012
186034
  if (market['settle'] === 'USDT') {
186013
- const sideId = this.safeString(trade, 'side');
186014
- side = (sideId === '1') ? 'buy' : 'sell';
186035
+ const sideId = this.safeStringLower(trade, 'side');
186036
+ if ((sideId === 'buy') || (sideId === 'sell')) {
186037
+ side = sideId;
186038
+ }
186039
+ else if (sideId !== undefined) {
186040
+ side = (sideId === '1') ? 'buy' : 'sell';
186041
+ }
186015
186042
  const ordType = this.safeString(trade, 'ordType');
186016
186043
  if (ordType === '1') {
186017
186044
  type = 'market';
@@ -186019,7 +186046,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
186019
186046
  else if (ordType === '2') {
186020
186047
  type = 'limit';
186021
186048
  }
186022
- priceString = this.safeString(trade, 'priceRp');
186049
+ priceString = this.safeString(trade, 'execPriceRp');
186023
186050
  amountString = this.safeString(trade, 'execQtyRq');
186024
186051
  costString = this.safeString(trade, 'execValueRv');
186025
186052
  feeCostString = this.safeString(trade, 'execFeeRv');
@@ -190007,25 +190034,21 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
190007
190034
  return this.parseOrders(response, market, since, limit, extension);
190008
190035
  }
190009
190036
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
190010
- //
190011
- // @method
190012
- // @name poloniex#createOrder
190013
- // @description create a trade order
190014
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
190015
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
190016
- // @param {string} symbol unified symbol of the market to create an order in
190017
- // @param {string} type 'market' or 'limit'
190018
- // @param {string} side 'buy' or 'sell'
190019
- // @param {float} amount how much of currency you want to trade in units of base currency
190020
- // @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
190021
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
190022
- // <<<<<<< HEAD
190023
- // @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
190024
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190025
- // =======
190026
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190027
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
190028
- //
190037
+ /**
190038
+ * @method
190039
+ * @name poloniex#createOrder
190040
+ * @description create a trade order
190041
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
190042
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
190043
+ * @param {string} symbol unified symbol of the market to create an order in
190044
+ * @param {string} type 'market' or 'limit'
190045
+ * @param {string} side 'buy' or 'sell'
190046
+ * @param {float} amount how much of currency you want to trade in units of base currency
190047
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
190048
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
190049
+ * @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
190050
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190051
+ */
190029
190052
  await this.loadMarkets();
190030
190053
  const market = this.market(symbol);
190031
190054
  if (!market['spot']) {
@@ -190094,26 +190117,22 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
190094
190117
  return [request, params];
190095
190118
  }
190096
190119
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
190097
- //
190098
- // @method
190099
- // @name poloniex#editOrder
190100
- // @description edit a trade order
190101
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
190102
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
190103
- // @param {string} id order id
190104
- // @param {string} symbol unified symbol of the market to create an order in
190105
- // @param {string} type 'market' or 'limit'
190106
- // @param {string} side 'buy' or 'sell'
190107
- // @param {float} [amount] how much of the currency you want to trade in units of the base currency
190108
- // @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
190109
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
190110
- // <<<<<<< HEAD
190111
- // @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
190112
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190113
- // =======
190114
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190115
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
190116
- //
190120
+ /**
190121
+ * @method
190122
+ * @name poloniex#editOrder
190123
+ * @description edit a trade order
190124
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
190125
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
190126
+ * @param {string} id order id
190127
+ * @param {string} symbol unified symbol of the market to create an order in
190128
+ * @param {string} type 'market' or 'limit'
190129
+ * @param {string} side 'buy' or 'sell'
190130
+ * @param {float} [amount] how much of the currency you want to trade in units of the base currency
190131
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
190132
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
190133
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
190134
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190135
+ */
190117
190136
  await this.loadMarkets();
190118
190137
  const market = this.market(symbol);
190119
190138
  if (!market['spot']) {
@@ -190153,12 +190172,8 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
190153
190172
  // @param {string} id order id
190154
190173
  // @param {string} symbol unified symbol of the market the order was made in
190155
190174
  // @param {object} [params] extra parameters specific to the poloniex api endpoint
190156
- // <<<<<<< HEAD
190157
190175
  // @param {boolean} [params.trigger] true if canceling a trigger order
190158
190176
  // @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190159
- // =======
190160
- // @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190161
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
190162
190177
  //
190163
190178
  await this.loadMarkets();
190164
190179
  const request = {};
@@ -190188,21 +190203,17 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
190188
190203
  return this.parseOrder(response);
190189
190204
  }
190190
190205
  async cancelAllOrders(symbol = undefined, params = {}) {
190191
- //
190192
- // @method
190193
- // @name poloniex#cancelAllOrders
190194
- // @description cancel all open orders
190195
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
190196
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
190197
- // @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
190198
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
190199
- // <<<<<<< HEAD
190200
- // @param {boolean} [params.trigger] true if canceling trigger orders
190201
- // @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190202
- // =======
190203
- // @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190204
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
190205
- //
190206
+ /**
190207
+ * @method
190208
+ * @name poloniex#cancelAllOrders
190209
+ * @description cancel all open orders
190210
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
190211
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
190212
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
190213
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
190214
+ * @param {boolean} [params.trigger] true if canceling trigger orders
190215
+ * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190216
+ */
190206
190217
  await this.loadMarkets();
190207
190218
  const request = {
190208
190219
  // 'accountTypes': 'SPOT',
@@ -190244,22 +190255,18 @@ class poloniex extends _abstract_poloniex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
190244
190255
  return this.parseOrders(response, market);
190245
190256
  }
190246
190257
  async fetchOrder(id, symbol = undefined, params = {}) {
190247
- //
190248
- // @method
190249
- // @name poloniex#fetchOrder
190250
- // @description fetch an order by it's id
190251
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
190252
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
190253
- // @param {string} id order id
190254
- // @param {string} symbol unified market symbol, default is undefined
190255
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
190256
- // <<<<<<< HEAD
190257
- // @param {boolean} [params.trigger] true if fetching a trigger order
190258
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190259
- // =======
190260
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190261
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
190262
- //
190258
+ /**
190259
+ * @method
190260
+ * @name poloniex#fetchOrder
190261
+ * @description fetch an order by it's id
190262
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
190263
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
190264
+ * @param {string} id order id
190265
+ * @param {string} symbol unified market symbol, default is undefined
190266
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
190267
+ * @param {boolean} [params.trigger] true if fetching a trigger order
190268
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
190269
+ */
190263
190270
  await this.loadMarkets();
190264
190271
  id = id.toString();
190265
190272
  const request = {
@@ -273434,7 +273441,7 @@ SOFTWARE.
273434
273441
 
273435
273442
  //-----------------------------------------------------------------------------
273436
273443
  // this is updated by vss.js when building
273437
- const version = '4.0.77';
273444
+ const version = '4.0.79';
273438
273445
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273439
273446
  //-----------------------------------------------------------------------------
273440
273447