ccxt 4.3.57 → 4.3.59

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 (82) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +4 -2
  4. package/dist/cjs/src/alpaca.js +5 -1
  5. package/dist/cjs/src/base/Exchange.js +4 -4
  6. package/dist/cjs/src/base/errors.js +22 -22
  7. package/dist/cjs/src/bigone.js +21 -1
  8. package/dist/cjs/src/bingx.js +131 -26
  9. package/dist/cjs/src/bitmart.js +1 -0
  10. package/dist/cjs/src/btcbox.js +149 -7
  11. package/dist/cjs/src/bybit.js +2 -2
  12. package/dist/cjs/src/coinmate.js +28 -35
  13. package/dist/cjs/src/coinone.js +1 -1
  14. package/dist/cjs/src/deribit.js +15 -1
  15. package/dist/cjs/src/digifinex.js +32 -7
  16. package/dist/cjs/src/gate.js +24 -18
  17. package/dist/cjs/src/htx.js +10 -8
  18. package/dist/cjs/src/hyperliquid.js +107 -1
  19. package/dist/cjs/src/kucoin.js +3 -0
  20. package/dist/cjs/src/latoken.js +5 -1
  21. package/dist/cjs/src/mexc.js +11 -11
  22. package/dist/cjs/src/okx.js +3 -0
  23. package/dist/cjs/src/pro/binance.js +11 -13
  24. package/dist/cjs/src/pro/bingx.js +11 -8
  25. package/dist/cjs/src/pro/okx.js +3 -3
  26. package/dist/cjs/src/pro/xt.js +1108 -0
  27. package/dist/cjs/src/upbit.js +148 -49
  28. package/dist/cjs/src/woo.js +1 -1
  29. package/dist/cjs/src/xt.js +72 -7
  30. package/js/ccxt.d.ts +6 -3
  31. package/js/ccxt.js +5 -3
  32. package/js/src/abstract/bitmart.d.ts +1 -0
  33. package/js/src/abstract/btcbox.d.ts +1 -0
  34. package/js/src/abstract/kucoin.d.ts +1 -0
  35. package/js/src/abstract/kucoinfutures.d.ts +1 -0
  36. package/js/src/abstract/upbit.d.ts +3 -0
  37. package/js/src/abstract/xt.d.ts +1 -0
  38. package/js/src/alpaca.d.ts +1 -1
  39. package/js/src/alpaca.js +5 -1
  40. package/js/src/base/Exchange.d.ts +3 -3
  41. package/js/src/base/Exchange.js +5 -5
  42. package/js/src/base/errorHierarchy.d.ts +5 -5
  43. package/js/src/base/errorHierarchy.js +5 -5
  44. package/js/src/base/errors.d.ts +15 -15
  45. package/js/src/base/errors.js +22 -22
  46. package/js/src/bigone.d.ts +1 -1
  47. package/js/src/bigone.js +21 -1
  48. package/js/src/bingx.js +131 -26
  49. package/js/src/bitmart.js +1 -0
  50. package/js/src/btcbox.d.ts +4 -1
  51. package/js/src/btcbox.js +149 -7
  52. package/js/src/bybit.js +2 -2
  53. package/js/src/coinmate.js +28 -35
  54. package/js/src/coinone.js +1 -1
  55. package/js/src/deribit.d.ts +1 -1
  56. package/js/src/deribit.js +15 -1
  57. package/js/src/digifinex.d.ts +3 -2
  58. package/js/src/digifinex.js +32 -7
  59. package/js/src/gate.js +24 -18
  60. package/js/src/htx.js +10 -8
  61. package/js/src/hyperliquid.d.ts +3 -1
  62. package/js/src/hyperliquid.js +107 -1
  63. package/js/src/kucoin.js +3 -0
  64. package/js/src/latoken.d.ts +1 -1
  65. package/js/src/latoken.js +5 -1
  66. package/js/src/mexc.js +11 -11
  67. package/js/src/okx.js +3 -0
  68. package/js/src/pro/binance.js +11 -13
  69. package/js/src/pro/bingx.js +11 -8
  70. package/js/src/pro/bitmart.d.ts +3 -3
  71. package/js/src/pro/bitopro.d.ts +2 -2
  72. package/js/src/pro/coincheck.d.ts +2 -2
  73. package/js/src/pro/coinone.d.ts +2 -2
  74. package/js/src/pro/hyperliquid.d.ts +2 -2
  75. package/js/src/pro/okx.js +3 -3
  76. package/js/src/pro/xt.d.ts +31 -0
  77. package/js/src/pro/xt.js +1109 -0
  78. package/js/src/upbit.d.ts +0 -1
  79. package/js/src/upbit.js +148 -49
  80. package/js/src/woo.js +2 -2
  81. package/js/src/xt.js +72 -7
  82. package/package.json +1 -1
