ccxt 4.4.77 → 4.4.80

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 (154) hide show
  1. package/README.md +8 -10
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +8 -4
  4. package/dist/cjs/src/abstract/ace.js +1 -1
  5. package/dist/cjs/src/abstract/apex.js +9 -0
  6. package/dist/cjs/src/ace.js +1 -1
  7. package/dist/cjs/src/apex.js +1949 -0
  8. package/dist/cjs/src/ascendex.js +25 -4
  9. package/dist/cjs/src/base/Exchange.js +42 -2
  10. package/dist/cjs/src/binance.js +9 -1
  11. package/dist/cjs/src/bingx.js +3 -3
  12. package/dist/cjs/src/bitfinex.js +64 -36
  13. package/dist/cjs/src/bitget.js +191 -138
  14. package/dist/cjs/src/bitmart.js +7 -2
  15. package/dist/cjs/src/bitmex.js +16 -8
  16. package/dist/cjs/src/bitopro.js +5 -1
  17. package/dist/cjs/src/bitrue.js +2 -1
  18. package/dist/cjs/src/bitso.js +1 -1
  19. package/dist/cjs/src/bitteam.js +2 -0
  20. package/dist/cjs/src/bitvavo.js +28 -10
  21. package/dist/cjs/src/btcalpha.js +1 -1
  22. package/dist/cjs/src/btcmarkets.js +1 -1
  23. package/dist/cjs/src/btcturk.js +1 -1
  24. package/dist/cjs/src/bybit.js +32 -16
  25. package/dist/cjs/src/cex.js +1 -1
  26. package/dist/cjs/src/coinbase.js +18 -2
  27. package/dist/cjs/src/coincatch.js +68 -0
  28. package/dist/cjs/src/coinex.js +1 -0
  29. package/dist/cjs/src/coinlist.js +1 -0
  30. package/dist/cjs/src/coinone.js +1 -0
  31. package/dist/cjs/src/delta.js +4 -0
  32. package/dist/cjs/src/deribit.js +1 -0
  33. package/dist/cjs/src/hitbtc.js +3 -0
  34. package/dist/cjs/src/hollaex.js +1 -0
  35. package/dist/cjs/src/htx.js +7 -3
  36. package/dist/cjs/src/huobijp.js +1 -0
  37. package/dist/cjs/src/hyperliquid.js +14 -4
  38. package/dist/cjs/src/kraken.js +2 -0
  39. package/dist/cjs/src/mexc.js +50 -57
  40. package/dist/cjs/src/okx.js +1 -1
  41. package/dist/cjs/src/phemex.js +2 -1
  42. package/dist/cjs/src/poloniex.js +2 -1
  43. package/dist/cjs/src/pro/apex.js +1043 -0
  44. package/dist/cjs/src/pro/binance.js +3 -3
  45. package/dist/cjs/src/pro/coinbase.js +45 -68
  46. package/dist/cjs/src/pro/gate.js +27 -2
  47. package/dist/cjs/src/pro/hollaex.js +2 -2
  48. package/dist/cjs/src/pro/p2b.js +2 -2
  49. package/dist/cjs/src/pro/tradeogre.js +283 -0
  50. package/dist/cjs/src/pro/upbit.js +43 -0
  51. package/dist/cjs/src/probit.js +1 -0
  52. package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2639 -0
  53. package/dist/cjs/src/timex.js +2 -2
  54. package/dist/cjs/src/tradeogre.js +2 -1
  55. package/dist/cjs/src/upbit.js +277 -67
  56. package/dist/cjs/src/whitebit.js +66 -12
  57. package/dist/cjs/src/woo.js +3 -1
  58. package/dist/cjs/src/xt.js +9 -0
  59. package/js/ccxt.d.ts +11 -5
  60. package/js/ccxt.js +8 -4
  61. package/js/src/abstract/apex.d.ts +34 -0
  62. package/js/src/abstract/bitmart.d.ts +1 -0
  63. package/js/src/apex.d.ts +333 -0
  64. package/js/src/apex.js +1945 -0
  65. package/js/src/ascendex.d.ts +3 -3
  66. package/js/src/ascendex.js +25 -4
  67. package/js/src/base/Exchange.d.ts +2 -0
  68. package/js/src/base/Exchange.js +42 -1
  69. package/js/src/binance.d.ts +7 -7
  70. package/js/src/binance.js +9 -1
  71. package/js/src/bingx.js +3 -3
  72. package/js/src/bitfinex.d.ts +3 -3
  73. package/js/src/bitfinex.js +64 -36
  74. package/js/src/bitflyer.d.ts +2 -2
  75. package/js/src/bitget.d.ts +2 -0
  76. package/js/src/bitget.js +191 -138
  77. package/js/src/bitmart.d.ts +5 -4
  78. package/js/src/bitmart.js +7 -2
  79. package/js/src/bitmex.d.ts +3 -3
  80. package/js/src/bitmex.js +16 -8
  81. package/js/src/bitopro.js +5 -1
  82. package/js/src/bitrue.js +2 -1
  83. package/js/src/bitso.js +1 -1
  84. package/js/src/bitteam.js +2 -0
  85. package/js/src/bitvavo.js +28 -10
  86. package/js/src/btcalpha.js +1 -1
  87. package/js/src/btcmarkets.js +1 -1
  88. package/js/src/btcturk.js +1 -1
  89. package/js/src/bybit.js +32 -16
  90. package/js/src/cex.js +1 -1
  91. package/js/src/coinbase.d.ts +4 -4
  92. package/js/src/coinbase.js +18 -2
  93. package/js/src/coinbaseexchange.d.ts +1 -1
  94. package/js/src/coincatch.d.ts +11 -0
  95. package/js/src/coincatch.js +68 -0
  96. package/js/src/coinex.js +1 -0
  97. package/js/src/coinlist.js +1 -0
  98. package/js/src/coinone.js +1 -0
  99. package/js/src/cryptocom.d.ts +4 -4
  100. package/js/src/delta.js +4 -0
  101. package/js/src/deribit.d.ts +4 -4
  102. package/js/src/deribit.js +1 -0
  103. package/js/src/derive.d.ts +3 -3
  104. package/js/src/digifinex.d.ts +4 -4
  105. package/js/src/hitbtc.js +3 -0
  106. package/js/src/hollaex.js +1 -0
  107. package/js/src/htx.d.ts +4 -4
  108. package/js/src/htx.js +7 -3
  109. package/js/src/huobijp.js +1 -0
  110. package/js/src/hyperliquid.d.ts +1 -0
  111. package/js/src/hyperliquid.js +14 -4
  112. package/js/src/kraken.d.ts +3 -3
  113. package/js/src/kraken.js +2 -0
  114. package/js/src/krakenfutures.d.ts +2 -2
  115. package/js/src/kucoinfutures.d.ts +5 -5
  116. package/js/src/mexc.d.ts +1 -0
  117. package/js/src/mexc.js +50 -57
  118. package/js/src/okx.js +1 -1
  119. package/js/src/oxfun.d.ts +3 -3
  120. package/js/src/phemex.d.ts +3 -3
  121. package/js/src/phemex.js +2 -1
  122. package/js/src/poloniex.d.ts +3 -3
  123. package/js/src/poloniex.js +2 -1
  124. package/js/src/pro/apex.d.ts +160 -0
  125. package/js/src/pro/apex.js +1038 -0
  126. package/js/src/pro/binance.js +3 -3
  127. package/js/src/pro/coinbase.d.ts +4 -3
  128. package/js/src/pro/coinbase.js +45 -66
  129. package/js/src/pro/gate.js +27 -2
  130. package/js/src/pro/hollaex.js +2 -2
  131. package/js/src/pro/p2b.js +2 -2
  132. package/js/src/pro/tradeogre.d.ts +49 -0
  133. package/js/src/pro/tradeogre.js +278 -0
  134. package/js/src/pro/upbit.d.ts +16 -1
  135. package/js/src/pro/upbit.js +43 -0
  136. package/js/src/probit.js +1 -0
  137. package/js/src/static_dependencies/zklink/zklink-sdk-web.d.ts +1279 -0
  138. package/js/src/static_dependencies/zklink/zklink-sdk-web.js +4276 -0
  139. package/js/src/timex.js +2 -2
  140. package/js/src/tradeogre.js +2 -1
  141. package/js/src/upbit.d.ts +75 -23
  142. package/js/src/upbit.js +277 -67
  143. package/js/src/vertex.d.ts +3 -3
  144. package/js/src/whitebit.js +66 -12
  145. package/js/src/woo.d.ts +4 -4
  146. package/js/src/woo.js +3 -1
  147. package/js/src/woofipro.d.ts +4 -4
  148. package/js/src/xt.d.ts +4 -4
  149. package/js/src/xt.js +9 -0
  150. package/package.json +2 -2
  151. package/js/src/abstract/ace.d.ts +0 -18
  152. package/js/src/ace.d.ts +0 -158
  153. package/js/src/ace.js +0 -1175
  154. /package/js/src/abstract/{ace.js → apex.js} +0 -0
