ccxt 4.3.53 → 4.3.55

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 (231) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ace.js +1 -1
  5. package/dist/cjs/src/alpaca.js +1 -1
  6. package/dist/cjs/src/ascendex.js +6 -4
  7. package/dist/cjs/src/bigone.js +1 -1
  8. package/dist/cjs/src/binance.js +6 -6
  9. package/dist/cjs/src/bingx.js +4 -4
  10. package/dist/cjs/src/bit2c.js +1 -1
  11. package/dist/cjs/src/bitbank.js +1 -1
  12. package/dist/cjs/src/bitbns.js +1 -1
  13. package/dist/cjs/src/bitfinex.js +1 -1
  14. package/dist/cjs/src/bitfinex2.js +1 -1
  15. package/dist/cjs/src/bitflyer.js +1 -1
  16. package/dist/cjs/src/bitget.js +2 -2
  17. package/dist/cjs/src/bithumb.js +1 -1
  18. package/dist/cjs/src/bitmart.js +3 -3
  19. package/dist/cjs/src/bitmex.js +1 -1
  20. package/dist/cjs/src/bitopro.js +1 -1
  21. package/dist/cjs/src/bitrue.js +1 -1
  22. package/dist/cjs/src/bitso.js +1 -1
  23. package/dist/cjs/src/bitstamp.js +1 -1
  24. package/dist/cjs/src/bitteam.js +1 -1
  25. package/dist/cjs/src/bitvavo.js +2 -2
  26. package/dist/cjs/src/bl3p.js +1 -1
  27. package/dist/cjs/src/blockchaincom.js +28 -28
  28. package/dist/cjs/src/blofin.js +1 -1
  29. package/dist/cjs/src/btcalpha.js +4 -12
  30. package/dist/cjs/src/btcbox.js +1 -1
  31. package/dist/cjs/src/btcmarkets.js +1 -1
  32. package/dist/cjs/src/btcturk.js +1 -1
  33. package/dist/cjs/src/bybit.js +2 -2
  34. package/dist/cjs/src/cex.js +2 -2
  35. package/dist/cjs/src/coinbase.js +33 -33
  36. package/dist/cjs/src/coinbaseexchange.js +1 -1
  37. package/dist/cjs/src/coinbaseinternational.js +1 -1
  38. package/dist/cjs/src/coincheck.js +1 -1
  39. package/dist/cjs/src/coinex.js +2 -2
  40. package/dist/cjs/src/coinlist.js +2 -2
  41. package/dist/cjs/src/coinmate.js +1 -1
  42. package/dist/cjs/src/coinmetro.js +1 -1
  43. package/dist/cjs/src/coinone.js +1 -1
  44. package/dist/cjs/src/coinsph.js +1 -1
  45. package/dist/cjs/src/coinspot.js +1 -1
  46. package/dist/cjs/src/cryptocom.js +1 -1
  47. package/dist/cjs/src/currencycom.js +1 -1
  48. package/dist/cjs/src/delta.js +2 -2
  49. package/dist/cjs/src/deribit.js +4 -4
  50. package/dist/cjs/src/digifinex.js +2 -2
  51. package/dist/cjs/src/exmo.js +2 -2
  52. package/dist/cjs/src/gate.js +2 -2
  53. package/dist/cjs/src/gemini.js +1 -1
  54. package/dist/cjs/src/hitbtc.js +1 -1
  55. package/dist/cjs/src/hollaex.js +1 -1
  56. package/dist/cjs/src/htx.js +3 -3
  57. package/dist/cjs/src/huobijp.js +1 -1
  58. package/dist/cjs/src/hyperliquid.js +2 -2
  59. package/dist/cjs/src/idex.js +1 -1
  60. package/dist/cjs/src/independentreserve.js +1 -1
  61. package/dist/cjs/src/indodax.js +1 -1
  62. package/dist/cjs/src/kraken.js +2 -2
  63. package/dist/cjs/src/kucoin.js +136 -47
  64. package/dist/cjs/src/kucoinfutures.js +1 -1
  65. package/dist/cjs/src/kuna.js +1 -1
  66. package/dist/cjs/src/latoken.js +1 -1
  67. package/dist/cjs/src/lbank.js +1 -1
  68. package/dist/cjs/src/luno.js +1 -1
  69. package/dist/cjs/src/lykke.js +1 -1
  70. package/dist/cjs/src/mercado.js +1 -1
  71. package/dist/cjs/src/mexc.js +1 -1
  72. package/dist/cjs/src/ndax.js +1 -1
  73. package/dist/cjs/src/novadax.js +1 -1
  74. package/dist/cjs/src/oceanex.js +1 -1
  75. package/dist/cjs/src/okcoin.js +1 -1
  76. package/dist/cjs/src/okx.js +3 -3
  77. package/dist/cjs/src/onetrading.js +1 -1
  78. package/dist/cjs/src/oxfun.js +2 -2
  79. package/dist/cjs/src/p2b.js +1 -1
  80. package/dist/cjs/src/paymium.js +1 -1
  81. package/dist/cjs/src/phemex.js +30 -3
  82. package/dist/cjs/src/poloniex.js +6 -4
  83. package/dist/cjs/src/poloniexfutures.js +1 -1
  84. package/dist/cjs/src/pro/binance.js +3 -3
  85. package/dist/cjs/src/pro/bitvavo.js +2 -2
  86. package/dist/cjs/src/pro/bybit.js +22 -14
  87. package/dist/cjs/src/pro/cex.js +3 -3
  88. package/dist/cjs/src/pro/coinbase.js +23 -1
  89. package/dist/cjs/src/pro/cryptocom.js +1 -1
  90. package/dist/cjs/src/pro/gate.js +2 -2
  91. package/dist/cjs/src/pro/hitbtc.js +1 -1
  92. package/dist/cjs/src/pro/kraken.js +2 -2
  93. package/dist/cjs/src/pro/kucoin.js +66 -28
  94. package/dist/cjs/src/pro/okx.js +2 -2
  95. package/dist/cjs/src/pro/oxfun.js +2 -2
  96. package/dist/cjs/src/pro/poloniex.js +1 -1
  97. package/dist/cjs/src/pro/vertex.js +2 -2
  98. package/dist/cjs/src/probit.js +1 -1
  99. package/dist/cjs/src/timex.js +1 -1
  100. package/dist/cjs/src/tokocrypto.js +1 -1
  101. package/dist/cjs/src/tradeogre.js +1 -1
  102. package/dist/cjs/src/upbit.js +1 -1
  103. package/dist/cjs/src/vertex.js +2 -2
  104. package/dist/cjs/src/wavesexchange.js +1 -1
  105. package/dist/cjs/src/wazirx.js +1 -1
  106. package/dist/cjs/src/whitebit.js +2 -2
  107. package/dist/cjs/src/woo.js +34 -26
  108. package/dist/cjs/src/woofipro.js +3 -3
  109. package/dist/cjs/src/yobit.js +1 -1
  110. package/dist/cjs/src/zaif.js +1 -1
  111. package/dist/cjs/src/zonda.js +1 -1
  112. package/js/ccxt.d.ts +1 -1
  113. package/js/ccxt.js +1 -1
  114. package/js/src/abstract/kucoin.d.ts +3 -0
  115. package/js/src/abstract/kucoinfutures.d.ts +3 -0
  116. package/js/src/ace.js +1 -1
  117. package/js/src/alpaca.js +1 -1
  118. package/js/src/ascendex.d.ts +1 -1
  119. package/js/src/ascendex.js +6 -4
  120. package/js/src/base/types.d.ts +4 -0
  121. package/js/src/bigone.js +1 -1
  122. package/js/src/binance.js +6 -6
  123. package/js/src/bingx.js +4 -4
  124. package/js/src/bit2c.js +1 -1
  125. package/js/src/bitbank.js +1 -1
  126. package/js/src/bitbns.js +1 -1
  127. package/js/src/bitfinex.js +1 -1
  128. package/js/src/bitfinex2.js +1 -1
  129. package/js/src/bitflyer.js +1 -1
  130. package/js/src/bitget.js +2 -2
  131. package/js/src/bithumb.js +1 -1
  132. package/js/src/bitmart.js +3 -3
  133. package/js/src/bitmex.js +1 -1
  134. package/js/src/bitopro.js +1 -1
  135. package/js/src/bitrue.js +1 -1
  136. package/js/src/bitso.js +1 -1
  137. package/js/src/bitstamp.js +1 -1
  138. package/js/src/bitteam.js +1 -1
  139. package/js/src/bitvavo.js +2 -2
  140. package/js/src/bl3p.js +1 -1
  141. package/js/src/blockchaincom.js +28 -28
  142. package/js/src/blofin.js +1 -1
  143. package/js/src/btcalpha.js +5 -13
  144. package/js/src/btcbox.js +1 -1
  145. package/js/src/btcmarkets.js +1 -1
  146. package/js/src/btcturk.js +1 -1
  147. package/js/src/bybit.js +2 -2
  148. package/js/src/cex.js +2 -2
  149. package/js/src/coinbase.js +33 -33
  150. package/js/src/coinbaseexchange.js +1 -1
  151. package/js/src/coinbaseinternational.js +1 -1
  152. package/js/src/coincheck.js +1 -1
  153. package/js/src/coinex.js +2 -2
  154. package/js/src/coinlist.js +2 -2
  155. package/js/src/coinmate.js +1 -1
  156. package/js/src/coinmetro.js +1 -1
  157. package/js/src/coinone.js +1 -1
  158. package/js/src/coinsph.js +1 -1
  159. package/js/src/coinspot.js +1 -1
  160. package/js/src/cryptocom.js +1 -1
  161. package/js/src/currencycom.js +1 -1
  162. package/js/src/delta.js +2 -2
  163. package/js/src/deribit.js +4 -4
  164. package/js/src/digifinex.js +2 -2
  165. package/js/src/exmo.js +2 -2
  166. package/js/src/gate.js +2 -2
  167. package/js/src/gemini.js +1 -1
  168. package/js/src/hitbtc.js +1 -1
  169. package/js/src/hollaex.js +1 -1
  170. package/js/src/htx.js +3 -3
  171. package/js/src/huobijp.js +1 -1
  172. package/js/src/hyperliquid.js +2 -2
  173. package/js/src/idex.js +1 -1
  174. package/js/src/independentreserve.js +1 -1
  175. package/js/src/indodax.js +1 -1
  176. package/js/src/kraken.js +2 -2
  177. package/js/src/kucoin.d.ts +1 -0
  178. package/js/src/kucoin.js +136 -47
  179. package/js/src/kucoinfutures.js +1 -1
  180. package/js/src/kuna.js +1 -1
  181. package/js/src/latoken.js +1 -1
  182. package/js/src/lbank.js +1 -1
  183. package/js/src/luno.js +1 -1
  184. package/js/src/lykke.js +1 -1
  185. package/js/src/mercado.js +1 -1
  186. package/js/src/mexc.js +1 -1
  187. package/js/src/ndax.js +1 -1
  188. package/js/src/novadax.js +1 -1
  189. package/js/src/oceanex.js +1 -1
  190. package/js/src/okcoin.js +1 -1
  191. package/js/src/okx.js +3 -3
  192. package/js/src/onetrading.js +1 -1
  193. package/js/src/oxfun.js +2 -2
  194. package/js/src/p2b.js +1 -1
  195. package/js/src/paymium.js +1 -1
  196. package/js/src/phemex.d.ts +1 -1
  197. package/js/src/phemex.js +30 -3
  198. package/js/src/poloniex.js +6 -4
  199. package/js/src/poloniexfutures.js +1 -1
  200. package/js/src/pro/binance.js +3 -3
  201. package/js/src/pro/bitvavo.js +2 -2
  202. package/js/src/pro/bybit.d.ts +1 -1
  203. package/js/src/pro/bybit.js +22 -14
  204. package/js/src/pro/cex.js +3 -3
  205. package/js/src/pro/coinbase.d.ts +1 -0
  206. package/js/src/pro/coinbase.js +23 -1
  207. package/js/src/pro/cryptocom.js +1 -1
  208. package/js/src/pro/gate.js +2 -2
  209. package/js/src/pro/hitbtc.js +1 -1
  210. package/js/src/pro/kraken.js +2 -2
  211. package/js/src/pro/kucoin.js +66 -28
  212. package/js/src/pro/okx.js +2 -2
  213. package/js/src/pro/oxfun.js +2 -2
  214. package/js/src/pro/poloniex.js +1 -1
  215. package/js/src/pro/vertex.js +2 -2
  216. package/js/src/probit.js +1 -1
  217. package/js/src/timex.js +1 -1
  218. package/js/src/tokocrypto.js +1 -1
  219. package/js/src/tradeogre.js +1 -1
  220. package/js/src/upbit.js +1 -1
  221. package/js/src/vertex.js +2 -2
  222. package/js/src/wavesexchange.js +1 -1
  223. package/js/src/wazirx.js +1 -1
  224. package/js/src/whitebit.js +2 -2
  225. package/js/src/woo.d.ts +1 -0
  226. package/js/src/woo.js +34 -26
  227. package/js/src/woofipro.js +3 -3
  228. package/js/src/yobit.js +1 -1
  229. package/js/src/zaif.js +1 -1
  230. package/js/src/zonda.js +1 -1
  231. package/package.json +54 -52
