ccxt 4.4.49 → 4.4.53

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 (158) hide show
  1. package/README.md +6 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +65 -2
  5. package/dist/cjs/src/base/Exchange.js +112 -3
  6. package/dist/cjs/src/binance.js +42 -19
  7. package/dist/cjs/src/bitfinex1.js +22 -22
  8. package/dist/cjs/src/blofin.js +6 -2
  9. package/dist/cjs/src/bybit.js +2 -2
  10. package/dist/cjs/src/coinex.js +5 -5
  11. package/dist/cjs/src/coinmetro.js +21 -4
  12. package/dist/cjs/src/defx.js +1 -1
  13. package/dist/cjs/src/deribit.js +23 -4
  14. package/dist/cjs/src/ellipx.js +1 -0
  15. package/dist/cjs/src/gate.js +2 -2
  16. package/dist/cjs/src/hollaex.js +15 -20
  17. package/dist/cjs/src/htx.js +6 -4
  18. package/dist/cjs/src/hyperliquid.js +4 -4
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/kucoin.js +52 -74
  21. package/dist/cjs/src/kuna.js +1 -1
  22. package/dist/cjs/src/mexc.js +29 -8
  23. package/dist/cjs/src/okcoin.js +13 -5
  24. package/dist/cjs/src/okx.js +1 -1
  25. package/dist/cjs/src/onetrading.js +1 -1
  26. package/dist/cjs/src/paradex.js +2 -2
  27. package/dist/cjs/src/paymium.js +42 -0
  28. package/dist/cjs/src/pro/binance.js +2 -0
  29. package/dist/cjs/src/pro/bitfinex1.js +4 -4
  30. package/dist/cjs/src/pro/bitvavo.js +1 -1
  31. package/dist/cjs/src/pro/blofin.js +9 -1
  32. package/dist/cjs/src/pro/bybit.js +1 -1
  33. package/dist/cjs/src/pro/coincatch.js +2 -2
  34. package/dist/cjs/src/pro/coinex.js +4 -1
  35. package/dist/cjs/src/pro/cryptocom.js +2 -2
  36. package/dist/cjs/src/pro/defx.js +1 -1
  37. package/dist/cjs/src/pro/exmo.js +1 -1
  38. package/dist/cjs/src/pro/gemini.js +1 -1
  39. package/dist/cjs/src/pro/hashkey.js +2 -2
  40. package/dist/cjs/src/pro/htx.js +8 -8
  41. package/dist/cjs/src/pro/hyperliquid.js +2 -2
  42. package/dist/cjs/src/pro/kucoin.js +1 -1
  43. package/dist/cjs/src/pro/okx.js +1 -1
  44. package/dist/cjs/src/pro/oxfun.js +1 -1
  45. package/dist/cjs/src/probit.js +77 -9
  46. package/dist/cjs/src/timex.js +67 -0
  47. package/dist/cjs/src/tokocrypto.js +82 -5
  48. package/dist/cjs/src/tradeogre.js +55 -2
  49. package/dist/cjs/src/vertex.js +65 -2
  50. package/dist/cjs/src/wavesexchange.js +73 -0
  51. package/dist/cjs/src/wazirx.js +59 -3
  52. package/dist/cjs/src/whitebit.js +80 -4
  53. package/dist/cjs/src/xt.js +112 -0
  54. package/dist/cjs/src/yobit.js +56 -0
  55. package/dist/cjs/src/zaif.js +55 -0
  56. package/dist/cjs/src/zonda.js +56 -0
  57. package/examples/README.md +6 -0
  58. package/js/ccxt.d.ts +1 -1
  59. package/js/ccxt.js +1 -1
  60. package/js/src/abstract/binance.d.ts +1 -0
  61. package/js/src/abstract/binancecoinm.d.ts +1 -0
  62. package/js/src/abstract/binanceus.d.ts +1 -0
  63. package/js/src/abstract/binanceusdm.d.ts +1 -0
  64. package/js/src/alpaca.d.ts +35 -0
  65. package/js/src/alpaca.js +65 -2
  66. package/js/src/base/Exchange.d.ts +2 -0
  67. package/js/src/base/Exchange.js +112 -3
  68. package/js/src/binance.d.ts +4 -1
  69. package/js/src/binance.js +42 -19
  70. package/js/src/bitfinex1.d.ts +22 -22
  71. package/js/src/bitfinex1.js +22 -22
  72. package/js/src/blofin.d.ts +1 -1
  73. package/js/src/blofin.js +6 -2
  74. package/js/src/bybit.d.ts +2 -2
  75. package/js/src/bybit.js +2 -2
  76. package/js/src/coinex.js +5 -5
  77. package/js/src/coinmetro.d.ts +1 -1
  78. package/js/src/coinmetro.js +21 -4
  79. package/js/src/defx.d.ts +1 -1
  80. package/js/src/defx.js +1 -1
  81. package/js/src/deribit.d.ts +1 -1
  82. package/js/src/deribit.js +23 -4
  83. package/js/src/ellipx.d.ts +1 -0
  84. package/js/src/ellipx.js +1 -0
  85. package/js/src/gate.d.ts +1 -1
  86. package/js/src/gate.js +2 -2
  87. package/js/src/hollaex.d.ts +2 -1
  88. package/js/src/hollaex.js +15 -20
  89. package/js/src/htx.d.ts +1 -1
  90. package/js/src/htx.js +6 -4
  91. package/js/src/hyperliquid.d.ts +3 -3
  92. package/js/src/hyperliquid.js +4 -4
  93. package/js/src/krakenfutures.d.ts +1 -1
  94. package/js/src/krakenfutures.js +1 -1
  95. package/js/src/kucoin.js +52 -74
  96. package/js/src/kuna.d.ts +1 -1
  97. package/js/src/kuna.js +1 -1
  98. package/js/src/mexc.d.ts +1 -1
  99. package/js/src/mexc.js +29 -8
  100. package/js/src/okcoin.js +13 -5
  101. package/js/src/okx.d.ts +1 -1
  102. package/js/src/okx.js +1 -1
  103. package/js/src/onetrading.d.ts +1 -1
  104. package/js/src/onetrading.js +1 -1
  105. package/js/src/paradex.d.ts +1 -1
  106. package/js/src/paradex.js +2 -2
  107. package/js/src/paymium.js +42 -0
  108. package/js/src/pro/binance.js +2 -0
  109. package/js/src/pro/bitfinex1.d.ts +4 -4
  110. package/js/src/pro/bitfinex1.js +4 -4
  111. package/js/src/pro/bitvavo.d.ts +1 -1
  112. package/js/src/pro/bitvavo.js +1 -1
  113. package/js/src/pro/blofin.d.ts +1 -1
  114. package/js/src/pro/blofin.js +9 -1
  115. package/js/src/pro/bybit.d.ts +1 -1
  116. package/js/src/pro/bybit.js +1 -1
  117. package/js/src/pro/coincatch.d.ts +2 -2
  118. package/js/src/pro/coincatch.js +2 -2
  119. package/js/src/pro/coinex.js +4 -1
  120. package/js/src/pro/cryptocom.d.ts +2 -2
  121. package/js/src/pro/cryptocom.js +2 -2
  122. package/js/src/pro/defx.d.ts +1 -1
  123. package/js/src/pro/defx.js +1 -1
  124. package/js/src/pro/exmo.d.ts +1 -1
  125. package/js/src/pro/exmo.js +1 -1
  126. package/js/src/pro/gemini.d.ts +1 -1
  127. package/js/src/pro/gemini.js +1 -1
  128. package/js/src/pro/hashkey.d.ts +2 -2
  129. package/js/src/pro/hashkey.js +2 -2
  130. package/js/src/pro/htx.d.ts +8 -8
  131. package/js/src/pro/htx.js +8 -8
  132. package/js/src/pro/hyperliquid.d.ts +2 -2
  133. package/js/src/pro/hyperliquid.js +2 -2
  134. package/js/src/pro/kucoin.d.ts +1 -1
  135. package/js/src/pro/kucoin.js +1 -1
  136. package/js/src/pro/okx.d.ts +1 -1
  137. package/js/src/pro/okx.js +1 -1
  138. package/js/src/pro/oxfun.d.ts +1 -1
  139. package/js/src/pro/oxfun.js +1 -1
  140. package/js/src/probit.d.ts +1 -0
  141. package/js/src/probit.js +77 -9
  142. package/js/src/timex.js +67 -0
  143. package/js/src/tokocrypto.d.ts +2 -3
  144. package/js/src/tokocrypto.js +82 -5
  145. package/js/src/tradeogre.d.ts +4 -2
  146. package/js/src/tradeogre.js +55 -2
  147. package/js/src/vertex.js +65 -2
  148. package/js/src/wavesexchange.js +73 -0
  149. package/js/src/wazirx.js +59 -3
  150. package/js/src/whitebit.js +80 -4
  151. package/js/src/xt.js +112 -0
  152. package/js/src/yobit.js +56 -0
  153. package/js/src/zaif.js +55 -0
  154. package/js/src/zonda.d.ts +1 -0
  155. package/js/src/zonda.js +56 -0
  156. package/package.json +2 -2
  157. package/js/src/hitbtc3.d.ts +0 -8
  158. package/js/src/hitbtc3.js +0 -20
