ccxt 4.4.85 → 4.4.86

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 (60) hide show
  1. package/README.md +6 -7
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +6 -9
  4. package/dist/cjs/src/abstract/bittrade.js +9 -0
  5. package/dist/cjs/src/ascendex.js +189 -155
  6. package/dist/cjs/src/bequant.js +1 -1
  7. package/dist/cjs/src/bitget.js +5 -4
  8. package/dist/cjs/src/bitmart.js +1 -1
  9. package/dist/cjs/src/bittrade.js +2049 -0
  10. package/dist/cjs/src/coinbase.js +2 -6
  11. package/dist/cjs/src/deribit.js +4 -5
  12. package/dist/cjs/src/hollaex.js +107 -49
  13. package/dist/cjs/src/htx.js +20 -44
  14. package/dist/cjs/src/hyperliquid.js +4 -4
  15. package/dist/cjs/src/mexc.js +2 -2
  16. package/dist/cjs/src/ndax.js +25 -24
  17. package/dist/cjs/src/okcoin.js +12 -31
  18. package/dist/cjs/src/okx.js +9 -0
  19. package/dist/cjs/src/onetrading.js +9 -6
  20. package/dist/cjs/src/oxfun.js +42 -114
  21. package/dist/cjs/src/paradex.js +5 -1
  22. package/dist/cjs/src/pro/binance.js +1 -0
  23. package/dist/cjs/src/pro/bittrade.js +605 -0
  24. package/dist/cjs/src/pro/luno.js +6 -5
  25. package/dist/cjs/src/pro/mexc.js +3 -0
  26. package/js/ccxt.d.ts +8 -11
  27. package/js/ccxt.js +6 -8
  28. package/js/src/abstract/myokx.d.ts +2 -0
  29. package/js/src/abstract/okx.d.ts +2 -0
  30. package/js/src/ascendex.d.ts +2 -0
  31. package/js/src/ascendex.js +189 -155
  32. package/js/src/bequant.js +1 -1
  33. package/js/src/bitget.js +5 -4
  34. package/js/src/bitmart.js +1 -1
  35. package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
  36. package/js/src/{huobijp.js → bittrade.js} +35 -35
  37. package/js/src/coinbase.js +2 -6
  38. package/js/src/deribit.js +4 -5
  39. package/js/src/hollaex.js +107 -49
  40. package/js/src/htx.js +20 -44
  41. package/js/src/hyperliquid.js +4 -4
  42. package/js/src/mexc.js +2 -2
  43. package/js/src/ndax.js +25 -24
  44. package/js/src/okcoin.js +12 -31
  45. package/js/src/okx.js +9 -0
  46. package/js/src/onetrading.js +9 -6
  47. package/js/src/oxfun.js +42 -114
  48. package/js/src/paradex.js +5 -1
  49. package/js/src/pro/binance.js +1 -0
  50. package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
  51. package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
  52. package/js/src/pro/luno.js +6 -5
  53. package/js/src/pro/mexc.js +3 -0
  54. package/package.json +1 -1
  55. package/js/src/abstract/kuna.d.ts +0 -185
  56. package/js/src/abstract/kuna.js +0 -11
  57. package/js/src/kuna.d.ts +0 -335
  58. package/js/src/kuna.js +0 -2006
  59. /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
  60. /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
@@ -1452,10 +1452,6 @@ class coinbase extends coinbase$1 {
1452
1452
  this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE' })),
1453
1453
  this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
1454
1454
  ];
1455
- if (this.checkRequiredCredentials(false)) {
1456
- unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE' }));
1457
- unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' }));
1458
- }
1459
1455
  }