@@ -2225,7 +2225,7 @@ class oxfun extends oxfun$1 {
2225
2225
  * @param {string} type 'market', 'limit', 'STOP_LIMIT' or 'STOP_MARKET'
2226
2226
  * @param {string} side 'buy' or 'sell'
2227
2227
  * @param {float} amount how much of currency you want to trade in units of base currency
2228
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2228
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2229
2229
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2230
2230
  * @param {int} [params.clientOrderId] a unique id for the order
2231
2231
  * @param {int} [params.timestamp] in milliseconds. If an order reaches the matching engine and the current timestamp exceeds timestamp + recvWindow, then the order will be rejected.
@@ -2415,7 +2415,7 @@ class oxfun extends oxfun$1 {
2415
2415
  * @param {string} type 'market', 'limit', 'STOP_LIMIT' or 'STOP_MARKET'
2416
2416
  * @param {string} side 'buy' or 'sell'
2417
2417
  * @param {float} amount how much of currency you want to trade in units of base currency
2418
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2418
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2419
2419
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2420
2420
  * @param {int} [params.clientOrderId] a unique id for the order
2421
2421
  * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
@@ -784,7 +784,7 @@ class p2b extends p2b$1 {
784
784
  * @param {string} type must be 'limit'
785
785
  * @param {string} side 'buy' or 'sell'
786
786
  * @param {float} amount how much of currency you want to trade in units of base currency
787
- * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
787
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency
788
788
  * @param {object} [params] extra parameters specific to the exchange API endpoint
789
789
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
790
790
  */
@@ -390,7 +390,7 @@ class paymium extends paymium$1 {
390
390
  * @param {string} type 'market' or 'limit'
391
391
  * @param {string} side 'buy' or 'sell'
392
392
  * @param {float} amount how much of currency you want to trade in units of base currency
393
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
393
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
394
394
  * @param {object} [params] extra parameters specific to the exchange API endpoint
395
395
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
396
396
  */
@@ -2488,7 +2488,7 @@ class phemex extends phemex$1 {
2488
2488
  * @param {string} type 'market' or 'limit'
2489
2489
  * @param {string} side 'buy' or 'sell'
2490
2490
  * @param {float} amount how much of currency you want to trade in units of base currency
2491
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2491
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2492
2492
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2493
2493
  * @param {float} [params.trigger] trigger price for conditional orders
2494
2494
  * @param {object} [params.takeProfit] *swap only* *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered (perpetual swap markets only)
@@ -2800,7 +2800,7 @@ class phemex extends phemex$1 {
2800
2800
  * @param {string} type 'market' or 'limit'
2801
2801
  * @param {string} side 'buy' or 'sell'
2802
2802
  * @param {float} amount how much of currency you want to trade in units of base currency
2803
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
2803
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2804
2804
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2805
2805
  * @param {string} [params.posSide] either 'Merged' or 'Long' or 'Short'
2806
2806
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2941,14 +2941,41 @@ class phemex extends phemex$1 {
2941
2941
  let response = undefined;
2942
2942
  if (market['settle'] === 'USDT') {
2943
2943
  response = await this.privateDeleteGOrdersAll(this.extend(request, params));
2944
+ //
2945
+ // {
2946
+ // code: '0',
2947
+ // msg: '',
2948
+ // data: '1'
2949
+ // }
2950
+ //
2944
2951
  }
2945
2952
  else if (market['swap']) {
2946
2953
  response = await this.privateDeleteOrdersAll(this.extend(request, params));
2954
+ //
2955
+ // {
2956
+ // code: '0',
2957
+ // msg: '',
2958
+ // data: '1'
2959
+ // }
2960
+ //
2947
2961
  }
2948
2962
  else {
2949
2963
  response = await this.privateDeleteSpotOrdersAll(this.extend(request, params));
2964
+ //
2965
+ // {
2966
+ // code: '0',
2967
+ // msg: '',
2968
+ // data: {
2969
+ // total: '1'
2970
+ // }
2971
+ // }
2972
+ //
2950
2973
  }
2951
- return response;
2974
+ return [
2975
+ this.safeOrder({
2976
+ 'info': response,
2977
+ }),
2978
+ ];
2952
2979
  }
2953
2980
  async fetchOrder(id, symbol = undefined, params = {}) {
2954
2981
  /**
@@ -1254,7 +1254,7 @@ class poloniex extends poloniex$1 {
1254
1254
  * @param {string} type 'market' or 'limit'
1255
1255
  * @param {string} side 'buy' or 'sell'
1256
1256
  * @param {float} amount how much of currency you want to trade in units of base currency
1257
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1257
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1258
1258
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1259
1259
  * @param {float} [params.triggerPrice] *spot only* The price at which a trigger order is triggered at
1260
1260
  * @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
@@ -1288,7 +1288,8 @@ class poloniex extends poloniex$1 {
1288
1288
  // }
1289
1289
  //
1290
1290
  response = this.extend(response, {
1291
- 'type': side,
1291
+ 'type': type,
1292
+ 'side': side,
1292
1293
  });
1293
1294
  return this.parseOrder(response, market);
1294
1295
  }
@@ -1360,7 +1361,7 @@ class poloniex extends poloniex$1 {
1360
1361
  * @param {string} type 'market' or 'limit'
1361
1362
  * @param {string} side 'buy' or 'sell'
1362
1363
  * @param {float} [amount] how much of the currency you want to trade in units of the base currency
1363
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1364
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1364
1365
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1365
1366
  * @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
1366
1367
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -1390,7 +1391,8 @@ class poloniex extends poloniex$1 {
1390
1391
  // }
1391
1392
  //
1392
1393
  response = this.extend(response, {
1393
- 'type': side,
1394
+ 'side': side,
1395
+ 'type': type,
1394
1396
  });
1395
1397
  return this.parseOrder(response, market);
1396
1398
  }
@@ -831,7 +831,7 @@ class poloniexfutures extends poloniexfutures$1 {
831
831
  * @param {string} type 'limit' or 'market'
832
832
  * @param {string} side 'buy' or 'sell'
833
833
  * @param {float} amount the amount of currency to trade
834
- * @param {float} [price] *ignored in "market" orders* the price at which the order is to be fullfilled at in units of the quote currency
834
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
835
835
  * @param {object} [params] extra parameters specific to the exchange API endpoint
836
836
  * @param {float} [params.leverage] Leverage size of the order
837
837
  * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
@@ -2344,7 +2344,7 @@ class binance extends binance$1 {
2344
2344
  * @param {string} type 'market' or 'limit'
2345
2345
  * @param {string} side 'buy' or 'sell'
2346
2346
  * @param {float} amount how much of currency you want to trade in units of base currency
2347
- * @param {float|undefined} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2347
+ * @param {float|undefined} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2348
2348
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2349
2349
  * @param {boolean} params.test test order, default false
2350
2350
  * @param {boolean} params.returnRateLimits set to true to return rate limit information, default false
@@ -2493,7 +2493,7 @@ class binance extends binance$1 {
2493
2493
  * @param {string} type 'market' or 'limit'
2494
2494
  * @param {string} side 'buy' or 'sell'
2495
2495
  * @param {float} amount how much of the currency you want to trade in units of the base currency
2496
- * @param {float|undefined} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2496
+ * @param {float|undefined} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
2497
2497
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2498
2498
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2499
2499
  */
@@ -3730,7 +3730,7 @@ class binance extends binance$1 {
3730
3730
  rejected = true;
3731
3731
  // private endpoint uses id as messageHash
3732
3732
  client.reject(e, id);
3733
- // public endpoint stores messageHash in subscriptios
3733
+ // public endpoint stores messageHash in subscriptions
3734
3734
  const subscriptionKeys = Object.keys(client.subscriptions);
3735
3735
  for (let i = 0; i < subscriptionKeys.length; i++) {
3736
3736
  const subscriptionHash = subscriptionKeys[i];
@@ -538,7 +538,7 @@ class bitvavo extends bitvavo$1 {
538
538
  * @param {string} type 'market' or 'limit'
539
539
  * @param {string} side 'buy' or 'sell'
540
540
  * @param {float} amount how much of currency you want to trade in units of base currency
541
- * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
541
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
542
542
  * @param {object} [params] extra parameters specific to the bitvavo api endpoint
543
543
  * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
544
544
  * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
@@ -569,7 +569,7 @@ class bitvavo extends bitvavo$1 {
569
569
  * @param {string} type 'market' or 'limit'
570
570
  * @param {string} side 'buy' or 'sell'
571
571
  * @param {float} [amount] how much of currency you want to trade in units of base currency
572
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
572
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
573
573
  * @param {object} [params] extra parameters specific to the bitvavo api endpoint
574
574
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
575
575
  */
@@ -132,7 +132,7 @@ class bybit extends bybit$1 {
132
132
  this.options['requestId'] = requestId;
133
133
  return requestId;
134
134
  }
135
- getUrlByMarketType(symbol = undefined, isPrivate = false, method = undefined, params = {}) {
135
+ async getUrlByMarketType(symbol = undefined, isPrivate = false, method = undefined, params = {}) {
136
136
  const accessibility = isPrivate ? 'private' : 'public';
137
137
  let isUsdcSettled = undefined;
138
138
  let isSpot = undefined;
@@ -152,7 +152,15 @@ class bybit extends bybit$1 {
152
152
  }
153
153
  isSpot = (type === 'spot');
154
154
  if (isPrivate) {
155
- url = (isUsdcSettled) ? url[accessibility]['usdc'] : url[accessibility]['contract'];
155
+ const unified = await this.isUnifiedEnabled();
156
+ const isUnifiedMargin = this.safeBool(unified, 0, false);
157
+ const isUnifiedAccount = this.safeBool(unified, 1, false);
158
+ if (isUsdcSettled && !isUnifiedMargin && !isUnifiedAccount) {
159
+ url = url[accessibility]['usdc'];
160
+ }
161
+ else {
162
+ url = url[accessibility]['contract'];
163
+ }
156
164
  }
157
165
  else {
158
166
  if (isSpot) {
@@ -186,7 +194,7 @@ class bybit extends bybit$1 {
186
194
  * @param {string} type 'market' or 'limit'
187
195
  * @param {string} side 'buy' or 'sell'
188
196
  * @param {float} amount how much of currency you want to trade in units of base currency
189
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
197
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
190
198
  * @param {object} [params] extra parameters specific to the exchange API endpoint
191
199
  * @param {string} [params.timeInForce] "GTC", "IOC", "FOK"
192
200
  * @param {bool} [params.postOnly] true or false whether the order is post-only
@@ -237,7 +245,7 @@ class bybit extends bybit$1 {
237
245
  * @param {string} type 'market' or 'limit'
238
246
  * @param {string} side 'buy' or 'sell'
239
247
  * @param {float} amount how much of currency you want to trade in units of base currency
240
- * @param {float} price the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
248
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
241
249
  * @param {object} [params] extra parameters specific to the exchange API endpoint
242
250
  * @param {float} [params.triggerPrice] The price that a trigger order is triggered at
243
251
  * @param {float} [params.stopLossPrice] The price that a stop loss order is triggered at
@@ -319,7 +327,7 @@ class bybit extends bybit$1 {
319
327
  const market = this.market(symbol);
320
328
  symbol = market['symbol'];
321
329
  const messageHash = 'ticker:' + symbol;
322
- const url = this.getUrlByMarketType(symbol, false, 'watchTicker', params);
330
+ const url = await this.getUrlByMarketType(symbol, false, 'watchTicker', params);
323
331
  params = this.cleanParams(params);
324
332
  const options = this.safeValue(this.options, 'watchTicker', {});
325
333
  let topic = this.safeString(options, 'name', 'tickers');
@@ -344,7 +352,7 @@ class bybit extends bybit$1 {
344
352
  await this.loadMarkets();
345
353
  symbols = this.marketSymbols(symbols, undefined, false);
346
354
  const messageHashes = [];
347
- const url = this.getUrlByMarketType(symbols[0], false, 'watchTickers', params);
355
+ const url = await this.getUrlByMarketType(symbols[0], false, 'watchTickers', params);
348
356
  params = this.cleanParams(params);
349
357
  const options = this.safeValue(this.options, 'watchTickers', {});
350
358
  const topic = this.safeString(options, 'name', 'tickers');
@@ -525,7 +533,7 @@ class bybit extends bybit$1 {
525
533
  await this.loadMarkets();
526
534
  const market = this.market(symbol);
527
535
  symbol = market['symbol'];
528
- const url = this.getUrlByMarketType(symbol, false, 'watchOHLCV', params);
536
+ const url = await this.getUrlByMarketType(symbol, false, 'watchOHLCV', params);
529
537
  params = this.cleanParams(params);
530
538
  let ohlcv = undefined;
531
539
  const timeframeId = this.safeString(this.timeframes, timeframe, timeframe);
@@ -643,7 +651,7 @@ class bybit extends bybit$1 {
643
651
  throw new errors.ArgumentsRequired(this.id + ' watchOrderBookForSymbols() requires a non-empty array of symbols');
644
652
  }
645
653
  symbols = this.marketSymbols(symbols);
646
- const url = this.getUrlByMarketType(symbols[0], false, 'watchOrderBook', params);
654
+ const url = await this.getUrlByMarketType(symbols[0], false, 'watchOrderBook', params);
647
655
  params = this.cleanParams(params);
648
656
  const market = this.market(symbols[0]);
649
657
  if (limit === undefined) {
@@ -775,7 +783,7 @@ class bybit extends bybit$1 {
775
783
  throw new errors.ArgumentsRequired(this.id + ' watchTradesForSymbols() requires a non-empty array of symbols');
776
784
  }
777
785
  params = this.cleanParams(params);
778
- const url = this.getUrlByMarketType(symbols[0], false, 'watchTrades', params);
786
+ const url = await this.getUrlByMarketType(symbols[0], false, 'watchTrades', params);
779
787
  const topics = [];
780
788
  const messageHashes = [];
781
789
  for (let i = 0; i < symbols.length; i++) {
@@ -938,7 +946,7 @@ class bybit extends bybit$1 {
938
946
  symbol = this.symbol(symbol);
939
947
  messageHash += ':' + symbol;
940
948
  }
941
- const url = this.getUrlByMarketType(symbol, true, method, params);
949
+ const url = await this.getUrlByMarketType(symbol, true, method, params);
942
950
  await this.authenticate(url);
943
951
  const topicByMarket = {
944
952
  'spot': 'ticketInfo',
@@ -1067,7 +1075,7 @@ class bybit extends bybit$1 {
1067
1075
  messageHash = '::' + symbols.join(',');
1068
1076
  }
1069
1077
  const firstSymbol = this.safeString(symbols, 0);
1070
- const url = this.getUrlByMarketType(firstSymbol, true, method, params);
1078
+ const url = await this.getUrlByMarketType(firstSymbol, true, method, params);
1071
1079
  messageHash = 'positions' + messageHash;
1072
1080
  const client = this.client(url);
1073
1081
  await this.authenticate(url);
@@ -1218,7 +1226,7 @@ class bybit extends bybit$1 {
1218
1226
  await this.loadMarkets();
1219
1227
  const market = this.market(symbol);
1220
1228
  symbol = market['symbol'];
1221
- const url = this.getUrlByMarketType(symbol, false, 'watchLiquidations', params);
1229
+ const url = await this.getUrlByMarketType(symbol, false, 'watchLiquidations', params);
1222
1230
  params = this.cleanParams(params);
1223
1231
  const messageHash = 'liquidations::' + symbol;
1224
1232
  const topic = 'liquidation.' + market['id'];
@@ -1302,7 +1310,7 @@ class bybit extends bybit$1 {
1302
1310
  symbol = this.symbol(symbol);
1303
1311
  messageHash += ':' + symbol;
1304
1312
  }
1305
- const url = this.getUrlByMarketType(symbol, true, method, params);
1313
+ const url = await this.getUrlByMarketType(symbol, true, method, params);
1306
1314
  await this.authenticate(url);
1307
1315
  const topicsByMarket = {
1308
1316
  'spot': ['order', 'stopOrder'],
@@ -1614,7 +1622,7 @@ class bybit extends bybit$1 {
1614
1622
  const unified = await this.isUnifiedEnabled();
1615
1623
  const isUnifiedMargin = this.safeBool(unified, 0, false);
1616
1624
  const isUnifiedAccount = this.safeBool(unified, 1, false);
1617
- const url = this.getUrlByMarketType(undefined, true, method, params);
1625
+ const url = await this.getUrlByMarketType(undefined, true, method, params);
1618
1626
  await this.authenticate(url);
1619
1627
  const topicByMarket = {
1620
1628
  'spot': 'outboundAccountInfo',
@@ -671,7 +671,7 @@ class cex extends cex$1 {
671
671
  // }
672
672
  // }
673
673
  // }
674
- // fullfilledOrder
674
+ // fulfilledOrder
675
675
  // {
676
676
  // "e": "order",
677
677
  // "data": {
@@ -1255,7 +1255,7 @@ class cex extends cex$1 {
1255
1255
  * @param {string} type 'market' or 'limit'
1256
1256
  * @param {string} side 'buy' or 'sell'
1257
1257
  * @param {float} amount how much of currency you want to trade in units of base currency
1258
- * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1258
+ * @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1259
1259
  * @param {object} [params] extra parameters specific to the kraken api endpoint
1260
1260
  * @param {boolean} [params.maker_only] Optional, maker only places an order only if offers best sell (<= max) or buy(>= max) price for this pair, if not order placement will be rejected with an error - "Order is not maker"
1261
1261
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
@@ -1293,7 +1293,7 @@ class cex extends cex$1 {
1293
1293
  * @param {string} type 'market' or 'limit'
1294
1294
  * @param {string} side 'buy' or 'sell'
1295
1295
  * @param {float} amount how much of the currency you want to trade in units of the base currency
1296
- * @param {float|undefined} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1296
+ * @param {float|undefined} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1297
1297
  * @param {object} [params] extra parameters specific to the cex api endpoint
1298
1298
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/en/latest/manual.html#order-structure}
1299
1299
  */
@@ -707,6 +707,25 @@ class coinbase extends coinbase$1 {
707
707
  //
708
708
  return message;
709
709
  }
710
+ handleHeartbeats(client, message) {
711
+ // although the subscription takes a product_ids parameter (i.e. symbol),
712
+ // there is no (clear) way of mapping the message back to the symbol.
713
+ //
714
+ // {
715
+ // "channel": "heartbeats",
716
+ // "client_id": "",
717
+ // "timestamp": "2023-06-23T20:31:26.122969572Z",
718
+ // "sequence_num": 0,
719
+ // "events": [
720
+ // {
721
+ // "current_time": "2023-06-23 20:31:56.121961769 +0000 UTC m=+91717.525857105",
722
+ // "heartbeat_counter": "3049"
723
+ // }
724
+ // ]
725
+ // }
726
+ //
727
+ return message;
728
+ }
710
729
  handleMessage(client, message) {
711
730
  const channel = this.safeString(message, 'channel');
712
731
  const methods = {
@@ -716,6 +735,7 @@ class coinbase extends coinbase$1 {
716
735
  'market_trades': this.handleTrade,
717
736
  'user': this.handleOrder,
718
737
  'l2_data': this.handleOrderBook,
738
+ 'heartbeats': this.handleHeartbeats,
719
739
  };
720
740
  const type = this.safeString(message, 'type');
721
741
  if (type === 'error') {
@@ -723,7 +743,9 @@ class coinbase extends coinbase$1 {
723
743
  throw new errors.ExchangeError(errorMessage);
724
744
  }
725
745
  const method = this.safeValue(methods, channel);
726
- method.call(this, client, message);
746
+ if (method) {
747
+ method.call(this, client, message);
748
+ }
727
749
  }
728
750
  }
729
751
 
@@ -735,7 +735,7 @@ class cryptocom extends cryptocom$1 {
735
735
  * @param {string} type 'market' or 'limit'
736
736
  * @param {string} side 'buy' or 'sell'
737
737
  * @param {float} amount how much of currency you want to trade in units of base currency
738
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
738
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
739
739
  * @param {object} [params] extra parameters specific to the exchange API endpoint
740
740
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
741
741
  */
@@ -129,7 +129,7 @@ class gate extends gate$1 {
129
129
  * @param {string} type 'limit' or 'market' *"market" is contract only*
130
130
  * @param {string} side 'buy' or 'sell'
131
131
  * @param {float} amount the amount of currency to trade
132
- * @param {float} [price] *ignored in "market" orders* the price at which the order is to be fullfilled at in units of the quote currency
132
+ * @param {float} [price] *ignored in "market" orders* the price at which the order is to be fulfilled at in units of the quote currency
133
133
  * @param {object} [params] extra parameters specific to the exchange API endpoint
134
134
  * @param {float} [params.stopPrice] The price at which a trigger order is triggered at
135
135
  * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
@@ -249,7 +249,7 @@ class gate extends gate$1 {
249
249
  * @param {string} type 'market' or 'limit'
250
250
  * @param {string} side 'buy' or 'sell'
251
251
  * @param {float} amount how much of the currency you want to trade in units of the base currency
252
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
252
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
253
253
  * @param {object} [params] extra parameters specific to the exchange API endpoint
254
254
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
255
255
  */
@@ -1005,7 +1005,7 @@ class hitbtc extends hitbtc$1 {
1005
1005
  * @param {string} type 'market' or 'limit'
1006
1006
  * @param {string} side 'buy' or 'sell'
1007
1007
  * @param {float} amount how much of currency you want to trade in units of base currency
1008
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1008
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1009
1009
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1010
1010
  * @param {string} [params.marginMode] 'cross' or 'isolated' only 'isolated' is supported for spot-margin, swap supports both, default is 'cross'
1011
1011
  * @param {bool} [params.margin] true for creating a margin order
@@ -115,7 +115,7 @@ class kraken extends kraken$1 {
115
115
  * @param {string} type 'market' or 'limit'
116
116
  * @param {string} side 'buy' or 'sell'
117
117
  * @param {float} amount how much of currency you want to trade in units of base currency
118
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
118
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
119
119
  * @param {object} [params] extra parameters specific to the exchange API endpoint
120
120
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
121
121
  */
@@ -172,7 +172,7 @@ class kraken extends kraken$1 {
172
172
  * @param {string} type 'market' or 'limit'
173
173
  * @param {string} side 'buy' or 'sell'
174
174
  * @param {float} amount how much of the currency you want to trade in units of the base currency
175
- * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
175
+ * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
176
176
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177
177
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
178
178
  */