ccxt 4.3.44 → 4.3.46

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 (64) hide show
  1. package/README.md +130 -130
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/oxfun.js +9 -0
  5. package/dist/cjs/src/base/Exchange.js +1 -0
  6. package/dist/cjs/src/binance.js +2 -0
  7. package/dist/cjs/src/bingx.js +25 -17
  8. package/dist/cjs/src/bitmart.js +5 -0
  9. package/dist/cjs/src/bitstamp.js +18 -2
  10. package/dist/cjs/src/bitteam.js +5 -7
  11. package/dist/cjs/src/coinmetro.js +8 -17
  12. package/dist/cjs/src/hyperliquid.js +29 -21
  13. package/dist/cjs/src/idex.js +1 -0
  14. package/dist/cjs/src/kucoin.js +28 -1
  15. package/dist/cjs/src/luno.js +9 -1
  16. package/dist/cjs/src/mexc.js +8 -6
  17. package/dist/cjs/src/okx.js +1 -0
  18. package/dist/cjs/src/oxfun.js +2900 -0
  19. package/dist/cjs/src/pro/binanceus.js +0 -8
  20. package/dist/cjs/src/pro/oxfun.js +1034 -0
  21. package/dist/cjs/src/tokocrypto.js +8 -10
  22. package/dist/cjs/src/wavesexchange.js +122 -110
  23. package/dist/cjs/src/woofipro.js +1 -0
  24. package/dist/cjs/src/xt.js +1 -1
  25. package/js/ccxt.d.ts +8 -2
  26. package/js/ccxt.js +6 -2
  27. package/js/src/abstract/binance.d.ts +2 -0
  28. package/js/src/abstract/binancecoinm.d.ts +2 -0
  29. package/js/src/abstract/binanceus.d.ts +2 -0
  30. package/js/src/abstract/binanceusdm.d.ts +2 -0
  31. package/js/src/abstract/bitstamp.d.ts +16 -0
  32. package/js/src/abstract/kucoin.d.ts +14 -0
  33. package/js/src/abstract/kucoinfutures.d.ts +14 -0
  34. package/js/src/abstract/mexc.d.ts +2 -0
  35. package/js/src/abstract/oxfun.d.ts +37 -0
  36. package/js/src/abstract/oxfun.js +11 -0
  37. package/js/src/base/Exchange.d.ts +1 -0
  38. package/js/src/base/Exchange.js +1 -0
  39. package/js/src/binance.js +2 -0
  40. package/js/src/bingx.js +26 -18
  41. package/js/src/bitmart.js +5 -0
  42. package/js/src/bitstamp.js +18 -2
  43. package/js/src/bitteam.js +6 -8
  44. package/js/src/coinmetro.js +9 -18
  45. package/js/src/hyperliquid.d.ts +3 -3
  46. package/js/src/hyperliquid.js +29 -21
  47. package/js/src/idex.js +1 -0
  48. package/js/src/kucoin.js +28 -1
  49. package/js/src/luno.d.ts +1 -1
  50. package/js/src/luno.js +9 -1
  51. package/js/src/mexc.js +8 -6
  52. package/js/src/okx.js +1 -0
  53. package/js/src/oxfun.d.ts +129 -0
  54. package/js/src/oxfun.js +2901 -0
  55. package/js/src/pro/binanceus.js +0 -8
  56. package/js/src/pro/oxfun.d.ts +38 -0
  57. package/js/src/pro/oxfun.js +1035 -0
  58. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  59. package/js/src/tokocrypto.js +9 -11
  60. package/js/src/wavesexchange.d.ts +7 -7
  61. package/js/src/wavesexchange.js +123 -111
  62. package/js/src/woofipro.js +1 -0
  63. package/js/src/xt.js +1 -1
  64. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -99,6 +99,7 @@ var oceanex = require('./src/oceanex.js');
99
99
  var okcoin = require('./src/okcoin.js');
100
100
  var okx = require('./src/okx.js');
101
101
  var onetrading = require('./src/onetrading.js');