@@ -404,7 +404,7 @@ export default class bitfinex1 extends Exchange {
404
404
  }
405
405
  /**
406
406
  * @method
407
- * @name bitfinex#fetchTransactionFees
407
+ * @name bitfinex1#fetchTransactionFees
408
408
  * @deprecated
409
409
  * @description please use fetchDepositWithdrawFees instead
410
410
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-fees
@@ -441,7 +441,7 @@ export default class bitfinex1 extends Exchange {
441
441
  }
442
442
  /**
443
443
  * @method
444
- * @name bitfinex#fetchDepositWithdrawFees
444
+ * @name bitfinex1#fetchDepositWithdrawFees
445
445
  * @description fetch deposit and withdraw fees
446
446
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-fees
447
447
  * @param {string[]|undefined} codes list of unified currency codes
@@ -481,7 +481,7 @@ export default class bitfinex1 extends Exchange {
481
481
  }
482
482
  /**
483
483
  * @method
484
- * @name bitfinex#fetchTradingFees
484
+ * @name bitfinex1#fetchTradingFees
485
485
  * @description fetch the trading fees for multiple markets
486
486
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-summary
487
487
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -564,7 +564,7 @@ export default class bitfinex1 extends Exchange {
564
564
  }
565
565
  /**
566
566
  * @method
567
- * @name bitfinex#fetchMarkets
567
+ * @name bitfinex1#fetchMarkets
568
568
  * @description retrieves data on all markets for bitfinex
569
569
  * @see https://docs.bitfinex.com/v1/reference/rest-public-symbols
570
570
  * @see https://docs.bitfinex.com/v1/reference/rest-public-symbol-details
@@ -691,7 +691,7 @@ export default class bitfinex1 extends Exchange {
691
691
  }
692
692
  /**
693
693
  * @method
694
- * @name bitfinex#fetchBalance
694
+ * @name bitfinex1#fetchBalance
695
695
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
696
696
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-wallet-balances
697
697
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -749,7 +749,7 @@ export default class bitfinex1 extends Exchange {
749
749
  }
750
750
  /**
751
751
  * @method
752
- * @name bitfinex#transfer
752
+ * @name bitfinex1#transfer
753
753
  * @description transfer currency internally between wallets on the same account
754
754
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-transfer-between-wallets
755
755
  * @param {string} code unified currency code
@@ -835,7 +835,7 @@ export default class bitfinex1 extends Exchange {
835
835
  }
836
836
  /**
837
837
  * @method
838
- * @name bitfinex#fetchOrderBook
838
+ * @name bitfinex1#fetchOrderBook
839
839
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
840
840
  * @see https://docs.bitfinex.com/v1/reference/rest-public-orderbook
841
841
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -858,7 +858,7 @@ export default class bitfinex1 extends Exchange {
858
858
  }
859
859
  /**
860
860
  * @method
861
- * @name bitfinex#fetchTickers
861
+ * @name bitfinex1#fetchTickers
862
862
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
863
863
  * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
864
864
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -878,7 +878,7 @@ export default class bitfinex1 extends Exchange {
878
878
  }
879
879
  /**
880
880
  * @method
881
- * @name bitfinex#fetchTicker
881
+ * @name bitfinex1#fetchTicker
882
882
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
883
883
  * @see https://docs.bitfinex.com/v1/reference/rest-public-ticker
884
884
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -1019,7 +1019,7 @@ export default class bitfinex1 extends Exchange {
1019
1019
  }
1020
1020
  /**
1021
1021
  * @method
1022
- * @name bitfinex#fetchTrades
1022
+ * @name bitfinex1#fetchTrades
1023
1023
  * @description get the list of most recent trades for a particular symbol
1024
1024
  * @see https://docs.bitfinex.com/v1/reference/rest-public-trades
1025
1025
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -1055,7 +1055,7 @@ export default class bitfinex1 extends Exchange {
1055
1055
  }
1056
1056
  /**
1057
1057
  * @method
1058
- * @name bitfinex#fetchMyTrades
1058
+ * @name bitfinex1#fetchMyTrades
1059
1059
  * @description fetch all trades made by the user
1060
1060
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-past-trades
1061
1061
  * @param {string} symbol unified market symbol
@@ -1084,7 +1084,7 @@ export default class bitfinex1 extends Exchange {
1084
1084
  }
1085
1085
  /**
1086
1086
  * @method
1087
- * @name bitfinex#createOrder
1087
+ * @name bitfinex1#createOrder
1088
1088
  * @description create a trade order
1089
1089
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-new-order
1090
1090
  * @param {string} symbol unified symbol of the market to create an order in
@@ -1152,7 +1152,7 @@ export default class bitfinex1 extends Exchange {
1152
1152
  }
1153
1153
  /**
1154
1154
  * @method
1155
- * @name bitfinex#cancelOrder
1155
+ * @name bitfinex1#cancelOrder
1156
1156
  * @description cancels an open order
1157
1157
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-order
1158
1158
  * @param {string} id order id
@@ -1195,7 +1195,7 @@ export default class bitfinex1 extends Exchange {
1195
1195
  }
1196
1196
  /**
1197
1197
  * @method
1198
- * @name bitfinex#cancelAllOrders
1198
+ * @name bitfinex1#cancelAllOrders
1199
1199
  * @description cancel all open orders
1200
1200
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-cancel-all-orders
1201
1201
  * @param {string} symbol not used by bitfinex cancelAllOrders
@@ -1287,7 +1287,7 @@ export default class bitfinex1 extends Exchange {
1287
1287
  }
1288
1288
  /**
1289
1289
  * @method
1290
- * @name bitfinex#fetchOpenOrders
1290
+ * @name bitfinex1#fetchOpenOrders
1291
1291
  * @description fetch all unfilled currently open orders
1292
1292
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-orders
1293
1293
  * @param {string} symbol unified market symbol
@@ -1312,7 +1312,7 @@ export default class bitfinex1 extends Exchange {
1312
1312
  }
1313
1313
  /**
1314
1314
  * @method
1315
- * @name bitfinex#fetchClosedOrders
1315
+ * @name bitfinex1#fetchClosedOrders
1316
1316
  * @description fetches information on multiple closed orders made by the user
1317
1317
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-orders-history
1318
1318
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1338,7 +1338,7 @@ export default class bitfinex1 extends Exchange {
1338
1338
  }
1339
1339
  /**
1340
1340
  * @method
1341
- * @name bitfinex#fetchOrder
1341
+ * @name bitfinex1#fetchOrder
1342
1342
  * @description fetches information on an order made by the user
1343
1343
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-order-status
1344
1344
  * @param {string} id the order id
@@ -1434,7 +1434,7 @@ export default class bitfinex1 extends Exchange {
1434
1434
  }
1435
1435
  /**
1436
1436
  * @method
1437
- * @name bitfinex#createDepositAddress
1437
+ * @name bitfinex1#createDepositAddress
1438
1438
  * @description create a currency deposit address
1439
1439
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1440
1440
  * @param {string} code unified currency code of the currency for the deposit address
@@ -1450,7 +1450,7 @@ export default class bitfinex1 extends Exchange {
1450
1450
  }
1451
1451
  /**
1452
1452
  * @method
1453
- * @name bitfinex#fetchDepositAddress
1453
+ * @name bitfinex1#fetchDepositAddress
1454
1454
  * @description fetch the deposit address for a currency associated with this account
1455
1455
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit
1456
1456
  * @param {string} code unified currency code
@@ -1484,7 +1484,7 @@ export default class bitfinex1 extends Exchange {
1484
1484
  }
1485
1485
  /**
1486
1486
  * @method
1487
- * @name bitfinex#fetchDepositsWithdrawals
1487
+ * @name bitfinex1#fetchDepositsWithdrawals
1488
1488
  * @description fetch history of deposits and withdrawals
1489
1489
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-deposit-withdrawal-history
1490
1490
  * @param {string} code unified currency code for the currency of the deposit/withdrawals
@@ -1621,7 +1621,7 @@ export default class bitfinex1 extends Exchange {
1621
1621
  }
1622
1622
  /**
1623
1623
  * @method
1624
- * @name bitfinex#withdraw
1624
+ * @name bitfinex1#withdraw
1625
1625
  * @description make a withdrawal
1626
1626
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
1627
1627
  * @param {string} code unified currency code
@@ -1672,7 +1672,7 @@ export default class bitfinex1 extends Exchange {
1672
1672
  }
1673
1673
  /**
1674
1674
  * @method
1675
- * @name bitfinex#fetchPositions
1675
+ * @name bitfinex1#fetchPositions
1676
1676
  * @description fetch all open positions
1677
1677
  * @see https://docs.bitfinex.com/v1/reference/rest-auth-active-positions
1678
1678
  * @param {string[]|undefined} symbols list of unified market symbols
@@ -299,7 +299,7 @@ export default class blofin extends Exchange {
299
299
  fetchPosition(symbol: string, params?: {}): Promise<Position>;
300
300
  /**
301
301
  * @method
302
- * @name blofin#fetchPosition
302
+ * @name blofin#fetchPositions
303
303
  * @description fetch data on a single open contract trade position
304
304
  * @see https://blofin.com/docs#get-positions
305
305
  * @param {string[]} [symbols] list of unified market symbols
package/js/src/blofin.js CHANGED
@@ -160,6 +160,9 @@ export default class blofin extends Exchange {
160
160
  'api': {
161
161
  'rest': 'https://openapi.blofin.com',
162
162
  },
163
+ 'test': {
164
+ 'rest': 'https://demo-trading-openapi.blofin.com',
165
+ },
163
166
  'referral': {
164
167
  'url': 'https://blofin.com/register?referral_code=f79EsS',
165
168
  'discount': 0.05,
@@ -289,7 +292,7 @@ export default class blofin extends Exchange {
289
292
  'trailing': false,
290
293
  },
291
294
  'fetchOHLCV': {
292
- 'max': 1440,
295
+ 'limit': 1440,
293
296
  },
294
297
  },
295
298
  'spot': {
@@ -317,6 +320,7 @@ export default class blofin extends Exchange {
317
320
  'attachedStopLossTakeProfit': {
318
321
  'triggerPriceType': undefined,
319
322
  'limit': true,
323
+ 'price': undefined,
320
324
  },
321
325
  'hedged': true,
322
326
  },
@@ -1958,7 +1962,7 @@ export default class blofin extends Exchange {
1958
1962
  }
1959
1963
  /**
1960
1964
  * @method
1961
- * @name blofin#fetchPosition
1965
+ * @name blofin#fetchPositions
1962
1966
  * @description fetch data on a single open contract trade position
1963
1967
  * @see https://blofin.com/docs#get-positions
1964
1968
  * @param {string[]} [symbols] list of unified market symbols
package/js/src/bybit.d.ts CHANGED
@@ -344,7 +344,7 @@ export default class bybit extends Exchange {
344
344
  fetchOrderClassic(id: string, symbol?: Str, params?: {}): Promise<Order>;
345
345
  /**
346
346
  * @method
347
- * @name bybit#fetchOrderClassic
347
+ * @name bybit#fetchOrder
348
348
  * @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
349
349
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
350
350
  * @param {string} id the order id
@@ -357,7 +357,7 @@ export default class bybit extends Exchange {
357
357
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
358
358
  /**
359
359
  * @method
360
- * @name bybit#fetchOrders
360
+ * @name bybit#fetchOrdersClassic
361
361
  * @description fetches information on multiple orders made by the user *classic accounts only*
362
362
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
363
363
  * @param {string} symbol unified market symbol of the market orders were made in
package/js/src/bybit.js CHANGED
@@ -4769,7 +4769,7 @@ export default class bybit extends Exchange {
4769
4769
  }
4770
4770
  /**
4771
4771
  * @method
4772
- * @name bybit#fetchOrderClassic
4772
+ * @name bybit#fetchOrder
4773
4773
  * @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
4774
4774
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
4775
4775
  * @param {string} id the order id
@@ -4890,7 +4890,7 @@ export default class bybit extends Exchange {
4890
4890
  }
4891
4891
  /**
4892
4892
  * @method
4893
- * @name bybit#fetchOrders
4893
+ * @name bybit#fetchOrdersClassic
4894
4894
  * @description fetches information on multiple orders made by the user *classic accounts only*
4895
4895
  * @see https://bybit-exchange.github.io/docs/v5/order/order-list
4896
4896
  * @param {string} symbol unified market symbol of the market orders were made in
package/js/src/coinex.js CHANGED
@@ -470,7 +470,7 @@ export default class coinex extends Exchange {
470
470
  'ERC20': 'ERC20',
471
471
  'BRC20': 'BRC20',
472
472
  'SOL': 'SOL',
473
- 'TON': 'SOL',
473
+ 'TON': 'TON',
474
474
  'BSV': 'BSV',
475
475
  'AVAXC': 'AVA_C',
476
476
  'AVAXX': 'AVA',
@@ -3931,7 +3931,7 @@ export default class coinex extends Exchange {
3931
3931
  'currency': this.safeCurrencyCode(undefined, currency),
3932
3932
  'network': undefined,
3933
3933
  'address': address,
3934
- 'tag': tag,
3934
+ 'tag': this.safeString(depositAddress, 'memo', tag),
3935
3935
  };
3936
3936
  }
3937
3937
  /**
@@ -4805,14 +4805,14 @@ export default class coinex extends Exchange {
4805
4805
  this.checkAddress(address);
4806
4806
  await this.loadMarkets();
4807
4807
  const currency = this.currency(code);
4808
- if (tag) {
4809
- address = address + ':' + tag;
4810
- }
4811
4808
  const request = {
4812
4809
  'ccy': currency['id'],
4813
4810
  'to_address': address,
4814
4811
  'amount': this.numberToString(amount), // the actual amount without fees, https://www.coinex.com/fees
4815
4812
  };
4813
+ if (tag !== undefined) {
4814
+ request['memo'] = tag;
4815
+ }
4816
4816
  let networkCode = undefined;
4817
4817
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
4818
4818
  if (networkCode !== undefined) {
@@ -166,7 +166,7 @@ export default class coinmetro extends Exchange {
166
166
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
167
167
  /**
168
168
  * @method
169
- * @name coinmetro#cancelOrder
169
+ * @name coinmetro#closePosition
170
170
  * @description closes an open position
171
171
  * @see https://documenter.getpostman.com/view/3653795/SVfWN6KS#47f913fb-8cab-49f4-bc78-d980e6ced316
172
172
  * @param {string} symbol not used by coinmetro closePosition ()
@@ -212,7 +212,7 @@ export default class coinmetro extends Exchange {
212
212
  // exchange-specific options
213
213
  'options': {
214
214
  'currenciesByIdForParseMarket': undefined,
215
- 'currencyIdsListForParseMarket': undefined,
215
+ 'currencyIdsListForParseMarket': ['QRDO'],
216
216
  },
217
217
  'features': {
218
218
  'spot': {
@@ -401,7 +401,12 @@ export default class coinmetro extends Exchange {
401
401
  if (this.safeValue(this.options, 'currenciesByIdForParseMarket') === undefined) {
402
402
  const currenciesById = this.indexBy(result, 'id');
403
403
  this.options['currenciesByIdForParseMarket'] = currenciesById;
404
- this.options['currencyIdsListForParseMarket'] = Object.keys(currenciesById);
404
+ const currentCurrencyIdsList = this.safeList(this.options, 'currencyIdsListForParseMarket', []);
405
+ const currencyIdsList = Object.keys(currenciesById);
406
+ for (let i = 0; i < currencyIdsList.length; i++) {
407
+ currentCurrencyIdsList.push(currencyIdsList[i]);
408
+ }
409
+ this.options['currencyIdsListForParseMarket'] = currentCurrencyIdsList;
405
410
  }
406
411
  return result;
407
412
  }
@@ -502,10 +507,22 @@ export default class coinmetro extends Exchange {
502
507
  let baseId = undefined;
503
508
  let quoteId = undefined;
504
509
  const currencyIds = this.safeValue(this.options, 'currencyIdsListForParseMarket', []);
510
+ // Bubble sort by length (longest first)
511
+ const currencyIdsLength = currencyIds.length;
512
+ for (let i = 0; i < currencyIdsLength; i++) {
513
+ for (let j = 0; j < currencyIdsLength - i - 1; j++) {
514
+ const a = currencyIds[j];
515
+ const b = currencyIds[j + 1];
516
+ if (a.length < b.length) {
517
+ currencyIds[j] = b;
518
+ currencyIds[j + 1] = a;
519
+ }
520
+ }
521
+ }
505
522
  for (let i = 0; i < currencyIds.length; i++) {
506
523
  const currencyId = currencyIds[i];
507
524
  const entryIndex = marketId.indexOf(currencyId);
508
- if (entryIndex !== -1) {
525
+ if (entryIndex === 0) {
509
526
  const restId = marketId.replace(currencyId, '');
510
527
  if (this.inArray(restId, currencyIds)) {
511
528
  if (entryIndex === 0) {
@@ -1432,7 +1449,7 @@ export default class coinmetro extends Exchange {
1432
1449
  }
1433
1450
  /**
1434
1451
  * @method
1435
- * @name coinmetro#cancelOrder
1452
+ * @name coinmetro#closePosition
1436
1453
  * @description closes an open position
1437
1454
  * @see https://documenter.getpostman.com/view/3653795/SVfWN6KS#47f913fb-8cab-49f4-bc78-d980e6ced316
1438
1455
  * @param {string} symbol not used by coinmetro closePosition ()
package/js/src/defx.d.ts CHANGED
@@ -91,7 +91,7 @@ export default class defx extends Exchange {
91
91
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
92
92
  /**
93
93
  * @method
94
- * @name defx#fetchTrades
94
+ * @name defx#fetchMyTrades
95
95
  * @description fetch all trades made by the user
96
96
  * @see https://api-docs.defx.com/#06b5b33c-2fc6-48de-896c-fc316f5871a7
97
97
  * @param {string} symbol unified symbol of the market to fetch trades for
package/js/src/defx.js CHANGED
@@ -940,7 +940,7 @@ export default class defx extends Exchange {
940
940
  }
941
941
  /**
942
942
  * @method
943
- * @name defx#fetchTrades
943
+ * @name defx#fetchMyTrades
944
944
  * @description fetch all trades made by the user
945
945
  * @see https://api-docs.defx.com/#06b5b33c-2fc6-48de-896c-fc316f5871a7
946
946
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -443,7 +443,7 @@ export default class deribit extends Exchange {
443
443
  * @param {int} [since] the earliest time in ms to fetch funding rate history for
444
444
  * @param {int} [limit] the maximum number of entries to retrieve
445
445
  * @param {object} [params] extra parameters specific to the exchange API endpoint
446
- * @param {int} [params.end_timestamp] fetch funding rate ending at this timestamp
446
+ * @param {int} [params.until] fetch funding rate ending at this timestamp
447
447
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
448
448
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
449
449
  */