1460
1456
  catch (e) {
1461
1457
  unresolvedContractPromises = []; // the sync version of ccxt won't have the promise.all line so the request is made here. Some users can't access perpetual products
@@ -1472,8 +1468,8 @@ class coinbase extends coinbase$1 {
1472
1468
  const fees = this.safeDict(promises, 1, {});
1473
1469
  const expiringFutures = this.safeDict(contractPromises, 0, {});
1474
1470
  const perpetualFutures = this.safeDict(contractPromises, 1, {});
1475
- const expiringFees = this.safeDict(contractPromises, 2, {});
1476
- const perpetualFees = this.safeDict(contractPromises, 3, {});
1471
+ const expiringFees = this.safeDict(contractPromises, 0, {});
1472
+ const perpetualFees = this.safeDict(contractPromises, 1, {});
1477
1473
  //
1478
1474
  // {
1479
1475
  // "total_volume": 0,
@@ -634,18 +634,17 @@ class deribit extends deribit$1 {
634
634
  // "testnet": true
635
635
  // }
636
636
  //
637
- const data = this.safeValue(response, 'result', {});
637
+ const data = this.safeList(response, 'result', []);
638
638
  const result = {};
639
639
  for (let i = 0; i < data.length; i++) {
640
640
  const currency = data[i];
641
641
  const currencyId = this.safeString(currency, 'currency');
642
642
  const code = this.safeCurrencyCode(currencyId);
643
- const name = this.safeString(currency, 'currency_long');
644
- result[code] = {
643
+ result[code] = this.safeCurrencyStructure({
645
644
  'info': currency,
646
645
  'code': code,
647
646
  'id': currencyId,
648
- 'name': name,
647
+ 'name': this.safeString(currency, 'currency_long'),
649
648
  'active': undefined,
650
649
  'deposit': undefined,
651
650
  'withdraw': undefined,
@@ -667,7 +666,7 @@ class deribit extends deribit$1 {
667
666
  },
668
667
  },
669
668
  'networks': undefined,
670
- };
669
+ });
671
670
  }
672
671
  return result;
673
672
  }
@@ -284,6 +284,14 @@ class hollaex extends hollaex$1 {
284
284
  'BNB': 'bnb',
285
285
  'MATIC': 'matic',
286
286
  },
287
+ 'networksById': {
288
+ 'eth': 'ERC20',
289
+ 'ETH': 'ERC20',
290
+ 'ERC20': 'ERC20',
291
+ 'trx': 'TRC20',
292
+ 'TRX': 'TRC20',
293
+ 'TRC20': 'TRC20',
294
+ },
287
295
  },
288
296
  });
289
297
  }
