ccxt 4.1.31 → 4.1.33

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 (41) hide show
  1. package/README.md +4 -4
  2. package/build.sh +5 -2
  3. package/dist/ccxt.browser.js +350 -202
  4. package/dist/ccxt.browser.min.js +9 -9
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +4 -1
  7. package/dist/cjs/src/base/functions/misc.js +6 -0
  8. package/dist/cjs/src/bitmex.js +16 -22
  9. package/dist/cjs/src/digifinex.js +14 -0
  10. package/dist/cjs/src/huobi.js +18 -12
  11. package/dist/cjs/src/krakenfutures.js +1 -0
  12. package/dist/cjs/src/phemex.js +8 -6
  13. package/dist/cjs/src/pro/bittrex.js +68 -2
  14. package/dist/cjs/src/pro/huobi.js +79 -32
  15. package/dist/cjs/src/pro/woo.js +5 -2
  16. package/dist/cjs/src/upbit.js +8 -6
  17. package/dist/cjs/src/wavesexchange.js +6 -7
  18. package/dist/cjs/src/woo.js +27 -31
  19. package/dist/cjs/src/zonda.js +37 -30
  20. package/js/ccxt.d.ts +1 -1
  21. package/js/ccxt.js +1 -1
  22. package/js/src/abstract/bitbay.d.ts +2 -0
  23. package/js/src/abstract/digifinex.d.ts +14 -0
  24. package/js/src/abstract/zonda.d.ts +2 -0
  25. package/js/src/base/Exchange.d.ts +1 -1
  26. package/js/src/base/Exchange.js +7 -2
  27. package/js/src/base/functions/misc.js +6 -0
  28. package/js/src/bitmex.js +16 -22
  29. package/js/src/digifinex.js +14 -0
  30. package/js/src/huobi.js +18 -12
  31. package/js/src/krakenfutures.js +1 -0
  32. package/js/src/phemex.js +8 -6
  33. package/js/src/pro/bittrex.d.ts +1 -0
  34. package/js/src/pro/bittrex.js +69 -3
  35. package/js/src/pro/huobi.js +79 -32
  36. package/js/src/pro/woo.js +5 -2
  37. package/js/src/upbit.js +8 -6
  38. package/js/src/wavesexchange.js +6 -7
  39. package/js/src/woo.js +27 -31
  40. package/js/src/zonda.js +37 -30
  41. package/package.json +1 -1
