ccxt 4.2.85 → 4.2.87

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 (99) hide show
  1. package/README.md +5 -5
  2. package/dist/ccxt.browser.js +1132 -432
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ascendex.js +11 -1
  6. package/dist/cjs/src/binance.js +14 -1
  7. package/dist/cjs/src/bingx.js +71 -20
  8. package/dist/cjs/src/bitbank.js +19 -23
  9. package/dist/cjs/src/bitfinex.js +3 -0
  10. package/dist/cjs/src/bitfinex2.js +16 -1
  11. package/dist/cjs/src/bitflyer.js +19 -0
  12. package/dist/cjs/src/bitget.js +15 -1
  13. package/dist/cjs/src/bitopro.js +3 -0
  14. package/dist/cjs/src/bitrue.js +13 -7
  15. package/dist/cjs/src/bitvavo.js +3 -0
  16. package/dist/cjs/src/btcmarkets.js +1 -1
  17. package/dist/cjs/src/btcturk.js +2 -1
  18. package/dist/cjs/src/coinex.js +576 -302
  19. package/dist/cjs/src/currencycom.js +1 -1
  20. package/dist/cjs/src/delta.js +3 -1
  21. package/dist/cjs/src/digifinex.js +4 -2
  22. package/dist/cjs/src/exmo.js +11 -12
  23. package/dist/cjs/src/gate.js +5 -2
  24. package/dist/cjs/src/hitbtc.js +26 -2
  25. package/dist/cjs/src/htx.js +2 -2
  26. package/dist/cjs/src/huobijp.js +1 -1
  27. package/dist/cjs/src/hyperliquid.js +249 -12
  28. package/dist/cjs/src/idex.js +11 -12
  29. package/dist/cjs/src/krakenfutures.js +2 -6
  30. package/dist/cjs/src/lbank.js +3 -0
  31. package/dist/cjs/src/oceanex.js +1 -1
  32. package/dist/cjs/src/okcoin.js +3 -1
  33. package/dist/cjs/src/okx.js +24 -10
  34. package/dist/cjs/src/phemex.js +3 -1
  35. package/dist/cjs/src/pro/bitget.js +1 -0
  36. package/dist/cjs/src/pro/kucoin.js +11 -6
  37. package/dist/cjs/src/wazirx.js +1 -1
  38. package/dist/cjs/src/zonda.js +3 -0
  39. package/examples/js/benchmark.js +104 -0
  40. package/examples/ts/benchmark.ts +134 -0
  41. package/js/ccxt.d.ts +1 -1
  42. package/js/ccxt.js +1 -1
  43. package/js/src/abstract/coinex.d.ts +232 -123
  44. package/js/src/ascendex.d.ts +5 -12
  45. package/js/src/ascendex.js +11 -1
  46. package/js/src/base/Exchange.d.ts +13 -13
  47. package/js/src/base/types.d.ts +11 -0
  48. package/js/src/binance.d.ts +4 -11
  49. package/js/src/binance.js +14 -1
  50. package/js/src/bingx.d.ts +5 -2
  51. package/js/src/bingx.js +71 -20
  52. package/js/src/bitbank.js +19 -23
  53. package/js/src/bitfinex.js +3 -0
  54. package/js/src/bitfinex2.d.ts +3 -17
  55. package/js/src/bitfinex2.js +16 -1
  56. package/js/src/bitflyer.d.ts +1 -0
  57. package/js/src/bitflyer.js +20 -1
  58. package/js/src/bitget.d.ts +5 -12
  59. package/js/src/bitget.js +15 -1
  60. package/js/src/bitopro.js +3 -0
  61. package/js/src/bitrue.d.ts +3 -17
  62. package/js/src/bitrue.js +13 -7
  63. package/js/src/bitvavo.js +3 -0
  64. package/js/src/btcmarkets.js +1 -1
  65. package/js/src/btcturk.js +2 -1
  66. package/js/src/coinex.d.ts +5 -12
  67. package/js/src/coinex.js +576 -302
  68. package/js/src/currencycom.js +1 -1
  69. package/js/src/delta.d.ts +5 -37
  70. package/js/src/delta.js +3 -1
  71. package/js/src/digifinex.d.ts +5 -13
  72. package/js/src/digifinex.js +4 -2
  73. package/js/src/exmo.d.ts +5 -37
  74. package/js/src/exmo.js +11 -12
  75. package/js/src/gate.d.ts +5 -33
  76. package/js/src/gate.js +5 -2
  77. package/js/src/hitbtc.d.ts +5 -12
  78. package/js/src/hitbtc.js +26 -2
  79. package/js/src/htx.js +2 -2
  80. package/js/src/huobijp.js +1 -1
  81. package/js/src/hyperliquid.d.ts +7 -4
  82. package/js/src/hyperliquid.js +249 -12
  83. package/js/src/idex.js +11 -12
  84. package/js/src/krakenfutures.js +2 -6
  85. package/js/src/kucoinfutures.d.ts +2 -2
  86. package/js/src/lbank.js +3 -0
  87. package/js/src/mexc.d.ts +3 -3
  88. package/js/src/oceanex.js +1 -1
  89. package/js/src/okcoin.js +3 -1
  90. package/js/src/okx.d.ts +5 -33
  91. package/js/src/okx.js +24 -10
  92. package/js/src/phemex.d.ts +3 -11
  93. package/js/src/phemex.js +3 -1
  94. package/js/src/pro/bitget.js +1 -0
  95. package/js/src/pro/kucoin.js +11 -6
  96. package/js/src/wazirx.js +1 -1
  97. package/js/src/zonda.js +3 -0
  98. package/package.json +3 -2
  99. package/skip-tests.json +7 -3