@@ -63,7 +63,7 @@ class btcbox extends btcbox$1 {
63
63
  'fetchPositionsRisk': false,
64
64
  'fetchPremiumIndexOHLCV': false,
65
65
  'fetchTicker': true,
66
- 'fetchTickers': false,
66
+ 'fetchTickers': true,
67
67
  'fetchTrades': true,
68
68
  'fetchTransfer': false,
69
69
  'fetchTransfers': false,
@@ -92,6 +92,7 @@ class btcbox extends btcbox$1 {
92
92
  'depth',
93
93
  'orders',
94
94
  'ticker',
95
+ 'tickers',
95
96
  ],
96
97
  },
97
98
  'private': {
@@ -105,12 +106,6 @@ class btcbox extends btcbox$1 {
105
106
  ],
106
107
  },
107
108
  },
108
- 'markets': {
109
- 'BTC/JPY': this.safeMarketStructure({ 'id': 'btc', 'symbol': 'BTC/JPY', 'base': 'BTC', 'quote': 'JPY', 'baseId': 'btc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0005'), 'maker': this.parseNumber('0.0005'), 'type': 'spot', 'spot': true }),
110
- 'ETH/JPY': this.safeMarketStructure({ 'id': 'eth', 'symbol': 'ETH/JPY', 'base': 'ETH', 'quote': 'JPY', 'baseId': 'eth', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
111
- 'LTC/JPY': this.safeMarketStructure({ 'id': 'ltc', 'symbol': 'LTC/JPY', 'base': 'LTC', 'quote': 'JPY', 'baseId': 'ltc', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
112
- 'BCH/JPY': this.safeMarketStructure({ 'id': 'bch', 'symbol': 'BCH/JPY', 'base': 'BCH', 'quote': 'JPY', 'baseId': 'bch', 'quoteId': 'jpy', 'taker': this.parseNumber('0.0010'), 'maker': this.parseNumber('0.0010'), 'type': 'spot', 'spot': true }),
113
- },
114
109
  'precisionMode': number.TICK_SIZE,
115
110
  'exceptions': {
116
111
  '104': errors.AuthenticationError,
@@ -126,6 +121,140 @@ class btcbox extends btcbox$1 {
126
121
  },
127
122
  });
128
123
  }
124
+ async fetchMarkets(params = {}) {
125
+ /**
126
+ * @method
127
+ * @name btcbox#fetchMarkets
128
+ * @description retrieves data on all markets for ace
129
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
130
+ * @returns {object[]} an array of objects representing market data
131
+ */
132
+ const response = await this.publicGetTickers();
133
+ //
134
+ const marketIds = Object.keys(response);
135
+ const markets = [];
136
+ for (let i = 0; i < marketIds.length; i++) {
137
+ const marketId = marketIds[i];
138
+ const symbolParts = marketId.split('_');
139
+ const baseCurr = this.safeString(symbolParts, 0);
140
+ const quote = this.safeString(symbolParts, 1);
141
+ const quoteId = quote.toLowerCase();
142
+ const id = baseCurr.toLowerCase();
143
+ const res = response[marketId];
144
+ const symbol = baseCurr + '/' + quote;
145
+ const fee = (id === 'BTC') ? this.parseNumber('0.0005') : this.parseNumber('0.0010');
146
+ markets.push(this.safeMarketStructure({
147
+ 'id': id,
148
+ 'uppercaseId': undefined,
149
+ 'symbol': symbol,
150
+ 'base': baseCurr,
151
+ 'baseId': id,
152
+ 'quote': quote,
153
+ 'quoteId': quoteId,
154
+ 'settle': undefined,
155
+ 'settleId': undefined,
156
+ 'type': 'spot',
157
+ 'spot': true,
158
+ 'margin': false,
159
+ 'swap': false,
160
+ 'future': false,
161
+ 'option': false,
162
+ 'taker': fee,
163
+ 'maker': fee,
164
+ 'contract': false,
165
+ 'linear': undefined,
166
+ 'inverse': undefined,
167
+ 'contractSize': undefined,
168
+ 'expiry': undefined,
169
+ 'expiryDatetime': undefined,
170
+ 'strike': undefined,
171
+ 'optionType': undefined,
172
+ 'limits': {
173
+ 'amount': {
174
+ 'min': undefined,
175
+ 'max': undefined,
176
+ },
177
+ 'price': {
178
+ 'min': undefined,
179
+ 'max': undefined,
180
+ },
181
+ 'cost': {
182
+ 'min': undefined,
183
+ 'max': undefined,
184
+ },
185
+ 'leverage': {
186
+ 'min': undefined,
187
+ 'max': undefined,
188
+ },
189
+ },
190
+ 'precision': {
191
+ 'price': undefined,
192
+ 'amount': undefined,
193
+ },
194
+ 'active': undefined,
195
+ 'created': undefined,
196
+ 'info': res,
197
+ }));
198
+ }
199
+ return markets;
200
+ }
201
+ parseMarket(market) {
202
+ const baseId = this.safeString(market, 'base');
203
+ const base = this.safeCurrencyCode(baseId);
204
+ const quoteId = this.safeString(market, 'quote');
205
+ const quote = this.safeCurrencyCode(quoteId);
206
+ const symbol = base + '/' + quote;
207
+ return {
208
+ 'id': this.safeString(market, 'symbol'),
209
+ 'uppercaseId': undefined,
210
+ 'symbol': symbol,
211
+ 'base': base,
212
+ 'baseId': baseId,
213
+ 'quote': quote,
214
+ 'quoteId': quoteId,
215
+ 'settle': undefined,
216
+ 'settleId': undefined,
217
+ 'type': 'spot',
218
+ 'spot': true,
219
+ 'margin': false,
220
+ 'swap': false,
221
+ 'future': false,
222
+ 'option': false,
223
+ 'contract': false,
224
+ 'linear': undefined,
225
+ 'inverse': undefined,
226
+ 'contractSize': undefined,
227
+ 'expiry': undefined,
228
+ 'expiryDatetime': undefined,
229
+ 'strike': undefined,
230
+ 'optionType': undefined,
231
+ 'limits': {
232
+ 'amount': {
233
+ 'min': this.safeNumber(market, 'minLimitBaseAmount'),
234
+ 'max': this.safeNumber(market, 'maxLimitBaseAmount'),
235
+ },
236
+ 'price': {
237
+ 'min': undefined,
238
+ 'max': undefined,
239
+ },
240
+ 'cost': {
241
+ 'min': undefined,
242
+ 'max': undefined,
243
+ },
244
+ 'leverage': {
245
+ 'min': undefined,
246
+ 'max': undefined,
247
+ },
248
+ },
249
+ 'precision': {
250
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quotePrecision'))),
251
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'basePrecision'))),
252
+ },
253
+ 'active': undefined,
254
+ 'created': undefined,
255
+ 'info': market,
256
+ };
257
+ }
129
258
  parseBalance(response) {
130
259
  const result = { 'info': response };
131
260
  const codes = Object.keys(this.currencies);
@@ -224,6 +353,19 @@ class btcbox extends btcbox$1 {
224
353
  const response = await this.publicGetTicker(this.extend(request, params));
225
354
  return this.parseTicker(response, market);
226
355
  }
356
+ async fetchTickers(symbols = undefined, params = {}) {
357
+ /**
358
+ * @method
359
+ * @name btcbox#fetchTickers
360
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
361
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
362
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
363
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
364
+ */
365
+ await this.loadMarkets();
366
+ const response = await this.publicGetTickers(params);
367
+ return this.parseTickers(response, symbols);
368
+ }
227
369
  parseTrade(trade, market = undefined) {
228
370
  //
229
371
  // fetchTrades (public)
@@ -3332,13 +3332,13 @@ class bybit extends bybit$1 {
3332
3332
  if (code !== undefined) {
3333
3333
  if (code !== '0') {
3334
3334
  const category = this.safeString(order, 'category');
3335
- const inferedMarketType = (category === 'spot') ? 'spot' : 'contract';
3335
+ const inferredMarketType = (category === 'spot') ? 'spot' : 'contract';
3336
3336
  return this.safeOrder({
3337
3337
  'info': order,
3338
3338
  'status': 'rejected',
3339
3339
  'id': this.safeString(order, 'orderId'),
3340
3340
  'clientOrderId': this.safeString(order, 'orderLinkId'),
3341
- 'symbol': this.safeSymbol(this.safeString(order, 'symbol'), undefined, undefined, inferedMarketType),
3341
+ 'symbol': this.safeSymbol(this.safeString(order, 'symbol'), undefined, undefined, inferredMarketType),
3342
3342
  });
3343
3343
  }
3344
3344
  }
@@ -18,7 +18,7 @@ class coinmate extends coinmate$1 {
18
18
  'id': 'coinmate',
19
19
  'name': 'CoinMate',
20
20
  'countries': ['GB', 'CZ', 'EU'],
21
- 'rateLimit': 1000,
21
+ 'rateLimit': 600,
22
22
  'has': {
23
23
  'CORS': true,
24
24
  'spot': true,
@@ -167,28 +167,28 @@ class coinmate extends coinmate$1 {
167
167
  'trading': {
168
168
  'tierBased': true,
169
169
  'percentage': true,
170
- 'maker': this.parseNumber('0.0012'),
171
- 'taker': this.parseNumber('0.0025'),
170
+ 'taker': this.parseNumber('0.006'),
171
+ 'maker': this.parseNumber('0.004'),
172
172
  'tiers': {
173
173
  'taker': [
174
- [this.parseNumber('0'), this.parseNumber('0.0035')],
175
- [this.parseNumber('10000'), this.parseNumber('0.0023')],
176
- [this.parseNumber('100000'), this.parseNumber('0.0021')],
177
- [this.parseNumber('250000'), this.parseNumber('0.0020')],
178
- [this.parseNumber('500000'), this.parseNumber('0.0015')],
179
- [this.parseNumber('1000000'), this.parseNumber('0.0013')],
180
- [this.parseNumber('3000000'), this.parseNumber('0.0010')],
181
- [this.parseNumber('15000000'), this.parseNumber('0.0005')],
174
+ [this.parseNumber('0'), this.parseNumber('0.006')],
175
+ [this.parseNumber('10000'), this.parseNumber('0.003')],
176
+ [this.parseNumber('100000'), this.parseNumber('0.0023')],
177
+ [this.parseNumber('250000'), this.parseNumber('0.0021')],
178
+ [this.parseNumber('500000'), this.parseNumber('0.0018')],
179
+ [this.parseNumber('1000000'), this.parseNumber('0.0015')],
180
+ [this.parseNumber('3000000'), this.parseNumber('0.0012')],
181
+ [this.parseNumber('15000000'), this.parseNumber('0.001')],
182
182
  ],
183
183
  'maker': [
184
- [this.parseNumber('0'), this.parseNumber('0.003')],
185
- [this.parseNumber('10000'), this.parseNumber('0.0011')],
186
- [this.parseNumber('100000'), this.parseNumber('0.0010')],
187
- [this.parseNumber('250000'), this.parseNumber('0.0008')],
184
+ [this.parseNumber('0'), this.parseNumber('0.004')],
185
+ [this.parseNumber('10000'), this.parseNumber('0.002')],
186
+ [this.parseNumber('100000'), this.parseNumber('0.0012')],
187
+ [this.parseNumber('250000'), this.parseNumber('0.0009')],
188
188
  [this.parseNumber('500000'), this.parseNumber('0.0005')],
189
189
  [this.parseNumber('1000000'), this.parseNumber('0.0003')],
190
190
  [this.parseNumber('3000000'), this.parseNumber('0.0002')],
191
- [this.parseNumber('15000000'), this.parseNumber('0')],
191
+ [this.parseNumber('15000000'), this.parseNumber('-0.0004')],
192
192
  ],
193
193
  },
194
194
  },
@@ -1093,26 +1093,19 @@ class coinmate extends coinmate$1 {
1093
1093
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
1094
1094
  }
1095
1095
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
1096
- if (response !== undefined) {
1097
- if ('error' in response) {
1098
- // {"error":true,"errorMessage":"Minimum Order Size 0.01 ETH","data":null}
1099
- if (response['error']) {
1100
- const message = this.safeString(response, 'errorMessage');
1101
- const feedback = this.id + ' ' + message;
1102
- this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
1103
- this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
1104
- throw new errors.ExchangeError(this.id + ' ' + this.json(response));
1105
- }
1106
- }
1096
+ if (response === undefined) {
1097
+ return undefined; // fallback to default error handler
1107
1098
  }
1108
- if (code > 400) {
1109
- if (body) {
1110
- const feedback = this.id + ' ' + body;
1111
- this.throwExactlyMatchedException(this.exceptions['exact'], body, feedback);
1112
- this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
1113
- throw new errors.ExchangeError(feedback); // unknown message
1114
- }
1115
- throw new errors.ExchangeError(this.id + ' ' + body);
1099
+ //
1100
+ // {"error":true,"errorMessage":"Api internal error","data":null}
1101
+ // {"error":true,"errorMessage":"Access denied.","data":null}
1102
+ //
1103
+ const errorMessage = this.safeString(response, 'errorMessage');
1104
+ if (errorMessage !== undefined) {
1105
+ const feedback = this.id + ' ' + body;
1106
+ this.throwExactlyMatchedException(this.exceptions['exact'], errorMessage, feedback);
1107
+ this.throwBroadlyMatchedException(this.exceptions['broad'], errorMessage, feedback);
1108
+ throw new errors.ExchangeError(feedback); // unknown message
1116
1109
  }
1117
1110
  return undefined;
1118
1111
  }
@@ -1170,7 +1170,7 @@ class coinone extends coinone$1 {
1170
1170
  // {"result":"error","error_code":"108","error_msg":"Unknown CryptoCurrency"}
1171
1171
  //
1172
1172
  const errorCode = this.safeString(response, 'error_code');
1173
- if (errorCode !== '0') {
1173
+ if (errorCode !== undefined && errorCode !== '0') {
1174
1174
  const feedback = this.id + ' ' + body;
1175
1175
  this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);
1176
1176
  throw new errors.ExchangeError(feedback); // unknown message
@@ -2125,7 +2125,21 @@ class deribit extends deribit$1 {
2125
2125
  request['instrument_name'] = market['id'];
2126
2126
  response = await this.privateGetCancelAllByInstrument(this.extend(request, params));
2127
2127
  }
2128
- return response;
2128
+ //
2129
+ // {
2130
+ // jsonrpc: '2.0',
2131
+ // result: '1',
2132
+ // usIn: '1720508354127369',
2133
+ // usOut: '1720508354133603',
2134
+ // usDiff: '6234',
2135
+ // testnet: true
2136
+ // }
2137
+ //
2138
+ return [
2139
+ this.safeOrder({
2140
+ 'info': response,
2141
+ }),
2142
+ ];
2129
2143
  }
2130
2144
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2131
2145
  /**
@@ -1932,8 +1932,38 @@ class digifinex extends digifinex$1 {
1932
1932
  if (numCanceledOrders !== 1) {
1933
1933
  throw new errors.OrderNotFound(this.id + ' cancelOrder() ' + id + ' not found');
1934
1934
  }
1935
+ const orders = this.parseCancelOrders(response);
1936
+ return this.safeDict(orders, 0);
1935
1937
  }
1936
- return response;
1938
+ else {
1939
+ return this.safeOrder({
1940
+ 'info': response,
1941
+ 'orderId': this.safeString(response, 'data'),
1942
+ });
1943
+ }
1944
+ }
1945
+ parseCancelOrders(response) {
1946
+ const success = this.safeList(response, 'success');
1947
+ const error = this.safeList(response, 'error');
1948
+ const result = [];
1949
+ for (let i = 0; i < success.length; i++) {
1950
+ const order = success[i];
1951
+ result.push(this.safeOrder({
1952
+ 'info': order,
1953
+ 'id': order,
1954
+ 'status': 'canceled',
1955
+ }));
1956
+ }
1957
+ for (let i = 0; i < error.length; i++) {
1958
+ const order = error[i];
1959
+ result.push(this.safeOrder({
1960
+ 'info': order,
1961
+ 'id': this.safeString2(order, 'order-id', 'order_id'),
1962
+ 'status': 'failed',
1963
+ 'clientOrderId': this.safeString(order, 'client-order-id'),
1964
+ }));
1965
+ }
1966
+ return result;
1937
1967
  }
1938
1968
  async cancelOrders(ids, symbol = undefined, params = {}) {
1939
1969
  /**
@@ -1966,12 +1996,7 @@ class digifinex extends digifinex$1 {
1966
1996
  // ]
1967
1997
  // }
1968
1998
  //
1969
- const canceledOrders = this.safeValue(response, 'success', []);
1970
- const numCanceledOrders = canceledOrders.length;
1971
- if (numCanceledOrders < 1) {
1972
- throw new errors.OrderNotFound(this.id + ' cancelOrders() error');
1973
- }
1974
- return response;
1999
+ return this.parseCancelOrders(response);
1975
2000
  }
1976
2001
  parseOrderStatus(status) {
1977
2002
  const statuses = {
@@ -594,21 +594,21 @@ class gate extends gate$1 {
594
594
  // copied from gatev2
595
595
  'commonCurrencies': {
596
596
  '88MPH': 'MPH',
597
- 'AXIS': 'Axis DeFi',
598
- 'BIFI': 'Bitcoin File',
599
- 'BOX': 'DefiBox',
600
- 'BYN': 'BeyondFi',
601
- 'EGG': 'Goose Finance',
602
- 'GTC': 'Game.com',
603
- 'GTC_HT': 'Game.com HT',
604
- 'GTC_BSC': 'Game.com BSC',
605
- 'HIT': 'HitChain',
606
- 'MM': 'Million',
607
- 'MPH': 'Morpher',
608
- 'POINT': 'GatePoint',
609
- 'RAI': 'Rai Reflex Index',
610
- 'SBTC': 'Super Bitcoin',
611
- 'TNC': 'Trinity Network Credit',
597
+ 'AXIS': 'AXISDEFI',
598
+ 'BIFI': 'BITCOINFILE',
599
+ 'BOX': 'DEFIBOX',
600
+ 'BYN': 'BEYONDFI',
601
+ 'EGG': 'GOOSEFINANCE',
602
+ 'GTC': 'GAMECOM',
603
+ 'GTC_HT': 'GAMECOM_HT',
604
+ 'GTC_BSC': 'GAMECOM_BSC',
605
+ 'HIT': 'HITCHAIN',
606
+ 'MM': 'MILLION',
607
+ 'MPH': 'MORPHER',
608
+ 'POINT': 'GATEPOINT',
609
+ 'RAI': 'RAIREFLEXINDEX',
610
+ 'SBTC': 'SUPERBITCOIN',
611
+ 'TNC': 'TRINITYNETWORKCREDIT',
612
612
  'VAI': 'VAIOT',
613
613
  'TRAC': 'TRACO', // conflict with OriginTrail (TRAC)
614
614
  },
@@ -4019,7 +4019,7 @@ class gate extends gate$1 {
4019
4019
  request['price'] = price; // set to 0 for market orders
4020
4020
  }
4021
4021
  else {
4022
- request['price'] = this.priceToPrecision(symbol, price);
4022
+ request['price'] = (price === 0) ? '0' : this.priceToPrecision(symbol, price);
4023
4023
  }
4024
4024
  if (reduceOnly !== undefined) {
4025
4025
  request['reduce_only'] = reduceOnly;
@@ -4110,8 +4110,8 @@ class gate extends gate$1 {
4110
4110
  request = {
4111
4111
  'initial': {
4112
4112
  'contract': market['id'],
4113
- 'size': amount,
4114
- 'price': this.priceToPrecision(symbol, price), // set to 0 to use market price
4113
+ 'size': amount, // positive = buy, negative = sell, set to 0 to close the position
4114
+ // 'price': (price === 0) ? '0' : this.priceToPrecision (symbol, price), // set to 0 to use market price
4115
4115
  // 'close': false, // set to true if trying to close the position
4116
4116
  // 'tif': 'gtc', // gtc, ioc, if using market price, only ioc is supported
4117
4117
  // 'text': clientOrderId, // web, api, app
@@ -4119,6 +4119,12 @@ class gate extends gate$1 {
4119
4119
  },
4120
4120
  'settle': market['settleId'],
4121
4121
  };
4122
+ if (type === 'market') {
4123
+ request['initial']['price'] = '0';
4124
+ }
4125
+ else {
4126
+ request['initial']['price'] = (price === 0) ? '0' : this.priceToPrecision(symbol, price);
4127
+ }
4122
4128
  if (trigger === undefined) {
4123
4129
  let rule = undefined;
4124
4130
  let triggerOrderPrice = undefined;
@@ -1218,17 +1218,17 @@ class htx extends htx$1 {
1218
1218
  // https://github.com/ccxt/ccxt/issues/6081
1219
1219
  // https://github.com/ccxt/ccxt/issues/3365
1220
1220
  // https://github.com/ccxt/ccxt/issues/2873
1221
- 'GET': 'Themis',
1222
- 'GTC': 'Game.com',
1223
- 'HIT': 'HitChain',
1221
+ 'GET': 'THEMIS',
1222
+ 'GTC': 'GAMECOM',
1223
+ 'HIT': 'HITCHAIN',
1224
1224
  // https://github.com/ccxt/ccxt/issues/7399
1225
1225
  // https://coinmarketcap.com/currencies/pnetwork/
1226
1226
  // https://coinmarketcap.com/currencies/penta/markets/
1227
1227
  // https://en.cryptonomist.ch/blog/eidoo/the-edo-to-pnt-upgrade-what-you-need-to-know-updated/
1228
- 'PNT': 'Penta',
1229
- 'SBTC': 'Super Bitcoin',
1230
- 'SOUL': 'Soulsaver',
1231
- 'BIFI': 'Bitcoin File', // conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
1228
+ 'PNT': 'PENTA',
1229
+ 'SBTC': 'SUPERBITCOIN',
1230
+ 'SOUL': 'SOULSAVER',
1231
+ 'BIFI': 'BITCOINFILE', // conflict with Beefy.Finance https://github.com/ccxt/ccxt/issues/8706
1232
1232
  },
1233
1233
  });
1234
1234
  }
@@ -3230,6 +3230,7 @@ class htx extends htx$1 {
3230
3230
  const instStatus = this.safeString(entry, 'instStatus');
3231
3231
  const currencyActive = instStatus === 'normal';
3232
3232
  let minPrecision = undefined;
3233
+ let minDeposit = undefined;
3233
3234
  let minWithdraw = undefined;
3234
3235
  let maxWithdraw = undefined;
3235
3236
  let deposit = false;
@@ -3241,6 +3242,7 @@ class htx extends htx$1 {
3241
3242
  this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
3242
3243
  this.options['networkNamesByChainIds'][uniqueChainId] = title;
3243
3244
  const networkCode = this.networkIdToCode(uniqueChainId);
3245
+ minDeposit = this.safeNumber(chainEntry, 'minDepositAmt');
3244
3246
  minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
3245
3247
  maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
3246
3248
  const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
@@ -3261,7 +3263,7 @@ class htx extends htx$1 {
3261
3263
  'network': networkCode,
3262
3264
  'limits': {
3263
3265
  'deposit': {
3264
- 'min': undefined,
3266
+ 'min': minDeposit,
3265
3267
  'max': undefined,
3266
3268
  },
3267
3269
  'withdraw': {
@@ -98,7 +98,7 @@ class hyperliquid extends hyperliquid$1 {
98
98
  'fetchTickers': false,
99
99
  'fetchTime': false,
100
100
  'fetchTrades': true,
101
- 'fetchTradingFee': false,
101
+ 'fetchTradingFee': true,
102
102
  'fetchTradingFees': false,
103
103
  'fetchTransfer': false,
104
104
  'fetchTransfers': false,
@@ -2516,6 +2516,112 @@ class hyperliquid extends hyperliquid$1 {
2516
2516
  'fee': undefined,
2517
2517
  };
2518
2518
  }
2519
+ async fetchTradingFee(symbol, params = {}) {
2520
+ /**
2521
+ * @method
2522
+ * @name hyperliquid#fetchTradingFee
2523
+ * @description fetch the trading fees for a market
2524
+ * @param {string} symbol unified market symbol
2525
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2526
+ * @param {string} [params.user] user address, will default to this.walletAddress if not provided
2527
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
2528
+ */
2529
+ await this.loadMarkets();
2530
+ let userAddress = undefined;
2531
+ [userAddress, params] = this.handlePublicAddress('fetchTradingFee', params);
2532
+ const market = this.market(symbol);
2533
+ const request = {
2534
+ 'type': 'userFees',
2535
+ 'user': userAddress,
2536
+ };
2537
+ const response = await this.publicPostInfo(this.extend(request, params));
2538
+ //
2539
+ // {
2540
+ // "dailyUserVlm": [
2541
+ // {
2542
+ // "date": "2024-07-08",
2543
+ // "userCross": "0.0",
2544
+ // "userAdd": "0.0",
2545
+ // "exchange": "90597185.23639999"
2546
+ // }
2547
+ // ],
2548
+ // "feeSchedule": {
2549
+ // "cross": "0.00035",
2550
+ // "add": "0.0001",
2551
+ // "tiers": {
2552
+ // "vip": [
2553
+ // {
2554
+ // "ntlCutoff": "5000000.0",
2555
+ // "cross": "0.0003",
2556
+ // "add": "0.00005"
2557
+ // }
2558
+ // ],
2559
+ // "mm": [
2560
+ // {
2561
+ // "makerFractionCutoff": "0.005",
2562
+ // "add": "-0.00001"
2563
+ // }
2564
+ // ]
2565
+ // },
2566
+ // "referralDiscount": "0.04"
2567
+ // },
2568
+ // "userCrossRate": "0.00035",
2569
+ // "userAddRate": "0.0001",
2570
+ // "activeReferralDiscount": "0.0"
2571
+ // }
2572
+ //
2573
+ const data = {
2574
+ 'userCrossRate': this.safeString(response, 'userCrossRate'),
2575
+ 'userAddRate': this.safeString(response, 'userAddRate'),
2576
+ };
2577
+ return this.parseTradingFee(data, market);
2578
+ }
2579
+ parseTradingFee(fee, market = undefined) {
2580
+ //
2581
+ // {
2582
+ // "dailyUserVlm": [
2583
+ // {
2584
+ // "date": "2024-07-08",
2585
+ // "userCross": "0.0",
2586
+ // "userAdd": "0.0",
2587
+ // "exchange": "90597185.23639999"
2588
+ // }
2589
+ // ],
2590
+ // "feeSchedule": {
2591
+ // "cross": "0.00035",
2592
+ // "add": "0.0001",
2593
+ // "tiers": {
2594
+ // "vip": [
2595
+ // {
2596
+ // "ntlCutoff": "5000000.0",
2597
+ // "cross": "0.0003",
2598
+ // "add": "0.00005"
2599
+ // }
2600
+ // ],
2601
+ // "mm": [
2602
+ // {
2603
+ // "makerFractionCutoff": "0.005",
2604
+ // "add": "-0.00001"
2605
+ // }
2606
+ // ]
2607
+ // },
2608
+ // "referralDiscount": "0.04"
2609
+ // },
2610
+ // "userCrossRate": "0.00035",
2611
+ // "userAddRate": "0.0001",
2612
+ // "activeReferralDiscount": "0.0"
2613
+ // }
2614
+ //
2615
+ const symbol = this.safeSymbol(undefined, market);
2616
+ return {
2617
+ 'info': fee,
2618
+ 'symbol': symbol,
2619
+ 'maker': this.safeNumber(fee, 'userAddRate'),
2620
+ 'taker': this.safeNumber(fee, 'userCrossRate'),
2621
+ 'percentage': undefined,
2622
+ 'tierBased': undefined,
2623
+ };
2624
+ }
2519
2625
  formatVaultAddress(address = undefined) {
2520
2626
  if (address === undefined) {
2521
2627
  return undefined;
@@ -240,6 +240,8 @@ class kucoin extends kucoin$1 {
240
240
  'purchase/orders': 10,
241
241
  // broker
242
242
  'broker/api/rebase/download': 3,
243
+ // affiliate
244
+ 'affiliate/inviter/statistics': 30,
243
245
  },
244
246
  'post': {
245
247
  // account
@@ -681,6 +683,7 @@ class kucoin extends kucoin$1 {
681
683
  'redeem/orders': 'v3',
682
684
  'purchase/orders': 'v3',
683
685
  'margin/symbols': 'v3',
686
+ 'affiliate/inviter/statistics': 'v2',
684
687
  },
685
688
  'POST': {
686
689
  // account