package/js/src/delta.js CHANGED
@@ -345,6 +345,9 @@ export default class delta extends Exchange {
345
345
  expiry = this.safeString(optionParts, 3);
346
346
  optionType = this.safeString(optionParts, 0);
347
347
  }
348
+ if (expiry !== undefined) {
349
+ expiry = expiry.slice(4) + expiry.slice(2, 4) + expiry.slice(0, 2);
350
+ }
348
351
  const settle = quote;
349
352
  const strike = this.safeString(optionParts, 2);
350
353
  const datetime = this.convertExpireDate(expiry);
@@ -560,6 +563,7 @@ export default class delta extends Exchange {
560
563
  },
561
564
  },
562
565
  'networks': {},
566
+ 'type': 'crypto',
563
567
  };
564
568
  }
565
569
  return result;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/deribit.js';
2
- import type { Balances, Currency, FundingRateHistory, Greeks, Int, Liquidation, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, MarketInterface, Num, Account, Option, OptionChain, Currencies, TradingFees, Dict, int, FundingRate, DepositAddress } from './base/types.js';
2
+ import type { Balances, Currency, FundingRateHistory, Greeks, Int, Liquidation, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, MarketInterface, Num, Account, Option, OptionChain, Currencies, TradingFees, Dict, int, FundingRate, DepositAddress, Position } from './base/types.js';
3
3
  /**
4
4
  * @class deribit
5
5
  * @augments Exchange
@@ -321,7 +321,7 @@ export default class deribit extends Exchange {
321
321
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
322
322
  parseTransactionStatus(status: Str): string;
323
323
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
324
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
324
+ parsePosition(position: Dict, market?: Market): Position;
325
325
  /**
326
326
  * @method
327
327
  * @name deribit#fetchPosition
@@ -331,7 +331,7 @@ export default class deribit extends Exchange {
331
331
  * @param {object} [params] extra parameters specific to the exchange API endpoint
332
332
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
333
333
  */
