ccxt 4.5.9 → 4.5.11

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 (79) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/base/Exchange.js +14 -2
  5. package/dist/cjs/src/bingx.js +1 -1
  6. package/dist/cjs/src/bitfinex.js +4 -2
  7. package/dist/cjs/src/bitget.js +5 -2
  8. package/dist/cjs/src/btcmarkets.js +4 -2
  9. package/dist/cjs/src/coinbase.js +1 -0
  10. package/dist/cjs/src/deribit.js +21 -19
  11. package/dist/cjs/src/kraken.js +4 -0
  12. package/dist/cjs/src/kucoin.js +1 -1
  13. package/dist/cjs/src/latoken.js +1 -0
  14. package/dist/cjs/src/mexc.js +1 -0
  15. package/dist/cjs/src/onetrading.js +2 -1
  16. package/dist/cjs/src/phemex.js +1 -0
  17. package/dist/cjs/src/pro/bitget.js +1 -0
  18. package/dist/cjs/src/pro/htx.js +22 -3
  19. package/dist/cjs/src/pro/kraken.js +282 -458
  20. package/dist/cjs/src/pro/mexc.js +15 -10
  21. package/dist/cjs/src/probit.js +1 -1
  22. package/js/ccxt.d.ts +2 -8
  23. package/js/ccxt.js +2 -6
  24. package/js/src/abstract/coinbase.d.ts +1 -0
  25. package/js/src/abstract/coinbaseadvanced.d.ts +1 -0
  26. package/js/src/abstract/phemex.d.ts +1 -0
  27. package/js/src/base/Exchange.d.ts +5 -2
  28. package/js/src/base/Exchange.js +14 -2
  29. package/js/src/bingx.js +1 -1
  30. package/js/src/bitfinex.d.ts +1 -1
  31. package/js/src/bitfinex.js +4 -2
  32. package/js/src/bitget.d.ts +1 -1
  33. package/js/src/bitget.js +5 -2
  34. package/js/src/bithumb.d.ts +1 -1
  35. package/js/src/bitmex.d.ts +1 -1
  36. package/js/src/bitopro.d.ts +1 -1
  37. package/js/src/bitso.d.ts +1 -1
  38. package/js/src/bittrade.d.ts +1 -1
  39. package/js/src/blofin.d.ts +1 -1
  40. package/js/src/btcmarkets.d.ts +1 -1
  41. package/js/src/btcmarkets.js +4 -2
  42. package/js/src/bybit.d.ts +1 -1
  43. package/js/src/coinbase.d.ts +1 -1
  44. package/js/src/coinbase.js +1 -0
  45. package/js/src/coinex.d.ts +1 -1
  46. package/js/src/cryptocom.d.ts +1 -1
  47. package/js/src/deribit.js +21 -19
  48. package/js/src/digifinex.d.ts +1 -1
  49. package/js/src/hibachi.d.ts +1 -1
  50. package/js/src/htx.d.ts +1 -1
  51. package/js/src/hyperliquid.d.ts +1 -1
  52. package/js/src/kraken.d.ts +1 -1
  53. package/js/src/kraken.js +4 -0
  54. package/js/src/kucoin.js +1 -1
  55. package/js/src/kucoinfutures.d.ts +1 -1
  56. package/js/src/latoken.js +1 -0
  57. package/js/src/mexc.d.ts +1 -1
  58. package/js/src/mexc.js +1 -0
  59. package/js/src/oceanex.d.ts +1 -1
  60. package/js/src/okx.d.ts +1 -1
  61. package/js/src/onetrading.d.ts +1 -1
  62. package/js/src/onetrading.js +2 -1
  63. package/js/src/phemex.js +1 -0
  64. package/js/src/pro/bitget.d.ts +1 -0
  65. package/js/src/pro/bitget.js +1 -0
  66. package/js/src/pro/bitvavo.d.ts +2 -2
  67. package/js/src/pro/htx.js +22 -3
  68. package/js/src/pro/kraken.d.ts +7 -8
  69. package/js/src/pro/kraken.js +282 -458
  70. package/js/src/pro/mexc.js +15 -10
  71. package/js/src/probit.js +1 -1
  72. package/js/src/timex.d.ts +1 -1
  73. package/package.json +1 -1
  74. package/js/src/abstract/okcoin.d.ts +0 -77
  75. package/js/src/abstract/okcoin.js +0 -11
  76. package/js/src/okcoin.d.ts +0 -346
  77. package/js/src/okcoin.js +0 -3214
  78. package/js/src/pro/okcoin.d.ts +0 -91
  79. package/js/src/pro/okcoin.js +0 -763