package/js/src/deribit.js CHANGED
@@ -3164,7 +3164,7 @@ export default class deribit extends Exchange {
3164
3164
  * @param {int} [since] the earliest time in ms to fetch funding rate history for
3165
3165
  * @param {int} [limit] the maximum number of entries to retrieve
3166
3166
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3167
- * @param {int} [params.end_timestamp] fetch funding rate ending at this timestamp
3167
+ * @param {int} [params.until] fetch funding rate ending at this timestamp
3168
3168
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
3169
3169
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3170
3170
  */
@@ -3173,19 +3173,38 @@ export default class deribit extends Exchange {
3173
3173
  const market = this.market(symbol);
3174
3174
  let paginate = false;
3175
3175
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
3176
+ const maxEntriesPerRequest = 744; // seems exchange returns max 744 items per request
3177
+ const eachItemDuration = '1h';
3176
3178
  if (paginate) {
3177
- return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 720);
3179
+ // fix for: https://github.com/ccxt/ccxt/issues/25040
3180
+ return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, eachItemDuration, this.extend(params, { 'isDeribitPaginationCall': true }), maxEntriesPerRequest);
3178
3181
  }
3179
- const time = this.milliseconds();
3182
+ const duration = this.parseTimeframe(eachItemDuration) * 1000;
3183
+ let time = this.milliseconds();
3180
3184
  const month = 30 * 24 * 60 * 60 * 1000;
