ccxt 4.0.78 → 4.0.80

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.
Files changed (50) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +189 -169
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/binance.js +78 -67
  6. package/dist/cjs/src/bithumb.js +1 -1
  7. package/dist/cjs/src/bitmex.js +2 -2
  8. package/dist/cjs/src/bybit.js +4 -2
  9. package/dist/cjs/src/coinsph.js +2 -2
  10. package/dist/cjs/src/krakenfutures.js +2 -2
  11. package/dist/cjs/src/mexc.js +1 -0
  12. package/dist/cjs/src/okcoin.js +2 -2
  13. package/dist/cjs/src/okx.js +1 -1
  14. package/dist/cjs/src/phemex.js +8 -3
  15. package/dist/cjs/src/poloniex.js +54 -74
  16. package/dist/cjs/src/pro/bitget.js +18 -2
  17. package/dist/cjs/src/pro/gate.js +5 -3
  18. package/dist/cjs/src/pro/kraken.js +2 -2
  19. package/dist/cjs/src/probit.js +2 -2
  20. package/dist/cjs/src/upbit.js +1 -1
  21. package/dist/cjs/src/wavesexchange.js +4 -2
  22. package/dist/cjs/src/wazirx.js +1 -0
  23. package/js/ccxt.d.ts +1 -1
  24. package/js/ccxt.js +1 -1
  25. package/js/src/abstract/binance.d.ts +12 -1
  26. package/js/src/abstract/binancecoinm.d.ts +12 -1
  27. package/js/src/abstract/binanceus.d.ts +12 -1
  28. package/js/src/abstract/binanceusdm.d.ts +12 -1
  29. package/js/src/abstract/bybit.d.ts +1 -0
  30. package/js/src/abstract/mexc.d.ts +1 -0
  31. package/js/src/abstract/mexc3.d.ts +1 -0
  32. package/js/src/binance.js +78 -67
  33. package/js/src/bithumb.js +1 -1
  34. package/js/src/bitmex.js +2 -2
  35. package/js/src/bybit.js +4 -2
  36. package/js/src/coinsph.js +2 -2
  37. package/js/src/krakenfutures.js +2 -2
  38. package/js/src/mexc.js +1 -0
  39. package/js/src/okcoin.js +2 -2
  40. package/js/src/okx.js +1 -1
  41. package/js/src/phemex.js +8 -3
  42. package/js/src/poloniex.js +54 -74
  43. package/js/src/pro/bitget.js +19 -3
  44. package/js/src/pro/gate.js +5 -3
  45. package/js/src/pro/kraken.js +2 -2
  46. package/js/src/probit.js +2 -2
  47. package/js/src/upbit.js +1 -1
  48. package/js/src/wavesexchange.js +4 -2
  49. package/js/src/wazirx.js +1 -0
  50. package/package.json +1 -1
