ccxt 4.5.63 → 4.5.64

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 (124) hide show
  1. package/README.md +6 -8
  2. package/dist/ccxt.browser.min.js +4 -4
  3. package/dist/cjs/ccxt.js +6 -12
  4. package/dist/cjs/src/aster.js +2 -2
  5. package/dist/cjs/src/base/Exchange.js +34 -3
  6. package/dist/cjs/src/bitget.js +5 -3
  7. package/dist/cjs/src/bitmex.js +1 -1
  8. package/dist/cjs/src/bitstamp.js +2 -1
  9. package/dist/cjs/src/bitvavo.js +1 -0
  10. package/dist/cjs/src/btcbox.js +1 -1
  11. package/dist/cjs/src/bullish.js +1 -1
  12. package/dist/cjs/src/bybiteu.js +3 -0
  13. package/dist/cjs/src/coinbase.js +3 -2
  14. package/dist/cjs/src/coinbaseinternational.js +1 -1
  15. package/dist/cjs/src/delta.js +23 -1
  16. package/dist/cjs/src/derive.js +1 -1
  17. package/dist/cjs/src/digifinex.js +12 -0
  18. package/dist/cjs/src/dydx.js +2 -2
  19. package/dist/cjs/src/extended.js +1 -1
  20. package/dist/cjs/src/gateeu.js +1 -0
  21. package/dist/cjs/src/grvt.js +1 -1
  22. package/dist/cjs/src/hashkey.js +127 -6
  23. package/dist/cjs/src/hibachi.js +20 -10
  24. package/dist/cjs/src/hyperliquid.js +1 -1
  25. package/dist/cjs/src/kraken.js +2 -0
  26. package/dist/cjs/src/kucoin.js +1 -1
  27. package/dist/cjs/src/kucoineu.js +3 -0
  28. package/dist/cjs/src/lighter.js +6 -4
  29. package/dist/cjs/src/mudrex.js +1328 -0
  30. package/dist/cjs/src/myokx.js +3 -0
  31. package/dist/cjs/src/okxus.js +1 -5
  32. package/dist/cjs/src/onetrading.js +1 -0
  33. package/dist/cjs/src/pacifica.js +1 -1
  34. package/dist/cjs/src/poloniex.js +1 -1
  35. package/dist/cjs/src/pro/bingx.js +4 -2
  36. package/dist/cjs/src/pro/bitget.js +9 -7
  37. package/dist/cjs/src/pro/grvt.js +1 -1
  38. package/dist/cjs/src/pro/hashkey.js +1 -1
  39. package/dist/cjs/src/pro/kraken.js +1 -1
  40. package/dist/cjs/src/pro/mudrex.js +226 -0
  41. package/dist/cjs/src/pro/okxus.js +1 -1
  42. package/js/ccxt.d.ts +8 -14
  43. package/js/ccxt.js +6 -10
  44. package/js/src/abstract/binance.d.ts +3 -0
  45. package/js/src/abstract/binancecoinm.d.ts +3 -0
  46. package/js/src/abstract/binanceus.d.ts +3 -0
  47. package/js/src/abstract/binanceusdm.d.ts +3 -0
  48. package/js/src/abstract/bybit.d.ts +39 -0
  49. package/js/src/abstract/bybiteu.d.ts +39 -0
  50. package/js/src/abstract/coincheck.d.ts +3 -0
  51. package/js/src/abstract/coinsph.d.ts +8 -1
  52. package/js/src/abstract/kucoineu.js +0 -6
  53. package/js/src/abstract/mudrex.d.ts +33 -0
  54. package/js/src/aster.js +2 -2
  55. package/js/src/base/Exchange.d.ts +10 -1
  56. package/js/src/base/Exchange.js +34 -3
  57. package/js/src/bitget.js +5 -3
  58. package/js/src/bitmex.js +1 -1
  59. package/js/src/bitstamp.js +2 -1
  60. package/js/src/bitvavo.js +1 -0
  61. package/js/src/btcbox.js +1 -1
  62. package/js/src/bullish.js +1 -1
  63. package/js/src/bybiteu.js +3 -0
  64. package/js/src/coinbase.js +3 -2
  65. package/js/src/coinbaseinternational.js +1 -1
  66. package/js/src/delta.d.ts +12 -0
  67. package/js/src/delta.js +23 -1
  68. package/js/src/derive.js +1 -1
  69. package/js/src/digifinex.d.ts +12 -0
  70. package/js/src/digifinex.js +12 -0
  71. package/js/src/dydx.d.ts +2 -2
  72. package/js/src/dydx.js +2 -2
  73. package/js/src/extended.js +1 -1
  74. package/js/src/gateeu.js +1 -0
  75. package/js/src/grvt.d.ts +1 -1
  76. package/js/src/grvt.js +1 -1
  77. package/js/src/hashkey.d.ts +40 -3
  78. package/js/src/hashkey.js +127 -6
  79. package/js/src/hibachi.d.ts +9 -5
  80. package/js/src/hibachi.js +20 -10
  81. package/js/src/hyperliquid.js +1 -1
  82. package/js/src/kraken.js +2 -0
  83. package/js/src/kucoin.js +1 -1
  84. package/js/src/kucoineu.js +3 -0
  85. package/js/src/lighter.js +6 -4
  86. package/js/src/mudrex.d.ts +310 -0
  87. package/js/src/mudrex.js +1321 -0
  88. package/js/src/myokx.js +3 -0
  89. package/js/src/okxus.js +1 -5
  90. package/js/src/onetrading.js +1 -0
  91. package/js/src/pacifica.js +1 -1
  92. package/js/src/poloniex.js +1 -1
  93. package/js/src/pro/bingx.js +4 -2
  94. package/js/src/pro/bitget.js +9 -7
  95. package/js/src/pro/grvt.d.ts +1 -1
  96. package/js/src/pro/grvt.js +1 -1
  97. package/js/src/pro/hashkey.d.ts +1 -1
  98. package/js/src/pro/hashkey.js +1 -1
  99. package/js/src/pro/kraken.js +1 -1
  100. package/js/src/pro/mudrex.d.ts +23 -0
  101. package/js/src/pro/mudrex.js +219 -0
  102. package/js/src/pro/okxus.js +1 -1
  103. package/package.json +3 -3
  104. package/dist/cjs/src/abstract/coinmetro.js +0 -11
  105. package/dist/cjs/src/abstract/novadax.js +0 -11
  106. package/dist/cjs/src/ascendex.js +0 -3780
  107. package/dist/cjs/src/coinmetro.js +0 -2030
  108. package/dist/cjs/src/novadax.js +0 -1678
  109. package/dist/cjs/src/pro/ascendex.js +0 -1013
  110. package/js/src/abstract/ascendex.d.ts +0 -80
  111. package/js/src/abstract/coinmetro.d.ts +0 -37
  112. package/js/src/abstract/coinmetro.js +0 -5
  113. package/js/src/abstract/novadax.d.ts +0 -32
  114. package/js/src/abstract/novadax.js +0 -5
  115. package/js/src/ascendex.d.ts +0 -436
  116. package/js/src/ascendex.js +0 -3773
  117. package/js/src/coinmetro.d.ts +0 -245
  118. package/js/src/coinmetro.js +0 -2023
  119. package/js/src/novadax.d.ts +0 -279
  120. package/js/src/novadax.js +0 -1671
  121. package/js/src/pro/ascendex.d.ts +0 -99
  122. package/js/src/pro/ascendex.js +0 -1006
  123. /package/dist/cjs/src/abstract/{ascendex.js → mudrex.js} +0 -0
  124. /package/js/src/abstract/{ascendex.js → mudrex.js} +0 -0