3181
3185
  if (since === undefined) {
3182
3186
  since = time - month;
3183
3187
  }
3188
+ else {
3189
+ time = since + month;
3190
+ }
3184
3191
  const request = {
3185
3192
  'instrument_name': market['id'],
3186
3193
  'start_timestamp': since - 1,
3187
- 'end_timestamp': time,
3188
3194
  };
3195
+ const until = this.safeInteger2(params, 'until', 'end_timestamp');
3196
+ if (until !== undefined) {
3197
+ params = this.omit(params, ['until']);
3198
+ request['end_timestamp'] = until;
3199
+ }
3200
+ else {
3201
+ request['end_timestamp'] = time;
3202
+ }
3203
+ if ('isDeribitPaginationCall' in params) {
3204
+ params = this.omit(params, 'isDeribitPaginationCall');
3205
+ const maxUntil = this.sum(since, limit * duration);
3206
+ request['end_timestamp'] = Math.min(request['end_timestamp'], maxUntil);
3207
+ }
3189
3208
  const response = await this.publicGetGetFundingRateHistory(this.extend(request, params));
3190
3209
  //
3191
3210
  // {
@@ -219,6 +219,7 @@ export default class ellipx extends Exchange {
219
219
  fetchTradingFee(symbol?: string, params?: {}): Promise<TradingFeeInterface>;
220
220
  /**
221
221
  * @method
222
+ * @name ellipx#withdraw
222
223
  * @description Make a withdrawal request
223
224
  * @see https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM/edit?tab=t.0#heading=h.zegupoa8g4t9
224
225
  * @param {string} code Currency code
package/js/src/ellipx.js CHANGED
@@ -1712,6 +1712,7 @@ export default class ellipx extends Exchange {
1712
1712
  }
1713
1713
  /**
1714
1714
  * @method
1715
+ * @name ellipx#withdraw
1715
1716
  * @description Make a withdrawal request
1716
1717
  * @see https://docs.google.com/document/d/1ZXzTQYffKE_EglTaKptxGQERRnunuLHEMmar7VC9syM/edit?tab=t.0#heading=h.zegupoa8g4t9
1717
1718
  * @param {string} code Currency code
package/js/src/gate.d.ts CHANGED
@@ -734,7 +734,7 @@ export default class gate extends Exchange {
734
734
  }>;
735
735
  /**
736
736
  * @method
737
- * @name gate#borrowMargin
737
+ * @name gate#borrowIsolatedMargin
738
738
  * @description create a loan to borrow margin
739
739
  * @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
740
740
  * @param {string} symbol unified market symbol, required for isolated margin
package/js/src/gate.js CHANGED
@@ -1824,7 +1824,7 @@ export default class gate extends Exchange {
1824
1824
  const active = listed && tradeEnabled && withdrawEnabled && depositEnabled;
1825
1825
  if (this.safeValue(result, code) === undefined) {
1826
1826
  result[code] = {
1827
- 'id': code.toLowerCase(),
1827
+ 'id': currency,
1828
1828
  'code': code,
1829
1829
  'info': undefined,
1830
1830
  'name': undefined,
@@ -6456,7 +6456,7 @@ export default class gate extends Exchange {
6456
6456
  }
6457
6457
  /**
6458
6458
  * @method
6459
- * @name gate#borrowMargin
6459
+ * @name gate#borrowIsolatedMargin
6460
6460
  * @description create a loan to borrow margin
6461
6461
  * @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
6462
6462
  * @param {string} symbol unified market symbol, required for isolated margin
@@ -93,13 +93,14 @@ export default class hollaex extends Exchange {
93
93
  /**
94
94
  * @method
95
95
  * @name hollaex#fetchOHLCV
96
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
96
+ * @description hollaex has large gaps between candles, so it's recommended to specify since
97
97
  * @see https://apidocs.hollaex.com/#chart
98
98
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
99
99
  * @param {string} timeframe the length of time each candle represents
100
100
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
101
101
  * @param {int} [limit] the maximum amount of candles to fetch
102
102
  * @param {object} [params] extra parameters specific to the exchange API endpoint
103
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
103
104
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
104
105
  */
105
106
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
package/js/src/hollaex.js CHANGED
@@ -831,13 +831,14 @@ export default class hollaex extends Exchange {
831
831
  /**
832
832
  * @method
833
833
  * @name hollaex#fetchOHLCV
834
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
834
+ * @description hollaex has large gaps between candles, so it's recommended to specify since
835
835
  * @see https://apidocs.hollaex.com/#chart
836
836
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
837
837
  * @param {string} timeframe the length of time each candle represents
838
838
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
839
839
  * @param {int} [limit] the maximum amount of candles to fetch
840
840
  * @param {object} [params] extra parameters specific to the exchange API endpoint
841
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
841
842
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
842
843
  */
843
844
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -847,27 +848,20 @@ export default class hollaex extends Exchange {
847
848
  'symbol': market['id'],
848
849
  'resolution': this.safeString(this.timeframes, timeframe, timeframe),
849
850
  };
850
- const duration = this.parseTimeframe(timeframe);
851
- if (since === undefined) {
852
- if (limit === undefined) {
853
- limit = 1000; // they have no defaults and can actually provide tens of thousands of bars in one request, but we should cap "default" at generous amount
854
- }
855
- const end = this.seconds();
856
- const start = end - duration * limit;
857
- request['to'] = end;
858
- request['from'] = start;
851
+ const until = this.safeInteger(params, 'until');
852
+ let end = this.seconds();
853
+ if (until !== undefined) {
854
+ end = this.parseToInt(until / 1000);
855
+ }
856
+ const defaultSpan = 2592000; // 30 days
857
+ if (since !== undefined) {
858
+ request['from'] = this.parseToInt(since / 1000);
859
859
  }
860
860
  else {
861
- if (limit === undefined) {
862
- request['from'] = this.parseToInt(since / 1000);
863
- request['to'] = this.seconds();
864
- }
865
- else {
866
- const start = this.parseToInt(since / 1000);
867
- request['from'] = start;
868
- request['to'] = this.sum(start, duration * limit);
869
- }
861
+ request['from'] = end - defaultSpan;
870
862
  }
863
+ request['to'] = end;
864
+ params = this.omit(params, 'until');
871
865
  const response = await this.publicGetChart(this.extend(request, params));
872
866
  //
873
867
  // [
@@ -1959,6 +1953,7 @@ export default class hollaex extends Exchange {
1959
1953
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
1960
1954
  }
1961
1955
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
1956
+ // { "message": "Invalid token" }
1962
1957
  if (response === undefined) {
1963
1958
  return undefined;
1964
1959
  }
@@ -1966,7 +1961,7 @@ export default class hollaex extends Exchange {
1966
1961
  //
1967
1962
  // { "message": "Invalid token" }
1968
1963
  //
1969
- // different errors return the same code eg:
1964
+ // different errors return the same code eg
1970
1965
  //
1971
1966
  // { "message":"Error 1001 - Order rejected. Order could not be submitted as this order was set to a post only order." }
1972
1967
  //
package/js/src/htx.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import Exchange from './abstract/htx.js';
2
2
  import type { TransferEntry, Int, OrderSide, OrderType, Order, OHLCV, Trade, FundingRateHistory, Balances, Str, Dict, Transaction, Ticker, OrderBook, Tickers, OrderRequest, Strings, Market, Currency, Num, Account, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, LeverageTiers, LeverageTier, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, BorrowInterest, OpenInterests } from './base/types.js';
3
3
  /**
4
- * @class huobi
4
+ * @class htx
5
5
  * @augments Exchange
6
6
  */
7
7
  export default class htx extends Exchange {
package/js/src/htx.js CHANGED
@@ -12,7 +12,7 @@ import { TICK_SIZE, TRUNCATE } from './base/functions/number.js';
12
12
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
13
13
  // ---------------------------------------------------------------------------
14
14
  /**
15
- * @class huobi
15
+ * @class htx
16
16
  * @augments Exchange
17
17
  */
18
18
  export default class htx extends Exchange {
@@ -7560,11 +7560,13 @@ export default class htx extends Exchange {
7560
7560
  'AccessKeyId': this.apiKey,
7561
7561
  'Timestamp': timestamp,
7562
7562
  };
7563
+ // sorting needs such flow exactly, before urlencoding (more at: https://github.com/ccxt/ccxt/issues/24930 )
7564
+ request = this.keysort(request);
7563
7565
  if (method !== 'POST') {
7564
- request = this.extend(request, query);
7566
+ const sortedQuery = this.keysort(query);
7567
+ request = this.extend(request, sortedQuery);
7565
7568
  }
7566
- request = this.keysort(request);
7567
- let auth = this.urlencode(request);
7569
+ let auth = this.urlencode(request).replace('%2c', '%2C'); // in c# it manually needs to be uppercased
7568
7570
  // unfortunately, PHP demands double quotes for the escaped newline symbol
7569
7571
  const payload = [method, hostname, url, auth].join("\n"); // eslint-disable-line quotes
7570
7572
  const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256, 'base64');