ccxt 4.5.26 → 4.5.28

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 (60) hide show
  1. package/README.md +6 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +4 -1
  4. package/dist/cjs/src/abstract/zebpay.js +11 -0
  5. package/dist/cjs/src/base/Exchange.js +2 -2
  6. package/dist/cjs/src/binance.js +18 -7
  7. package/dist/cjs/src/bingx.js +5 -5
  8. package/dist/cjs/src/bitget.js +18 -17
  9. package/dist/cjs/src/bitmex.js +5 -1
  10. package/dist/cjs/src/blofin.js +5 -5
  11. package/dist/cjs/src/bybit.js +58 -29
  12. package/dist/cjs/src/coincatch.js +9 -9
  13. package/dist/cjs/src/coinex.js +93 -0
  14. package/dist/cjs/src/coinmate.js +20 -0
  15. package/dist/cjs/src/coinsph.js +23 -0
  16. package/dist/cjs/src/cryptocom.js +7 -0
  17. package/dist/cjs/src/gate.js +2 -0
  18. package/dist/cjs/src/hyperliquid.js +12 -15
  19. package/dist/cjs/src/pro/binance.js +1 -1
  20. package/dist/cjs/src/pro/bybit.js +1 -1
  21. package/dist/cjs/src/whitebit.js +4 -2
  22. package/dist/cjs/src/zebpay.js +1908 -0
  23. package/js/ccxt.d.ts +5 -2
  24. package/js/ccxt.js +4 -2
  25. package/js/src/abstract/binance.d.ts +3 -1
  26. package/js/src/abstract/binancecoinm.d.ts +3 -1
  27. package/js/src/abstract/binanceus.d.ts +3 -1
  28. package/js/src/abstract/binanceusdm.d.ts +3 -1
  29. package/js/src/abstract/coinex.d.ts +16 -0
  30. package/js/src/abstract/coinmate.d.ts +3 -0
  31. package/js/src/abstract/coinsph.d.ts +21 -0
  32. package/js/src/abstract/cryptocom.d.ts +7 -0
  33. package/js/src/abstract/gate.d.ts +2 -0
  34. package/js/src/abstract/gateio.d.ts +2 -0
  35. package/js/src/abstract/zebpay.d.ts +49 -0
  36. package/js/src/abstract/zebpay.js +11 -0
  37. package/js/src/base/Exchange.js +2 -2
  38. package/js/src/binance.d.ts +1 -0
  39. package/js/src/binance.js +18 -7
  40. package/js/src/bingx.js +5 -5
  41. package/js/src/bitget.js +19 -18
  42. package/js/src/bitmex.js +5 -1
  43. package/js/src/blofin.js +5 -5
  44. package/js/src/bybit.d.ts +3 -0
  45. package/js/src/bybit.js +58 -29
  46. package/js/src/coincatch.js +9 -9
  47. package/js/src/coinex.d.ts +11 -0
  48. package/js/src/coinex.js +93 -0
  49. package/js/src/coinmate.d.ts +9 -0
  50. package/js/src/coinmate.js +20 -0
  51. package/js/src/coinsph.js +23 -0
  52. package/js/src/cryptocom.js +7 -0
  53. package/js/src/gate.js +2 -0
  54. package/js/src/hyperliquid.js +12 -15
  55. package/js/src/pro/binance.js +1 -1
  56. package/js/src/pro/bybit.js +1 -1
  57. package/js/src/whitebit.js +4 -2
  58. package/js/src/zebpay.d.ts +361 -0
  59. package/js/src/zebpay.js +1907 -0
  60. package/package.json +1 -1