@@ -988,7 +988,7 @@ export default class currencycom extends Exchange {
988
988
  request['startTime'] = since;
989
989
  }
990
990
  if (limit !== undefined) {
991
- request['limit'] = limit; // default 500, max 1000
991
+ request['limit'] = Math.min(limit, 1000); // default 500, max 1000
992
992
  }
993
993
  const response = await this.publicGetV2Klines(this.extend(request, params));
994
994
  //
package/js/src/delta.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/delta.js';
2
- import type { Balances, Currency, Greeks, Int, Market, MarketInterface, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Position, Leverage, MarginMode, Num, Option } from './base/types.js';
2
+ import type { Balances, Currency, Greeks, Int, Market, MarketInterface, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Position, Leverage, MarginMode, Num, Option, MarginModification } from './base/types.js';
3
3
  /**
4
4
  * @class delta
5
5
  * @augments Exchange
@@ -115,42 +115,10 @@ export default class delta extends Exchange {
115
115
  previousFundingTimestamp: any;
116
116
  previousFundingDatetime: any;
117
117
  };
118
- addMargin(symbol: string, amount: any, params?: {}): Promise<{
119
- info: any;
120
- type: any;
121
- amount: any;
122
- total: number;
123
- code: any;
124
- symbol: string;
125
- status: any;
126
- }>;
127
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<{
128
- info: any;
129
- type: any;
130
- amount: any;
131
- total: number;
132
- code: any;
133
- symbol: string;
134
- status: any;
135
- }>;
136
- modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<{
137
- info: any;
138
- type: any;
139
- amount: any;
140
- total: number;
141
- code: any;
142
- symbol: string;
143
- status: any;
144
- }>;
145
- parseMarginModification(data: any, market?: Market): {
146
- info: any;
147
- type: any;
148
- amount: any;
149
- total: number;
150
- code: any;
151
- symbol: string;
152
- status: any;
153
- };
118
+ addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
119
+ reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
120
+ modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
121
+ parseMarginModification(data: any, market?: Market): MarginModification;
154
122
  fetchOpenInterest(symbol: string, params?: {}): Promise<import("./base/types.js").OpenInterest>;
155
123
  parseOpenInterest(interest: any, market?: Market): import("./base/types.js").OpenInterest;
156
124
  fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
package/js/src/delta.js CHANGED
@@ -2666,12 +2666,14 @@ export default class delta extends Exchange {
2666
2666
  market = this.safeMarket(marketId, market);
2667
2667
  return {
2668
2668
  'info': data,
2669
+ 'symbol': market['symbol'],
2669
2670
  'type': undefined,
2670
2671
  'amount': undefined,
2671
2672
  'total': this.safeNumber(data, 'margin'),
2672
2673
  'code': undefined,
2673
- 'symbol': market['symbol'],
2674
2674
  'status': undefined,
2675
+ 'timestamp': undefined,
2676
+ 'datetime': undefined,
2675
2677
  };
2676
2678
  }
2677
2679
  async fetchOpenInterest(symbol, params = {}) {
@@ -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 } 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 } from './base/types.js';
3
3
  /**
4
4
  * @class digifinex
5
5
  * @augments Exchange
@@ -161,18 +161,10 @@ export default class digifinex extends Exchange {
161
161
  handleMarginModeAndParams(methodName: any, params?: {}, defaultValue?: any): any[];
162
162
  fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<{}>;
163
163
  parseDepositWithdrawFees(response: any, codes?: any, currencyIdKey?: any): {};
164
- addMargin(symbol: string, amount: any, params?: {}): Promise<any>;
165
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<any>;
166
- modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<any>;
167
- parseMarginModification(data: any, market?: Market): {
168
- info: any;
169
- type: string;
170
- amount: number;
171
- total: any;
172
- code: string;
173
- symbol: string;
174
- status: any;
175
- };
164
+ addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
165
+ reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
166
+ modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
167
+ parseMarginModification(data: any, market?: Market): MarginModification;
176
168
  fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingHistory[]>;
177
169
  parseIncome(income: any, market?: Market): {
178
170
  info: any;
@@ -1508,7 +1508,7 @@ export default class digifinex extends Exchange {
1508
1508
  request['instrument_id'] = market['id'];
1509
1509
  request['granularity'] = timeframe;
1510
1510
  if (limit !== undefined) {
1511
- request['limit'] = limit;
1511
+ request['limit'] = Math.min(limit, 100);
1512
1512
  }
1513
1513
  response = await this.publicSwapGetPublicCandles(this.extend(request, params));
1514
1514
  }
@@ -4161,12 +4161,14 @@ export default class digifinex extends Exchange {
4161
4161
  const rawType = this.safeInteger(data, 'type');
4162
4162
  return {
4163
4163
  'info': data,
4164
+ 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
4164
4165
  'type': (rawType === 1) ? 'add' : 'reduce',
4165
4166
  'amount': this.safeNumber(data, 'amount'),
4166
4167
  'total': undefined,
4167
4168
  'code': market['settle'],
4168
- 'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
4169
4169
  'status': undefined,
4170
+ 'timestamp': undefined,
4171
+ 'datetime': undefined,
4170
4172
  };
4171
4173
  }
4172
4174
  async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
package/js/src/exmo.d.ts CHANGED
@@ -1,47 +1,15 @@
1
1
  import Exchange from './abstract/exmo.js';
2
- import type { Dictionary, Int, Order, OrderSide, OrderType, Trade, OrderBook, OHLCV, Balances, Str, Transaction, Ticker, Tickers, Strings, Market, Currency, Num } from './base/types.js';
2
+ import type { Dictionary, Int, Order, OrderSide, OrderType, Trade, OrderBook, OHLCV, Balances, Str, Transaction, Ticker, Tickers, Strings, Market, Currency, Num, MarginModification } from './base/types.js';
3
3
  /**
4
4
  * @class exmo
5
5
  * @augments Exchange
6
6
  */