@@ -414,66 +422,116 @@ class hollaex extends hollaex$1 {
414
422
  async fetchCurrencies(params = {}) {
415
423
  const response = await this.publicGetConstants(params);
416
424
  //
417
- // {
418
- // "coins":{
419
- // "bch":{
420
- // "id":4,
421
- // "fullname":"Bitcoin Cash",
422
- // "symbol":"bch",
423
- // "active":true,
424
- // "verified":true,
425
- // "allow_deposit":true,
426
- // "allow_withdrawal":true,
427
- // "withdrawal_fee":0.0002,
428
- // "min":0.001,
429
- // "max":100000,
430
- // "increment_unit":0.001,
431
- // "logo":"https://bitholla.s3.ap-northeast-2.amazonaws.com/icon/BCH-hollaex-asset-01.svg",
432
- // "code":"bch",
433
- // "is_public":true,
434
- // "meta":{},
435
- // "estimated_price":null,
436
- // "description":null,
437
- // "type":"blockchain",
438
- // "network":null,
439
- // "standard":null,
440
- // "issuer":"HollaEx",
441
- // "withdrawal_fees":null,
442
- // "created_at":"2019-08-09T10:45:43.367Z",
443
- // "updated_at":"2021-12-13T03:08:32.372Z",
444
- // "created_by":1,
445
- // "owner_id":1
446
- // },
425
+ // {
426
+ // "coins": {
427
+ // "usdt": {
428
+ // "id": "6",
429
+ // "fullname": "USD Tether",
430
+ // "symbol": "usdt",
431
+ // "active": true,
432
+ // "verified": true,
433
+ // "allow_deposit": true,
434
+ // "allow_withdrawal": true,
435
+ // "withdrawal_fee": "20",
436
+ // "min": "1",
437
+ // "max": "10000000",
438
+ // "increment_unit": "0.0001",
439
+ // "logo": "https://hollaex-resources.s3.ap-southeast-1.amazonaws.com/icons/usdt.svg",
440
+ // "code": "usdt",
441
+ // "is_public": true,
442
+ // "meta": {
443
+ // "color": "#27a17a",
444
+ // "website": "https://tether.to",
445
+ // "explorer": "https://blockchair.com/tether",
446
+ // "decimal_points": "6"
447
+ // },
448
+ // "estimated_price": "1",
449
+ // "description": "<p>Tether (USDT) is a stablecoin pegged 1:1 to the US dollar. It is a digital currency that aims to maintain its value while allowing for fast and secure transfer of funds. It was the first stablecoin, and is the most widely used due stablecoin due to its stability and low volatility compared to other cryptocurrencies. It was launched in 2014 by Tether Limited.</p>",
450
+ // "type": "blockchain",
451
+ // "network": "eth,trx,bnb,matic",
452
+ // "standard": "",
453
+ // "issuer": "HollaEx",
454
+ // "withdrawal_fees": {
455
+ // "bnb": {
456
+ // "value": "0.8",
457
+ // "active": true,
458
+ // "symbol": "usdt"
459
+ // },
460
+ // "eth": {
461
+ // "value": "1.5",
462
+ // "active": true,
463
+ // "symbol": "usdt"
464
+ // },
465
+ // "trx": {
466
+ // "value": "4",
467
+ // "active": true,
468
+ // "symbol": "usdt"
469
+ // },
470
+ // "matic": {
471
+ // "value": "0.3",
472
+ // "active": true,
473
+ // "symbol": "usdt"
474
+ // }
475
+ // },
476
+ // "display_name": null,
477
+ // "deposit_fees": null,
478
+ // "is_risky": false,
479
+ // "market_cap": "144568098696.29",
480
+ // "category": "stable",
481
+ // "created_at": "2019-08-09T10:45:43.367Z",
482
+ // "updated_at": "2025-03-25T17:12:37.970Z",
483
+ // "created_by": "168",
484
+ // "owner_id": "1"
485
+ // },
447
486
  // },
448
487
  // "network":"https://api.hollaex.network"
449
488
  // }
450
489
  //
451
- const coins = this.safeValue(response, 'coins', {});
490
+ const coins = this.safeDict(response, 'coins', {});
452
491
  const keys = Object.keys(coins);
453
492
  const result = {};
454
493
  for (let i = 0; i < keys.length; i++) {
455
494
  const key = keys[i];
456
495
  const currency = coins[key];
457
496
  const id = this.safeString(currency, 'symbol');
458
- const numericId = this.safeInteger(currency, 'id');
459
497
  const code = this.safeCurrencyCode(id);
460
- const name = this.safeString(currency, 'fullname');
461
- const depositEnabled = this.safeValue(currency, 'allow_deposit');
462
- const withdrawEnabled = this.safeValue(currency, 'allow_withdrawal');
463
- const isActive = this.safeValue(currency, 'active');
464
- const active = isActive && depositEnabled && withdrawEnabled;
465
- const fee = this.safeNumber(currency, 'withdrawal_fee');
466
- const withdrawalLimits = this.safeValue(currency, 'withdrawal_limits', []);
467
- result[code] = {
498
+ const withdrawalLimits = this.safeList(currency, 'withdrawal_limits', []);
499
+ const rawType = this.safeString(currency, 'type');
500
+ const type = (rawType === 'blockchain') ? 'crypto' : 'other';
501
+ const rawNetworks = this.safeDict(currency, 'withdrawal_fees', {});
502
+ const networks = {};
503
+ const networkIds = Object.keys(rawNetworks);
504
+ for (let j = 0; j < networkIds.length; j++) {
505
+ const networkId = networkIds[j];
506
+ const networkEntry = this.safeDict(rawNetworks, networkId);
507
+ const networkCode = this.networkIdToCode(networkId);
508
+ networks[networkCode] = {
509
+ 'id': networkId,
510
+ 'network': networkCode,
511
+ 'active': this.safeBool(networkEntry, 'active'),
512
+ 'deposit': undefined,
513
+ 'withdraw': undefined,
514
+ 'fee': this.safeNumber(networkEntry, 'value'),
515
+ 'precision': undefined,
516
+ 'limits': {
517
+ 'withdraw': {
518
+ 'min': undefined,
519
+ 'max': undefined,
520
+ },
521
+ },
522
+ 'info': networkEntry,
523
+ };
524
+ }
525
+ result[code] = this.safeCurrencyStructure({
468
526
  'id': id,
469
- 'numericId': numericId,
527
+ 'numericId': this.safeInteger(currency, 'id'),
470
528
  'code': code,
471
529
  'info': currency,
472
- 'name': name,
473
- 'active': active,
474
- 'deposit': depositEnabled,
475
- 'withdraw': withdrawEnabled,
476
- 'fee': fee,
530
+ 'name': this.safeString(currency, 'fullname'),
531
+ 'active': this.safeBool(currency, 'active'),
532
+ 'deposit': this.safeBool(currency, 'allow_deposit'),
533
+ 'withdraw': this.safeBool(currency, 'allow_withdrawal'),
534
+ 'fee': this.safeNumber(currency, 'withdrawal_fee'),
477
535
  'precision': this.safeNumber(currency, 'increment_unit'),
478
536
  'limits': {
479
537
  'amount': {
@@ -485,9 +543,9 @@ class hollaex extends hollaex$1 {
485
543
  'max': this.safeValue(withdrawalLimits, 0),
486
544
  },
487
545
  },
488
- 'networks': {},
489
- 'type': 'crypto',
490
- };
546
+ 'networks': networks,
547
+ 'type': type,
548
+ });
491
549
  }
492
550
  return result;
493
551
  }
@@ -3433,9 +3433,8 @@ class htx extends htx$1 {
3433
3433
  // }
3434
3434
  // ]
3435
3435
  // }
3436
- // }
3437
3436
  //
3438
- const data = this.safeValue(response, 'data', []);
3437
+ const data = this.safeList(response, 'data', []);
3439
3438
  const result = {};
3440
3439
  this.options['networkChainIdsByNames'] = {};
3441
3440
  this.options['networkNamesByChainIds'] = {};
@@ -3443,19 +3442,11 @@ class htx extends htx$1 {
3443
3442
  const entry = data[i];
3444
3443
  const currencyId = this.safeString(entry, 'currency');
3445
3444
  const code = this.safeCurrencyCode(currencyId);
3446
- this.options['networkChainIdsByNames'][code] = {};
3447
- const chains = this.safeValue(entry, 'chains', []);
3448
- const networks = {};
3449
- const instStatus = this.safeString(entry, 'instStatus');
3450
3445
  const assetType = this.safeString(entry, 'assetType');
3451
3446
  const type = assetType === '1' ? 'crypto' : 'fiat';
3452
- const currencyActive = instStatus === 'normal';
3453
- let minPrecision = undefined;
3454
- let minDeposit = undefined;
3455
- let minWithdraw = undefined;
3456
- let maxWithdraw = undefined;
3457
- let deposit = false;
3458
- let withdraw = false;
3447
+ this.options['networkChainIdsByNames'][code] = {};
3448
+ const chains = this.safeList(entry, 'chains', []);
3449
+ const networks = {};
3459
3450
  for (let j = 0; j < chains.length; j++) {
3460
3451
  const chainEntry = chains[j];
3461
3452
  const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
@@ -3463,49 +3454,34 @@ class htx extends htx$1 {
3463
3454
  this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
3464
3455
  this.options['networkNamesByChainIds'][uniqueChainId] = title;
3465
3456
  const networkCode = this.networkIdToCode(uniqueChainId);
3466
- minDeposit = this.safeNumber(chainEntry, 'minDepositAmt');
3467
- minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
3468
- maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
3469
- const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
3470
- const depositStatus = this.safeString(chainEntry, 'depositStatus');
3471
- const withdrawEnabled = (withdrawStatus === 'allowed');
3472
- const depositEnabled = (depositStatus === 'allowed');
3473
- withdraw = (withdrawEnabled) ? withdrawEnabled : withdraw;
3474
- deposit = (depositEnabled) ? depositEnabled : deposit;
3475
- const active = withdrawEnabled && depositEnabled;
3476
- const precision = this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'));
3477
- if (precision !== undefined) {
3478
- minPrecision = (minPrecision === undefined) ? precision : Precise["default"].stringMin(precision, minPrecision);
3479
- }
3480
- const fee = this.safeNumber(chainEntry, 'transactFeeWithdraw');
3481
3457
  networks[networkCode] = {
3482
3458
  'info': chainEntry,
3483
3459
  'id': uniqueChainId,
3484
3460
  'network': networkCode,
3485
3461
  'limits': {
3486
3462
  'deposit': {
3487
- 'min': minDeposit,
3463
+ 'min': this.safeNumber(chainEntry, 'minDepositAmt'),
3488
3464
  'max': undefined,
3489
3465
  },
3490
3466
  'withdraw': {
3491
- 'min': minWithdraw,
3492
- 'max': maxWithdraw,
3467
+ 'min': this.safeNumber(chainEntry, 'minWithdrawAmt'),
3468
+ 'max': this.safeNumber(chainEntry, 'maxWithdrawAmt'),
3493
3469
  },
3494
3470
  },
3495
- 'active': active,
3496
- 'deposit': depositEnabled,
3497
- 'withdraw': withdrawEnabled,
3498
- 'fee': fee,
3499
- 'precision': this.parseNumber(precision),
3471
+ 'active': undefined,
3472
+ 'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
3473
+ 'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
3474
+ 'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
3475
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
3500
3476
  };
3501
3477
  }
3502
- result[code] = {
3478
+ result[code] = this.safeCurrencyStructure({
3503
3479
  'info': entry,
3504
3480
  'code': code,
3505
3481
  'id': currencyId,
3506
- 'active': currencyActive,
3507
- 'deposit': deposit,
3508
- 'withdraw': withdraw,
3482
+ 'active': this.safeString(entry, 'instStatus') === 'normal',
3483
+ 'deposit': undefined,
3484
+ 'withdraw': undefined,
3509
3485
  'fee': undefined,
3510
3486
  'name': undefined,
3511
3487
  'type': type,
@@ -3515,17 +3491,17 @@ class htx extends htx$1 {
3515
3491
  'max': undefined,
3516
3492
  },
3517
3493
  'withdraw': {
3518
- 'min': minWithdraw,
3519
- 'max': maxWithdraw,
3494
+ 'min': undefined,
3495
+ 'max': undefined,
3520
3496
  },
3521
3497
  'deposit': {
3522
3498
  'min': undefined,
3523
3499
  'max': undefined,
3524
3500
  },
3525
3501
  },
3526
- 'precision': this.parseNumber(minPrecision),
3502
+ 'precision': undefined,
3527
3503
  'networks': networks,
3528
- };
3504
+ });
3529
3505
  }
3530
3506
  return result;
3531
3507
  }
@@ -175,12 +175,12 @@ class hyperliquid extends hyperliquid$1 {
175
175
  },
176
176
  'fees': {
177
177
  'swap': {
178
- 'taker': this.parseNumber('0.00035'),
179
- 'maker': this.parseNumber('0.0001'),
178
+ 'taker': this.parseNumber('0.00045'),
179
+ 'maker': this.parseNumber('0.00015'),
180
180
  },
181
181
  'spot': {
182
- 'taker': this.parseNumber('0.00035'),
183
- 'maker': this.parseNumber('0.0001'),
182
+ 'taker': this.parseNumber('0.0007'),
183
+ 'maker': this.parseNumber('0.0004'),
184
184
  },
185
185
  },
186
186
  'requiredCredentials': {
@@ -1087,7 +1087,6 @@ class mexc extends mexc$1 {
1087
1087
  const currency = response[i];
1088
1088
  const id = this.safeString(currency, 'coin');
1089
1089
  const code = this.safeCurrencyCode(id);
1090
- const name = this.safeString(currency, 'name');
1091
1090
  const networks = {};
1092
1091
  const chains = this.safeValue(currency, 'networkList', []);
1093
1092
  for (let j = 0; j < chains.length; j++) {
@@ -1109,13 +1108,14 @@ class mexc extends mexc$1 {
1109
1108
  'max': this.safeString(chain, 'withdrawMax'),
1110
1109
  },
1111
1110
  },
1111
+ 'contract': this.safeString(chain, 'contract'),
1112
1112
  };
1113
1113
  }
1114
1114
  result[code] = this.safeCurrencyStructure({
1115
1115
  'info': currency,
1116
1116
  'id': id,
1117
1117
  'code': code,
1118
- 'name': name,
1118
+ 'name': this.safeString(currency, 'name'),
1119
1119
  'active': undefined,
1120
1120
  'deposit': undefined,
1121
1121
  'withdraw': undefined,
@@ -452,45 +452,45 @@ class ndax extends ndax$1 {
452
452
  };
453
453
  const response = await this.publicGetGetProducts(this.extend(request, params));
454
454
  //
455
- // [
456
- // {
457
- // "OMSId":1,
458
- // "ProductId":1,
459
- // "Product":"BTC",
460
- // "ProductFullName":"Bitcoin",
461
- // "ProductType":"CryptoCurrency",
462
- // "DecimalPlaces":8,
463
- // "TickSize":0.0000000100000000000000000000,
464
- // "NoFees":false,
465
- // "IsDisabled":false,
466
- // "MarginEnabled":false
467
- // },
468
- // ]
455
+ // [
456
+ // {
457
+ // "OMSId": "1",
458
+ // "ProductId": "1",
459
+ // "Product": "BTC",
460
+ // "ProductFullName": "Bitcoin",
461
+ // "MasterDataUniqueProductSymbol": "",
462
+ // "ProductType": "CryptoCurrency",
463
+ // "DecimalPlaces": "8",
464
+ // "TickSize": "0.0000000100000000000000000000",
465
+ // "DepositEnabled": true,
466
+ // "WithdrawEnabled": true,
467
+ // "NoFees": false,
468
+ // "IsDisabled": false,
469
+ // "MarginEnabled": false
470
+ // },
471
+ // ...
469
472
  //
470
473
  const result = {};
471
474
  for (let i = 0; i < response.length; i++) {
472
475
  const currency = response[i];
473
476
  const id = this.safeString(currency, 'ProductId');
474
- const name = this.safeString(currency, 'ProductFullName');
477
+ const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
475
478
  const ProductType = this.safeString(currency, 'ProductType');
476
479
  let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
477
480
  if (ProductType === 'Unknown') {
478
481
  // such currency is just a blanket entry
479
482
  type = 'other';
480
483
  }
481
- const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
482
- const isDisabled = this.safeValue(currency, 'IsDisabled');
483
- const active = !isDisabled;
484
- result[code] = {
484
+ result[code] = this.safeCurrencyStructure({
485
485
  'id': id,
486
- 'name': name,
486
+ 'name': this.safeString(currency, 'ProductFullName'),
487
487
  'code': code,
488
488
  'type': type,
489
489
  'precision': this.safeNumber(currency, 'TickSize'),
490
490
  'info': currency,
491
- 'active': active,
492
- 'deposit': undefined,
493
- 'withdraw': undefined,
491
+ 'active': !this.safeBool(currency, 'IsDisabled'),
492
+ 'deposit': this.safeBool(currency, 'DepositEnabled'),
493
+ 'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
494
494
  'fee': undefined,
495
495
  'limits': {
496
496
  'amount': {
@@ -503,7 +503,8 @@ class ndax extends ndax$1 {
503
503
  },
504
504
  },
505
505
  'networks': {},
506
- };
506
+ 'margin': this.safeBool(currency, 'MarginEnabled'),
507
+ });
507
508
  }
508
509
  return result;
509
510
  }
@@ -826,49 +826,30 @@ class okcoin extends okcoin$1 {
826
826
  }
827
827
  else {
828
828
  const response = await this.privateGetAssetCurrencies(params);
829
- const data = this.safeValue(response, 'data', []);
829
+ const data = this.safeList(response, 'data', []);
830
830
  const result = {};
831
831
  const dataByCurrencyId = this.groupBy(data, 'ccy');
832
832
  const currencyIds = Object.keys(dataByCurrencyId);
833
833
  for (let i = 0; i < currencyIds.length; i++) {
834
834
  const currencyId = currencyIds[i];
835
- const currency = this.safeCurrency(currencyId);
836
- const code = currency['code'];
835
+ const code = this.safeCurrencyCode(currencyId);
837
836
  const chains = dataByCurrencyId[currencyId];
838
837
  const networks = {};
839
- let currencyActive = false;
840
- let depositEnabled = false;
841
- let withdrawEnabled = false;
842
- let maxPrecision = undefined;
843
838
  for (let j = 0; j < chains.length; j++) {
844
839
  const chain = chains[j];
845
- const canDeposit = this.safeValue(chain, 'canDep');
846
- depositEnabled = (canDeposit) ? canDeposit : depositEnabled;
847
- const canWithdraw = this.safeValue(chain, 'canWd');
848
- withdrawEnabled = (canWithdraw) ? canWithdraw : withdrawEnabled;
849
- const canInternal = this.safeValue(chain, 'canInternal');
850
- const active = (canDeposit && canWithdraw && canInternal) ? true : false;
851
- currencyActive = (active) ? active : currencyActive;
852
840
  const networkId = this.safeString(chain, 'chain');
853
841
  if ((networkId !== undefined) && (networkId.indexOf('-') >= 0)) {
854
842
  const parts = networkId.split('-');
855
843
  const chainPart = this.safeString(parts, 1, networkId);
856
844
  const networkCode = this.networkIdToCode(chainPart);
857
- const precision = this.parsePrecision(this.safeString(chain, 'wdTickSz'));
858
- if (maxPrecision === undefined) {
859
- maxPrecision = precision;
860
- }
861
- else {
862
- maxPrecision = Precise["default"].stringMin(maxPrecision, precision);
863
- }
864
845
  networks[networkCode] = {
865
846
  'id': networkId,
866
847
  'network': networkCode,
867
- 'active': active,
868
- 'deposit': canDeposit,
869
- 'withdraw': canWithdraw,
848
+ 'active': undefined,
849
+ 'deposit': this.safeBool(chain, 'canDep'),
850
+ 'withdraw': this.safeBool(chain, 'canWd'),
870
851
  'fee': this.safeNumber(chain, 'minFee'),
871
- 'precision': this.parseNumber(precision),
852
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
872
853
  'limits': {
873
854
  'withdraw': {
874
855
  'min': this.safeNumber(chain, 'minWd'),
@@ -880,16 +861,16 @@ class okcoin extends okcoin$1 {
880
861
  }
881
862
  }
882
863
  const firstChain = this.safeValue(chains, 0);
883
- result[code] = {
864
+ result[code] = this.safeCurrencyStructure({
884
865
  'info': chains,
885
866
  'code': code,
886
867
  'id': currencyId,
887
868
  'name': this.safeString(firstChain, 'name'),
888
- 'active': currencyActive,
889
- 'deposit': depositEnabled,
890
- 'withdraw': withdrawEnabled,
869
+ 'active': undefined,
870
+ 'deposit': undefined,
871
+ 'withdraw': undefined,
891
872
  'fee': undefined,
892
- 'precision': this.parseNumber(maxPrecision),
873
+ 'precision': undefined,
893
874
  'limits': {
894
875
  'amount': {
895
876
  'min': undefined,
@@ -897,7 +878,7 @@ class okcoin extends okcoin$1 {
897
878
  },
898
879
  },
899
880
  'networks': networks,
900
- };
881
+ });
901
882
  }
902
883
  return result;
903
884
  }
@@ -363,6 +363,7 @@ class okx extends okx$1 {
363
363
  'account/spot-manual-borrow-repay': 10,
364
364
  'account/set-auto-repay': 4,
365
365
  'account/spot-borrow-repay-history': 4,
366
+ 'account/move-positions-history': 10,
366
367
  // subaccount
367
368
  'users/subaccount/list': 10,
368
369
  'account/subaccount/balances': 10 / 3,
@@ -500,6 +501,7 @@ class okx extends okx$1 {
500
501
  'account/fixed-loan/manual-reborrow': 5,
501
502
  'account/fixed-loan/repay-borrowing-order': 5,
502
503
  'account/bills-history-archive': 72000,
504
+ 'account/move-positions': 10,
503
505
  // subaccount
504
506
  'users/subaccount/modify-apikey': 10,
505
507
  'asset/subaccount/transfer': 10,
@@ -966,6 +968,13 @@ class okx extends okx$1 {
966
968
  '70010': errors.BadRequest,
967
969
  '70013': errors.BadRequest,
968
970
  '70016': errors.BadRequest,
971
+ '70060': errors.BadRequest,
972
+ '70061': errors.BadRequest,
973
+ '70062': errors.BadRequest,
974
+ '70064': errors.BadRequest,
975
+ '70065': errors.BadRequest,
976
+ '70066': errors.BadRequest,
977
+ '70067': errors.BadRequest,
969
978
  '1009': errors.BadRequest,
970
979
  '4001': errors.AuthenticationError,
971
980
  '4002': errors.BadRequest,