ccxt 4.4.2 → 4.4.4

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 (137) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +2 -2
  5. package/dist/cjs/src/base/functions/misc.js +11 -0
  6. package/dist/cjs/src/base/functions.js +1 -0
  7. package/dist/cjs/src/base/ws/WsClient.js +2 -1
  8. package/dist/cjs/src/binance.js +49 -22
  9. package/dist/cjs/src/bingx.js +1 -0
  10. package/dist/cjs/src/bitfinex2.js +7 -6
  11. package/dist/cjs/src/bitget.js +10 -6
  12. package/dist/cjs/src/bitmart.js +3 -1
  13. package/dist/cjs/src/bitmex.js +11 -10
  14. package/dist/cjs/src/bitso.js +5 -4
  15. package/dist/cjs/src/bitstamp.js +33 -45
  16. package/dist/cjs/src/blofin.js +21 -23
  17. package/dist/cjs/src/bybit.js +22 -20
  18. package/dist/cjs/src/coinbase.js +28 -7
  19. package/dist/cjs/src/coinbaseexchange.js +11 -11
  20. package/dist/cjs/src/coinlist.js +6 -5
  21. package/dist/cjs/src/coinmetro.js +3 -3
  22. package/dist/cjs/src/cryptocom.js +9 -6
  23. package/dist/cjs/src/currencycom.js +6 -6
  24. package/dist/cjs/src/delta.js +5 -5
  25. package/dist/cjs/src/digifinex.js +8 -6
  26. package/dist/cjs/src/gate.js +6 -5
  27. package/dist/cjs/src/hashkey.js +9 -7
  28. package/dist/cjs/src/htx.js +13 -16
  29. package/dist/cjs/src/hyperliquid.js +67 -114
  30. package/dist/cjs/src/kraken.js +8 -6
  31. package/dist/cjs/src/kucoin.js +9 -8
  32. package/dist/cjs/src/luno.js +10 -9
  33. package/dist/cjs/src/mexc.js +54 -2
  34. package/dist/cjs/src/ndax.js +6 -5
  35. package/dist/cjs/src/okcoin.js +18 -27
  36. package/dist/cjs/src/okx.js +18 -26
  37. package/dist/cjs/src/p2b.js +2 -2
  38. package/dist/cjs/src/pro/bybit.js +56 -0
  39. package/dist/cjs/src/pro/cryptocom.js +191 -21
  40. package/dist/cjs/src/pro/mexc.js +165 -3
  41. package/dist/cjs/src/pro/okx.js +6 -3
  42. package/dist/cjs/src/pro/oxfun.js +75 -0
  43. package/dist/cjs/src/pro/phemex.js +45 -1
  44. package/dist/cjs/src/pro/woofipro.js +67 -0
  45. package/dist/cjs/src/woo.js +7 -6
  46. package/dist/cjs/src/woofipro.js +8 -6
  47. package/dist/cjs/src/xt.js +10 -4
  48. package/dist/cjs/src/zonda.js +6 -5
  49. package/js/ccxt.d.ts +1 -1
  50. package/js/ccxt.js +1 -1
  51. package/js/src/abstract/bitmart.d.ts +1 -0
  52. package/js/src/base/Exchange.d.ts +2 -2
  53. package/js/src/base/Exchange.js +2 -2
  54. package/js/src/base/functions/misc.d.ts +2 -1
  55. package/js/src/base/functions/misc.js +11 -1
  56. package/js/src/base/types.d.ts +1 -1
  57. package/js/src/base/ws/WsClient.js +2 -2
  58. package/js/src/binance.d.ts +4 -20
  59. package/js/src/binance.js +49 -22
  60. package/js/src/bingx.js +1 -0
  61. package/js/src/bitfinex2.d.ts +3 -19
  62. package/js/src/bitfinex2.js +7 -6
  63. package/js/src/bitget.d.ts +3 -19
  64. package/js/src/bitget.js +10 -6
  65. package/js/src/bitmart.js +3 -1
  66. package/js/src/bitmex.d.ts +3 -22
  67. package/js/src/bitmex.js +11 -10
  68. package/js/src/bitso.d.ts +3 -19
  69. package/js/src/bitso.js +5 -4
  70. package/js/src/bitstamp.d.ts +3 -35
  71. package/js/src/bitstamp.js +33 -45
  72. package/js/src/blofin.d.ts +3 -15
  73. package/js/src/blofin.js +21 -23
  74. package/js/src/bybit.d.ts +3 -19
  75. package/js/src/bybit.js +23 -21
  76. package/js/src/coinbase.d.ts +3 -19
  77. package/js/src/coinbase.js +28 -7
  78. package/js/src/coinbaseexchange.d.ts +3 -19
  79. package/js/src/coinbaseexchange.js +11 -11
  80. package/js/src/coinlist.d.ts +3 -19
  81. package/js/src/coinlist.js +6 -5
  82. package/js/src/coinmetro.d.ts +3 -19
  83. package/js/src/coinmetro.js +3 -3
  84. package/js/src/cryptocom.d.ts +3 -22
  85. package/js/src/cryptocom.js +9 -6
  86. package/js/src/currencycom.d.ts +3 -3
  87. package/js/src/currencycom.js +6 -6
  88. package/js/src/delta.d.ts +3 -19
  89. package/js/src/delta.js +5 -5
  90. package/js/src/digifinex.d.ts +3 -19
  91. package/js/src/digifinex.js +8 -6
  92. package/js/src/gate.d.ts +3 -19
  93. package/js/src/gate.js +6 -5
  94. package/js/src/hashkey.d.ts +3 -20
  95. package/js/src/hashkey.js +9 -7
  96. package/js/src/htx.d.ts +3 -19
  97. package/js/src/htx.js +13 -16
  98. package/js/src/hyperliquid.d.ts +3 -19
  99. package/js/src/hyperliquid.js +68 -115
  100. package/js/src/kraken.d.ts +5 -24
  101. package/js/src/kraken.js +8 -6
  102. package/js/src/kucoin.d.ts +3 -19
  103. package/js/src/kucoin.js +9 -8
  104. package/js/src/luno.d.ts +4 -20
  105. package/js/src/luno.js +10 -9
  106. package/js/src/mexc.js +54 -2
  107. package/js/src/ndax.d.ts +3 -19
  108. package/js/src/ndax.js +6 -5
  109. package/js/src/okcoin.d.ts +3 -19
  110. package/js/src/okcoin.js +18 -27
  111. package/js/src/okx.d.ts +3 -19
  112. package/js/src/okx.js +18 -26
  113. package/js/src/p2b.js +2 -2
  114. package/js/src/pro/bybit.d.ts +2 -0
  115. package/js/src/pro/bybit.js +56 -0
  116. package/js/src/pro/cryptocom.d.ts +7 -1
  117. package/js/src/pro/cryptocom.js +191 -21
  118. package/js/src/pro/mexc.d.ts +6 -1
  119. package/js/src/pro/mexc.js +166 -4
  120. package/js/src/pro/okx.js +6 -3
  121. package/js/src/pro/oxfun.d.ts +3 -0
  122. package/js/src/pro/oxfun.js +75 -0
  123. package/js/src/pro/phemex.d.ts +2 -1
  124. package/js/src/pro/phemex.js +45 -1
  125. package/js/src/pro/woofipro.d.ts +3 -0
  126. package/js/src/pro/woofipro.js +67 -0
  127. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  128. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  129. package/js/src/woo.d.ts +3 -19
  130. package/js/src/woo.js +7 -6
  131. package/js/src/woofipro.d.ts +3 -19
  132. package/js/src/woofipro.js +8 -6
  133. package/js/src/xt.d.ts +3 -22
  134. package/js/src/xt.js +10 -4
  135. package/js/src/zonda.d.ts +3 -19
  136. package/js/src/zonda.js +6 -5
  137. package/package.json +1 -1