334
- fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
334
+ fetchPosition(symbol: string, params?: {}): Promise<Position>;
335
335
  /**
336
336
  * @method
337
337
  * @name deribit#fetchPositions
@@ -344,7 +344,7 @@ export default class deribit extends Exchange {
344
344
  * @param {int} [params.subaccount_id] the user id for the subaccount
345
345
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
346
346
  */
347
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
347
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
348
348
  /**
349
349
  * @method
350
350
  * @name deribit#fetchVolatilityHistory
package/js/src/deribit.js CHANGED
@@ -646,6 +646,7 @@ export default class deribit extends Exchange {
646
646
  'active': undefined,
647
647
  'deposit': undefined,
648
648
  'withdraw': undefined,
649
+ 'type': 'crypto',
649
650
  'fee': this.safeNumber(currency, 'withdrawal_fee'),
650
651
  'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'fee_precision'))),
651
652
  'limits': {
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/derive.js';
2
- import type { Dict, Currencies, Transaction, Currency, FundingHistory, Market, Str, Strings, Ticker, Int, int, Trade, OrderType, OrderSide, Num, FundingRateHistory, FundingRate, Balances, Order } from './base/types.js';
2
+ import type { Dict, Currencies, Transaction, Currency, FundingHistory, Market, Str, Strings, Ticker, Int, int, Trade, OrderType, OrderSide, Num, FundingRateHistory, FundingRate, Balances, Order, Position } from './base/types.js';
3
3
  /**
4
4
  * @class derive
5
5
  * @augments Exchange
@@ -249,8 +249,8 @@ export default class derive extends Exchange {
249
249
  * @param {string} [params.subaccount_id] *required* the subaccount id
250
250
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
251
251
  */
252
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
253
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
252
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
253
+ parsePosition(position: Dict, market?: Market): Position;
254
254
  /**
255
255
  * @method
256
256
  * @name derive#fetchFundingHistory
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/digifinex.js';
2
- import type { FundingRateHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Trade, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Market, Currency, TransferEntry, Num, MarginModification, TradingFeeInterface, Currencies, CrossBorrowRate, CrossBorrowRates, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, FundingRate, DepositAddress, BorrowInterest } from './base/types.js';
2
+ import type { FundingRateHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Trade, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Market, Currency, TransferEntry, Num, MarginModification, TradingFeeInterface, Currencies, CrossBorrowRate, CrossBorrowRates, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, FundingRate, DepositAddress, BorrowInterest, Position } from './base/types.js';
3
3
  /**
4
4
  * @class digifinex
5
5
  * @augments Exchange
@@ -404,7 +404,7 @@ export default class digifinex extends Exchange {
404
404
  * @param {object} [params] extra parameters specific to the exchange API endpoint
405
405
  * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
406
406
  */
407
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
407
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
408
408
  /**
409
409
  * @method
410
410
  * @name digifinex#fetchPosition
@@ -415,8 +415,8 @@ export default class digifinex extends Exchange {
415
415
  * @param {object} [params] extra parameters specific to the exchange API endpoint
416
416
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
417
417
  */