102
+ var oxfun = require('./src/oxfun.js');
102
103
  var p2b = require('./src/p2b.js');
103
104
  var paymium = require('./src/paymium.js');
104
105
  var phemex = require('./src/phemex.js');
@@ -173,6 +174,7 @@ var ndax$1 = require('./src/pro/ndax.js');
173
174
  var okcoin$1 = require('./src/pro/okcoin.js');
174
175
  var okx$1 = require('./src/pro/okx.js');
175
176
  var onetrading$1 = require('./src/pro/onetrading.js');
177
+ var oxfun$1 = require('./src/pro/oxfun.js');
176
178
  var p2b$1 = require('./src/pro/p2b.js');
177
179
  var phemex$1 = require('./src/pro/phemex.js');
178
180
  var poloniex$1 = require('./src/pro/poloniex.js');
@@ -186,7 +188,7 @@ var woofipro$1 = require('./src/pro/woofipro.js');
186
188
 
187
189
  //-----------------------------------------------------------------------------
188
190
  // this is updated by vss.js when building
189
- const version = '4.3.44';
191
+ const version = '4.3.46';
190
192
  Exchange["default"].ccxtVersion = version;
191
193
  const exchanges = {
192
194
  'ace': ace,
@@ -276,6 +278,7 @@ const exchanges = {
276
278
  'okcoin': okcoin,
277
279
  'okx': okx,
278
280
  'onetrading': onetrading,
281
+ 'oxfun': oxfun,
279
282
  'p2b': p2b,
280
283
  'paymium': paymium,
281
284
  'phemex': phemex,
@@ -352,6 +355,7 @@ const pro = {
352
355
  'okcoin': okcoin$1,
353
356
  'okx': okx$1,
354
357
  'onetrading': onetrading$1,
358
+ 'oxfun': oxfun$1,
355
359
  'p2b': p2b$1,
356
360
  'phemex': phemex$1,
357
361
  'poloniex': poloniex$1,
@@ -497,6 +501,7 @@ exports.oceanex = oceanex;
497
501
  exports.okcoin = okcoin;
498
502
  exports.okx = okx;
499
503
  exports.onetrading = onetrading;
504
+ exports.oxfun = oxfun;
500
505
  exports.p2b = p2b;
501
506
  exports.paymium = paymium;
502
507
  exports.phemex = phemex;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var Exchange$1 = require('../base/Exchange.js');
4
+
5
+ // -------------------------------------------------------------------------------
6
+ class Exchange extends Exchange$1["default"] {
7
+ }
8
+
9
+ module.exports = Exchange;
@@ -368,6 +368,7 @@ class Exchange {
368
368
  'certified': false,
369
369
  'pro': false,
370
370
  'alias': false,
371
+ 'dex': false,
371
372
  'has': {
372
373
  'publicAPI': true,
373
374
  'privateAPI': true,
@@ -987,6 +987,8 @@ class binance extends binance$1 {
987
987
  'post': {
988
988
  'order/oco': 0.2,
989
989
  'orderList/oco': 0.2,
990
+ 'orderList/oto': 0.2,
991
+ 'orderList/otoco': 0.2,
990
992
  'sor/order': 0.2,
991
993
  'sor/order/test': 0.2,
992
994
  'order': 0.2,
@@ -385,7 +385,7 @@ class bingx extends bingx$1 {
385
385
  '1w': '1w',
386
386
  '1M': '1M',
387
387
  },
388
- 'precisionMode': number.DECIMAL_PLACES,
388
+ 'precisionMode': number.TICK_SIZE,
389
389
  'exceptions': {
390
390
  'exact': {
391
391
  '400': errors.BadRequest,
@@ -610,18 +610,26 @@ class bingx extends bingx$1 {
610
610
  // "msg": "",
611
611
  // "data": [
612
612
  // {
613
- // "contractId": "100",
614
- // "symbol": "BTC-USDT",
615
- // "size": "0.0001",
616
- // "quantityPrecision": 4,
617
- // "pricePrecision": 1,
618
- // "feeRate": 0.0005,
619
- // "tradeMinLimit": 1,
620
- // "maxLongLeverage": 150,
621
- // "maxShortLeverage": 150,
622
- // "currency": "USDT",
623
- // "asset": "BTC",
624
- // "status": 1
613
+ // "contractId": "100",
614
+ // "symbol": "BTC-USDT",
615
+ // "size": "0.0001",
616
+ // "quantityPrecision": "4",
617
+ // "pricePrecision": "1",
618
+ // "feeRate": "0.0005",
619
+ // "makerFeeRate": "0.0002",
620
+ // "takerFeeRate": "0.0005",
621
+ // "tradeMinLimit": "0",
622
+ // "tradeMinQuantity": "0.0001",
623
+ // "tradeMinUSDT": "2",
624
+ // "maxLongLeverage": "125",
625
+ // "maxShortLeverage": "125",
626
+ // "currency": "USDT",
627
+ // "asset": "BTC",
628
+ // "status": "1",
629
+ // "apiStateOpen": "true",
630
+ // "apiStateClose": "true",
631
+ // "ensureTrigger": true,
632
+ // "triggerFeeRate": "0.00020000"
625
633
  // },
626
634
  // ...
627
635
  // ]
@@ -639,13 +647,13 @@ class bingx extends bingx$1 {
639
647
  const quote = this.safeCurrencyCode(quoteId);
640
648
  const currency = this.safeString(market, 'currency');
641
649
  const settle = this.safeCurrencyCode(currency);
642
- let pricePrecision = this.safeInteger(market, 'pricePrecision');
650
+ let pricePrecision = this.safeNumber(market, 'tickSize');
643
651
  if (pricePrecision === undefined) {
644
- pricePrecision = this.precisionFromString(this.safeString(market, 'tickSize'));
652
+ pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision')));
645
653
  }
646
- let quantityPrecision = this.safeInteger(market, 'quantityPrecision');
654
+ let quantityPrecision = this.safeNumber(market, 'stepSize');
647
655
  if (quantityPrecision === undefined) {
648
- quantityPrecision = this.precisionFromString(this.safeString(market, 'stepSize'));
656
+ quantityPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
649
657
  }
650
658
  const type = (settle !== undefined) ? 'swap' : 'spot';
651
659
  const spot = type === 'spot';
@@ -2740,6 +2740,11 @@ class bitmart extends bitmart$1 {
2740
2740
  if (ioc) {
2741
2741
  request['type'] = 'ioc';
2742
2742
  }
2743
+ const clientOrderId = this.safeString(params, 'clientOrderId');
2744
+ if (clientOrderId !== undefined) {
2745
+ params = this.omit(params, 'clientOrderId');
2746
+ request['client_order_id'] = clientOrderId;
2747
+ }
2743
2748
  return this.extend(request, params);
2744
2749
  }
2745
2750
  async cancelOrder(id, symbol = undefined, params = {}) {
@@ -219,7 +219,7 @@ class bitstamp extends bitstamp$1 {
219
219
  'uni_withdrawal/': 1,
220
220
  'uni_address/': 1,
221
221
  'yfi_withdrawal/': 1,
222
- 'yfi_address': 1,
222
+ 'yfi_address/': 1,
223
223
  'audio_withdrawal/': 1,
224
224
  'audio_address/': 1,
225
225
  'crv_withdrawal/': 1,
@@ -228,7 +228,7 @@ class bitstamp extends bitstamp$1 {
228
228
  'algo_address/': 1,
229
229
  'comp_withdrawal/': 1,
230
230
  'comp_address/': 1,
231
- 'grt_withdrawal': 1,
231
+ 'grt_withdrawal/': 1,
232
232
  'grt_address/': 1,
233
233
  'usdt_withdrawal/': 1,
234
234
  'usdt_address/': 1,
@@ -366,6 +366,22 @@ class bitstamp extends bitstamp$1 {
366
366
  'vchf_address/': 1,
367
367
  'veur_withdrawal/': 1,
368
368
  'veur_address/': 1,
369
+ 'truf_withdrawal/': 1,
370
+ 'truf_address/': 1,
371
+ 'wif_withdrawal/': 1,
372
+ 'wif_address/': 1,
373
+ 'smt_withdrawal/': 1,
374
+ 'smt_address/': 1,
375
+ 'sui_withdrawal/': 1,
376
+ 'sui_address/': 1,
377
+ 'jup_withdrawal/': 1,
378
+ 'jup_address/': 1,
379
+ 'ondo_withdrawal/': 1,
380
+ 'ondo_address/': 1,
381
+ 'boba_withdrawal/': 1,
382
+ 'boba_address/': 1,
383
+ 'pyth_withdrawal/': 1,
384
+ 'pyth_address/': 1,
369
385
  },
370
386
  },
371
387
  },
@@ -190,7 +190,7 @@ class bitteam extends bitteam$1 {
190
190
  'maker': this.parseNumber('0.002'),
191
191
  },
192
192
  },
193
- 'precisionMode': number.DECIMAL_PLACES,
193
+ 'precisionMode': number.TICK_SIZE,
194
194
  // exchange-specific options
195
195
  'options': {
196
196
  'networksById': {
@@ -351,8 +351,6 @@ class bitteam extends bitteam$1 {
351
351
  const base = this.safeCurrencyCode(baseId);
352
352
  const quote = this.safeCurrencyCode(quoteId);
353
353
  const active = this.safeValue(market, 'active');
354
- const amountPrecision = this.safeInteger(market, 'baseStep');
355
- const pricePrecision = this.safeInteger(market, 'quoteStep');
356
354
  const timeStart = this.safeString(market, 'timeStart');
357
355
  const created = this.parse8601(timeStart);
358
356
  let minCost = undefined;
@@ -388,8 +386,8 @@ class bitteam extends bitteam$1 {
388
386
  'strike': undefined,
389
387
  'optionType': undefined,
390
388
  'precision': {
391
- 'amount': amountPrecision,
392
- 'price': pricePrecision,
389
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseStep'))),
390
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteStep'))),
393
391
  },
394
392
  'limits': {
395
393
  'leverage': {
@@ -545,7 +543,7 @@ class bitteam extends bitteam$1 {
545
543
  const numericId = this.safeInteger(currency, 'id');
546
544
  const code = this.safeCurrencyCode(id);
547
545
  const active = this.safeBool(currency, 'active', false);
548
- const precision = this.safeInteger(currency, 'precision');
546
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision')));
549
547
  const txLimits = this.safeValue(currency, 'txLimits', {});
550
548
  const minWithdraw = this.safeString(txLimits, 'minWithdraw');
551
549
  const maxWithdraw = this.safeString(txLimits, 'maxWithdraw');
@@ -567,7 +565,7 @@ class bitteam extends bitteam$1 {
567
565
  const withdraw = this.safeValue(statuses, 'withdrawStatus');
568
566
  const networkIds = Object.keys(feesByNetworkId);
569
567
  const networks = {};
570
- const networkPrecision = this.safeInteger(currency, 'decimals');
568
+ const networkPrecision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
571
569
  for (let j = 0; j < networkIds.length; j++) {
572
570
  const networkId = networkIds[j];
573
571
  const networkCode = this.networkIdToCode(networkId, code);
@@ -205,7 +205,7 @@ class coinmetro extends coinmetro$1 {
205
205
  'maker': this.parseNumber('0'),
206
206
  },
207
207
  },
208
- 'precisionMode': number.DECIMAL_PLACES,
208
+ 'precisionMode': number.TICK_SIZE,
209
209
  // exchange-specific options
210
210
  'options': {
211
211
  'currenciesByIdForParseMarket': undefined,
@@ -309,7 +309,6 @@ class coinmetro extends coinmetro$1 {
309
309
  const deposit = this.safeValue(currency, 'canDeposit');
310
310
  const canTrade = this.safeValue(currency, 'canTrade');
311
311
  const active = canTrade ? withdraw : true;
312
- const precision = this.safeInteger(currency, 'digits');
313
312
  const minAmount = this.safeNumber(currency, 'minQty');
314
313
  result[code] = this.safeCurrencyStructure({
315
314
  'id': id,
@@ -320,7 +319,7 @@ class coinmetro extends coinmetro$1 {
320
319
  'deposit': deposit,
321
320
  'withdraw': withdraw,
322
321
  'fee': undefined,
323
- 'precision': precision,
322
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'digits'))),
324
323
  'limits': {
325
324
  'amount': { 'min': minAmount, 'max': undefined },
326
325
  'withdraw': { 'min': undefined, 'max': undefined },
@@ -351,19 +350,14 @@ class coinmetro extends coinmetro$1 {
351
350
  //
352
351
  // [
353
352
  // {
354
- // "pair": "PERPEUR",
355
- // "precision": 5,
356
- // "margin": false
357
- // },
358
- // {
359
- // "pair": "PERPUSD",
353
+ // "pair": "YFIEUR",
360
354
  // "precision": 5,
361
355
  // "margin": false
362
356
  // },
363
357
  // {
364
- // "pair": "YFIEUR",
365
- // "precision": 5,
366
- // "margin": false
358
+ // "pair": "BTCEUR",
359
+ // "precision": 2,
360
+ // "margin": true
367
361
  // },
368
362
  // ...
369
363
  // ]
@@ -409,9 +403,7 @@ class coinmetro extends coinmetro$1 {
409
403
  'optionType': undefined,
410
404
  'precision': {
411
405
  'amount': basePrecisionAndLimits['precision'],
412
- 'price': quotePrecisionAndLimits['precision'],
413
- 'base': basePrecisionAndLimits['precision'],
414
- 'quote': quotePrecisionAndLimits['precision'],
406
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'precision'))),
415
407
  },
416
408
  'limits': {
417
409
  'leverage': {
@@ -466,12 +458,11 @@ class coinmetro extends coinmetro$1 {
466
458
  parseMarketPrecisionAndLimits(currencyId) {
467
459
  const currencies = this.safeValue(this.options, 'currenciesByIdForParseMarket', {});
468
460
  const currency = this.safeValue(currencies, currencyId, {});
469
- const precision = this.safeInteger(currency, 'precision');
470
461
  const limits = this.safeValue(currency, 'limits', {});
471
462
  const amountLimits = this.safeValue(limits, 'amount', {});
472
463
  const minLimit = this.safeNumber(amountLimits, 'min');
473
464
  const result = {
474
- 'precision': precision,
465
+ 'precision': this.safeNumber(currency, 'precision'),
475
466
  'minLimit': minLimit,
476
467
  };
477
468
  return result;
@@ -24,6 +24,7 @@ class hyperliquid extends hyperliquid$1 {
24
24
  'rateLimit': 50,
25
25
  'certified': false,
26
26
  'pro': true,
27
+ 'dex': true,
27
28
  'has': {
28
29
  'CORS': undefined,
29
30
  'spot': true,
@@ -968,11 +969,12 @@ class hyperliquid extends hyperliquid$1 {
968
969
  const signature = this.signMessage(msg, this.privateKey);
969
970
  return signature;
970
971
  }
971
- buildSig(chainId, messageTypes, message) {
972
+ signUserSignedAction(messageTypes, message) {
972
973
  const zeroAddress = this.safeString(this.options, 'zeroAddress');
974
+ const chainId = 421614; // check this out
973
975
  const domain = {
974
976
  'chainId': chainId,
975
- 'name': 'Exchange',
977
+ 'name': 'HyperliquidSignTransaction',
976
978
  'verifyingContract': zeroAddress,
977
979
  'version': '1',
978
980
  };
@@ -981,28 +983,26 @@ class hyperliquid extends hyperliquid$1 {
981
983
  return signature;
982
984
  }
983
985
  buildTransferSig(message) {
984
- const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
985
- const chainId = (isSandboxMode) ? 421614 : 42161;
986
986
  const messageTypes = {
987
- 'UsdTransferSignPayload': [
987
+ 'HyperliquidTransaction:UsdSend': [
988
+ { 'name': 'hyperliquidChain', 'type': 'string' },
988
989
  { 'name': 'destination', 'type': 'string' },
989
990
  { 'name': 'amount', 'type': 'string' },
990
991
  { 'name': 'time', 'type': 'uint64' },
991
992
  ],
992
993
  };
993
- return this.buildSig(chainId, messageTypes, message);
994
+ return this.signUserSignedAction(messageTypes, message);
994
995
  }
995
996
  buildWithdrawSig(message) {
996
- const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
997
- const chainId = (isSandboxMode) ? 421614 : 42161;
998
997
  const messageTypes = {
999
- 'WithdrawFromBridge2SignPayload': [
998
+ 'HyperliquidTransaction:Withdraw': [
999
+ { 'name': 'hyperliquidChain', 'type': 'string' },
1000
1000
  { 'name': 'destination', 'type': 'string' },
1001
- { 'name': 'usd', 'type': 'string' },
1001
+ { 'name': 'amount', 'type': 'string' },
1002
1002
  { 'name': 'time', 'type': 'uint64' },
1003
1003
  ],
1004
1004
  };
1005
- return this.buildSig(chainId, messageTypes, message);
1005
+ return this.signUserSignedAction(messageTypes, message);
1006
1006
  }
1007
1007
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1008
1008
  /**
@@ -2405,10 +2405,11 @@ class hyperliquid extends hyperliquid$1 {
2405
2405
  if (code !== undefined) {
2406
2406
  code = code.toUpperCase();
2407
2407
  if (code !== 'USDC') {
2408
- throw new errors.NotSupported(this.id + 'withdraw() only support USDC');
2408
+ throw new errors.NotSupported(this.id + 'transfer() only support USDC');
2409
2409
  }
2410
2410
  }
2411
2411
  const payload = {
2412
+ 'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
2412
2413
  'destination': toAccount,
2413
2414
  'amount': this.numberToString(amount),
2414
2415
  'time': nonce,
@@ -2416,9 +2417,12 @@ class hyperliquid extends hyperliquid$1 {
2416
2417
  const sig = this.buildTransferSig(payload);
2417
2418
  const request = {
2418
2419
  'action': {
2419
- 'chain': (isSandboxMode) ? 'ArbitrumTestnet' : 'Arbitrum',
2420
- 'payload': payload,
2421
- 'type': 'usdTransfer',
2420
+ 'hyperliquidChain': payload['hyperliquidChain'],
2421
+ 'signatureChainId': '0x66eee',
2422
+ 'destination': toAccount,
2423
+ 'amount': amount.toString(),
2424
+ 'time': nonce,
2425
+ 'type': 'usdSend',
2422
2426
  },
2423
2427
  'nonce': nonce,
2424
2428
  'signature': sig,
@@ -2448,25 +2452,29 @@ class hyperliquid extends hyperliquid$1 {
2448
2452
  throw new errors.NotSupported(this.id + 'withdraw() only support USDC');
2449
2453
  }
2450
2454
  }
2451
- const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
2455
+ const isSandboxMode = this.safeBool(this.options, 'sandboxMode', false);
2452
2456
  const nonce = this.milliseconds();
2453
2457
  const payload = {
2458
+ 'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
2454
2459
  'destination': address,
2455
- 'usd': amount.toString(),
2460
+ 'amount': amount.toString(),
2456
2461
  'time': nonce,
2457
2462
  };
2458
2463
  const sig = this.buildWithdrawSig(payload);
2459
2464
  const request = {
2460
2465
  'action': {
2461
- 'chain': (isSandboxMode) ? 'ArbitrumTestnet' : 'Arbitrum',
2462
- 'payload': payload,
2463
- 'type': 'withdraw2',
2466
+ 'hyperliquidChain': payload['hyperliquidChain'],
2467
+ 'signatureChainId': '0x66eee',
2468
+ 'destination': address,
2469
+ 'amount': amount.toString(),
2470
+ 'time': nonce,
2471
+ 'type': 'withdraw3',
2464
2472
  },
2465
2473
  'nonce': nonce,
2466
2474
  'signature': sig,
2467
2475
  };
2468
2476
  const response = await this.privatePostExchange(this.extend(request, params));
2469
- return response;
2477
+ return this.parseTransaction(response);
2470
2478
  }
2471
2479
  formatVaultAddress(address = undefined) {
2472
2480
  if (address === undefined) {
@@ -24,6 +24,7 @@ class idex extends idex$1 {
24
24
  'rateLimit': 1000,
25
25
  'version': 'v3',
26
26
  'pro': true,
27
+ 'dex': true,
27
28
  'certified': false,
28
29
  'requiresWeb3': true,
29
30
  'has': {
@@ -121,6 +121,7 @@ class kucoin extends kucoin$1 {
121
121
  'futuresPublic': 'https://api-futures.kucoin.com',
122
122
  'webExchange': 'https://kucoin.com/_api',
123
123
  'broker': 'https://api-broker.kucoin.com',
124
+ 'earn': 'https://api.kucoin.com',
124
125
  },
125
126
  'www': 'https://www.kucoin.com',
126
127
  'doc': [
@@ -388,6 +389,9 @@ class kucoin extends kucoin$1 {
388
389
  'broker/nd/account': 2,
389
390
  'broker/nd/account/apikey': 2,
390
391
  'broker/nd/rebase/download': 3,
392
+ 'broker/nd/transfer/detail': 1,
393
+ 'broker/nd/deposit/detail': 1,
394
+ 'broker/nd/withdraw/detail': 1,
391
395
  },
392
396
  'post': {
393
397
  'broker/nd/transfer': 1,
@@ -399,6 +403,25 @@ class kucoin extends kucoin$1 {
399
403
  'broker/nd/account/apikey': 3,
400
404
  },
401
405
  },
406
+ 'earn': {
407
+ 'get': {
408
+ 'otc-loan/loan': 1,
409
+ 'otc-loan/accounts': 1,
410
+ 'earn/redeem-preview': 7.5,
411
+ 'earn/saving/products': 7.5,
412
+ 'earn/hold-assets': 7.5,
413
+ 'earn/promotion/products': 7.5,
414
+ 'earn/kcs-staking/products': 7.5,
415
+ 'earn/staking/products': 7.5,
416
+ 'earn/eth-staking/products': 7.5, // 5EW
417
+ },
418
+ 'post': {
419
+ 'earn/orders': 7.5, // 5EW
420
+ },
421
+ 'delete': {
422
+ 'earn/orders': 7.5, // 5EW
423
+ },
424
+ },
402
425
  },
403
426
  'timeframes': {
404
427
  '1m': '1min',
@@ -4795,6 +4818,9 @@ class kucoin extends kucoin$1 {
4795
4818
  if (api === 'webExchange') {
4796
4819
  endpoint = '/' + this.implodeParams(path, params);
4797
4820
  }
4821
+ if (api === 'earn') {
4822
+ endpoint = '/api/v1/' + this.implodeParams(path, params);
4823
+ }
4798
4824
  const query = this.omit(params, this.extractParams(path));
4799
4825
  let endpart = '';
4800
4826
  headers = (headers !== undefined) ? headers : {};
@@ -4813,7 +4839,8 @@ class kucoin extends kucoin$1 {
4813
4839
  const isFuturePrivate = (api === 'futuresPrivate');
4814
4840
  const isPrivate = (api === 'private');
4815
4841
  const isBroker = (api === 'broker');
4816
- if (isPrivate || isFuturePrivate || isBroker) {
4842
+ const isEarn = (api === 'earn');
4843
+ if (isPrivate || isFuturePrivate || isBroker || isEarn) {
4817
4844
  this.checkRequiredCredentials();
4818
4845
  const timestamp = this.nonce().toString();
4819
4846
  headers = this.extend({
@@ -961,7 +961,15 @@ class luno extends luno$1 {
961
961
  const request = {
962
962
  'order_id': id,
963
963
  };
964
- return await this.privatePostStoporder(this.extend(request, params));
964
+ const response = await this.privatePostStoporder(this.extend(request, params));
965
+ //
966
+ // {
967
+ // "success": true
968
+ // }
969
+ //
970
+ return this.safeOrder({
971
+ 'info': response,
972
+ });
965
973
  }
966
974
  async fetchLedgerByEntries(code = undefined, entry = undefined, limit = undefined, params = {}) {
967
975
  // by default without entry number or limit number, return most recent entry
@@ -221,6 +221,7 @@ class mexc extends mexc$1 {
221
221
  'sub-account/margin': 1,
222
222
  'batchOrders': 10,
223
223
  'capital/withdraw/apply': 1,
224
+ 'capital/withdraw': 1,
224
225
  'capital/transfer': 1,
225
226
  'capital/transfer/internal': 1,
226
227
  'capital/deposit/address': 1,
@@ -239,6 +240,7 @@ class mexc extends mexc$1 {
239
240
  'margin/order': 1,
240
241
  'margin/openOrders': 1,
241
242
  'userDataStream': 1,
243
+ 'capital/withdraw': 1,
242
244
  },
243
245
  },
244
246
  },
@@ -1066,7 +1068,7 @@ class mexc extends mexc$1 {
1066
1068
  const chains = this.safeValue(currency, 'networkList', []);
1067
1069
  for (let j = 0; j < chains.length; j++) {
1068
1070
  const chain = chains[j];
1069
- const networkId = this.safeString(chain, 'network');
1071
+ const networkId = this.safeString2(chain, 'network', 'netWork');
1070
1072
  const network = this.networkIdToCode(networkId);
1071
1073
  const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1072
1074
  const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
@@ -5221,7 +5223,7 @@ class mexc extends mexc$1 {
5221
5223
  * @method
5222
5224
  * @name mexc#withdraw
5223
5225
  * @description make a withdrawal
5224
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
5226
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
5225
5227
  * @param {string} code unified currency code
5226
5228
  * @param {float} amount the amount to withdraw
5227
5229
  * @param {string} address the address to withdraw to
@@ -5231,7 +5233,7 @@ class mexc extends mexc$1 {
5231
5233
  */
5232
5234
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5233
5235
  const networks = this.safeValue(this.options, 'networks', {});
5234
- let network = this.safeString2(params, 'network', 'chain'); // this line allows the user to specify either ERC20 or ETH
5236
+ let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5235
5237
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5236
5238
  this.checkAddress(address);
5237
5239
  await this.loadMarkets();
@@ -5245,10 +5247,10 @@ class mexc extends mexc$1 {
5245
5247
  request['memo'] = tag;
5246
5248
  }
5247
5249
  if (network !== undefined) {
5248
- request['network'] = network;
5249
- params = this.omit(params, ['network', 'chain']);
5250
+ request['netWork'] = network;
5251
+ params = this.omit(params, ['network', 'netWork']);
5250
5252
  }
5251
- const response = await this.spotPrivatePostCapitalWithdrawApply(this.extend(request, params));
5253
+ const response = await this.spotPrivatePostCapitalWithdraw(this.extend(request, params));
5252
5254
  //
5253
5255
  // {
5254
5256
  // "id":"7213fea8e94b4a5593d507237e5a555b"
@@ -2458,6 +2458,7 @@ class okx extends okx$1 {
2458
2458
  * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2459
2459
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2460
2460
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2461
+ * @param {string} [params.type] wallet type, ['funding' or 'trading'] default is 'trading'
2461
2462
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2462
2463
  */
2463
2464
  await this.loadMarkets();