package/dist/cjs/ccxt.js CHANGED
@@ -89,7 +89,6 @@ var myokx = require('./src/myokx.js');
89
89
  var ndax = require('./src/ndax.js');
90
90
  var novadax = require('./src/novadax.js');
91
91
  var oceanex = require('./src/oceanex.js');
92
- var okcoin = require('./src/okcoin.js');
93
92
  var okx = require('./src/okx.js');
94
93
  var okxus = require('./src/okxus.js');
95
94
  var onetrading = require('./src/onetrading.js');
@@ -169,7 +168,6 @@ var mexc$1 = require('./src/pro/mexc.js');
169
168
  var modetrade$1 = require('./src/pro/modetrade.js');
170
169
  var myokx$1 = require('./src/pro/myokx.js');
171
170
  var ndax$1 = require('./src/pro/ndax.js');
172
- var okcoin$1 = require('./src/pro/okcoin.js');
173
171
  var okx$1 = require('./src/pro/okx.js');
174
172
  var okxus$1 = require('./src/pro/okxus.js');
175
173
  var onetrading$1 = require('./src/pro/onetrading.js');
@@ -189,7 +187,7 @@ var xt$1 = require('./src/pro/xt.js');
189
187
  // ----------------------------------------------------------------------------
190
188
  //-----------------------------------------------------------------------------
191
189
  // this is updated by vss.js when building
192
- const version = '4.5.9';
190
+ const version = '4.5.11';
193
191
  Exchange["default"].ccxtVersion = version;