418
- fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
419
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
418
+ fetchPosition(symbol: string, params?: {}): Promise<Position>;
419
+ parsePosition(position: Dict, market?: Market): Position;
420
420
  /**
421
421
  * @method
422
422
  * @name digifinex#setLeverage
package/js/src/hitbtc.js CHANGED
@@ -951,6 +951,8 @@ export default class hitbtc extends Exchange {
951
951
  const transferEnabled = this.safeBool(entry, 'transfer_enabled', false);
952
952
  const active = payinEnabled && payoutEnabled && transferEnabled;
953
953
  const rawNetworks = this.safeValue(entry, 'networks', []);
954
+ const isCrypto = this.safeBool(entry, 'crypto');
955
+ const type = isCrypto ? 'crypto' : 'fiat';
954
956
  const networks = {};
955
957
  let fee = undefined;
956
958
  let depositEnabled = undefined;
@@ -1013,6 +1015,7 @@ export default class hitbtc extends Exchange {
1013
1015
  'max': undefined,
1014
1016
  },
1015
1017
  },
1018
+ 'type': type,
1016
1019
  };
1017
1020
  }
1018
1021
  return result;
package/js/src/hollaex.js CHANGED
@@ -483,6 +483,7 @@ export default class hollaex extends Exchange {
483
483
  },
484
484
  },
485
485
  'networks': {},
486
+ 'type': 'crypto',
486
487
  };
487
488
  }
488
489
  return result;
package/js/src/htx.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/htx.js';
2
- import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest, OpenInterests } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest, OpenInterests, Position } from './base/types.js';
3
3
  /**
4
4
  * @class htx
5
5
  * @augments Exchange
@@ -717,7 +717,7 @@ export default class htx extends Exchange {
717
717
  id: string;
718
718
  amount: number;
719
719
  };
720
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
720
+ parsePosition(position: Dict, market?: Market): Position;
721
721
  /**
722
722
  * @method
723
723
  * @name htx#fetchPositions
@@ -733,7 +733,7 @@ export default class htx extends Exchange {
733
733
  * @param {string} [params.marginMode] *linear only* 'cross' or 'isolated'
734
734
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
735
735
  */
736
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
736
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
737
737
  /**
738
738
  * @method
739
739
  * @name htx#fetchPosition
@@ -746,7 +746,7 @@ export default class htx extends Exchange {
746
746
  * @param {object} [params] extra parameters specific to the exchange API endpoint
747
747
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
748
748
  */
749
- fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
749
+ fetchPosition(symbol: string, params?: {}): Promise<Position>;
750
750
  parseLedgerEntryType(type: any): string;
751
751
  parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
752
752
  /**
package/js/src/htx.js CHANGED
@@ -941,6 +941,7 @@ export default class htx extends Exchange {
941
941
  },
942
942
  'precisionMode': TICK_SIZE,
943
943
  'options': {
944
+ 'include_OS_certificates': false,
944
945
  'fetchMarkets': {
945
946
  'types': {
946
947
  'spot': true,
@@ -2204,7 +2205,7 @@ export default class htx extends Exchange {
2204
2205
  let ask = undefined;
2205
2206
  let askVolume = undefined;
2206
2207
  if ('bid' in ticker) {
2207
- if (Array.isArray(ticker['bid'])) {
2208
+ if (ticker['bid'] !== undefined && Array.isArray(ticker['bid'])) {
2208
2209
  bid = this.safeString(ticker['bid'], 0);
2209
2210
  bidVolume = this.safeString(ticker['bid'], 1);
2210
2211
  }
@@ -2214,7 +2215,7 @@ export default class htx extends Exchange {
2214
2215
  }
2215
2216
  }
2216
2217
  if ('ask' in ticker) {
2217
- if (Array.isArray(ticker['ask'])) {
2218
+ if (ticker['ask'] !== undefined && Array.isArray(ticker['ask'])) {
2218
2219
  ask = this.safeString(ticker['ask'], 0);
2219
2220
  askVolume = this.safeString(ticker['ask'], 1);
2220
2221
  }
@@ -3420,7 +3421,7 @@ export default class htx extends Exchange {
3420
3421
  // "withdrawQuotaPerYear": null,
3421
3422
  // "withdrawQuotaTotal": null,
3422
3423
  // "withdrawFeeType": "fixed",
3423
- // "transactFeeWithdraw": "11.1653",
3424
+ // "transactFeeWithdraw": "11.1654",
3424
3425
  // "addrWithTag": false,
3425
3426
  // "addrDepositTag": false
3426
3427
  // }
@@ -3443,6 +3444,8 @@ export default class htx extends Exchange {
3443
3444
  const chains = this.safeValue(entry, 'chains', []);
3444
3445
  const networks = {};
3445
3446
  const instStatus = this.safeString(entry, 'instStatus');
3447
+ const assetType = this.safeString(entry, 'assetType');
3448
+ const type = assetType === '1' ? 'crypto' : 'fiat';
3446
3449
  const currencyActive = instStatus === 'normal';
3447
3450
  let minPrecision = undefined;
3448
3451
  let minDeposit = undefined;
@@ -3502,6 +3505,7 @@ export default class htx extends Exchange {
3502
3505
  'withdraw': withdraw,
3503
3506
  'fee': undefined,
3504
3507
  'name': undefined,
3508
+ 'type': type,
3505
3509
  'limits': {
3506
3510
  'amount': {
3507
3511
  'min': undefined,
package/js/src/huobijp.js CHANGED
@@ -1137,6 +1137,7 @@ export default class huobijp extends Exchange {
1137
1137
  'withdraw': withdrawEnabled,
1138
1138
  'fee': undefined,
1139
1139
  'precision': precision,
1140
+ 'networks': undefined,
1140
1141
  'limits': {
1141
1142
  'amount': {
1142
1143
  'min': precision,
@@ -64,6 +64,7 @@ export default class hyperliquid extends Exchange {
64
64
  * @param {object} [params] extra parameters specific to the exchange API endpoint
65
65
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
66
66
  * @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
67
+ * @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
67
68
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
68
69
  */