7
7
  export default class exmo extends Exchange {
8
8
  describe(): any;
9
- modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<{
10
- info: any;
11
- type: any;
12
- amount: any;
13
- code: any;
14
- symbol: string;
15
- total: any;
16
- status: string;
17
- }>;
18
- parseMarginModification(data: any, market?: Market): {
19
- info: any;
20
- type: any;
21
- amount: any;
22
- code: any;
23
- symbol: string;
24
- total: any;
25
- status: string;
26
- };
27
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<{
28
- info: any;
29
- type: any;
30
- amount: any;
31
- code: any;
32
- symbol: string;
33
- total: any;
34
- status: string;
35
- }>;
36
- addMargin(symbol: string, amount: any, params?: {}): Promise<{
37
- info: any;
38
- type: any;
39
- amount: any;
40
- code: any;
41
- symbol: string;
42
- total: any;
43
- status: string;
44
- }>;
9
+ modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
10
+ parseMarginModification(data: any, market?: Market): MarginModification;
11
+ reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
12
+ addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
45
13
  fetchTradingFees(params?: {}): Promise<{}>;
46
14
  fetchPrivateTradingFees(params?: {}): Promise<{}>;
47
15
  fetchPublicTradingFees(params?: {}): Promise<{}>;
package/js/src/exmo.js CHANGED
@@ -265,12 +265,14 @@ export default class exmo extends Exchange {
265
265
  //
266
266
  return {
267
267
  'info': data,
268
+ 'symbol': this.safeSymbol(undefined, market),
268
269
  'type': undefined,
269
270
  'amount': undefined,
270
- 'code': this.safeValue(market, 'quote'),
271
- 'symbol': this.safeSymbol(undefined, market),
272
271
  'total': undefined,
272
+ 'code': this.safeValue(market, 'quote'),
273
273
  'status': 'ok',
274
+ 'timestamp': undefined,
275
+ 'datetime': undefined,
274
276
  };
275
277
  }
276
278
  async reduceMargin(symbol, amount, params = {}) {
@@ -863,16 +865,15 @@ export default class exmo extends Exchange {
863
865
  'symbol': market['id'],
864
866
  'resolution': this.safeString(this.timeframes, timeframe, timeframe),
865
867
  };
866
- const options = this.safeValue(this.options, 'fetchOHLCV');
867
- const maxLimit = this.safeInteger(options, 'maxLimit', 3000);
868
+ const maxLimit = 3000;
868
869
  const duration = this.parseTimeframe(timeframe);
869
870
  const now = this.milliseconds();
870
871
  if (since === undefined) {
871
872
  if (limit === undefined) {
872
873
  limit = 1000; // cap default at generous amount
873
874
  }
874
- if (limit > maxLimit) {
875
- limit = maxLimit; // avoid exception
875
+ else {
876
+ limit = Math.min(limit, maxLimit);
876
877
  }
877
878
  request['from'] = this.parseToInt(now / 1000) - limit * duration - 1;
878
879
  request['to'] = this.parseToInt(now / 1000);
@@ -880,15 +881,13 @@ export default class exmo extends Exchange {
880
881
  else {
881
882
  request['from'] = this.parseToInt(since / 1000) - 1;
882
883
  if (limit === undefined) {
883
- request['to'] = this.parseToInt(now / 1000);
884
+ limit = maxLimit;
884
885
  }
885
886
  else {
886
- if (limit > maxLimit) {
887
- throw new BadRequest(this.id + ' fetchOHLCV() will serve ' + maxLimit.toString() + ' candles at most');
888
- }
889
- const to = this.sum(since, limit * duration * 1000);
890
- request['to'] = this.parseToInt(to / 1000);
887
+ limit = Math.min(limit, maxLimit);
891
888
  }
889
+ const to = this.sum(since, limit * duration * 1000);
890
+ request['to'] = this.parseToInt(to / 1000);
892
891
  }
893
892
  const response = await this.publicGetCandlesHistory(this.extend(request, params));
894
893
  //
package/js/src/gate.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/gate.js';
2
- import type { Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OpenInterest, Order, Balances, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Leverage, Leverages, Num, OptionChain, Option } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OpenInterest, Order, Balances, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Leverage, Leverages, Num, OptionChain, Option, MarginModification } from './base/types.js';
3
3
  /**
4
4
  * @class gate
5
5
  * @augments Exchange
@@ -262,38 +262,10 @@ export default class gate extends Exchange {
262
262
  body: any;
263
263
  headers: any;
264
264
  };
265
- modifyMarginHelper(symbol: string, amount: any, params?: {}): Promise<{
266
- info: any;
267
- amount: any;
268
- code: any;
269
- symbol: string;
270
- total: number;
271
- status: string;
272
- }>;
273
- parseMarginModification(data: any, market?: Market): {
274
- info: any;
275
- amount: any;
276
- code: any;
277
- symbol: string;
278
- total: number;
279
- status: string;
280
- };
281
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<{
282
- info: any;
283
- amount: any;
284
- code: any;
285
- symbol: string;
286
- total: number;
287
- status: string;
288
- }>;
289
- addMargin(symbol: string, amount: any, params?: {}): Promise<{
290
- info: any;
291
- amount: any;
292
- code: any;
293
- symbol: string;
294
- total: number;
295
- status: string;
296
- }>;
265
+ modifyMarginHelper(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
266
+ parseMarginModification(data: any, market?: Market): MarginModification;
267
+ reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
268
+ addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
297
269
  fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
298
270
  parseOpenInterest(interest: any, market?: Market): {
299
271
  symbol: string;
package/js/src/gate.js CHANGED
@@ -6118,11 +6118,14 @@ export default class gate extends Exchange {
6118
6118
  const total = this.safeNumber(data, 'margin');
6119
6119
  return {
6120
6120
  'info': data,
6121
- 'amount': undefined,
6122
- 'code': this.safeValue(market, 'quote'),
6123
6121
  'symbol': market['symbol'],
6122
+ 'type': undefined,
6123
+ 'amount': undefined,
6124
6124
  'total': total,
6125
+ 'code': this.safeValue(market, 'quote'),
6125
6126
  'status': 'ok',
6127
+ 'timestamp': undefined,
6128
+ 'datetime': undefined,
6126
6129
  };
6127
6130
  }
6128
6131
  async reduceMargin(symbol, amount, params = {}) {
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/hitbtc.js';
2
- import type { TransferEntry, Int, OrderSide, OrderType, FundingRateHistory, OHLCV, Ticker, Order, OrderBook, Dictionary, Position, Str, Trade, Balances, Transaction, MarginMode, Tickers, Strings, Market, Currency, MarginModes, Leverage, Num } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, FundingRateHistory, OHLCV, Ticker, Order, OrderBook, Dictionary, Position, Str, Trade, Balances, Transaction, MarginMode, Tickers, Strings, Market, Currency, MarginModes, Leverage, Num, MarginModification } from './base/types.js';
3
3
  /**
4
4
  * @class hitbtc
5
5
  * @augments Exchange
@@ -132,17 +132,10 @@ export default class hitbtc extends Exchange {
132
132
  previousFundingTimestamp: any;
133
133
  previousFundingDatetime: any;
134
134
  };
135
- modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<any>;
136
- parseMarginModification(data: any, market?: Market): {
137
- info: any;
138
- type: any;
139
- amount: any;
140
- code: string;
141
- symbol: string;
142
- status: any;
143
- };
144
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<any>;
145
- addMargin(symbol: string, amount: any, params?: {}): Promise<any>;
135
+ modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
136
+ parseMarginModification(data: any, market?: Market): MarginModification;
137
+ reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
138
+ addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
146
139
  fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
147
140
  parseLeverage(leverage: any, market?: any): Leverage;
148
141
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
package/js/src/hitbtc.js CHANGED
@@ -1737,7 +1737,7 @@ export default class hitbtc extends Exchange {
1737
1737
  }
1738
1738
  [request, params] = this.handleUntilOption('till', request, params);
1739
1739
  if (limit !== undefined) {
1740
- request['limit'] = limit;
1740
+ request['limit'] = Math.min(limit, 1000);
1741
1741
  }
1742
1742
  const price = this.safeString(params, 'price');
1743
1743
  params = this.omit(params, 'price');
@@ -3295,15 +3295,39 @@ export default class hitbtc extends Exchange {
3295
3295
  });
3296
3296
  }
3297
3297
  parseMarginModification(data, market = undefined) {
3298
+ //
3299
+ // addMargin/reduceMargin
3300
+ //
3301
+ // {
3302
+ // "symbol": "BTCUSDT_PERP",
3303
+ // "type": "isolated",
3304
+ // "leverage": "8.00",
3305
+ // "created_at": "2022-03-30T23:34:27.161Z",
3306
+ // "updated_at": "2022-03-30T23:34:27.161Z",
3307
+ // "currencies": [
3308
+ // {
3309
+ // "code": "USDT",
3310
+ // "margin_balance": "7.000000000000",
3311
+ // "reserved_orders": "0",
3312
+ // "reserved_positions": "0"
3313
+ // }
3314
+ // ],
3315
+ // "positions": null
3316
+ // }
3317
+ //
3298
3318
  const currencies = this.safeValue(data, 'currencies', []);
3299
3319
  const currencyInfo = this.safeValue(currencies, 0);
3320
+ const datetime = this.safeString(data, 'updated_at');
3300
3321
  return {
3301
3322
  'info': data,
3323
+ 'symbol': market['symbol'],
3302
3324
  'type': undefined,
3303
3325
  'amount': undefined,
3326
+ 'total': undefined,
3304
3327
  'code': this.safeString(currencyInfo, 'code'),
3305
- 'symbol': market['symbol'],
3306
3328
  'status': undefined,
3329
+ 'timestamp': this.parse8601(datetime),
3330
+ 'datetime': datetime,
3307
3331
  };
3308
3332
  }
3309
3333
  async reduceMargin(symbol, amount, params = {}) {
package/js/src/htx.js CHANGED
@@ -2965,7 +2965,7 @@ export default class htx extends Exchange {
2965
2965
  const untilSeconds = (until !== undefined) ? this.parseToInt(until / 1000) : undefined;
2966
2966
  if (market['contract']) {
2967
2967
  if (limit !== undefined) {
2968
- request['size'] = limit; // when using limit: from & to are ignored
2968
+ request['size'] = Math.min(limit, 2000); // when using limit: from & to are ignored
2969
2969
  // https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-data
2970
2970
  }
2971
2971
  else {
@@ -3057,7 +3057,7 @@ export default class htx extends Exchange {
3057
3057
  [useHistorical, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'useHistoricalEndpointForSpot', true);
3058
3058
  if (!useHistorical) {
3059
3059
  if (limit !== undefined) {
3060
- request['size'] = Math.min(2000, limit); // max 2000
3060
+ request['size'] = Math.min(limit, 2000); // max 2000
3061
3061
  }
3062
3062
  response = await this.spotPublicGetMarketHistoryKline(this.extend(request, params));
3063
3063
  }
package/js/src/huobijp.js CHANGED
@@ -955,7 +955,7 @@ export default class huobijp extends Exchange {
955
955
  'period': this.safeString(this.timeframes, timeframe, timeframe),
956
956
  };
957
957
  if (limit !== undefined) {
958
- request['size'] = limit;
958
+ request['size'] = Math.min(limit, 2000);
959
959
  }
960
960
  const response = await this.marketGetHistoryKline(this.extend(request, params));
961
961
  //
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/hyperliquid.js';
2
- import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num } from './base/types.js';
2
+ import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification } from './base/types.js';
3
3
  /**
4
4
  * @class hyperliquid
5
5
  * @augments Exchange
@@ -9,6 +9,8 @@ export default class hyperliquid extends Exchange {
9
9
  setSandboxMode(enabled: any): void;
10
10
  fetchCurrencies(params?: {}): Promise<{}>;
11
11
  fetchMarkets(params?: {}): Promise<Market[]>;
12
+ fetchSwapMarkets(params?: {}): Promise<Market[]>;
13
+ fetchSpotMarkets(params?: {}): Promise<Market[]>;
12
14
  parseMarket(market: any): Market;
13
15
  fetchBalance(params?: {}): Promise<Balances>;
14
16
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
@@ -68,9 +70,10 @@ export default class hyperliquid extends Exchange {
68
70
  parsePosition(position: any, market?: Market): Position;
69
71
  setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
70
72
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
71
- addMargin(symbol: string, amount: any, params?: {}): Promise<any>;
72
- reduceMargin(symbol: string, amount: any, params?: {}): Promise<any>;
73
- modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<any>;
73
+ addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
74
+ reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
75
+ modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
76
+ parseMarginModification(data: any, market?: Market): MarginModification;
74
77
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
75
78
  withdraw(code: string, amount: any, address: any, tag?: any, params?: {}): Promise<any>;
76
79
  formatVaultAddress(address?: Str): string;