package/js/src/binance.js CHANGED
@@ -189,12 +189,11 @@ export default class binance extends Exchange {
189
189
  'api': {
190
190
  // the API structure below will need 3-layer apidefs
191
191
  'sapi': {
192
- // IP (api) = 1200 per minute => (rateLimit = 50)
193
192
  // IP (sapi) request rate limit of 12 000 per minute
194
- // 1 IP (sapi) => cost = 0.1
193
+ // 1 IP (sapi) => cost = 0.1 => (1000 / (50 * 0.1)) * 60 = 12000
195
194
  // 10 IP (sapi) => cost = 1
196
195
  // UID (sapi) request rate limit of 180 000 per minute
197
- // 1 UID (sapi) => cost = 1200 / 180 000 = 0.006667
196
+ // 1 UID (sapi) => cost = 0.006667 => (1000 / (50 * 0.006667)) * 60 = 180000
198
197
  'get': {
199
198
  'system/status': 0.1,
200
199
  // these endpoints require this.apiKey
@@ -210,7 +209,7 @@ export default class binance extends Exchange {
210
209
  'asset/transfer': 0.1,
211
210
  'asset/assetDetail': 0.1,
212
211
  'asset/tradeFee': 0.1,
213
- 'asset/ledger-transfer/cloud-mining/queryByPage': 4,
212
+ 'asset/ledger-transfer/cloud-mining/queryByPage': 4.0002,
214
213
  'asset/convert-transfer/queryByPage': 0.033335,
215
214
  'margin/loan': 1,
216
215
  'margin/repay': 1,
@@ -239,15 +238,16 @@ export default class binance extends Exchange {
239
238
  'margin/isolatedMarginTier': 0.1,
240
239
  'margin/rateLimit/order': 2,
241
240
  'margin/dribblet': 0.1,
242
- 'margin/dust': 20,
241
+ 'margin/dust': 20.001,
243
242
  'margin/crossMarginCollateralRatio': 10,
244
243
  'margin/exchange-small-liability': 0.6667,
245
244
  'margin/exchange-small-liability-history': 0.6667,
246
245
  'margin/next-hourly-interest-rate': 0.6667,
246
+ 'margin/delist-schedule': 0.6667,
247
247
  'loan/vip/loanable/data': 40,
248
248
  'loan/vip/collateral/data': 40,
249
- 'loan/vip/request/data': 40,
250
- 'loan/income': 40,
249
+ 'loan/vip/request/data': 2.6668,
250
+ 'loan/income': 40.002,
251
251
  'loan/ongoing/orders': 40,
252
252
  'loan/ltv/adjustment/history': 40,
253
253
  'loan/borrow/history': 40,
@@ -266,7 +266,7 @@ export default class binance extends Exchange {
266
266
  'futures/loan/wallet': 1,
267
267
  'futures/loan/adjustCollateral/history': 1,
268
268
  'futures/loan/liquidationHistory': 1,
269
- 'rebate/taxQuery': 20.001,
269
+ 'rebate/taxQuery': 80.004,
270
270
  // https://binance-docs.github.io/apidocs/spot/en/#withdraw-sapi
271
271
  'capital/config/getall': 1,
272
272
  'capital/deposit/address': 1,
@@ -275,7 +275,7 @@ export default class binance extends Exchange {
275
275
  'capital/deposit/subHisrec': 0.1,
276
276
  'capital/withdraw/history': 0.1,
277
277
  'capital/contract/convertible-coins': 4.0002,
278
- 'convert/tradeFlow': 20.0001,
278
+ 'convert/tradeFlow': 20.001,
279
279
  'convert/exchangeInfo': 50,
280
280
  'convert/assetInfo': 10,
281
281
  'convert/orderStatus': 0.6667,
@@ -283,7 +283,6 @@ export default class binance extends Exchange {
283
283
  'account/apiTradingStatus': 0.1,
284
284
  'account/apiRestrictions/ipRestriction': 0.1,
285
285
  'bnbBurn': 0.1,
286
- // 'sub-account/assets': 1, (v3 endpoint)
287
286
  'sub-account/futures/account': 1,
288
287
  'sub-account/futures/accountSummary': 0.1,
289
288
  'sub-account/futures/positionRisk': 1,
@@ -297,15 +296,16 @@ export default class binance extends Exchange {
297
296
  'sub-account/transfer/subUserHistory': 0.1,
298
297
  'sub-account/universalTransfer': 0.1,
299
298
  'sub-account/apiRestrictions/ipRestriction/thirdPartyList': 1,
300
- 'sub-account/transaction-tatistics': 0.4,
299
+ 'sub-account/transaction-statistics': 0.40002,
300
+ 'sub-account/subAccountApi/ipRestriction': 20.001,
301
301
  'managed-subaccount/asset': 0.1,
302
302
  'managed-subaccount/accountSnapshot': 240,
303
303
  'managed-subaccount/queryTransLogForInvestor': 0.1,
304
- 'managed-subaccount/queryTransLogForTradeParent': 0.1,
305
- 'managed-subaccount/fetch-future-asset': 0.1,
304
+ 'managed-subaccount/queryTransLogForTradeParent': 0.40002,
305
+ 'managed-subaccount/fetch-future-asset': 0.40002,
306
306
  'managed-subaccount/marginAsset': 0.1,
307
- 'managed-subaccount/info': 0.4,
308
- 'managed-subaccount/deposit/address': 0.1,
307
+ 'managed-subaccount/info': 0.40002,
308
+ 'managed-subaccount/deposit/address': 0.006667,
309
309
  'managed-subaccount/query-trans-log': 0.40002,
310
310
  // lending endpoints
311
311
  'lending/daily/product/list': 0.1,
@@ -383,6 +383,9 @@ export default class binance extends Exchange {
383
383
  'giftcard/verify': 0.1,
384
384
  'giftcard/cryptography/rsa-public-key': 0.1,
385
385
  'giftcard/buyCode/token-limit': 0.1,
386
+ 'algo/spot/openOrders': 0.1,
387
+ 'algo/spot/historicalOrders': 0.1,
388
+ 'algo/spot/subOrders': 0.1,
386
389
  'algo/futures/openOrders': 0.1,
387
390
  'algo/futures/historicalOrders': 0.1,
388
391
  'algo/futures/subOrders': 0.1,
@@ -424,9 +427,9 @@ export default class binance extends Exchange {
424
427
  'simple-earn/flexible/history/collateralRecord': 0.1,
425
428
  },
426
429
  'post': {
427
- 'asset/dust': 1,
430
+ 'asset/dust': 0.06667,
428
431
  'asset/dust-btc': 0.1,
429
- 'asset/transfer': 0.1,
432
+ 'asset/transfer': 6.0003,
430
433
  'asset/get-funding-asset': 0.1,
431
434
  'asset/convert-transfer': 0.033335,
432
435
  'account/disableFastWithdrawSwitch': 0.1,
@@ -436,12 +439,12 @@ export default class binance extends Exchange {
436
439
  'capital/withdraw/apply': 4.0002,
437
440
  'capital/contract/convertible-coins': 4.0002,
438
441
  'capital/deposit/credit-apply': 0.1,
439
- 'margin/transfer': 1,
442
+ 'margin/transfer': 4.0002,
440
443
  'margin/loan': 20.001,
441
444
  'margin/repay': 20.001,
442
445
  'margin/order': 0.040002,
443
446
  'margin/order/oco': 0.040002,
444
- 'margin/dust': 20,
447
+ 'margin/dust': 20.001,
445
448
  'margin/exchange-small-liability': 20.001,
446
449
  // 'margin/isolated/create': 1, discontinued
447
450
  'margin/isolated/transfer': 4.0002,
@@ -458,8 +461,6 @@ export default class binance extends Exchange {
458
461
  'sub-account/transfer/subToMaster': 0.1,
459
462
  'sub-account/universalTransfer': 0.1,
460
463
  'sub-account/options/enable': 0.1,
461
- // v2 not supported yet
462
- // 'sub-account/subAccountApi/ipRestriction': 20,
463
464
  'managed-subaccount/deposit': 0.1,
464
465
  'managed-subaccount/withdraw': 0.1,
465
466
  'userDataStream': 0.1,
@@ -505,6 +506,7 @@ export default class binance extends Exchange {
505
506
  'giftcard/createCode': 0.1,
506
507
  'giftcard/redeemCode': 0.1,
507
508
  'giftcard/buyCode': 0.1,
509
+ 'algo/spot/newOrderTwap': 20.001,
508
510
  'algo/futures/newOrderVp': 20.001,
509
511
  'algo/futures/newOrderTwap': 20.001,
510
512
  // staking
@@ -512,14 +514,14 @@ export default class binance extends Exchange {
512
514
  'staking/redeem': 0.1,
513
515
  'staking/setAutoStaking': 0.1,
514
516
  'portfolio/repay': 20.001,
515
- 'loan/vip/renew': 40,
516
- 'loan/vip/borrow': 40,
517
- 'loan/borrow': 40,
518
- 'loan/repay': 40,
519
- 'loan/adjust/ltv': 40,
520
- 'loan/customize/margin_call': 40,
521
- 'loan/vip/repay': 40,
522
- 'convert/getQuote': 20.001,
517
+ 'loan/vip/renew': 40.002,
518
+ 'loan/vip/borrow': 40.002,
519
+ 'loan/borrow': 40.002,
520
+ 'loan/repay': 40.002,
521
+ 'loan/adjust/ltv': 40.002,
522
+ 'loan/customize/margin_call': 40.002,
523
+ 'loan/vip/repay': 40.002,
524
+ 'convert/getQuote': 1.3334,
523
525
  'convert/acceptQuote': 3.3335,
524
526
  'portfolio/auto-collection': 150,
525
527
  'portfolio/asset-collection': 6,
@@ -544,15 +546,17 @@ export default class binance extends Exchange {
544
546
  'delete': {
545
547
  // 'account/apiRestrictions/ipRestriction/ipList': 1, discontinued
546
548
  'margin/openOrders': 0.1,
547
- 'margin/order': 0.0066667,
548
- 'margin/orderList': 0.0066667,
549
+ 'margin/order': 0.006667,
550
+ 'margin/orderList': 0.006667,
549
551
  'margin/isolated/account': 2.0001,
550
552
  'userDataStream': 0.1,
551
553
  'userDataStream/isolated': 0.1,
552
554
  // brokerage API TODO NO MENTION OF RATELIMIT IN BROKERAGE DOCS
553
555
  'broker/subAccountApi': 1,
554
556
  'broker/subAccountApi/ipRestriction/ipList': 1,
557
+ 'algo/spot/order': 0.1,
555
558
  'algo/futures/order': 0.1,
559
+ 'sub-account/subAccountApi/ipRestriction/ipList': 20.001, // Weight(UID): 3000 => cost = 0.006667 * 3000 = 20.001
556
560
  },
557
561
  },
558
562
  'sapiV2': {
@@ -560,10 +564,13 @@ export default class binance extends Exchange {
560
564
  'sub-account/futures/account': 0.1,
561
565
  'sub-account/futures/positionRisk': 0.1,
562
566
  },
567
+ 'post': {
568
+ 'sub-account/subAccountApi/ipRestriction': 20.001, // Weight(UID): 3000 => cost = 0.006667 * 3000 = 20.001
569
+ },
563
570
  },
564
571
  'sapiV3': {
565
572
  'get': {
566
- 'sub-account/assets': 1,
573
+ 'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
567
574
  },
568
575
  'post': {
569
576
  'asset/getUserAsset': 0.5,
@@ -571,7 +578,7 @@ export default class binance extends Exchange {
571
578
  },
572
579
  'sapiV4': {
573
580
  'get': {
574
- 'sub-account/assets': 1,
581
+ 'sub-account/assets': 0.40002, // Weight(UID): 60 => cost = 0.006667 * 60 = 0.40002
575
582
  },
576
583
  },
577
584
  // deprecated
@@ -826,55 +833,59 @@ export default class binance extends Exchange {
826
833
  },
827
834
  },
828
835
  'public': {
836
+ // IP (api) request rate limit of 6000 per minute
837
+ // 1 IP (api) => cost = 0.2 => (1000 / (50 * 0.2)) * 60 = 6000
829
838
  'get': {
830
- 'ping': 1,
831
- 'time': 1,
832
- 'depth': { 'cost': 1, 'byLimit': [[100, 1], [500, 5], [1000, 10], [5000, 50]] },
833
- 'trades': 1,
834
- 'aggTrades': 1,
835
- 'historicalTrades': 5,
836
- 'klines': 1,
837
- 'ticker/24hr': { 'cost': 1, 'noSymbol': 40 },
838
- 'ticker/price': { 'cost': 1, 'noSymbol': 2 },
839
- 'ticker/bookTicker': { 'cost': 1, 'noSymbol': 2 },
840
- 'exchangeInfo': 10,
839
+ 'ping': 0.2,
840
+ 'time': 0.2,
841
+ 'depth': { 'cost': 0.4, 'byLimit': [[100, 0.4], [500, 2], [1000, 4], [5000, 20]] },
842
+ 'trades': 0.4,
843
+ 'aggTrades': 0.4,
844
+ 'historicalTrades': 2,
845
+ 'klines': 0.4,
846
+ 'uiKlines': 0.4,
847
+ 'ticker/24hr': { 'cost': 0.4, 'noSymbol': 16 },
848
+ 'ticker/price': { 'cost': 0.4, 'noSymbol': 0.8 },
849
+ 'ticker/bookTicker': { 'cost': 0.4, 'noSymbol': 0.8 },
850
+ 'exchangeInfo': 4,
851
+ 'avgPrice': 0.4,
841
852
  },
842
853
  'put': {
843
- 'userDataStream': 1,
854
+ 'userDataStream': 0.4,
844
855
  },
845
856
  'post': {
846
- 'userDataStream': 1,
857
+ 'userDataStream': 0.4,
847
858
  },
848
859
  'delete': {
849
- 'userDataStream': 1,
860
+ 'userDataStream': 0.4,
850
861
  },
851
862
  },
852
863
  'private': {
853
864
  'get': {
854
- 'allOrderList': 10,
855
- 'openOrderList': 3,
856
- 'orderList': 2,
857
- 'order': 2,
858
- 'openOrders': { 'cost': 3, 'noSymbol': 40 },
859
- 'allOrders': 10,
860
- 'account': 10,
861
- 'myTrades': 10,
862
- 'rateLimit/order': 20,
863
- 'myPreventedMatches': 1,
864
- 'myAllocations': 10,
865
+ 'allOrderList': 4,
866
+ 'openOrderList': 1.2,
867
+ 'orderList': 0.8,
868
+ 'order': 0.8,
869
+ 'openOrders': { 'cost': 1.2, 'noSymbol': 16 },
870
+ 'allOrders': 4,
871
+ 'account': 4,
872
+ 'myTrades': 4,
873
+ 'rateLimit/order': 8,
874
+ 'myPreventedMatches': 4,
875
+ 'myAllocations': 4,
865
876
  },
866
877
  'post': {
867
- 'order/oco': 1,
868
- 'sor/order': 1,
869
- 'sor/order/test': 1,
870
- 'order': 1,
871
- 'order/cancelReplace': 1,
872
- 'order/test': 1,
878
+ 'order/oco': 0.2,
879
+ 'sor/order': 0.2,
880
+ 'sor/order/test': 0.2,
881
+ 'order': 0.2,
882
+ 'order/cancelReplace': 0.2,
883
+ 'order/test': 0.2,
873
884
  },
874
885
  'delete': {
875
- 'openOrders': 1,
876
- 'orderList': 1,
877
- 'order': 1,
886
+ 'openOrders': 0.2,
887
+ 'orderList': 0.2,
888
+ 'order': 0.2,
878
889
  },
879
890
  },
880
891
  'papi': {
package/js/src/bithumb.js CHANGED
@@ -636,7 +636,7 @@ export default class bithumb extends Exchange {
636
636
  await this.loadMarkets();
637
637
  const market = this.market(symbol);
638
638
  const request = {
639
- 'currency': market['base'],
639
+ 'currency': market['base'] + '_' + market['quote'],
640
640
  };
641
641
  if (limit !== undefined) {
642
642
  request['count'] = limit; // default 20, max 100
package/js/src/bitmex.js CHANGED
@@ -1354,8 +1354,8 @@ export default class bitmex extends Exchange {
1354
1354
  'change': undefined,
1355
1355
  'percentage': undefined,
1356
1356
  'average': undefined,
1357
- 'baseVolume': this.convertFromRawQuantity(symbol, this.safeString(ticker, 'homeNotional24h')),
1358
- 'quoteVolume': this.convertFromRawQuantity(symbol, this.safeString(ticker, 'foreignNotional24h')),
1357
+ 'baseVolume': this.safeString(ticker, 'homeNotional24h'),
1358
+ 'quoteVolume': this.safeString(ticker, 'foreignNotional24h'),
1359
1359
  'info': ticker,
1360
1360
  }, market);
1361
1361
  }
package/js/src/bybit.js CHANGED
@@ -251,6 +251,7 @@ export default class bybit extends Exchange {
251
251
  'v5/spot-lever-token/info': 2.5,
252
252
  'v5/spot-lever-token/reference': 2.5,
253
253
  // spot margin trade
254
+ 'v5/spot-margin-trade/data': 2.5,
254
255
  'v5/spot-cross-margin-trade/data': 2.5,
255
256
  'v5/spot-cross-margin-trade/pledge-token': 2.5,
256
257
  'v5/spot-cross-margin-trade/borrow-token': 2.5,
@@ -2530,7 +2531,8 @@ export default class bybit extends Exchange {
2530
2531
  if (symbols !== undefined) {
2531
2532
  symbols = this.marketSymbols(symbols);
2532
2533
  market = this.market(symbols[0]);
2533
- if (symbols.length === 1) {
2534
+ const symbolsLength = symbols.length;
2535
+ if (symbolsLength === 1) {
2534
2536
  request['symbol'] = market['id'];
2535
2537
  }
2536
2538
  }
@@ -3914,7 +3916,7 @@ export default class bybit extends Exchange {
3914
3916
  const cost = this.safeNumber(params, 'cost');
3915
3917
  params = this.omit(params, 'cost');
3916
3918
  if (price === undefined && cost === undefined) {
3917
- throw new InvalidOrder(this.id + " createOrder() requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options['createMarketBuyOrderRequiresPrice'] = false to supply the cost in the amount argument (the exchange-specific behaviour)");
3919
+ throw new InvalidOrder(this.id + ' createOrder() requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options["createMarketBuyOrderRequiresPrice"] = false to supply the cost in the amount argument (the exchange-specific behaviour)');
3918
3920
  }
3919
3921
  else {
3920
3922
  const amountString = this.numberToString(amount);
package/js/src/coinsph.js CHANGED
@@ -1868,9 +1868,9 @@ export default class coinsph extends Exchange {
1868
1868
  if (i !== 0) {
1869
1869
  encodedArrayParams += '&';
1870
1870
  }
1871
- const array = query[key];
1871
+ const innerArray = query[key];
1872
1872
  query = this.omit(query, key);
1873
- const encodedArrayParam = this.parseArrayParam(array, key);
1873
+ const encodedArrayParam = this.parseArrayParam(innerArray, key);
1874
1874
  encodedArrayParams += encodedArrayParam;
1875
1875
  }
1876
1876
  }
@@ -1220,7 +1220,7 @@ export default class krakenfutures extends Exchange {
1220
1220
  let statusId = undefined;
1221
1221
  let price = undefined;
1222
1222
  let trades = [];
1223
- if (orderEvents.length > 0) {
1223
+ if (orderEvents.length) {
1224
1224
  const executions = [];
1225
1225
  for (let i = 0; i < orderEvents.length; i++) {
1226
1226
  const item = orderEvents[i];
@@ -1268,7 +1268,7 @@ export default class krakenfutures extends Exchange {
1268
1268
  let remaining = this.safeString(details, 'unfilledSize');
1269
1269
  let average = undefined;
1270
1270
  let filled2 = '0.0';
1271
- if (trades.length > 0) {
1271
+ if (trades.length) {
1272
1272
  let vwapSum = '0.0';
1273
1273
  for (let i = 0; i < trades.length; i++) {
1274
1274
  const trade = trades[i];
package/js/src/mexc.js CHANGED
@@ -195,6 +195,7 @@ export default class mexc extends Exchange {
195
195
  'rebate/detail': 1,
196
196
  'rebate/detail/kickback': 1,
197
197
  'rebate/referCode': 1,
198
+ 'rebate/affiliate/commission': 1,
198
199
  'mxDeduct/enable': 1,
199
200
  'userDataStream': 1,
200
201
  },
package/js/src/okcoin.js CHANGED
@@ -2013,7 +2013,7 @@ export default class okcoin extends Exchange {
2013
2013
  }
2014
2014
  }
2015
2015
  else if (notional === undefined) {
2016
- throw new InvalidOrder(this.id + " createOrder() requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options['createMarketBuyOrderRequiresPrice'] = false and supply the total cost value in the 'amount' argument or in the 'notional' extra parameter (the exchange-specific behaviour)");
2016
+ throw new InvalidOrder(this.id + ' createOrder() requires the price argument with market buy orders to calculate total order cost (amount to spend), where cost = amount * price. Supply a price argument to createOrder() call if you want the cost to be calculated for you from price and amount, or, alternatively, add .options["createMarketBuyOrderRequiresPrice"] = false and supply the total cost value in the "amount" argument or in the "notional" extra parameter (the exchange-specific behaviour)');
2017
2017
  }
2018
2018
  }
2019
2019
  else {
@@ -3490,7 +3490,7 @@ export default class okcoin extends Exchange {
3490
3490
  let currency = undefined;
3491
3491
  if (type === 'spot') {
3492
3492
  if (code === undefined) {
3493
- throw new ArgumentsRequired(this.id + " fetchLedger() requires a currency code argument for '" + type + "' markets");
3493
+ throw new ArgumentsRequired(this.id + ' fetchLedger() requires a currency code argument for "' + type + '" markets');
3494
3494
  }
3495
3495
  argument = 'Currency';
3496
3496
  currency = this.currency(code);
package/js/src/okx.js CHANGED
@@ -4318,7 +4318,7 @@ export default class okx extends Exchange {
4318
4318
  const targetNetwork = this.safeValue(currency['networks'], this.networkIdToCode(network), {});
4319
4319
  fee = this.safeString(targetNetwork, 'fee');
4320
4320
  if (fee === undefined) {
4321
- throw new ArgumentsRequired(this.id + " withdraw() requires a 'fee' string parameter, network transaction fee must be ≥ 0. Withdrawals to OKCoin or OKX are fee-free, please set '0'. Withdrawing to external digital asset address requires network transaction fee.");
4321
+ throw new ArgumentsRequired(this.id + ' withdraw() requires a "fee" string parameter, network transaction fee must be ≥ 0. Withdrawals to OKCoin or OKX are fee-free, please set "0". Withdrawing to external digital asset address requires network transaction fee.');
4322
4322
  }
4323
4323
  }
4324
4324
  request['fee'] = this.numberToString(fee); // withdrawals to OKCoin or OKX are fee-free, please set 0
package/js/src/phemex.js CHANGED
@@ -1610,8 +1610,13 @@ export default class phemex extends Exchange {
1610
1610
  id = this.safeString2(trade, 'execId', 'execID');
1611
1611
  orderId = this.safeString(trade, 'orderID');
1612
1612
  if (market['settle'] === 'USDT') {
1613
- const sideId = this.safeString(trade, 'side');
1614
- side = (sideId === '1') ? 'buy' : 'sell';
1613
+ const sideId = this.safeStringLower(trade, 'side');
1614
+ if ((sideId === 'buy') || (sideId === 'sell')) {
1615
+ side = sideId;
1616
+ }
1617
+ else if (sideId !== undefined) {
1618
+ side = (sideId === '1') ? 'buy' : 'sell';
1619
+ }
1615
1620
  const ordType = this.safeString(trade, 'ordType');
1616
1621
  if (ordType === '1') {
1617
1622
  type = 'market';
@@ -1619,7 +1624,7 @@ export default class phemex extends Exchange {
1619
1624
  else if (ordType === '2') {
1620
1625
  type = 'limit';
1621
1626
  }
1622
- priceString = this.safeString(trade, 'priceRp');
1627
+ priceString = this.safeString(trade, 'execPriceRp');
1623
1628
  amountString = this.safeString(trade, 'execQtyRq');
1624
1629
  costString = this.safeString(trade, 'execValueRv');
1625
1630
  feeCostString = this.safeString(trade, 'execFeeRv');
@@ -1207,25 +1207,21 @@ export default class poloniex extends Exchange {
1207
1207
  return this.parseOrders(response, market, since, limit, extension);
1208
1208
  }
1209
1209
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1210
- //
1211
- // @method
1212
- // @name poloniex#createOrder
1213
- // @description create a trade order
1214
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
1215
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
1216
- // @param {string} symbol unified symbol of the market to create an order in
1217
- // @param {string} type 'market' or 'limit'
1218
- // @param {string} side 'buy' or 'sell'
1219
- // @param {float} amount how much of currency you want to trade in units of base currency
1220
- // @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1221
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
1222
- // <<<<<<< HEAD
1223
- // @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
1224
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1225
- // =======
1226
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1227
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
1228
- //
1210
+ /**
1211
+ * @method
1212
+ * @name poloniex#createOrder
1213
+ * @description create a trade order
1214
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-create-order
1215
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-create-order // trigger orders
1216
+ * @param {string} symbol unified symbol of the market to create an order in
1217
+ * @param {string} type 'market' or 'limit'
1218
+ * @param {string} side 'buy' or 'sell'
1219
+ * @param {float} amount how much of currency you want to trade in units of base currency
1220
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1221
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
1222
+ * @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
1223
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1224
+ */
1229
1225
  await this.loadMarkets();
1230
1226
  const market = this.market(symbol);
1231
1227
  if (!market['spot']) {
@@ -1294,26 +1290,22 @@ export default class poloniex extends Exchange {
1294
1290
  return [request, params];
1295
1291
  }
1296
1292
  async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
1297
- //
1298
- // @method
1299
- // @name poloniex#editOrder
1300
- // @description edit a trade order
1301
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
1302
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
1303
- // @param {string} id order id
1304
- // @param {string} symbol unified symbol of the market to create an order in
1305
- // @param {string} type 'market' or 'limit'
1306
- // @param {string} side 'buy' or 'sell'
1307
- // @param {float} [amount] how much of the currency you want to trade in units of the base currency
1308
- // @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1309
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
1310
- // <<<<<<< HEAD
1311
- // @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1312
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1313
- // =======
1314
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1315
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
1316
- //
1293
+ /**
1294
+ * @method
1295
+ * @name poloniex#editOrder
1296
+ * @description edit a trade order
1297
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-replace-order
1298
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-replace-order
1299
+ * @param {string} id order id
1300
+ * @param {string} symbol unified symbol of the market to create an order in
1301
+ * @param {string} type 'market' or 'limit'
1302
+ * @param {string} side 'buy' or 'sell'
1303
+ * @param {float} [amount] how much of the currency you want to trade in units of the base currency
1304
+ * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1305
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
1306
+ * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1307
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1308
+ */
1317
1309
  await this.loadMarkets();
1318
1310
  const market = this.market(symbol);
1319
1311
  if (!market['spot']) {
@@ -1353,12 +1345,8 @@ export default class poloniex extends Exchange {
1353
1345
  // @param {string} id order id
1354
1346
  // @param {string} symbol unified symbol of the market the order was made in
1355
1347
  // @param {object} [params] extra parameters specific to the poloniex api endpoint
1356
- // <<<<<<< HEAD
1357
1348
  // @param {boolean} [params.trigger] true if canceling a trigger order
1358
1349
  // @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1359
- // =======
1360
- // @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1361
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
1362
1350
  //
1363
1351
  await this.loadMarkets();
1364
1352
  const request = {};
@@ -1388,21 +1376,17 @@ export default class poloniex extends Exchange {
1388
1376
  return this.parseOrder(response);
1389
1377
  }
1390
1378
  async cancelAllOrders(symbol = undefined, params = {}) {
1391
- //
1392
- // @method
1393
- // @name poloniex#cancelAllOrders
1394
- // @description cancel all open orders
1395
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
1396
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
1397
- // @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1398
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
1399
- // <<<<<<< HEAD
1400
- // @param {boolean} [params.trigger] true if canceling trigger orders
1401
- // @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1402
- // =======
1403
- // @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1404
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
1405
- //
1379
+ /**
1380
+ * @method
1381
+ * @name poloniex#cancelAllOrders
1382
+ * @description cancel all open orders
1383
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
1384
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-cancel-all-orders // trigger orders
1385
+ * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
1386
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
1387
+ * @param {boolean} [params.trigger] true if canceling trigger orders
1388
+ * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1389
+ */
1406
1390
  await this.loadMarkets();
1407
1391
  const request = {
1408
1392
  // 'accountTypes': 'SPOT',
@@ -1444,22 +1428,18 @@ export default class poloniex extends Exchange {
1444
1428
  return this.parseOrders(response, market);
1445
1429
  }
1446
1430
  async fetchOrder(id, symbol = undefined, params = {}) {
1447
- //
1448
- // @method
1449
- // @name poloniex#fetchOrder
1450
- // @description fetch an order by it's id
1451
- // @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
1452
- // @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
1453
- // @param {string} id order id
1454
- // @param {string} symbol unified market symbol, default is undefined
1455
- // @param {object} [params] extra parameters specific to the poloniex api endpoint
1456
- // <<<<<<< HEAD
1457
- // @param {boolean} [params.trigger] true if fetching a trigger order
1458
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1459
- // =======
1460
- // @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1461
- // >>>>>>> 1e1c747220aa06f7c710fc71e9b6658d1260c4d1
1462
- //
1431
+ /**
1432
+ * @method
1433
+ * @name poloniex#fetchOrder
1434
+ * @description fetch an order by it's id
1435
+ * @see https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
1436
+ * @see https://docs.poloniex.com/#authenticated-endpoints-smart-orders-open-orders // trigger orders
1437
+ * @param {string} id order id
1438
+ * @param {string} symbol unified market symbol, default is undefined
1439
+ * @param {object} [params] extra parameters specific to the poloniex api endpoint
1440
+ * @param {boolean} [params.trigger] true if fetching a trigger order
1441
+ * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1442
+ */
1463
1443
  await this.loadMarkets();
1464
1444
  id = id.toString();
1465
1445
  const request = {