package/js/src/woo.js CHANGED
@@ -950,29 +950,27 @@ export default class woo extends Exchange {
950
950
  if (stopPrice !== undefined) {
951
951
  request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
952
952
  }
953
+ params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice']);
953
954
  const isStop = (stopPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
954
- let method = undefined;
955
+ let response = undefined;
955
956
  if (isByClientOrder) {
957
+ request['client_order_id'] = clientOrderIdExchangeSpecific;
956
958
  if (isStop) {
957
- method = 'v3PrivatePutAlgoOrderClientClientOrderId';
958
- request['oid'] = id;
959
+ response = await this.v3PrivatePutAlgoOrderClientClientOrderId(this.extend(request, params));
959
960
  }
960
961
  else {
961
- method = 'v3PrivatePutOrderClientClientOrderId';
962
- request['client_order_id'] = clientOrderIdExchangeSpecific;
962
+ response = await this.v3PrivatePutOrderClientClientOrderId(this.extend(request, params));
963
963
  }
964
964
  }
965
965
  else {
966
+ request['oid'] = id;
966
967
  if (isStop) {
967
- method = 'v3PrivatePutAlgoOrderOid';
968
+ response = await this.v3PrivatePutAlgoOrderOid(this.extend(request, params));
968
969
  }
969
970
  else {
970
- method = 'v3PrivatePutOrderOid';
971
+ response = await this.v3PrivatePutOrderOid(this.extend(request, params));
971
972
  }
972
- request['oid'] = id;
973
973
  }
974
- params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice']);
975
- const response = await this[method](this.extend(request, params));
976
974
  //
977
975
  // {
978
976
  // "code": 0,
@@ -1008,32 +1006,31 @@ export default class woo extends Exchange {
1008
1006
  this.checkRequiredSymbol('cancelOrder', symbol);
1009
1007
  }
1010
1008
  await this.loadMarkets();
1009
+ let market = undefined;
1010
+ if (symbol !== undefined) {
1011
+ market = this.market(symbol);
1012
+ }
1011
1013
  const request = {};
1012
1014
  const clientOrderIdUnified = this.safeString2(params, 'clOrdID', 'clientOrderId');
1013
1015
  const clientOrderIdExchangeSpecific = this.safeString(params, 'client_order_id', clientOrderIdUnified);
1014
1016
  const isByClientOrder = clientOrderIdExchangeSpecific !== undefined;
1015
- let method = undefined;
1017
+ let response = undefined;
1016
1018
  if (stop) {
1017
- method = 'v3PrivateDeleteAlgoOrderOrderId';
1018
1019
  request['order_id'] = id;
1019
- }
1020
- else if (isByClientOrder) {
1021
- method = 'v1PrivateDeleteClientOrder';
1022
- request['client_order_id'] = clientOrderIdExchangeSpecific;
1023
- params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id']);
1020
+ response = await this.v3PrivateDeleteAlgoOrderOrderId(this.extend(request, params));
1024
1021
  }
1025
1022
  else {
1026
- method = 'v1PrivateDeleteOrder';
1027
- request['order_id'] = id;
1028
- }
1029
- let market = undefined;
1030
- if (symbol !== undefined) {
1031
- market = this.market(symbol);
1032
- }
1033
- if (!stop) {
1034
1023
  request['symbol'] = market['id'];
1024
+ if (isByClientOrder) {
1025
+ request['client_order_id'] = clientOrderIdExchangeSpecific;
1026
+ params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id']);
1027
+ response = await this.v1PrivateDeleteClientOrder(this.extend(request, params));
1028
+ }
1029
+ else {
1030
+ request['order_id'] = id;
1031
+ response = await this.v1PrivateDeleteOrder(this.extend(request, params));
1032
+ }
1035
1033
  }
1036
- const response = await this[method](this.extend(request, params));
1037
1034
  //
1038
1035
  // { success: true, status: 'CANCEL_SENT' }
1039
1036
  //
@@ -1097,20 +1094,19 @@ export default class woo extends Exchange {
1097
1094
  params = this.omit(params, 'stop');
1098
1095
  const request = {};
1099
1096
  const clientOrderId = this.safeString2(params, 'clOrdID', 'clientOrderId');
1100
- let method = undefined;
1097
+ let response = undefined;
1101
1098
  if (stop) {
1102
- method = 'v3PrivateGetAlgoOrderOid';
1103
1099
  request['oid'] = id;
1100
+ response = await this.v3PrivateGetAlgoOrderOid(this.extend(request, params));
1104
1101
  }
1105
1102
  else if (clientOrderId) {
1106
- method = 'v1PrivateGetClientOrderClientOrderId';
1107
1103
  request['client_order_id'] = clientOrderId;
1104
+ response = await this.v1PrivateGetClientOrderClientOrderId(this.extend(request, params));
1108
1105
  }
1109
1106
  else {
1110
- method = 'v1PrivateGetOrderOid';
1111
1107
  request['oid'] = id;
1108
+ response = await this.v1PrivateGetOrderOid(this.extend(request, params));
1112
1109
  }
1113
- const response = await this[method](this.extend(request, params));
1114
1110
  //
1115
1111
  // {
1116
1112
  // success: true,
package/js/src/zonda.js CHANGED
@@ -104,7 +104,7 @@ export default class zonda extends Exchange {
104
104
  '3d': '259200',
105
105
  '1w': '604800',
106
106
  },
107
- 'hostname': 'zonda.exchange',
107
+ 'hostname': 'zondacrypto.exchange',
108
108
  'urls': {
109
109
  'referral': 'https://auth.zondaglobal.com/ref/jHlbB4mIkdS1',
110
110
  'logo': 'https://user-images.githubusercontent.com/1294454/159202310-a0e38007-5e7c-4ba9-a32f-c8263a0291fe.jpg',
@@ -116,7 +116,7 @@ export default class zonda extends Exchange {
116
116
  'v1_01Private': 'https://api.{hostname}/rest',
117
117
  },
118
118
  'doc': [
119
- 'https://docs.zonda.exchange/',
119
+ 'https://docs.zondacrypto.exchange/',
120
120
  'https://github.com/BitBayNet/API',
121
121
  ],
122
122
  'support': 'https://zondaglobal.com/en/helpdesk/zonda-exchange',
@@ -177,6 +177,8 @@ export default class zonda extends Exchange {
177
177
  'balances/BITBAY/balance',
178
178
  'balances/BITBAY/balance/transfer/{source}/{destination}',
179
179
  'fiat_cantor/exchange',
180
+ 'api_payments/withdrawals/crypto',
181
+ 'api_payments/withdrawals/fiat',
180
182
  ],
181
183
  'delete': [
182
184
  'trading/offer/{symbol}/{id}/{side}/{price}',
@@ -285,6 +287,10 @@ export default class zonda extends Exchange {
285
287
  'REQUEST_TIMESTAMP_TOO_OLD': InvalidNonce,
286
288
  'PERMISSIONS_NOT_SUFFICIENT': PermissionDenied,
287
289
  'INVALID_STOP_RATE': InvalidOrder,
290
+ 'TIMEOUT': ExchangeError,
291
+ 'RESPONSE_TIMEOUT': ExchangeError,
292
+ 'ACTION_BLOCKED': PermissionDenied,
293
+ 'INVALID_HASH_SIGNATURE': AuthenticationError,
288
294
  },
289
295
  'commonCurrencies': {
290
296
  'GGC': 'Global Game Coin',
@@ -295,7 +301,7 @@ export default class zonda extends Exchange {
295
301
  /**
296
302
  * @method
297
303
  * @name zonda#fetchMarkets
298
- * @see https://docs.zonda.exchange/reference/ticker-1
304
+ * @see https://docs.zondacrypto.exchange/reference/ticker-1
299
305
  * @description retrieves data on all markets for zonda
300
306
  * @param {object} [params] extra parameters specific to the exchange api endpoint
301
307
  * @returns {object[]} an array of objects representing market data
@@ -398,7 +404,7 @@ export default class zonda extends Exchange {
398
404
  /**
399
405
  * @method
400
406
  * @name zonda#fetchOpenOrders
401
- * @see https://docs.zonda.exchange/reference/active-orders
407
+ * @see https://docs.zondacrypto.exchange/reference/active-orders
402
408
  * @description fetch all unfilled currently open orders
403
409
  * @param {string} symbol not used by zonda fetchOpenOrders
404
410
  * @param {int} [since] the earliest time in ms to fetch open orders for
@@ -466,7 +472,7 @@ export default class zonda extends Exchange {
466
472
  /**
467
473
  * @method
468
474
  * @name zonda#fetchMyTrades
469
- * @see https://docs.zonda.exchange/reference/transactions-history
475
+ * @see https://docs.zondacrypto.exchange/reference/transactions-history
470
476
  * @description fetch all trades made by the user
471
477
  * @param {string} symbol unified market symbol
472
478
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -531,7 +537,7 @@ export default class zonda extends Exchange {
531
537
  /**
532
538
  * @method
533
539
  * @name zonda#fetchBalance
534
- * @see https://docs.zonda.exchange/reference/list-of-wallets
540
+ * @see https://docs.zondacrypto.exchange/reference/list-of-wallets
535
541
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
536
542
  * @param {object} [params] extra parameters specific to the zonda api endpoint
537
543
  * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
@@ -544,7 +550,7 @@ export default class zonda extends Exchange {
544
550
  /**
545
551
  * @method
546
552
  * @name zonda#fetchOrderBook
547
- * @see https://docs.zonda.exchange/reference/orderbook-2
553
+ * @see https://docs.zondacrypto.exchange/reference/orderbook-2
548
554
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
549
555
  * @param {string} symbol unified symbol of the market to fetch the order book for
550
556
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -657,7 +663,7 @@ export default class zonda extends Exchange {
657
663
  * @method
658
664
  * @name zonda#fetchTicker
659
665
  * @description v1_01PublicGetTradingTickerSymbol retrieves timestamp, datetime, bid, ask, close, last, previousClose, v1_01PublicGetTradingStatsSymbol retrieves high, low, volume and opening price of an asset
660
- * @see https://docs.zonda.exchange/reference/market-statistics
666
+ * @see https://docs.zondacrypto.exchange/reference/market-statistics
661
667
  * @param {string} symbol unified symbol of the market to fetch the ticker for
662
668
  * @param {object} [params] extra parameters specific to the zonda api endpoint
663
669
  * @param {string} [params.method] v1_01PublicGetTradingTickerSymbol (default) or v1_01PublicGetTradingStatsSymbol
@@ -730,7 +736,7 @@ export default class zonda extends Exchange {
730
736
  * @method
731
737
  * @name zonda#fetchTickersV2
732
738
  * @description v1_01PublicGetTradingTicker retrieves timestamp, datetime, bid, ask, close, last, previousClose for each market, v1_01PublicGetTradingStats retrieves high, low, volume and opening price of each market
733
- * @see https://docs.zonda.exchange/reference/market-statistics
739
+ * @see https://docs.zondacrypto.exchange/reference/market-statistics
734
740
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
735
741
  * @param {object} [params] extra parameters specific to the zonda api endpoint
736
742
  * @param {string} [params.method] v1_01PublicGetTradingTicker (default) or v1_01PublicGetTradingStats
@@ -803,7 +809,7 @@ export default class zonda extends Exchange {
803
809
  /**
804
810
  * @method
805
811
  * @name zonda#fetchLedger
806
- * @see https://docs.zonda.exchange/reference/operations-history
812
+ * @see https://docs.zondacrypto.exchange/reference/operations-history
807
813
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
808
814
  * @param {string} code unified currency code, default is undefined
809
815
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
@@ -1177,7 +1183,7 @@ export default class zonda extends Exchange {
1177
1183
  /**
1178
1184
  * @method
1179
1185
  * @name zonda#fetchOHLCV
1180
- * @see https://docs.zonda.exchange/reference/candles-chart
1186
+ * @see https://docs.zondacrypto.exchange/reference/candles-chart
1181
1187
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1182
1188
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1183
1189
  * @param {string} timeframe the length of time each candle represents
@@ -1303,7 +1309,7 @@ export default class zonda extends Exchange {
1303
1309
  /**
1304
1310
  * @method
1305
1311
  * @name zonda#fetchTrades
1306
- * @see https://docs.zonda.exchange/reference/last-transactions
1312
+ * @see https://docs.zondacrypto.exchange/reference/last-transactions
1307
1313
  * @description get the list of most recent trades for a particular symbol
1308
1314
  * @param {string} symbol unified symbol of the market to fetch trades for
1309
1315
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -1356,7 +1362,6 @@ export default class zonda extends Exchange {
1356
1362
  const isStopLimit = (type === 'stop-limit') || (isLimitOrder && isStopLossPrice);
1357
1363
  const isStopMarket = type === 'stop-market' || (isMarketOrder && isStopLossPrice);
1358
1364
  const isStopOrder = isStopLimit || isStopMarket;
1359
- const method = isStopOrder ? 'v1_01PrivatePostTradingStopOfferSymbol' : 'v1_01PrivatePostTradingOfferSymbol';
1360
1365
  if (isLimitOrder || isStopLimit) {
1361
1366
  request['rate'] = this.priceToPrecision(symbol, price);
1362
1367
  request['mode'] = isStopLimit ? 'stop-limit' : 'limit';
@@ -1367,14 +1372,18 @@ export default class zonda extends Exchange {
1367
1372
  else {
1368
1373
  throw new ExchangeError(this.id + ' createOrder() invalid type');
1369
1374
  }
1375
+ params = this.omit(params, ['stopPrice', 'stopLossPrice']);
1376
+ let response = undefined;
1370
1377
  if (isStopOrder) {
1371
1378
  if (!isStopLossPrice) {
1372
1379
  throw new ExchangeError(this.id + ' createOrder() zonda requires `triggerPrice` or `stopPrice` parameter for stop-limit or stop-market orders');
1373
1380
  }
1374
1381
  request['stopRate'] = this.priceToPrecision(symbol, stopLossPrice);
1382
+ response = await this.v1_01PrivatePostTradingStopOfferSymbol(this.extend(request, params));
1383
+ }
1384
+ else {
1385
+ response = await this.v1_01PrivatePostTradingOfferSymbol(this.extend(request, params));
1375
1386
  }
1376
- params = this.omit(params, ['stopPrice', 'stopLossPrice']);
1377
- const response = await this[method](this.extend(request, params));
1378
1387
  //
1379
1388
  // unfilled (open order)
1380
1389
  //
@@ -1458,7 +1467,7 @@ export default class zonda extends Exchange {
1458
1467
  /**
1459
1468
  * @method
1460
1469
  * @name zonda#cancelOrder
1461
- * @see https://docs.zonda.exchange/reference/cancel-order
1470
+ * @see https://docs.zondacrypto.exchange/reference/cancel-order
1462
1471
  * @description cancels an open order
1463
1472
  * @param {string} id order id
1464
1473
  * @param {string} symbol unified symbol of the market the order was made in
@@ -1519,7 +1528,7 @@ export default class zonda extends Exchange {
1519
1528
  /**
1520
1529
  * @method
1521
1530
  * @name zonda#fetchDepositAddress
1522
- * @see https://docs.zonda.exchange/reference/deposit-addresses-for-crypto
1531
+ * @see https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
1523
1532
  * @description fetch the deposit address for a currency associated with this account
1524
1533
  * @param {string} code unified currency code
1525
1534
  * @param {object} [params] extra parameters specific to the zonda api endpoint
@@ -1553,7 +1562,7 @@ export default class zonda extends Exchange {
1553
1562
  /**
1554
1563
  * @method
1555
1564
  * @name zonda#fetchDepositAddresses
1556
- * @see https://docs.zonda.exchange/reference/deposit-addresses-for-crypto
1565
+ * @see https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
1557
1566
  * @description fetch deposit addresses for multiple currencies and chain types
1558
1567
  * @param {string[]|undefined} codes zonda does not support filtering filtering by multiple codes and will ignore this parameter.
1559
1568
  * @param {object} [params] extra parameters specific to the zonda api endpoint
@@ -1581,7 +1590,7 @@ export default class zonda extends Exchange {
1581
1590
  /**
1582
1591
  * @method
1583
1592
  * @name zonda#transfer
1584
- * @see https://docs.zonda.exchange/reference/internal-transfer
1593
+ * @see https://docs.zondacrypto.exchange/reference/internal-transfer
1585
1594
  * @description transfer currency internally between wallets on the same account
1586
1595
  * @param {string} code unified currency code
1587
1596
  * @param {float} amount amount to transfer
@@ -1693,7 +1702,7 @@ export default class zonda extends Exchange {
1693
1702
  /**
1694
1703
  * @method
1695
1704
  * @name zonda#withdraw
1696
- * @see https://docs.zonda.exchange/reference/crypto-withdrawal-1
1705
+ * @see https://docs.zondacrypto.exchange/reference/crypto-withdrawal-1
1697
1706
  * @description make a withdrawal
1698
1707
  * @param {string} code unified currency code
1699
1708
  * @param {float} amount the amount to withdraw
@@ -1705,26 +1714,24 @@ export default class zonda extends Exchange {
1705
1714
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
1706
1715
  this.checkAddress(address);
1707
1716
  await this.loadMarkets();
1708
- let method = undefined;
1717
+ let response = undefined;
1709
1718
  const currency = this.currency(code);
1710
1719
  const request = {
1711
1720
  'currency': currency['id'],
1712
- 'quantity': amount,
1721
+ 'amount': amount,
1722
+ 'address': address,
1723
+ // request['balanceId'] = params['balanceId']; // Wallet id used for withdrawal. If not provided, any BITBAY wallet with sufficient funds is used. If BITBAYPAY wallet should be used parameter must be explicitly specified.
1713
1724
  };
1714
1725
  if (this.isFiat(code)) {
1715
- method = 'privatePostWithdraw';
1716
- // request['account'] = params['account']; // they demand an account number
1717
- // request['express'] = params['express']; // whatever it means, they don't explain
1718
- // request['bic'] = '';
1726
+ // request['swift'] = params['swift']; // Bank identifier, if required.
1727
+ response = await this.v1_01PrivatePostApiPaymentsWithdrawalsFiat(this.extend(request, params));
1719
1728
  }
1720
1729
  else {
1721
- method = 'privatePostTransfer';
1722
1730
  if (tag !== undefined) {
1723
- address += '?dt=' + tag.toString();
1731
+ request['tag'] = tag;
1724
1732
  }
1725
- request['address'] = address;
1733
+ response = await this.v1_01PrivatePostApiPaymentsWithdrawalsCrypto(this.extend(request, params));
1726
1734
  }
1727
- const response = await this[method](this.extend(request, params));
1728
1735
  //
1729
1736
  // {
1730
1737
  // "status": "Ok",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.1.31",
3
+ "version": "4.1.33",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",