194
192
  const exchanges = {
195
193
  'alpaca': alpaca["default"],
@@ -275,7 +273,6 @@ const exchanges = {
275
273
  'ndax': ndax["default"],
276
274
  'novadax': novadax["default"],
277
275
  'oceanex': oceanex["default"],
278
- 'okcoin': okcoin["default"],
279
276
  'okx': okx["default"],
280
277
  'okxus': okxus["default"],
281
278
  'onetrading': onetrading["default"],
@@ -357,7 +354,6 @@ const pro = {
357
354
  'modetrade': modetrade$1["default"],
358
355
  'myokx': myokx$1["default"],
359
356
  'ndax': ndax$1["default"],
360
- 'okcoin': okcoin$1["default"],
361
357
  'okx': okx$1["default"],
362
358
  'okxus': okxus$1["default"],
363
359
  'onetrading': onetrading$1["default"],
@@ -508,7 +504,6 @@ exports.myokx = myokx["default"];
508
504
  exports.ndax = ndax["default"];
509
505
  exports.novadax = novadax["default"];
510
506
  exports.oceanex = oceanex["default"];
511
- exports.okcoin = okcoin["default"];
512
507
  exports.okx = okx["default"];
513
508
  exports.okxus = okxus["default"];
514
509
  exports.onetrading = onetrading["default"];
@@ -2263,6 +2263,12 @@ class Exchange {
2263
2263
  async unWatchTicker(symbol, params = {}) {
2264
2264
  throw new errors.NotSupported(this.id + ' unWatchTicker() is not supported yet');
2265
2265
  }
2266
+ async unWatchMarkPrice(symbol, params = {}) {
2267
+ throw new errors.NotSupported(this.id + ' unWatchMarkPrice() is not supported yet');
2268
+ }
2269
+ async unWatchMarkPrices(symbols = undefined, params = {}) {
2270
+ throw new errors.NotSupported(this.id + ' unWatchMarkPrices() is not supported yet');
2271
+ }
2266
2272
  async fetchDepositAddresses(codes = undefined, params = {}) {
2267
2273
  throw new errors.NotSupported(this.id + ' fetchDepositAddresses() is not supported yet');
2268
2274
  }
@@ -2678,6 +2684,9 @@ class Exchange {
2678
2684
  if (this.features === undefined) {
2679
2685
  return defaultValue;
2680
2686
  }
2687
+ if (marketType === undefined) {
2688
+ return defaultValue; // marketType is required
2689
+ }
2681
2690
  // if marketType (e.g. 'option') does not exist in features
2682
2691
  if (!(marketType in this.features)) {
2683
2692
  return defaultValue; // unsupported marketType, check "exchange.features" for details
@@ -2704,7 +2713,7 @@ class Exchange {
2704
2713
  }
2705
2714
  // if user wanted only marketType and didn't provide methodName, eg: featureIsSupported('spot')
2706
2715
  if (methodName === undefined) {
2707
- return methodsContainer;
2716
+ return (defaultValue !== undefined) ? defaultValue : methodsContainer;
2708
2717
  }
2709
2718
  if (!(methodName in methodsContainer)) {
2710
2719
  return defaultValue; // unsupported method, check "exchange.features" for details');
@@ -2715,7 +2724,7 @@ class Exchange {
2715
2724
  }
2716
2725
  // if user wanted only method and didn't provide `paramName`, eg: featureIsSupported('swap', 'linear', 'createOrder')
2717
2726
  if (paramName === undefined) {
2718
- return methodDict;
2727
+ return (defaultValue !== undefined) ? defaultValue : methodDict;
2719
2728
  }
2720
2729
  const splited = paramName.split('.'); // can be only parent key (`stopLoss`) or with child (`stopLoss.triggerPrice`)
2721
2730
  const parentKey = splited[0];
@@ -5705,6 +5714,9 @@ class Exchange {
5705
5714
  async cancelOrderWs(id, symbol = undefined, params = {}) {
5706
5715
  throw new errors.NotSupported(this.id + ' cancelOrderWs() is not supported yet');
5707
5716
  }
5717
+ async cancelOrders(ids, symbol = undefined, params = {}) {
5718
+ throw new errors.NotSupported(this.id + ' cancelOrders() is not supported yet');
5719
+ }
5708
5720
  async cancelOrdersWs(ids, symbol = undefined, params = {}) {
5709
5721
  throw new errors.NotSupported(this.id + ' cancelOrdersWs() is not supported yet');
5710
5722
  }
@@ -5891,7 +5891,7 @@ class bingx extends bingx$1["default"] {
5891
5891
  this.checkAddress(address);
5892
5892
  await this.loadMarkets();
5893
5893
  const currency = this.currency(code);
5894
- const walletType = this.safeInteger(params, 'walletType', 1);
5894
+ const walletType = this.safeInteger(params, 'walletType', 15);
5895
5895
  const request = {
5896
5896
  'coin': currency['id'],
5897
5897
  'address': address,
@@ -1983,11 +1983,13 @@ class bitfinex extends bitfinex$1["default"] {
1983
1983
  */
1984
1984
  async cancelOrders(ids, symbol = undefined, params = {}) {
1985
1985
  await this.loadMarkets();
1986
+ const numericIds = [];
1986
1987
  for (let i = 0; i < ids.length; i++) {
1987
- ids[i] = this.parseToNumeric(ids[i]);
1988
+ // numericIds[i] = this.parseToNumeric (ids[i]);
1989
+ numericIds.push(this.parseToNumeric(ids[i]));
1988
1990
  }
1989
1991
  const request = {
1990
- 'id': ids,
1992
+ 'id': numericIds,
1991
1993
  };
1992
1994
  let market = undefined;
1993
1995
  if (symbol !== undefined) {
@@ -7980,7 +7980,10 @@ class bitget extends bitget$1["default"] {
7980
7980
  let market = undefined;
7981
7981
  if (symbols !== undefined) {
7982
7982
  const first = this.safeString(symbols, 0);
7983
- market = this.market(first);
7983
+ // symbols can be undefined or []
7984
+ if (first !== undefined) {
7985
+ market = this.market(first);
7986
+ }
7984
7987
  }
7985
7988
  let productType = undefined;
7986
7989
  [productType, params] = this.handleProductTypeAndParams(market, params);
@@ -7995,7 +7998,7 @@ class bitget extends bitget$1["default"] {
7995
7998
  }
7996
7999
  else if (method === 'privateMixGetV2MixPositionAllPosition') {
7997
8000
  let marginCoin = this.safeString(params, 'marginCoin', 'USDT');
7998
- if (symbols !== undefined) {
8001
+ if (market !== undefined) {
7999
8002
  marginCoin = market['settleId'];
8000
8003
  }
8001
8004
  else if (productType === 'USDT-FUTURES') {
@@ -1012,11 +1012,13 @@ class btcmarkets extends btcmarkets$1["default"] {
1012
1012
  */
1013
1013
  async cancelOrders(ids, symbol = undefined, params = {}) {
1014
1014
  await this.loadMarkets();
1015
+ const numericIds = [];
1015
1016
  for (let i = 0; i < ids.length; i++) {
1016
- ids[i] = parseInt(ids[i]);
1017
+ // numericIds[i] = parseInt (ids[i]);
1018
+ numericIds.push(parseInt(ids[i]));
1017
1019
  }
1018
1020
  const request = {
1019
- 'ids': ids,
1021
+ 'ids': numericIds,
1020
1022
  };
1021
1023
  const response = await this.privateDeleteBatchordersIds(this.extend(request, params));
1022
1024
  //
@@ -280,6 +280,7 @@ class coinbase extends coinbase$1["default"] {
280
280
  'brokerage/intx/positions/{portfolio_uuid}/{symbol}': 1,
281
281
  'brokerage/payment_methods': 1,
282
282
  'brokerage/payment_methods/{payment_method_id}': 1,
283
+ 'brokerage/key_permissions': 1,
283
284
  },
284
285
  'post': {
285
286
  'brokerage/orders': 1,
@@ -616,24 +616,26 @@ class deribit extends deribit$1["default"] {
616
616
  const response = await this.publicGetGetCurrencies(params);
617
617
  //
618
618
  // {
619
- // "jsonrpc": "2.0",
620
- // "result": [
621
- // {
622
- // "withdrawal_priorities": [],
623
- // "withdrawal_fee": 0.01457324,
624
- // "min_withdrawal_fee": 0.000001,
625
- // "min_confirmations": 1,
626
- // "fee_precision": 8,
627
- // "currency_long": "Solana",
628
- // "currency": "SOL",
629
- // "coin_type": "SOL"
630
- // },
631
- // ...
632
- // ],
633
- // "usIn": 1688652701456124,
634
- // "usOut": 1688652701456390,
635
- // "usDiff": 266,
636
- // "testnet": true
619
+ // "jsonrpc": "2.0",
620
+ // "result": [
621
+ // {
622
+ // "currency": "XRP",
623
+ // "network_fee": "1.5e-5",
624
+ // "min_withdrawal_fee": "0.0001",
625
+ // "apr": "0.0",
626
+ // "withdrawal_fee": "0.0001",
627
+ // "network_currency": "XRP",
628
+ // "coin_type": "XRP",
629
+ // "withdrawal_priorities": [],
630
+ // "min_confirmations": "1",
631
+ // "currency_long": "XRP",
632
+ // "in_cross_collateral_pool": false
633
+ // },
634
+ // ],
635
+ // "usIn": "1760110326693923",
636
+ // "usOut": "1760110326944891",
637
+ // "usDiff": "250968",
638
+ // "testnet": false
637
639
  // }
638
640
  //
639
641
  const data = this.safeList(response, 'result', []);
@@ -652,7 +654,7 @@ class deribit extends deribit$1["default"] {
652
654
  'withdraw': undefined,
653
655
  'type': 'crypto',
654
656
  'fee': this.safeNumber(currency, 'withdrawal_fee'),
655
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'fee_precision'))),
657
+ 'precision': undefined,
656
658
  'limits': {
657
659
  'amount': {
658
660
  'min': undefined,
@@ -1728,6 +1728,10 @@ class kraken extends kraken$1["default"] {
1728
1728
  const statuses = {
1729
1729
  'pending': 'open',
1730
1730
  'open': 'open',
1731
+ 'pending_new': 'open',
1732
+ 'new': 'open',
1733
+ 'partially_filled': 'open',
1734
+ 'filled': 'closed',
1731
1735
  'closed': 'closed',
1732
1736
  'canceled': 'canceled',
1733
1737
  'expired': 'expired',
@@ -1608,7 +1608,7 @@ class kucoin extends kucoin$1["default"] {
1608
1608
  const networkCodeNew = this.networkIdToCode(this.safeString(chain, 'chainId'), this.safeString(currency, 'code'));
1609
1609
  resultNew['networks'][networkCodeNew] = {
1610
1610
  'withdraw': {
1611
- 'fee': this.safeNumber(chain, 'withdrawMinFee'),
1611
+ 'fee': this.safeNumber2(chain, 'withdrawalMinFee', 'withdrawMinFee'),
1612
1612
  'percentage': false,
1613
1613
  },
1614
1614
  'deposit': {
@@ -1606,6 +1606,7 @@ class latoken extends latoken$1["default"] {
1606
1606
  'TRANSACTION_STATUS_CHECKING': 'pending',
1607
1607
  'TRANSACTION_STATUS_CANCELLED': 'canceled',
1608
1608
  'TRANSACTION_STATUS_FAILED': 'failed',
1609
+ 'TRANSACTION_STATUS_REJECTED': 'rejected',
1609
1610
  };
1610
1611
  return this.safeString(statuses, status, status);
1611
1612
  }
@@ -3589,6 +3589,7 @@ class mexc extends mexc$1["default"] {
3589
3589
  'timestamp': timestamp,
3590
3590
  'datetime': this.iso8601(timestamp),
3591
3591
  'lastTradeTimestamp': undefined,
3592
+ 'lastUpdateTimestamp': this.safeInteger(order, 'updateTime'),
3592
3593
  'status': this.parseOrderStatus(this.safeString2(order, 'status', 'state')),
3593
3594
  'symbol': market['symbol'],
3594
3595
  'type': this.parseOrderType(typeRaw),
@@ -1488,7 +1488,8 @@ class onetrading extends onetrading$1["default"] {
1488
1488
  // "a10e9bd1-8f72-4cfe-9f1b-7f1c8a9bd8ee"
1489
1489
  // ]
1490
1490
  //
1491
- return response;
1491
+ const order = this.safeOrder({ 'info': response });
1492
+ return [order];
1492
1493
  }
1493
1494
  /**
1494
1495
  * @method
@@ -192,6 +192,7 @@ class phemex extends phemex$1["default"] {
192
192
  'accounts/accountPositions': 1,
193
193
  'g-accounts/accountPositions': 1,
194
194
  'g-accounts/positions': 25,
195
+ 'g-accounts/risk-unit': 1,
195
196
  'api-data/futures/funding-fees': 5,
196
197
  'api-data/g-futures/funding-fees': 5,
197
198
  'api-data/futures/orders': 5,
@@ -1492,6 +1492,7 @@ class bitget extends bitget$1["default"] {
1492
1492
  * @name bitget#watchOrders
1493
1493
  * @description watches information on multiple orders made by the user
1494
1494
  * @see https://www.bitget.com/api-doc/spot/websocket/private/Order-Channel
1495
+ * @see https://www.bitget.com/api-doc/spot/websocket/private/Plan-Order-Channel
1495
1496
  * @see https://www.bitget.com/api-doc/contract/websocket/private/Order-Channel
1496
1497
  * @see https://www.bitget.com/api-doc/contract/websocket/private/Plan-Order-Channel
1497
1498
  * @see https://www.bitget.com/api-doc/margin/cross/websocket/private/Cross-Orders
@@ -928,24 +928,40 @@ class htx extends htx$1["default"] {
928
928
  //
929
929
  // spot
930
930
  //
931
+ // for new order creation
932
+ //
931
933
  // {
932
934
  // "action":"push",
933
935
  // "ch":"orders#btcusdt", // or "orders#*" for global subscriptions
934
936
  // "data": {
937
+ // "orderStatus": "submitted",
938
+ // "eventType": "creation",
939
+ // "totalTradeAmount": 0 // for "submitted" order status
940
+ // "orderCreateTime": 1645116048355, // only when `submitted` status
935
941
  // "orderSource": "spot-web",
936
- // "orderCreateTime": 1645116048355,
937
942
  // "accountId": 44234548,
938
943
  // "orderPrice": "100",
939
944
  // "orderSize": "0.05",
940
945
  // "symbol": "ethusdt",
941
946
  // "type": "buy-limit",
942
947
  // "orderId": "478861479986886",
943
- // "eventType": "creation",
944
948
  // "clientOrderId": '',
945
- // "orderStatus": "submitted"
946
949
  // }
947
950
  // }
948
951
  //
952
+ // for filled order, additional fields are present:
953
+ //
954
+ // "orderStatus": "filled",
955
+ // "eventType": "trade",
956
+ // "totalTradeAmount": "5.9892649859",
957
+ // "tradePrice": "0.676669",
958
+ // "tradeVolume": "8.8511",
959
+ // "tradeTime": 1760427775894,
960
+ // "aggressor": false,
961
+ // "execAmt": "8.8511",
962
+ // "tradeId": 100599712781,
963
+ // "remainAmt": "0",
964
+ //
949
965
  // spot wrapped trade
950
966
  //
951
967
  // {
@@ -1057,6 +1073,9 @@ class htx extends htx$1["default"] {
1057
1073
  'symbol': market['symbol'],
1058
1074
  'filled': this.parseNumber(filled),
1059
1075
  'remaining': this.parseNumber(remaining),
1076
+ 'price': this.safeNumber(data, 'orderPrice'),
1077
+ 'amount': this.safeNumber(data, 'orderSize'),
1078
+ 'info': data,
1060
1079
  };
1061
1080
  parsedOrder = order;
1062
1081
  }