package/js/src/myokx.js CHANGED
@@ -43,6 +43,9 @@ export default class myokx extends okx {
43
43
  'inverse': undefined,
44
44
  },
45
45
  },
46
+ 'options': {
47
+ 'mica': true,
48
+ },
46
49
  });
47
50
  }
48
51
  }
package/js/src/okxus.js CHANGED
@@ -29,15 +29,11 @@ export default class okxus extends okx {
29
29
  'CORS': undefined,
30
30
  'spot': true,
31
31
  'margin': undefined,
32
- 'swap': false,
32
+ 'swap': true,
33
33
  'future': false,
34
34
  'option': false,
35
35
  },
36
36
  'features': {
37
- 'swap': {
38
- 'linear': undefined,
39
- 'inverse': undefined,
40
- },
41
37
  'future': {
42
38
  'linear': undefined,
43
39
  'inverse': undefined,
@@ -314,6 +314,7 @@ export default class onetrading extends Exchange {
314
314
  },
315
315
  // exchange-specific options
316
316
  'options': {
317
+ 'mica': true,
317
318
  'fetchTradingFees': {
318
319
  'method': 'fetchPrivateTradingFees', // or 'fetchPublicTradingFees'
319
320
  },
@@ -27,7 +27,7 @@ export default class pacifica extends Exchange {
27
27
  'spot': false,
28
28
  'margin': false,
29
29
  'swap': true,
30
- 'future': true,
30
+ 'future': false,
31
31
  'option': false,
32
32
  'addMargin': false,
33
33
  'borrowCrossMargin': false,
@@ -24,7 +24,7 @@ export default class poloniex extends Exchange {
24
24
  'spot': true,
25
25
  'margin': undefined, // has but not fully implemented
26
26
  'swap': true,
27
- 'future': true,
27
+ 'future': false,
28
28
  'option': false,
29
29
  'addMargin': true,
30
30
  'cancelAllOrders': true,
@@ -980,7 +980,7 @@ export default class bingx extends bingxRest {
980
980
  }
981
981
  const uuid = this.uuid();
982
982
  let baseUrl = undefined;
983
- let request = {};
983
+ let request = undefined;
984
984
  if (type === 'swap') {
985
985
  if (subType === 'inverse') {
986
986
  throw new NotSupported(this.id + ' watchOrders is not supported for inverse swap markets yet');
@@ -1093,13 +1093,15 @@ export default class bingx extends bingxRest {
1093
1093
  const swapMessageHash = 'swap:balance';
1094
1094
  const messageHash = isSpot ? spotMessageHash : swapMessageHash;
1095
1095
  const subscriptionHash = isSpot ? spotSubHash : swapSubHash;
1096
- let request = {};
1096
+ let request = undefined;
1097
1097
  let baseUrl = undefined;
1098
1098
  const uuid = this.uuid();
1099
1099
  if (type === 'swap') {
1100
1100
  if (subType === 'inverse') {
1101
1101
  throw new NotSupported(this.id + ' watchBalance is not supported for inverse swap markets yet');
1102
1102
  }
1103
+ // swap balance updates are pushed automatically over the listenKey connection,
1104
+ // so we must not send a subscription message (an empty one is rejected with 80014)
1103
1105
  baseUrl = this.safeString(this.urls['api']['ws'], subType);
1104
1106
  }
1105
1107
  else {
@@ -887,7 +887,10 @@ export default class bitget extends bitgetRest {
887
887
  storedOrderBook['datetime'] = this.iso8601(timestamp);
888
888
  const checksum = this.handleOption('watchOrderBook', 'checksum', true);
889
889
  const isSnapshot = this.safeString(message, 'action') === 'snapshot'; // snapshot does not have a checksum
890
- if (!isSnapshot && checksum) {
890
+ // UTA order books do not provide a crc32 checksum (they rely on seq/pseq for integrity),
891
+ // so only validate the checksum when the exchange actually sends one
892
+ const responseChecksum = this.safeInteger(rawOrderBook, 'checksum');
893
+ if (!isSnapshot && checksum && (responseChecksum !== undefined)) {
891
894
  const storedAsks = storedOrderBook['asks'];
892
895
  const storedBids = storedOrderBook['bids'];
893
896
  const asksLength = storedAsks.length;
@@ -905,12 +908,7 @@ export default class bitget extends bitgetRest {
905
908
  }
906
909
  const payload = payloadArray.join(':');
907
910
  const calculatedChecksum = this.crc32(payload, true);
908
- const responseChecksum = this.safeInteger(rawOrderBook, 'checksum');
909
911
  if (calculatedChecksum !== responseChecksum) {
910
- // if (messageHash in client.subscriptions) {
911
- // // delete client.subscriptions[messageHash];
912
- // // delete this.orderbooks[symbol];
913
- // }
914
912
  this.spawn(this.handleCheckSumError, client, symbol, messageHash);
915
913
  return;
916
914
  }
@@ -2699,10 +2697,14 @@ export default class bitget extends bitgetRest {
2699
2697
  //
2700
2698
  // {"event":"unsubscribe","arg":{"instType":"SPOT","channel":"books","instId":"BTCUSDT"}}
2701
2699
  //
2700
+ // UTA
2701
+ //
2702
+ // {"event":"unsubscribe","arg":{"instType":"spot","topic":"books","symbol":"BTCUSDT"}}
2703
+ //
2702
2704
  const arg = this.safeDict(message, 'arg', {});
2703
2705
  const instType = this.safeStringLower(arg, 'instType');
2704
2706
  const type = (instType === 'spot') ? 'spot' : 'contract';
2705
- const instId = this.safeString(arg, 'instId');
2707
+ const instId = this.safeString2(arg, 'instId', 'symbol');
2706
2708
  const market = this.safeMarket(instId, undefined, undefined, type);
2707
2709
  const symbol = market['symbol'];
2708
2710
  const messageHash = 'unsubscribe:orderbook:' + market['symbol'];
@@ -20,7 +20,7 @@ export default class grvt extends grvtRest {
20
20
  * @method
21
21
  * @name grvt#watchTickers
22
22
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
23
- * @see https://docs.backpack.exchange/#tag/Streams/Public/Ticker
23
+ * @see https://api-docs.grvt.io/market_data_streams/#mini-ticker-snap-feed-selector
24
24
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
25
25
  * @param {object} [params] extra parameters specific to the exchange API endpoint
26
26
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
@@ -139,7 +139,7 @@ export default class grvt extends grvtRest {
139
139
  * @method
140
140
  * @name grvt#watchTickers
141
141
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
142
- * @see https://docs.backpack.exchange/#tag/Streams/Public/Ticker
142
+ * @see https://api-docs.grvt.io/market_data_streams/#mini-ticker-snap-feed-selector
143
143
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
144
144
  * @param {object} [params] extra parameters specific to the exchange API endpoint
145
145
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
@@ -24,7 +24,7 @@ export default class hashkey extends hashkeyRest {
24
24
  parseWsOHLCV(ohlcv: any, market?: Market): OHLCV;
25
25
  /**
26
26
  * @method
27
- * @name hahskey#watchTicker
27
+ * @name hashkey#watchTicker
28
28
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
29
29
  * @see https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#public-stream
30
30
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -161,7 +161,7 @@ export default class hashkey extends hashkeyRest {
161
161
  }
162
162
  /**
163
163
  * @method
164
- * @name hahskey#watchTicker
164
+ * @name hashkey#watchTicker
165
165
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
166
166
  * @see https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#public-stream
167
167
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -626,7 +626,7 @@ export default class kraken extends krakenRest {
626
626
  const ohlcvsLength = data.length;
627
627
  for (let i = 0; i < ohlcvsLength; i++) {
628
628
  const candle = data[ohlcvsLength - i - 1];
629
- const datetime = this.safeString(candle, 'timestamp');
629
+ const datetime = this.safeString(candle, 'interval_begin');
630
630
  const timestamp = this.parse8601(datetime);
631
631
  const parsed = [
632
632
  timestamp,
@@ -0,0 +1,23 @@
1
+ import mudrexRest from '../mudrex.js';
2
+ import type { Int, OHLCV, Strings, Ticker, Tickers } from '../base/types.js';
3
+ export default class mudrex extends mudrexRest {
4
+ describe(): any;
5
+ ping(client: any): {
6
+ id: any;
7
+ method: string;
8
+ };
9
+ requestId(): any;
10
+ /**
11
+ * @ignore
12
+ * @method
13
+ * @description injects the broker Partner-Id into the websocket connection headers
14
+ */
15
+ setBrokerHeaders(): void;
16
+ watchTicker(symbol: string, params?: {}): Promise<Ticker>;
17
+ watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
18
+ watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
19
+ handleMessage(client: any, message: any): void;
20
+ handleErrorMessage(client: any, message: any): void;
21
+ handleOHLCV(client: any, message: any): void;
22
+ handleTicker(client: any, message: any): void;
23
+ }
@@ -0,0 +1,219 @@
1
+ // ---------------------------------------------------------------------------
2
+ import mudrexRest from '../mudrex.js';
3
+ import { ExchangeError, NotSupported, RateLimitExceeded } from '../base/errors.js';
4
+ import { ArrayCacheByTimestamp } from '../base/ws/Cache.js';
5
+ // ---------------------------------------------------------------------------
6
+ export default class mudrex extends mudrexRest {
7
+ describe() {
8
+ return this.deepExtend(super.describe(), {
9
+ 'has': {
10
+ 'ws': true,
11
+ 'watchOHLCV': true,
12
+ 'watchTicker': true,
13
+ 'watchTickers': true,
14
+ },
15
+ 'urls': {
16
+ 'api': {
17
+ 'ws': 'wss://trade.mudrex.com/fapi/v1/price/ws/linear',
18
+ },
19
+ },
20
+ 'options': {
21
+ 'broker': '42ce8902-8585-448c-a1e8-0371a6ca7ca8',
22
+ },
23
+ 'streaming': {
24
+ 'ping': this.ping,
25
+ 'keepAlive': 20000,
26
+ },
27
+ });
28
+ }
29
+ ping(client) {
30
+ return {
31
+ 'id': this.requestId(),
32
+ 'method': 'PING',
33
+ };
34
+ }
35
+ requestId() {
36
+ const reqid = this.sum(this.safeInteger(this.options, 'correlationId', 0), 1);
37
+ this.options['correlationId'] = reqid;
38
+ return reqid;
39
+ }
40
+ /**
41
+ * @ignore
42
+ * @method
43
+ * @description injects the broker Partner-Id into the websocket connection headers
44
+ */
45
+ setBrokerHeaders() {
46
+ const brokerId = this.safeString(this.options, 'broker');
47
+ if (brokerId === undefined) {
48
+ return;
49
+ }
50
+ const wsOptions = this.safeDict(this.options, 'ws', {});
51
+ const innerOptions = this.safeDict(wsOptions, 'options', {});
52
+ const headers = this.safeDict(innerOptions, 'headers', {});
53
+ headers['Partner-Id'] = brokerId;
54
+ innerOptions['headers'] = headers;
55
+ wsOptions['options'] = innerOptions;
56
+ this.options['ws'] = wsOptions;
57
+ }
58
+ async watchTicker(symbol, params = {}) {
59
+ await this.loadMarkets();
60
+ const market = this.market(symbol);
61
+ symbol = market['symbol'];
62
+ const messageHash = 'ticker:' + symbol;
63
+ const url = this.urls['api']['ws'];
64
+ this.setBrokerHeaders();
65
+ const subscribe = {
66
+ 'id': this.requestId(),
67
+ 'method': 'SUBSCRIBE',
68
+ 'params': ['ticker@1s'],
69
+ 'assets': [market['baseId'].toLowerCase() + market['quoteId'].toLowerCase()],
70
+ };
71
+ const request = this.extend(subscribe, params);
72
+ return await this.watch(url, messageHash, request, messageHash);
73
+ }
74
+ async watchTickers(symbols = undefined, params = {}) {
75
+ await this.loadMarkets();
76
+ symbols = this.marketSymbols(symbols);
77
+ const messageHashes = [];
78
+ const assets = [];
79
+ if (symbols !== undefined) {
80
+ for (let i = 0; i < symbols.length; i++) {
81
+ const market = this.market(symbols[i]);
82
+ messageHashes.push('ticker:' + market['symbol']);
83
+ assets.push(market['baseId'].toLowerCase() + market['quoteId'].toLowerCase());
84
+ }
85
+ }
86
+ const url = this.urls['api']['ws'];
87
+ this.setBrokerHeaders();
88
+ const subscribe = {
89
+ 'id': this.requestId(),
90
+ 'method': 'SUBSCRIBE',
91
+ 'params': ['ticker@1s'],
92
+ 'assets': assets,
93
+ };
94
+ const request = this.extend(subscribe, params);
95
+ const ticker = await this.watchMultiple(url, messageHashes, request, messageHashes);
96
+ if (this.newUpdates) {
97
+ const result = {};
98
+ result[ticker['symbol']] = ticker;
99
+ return result;
100
+ }
101
+ return this.filterByArrayTickers(this.tickers, 'symbol', symbols);
102
+ }
103
+ async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
104
+ await this.loadMarkets();
105
+ const market = this.market(symbol);
106
+ symbol = market['symbol'];
107
+ const priceType = this.safeString(params, 'price');
108
+ params = this.omit(params, 'price');
109
+ const interval = this.safeString(this.timeframes, timeframe, timeframe);
110
+ if (interval !== '1s' && interval !== '1m') {
111
+ throw new NotSupported(this.id + ' watchOHLCV() supports 1s and 1m timeframes only');
112
+ }
113
+ let prefix = 'kline';
114
+ if (priceType === 'mark') {
115
+ prefix = 'markKline';
116
+ }
117
+ const stream = prefix + '@' + interval + '@' + market['baseId'].toLowerCase() + market['quoteId'].toLowerCase();
118
+ const messageHash = stream;
119
+ const url = this.urls['api']['ws'];
120
+ this.setBrokerHeaders();
121
+ const subscribe = {
122
+ 'id': this.requestId(),
123
+ 'method': 'SUBSCRIBE',
124
+ 'params': [stream],
125
+ };
126
+ const request = this.extend(subscribe, params);
127
+ const ohlcv = await this.watch(url, messageHash, request, messageHash);
128
+ if (this.newUpdates) {
129
+ limit = ohlcv.getLimit(symbol, limit);
130
+ }
131
+ return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
132
+ }
133
+ handleMessage(client, message) {
134
+ if (this.safeString(message, 'method') === 'PONG') {
135
+ return;
136
+ }
137
+ const error = this.safeDict(message, 'error');
138
+ if (error !== undefined) {
139
+ this.handleErrorMessage(client, message);
140
+ return;
141
+ }
142
+ const stream = this.safeString(message, 'stream');
143
+ if (stream !== undefined) {
144
+ if (stream.indexOf('kline') >= 0 || stream.indexOf('markKline') >= 0) {
145
+ this.handleOHLCV(client, message);
146
+ }
147
+ else if (stream.indexOf('ticker') >= 0) {
148
+ this.handleTicker(client, message);
149
+ }
150
+ }
151
+ }
152
+ handleErrorMessage(client, message) {
153
+ const error = this.safeDict(message, 'error', {});
154
+ const code = this.safeString(error, 'code');
155
+ const msg = this.safeString(error, 'msg');
156
+ const feedback = this.id + ' ' + msg;
157
+ if (code === '429') {
158
+ throw new RateLimitExceeded(feedback);
159
+ }
160
+ throw new ExchangeError(feedback);
161
+ }
162
+ handleOHLCV(client, message) {
163
+ const stream = this.safeString(message, 'stream');
164
+ const parts = stream.split('@');
165
+ const interval = parts[1];
166
+ const tf = this.findTimeframe(interval);
167
+ const data = this.safeDict(message, 'data', {});
168
+ const s = this.safeString(data, 's');
169
+ if (s === undefined) {
170
+ return;
171
+ }
172
+ const market = this.safeMarket(s.toUpperCase());
173
+ const symbol = market['symbol'];
174
+ const parsed = [
175
+ this.safeTimestamp(data, 't'),
176
+ this.safeNumber(data, 'o'),
177
+ this.safeNumber(data, 'h'),
178
+ this.safeNumber(data, 'l'),
179
+ this.safeNumber(data, 'c'),
180
+ this.safeNumber(data, 'v'),
181
+ ];
182
+ this.ohlcvs[symbol] = this.safeValue(this.ohlcvs, symbol, {});
183
+ let stored = this.safeValue(this.ohlcvs[symbol], tf);
184
+ if (stored === undefined) {
185
+ const limit = this.safeInteger(this.options, 'OHLCVLimit', 1000);
186
+ stored = new ArrayCacheByTimestamp(limit);
187
+ this.ohlcvs[symbol][tf] = stored;
188
+ }
189
+ stored.append(parsed);
190
+ const messageHash = stream;
191
+ client.resolve(stored, messageHash);
192
+ }
193
+ handleTicker(client, message) {
194
+ const data = this.safeList(message, 'data', []);
195
+ for (let i = 0; i < data.length; i++) {
196
+ const t = data[i];
197
+ const s = this.safeString(t, 's');
198
+ if (s === undefined) {
199
+ continue;
200
+ }
201
+ const market = this.safeMarket(s.toUpperCase());
202
+ const symbol = market['symbol'];
203
+ const timestamp = this.milliseconds();
204
+ const last = this.safeNumber(t, 'p');
205
+ const result = this.safeTicker({
206
+ 'symbol': symbol,
207
+ 'timestamp': timestamp,
208
+ 'datetime': this.iso8601(timestamp),
209
+ 'last': last,
210
+ 'close': last,
211
+ 'info': t,
212
+ });
213
+ this.tickers[symbol] = result;
214
+ const messageHash = 'ticker:' + symbol;
215
+ client.resolve(result, messageHash);
216
+ client.resolve(result, 'tickers');
217
+ }
218
+ }
219
+ }
@@ -24,7 +24,7 @@ export default class okxus extends okx {
24
24
  },
25
25
  },
26
26
  'has': {
27
- 'swap': false,
27
+ 'swap': true,
28
28
  'future': false,
29
29
  'option': false,
30
30
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.5.63",
3
+ "version": "4.5.64",
4
4
  "description": "A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",
@@ -58,7 +58,7 @@
58
58
  "go": "npm run transpileGO && npm run buildGO",
59
59
  "force-build//WithoutGo": "npm run pre-transpile && npm run force-transpile-fast && npm run csharp && npm run post-transpile && npm run update-badges",
60
60
  "force-build": "npm run pre-transpile && npm run go && npm run force-transpile-fast && npm run csharp && npm run java && npm run post-transpile && npm run update-badges",
61
- "build-docs": "node jsdoc2md.js && node examples2md.js",
61
+ "build-docs": "node jsdoc2md.js && node examples2md.js && tsx build/exchange-implicit-api.ts",
62
62
  "fumadocs-content": "tsx build/wiki-to-fumadocs.ts",
63
63
  "fumadocs-regen": "npm run build-docs && tsx build/wiki-to-fumadocs.ts",
64
64
  "fumadocs-build": "npm run fumadocs-content && cd website && npm run build",
@@ -241,7 +241,7 @@
241
241
  "as-table": "^1.0.55",
242
242
  "asciichart": "^1.5.25",
243
243
  "assert": "^2.0.0",
244
- "ast-transpiler": "0.0.86",
244
+ "ast-transpiler": "0.0.90",
245
245
  "blessed": "^0.1.81",
246
246
  "clipboardy": "^5.0.0",
247
247
  "commander": "^14.0.1",
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var Exchange$1 = require('../base/Exchange.js');
6
-
7
- // -------------------------------------------------------------------------------
8
- class Exchange extends Exchange$1["default"] {
9
- }
10
-
11
- exports["default"] = Exchange;
@@ -1,11 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var Exchange$1 = require('../base/Exchange.js');
6
-
7
- // -------------------------------------------------------------------------------
8
- class Exchange extends Exchange$1["default"] {
9
- }
10
-
11
- exports["default"] = Exchange;