ccxt 4.3.30 → 4.3.32

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 (140) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +14 -0
  5. package/dist/cjs/src/binance.js +14 -1
  6. package/dist/cjs/src/bitfinex2.js +100 -58
  7. package/dist/cjs/src/bitmart.js +3 -3
  8. package/dist/cjs/src/bitmex.js +1 -1
  9. package/dist/cjs/src/coinbase.js +1 -1
  10. package/dist/cjs/src/coinex.js +153 -126
  11. package/dist/cjs/src/gate.js +3 -3
  12. package/dist/cjs/src/hyperliquid.js +1 -1
  13. package/dist/cjs/src/kraken.js +2 -7
  14. package/dist/cjs/src/mexc.js +5 -5
  15. package/dist/cjs/src/poloniexfutures.js +8 -3
  16. package/dist/cjs/src/pro/bingx.js +1 -1
  17. package/dist/cjs/src/pro/cex.js +1 -1
  18. package/dist/cjs/src/pro/coinbase.js +31 -0
  19. package/dist/cjs/src/pro/mexc.js +7 -7
  20. package/js/ccxt.d.ts +1 -1
  21. package/js/ccxt.js +1 -1
  22. package/js/src/abstract/binance.d.ts +2 -0
  23. package/js/src/abstract/binancecoinm.d.ts +2 -0
  24. package/js/src/abstract/binanceus.d.ts +2 -0
  25. package/js/src/abstract/binanceusdm.d.ts +2 -0
  26. package/js/src/ace.d.ts +3 -3
  27. package/js/src/alpaca.d.ts +5 -5
  28. package/js/src/ascendex.d.ts +12 -23
  29. package/js/src/base/Exchange.d.ts +39 -37
  30. package/js/src/base/Exchange.js +14 -0
  31. package/js/src/base/functions/type.d.ts +9 -9
  32. package/js/src/base/types.d.ts +2 -0
  33. package/js/src/bigone.d.ts +4 -4
  34. package/js/src/binance.d.ts +20 -23
  35. package/js/src/binance.js +14 -1
  36. package/js/src/bingx.d.ts +8 -19
  37. package/js/src/bit2c.d.ts +2 -2
  38. package/js/src/bitbank.d.ts +4 -4
  39. package/js/src/bitbns.d.ts +3 -3
  40. package/js/src/bitfinex.d.ts +4 -4
  41. package/js/src/bitfinex2.d.ts +8 -8
  42. package/js/src/bitfinex2.js +100 -58
  43. package/js/src/bitflyer.d.ts +4 -4
  44. package/js/src/bitget.d.ts +14 -25
  45. package/js/src/bithumb.d.ts +4 -4
  46. package/js/src/bitmart.d.ts +8 -8
  47. package/js/src/bitmart.js +3 -3
  48. package/js/src/bitmex.d.ts +10 -21
  49. package/js/src/bitmex.js +1 -1
  50. package/js/src/bitopro.d.ts +4 -4
  51. package/js/src/bitrue.d.ts +5 -16
  52. package/js/src/bitso.d.ts +8 -8
  53. package/js/src/bitstamp.d.ts +11 -13
  54. package/js/src/bitteam.d.ts +4 -4
  55. package/js/src/bitvavo.d.ts +8 -19
  56. package/js/src/bl3p.d.ts +1 -1
  57. package/js/src/blockchaincom.d.ts +4 -6
  58. package/js/src/blofin.d.ts +11 -11
  59. package/js/src/btcalpha.d.ts +4 -4
  60. package/js/src/btcbox.d.ts +3 -3
  61. package/js/src/btcmarkets.d.ts +4 -4
  62. package/js/src/btcturk.d.ts +3 -3
  63. package/js/src/bybit.d.ts +19 -33
  64. package/js/src/cex.d.ts +3 -3
  65. package/js/src/coinbase.d.ts +11 -13
  66. package/js/src/coinbase.js +1 -1
  67. package/js/src/coinbaseexchange.d.ts +6 -6
  68. package/js/src/coinbaseinternational.d.ts +10 -10
  69. package/js/src/coincheck.d.ts +3 -3
  70. package/js/src/coinex.d.ts +14 -14
  71. package/js/src/coinex.js +153 -126
  72. package/js/src/coinlist.d.ts +6 -6
  73. package/js/src/coinmate.d.ts +5 -5
  74. package/js/src/coinmetro.d.ts +5 -11
  75. package/js/src/coinone.d.ts +4 -4
  76. package/js/src/coinsph.d.ts +5 -5
  77. package/js/src/coinspot.d.ts +1 -1
  78. package/js/src/cryptocom.d.ts +10 -21
  79. package/js/src/currencycom.d.ts +6 -22
  80. package/js/src/delta.d.ts +8 -8
  81. package/js/src/deribit.d.ts +6 -6
  82. package/js/src/digifinex.d.ts +16 -16
  83. package/js/src/exmo.d.ts +6 -6
  84. package/js/src/gate.d.ts +17 -28
  85. package/js/src/gate.js +3 -3
  86. package/js/src/gemini.d.ts +4 -4
  87. package/js/src/hitbtc.d.ts +8 -8
  88. package/js/src/hollaex.d.ts +6 -17
  89. package/js/src/htx.d.ts +15 -15
  90. package/js/src/huobijp.d.ts +5 -5
  91. package/js/src/hyperliquid.d.ts +4 -4
  92. package/js/src/hyperliquid.js +1 -1
  93. package/js/src/idex.d.ts +4 -4
  94. package/js/src/independentreserve.d.ts +3 -3
  95. package/js/src/indodax.d.ts +5 -7
  96. package/js/src/kraken.d.ts +7 -7
  97. package/js/src/kraken.js +2 -7
  98. package/js/src/krakenfutures.d.ts +9 -9
  99. package/js/src/kucoin.d.ts +11 -22
  100. package/js/src/kucoinfutures.d.ts +6 -6
  101. package/js/src/kuna.d.ts +7 -7
  102. package/js/src/latoken.d.ts +5 -5
  103. package/js/src/lbank.d.ts +10 -10
  104. package/js/src/luno.d.ts +3 -3
  105. package/js/src/lykke.d.ts +4 -4
  106. package/js/src/mercado.d.ts +4 -4
  107. package/js/src/mexc.d.ts +12 -12
  108. package/js/src/mexc.js +5 -5
  109. package/js/src/ndax.d.ts +6 -6
  110. package/js/src/novadax.d.ts +4 -4
  111. package/js/src/oceanex.d.ts +4 -4
  112. package/js/src/okcoin.d.ts +6 -6
  113. package/js/src/okx.d.ts +18 -24
  114. package/js/src/onetrading.d.ts +7 -7
  115. package/js/src/p2b.d.ts +3 -3
  116. package/js/src/paymium.d.ts +3 -3
  117. package/js/src/phemex.d.ts +11 -11
  118. package/js/src/poloniex.d.ts +6 -6
  119. package/js/src/poloniexfutures.d.ts +4 -4
  120. package/js/src/poloniexfutures.js +8 -3
  121. package/js/src/pro/bingx.js +1 -1
  122. package/js/src/pro/cex.js +1 -1
  123. package/js/src/pro/coinbase.d.ts +2 -2
  124. package/js/src/pro/coinbase.js +31 -0
  125. package/js/src/pro/mexc.js +7 -7
  126. package/js/src/pro/phemex.d.ts +3 -45
  127. package/js/src/probit.d.ts +5 -5
  128. package/js/src/timex.d.ts +6 -6
  129. package/js/src/tokocrypto.d.ts +4 -4
  130. package/js/src/tradeogre.d.ts +3 -3
  131. package/js/src/upbit.d.ts +5 -5
  132. package/js/src/wavesexchange.d.ts +4 -4
  133. package/js/src/wazirx.d.ts +4 -4
  134. package/js/src/whitebit.d.ts +11 -11
  135. package/js/src/woo.d.ts +8 -8
  136. package/js/src/woofipro.d.ts +10 -10
  137. package/js/src/yobit.d.ts +3 -3
  138. package/js/src/zaif.d.ts +3 -3
  139. package/js/src/zonda.d.ts +6 -6
  140. package/package.json +1 -1