@@ -17,7 +17,7 @@ export default class phemex extends phemexRest {
17
17
  'has': {
18
18
  'ws': true,
19
19
  'watchTicker': true,
20
- 'watchTickers': false,
20
+ 'watchTickers': true,
21
21
  'watchTrades': true,
22
22
  'watchMyTrades': true,
23
23
  'watchOrders': true,
@@ -526,6 +526,50 @@ export default class phemex extends phemexRest {
526
526
  const request = this.deepExtend(subscribe, params);
527
527
  return await this.watch(url, messageHash, request, subscriptionHash);
528
528
  }
529
+ async watchTickers(symbols = undefined, params = {}) {
530
+ /**
531
+ * @method
532
+ * @name phemex#watchTickers
533
+ * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#subscribe-24-hours-ticker
534
+ * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#subscribe-24-hours-ticker
535
+ * @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Spot-API-en.md#subscribe-24-hours-ticker
536
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
537
+ * @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
538
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
539
+ * @param {string} [params.channel] the channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers
540
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
541
+ */
542
+ await this.loadMarkets();
543
+ symbols = this.marketSymbols(symbols, undefined, false);
544
+ const first = symbols[0];
545
+ const market = this.market(first);
546
+ const isSwap = market['swap'];
547
+ const settleIsUSDT = market['settle'] === 'USDT';
548
+ let name = 'spot_market24h';
549
+ if (isSwap) {
550
+ name = settleIsUSDT ? 'perp_market24h_pack_p' : 'market24h';
551
+ }
552
+ const url = this.urls['api']['ws'];
553
+ const requestId = this.requestId();
554
+ const subscriptionHash = name + '.subscribe';
555
+ const messageHashes = [];
556
+ for (let i = 0; i < symbols.length; i++) {
557
+ messageHashes.push('ticker:' + symbols[i]);
558
+ }
559
+ const subscribe = {
560
+ 'method': subscriptionHash,
561
+ 'id': requestId,
562
+ 'params': [],
563
+ };
564
+ const request = this.deepExtend(subscribe, params);
565
+ const ticker = await this.watchMultiple(url, messageHashes, request, messageHashes);
566
+ if (this.newUpdates) {
567
+ const result = {};
568
+ result[ticker['symbol']] = ticker;
569
+ return result;
570
+ }
571
+ return this.filterByArray(this.tickers, 'symbol', symbols);
572
+ }
529
573
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
530
574
  /**
531
575
  * @method
@@ -12,6 +12,9 @@ export default class woofipro extends woofiproRest {
12
12
  handleTicker(client: Client, message: any): any;
13
13
  watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
14
14
  handleTickers(client: Client, message: any): void;
15
+ watchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
16
+ handleBidAsk(client: Client, message: any): void;
17
+ parseWsBidAsk(ticker: any, market?: any): Ticker;
15
18
  watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
16
19
  handleOHLCV(client: Client, message: any): void;
17
20
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -24,6 +24,7 @@ export default class woofipro extends woofiproRest {
24
24
  'watchOrders': true,
25
25
  'watchTicker': true,
26
26
  'watchTickers': true,
27
+ 'watchBidsAsks': true,
27
28
  'watchTrades': true,
28
29
  'watchTradesForSymbols': false,
29
30
  'watchPositions': true,
@@ -291,6 +292,71 @@ export default class woofipro extends woofiproRest {
291
292
  }
292
293
  client.resolve(result, topic);
293
294
  }
295
+ async watchBidsAsks(symbols = undefined, params = {}) {
296
+ /**
297
+ * @method
298
+ * @name woofipro#watchBidsAsks
299
+ * @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/public/bbos
300
+ * @description watches best bid & ask for symbols
301
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
302
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
303
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
304
+ */
305
+ await this.loadMarkets();
306
+ symbols = this.marketSymbols(symbols);
307
+ const name = 'bbos';
308
+ const topic = name;
309
+ const request = {
310
+ 'event': 'subscribe',
311
+ 'topic': topic,
312
+ };
313
+ const message = this.extend(request, params);
314
+ const tickers = await this.watchPublic(topic, message);
315
+ return this.filterByArray(tickers, 'symbol', symbols);
316
+ }
317
+ handleBidAsk(client, message) {
318
+ //
319
+ // {
320
+ // "topic": "bbos",
321
+ // "ts": 1726212495000,
322
+ // "data": [
323
+ // {
324
+ // "symbol": "PERP_WOO_USDC",
325
+ // "ask": 0.16570,
326
+ // "askSize": 4224,
327
+ // "bid": 0.16553,
328
+ // "bidSize": 6645
329
+ // }
330
+ // ]
331
+ // }
332
+ //
333
+ const topic = this.safeString(message, 'topic');
334
+ const data = this.safeList(message, 'data', []);
335
+ const timestamp = this.safeInteger(message, 'ts');
336
+ const result = [];
337
+ for (let i = 0; i < data.length; i++) {
338
+ const ticker = this.parseWsBidAsk(this.extend(data[i], { 'ts': timestamp }));
339
+ this.tickers[ticker['symbol']] = ticker;
340
+ result.push(ticker);
341
+ }
342
+ client.resolve(result, topic);
343
+ }
344
+ parseWsBidAsk(ticker, market = undefined) {
345
+ const marketId = this.safeString(ticker, 'symbol');
346
+ market = this.safeMarket(marketId, market);
347
+ const symbol = this.safeString(market, 'symbol');
348
+ const timestamp = this.safeInteger(ticker, 'ts');
349
+ return this.safeTicker({
350
+ 'symbol': symbol,
351
+ 'timestamp': timestamp,
352
+ 'datetime': this.iso8601(timestamp),
353
+ 'ask': this.safeString(ticker, 'ask'),
354
+ 'askVolume': this.safeString(ticker, 'askSize'),
355
+ 'bid': this.safeString(ticker, 'bid'),
356
+ 'bidVolume': this.safeString(ticker, 'bidSize'),
357
+ 'info': ticker,
358
+ }, market);
359
+ }
294
360
  async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
295
361
  /**
296
362
  * @method
@@ -1205,6 +1271,7 @@ export default class woofipro extends woofiproRest {
1205
1271
  'algoexecutionreport': this.handleOrderUpdate,
1206
1272
  'position': this.handlePositions,
1207
1273
  'balance': this.handleBalance,
1274
+ 'bbos': this.handleBidAsk,
1208
1275
  };
1209
1276
  const event = this.safeString(message, 'event');
1210
1277
  let method = this.safeValue(methods, event);
@@ -15,7 +15,7 @@ export declare class BigInteger {
15
15
  protected intValue(): number;
16
16
  protected byteValue(): number;
17
17
  protected shortValue(): number;
18
- protected signum(): 1 | 0 | -1;
18
+ protected signum(): 0 | 1 | -1;
19
19
  toByteArray(): number[];
20
20
  protected equals(a: BigInteger): boolean;
21
21
  protected min(a: BigInteger): BigInteger;
@@ -1,5 +1,5 @@
1
1
  import { Abi, FunctionAbi, RawArgs } from '../../../types/index.js';
2
2
  import { AbiParserInterface } from './interface.js';
3
3
  export declare function createAbiParser(abi: Abi): AbiParserInterface;
4
- export declare function getAbiVersion(abi: Abi): 1 | 0 | 2;
4
+ export declare function getAbiVersion(abi: Abi): 0 | 1 | 2;
5
5
  export declare function isNoConstructorValid(method: string, argsCalldata: RawArgs, abiMethod?: FunctionAbi): boolean;
package/js/src/woo.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/woo.js';
2
- import type { TransferEntry, Balances, Conversion, Currency, FundingRateHistory, Int, Market, MarginModification, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Dict, Strings, Trade, Transaction, Leverage, Account, Currencies, TradingFees, int, FundingHistory } from './base/types.js';
2
+ import type { TransferEntry, Balances, Conversion, Currency, FundingRateHistory, Int, Market, MarginModification, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Dict, Strings, Trade, Transaction, Leverage, Account, Currencies, TradingFees, int, FundingHistory, LedgerEntry } from './base/types.js';
3
3
  /**
4
4
  * @class woo
5
5
  * @augments Exchange
@@ -61,24 +61,8 @@ export default class woo extends Exchange {
61
61
  info: any;
62
62
  }>;
63
63
  getAssetHistoryRows(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
64
- fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
65
- parseLedgerEntry(item: Dict, currency?: Currency): {
66
- id: string;
67
- currency: any;
68
- account: string;
69
- referenceAccount: any;
70
- referenceId: string;
71
- status: string;
72
- amount: number;
73
- before: any;
74
- after: any;
75
- fee: any;
76
- direction: string;
77
- timestamp: number;
78
- datetime: string;
79
- type: string;
80
- info: Dict;
81
- };
64
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
65
+ parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
82
66
  parseLedgerEntryType(type: any): string;
83
67
  getCurrencyFromChaincode(networkizedCode: any, currency: any): any;
84
68
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
package/js/src/woo.js CHANGED
@@ -2144,9 +2144,9 @@ export default class woo extends Exchange {
2144
2144
  * @name woo#fetchLedger
2145
2145
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
2146
2146
  * @see https://docs.woo.org/#get-asset-history
2147
- * @param {string} code unified currency code, default is undefined
2147
+ * @param {string} [code] unified currency code, default is undefined
2148
2148
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
2149
- * @param {int} [limit] max number of ledger entrys to return, default is undefined
2149
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
2150
2150
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2151
2151
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
2152
2152
  */
@@ -2157,12 +2157,14 @@ export default class woo extends Exchange {
2157
2157
  const networkizedCode = this.safeString(item, 'token');
2158
2158
  const currencyDefined = this.getCurrencyFromChaincode(networkizedCode, currency);
2159
2159
  const code = currencyDefined['code'];
2160
+ currency = this.safeCurrency(code, currency);
2160
2161
  const amount = this.safeNumber(item, 'amount');
2161
2162
  const side = this.safeString(item, 'token_side');
2162
2163
  const direction = (side === 'DEPOSIT') ? 'in' : 'out';
2163
2164
  const timestamp = this.safeTimestamp(item, 'created_time');
2164
2165
  const fee = this.parseTokenAndFeeTemp(item, 'fee_token', 'fee_amount');
2165
- return {
2166
+ return this.safeLedgerEntry({
2167
+ 'info': item,
2166
2168
  'id': this.safeString(item, 'id'),
2167
2169
  'currency': code,
2168
2170
  'account': this.safeString(item, 'account'),
@@ -2172,13 +2174,12 @@ export default class woo extends Exchange {
2172
2174
  'amount': amount,
2173
2175
  'before': undefined,
2174
2176
  'after': undefined,
2175
- 'fee': fee,
2176
2177
  'direction': direction,
2177
2178
  'timestamp': timestamp,
2178
2179
  'datetime': this.iso8601(timestamp),
2179
2180
  'type': this.parseLedgerEntryType(this.safeString(item, 'type')),
2180
- 'info': item,
2181
- };
2181
+ 'fee': fee,
2182
+ }, currency);
2182
2183
  }
2183
2184
  parseLedgerEntryType(type) {
2184
2185
  const types = {
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/woofipro.js';
2
- import type { Balances, Currency, FundingRateHistory, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, Transaction, Leverage, Currencies, TradingFees, OrderRequest, Dict, int } from './base/types.js';
2
+ import type { Balances, Currency, FundingRateHistory, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Trade, Transaction, Leverage, Currencies, TradingFees, OrderRequest, Dict, int, LedgerEntry } from './base/types.js';
3
3
  /**
4
4
  * @class woofipro
5
5
  * @augments Exchange
@@ -87,25 +87,9 @@ export default class woofipro extends Exchange {
87
87
  parseBalance(response: any): Balances;
88
88
  fetchBalance(params?: {}): Promise<Balances>;
89
89
  getAssetHistoryRows(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
90
- parseLedgerEntry(item: Dict, currency?: Currency): {
91
- id: string;
92
- currency: string;
93
- account: string;
94
- referenceAccount: any;
95
- referenceId: string;
96
- status: string;
97
- amount: number;
98
- before: any;
99
- after: any;
100
- fee: any;
101
- direction: string;
102
- timestamp: number;
103
- datetime: string;
104
- type: string;
105
- info: Dict;
106
- };
90
+ parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
107
91
  parseLedgerEntryType(type: any): string;
108
- fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
92
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
109
93
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
110
94
  parseTransactionStatus(status: Str): string;
111
95
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
@@ -2122,13 +2122,15 @@ export default class woofipro extends Exchange {
2122
2122
  return [currency, this.safeList(data, 'rows', [])];
2123
2123
  }
2124
2124
  parseLedgerEntry(item, currency = undefined) {
2125
- const code = this.safeString(item, 'token');
2125
+ const currencyId = this.safeString(item, 'token');
2126
+ const code = this.safeCurrencyCode(currencyId, currency);
2127
+ currency = this.safeCurrency(currencyId, currency);
2126
2128
  const amount = this.safeNumber(item, 'amount');
2127
2129
  const side = this.safeString(item, 'token_side');
2128
2130
  const direction = (side === 'DEPOSIT') ? 'in' : 'out';
2129
2131
  const timestamp = this.safeInteger(item, 'created_time');
2130
2132
  const fee = this.parseTokenAndFeeTemp(item, 'fee_token', 'fee_amount');
2131
- return {
2133
+ return this.safeLedgerEntry({
2132
2134
  'id': this.safeString(item, 'id'),
2133
2135
  'currency': code,
2134
2136
  'account': this.safeString(item, 'account'),
@@ -2144,7 +2146,7 @@ export default class woofipro extends Exchange {
2144
2146
  'datetime': this.iso8601(timestamp),
2145
2147
  'type': this.parseLedgerEntryType(this.safeString(item, 'type')),
2146
2148
  'info': item,
2147
- };
2149
+ }, currency);
2148
2150
  }
2149
2151
  parseLedgerEntryType(type) {
2150
2152
  const types = {
@@ -2157,11 +2159,11 @@ export default class woofipro extends Exchange {
2157
2159
  /**
2158
2160
  * @method
2159
2161
  * @name woofipro#fetchLedger
2160
- * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
2162
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
2161
2163
  * @see https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
2162
- * @param {string} code unified currency code, default is undefined
2164
+ * @param {string} [code] unified currency code, default is undefined
2163
2165
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
2164
- * @param {int} [limit] max number of ledger entrys to return, default is undefined
2166
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
2165
2167
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2166
2168
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
2167
2169
  */
package/js/src/xt.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/xt.js';
2
- import { Currencies, Currency, Dict, FundingHistory, FundingRateHistory, Int, LeverageTier, MarginModification, Market, Num, OHLCV, Order, OrderSide, OrderType, Str, Tickers, Transaction, TransferEntry } from './base/types.js';
2
+ import { Currencies, Currency, Dict, FundingHistory, FundingRateHistory, Int, LeverageTier, MarginModification, Market, Num, OHLCV, Order, OrderSide, OrderType, Str, Tickers, Transaction, TransferEntry, LedgerEntry } from './base/types.js';
3
3
  /**
4
4
  * @class xt
5
5
  * @augments Exchange
@@ -41,27 +41,8 @@ export default class xt extends Exchange {
41
41
  cancelOrders(ids: string[], symbol?: string, params?: {}): Promise<Order[]>;
42
42
  parseOrder(order: any, market?: any): Order;
43
43
  parseOrderStatus(status: any): string;
44
- fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
45
- parseLedgerEntry(item: any, currency?: any): {
46
- id: string;
47
- direction: string;
48
- account: any;
49
- referenceId: any;
50
- referenceAccount: any;
51
- type: string;
52
- currency: string;
53
- amount: number;
54
- timestamp: number;
55
- datetime: string;
56
- before: any;
57
- after: number;
58
- status: any;
59
- fee: {
60
- currency: any;
61
- cost: any;
62
- };
63
- info: any;
64
- };
44
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
45
+ parseLedgerEntry(item: any, currency?: any): LedgerEntry;
65
46
  parseLedgerEntryType(type: any): string;
66
47
  fetchDepositAddress(code: string, params?: {}): Promise<{
67
48
  currency: string;
package/js/src/xt.js CHANGED
@@ -1138,12 +1138,14 @@ export default class xt extends Exchange {
1138
1138
  let maxCost = undefined;
1139
1139
  let minPrice = undefined;
1140
1140
  let maxPrice = undefined;
1141
+ let amountPrecision = undefined;
1141
1142
  for (let i = 0; i < filters.length; i++) {
1142
1143
  const entry = filters[i];
1143
1144
  const filter = this.safeString(entry, 'filter');
1144
1145
  if (filter === 'QUANTITY') {
1145
1146
  minAmount = this.safeNumber(entry, 'min');
1146
1147
  maxAmount = this.safeNumber(entry, 'max');
1148
+ amountPrecision = this.safeNumber(entry, 'tickSize');
1147
1149
  }
1148
1150
  if (filter === 'QUOTE_QTY') {
1149
1151
  minCost = this.safeNumber(entry, 'min');
@@ -1153,6 +1155,9 @@ export default class xt extends Exchange {
1153
1155
  maxPrice = this.safeNumber(entry, 'max');
1154
1156
  }
1155
1157
  }
1158
+ if (amountPrecision === undefined) {
1159
+ amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
1160
+ }
1156
1161
  const underlyingType = this.safeString(market, 'underlyingType');
1157
1162
  let linear = undefined;
1158
1163
  let inverse = undefined;
@@ -1235,7 +1240,7 @@ export default class xt extends Exchange {
1235
1240
  'optionType': undefined,
1236
1241
  'precision': {
1237
1242
  'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision'))),
1238
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision'))),
1243
+ 'amount': amountPrecision,
1239
1244
  'base': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseCoinPrecision'))),
1240
1245
  'quote': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteCoinPrecision'))),
1241
1246
  },
@@ -3595,8 +3600,10 @@ export default class xt extends Exchange {
3595
3600
  const side = this.safeString(item, 'side');
3596
3601
  const direction = (side === 'ADD') ? 'in' : 'out';
3597
3602
  const currencyId = this.safeString(item, 'coin');
3603
+ currency = this.safeCurrency(currencyId, currency);
3598
3604
  const timestamp = this.safeInteger(item, 'createdTime');
3599
- return {
3605
+ return this.safeLedgerEntry({
3606
+ 'info': item,
3600
3607
  'id': this.safeString(item, 'id'),
3601
3608
  'direction': direction,
3602
3609
  'account': undefined,
@@ -3614,8 +3621,7 @@ export default class xt extends Exchange {
3614
3621
  'currency': undefined,
3615
3622
  'cost': undefined,
3616
3623
  },
3617
- 'info': item,
3618
- };
3624
+ }, currency);
3619
3625
  }
3620
3626
  parseLedgerEntryType(type) {
3621
3627
  const ledgerType = {
package/js/src/zonda.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/zonda.js';
2
- import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, Dict, int } from './base/types.js';
2
+ import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, Dict, int, LedgerEntry } from './base/types.js';
3
3
  /**
4
4
  * @class zonda
5
5
  * @augments Exchange
@@ -17,24 +17,8 @@ export default class zonda extends Exchange {
17
17
  parseTicker(ticker: Dict, market?: Market): Ticker;
18
18
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
19
19
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
20
- fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
21
- parseLedgerEntry(item: Dict, currency?: Currency): {
22
- info: Dict;
23
- id: string;
24
- direction: string;
25
- account: any;
26
- referenceId: string;
27
- referenceAccount: any;
28
- type: string;
29
- currency: string;
30
- amount: number;
31
- before: number;
32
- after: number;
33
- status: string;
34
- timestamp: number;
35
- datetime: string;
36
- fee: any;
37
- };
20
+ fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
21
+ parseLedgerEntry(item: Dict, currency?: Currency): LedgerEntry;
38
22
  parseLedgerEntryType(type: any): string;
39
23
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
40
24
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
package/js/src/zonda.js CHANGED
@@ -822,11 +822,11 @@ export default class zonda extends Exchange {
822
822
  /**
823
823
  * @method
824
824
  * @name zonda#fetchLedger
825
+ * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
825
826
  * @see https://docs.zondacrypto.exchange/reference/operations-history
826
- * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
827
- * @param {string} code unified currency code, default is undefined
827
+ * @param {string} [code] unified currency code, default is undefined
828
828
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
829
- * @param {int} [limit] max number of ledger entrys to return, default is undefined
829
+ * @param {int} [limit] max number of ledger entries to return, default is undefined
830
830
  * @param {object} [params] extra parameters specific to the exchange API endpoint
831
831
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
832
832
  */
@@ -1120,6 +1120,7 @@ export default class zonda extends Exchange {
1120
1120
  const timestamp = this.safeInteger(item, 'time');
1121
1121
  const balance = this.safeValue(item, 'balance', {});
1122
1122
  const currencyId = this.safeString(balance, 'currency');
1123
+ currency = this.safeCurrency(currencyId, currency);
1123
1124
  const change = this.safeValue(item, 'change', {});
1124
1125
  let amount = this.safeString(change, 'total');
1125
1126
  let direction = 'in';
@@ -1131,7 +1132,7 @@ export default class zonda extends Exchange {
1131
1132
  // that can be used to enrich the transfers with txid, address etc (you need to use info.detailId as a parameter)
1132
1133
  const fundsBefore = this.safeValue(item, 'fundsBefore', {});
1133
1134
  const fundsAfter = this.safeValue(item, 'fundsAfter', {});
1134
- return {
1135
+ return this.safeLedgerEntry({
1135
1136
  'info': item,
1136
1137
  'id': this.safeString(item, 'historyId'),
1137
1138
  'direction': direction,
@@ -1147,7 +1148,7 @@ export default class zonda extends Exchange {
1147
1148
  'timestamp': timestamp,
1148
1149
  'datetime': this.iso8601(timestamp),
1149
1150
  'fee': undefined,
1150
- };
1151
+ }, currency);
1151
1152
  }
1152
1153
  parseLedgerEntryType(type) {
1153
1154
  const types = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.2",
3
+ "version": "4.4.4",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",