@@ -61,6 +61,7 @@ class coinex extends coinex$1["default"] {
61
61
  'createTakeProfitOrder': true,
62
62
  'createTriggerOrder': true,
63
63
  'editOrder': true,
64
+ 'editOrders': true,
64
65
  'fetchBalance': true,
65
66
  'fetchBorrowInterest': true,
66
67
  'fetchBorrowRateHistories': false,
@@ -319,6 +320,7 @@ class coinex extends coinex$1["default"] {
319
320
  'futures/index': 1,
320
321
  'futures/funding-rate': 1,
321
322
  'futures/funding-rate-history': 1,
323
+ 'futures/premium-index-history': 1,
322
324
  'futures/position-level': 1,
323
325
  'futures/liquidation-history': 1,
324
326
  'futures/basis-history': 1,
@@ -333,20 +335,26 @@ class coinex extends coinex$1["default"] {
333
335
  'account/subs/info': 1,
334
336
  'account/subs/api': 40,
335
337
  'account/subs/transfer-history': 40,
338
+ 'account/subs/balance': 1,
336
339
  'account/subs/spot-balance': 1,
337
340
  'account/trade-fee-rate': 40,
341
+ 'account/futures-market-settings': 1,
342
+ 'account/info': 1,
338
343
  'assets/spot/balance': 40,
339
344
  'assets/futures/balance': 40,
340
345
  'assets/margin/balance': 1,
341
346
  'assets/financial/balance': 40,
342
347
  'assets/amm/liquidity': 40,
343
348
  'assets/credit/info': 40,
349
+ 'assets/spot/transcation-history': 1,
344
350
  'assets/margin/borrow-history': 40,
345
351
  'assets/margin/interest-limit': 1,
346
352
  'assets/deposit-address': 40,
347
353
  'assets/deposit-history': 40,
348
354
  'assets/withdraw': 40,
349
355
  'assets/transfer-history': 40,
356
+ 'assets/amm/liquidity-pool': 40,
357
+ 'assets/amm/income-history': 40,
350
358
  'spot/order-status': 8,
351
359
  'spot/batch-order-status': 8,
352
360
  'spot/pending-order': 8,
@@ -369,6 +377,12 @@ class coinex extends coinex$1["default"] {
369
377
  'futures/position-funding-history': 40,
370
378
  'futures/position-adl-history': 1,
371
379
  'futures/position-settle-history': 1,
380
+ 'refer/referee': 1,
381
+ 'refer/referee-rebate/record': 1,
382
+ 'refer/referee-rebate/detail': 1,
383
+ 'refer/agent-referee': 1,
384
+ 'refer/agent-rebate/record': 1,
385
+ 'refer/agent-rebate/detail': 1,
372
386
  },
373
387
  'post': {
374
388
  'account/subs': 40,
@@ -379,6 +393,7 @@ class coinex extends coinex$1["default"] {
379
393
  'account/subs/delete-api': 40,
380
394
  'account/subs/transfer': 40,
381
395
  'account/settings': 40,
396
+ 'account/futures-market-settings': 40,
382
397
  'assets/margin/borrow': 40,
383
398
  'assets/margin/repay': 40,
384
399
  'assets/renewal-deposit-address': 40,
@@ -393,6 +408,7 @@ class coinex extends coinex$1["default"] {
393
408
  'spot/batch-stop-order': 1,
394
409
  'spot/modify-order': 13.334,
395
410
  'spot/modify-stop-order': 13.334,
411
+ 'spot/batch-modify-order': 13.334,
396
412
  'spot/cancel-all-order': 1,
397
413
  'spot/cancel-order': 6.667,
398
414
  'spot/cancel-stop-order': 6.667,
@@ -406,6 +422,7 @@ class coinex extends coinex$1["default"] {
406
422
  'futures/batch-stop-order': 1,
407
423
  'futures/modify-order': 20,
408
424
  'futures/modify-stop-order': 20,
425
+ 'futures/batch-modify-order': 20,
409
426
  'futures/cancel-all-order': 1,
410
427
  'futures/cancel-order': 10,
411
428
  'futures/cancel-stop-order': 10,
@@ -3039,6 +3056,82 @@ class coinex extends coinex$1["default"] {
3039
3056
  const data = this.safeDict(response, 'data', {});
3040
3057
  return this.parseOrder(data, market);
3041
3058
  }
3059
+ /**
3060
+ * @method
3061
+ * @name coinex#editOrders
3062
+ * @description edit a list of trade orders
3063
+ * @see https://docs.coinex.com/api/v2/spot/order/http/edit-multi-order
3064
+ * @see https://docs.coinex.com/api/v2/futures/order/http/edit-multi-order
3065
+ * @param {Array} orders list of orders to edit, each object should contain the parameters required by editOrder, namely id, symbol, amount, price and params
3066
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3067
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3068
+ */
3069
+ async editOrders(orders, params = {}) {
3070
+ await this.loadMarkets();
3071
+ const ordersRequests = [];
3072
+ let orderSymbols = [];
3073
+ for (let i = 0; i < orders.length; i++) {
3074
+ const rawOrder = orders[i];
3075
+ const marketId = this.safeString(rawOrder, 'symbol');
3076
+ const market = this.market(marketId);
3077
+ orderSymbols.push(marketId);
3078
+ const id = this.safeString(rawOrder, 'id');
3079
+ const amount = this.safeValue(rawOrder, 'amount');
3080
+ const price = this.safeValue(rawOrder, 'price');
3081
+ let orderParams = this.safeDict(rawOrder, 'params', {});
3082
+ let marginMode = undefined;
3083
+ [marginMode, orderParams] = this.handleMarginModeAndParams('editOrders', orderParams);
3084
+ let market_type = 'SPOT';
3085
+ if (market['swap']) {
3086
+ market_type = 'FUTURES';
3087
+ }
3088
+ else if (marginMode !== undefined) {
3089
+ market_type = 'MARGIN';
3090
+ }
3091
+ const orderRequest = {
3092
+ 'order_id': this.parseToNumeric(id),
3093
+ 'market': market['id'],
3094
+ 'market_type': market_type,
3095
+ };
3096
+ if (amount !== undefined) {
3097
+ orderRequest['amount'] = this.amountToPrecision(marketId, amount);
3098
+ }
3099
+ if (price !== undefined) {
3100
+ orderRequest['price'] = this.priceToPrecision(marketId, price);
3101
+ }
3102
+ ordersRequests.push(this.extend(orderRequest, orderParams));
3103
+ }
3104
+ orderSymbols = this.marketSymbols(orderSymbols, undefined, false, true, true);
3105
+ const firstSymbol = this.safeString(orderSymbols, 0);
3106
+ const firstMarket = this.market(firstSymbol);
3107
+ const request = {
3108
+ 'orders': ordersRequests,
3109
+ };
3110
+ let response = undefined;
3111
+ if (firstMarket['spot']) {
3112
+ response = await this.v2PrivatePostSpotBatchModifyOrder(this.extend(request, params));
3113
+ }
3114
+ else {
3115
+ response = await this.v2PrivatePostFuturesBatchModifyOrder(this.extend(request, params));
3116
+ }
3117
+ const data = this.safeList(response, 'data', []);
3118
+ const result = [];
3119
+ for (let i = 0; i < data.length; i++) {
3120
+ const entry = data[i];
3121
+ const code = this.safeString(entry, 'code');
3122
+ const message = this.safeString(entry, 'message');
3123
+ if ((code !== '0') || ((message !== 'Success') && (message !== 'Succeeded') && (message.toLowerCase() !== 'ok') && !data)) {
3124
+ const feedback = this.id + ' ' + message;
3125
+ this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
3126
+ this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
3127
+ throw new errors.ExchangeError(feedback);
3128
+ }
3129
+ const item = this.safeDict(entry, 'data', {});
3130
+ const order = this.parseOrder(item);
3131
+ result.push(order);
3132
+ }
3133
+ return result;
3134
+ }
3042
3135
  /**
3043
3136
  * @method
3044
3137
  * @name coinex#cancelOrder
@@ -140,10 +140,12 @@ class coinmate extends coinmate$1["default"] {
140
140
  'products',
141
141
  'transactions',
142
142
  'tradingPairs',
143
+ 'system/time',
143
144
  ],
144
145
  },
145
146
  'private': {
146
147
  'post': [
148
+ 'currencies',
147
149
  'balances',
148
150
  'bitcoinCashWithdrawal',
149
151
  'bitcoinCashDepositAddresses',
@@ -196,6 +198,7 @@ class coinmate extends coinmate$1["default"] {
196
198
  'solWithdrawal',
197
199
  'solDepositAddresses',
198
200
  'unconfirmedSolDeposits',
201
+ 'bankWireWithdrawal',
199
202
  ],
200
203
  },
201
204
  },
@@ -328,6 +331,23 @@ class coinmate extends coinmate$1["default"] {
328
331
  'precisionMode': number.TICK_SIZE,
329
332
  });
330
333
  }
334
+ /**
335
+ * @method
336
+ * @name coinmate#fetchTime
337
+ * @description fetches the current integer timestamp in milliseconds from the bingx server
338
+ * @see https://coinmate.docs.apiary.io/#reference/system/get-server-time/get
339
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
340
+ * @returns {int} the current integer timestamp in milliseconds from the bingx server
341
+ */
342
+ async fetchTime(params = {}) {
343
+ const response = await this.publicGetSystemTime(params);
344
+ //
345
+ // {
346
+ // "serverTime": 1765250628745
347
+ // }
348
+ //
349
+ return this.safeInteger(response, 'serverTime');
350
+ }
331
351
  /**
332
352
  * @method
333
353
  * @name coinmate#fetchMarkets
@@ -189,6 +189,7 @@ class coinsph extends coinsph$1["default"] {
189
189
  'get': {
190
190
  'openapi/v1/ping': 1,
191
191
  'openapi/v1/time': 1,
192
+ 'openapi/v1/user/ip': 1,
192
193
  // cost 1 if 'symbol' param defined (one market symbol) or if 'symbols' param is a list of 1-20 market symbols
193
194
  // cost 20 if 'symbols' param is a list of 21-100 market symbols
194
195
  // cost 40 if 'symbols' param is a list of 101 or more market symbols or if both 'symbol' and 'symbols' params are omited
@@ -210,11 +211,14 @@ class coinsph extends coinsph$1["default"] {
210
211
  },
211
212
  'private': {
212
213
  'get': {
214
+ 'openapi/v1/check-sys-status': 1,
213
215
  'openapi/wallet/v1/config/getall': 10,
214
216
  'openapi/wallet/v1/deposit/address': 10,
215
217
  'openapi/wallet/v1/deposit/history': 1,
216
218
  'openapi/wallet/v1/withdraw/history': 1,
219
+ 'openapi/wallet/v1/withdraw/address-whitelist': 1,
217
220
  'openapi/v1/account': 10,
221
+ 'openapi/v1/api-keys': 1,
218
222
  // cost 3 for a single symbol; 40 when the symbol parameter is omitted
219
223
  'openapi/v1/openOrders': { 'cost': 3, 'noSymbol': 40 },
220
224
  'openapi/v1/asset/tradeFee': 1,
@@ -228,6 +232,15 @@ class coinsph extends coinsph$1["default"] {
228
232
  'merchant-api/v1/get-invoices': 1,
229
233
  'openapi/account/v3/crypto-accounts': 1,
230
234
  'openapi/transfer/v3/transfers/{id}': 1,
235
+ 'openapi/v1/sub-account/list': 10,
236
+ 'openapi/v1/sub-account/asset': 10,
237
+ 'openapi/v1/sub-account/transfer/universal-transfer-history': 10,
238
+ 'openapi/v1/sub-account/transfer/sub-history': 10,
239
+ 'openapi/v1/sub-account/apikey/ip-restriction': 10,
240
+ 'openapi/v1/sub-account/wallet/deposit/address': 1,
241
+ 'openapi/v1/sub-account/wallet/deposit/history': 1,
242
+ 'openapi/v1/fund-collect/get-fund-record': 1,
243
+ 'openapi/v1/asset/transaction/history': 20,
231
244
  },
232
245
  'post': {
233
246
  'openapi/wallet/v1/withdraw/apply': 600,
@@ -244,12 +257,22 @@ class coinsph extends coinsph$1["default"] {
244
257
  'openapi/convert/v1/get-supported-trading-pairs': 1,
245
258
  'openapi/convert/v1/get-quote': 1,
246
259
  'openapi/convert/v1/accpet-quote': 1,
260
+ 'openapi/convert/v1/query-order-history': 1,
247
261
  'openapi/fiat/v1/support-channel': 1,
248
262
  'openapi/fiat/v1/cash-out': 1,
249
263
  'openapi/fiat/v1/history': 1,
250
264
  'openapi/migration/v4/sellorder': 1,
251
265
  'openapi/migration/v4/validate-field': 1,
252
266
  'openapi/transfer/v3/transfers': 1,
267
+ 'openapi/v1/sub-account/create': 30,
268
+ 'openapi/v1/sub-account/transfer/universal-transfer': 100,
269
+ 'openapi/v1/sub-account/transfer/sub-to-master': 100,
270
+ 'openapi/v1/sub-account/apikey/add-ip-restriction': 30,
271
+ 'openapi/v1/sub-account/apikey/delete-ip-restriction': 30,
272
+ 'openapi/v1/fund-collect/collect-from-sub-account': 1,
273
+ },
274
+ 'put': {
275
+ 'openapi/v1/userDataStream': 1,
253
276
  },
254
277
  'delete': {
255
278
  'openapi/v1/order': 1,
@@ -211,6 +211,13 @@ class cryptocom extends cryptocom$1["default"] {
211
211
  'private/get-deposit-history': 10 / 3,
212
212
  'private/get-fee-rate': 2,
213
213
  'private/get-instrument-fee-rate': 2,
214
+ 'private/fiat/fiat-deposit-info': 10 / 3,
215
+ 'private/fiat/fiat-deposit-history': 10 / 3,
216
+ 'private/fiat/fiat-withdraw-history': 10 / 3,
217
+ 'private/fiat/fiat-create-withdraw': 10 / 3,
218
+ 'private/fiat/fiat-transaction-quota': 10 / 3,
219
+ 'private/fiat/fiat-transaction-limit': 10 / 3,
220
+ 'private/fiat/fiat-get-bank-accounts': 10 / 3,
214
221
  'private/staking/stake': 2,
215
222
  'private/staking/unstake': 2,
216
223
  'private/staking/get-staking-position': 2,
@@ -320,6 +320,7 @@ class gate extends gate$1["default"] {
320
320
  'small_balance': 1,
321
321
  'small_balance_history': 1,
322
322
  'push': 1,
323
+ 'getLowCapExchangeList': 1,
323
324
  },
324
325
  'post': {
325
326
  'transfers': 2.5,
@@ -509,6 +510,7 @@ class gate extends gate$1["default"] {
509
510
  },
510
511
  'put': {
511
512
  '{settle}/orders/{order_id}': 1,
513
+ '{settle}/price_orders/{order_id}': 1,
512
514
  },
513
515
  'delete': {
514
516
  '{settle}/orders': 20 / 75,
@@ -239,11 +239,11 @@ class hyperliquid extends hyperliquid$1["default"] {
239
239
  'UXPL': 'XPL',
240
240
  },
241
241
  'fetchMarkets': {
242
- 'types': ['spot', 'swap', 'hip3'], // 'spot', 'swap', 'hip3'
243
- // 'hip3': {
244
- // 'limit': 5, // how many dexes to load max if dexes are not specified
245
- // 'dex': [ 'xyz' ],
246
- // },
242
+ 'types': ['spot', 'swap', 'hip3'],
243
+ 'hip3': {
244
+ 'limit': 10,
245
+ 'dexes': [], // list of dexes eg flx, xyz, etc
246
+ },
247
247
  },
248
248
  },
249
249
  'features': {
@@ -578,19 +578,16 @@ class hyperliquid extends hyperliquid$1["default"] {
578
578
  let fetchDexesList = [];
579
579
  const options = this.safeDict(this.options, 'fetchMarkets', {});
580
580
  const hip3 = this.safeDict(options, 'hip3', {});
581
- const defaultLimit = this.safeInteger(hip3, 'limit', 10);
582
- const dexesLength = fetchDexes.length;
583
- if (dexesLength > defaultLimit) { // first element is null
584
- const defaultDexes = this.safeList(hip3, 'dex', []);
585
- if (defaultDexes.length === 0) {
586
- throw new errors.ArgumentsRequired(this.id + ' fetchHip3Markets() Too many DEXes found. Please specify a list of DEXes in the exchange.options["fetchMarkets"]["hip3"]["dex"] parameter to fetch markets from those DEXes only. The limit is set to ' + defaultLimit.toString() + ' DEXes by default.');
587
- }
588
- else {
589
- fetchDexesList = defaultDexes;
581
+ const dexesProvided = this.safeList(hip3, 'dexes'); // let users provide their own list of dexes to load
582
+ const maxLimit = this.safeInteger(hip3, 'limit', 10);
583
+ if (dexesProvided !== undefined) {
584
+ const userProvidedDexesLength = dexesProvided.length;
585
+ if (userProvidedDexesLength > 0) {
586
+ fetchDexesList = dexesProvided;
590
587
  }
591
588
  }
592
589
  else {
593
- for (let i = 1; i < fetchDexes.length; i++) {
590
+ for (let i = 1; i < maxLimit; i++) {
594
591
  const dex = this.safeDict(fetchDexes, i, {});
595
592
  const dexName = this.safeString(dex, 'name');
596
593
  fetchDexesList.push(dexName);
@@ -3793,7 +3793,7 @@ class binance extends binance$1["default"] {
3793
3793
  'datetime': this.iso8601(timestamp),
3794
3794
  'lastTradeTimestamp': lastTradeTimestamp,
3795
3795
  'lastUpdateTimestamp': lastUpdateTimestamp,
3796
- 'type': this.safeStringLower(order, 'o'),
3796
+ 'type': this.parseOrderType(this.safeStringLower(order, 'o')),
3797
3797
  'timeInForce': timeInForce,
3798
3798
  'postOnly': undefined,
3799
3799
  'reduceOnly': this.safeBool(order, 'R'),
@@ -528,7 +528,7 @@ class bybit extends bybit$1["default"] {
528
528
  // spot
529
529
  // {
530
530
  // "topic": "tickers.BTCUSDT",
531
- // "ts": 1673853746003,
531
+ // "ts": 1673853746002,
532
532
  // "type": "snapshot",
533
533
  // "cs": 2588407389,
534
534
  // "data": {
@@ -21,7 +21,7 @@ class whitebit extends whitebit$1["default"] {
21
21
  'name': 'WhiteBit',
22
22
  'version': 'v4',
23
23
  'countries': ['EE'],
24
- 'rateLimit': 50,
24
+ 'rateLimit': 20,
25
25
  'pro': true,
26
26
  'has': {
27
27
  'CORS': undefined,
@@ -298,6 +298,7 @@ class whitebit extends whitebit$1["default"] {
298
298
  'timeDifference': 0,
299
299
  'adjustForTimeDifference': false,
300
300
  'fiatCurrencies': ['EUR', 'USD', 'RUB', 'UAH'],
301
+ 'nonceWindow': false,
301
302
  'fetchBalance': {
302
303
  'account': 'spot',
303
304
  },
@@ -3921,7 +3922,8 @@ class whitebit extends whitebit$1["default"] {
3921
3922
  const nonce = this.nonce().toString();
3922
3923
  const secret = this.encode(this.secret);
3923
3924
  const request = '/' + 'api' + '/' + version + pathWithParams;
3924
- body = this.json(this.extend({ 'request': request, 'nonce': nonce }, params));
3925
+ const [nonceWindow, requestParams] = this.handleOptionAndParams(params, 'sign', 'nonceWindow', false);
3926
+ body = this.json(this.extend({ 'request': request, 'nonce': nonce, 'nonceWindow': nonceWindow }, requestParams));
3925
3927
  const payload = this.stringToBase64(body);
3926
3928
  const signature = this.hmac(this.encode(payload), secret, sha512.sha512);
3927
3929
  headers = {