@@ -68,8 +68,8 @@ class coinex extends coinex$1 {
68
68
  'fetchDepositAddressByNetwork': false,
69
69
  'fetchDepositAddresses': false,
70
70
  'fetchDeposits': true,
71
- 'fetchDepositWithdrawFee': 'emulated',
72
- 'fetchDepositWithdrawFees': true,
71
+ 'fetchDepositWithdrawFee': true,
72
+ 'fetchDepositWithdrawFees': false,
73
73
  'fetchFundingHistory': true,
74
74
  'fetchFundingRate': true,
75
75
  'fetchFundingRateHistory': true,
@@ -77,8 +77,8 @@ class coinex extends coinex$1 {
77
77
  'fetchIndexOHLCV': false,
78
78
  'fetchIsolatedBorrowRate': true,
79
79
  'fetchIsolatedBorrowRates': false,
80
- 'fetchLeverage': 'emulated',
81
- 'fetchLeverages': true,
80
+ 'fetchLeverage': true,
81
+ 'fetchLeverages': false,
82
82
  'fetchLeverageTiers': true,
83
83
  'fetchMarginAdjustmentHistory': true,
84
84
  'fetchMarketLeverageTiers': 'emulated',
@@ -5403,157 +5403,184 @@ class coinex extends coinex$1 {
5403
5403
  'info': info,
5404
5404
  };
5405
5405
  }
5406
- async fetchDepositWithdrawFees(codes = undefined, params = {}) {
5406
+ async fetchDepositWithdrawFee(code, params = {}) {
5407
5407
  /**
5408
5408
  * @method
5409
- * @name coinex#fetchDepositWithdrawFees
5410
- * @description fetch deposit and withdraw fees
5411
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market010_asset_config
5412
- * @param {string[]|undefined} codes list of unified currency codes
5409
+ * @name coinex#fetchDepositWithdrawFee
5410
+ * @description fetch the fee for deposits and withdrawals
5411
+ * @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-withdrawal-config
5412
+ * @param {string} code unified currency code
5413
5413
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5414
- * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
5414
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
5415
5415
  */
5416
5416
  await this.loadMarkets();
5417
- const request = {};
5418
- if (codes !== undefined) {
5419
- const codesLength = codes.length;
5420
- if (codesLength === 1) {
5421
- request['coin_type'] = this.safeValue(codes, 0);
5422
- }
5423
- }
5424
- const response = await this.v1PublicGetCommonAssetConfig(this.extend(request, params));
5425
- //
5426
- // {
5427
- // "code": 0,
5428
- // "data": {
5429
- // "CET-CSC": {
5430
- // "asset": "CET",
5431
- // "chain": "CSC",
5432
- // "can_deposit": true,
5433
- // "can_withdraw ": false,
5434
- // "deposit_least_amount": "1",
5435
- // "withdraw_least_amount": "1",
5436
- // "withdraw_tx_fee": "0.1"
5437
- // },
5438
- // "CET-ERC20": {
5439
- // "asset": "CET",
5440
- // "chain": "ERC20",
5441
- // "can_deposit": true,
5442
- // "can_withdraw": false,
5443
- // "deposit_least_amount": "14",
5444
- // "withdraw_least_amount": "14",
5445
- // "withdraw_tx_fee": "14"
5446
- // }
5447
- // },
5448
- // "message": "Success"
5449
- // }
5450
- //
5451
- return this.parseDepositWithdrawFees(response, codes);
5417
+ const currency = this.currency(code);
5418
+ const request = {
5419
+ 'ccy': currency['id'],
5420
+ };
5421
+ const response = await this.v2PrivateGetAssetsDepositWithdrawConfig(this.extend(request, params));
5422
+ //
5423
+ // {
5424
+ // "code": 0,
5425
+ // "data": {
5426
+ // "asset": {
5427
+ // "ccy": "USDT",
5428
+ // "deposit_enabled": true,
5429
+ // "withdraw_enabled": true,
5430
+ // "inter_transfer_enabled": true,
5431
+ // "is_st": false
5432
+ // },
5433
+ // "chains": [
5434
+ // {
5435
+ // "chain": "TRC20",
5436
+ // "min_deposit_amount": "2.4",
5437
+ // "min_withdraw_amount": "2.4",
5438
+ // "deposit_enabled": true,
5439
+ // "withdraw_enabled": true,
5440
+ // "deposit_delay_minutes": 0,
5441
+ // "safe_confirmations": 10,
5442
+ // "irreversible_confirmations": 20,
5443
+ // "deflation_rate": "0",
5444
+ // "withdrawal_fee": "2.4",
5445
+ // "withdrawal_precision": 6,
5446
+ // "memo": "",
5447
+ // "is_memo_required_for_deposit": false,
5448
+ // "explorer_asset_url": "https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
5449
+ // },
5450
+ // ]
5451
+ // },
5452
+ // "message": "OK"
5453
+ // }
5454
+ //
5455
+ const data = this.safeDict(response, 'data', {});
5456
+ return this.parseDepositWithdrawFee(data, currency);
5452
5457
  }
5453
- parseDepositWithdrawFees(response, codes = undefined, currencyIdKey = undefined) {
5454
- const depositWithdrawFees = {};
5455
- codes = this.marketCodes(codes);
5456
- const data = this.safeValue(response, 'data');
5457
- const currencyIds = Object.keys(data);
5458
- for (let i = 0; i < currencyIds.length; i++) {
5459
- const entry = currencyIds[i];
5460
- const splitEntry = entry.split('-');
5461
- const feeInfo = data[currencyIds[i]];
5462
- const currencyId = this.safeString(feeInfo, 'asset');
5463
- const currency = this.safeCurrency(currencyId);
5464
- const code = this.safeString(currency, 'code');
5465
- if ((codes === undefined) || (this.inArray(code, codes))) {
5466
- const depositWithdrawFee = this.safeValue(depositWithdrawFees, code);
5467
- if (depositWithdrawFee === undefined) {
5468
- depositWithdrawFees[code] = this.depositWithdrawFee({});
5469
- }
5470
- depositWithdrawFees[code]['info'][entry] = feeInfo;
5471
- const networkId = this.safeString(splitEntry, 1);
5472
- const withdrawFee = this.safeValue(feeInfo, 'withdraw_tx_fee');
5473
- const withdrawResult = {
5474
- 'fee': withdrawFee,
5475
- 'percentage': (withdrawFee !== undefined) ? false : undefined,
5476
- };
5477
- const depositResult = {
5478
- 'fee': undefined,
5479
- 'percentage': undefined,
5480
- };
5481
- if (networkId !== undefined) {
5482
- const networkCode = this.networkIdToCode(networkId);
5483
- depositWithdrawFees[code]['networks'][networkCode] = {
5484
- 'withdraw': withdrawResult,
5485
- 'deposit': depositResult,
5458
+ parseDepositWithdrawFee(fee, currency = undefined) {
5459
+ //
5460
+ // {
5461
+ // "asset": {
5462
+ // "ccy": "USDT",
5463
+ // "deposit_enabled": true,
5464
+ // "withdraw_enabled": true,
5465
+ // "inter_transfer_enabled": true,
5466
+ // "is_st": false
5467
+ // },
5468
+ // "chains": [
5469
+ // {
5470
+ // "chain": "TRC20",
5471
+ // "min_deposit_amount": "2.4",
5472
+ // "min_withdraw_amount": "2.4",
5473
+ // "deposit_enabled": true,
5474
+ // "withdraw_enabled": true,
5475
+ // "deposit_delay_minutes": 0,
5476
+ // "safe_confirmations": 10,
5477
+ // "irreversible_confirmations": 20,
5478
+ // "deflation_rate": "0",
5479
+ // "withdrawal_fee": "2.4",
5480
+ // "withdrawal_precision": 6,
5481
+ // "memo": "",
5482
+ // "is_memo_required_for_deposit": false,
5483
+ // "explorer_asset_url": "https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
5484
+ // },
5485
+ // ]
5486
+ // }
5487
+ //
5488
+ const result = {
5489
+ 'info': fee,
5490
+ 'withdraw': {
5491
+ 'fee': undefined,
5492
+ 'percentage': undefined,
5493
+ },
5494
+ 'deposit': {
5495
+ 'fee': undefined,
5496
+ 'percentage': undefined,
5497
+ },
5498
+ 'networks': {},
5499
+ };
5500
+ const chains = this.safeList(fee, 'chains', []);
5501
+ const asset = this.safeDict(fee, 'asset', {});
5502
+ for (let i = 0; i < chains.length; i++) {
5503
+ const entry = chains[i];
5504
+ const isWithdrawEnabled = this.safeBool(entry, 'withdraw_enabled');
5505
+ if (isWithdrawEnabled) {
5506
+ result['withdraw']['fee'] = this.safeNumber(entry, 'withdrawal_fee');
5507
+ result['withdraw']['percentage'] = false;
5508
+ const networkId = this.safeString(entry, 'chain');
5509
+ if (networkId) {
5510
+ const networkCode = this.networkIdToCode(networkId, this.safeString(asset, 'ccy'));
5511
+ result['networks'][networkCode] = {
5512
+ 'withdraw': {
5513
+ 'fee': this.safeNumber(entry, 'withdrawal_fee'),
5514
+ 'percentage': false,
5515
+ },
5516
+ 'deposit': {
5517
+ 'fee': undefined,
5518
+ 'percentage': undefined,
5519
+ },
5486
5520
  };
5487
5521
  }
5488
- else {
5489
- depositWithdrawFees[code]['withdraw'] = withdrawResult;
5490
- depositWithdrawFees[code]['deposit'] = depositResult;
5491
- }
5492
5522
  }
5493
5523
  }
5494
- const depositWithdrawCodes = Object.keys(depositWithdrawFees);
5495
- for (let i = 0; i < depositWithdrawCodes.length; i++) {
5496
- const code = depositWithdrawCodes[i];
5497
- const currency = this.currency(code);
5498
- depositWithdrawFees[code] = this.assignDefaultDepositWithdrawFees(depositWithdrawFees[code], currency);
5499
- }
5500
- return depositWithdrawFees;
5524
+ return result;
5501
5525
  }
5502
- async fetchLeverages(symbols = undefined, params = {}) {
5526
+ async fetchLeverage(symbol, params = {}) {
5503
5527
  /**
5504
5528
  * @method
5505
- * @name coinex#fetchLeverages
5506
- * @description fetch the set leverage for all contract and margin markets
5507
- * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account007_margin_account_settings
5508
- * @param {string[]} [symbols] a list of unified market symbols
5529
+ * @name coinex#fetchLeverage
5530
+ * @description fetch the set leverage for a market
5531
+ * @see https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-interest-limit
5532
+ * @param {string} symbol unified market symbol
5509
5533
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5510
- * @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
5534
+ * @param {string} params.code unified currency code
5535
+ * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
5511
5536
  */
5512
5537
  await this.loadMarkets();
5513
- symbols = this.marketSymbols(symbols);
5514
- let market = undefined;
5515
- if (symbols !== undefined) {
5516
- const symbol = this.safeValue(symbols, 0);
5517
- market = this.market(symbol);
5518
- }
5519
- let marketType = undefined;
5520
- [marketType, params] = this.handleMarketTypeAndParams('fetchLeverages', market, params);
5521
- if (marketType !== 'spot') {
5522
- throw new errors.NotSupported(this.id + ' fetchLeverages() supports spot margin markets only');
5538
+ const code = this.safeString(params, 'code');
5539
+ if (code === undefined) {
5540
+ throw new errors.ArgumentsRequired(this.id + ' fetchLeverage() requires a code parameter');
5523
5541
  }
5524
- const response = await this.v1PrivateGetMarginConfig(params);
5542
+ params = this.omit(params, 'code');
5543
+ const currency = this.currency(code);
5544
+ const market = this.market(symbol);
5545
+ const request = {
5546
+ 'market': market['id'],
5547
+ 'ccy': currency['id'],
5548
+ };
5549
+ const response = await this.v2PrivateGetAssetsMarginInterestLimit(this.extend(request, params));
5525
5550
  //
5526
5551
  // {
5527
5552
  // "code": 0,
5528
- // "data": [
5529
- // {
5530
- // "market": "BTCUSDT",
5531
- // "leverage": 10,
5532
- // "BTC": {
5533
- // "min_amount": "0.0008",
5534
- // "max_amount": "200",
5535
- // "day_rate": "0.0015"
5536
- // },
5537
- // "USDT": {
5538
- // "min_amount": "50",
5539
- // "max_amount": "500000",
5540
- // "day_rate": "0.001"
5541
- // }
5542
- // },
5543
- // ],
5544
- // "message": "Success"
5553
+ // "data": {
5554
+ // "market": "BTCUSDT",
5555
+ // "ccy": "USDT",
5556
+ // "leverage": 10,
5557
+ // "min_amount": "50",
5558
+ // "max_amount": "500000",
5559
+ // "daily_interest_rate": "0.001"
5560
+ // },
5561
+ // "message": "OK"
5545
5562
  // }
5546
5563
  //
5547
- const leverages = this.safeList(response, 'data', []);
5548
- return this.parseLeverages(leverages, symbols, 'market', marketType);
5564
+ const data = this.safeDict(response, 'data', {});
5565
+ return this.parseLeverage(data, market);
5549
5566
  }
5550
5567
  parseLeverage(leverage, market = undefined) {
5568
+ //
5569
+ // {
5570
+ // "market": "BTCUSDT",
5571
+ // "ccy": "USDT",
5572
+ // "leverage": 10,
5573
+ // "min_amount": "50",
5574
+ // "max_amount": "500000",
5575
+ // "daily_interest_rate": "0.001"
5576
+ // }
5577
+ //
5551
5578
  const marketId = this.safeString(leverage, 'market');
5552
5579
  const leverageValue = this.safeInteger(leverage, 'leverage');
5553
5580
  return {
5554
5581
  'info': leverage,
5555
5582
  'symbol': this.safeSymbol(marketId, market, undefined, 'spot'),
5556
- 'marginMode': undefined,
5583
+ 'marginMode': 'isolated',
5557
5584
  'longLeverage': leverageValue,
5558
5585
  'shortLeverage': leverageValue,
5559
5586
  };
@@ -2323,7 +2323,7 @@ class gate extends gate$1 {
2323
2323
  await this.loadMarkets();
2324
2324
  const market = this.market(symbol);
2325
2325
  //
2326
- // const request = {
2326
+ // const request: Dict = {
2327
2327
  // 'currency_pair': market['id'],
2328
2328
  // 'interval': '0', // depth, 0 means no aggregation is applied, default to 0
2329
2329
  // 'limit': limit, // maximum number of order depth data in asks or bids
@@ -3088,7 +3088,7 @@ class gate extends gate$1 {
3088
3088
  //
3089
3089
  // spot
3090
3090
  //
3091
- // const request = {
3091
+ // const request: Dict = {
3092
3092
  // 'currency_pair': market['id'],
3093
3093
  // 'limit': limit, // maximum number of records to be returned in a single list
3094
3094
  // 'last_id': 'id', // specify list staring point using the id of last record in previous list-query results
@@ -3097,7 +3097,7 @@ class gate extends gate$1 {
3097
3097
  //
3098
3098
  // swap, future
3099
3099
  //
3100
- // const request = {
3100
+ // const request: Dict = {
3101
3101
  // 'settle': market['settleId'],
3102
3102
  // 'contract': market['id'],
3103
3103
  // 'limit': limit, // maximum number of records to be returned in a single list
@@ -928,7 +928,7 @@ class hyperliquid extends hyperliquid$1 {
928
928
  const hash = this.actionHash(action, vaultAdress, nonce);
929
929
  const isTestnet = this.safeBool(this.options, 'sandboxMode', false);
930
930
  const phantomAgent = this.constructPhantomAgent(hash, isTestnet);
931
- // const data = {
931
+ // const data: Dict = {
932
932
  // 'domain': {
933
933
  // 'chainId': 1337,
934
934
  // 'name': 'Exchange',
@@ -986,9 +986,7 @@ class kraken extends kraken$1 {
986
986
  request['interval'] = timeframe;
987
987
  }
988
988
  if (since !== undefined) {
989
- // contrary to kraken's api documentation, the since parameter must be passed in nanoseconds
990
- // the adding of '000000' is copied from the fetchTrades function
991
- request['since'] = this.numberToString(since) + '000000'; // expected to be in nanoseconds
989
+ request['since'] = this.numberToString(this.parseToInt(since / 1000)); // expected to be in seconds
992
990
  }
993
991
  const response = await this.publicGetOHLC(this.extend(request, params));
994
992
  //
@@ -1273,10 +1271,7 @@ class kraken extends kraken$1 {
1273
1271
  // https://support.kraken.com/hc/en-us/articles/218198197-How-to-pull-all-trade-data-using-the-Kraken-REST-API
1274
1272
  // https://github.com/ccxt/ccxt/issues/5677
1275
1273
  if (since !== undefined) {
1276
- // php does not format it properly
1277
- // therefore we use string concatenation here
1278
- request['since'] = since * 1e6;
1279
- request['since'] = since.toString() + '000000'; // expected to be in nanoseconds
1274
+ request['since'] = this.numberToString(this.parseToInt(since / 1000)); // expected to be in seconds
1280
1275
  }
1281
1276
  if (limit !== undefined) {
1282
1277
  request['count'] = limit;
@@ -2418,7 +2418,7 @@ class mexc extends mexc$1 {
2418
2418
  // {"success":true,"code":0,"data":259208506303929856}
2419
2419
  //
2420
2420
  const data = this.safeString(response, 'data');
2421
- return this.parseOrder(data, market);
2421
+ return this.safeOrder({ 'id': data }, market);
2422
2422
  }
2423
2423
  async createOrders(orders, params = {}) {
2424
2424
  /**
@@ -4412,8 +4412,8 @@ class mexc extends mexc$1 {
4412
4412
  {
4413
4413
  'tier': 0,
4414
4414
  'currency': this.safeCurrencyCode(quoteId),
4415
- 'notionalFloor': undefined,
4416
- 'notionalCap': undefined,
4415
+ 'minNotional': undefined,
4416
+ 'maxNotional': undefined,
4417
4417
  'maintenanceMarginRate': undefined,
4418
4418
  'maxLeverage': this.safeNumber(info, 'maxLeverage'),
4419
4419
  'info': info,
@@ -4425,8 +4425,8 @@ class mexc extends mexc$1 {
4425
4425
  tiers.push({
4426
4426
  'tier': this.parseNumber(Precise["default"].stringDiv(cap, riskIncrVol)),
4427
4427
  'currency': this.safeCurrencyCode(quoteId),
4428
- 'notionalFloor': this.parseNumber(floor),
4429
- 'notionalCap': this.parseNumber(cap),
4428
+ 'minNotional': this.parseNumber(floor),
4429
+ 'maxNotional': this.parseNumber(cap),
4430
4430
  'maintenanceMarginRate': this.parseNumber(maintenanceMarginRate),
4431
4431
  'maxLeverage': this.parseNumber(Precise["default"].stringDiv('1', initialMarginRate)),
4432
4432
  'info': info,
@@ -373,9 +373,13 @@ class poloniexfutures extends poloniexfutures$1 {
373
373
  const marketId = this.safeString(ticker, 'symbol');
374
374
  const symbol = this.safeSymbol(marketId, market);
375
375
  const timestampString = this.safeString(ticker, 'ts');
376
- // check timestamp bcz bug: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011 and also 17 digits occured
377
376
  let multiplier = undefined;
378
- if (timestampString.length === 17) {
377
+ if (timestampString.length === 16) {
378
+ // 16 digits: https://app.travis-ci.com/github/ccxt/ccxt/builds/270587157#L5454
379
+ multiplier = 0.001;
380
+ }
381
+ else if (timestampString.length === 17) {
382
+ // 17 digits: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011
379
383
  multiplier = 0.0001;
380
384
  }
381
385
  else if (timestampString.length === 18) {
@@ -459,7 +463,8 @@ class poloniexfutures extends poloniexfutures$1 {
459
463
  */
460
464
  await this.loadMarkets();
461
465
  const response = await this.publicGetTickers(params);
462
- return this.parseTickers(this.safeValue(response, 'data', []), symbols);
466
+ const data = this.safeList(response, 'data', []);
467
+ return this.parseTickers(data, symbols);
463
468
  }
464
469
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
465
470
  /**
@@ -190,7 +190,7 @@ class bingx extends bingx$1 {
190
190
  // "b": "2.5747"
191
191
  // }
192
192
  //
193
- const timestamp = this.safeInteger(message, 'ts');
193
+ const timestamp = this.safeInteger(message, 'C');
194
194
  const marketId = this.safeString(message, 's');
195
195
  market = this.safeMarket(marketId, market);
196
196
  const close = this.safeString(message, 'c');
@@ -976,7 +976,7 @@ class cex extends cex$1 {
976
976
  const symbol = this.pairToSymbol(pair);
977
977
  const messageHash = 'orderbook:' + symbol;
978
978
  const timestamp = this.safeInteger2(data, 'timestamp_ms', 'timestamp');
979
- const incrementalId = this.safeNumber(data, 'id');
979
+ const incrementalId = this.safeInteger(data, 'id');
980
980
  const orderbook = this.orderBook({});
981
981
  const snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks');
982
982
  snapshot['nonce'] = incrementalId;
@@ -244,6 +244,34 @@ class coinbase extends coinbase$1 {
244
244
  // ]
245
245
  // }
246
246
  //
247
+ // note! seems coinbase might also send empty data like:
248
+ //
249
+ // {
250
+ // "channel": "ticker_batch",
251
+ // "client_id": "",
252
+ // "timestamp": "2024-05-24T18:22:24.546809523Z",
253
+ // "sequence_num": 1,
254
+ // "events": [
255
+ // {
256
+ // "type": "snapshot",
257
+ // "tickers": [
258
+ // {
259
+ // "type": "ticker",
260
+ // "product_id": "",
261
+ // "price": "",
262
+ // "volume_24_h": "",
263
+ // "low_24_h": "",
264
+ // "high_24_h": "",
265
+ // "low_52_w": "",
266
+ // "high_52_w": "",
267
+ // "price_percent_chg_24_h": ""
268
+ // }
269
+ // ]
270
+ // }
271
+ // ]
272
+ // }
273
+ //
274
+ //
247
275
  const channel = this.safeString(message, 'channel');
248
276
  const events = this.safeValue(message, 'events', []);
249
277
  const datetime = this.safeString(message, 'timestamp');
@@ -260,6 +288,9 @@ class coinbase extends coinbase$1 {
260
288
  const symbol = result['symbol'];
261
289
  this.tickers[symbol] = result;
262
290
  const wsMarketId = this.safeString(ticker, 'product_id');
291
+ if (wsMarketId === undefined) {
292
+ continue;
293
+ }
263
294
  const messageHash = channel + '::' + wsMarketId;
264
295
  newTickers.push(result);
265
296
  client.resolve(result, messageHash);
@@ -69,7 +69,7 @@ class mexc extends mexc$1 {
69
69
  async watchTicker(symbol, params = {}) {
70
70
  /**
71
71
  * @method
72
- * @name mexc3#watchTicker
72
+ * @name mexc#watchTicker
73
73
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
74
74
  * @param {string} symbol unified symbol of the market to fetch the ticker for
75
75
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -202,7 +202,7 @@ class mexc extends mexc$1 {
202
202
  async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
203
203
  /**
204
204
  * @method
205
- * @name mexc3#watchOHLCV
205
+ * @name mexc#watchOHLCV
206
206
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#kline-streams
207
207
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
208
208
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -348,7 +348,7 @@ class mexc extends mexc$1 {
348
348
  async watchOrderBook(symbol, limit = undefined, params = {}) {
349
349
  /**
350
350
  * @method
351
- * @name mexc3#watchOrderBook
351
+ * @name mexc#watchOrderBook
352
352
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#diff-depth-stream
353
353
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
354
354
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -518,7 +518,7 @@ class mexc extends mexc$1 {
518
518
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
519
519
  /**
520
520
  * @method
521
- * @name mexc3#watchTrades
521
+ * @name mexc#watchTrades
522
522
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#trade-streams
523
523
  * @description get the list of most recent trades for a particular symbol
524
524
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -607,7 +607,7 @@ class mexc extends mexc$1 {
607
607
  async watchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
608
608
  /**
609
609
  * @method
610
- * @name mexc3#watchMyTrades
610
+ * @name mexc#watchMyTrades
611
611
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#spot-account-deals
612
612
  * @description watches information on multiple trades made by the user
613
613
  * @param {string} symbol unified market symbol of the market trades were made in
@@ -754,7 +754,7 @@ class mexc extends mexc$1 {
754
754
  async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
755
755
  /**
756
756
  * @method
757
- * @name mexc3#watchOrders
757
+ * @name mexc#watchOrders
758
758
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#spot-account-orders
759
759
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#margin-account-orders
760
760
  * @description watches information on multiple orders made by the user
@@ -1006,7 +1006,7 @@ class mexc extends mexc$1 {
1006
1006
  async watchBalance(params = {}) {
1007
1007
  /**
1008
1008
  * @method
1009
- * @name mexc3#watchBalance
1009
+ * @name mexc#watchBalance
1010
1010
  * @see https://mxcdevelop.github.io/apidocs/spot_v3_en/#spot-account-upadte
1011
1011
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1012
1012
  * @param {object} [params] extra parameters specific to the exchange API endpoint
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, Conversion } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
7
- declare const version = "4.3.29";
7
+ declare const version = "4.3.31";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.30';
41
+ const version = '4.3.32';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -518,6 +518,7 @@ interface Exchange {
518
518
  fapiPrivateGetOrderAsynId(params?: {}): Promise<implicitReturnType>;
519
519
  fapiPrivateGetTradeAsyn(params?: {}): Promise<implicitReturnType>;
520
520
  fapiPrivateGetTradeAsynId(params?: {}): Promise<implicitReturnType>;
521
+ fapiPrivateGetFeeBurn(params?: {}): Promise<implicitReturnType>;
521
522
  fapiPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
522
523
  fapiPrivatePostPositionSideDual(params?: {}): Promise<implicitReturnType>;
523
524
  fapiPrivatePostPositionMargin(params?: {}): Promise<implicitReturnType>;
@@ -529,6 +530,7 @@ interface Exchange {
529
530
  fapiPrivatePostMultiAssetsMargin(params?: {}): Promise<implicitReturnType>;
530
531
  fapiPrivatePostApiReferralCustomization(params?: {}): Promise<implicitReturnType>;
531
532
  fapiPrivatePostApiReferralUserCustomization(params?: {}): Promise<implicitReturnType>;
533
+ fapiPrivatePostFeeBurn(params?: {}): Promise<implicitReturnType>;
532
534
  fapiPrivatePutListenKey(params?: {}): Promise<implicitReturnType>;
533
535
  fapiPrivatePutOrder(params?: {}): Promise<implicitReturnType>;
534
536
  fapiPrivatePutBatchOrders(params?: {}): Promise<implicitReturnType>;