69
70
  fetchBalance(params?: {}): Promise<Balances>;
@@ -365,6 +365,7 @@ export default class hyperliquid extends Exchange {
365
365
  'withdraw': undefined,
366
366
  'networks': undefined,
367
367
  'fee': undefined,
368
+ 'type': 'crypto',
368
369
  'limits': {
369
370
  'amount': {
370
371
  'min': undefined,
@@ -768,6 +769,7 @@ export default class hyperliquid extends Exchange {
768
769
  * @param {object} [params] extra parameters specific to the exchange API endpoint
769
770
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
770
771
  * @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
772
+ * @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
771
773
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
772
774
  */
773
775
  async fetchBalance(params = {}) {
@@ -775,6 +777,8 @@ export default class hyperliquid extends Exchange {
775
777
  [userAddress, params] = this.handlePublicAddress('fetchBalance', params);
776
778
  let type = undefined;
777
779
  [type, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
780
+ let marginMode = undefined;
781
+ [marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
778
782
  const isSpot = (type === 'spot');
779
783
  const reqType = (isSpot) ? 'spotClearinghouseState' : 'clearinghouseState';
780
784
  const request = {
@@ -833,12 +837,18 @@ export default class hyperliquid extends Exchange {
833
837
  return this.safeBalance(spotBalances);
834
838
  }
835
839
  const data = this.safeDict(response, 'marginSummary', {});
840
+ const usdcBalance = {
841
+ 'total': this.safeNumber(data, 'accountValue'),
842
+ };
843
+ if ((marginMode !== undefined) && (marginMode === 'isolated')) {
844
+ usdcBalance['free'] = this.safeNumber(response, 'withdrawable');
845
+ }
846
+ else {
847
+ usdcBalance['used'] = this.safeNumber(data, 'totalMarginUsed');
848
+ }
836
849
  const result = {
837
850
  'info': response,
838
- 'USDC': {
839
- 'total': this.safeNumber(data, 'accountValue'),
840
- 'used': this.safeNumber(data, 'totalMarginUsed'),
841
- },
851
+ 'USDC': usdcBalance,
842
852
  };
843
853
  const timestamp = this.safeInteger(response, 'time');
844
854
  result['timestamp'] = timestamp;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/kraken.js';
2
- import type { IndexType, Int, OrderSide, OrderType, OHLCV, Trade, Order, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, int, LedgerEntry, DepositAddress } from './base/types.js';
2
+ import type { IndexType, Int, OrderSide, OrderType, OHLCV, Trade, Order, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, int, LedgerEntry, DepositAddress, Position } from './base/types.js';
3
3
  /**
4
4
  * @class kraken
5
5
  * @augments Exchange
@@ -446,8 +446,8 @@ export default class kraken extends Exchange {
446
446
  * @param {object} [params] extra parameters specific to the exchange API endpoint
447
447
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
448
448
  */
449
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
450
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
449
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
450
+ parsePosition(position: Dict, market?: Market): Position;
451
451
  parseAccountType(account: any): string;
452
452
  /**
453
453
  * @method
package/js/src/kraken.js CHANGED
@@ -855,12 +855,14 @@ export default class kraken extends Exchange {
855
855
  const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
856
856
  // assumes all currencies are active except those listed above
857
857
  const active = this.safeString(currency, 'status') === 'enabled';
858
+ const isFiat = code.indexOf('.HOLD') >= 0;
858
859
  result[code] = {
859
860
  'id': id,
860
861
  'code': code,
861
862
  'info': currency,
862
863
  'name': this.safeString(currency, 'altname'),
863
864
  'active': active,
865
+ 'type': isFiat ? 'fiat' : 'crypto',
864
866
  'deposit': undefined,
865
867
  'withdraw': undefined,
866
868
  'fee': undefined,
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/krakenfutures.js';
2
- import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OrderRequest, Order, Balances, Str, Dict, Ticker, OrderBook, Tickers, Strings, Market, Currency, Leverage, Leverages, Num, LeverageTier, LeverageTiers, int, FundingRate, FundingRates } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OrderRequest, Order, Balances, Str, Dict, Ticker, OrderBook, Tickers, Strings, Market, Currency, Leverage, Leverages, Num, LeverageTier, LeverageTiers, int, FundingRate, FundingRates, Position } from './base/types.js';
3
3
  /**
4
4
  * @class krakenfutures
5
5
  * @augments Exchange
@@ -258,7 +258,7 @@ export default class krakenfutures extends Exchange {
258
258
  * @param {object} [params] Not used by krakenfutures
259
259
  * @returns Parsed exchange response for positions
260
260
  */
261
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
261
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
262
262
  parsePositions(response: any, symbols?: Strings, params?: {}): any[];
263
263
  parsePosition(position: Dict, market?: Market): {
264
264
  info: Dict;
@@ -1,5 +1,5 @@
1
1
  import kucoin from './abstract/kucoinfutures.js';
2
- import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Order, Trade, OrderRequest, FundingHistory, Balances, Str, Ticker, Tickers, OrderBook, Transaction, Strings, Market, Currency, Num, MarginModification, TradingFeeInterface, Dict, LeverageTier, MarginMode, Leverage, FundingRate, DepositAddress } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, OHLCV, Order, Trade, OrderRequest, FundingHistory, Balances, Str, Ticker, Tickers, OrderBook, Transaction, Strings, Market, Currency, Num, MarginModification, TradingFeeInterface, Dict, LeverageTier, MarginMode, Leverage, FundingRate, DepositAddress, Position } from './base/types.js';
3
3
  /**
4
4
  * @class kucoinfutures
5
5
  * @augments Exchange
@@ -137,7 +137,7 @@ export default class kucoinfutures extends kucoin {
137
137
  * @param {object} [params] extra parameters specific to the exchange API endpoint
138
138
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
139
139
  */
140
- fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
140
+ fetchPosition(symbol: string, params?: {}): Promise<Position>;
141
141
  /**
142
142
  * @method
143
143
  * @name kucoinfutures#fetchPositions
@@ -147,7 +147,7 @@ export default class kucoinfutures extends kucoin {
147
147
  * @param {object} [params] extra parameters specific to the exchange API endpoint
148
148
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
149
149
  */
150
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
150
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
151
151
  /**
152
152
  * @method
153
153
  * @name kucoinfutures#fetchPositionsHistory
@@ -161,8 +161,8 @@ export default class kucoinfutures extends kucoin {
161
161
  * @param {int} [params.pageId] page id
162
162
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
163
163
  */
164
- fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Position[]>;
165
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
164
+ fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
165
+ parsePosition(position: Dict, market?: Market): Position;
166
166
  /**
167
167
  * @method
168
168
  * @name kucoinfutures#createOrder
package/js/src/mexc.d.ts CHANGED
@@ -374,6 +374,7 @@ export default class mexc extends Exchange {
374
374
  parseOrderType(status: any): string;
375
375
  parseOrderStatus(status: Str): string;
376
376
  parseOrderTimeInForce(status: any): string;
377
+ getTifFromRawOrderType(orderType?: Str): string;
377
378
  fetchAccountHelper(type: any, params: any): Promise<any>;
378
379
  /**
379
380
  * @method
package/js/src/mexc.js CHANGED
@@ -1085,87 +1085,48 @@ export default class mexc extends Exchange {
1085
1085
  const id = this.safeString(currency, 'coin');
1086
1086
  const code = this.safeCurrencyCode(id);
1087
1087
  const name = this.safeString(currency, 'name');
1088
- let currencyActive = false;
1089
- let currencyFee = undefined;
1090
- let currencyWithdrawMin = undefined;
1091
- let currencyWithdrawMax = undefined;
1092
- let depositEnabled = false;
1093
- let withdrawEnabled = false;
1094
1088
  const networks = {};
1095
1089
  const chains = this.safeValue(currency, 'networkList', []);
1096
1090
  for (let j = 0; j < chains.length; j++) {
1097
1091
  const chain = chains[j];
1098
1092
  const networkId = this.safeString2(chain, 'netWork', 'network');
1099
1093
  const network = this.networkIdToCode(networkId);
1100
- const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1101
- const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
1102
- const active = (isDepositEnabled && isWithdrawEnabled);
1103
- currencyActive = active || currencyActive;
1104
- const withdrawMin = this.safeString(chain, 'withdrawMin');
1105
- const withdrawMax = this.safeString(chain, 'withdrawMax');
1106
- currencyWithdrawMin = (currencyWithdrawMin === undefined) ? withdrawMin : currencyWithdrawMin;
1107
- currencyWithdrawMax = (currencyWithdrawMax === undefined) ? withdrawMax : currencyWithdrawMax;
1108
- const fee = this.safeNumber(chain, 'withdrawFee');
1109
- currencyFee = (currencyFee === undefined) ? fee : currencyFee;
1110
- if (Precise.stringGt(currencyWithdrawMin, withdrawMin)) {
1111
- currencyWithdrawMin = withdrawMin;
1112
- }
1113
- if (Precise.stringLt(currencyWithdrawMax, withdrawMax)) {
1114
- currencyWithdrawMax = withdrawMax;
1115
- }
1116
- if (isDepositEnabled) {
1117
- depositEnabled = true;
1118
- }
1119
- if (isWithdrawEnabled) {
1120
- withdrawEnabled = true;
1121
- }
1122
1094
  networks[network] = {
1123
1095
  'info': chain,
1124
1096
  'id': networkId,
1125
1097
  'network': network,
1126
- 'active': active,
1127
- 'deposit': isDepositEnabled,
1128
- 'withdraw': isWithdrawEnabled,
1129
- 'fee': fee,
1098
+ 'active': undefined,
1099
+ 'deposit': this.safeBool(chain, 'depositEnable', false),
1100
+ 'withdraw': this.safeBool(chain, 'withdrawEnable', false),
1101
+ 'fee': this.safeNumber(chain, 'withdrawFee'),
1130
1102
  'precision': undefined,
1131
1103
  'limits': {
1132
1104
  'withdraw': {
1133
- 'min': withdrawMin,
1134
- 'max': withdrawMax,
1105
+ 'min': this.safeString(chain, 'withdrawMin'),
1106
+ 'max': this.safeString(chain, 'withdrawMax'),
1135
1107
  },
1136
1108
  },
1137
1109
  };
1138
1110
  }
1139
- const networkKeys = Object.keys(networks);
1140
- const networkKeysLength = networkKeys.length;
1141
- if ((networkKeysLength === 1) || ('NONE' in networks)) {
1142
- const defaultNetwork = this.safeValue2(networks, 'NONE', networkKeysLength - 1);
1143
- if (defaultNetwork !== undefined) {
1144
- currencyFee = defaultNetwork['fee'];
1145
- }
1146
- }
1147
- result[code] = {
1111
+ result[code] = this.safeCurrencyStructure({
1148
1112
  'info': currency,
1149
1113
  'id': id,
1150
1114
  'code': code,
1151
1115
  'name': name,
1152
- 'active': currencyActive,
1153
- 'deposit': depositEnabled,
1154
- 'withdraw': withdrawEnabled,
1155
- 'fee': currencyFee,
1116
+ 'active': undefined,
1117
+ 'deposit': undefined,
1118
+ 'withdraw': undefined,
1119
+ 'fee': undefined,
1156
1120
  'precision': undefined,
1157
1121
  'limits': {
1158
1122
  'amount': {
1159
1123
  'min': undefined,
1160
1124
  'max': undefined,
1161
1125
  },
1162
- 'withdraw': {
1163
- 'min': currencyWithdrawMin,
1164
- 'max': currencyWithdrawMax,
1165
- },
1166
1126
  },
1127
+ 'type': 'crypto',
1167
1128
  'networks': networks,
1168
- };
1129
+ });
1169
1130
  }
1170
1131
  return result;
1171
1132
  }
@@ -3423,13 +3384,27 @@ export default class mexc extends Exchange {
3423
3384
  }
3424
3385
  parseOrder(order, market = undefined) {
3425
3386
  //
3426
- // spot: createOrder
3387
+ // spot
3388
+ // createOrder
3427
3389
  //
3428
- // {
3390
+ // {
3391
+ // "symbol": "FARTCOINUSDT",
3392
+ // "orderId": "C02__342252993005723644225",
3393
+ // "orderListId": "-1",
3394
+ // "price": "1.1",
3395
+ // "origQty": "6.3",
3396
+ // "type": "IMMEDIATE_OR_CANCEL",
3397
+ // "side": "SELL",
3398
+ // "transactTime": "1745852205223"
3399
+ // }
3400
+ //
3401
+ // unknown endpoint on spot
3402
+ //
3403
+ // {
3429
3404
  // "symbol": "BTCUSDT",
3430
3405
  // "orderId": "123738410679123456",
3431
3406
  // "orderListId": -1
3432
- // }
3407
+ // }
3433
3408
  //
3434
3409
  // margin: createOrder
3435
3410
  //
@@ -3594,6 +3569,11 @@ export default class mexc extends Exchange {
3594
3569
  else {
3595
3570
  id = this.safeString2(order, 'orderId', 'id');
3596
3571
  }
3572
+ let timeInForce = this.parseOrderTimeInForce(this.safeString(order, 'timeInForce'));
3573
+ const typeRaw = this.safeString(order, 'type');
3574
+ if (timeInForce === undefined) {
3575
+ timeInForce = this.getTifFromRawOrderType(typeRaw);
3576
+ }
3597
3577
  const marketId = this.safeString(order, 'symbol');
3598
3578
  market = this.safeMarket(marketId, market);
3599
3579
  const timestamp = this.safeIntegerN(order, ['time', 'createTime', 'transactTime']);
@@ -3616,8 +3596,8 @@ export default class mexc extends Exchange {
3616
3596
  'lastTradeTimestamp': undefined,
3617
3597
  'status': this.parseOrderStatus(this.safeString2(order, 'status', 'state')),
3618
3598
  'symbol': market['symbol'],
3619
- 'type': this.parseOrderType(this.safeString(order, 'type')),
3620
- 'timeInForce': this.parseOrderTimeInForce(this.safeString(order, 'timeInForce')),
3599
+ 'type': this.parseOrderType(typeRaw),
3600
+ 'timeInForce': timeInForce,
3621
3601
  'side': this.parseOrderSide(this.safeString(order, 'side')),
3622
3602
  'price': this.safeNumber(order, 'price'),
3623
3603
  'triggerPrice': this.safeNumber2(order, 'stopPrice', 'triggerPrice'),
@@ -3646,6 +3626,9 @@ export default class mexc extends Exchange {
3646
3626
  'MARKET': 'market',
3647
3627
  'LIMIT': 'limit',
3648
3628
  'LIMIT_MAKER': 'limit',
3629
+ // on spot, during submission below types are used only accepted as limit order
3630
+ 'IMMEDIATE_OR_CANCEL': 'limit',
3631
+ 'FILL_OR_KILL': 'limit',
3649
3632
  };
3650
3633
  return this.safeString(statuses, status, status);
3651
3634
  }
@@ -3673,6 +3656,16 @@ export default class mexc extends Exchange {
3673
3656
  };
3674
3657
  return this.safeString(statuses, status, status);
3675
3658
  }
3659
+ getTifFromRawOrderType(orderType = undefined) {
3660
+ const statuses = {
3661
+ 'LIMIT': 'GTC',
3662
+ 'LIMIT_MAKER': 'POST_ONLY',
3663
+ 'IMMEDIATE_OR_CANCEL': 'IOC',
3664
+ 'FILL_OR_KILL': 'FOK',
3665
+ 'MARKET': 'IOC',
3666
+ };
3667
+ return this.safeString(statuses, orderType, orderType);
3668
+ }
3676
3669
  async fetchAccountHelper(type, params) {
3677
3670
  if (type === 'spot') {
3678
3671
  return await this.spotPrivateGetAccount(params);
package/js/src/okx.js CHANGED
@@ -5072,7 +5072,7 @@ export default class okx extends Exchange {
5072
5072
  */
5073
5073
  async fetchDepositAddress(code, params = {}) {
5074
5074
  await this.loadMarkets();
5075
- const rawNetwork = this.safeStringUpper(params, 'network');
5075
+ const rawNetwork = this.safeString(params, 'network'); // some networks are like "Dora Vota Mainnet"
5076
5076
  params = this.omit(params, 'network');
5077
5077
  code = this.safeCurrencyCode(code);
5078
5078
  const network = this.networkIdToCode(rawNetwork, code);
package/js/src/oxfun.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/oxfun.js';
2
- import type { Account, Balances, Currencies, Currency, Int, Market, Num, OHLCV, Order, OrderBook, OrderType, OrderSide, OrderRequest, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, FundingRate, FundingRates, DepositAddress, LeverageTier, LeverageTiers } from './base/types.js';
2
+ import type { Account, Balances, Currencies, Currency, Int, Market, Num, OHLCV, Order, OrderBook, OrderType, OrderSide, OrderRequest, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, FundingRate, FundingRates, DepositAddress, LeverageTier, LeverageTiers, Position } from './base/types.js';
3
3
  /**
4
4
  * @class oxfun
5
5
  * @augments Exchange
@@ -301,8 +301,8 @@ export default class oxfun extends Exchange {
301
301
  * @param {boolean} [params.subAcc]
302
302
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
303
303
  */
304
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
305
- parsePosition(position: any, market?: Market): import("./base/types.js").Position;
304
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
305
+ parsePosition(position: any, market?: Market): Position;
306
306
  /**
307
307
  * @method
308
308
  * @name oxfun#createOrder
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/phemex.js';
2
- import type { TransferEntry, Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, MarginModification, Currencies, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress, Conversion } from './base/types.js';
2
+ import type { TransferEntry, Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, MarginModification, Currencies, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress, Conversion, Position } from './base/types.js';
3
3
  /**
4
4
  * @class phemex
5
5
  * @augments Exchange
@@ -293,8 +293,8 @@ export default class phemex extends Exchange {
293
293
  * @param {string} [params.method] *USDT contracts only* 'privateGetGAccountsAccountPositions' or 'privateGetAccountsPositions' default is 'privateGetGAccountsAccountPositions'
294
294
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
295
295
  */
296
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
297
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
296
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
297
+ parsePosition(position: Dict, market?: Market): Position;
298
298
  /**
299
299
  * @method
300
300
  * @name phemex#fetchFundingHistory
package/js/src/phemex.js CHANGED
@@ -1159,7 +1159,8 @@ export default class phemex extends Exchange {
1159
1159
  },
1160
1160
  },
1161
1161
  'valueScale': valueScale,
1162
- 'networks': {},
1162
+ 'networks': undefined,
1163
+ 'type': 'crypto',
1163
1164
  };
1164
1165
  }
1165
1166
  return result;