ccxt 4.1.63 → 4.1.65

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 (293) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.js +2769 -2653
  3. package/dist/ccxt.browser.min.js +3 -3
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ace.js +13 -13
  6. package/dist/cjs/src/alpaca.js +10 -10
  7. package/dist/cjs/src/ascendex.js +33 -33
  8. package/dist/cjs/src/base/Exchange.js +6 -6
  9. package/dist/cjs/src/bigone.js +23 -23
  10. package/dist/cjs/src/binance.js +68 -68
  11. package/dist/cjs/src/binanceus.js +33 -3
  12. package/dist/cjs/src/bingx.js +33 -33
  13. package/dist/cjs/src/bit2c.js +11 -11
  14. package/dist/cjs/src/bitbank.js +14 -14
  15. package/dist/cjs/src/bitbns.js +15 -15
  16. package/dist/cjs/src/bitfinex.js +24 -24
  17. package/dist/cjs/src/bitfinex2.js +30 -30
  18. package/dist/cjs/src/bitflyer.js +17 -17
  19. package/dist/cjs/src/bitforex.js +12 -12
  20. package/dist/cjs/src/bitget.js +50 -50
  21. package/dist/cjs/src/bithumb.js +13 -13
  22. package/dist/cjs/src/bitmart.js +74 -59
  23. package/dist/cjs/src/bitmex.js +29 -28
  24. package/dist/cjs/src/bitopro.js +23 -23
  25. package/dist/cjs/src/bitpanda.js +25 -25
  26. package/dist/cjs/src/bitrue.js +26 -26
  27. package/dist/cjs/src/bitso.js +22 -22
  28. package/dist/cjs/src/bitstamp.js +24 -24
  29. package/dist/cjs/src/bittrex.js +31 -31
  30. package/dist/cjs/src/bitvavo.js +23 -23
  31. package/dist/cjs/src/bl3p.js +7 -7
  32. package/dist/cjs/src/blockchaincom.js +23 -23
  33. package/dist/cjs/src/btcalpha.js +17 -17
  34. package/dist/cjs/src/btcbox.js +9 -9
  35. package/dist/cjs/src/btcmarkets.js +19 -19
  36. package/dist/cjs/src/btcturk.js +13 -13
  37. package/dist/cjs/src/bybit.js +71 -67
  38. package/dist/cjs/src/cex.js +17 -17
  39. package/dist/cjs/src/coinbase.js +28 -28
  40. package/dist/cjs/src/coinbasepro.js +27 -27
  41. package/dist/cjs/src/coincheck.js +11 -11
  42. package/dist/cjs/src/coinex.js +42 -42
  43. package/dist/cjs/src/coinlist.js +29 -29
  44. package/dist/cjs/src/coinmate.js +14 -14
  45. package/dist/cjs/src/coinone.js +13 -13
  46. package/dist/cjs/src/coinsph.js +25 -25
  47. package/dist/cjs/src/coinspot.js +9 -9
  48. package/dist/cjs/src/cryptocom.js +33 -32
  49. package/dist/cjs/src/currencycom.js +24 -24
  50. package/dist/cjs/src/delta.js +29 -29
  51. package/dist/cjs/src/deribit.js +35 -35
  52. package/dist/cjs/src/digifinex.js +43 -43
  53. package/dist/cjs/src/exmo.js +30 -30
  54. package/dist/cjs/src/gate.js +39 -39
  55. package/dist/cjs/src/gemini.js +18 -18
  56. package/dist/cjs/src/hitbtc.js +40 -40
  57. package/dist/cjs/src/hollaex.js +26 -26
  58. package/dist/cjs/src/htx.js +48 -48
  59. package/dist/cjs/src/huobijp.js +24 -24
  60. package/dist/cjs/src/idex.js +23 -23
  61. package/dist/cjs/src/independentreserve.js +12 -12
  62. package/dist/cjs/src/indodax.js +16 -16
  63. package/dist/cjs/src/kraken.js +48 -30
  64. package/dist/cjs/src/krakenfutures.js +16 -16
  65. package/dist/cjs/src/kucoin.js +39 -39
  66. package/dist/cjs/src/kucoinfutures.js +24 -24
  67. package/dist/cjs/src/kuna.js +25 -25
  68. package/dist/cjs/src/latoken.js +20 -20
  69. package/dist/cjs/src/lbank.js +24 -24
  70. package/dist/cjs/src/luno.js +27 -28
  71. package/dist/cjs/src/lykke.js +18 -18
  72. package/dist/cjs/src/mercado.js +13 -13
  73. package/dist/cjs/src/mexc.js +47 -45
  74. package/dist/cjs/src/ndax.js +23 -23
  75. package/dist/cjs/src/novadax.js +23 -23
  76. package/dist/cjs/src/oceanex.js +19 -19
  77. package/dist/cjs/src/okcoin.js +25 -25
  78. package/dist/cjs/src/okx.js +53 -53
  79. package/dist/cjs/src/p2b.js +14 -14
  80. package/dist/cjs/src/paymium.js +10 -10
  81. package/dist/cjs/src/phemex.js +162 -123
  82. package/dist/cjs/src/poloniex.js +27 -27
  83. package/dist/cjs/src/poloniexfutures.js +21 -21
  84. package/dist/cjs/src/pro/alpaca.js +6 -6
  85. package/dist/cjs/src/pro/ascendex.js +5 -5
  86. package/dist/cjs/src/pro/binance.js +21 -21
  87. package/dist/cjs/src/pro/bingx.js +6 -6
  88. package/dist/cjs/src/pro/bitfinex.js +4 -4
  89. package/dist/cjs/src/pro/bitfinex2.js +7 -7
  90. package/dist/cjs/src/pro/bitget.js +12 -12
  91. package/dist/cjs/src/pro/bitmart.js +5 -5
  92. package/dist/cjs/src/pro/bitmex.js +8 -8
  93. package/dist/cjs/src/pro/bitopro.js +4 -4
  94. package/dist/cjs/src/pro/bitpanda.js +7 -7
  95. package/dist/cjs/src/pro/bitrue.js +2 -2
  96. package/dist/cjs/src/pro/bitstamp.js +3 -3
  97. package/dist/cjs/src/pro/bittrex.js +7 -7
  98. package/dist/cjs/src/pro/bitvavo.js +6 -6
  99. package/dist/cjs/src/pro/blockchaincom.js +6 -6
  100. package/dist/cjs/src/pro/bybit.js +12 -12
  101. package/dist/cjs/src/pro/cex.js +9 -9
  102. package/dist/cjs/src/pro/coinbase.js +6 -6
  103. package/dist/cjs/src/pro/coinbasepro.js +10 -10
  104. package/dist/cjs/src/pro/coinex.js +7 -7
  105. package/dist/cjs/src/pro/cryptocom.js +13 -13
  106. package/dist/cjs/src/pro/currencycom.js +5 -5
  107. package/dist/cjs/src/pro/deribit.js +7 -7
  108. package/dist/cjs/src/pro/exmo.js +5 -5
  109. package/dist/cjs/src/pro/gate.js +10 -10
  110. package/dist/cjs/src/pro/gemini.js +4 -4
  111. package/dist/cjs/src/pro/hitbtc.js +11 -11
  112. package/dist/cjs/src/pro/hollaex.js +5 -5
  113. package/dist/cjs/src/pro/htx.js +8 -8
  114. package/dist/cjs/src/pro/huobijp.js +4 -4
  115. package/dist/cjs/src/pro/idex.js +5 -5
  116. package/dist/cjs/src/pro/independentreserve.js +2 -2
  117. package/dist/cjs/src/pro/kraken.js +11 -11
  118. package/dist/cjs/src/pro/krakenfutures.js +12 -9
  119. package/dist/cjs/src/pro/kucoin.js +10 -10
  120. package/dist/cjs/src/pro/kucoinfutures.js +8 -8
  121. package/dist/cjs/src/pro/luno.js +4 -4
  122. package/dist/cjs/src/pro/mexc.js +7 -7
  123. package/dist/cjs/src/pro/ndax.js +4 -4
  124. package/dist/cjs/src/pro/okcoin.js +6 -6
  125. package/dist/cjs/src/pro/okx.js +16 -16
  126. package/dist/cjs/src/pro/phemex.js +7 -7
  127. package/dist/cjs/src/pro/poloniex.js +7 -7
  128. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  129. package/dist/cjs/src/pro/probit.js +6 -6
  130. package/dist/cjs/src/pro/upbit.js +3 -3
  131. package/dist/cjs/src/pro/wazirx.js +7 -7
  132. package/dist/cjs/src/pro/whitebit.js +7 -7
  133. package/dist/cjs/src/pro/woo.js +1 -1
  134. package/dist/cjs/src/probit.js +24 -24
  135. package/dist/cjs/src/tidex.js +15 -15
  136. package/dist/cjs/src/timex.js +19 -19
  137. package/dist/cjs/src/tokocrypto.js +22 -24
  138. package/dist/cjs/src/upbit.js +22 -22
  139. package/dist/cjs/src/wavesexchange.js +19 -19
  140. package/dist/cjs/src/wazirx.js +22 -16
  141. package/dist/cjs/src/whitebit.js +29 -29
  142. package/dist/cjs/src/woo.js +26 -26
  143. package/dist/cjs/src/yobit.js +17 -17
  144. package/dist/cjs/src/zaif.js +10 -10
  145. package/dist/cjs/src/zonda.js +16 -16
  146. package/doc/manual.rst +1 -1
  147. package/doc/readme.rst +1 -1
  148. package/js/ccxt.d.ts +1 -1
  149. package/js/ccxt.js +1 -1
  150. package/js/src/abstract/mexc.d.ts +2 -0
  151. package/js/src/ace.js +13 -13
  152. package/js/src/alpaca.js +10 -10
  153. package/js/src/ascendex.js +33 -33
  154. package/js/src/base/Exchange.js +6 -6
  155. package/js/src/bigone.js +23 -23
  156. package/js/src/binance.js +68 -68
  157. package/js/src/binanceus.js +33 -3
  158. package/js/src/bingx.js +33 -33
  159. package/js/src/bit2c.js +11 -11
  160. package/js/src/bitbank.js +14 -14
  161. package/js/src/bitbns.js +15 -15
  162. package/js/src/bitfinex.js +24 -24
  163. package/js/src/bitfinex2.js +30 -30
  164. package/js/src/bitflyer.js +17 -17
  165. package/js/src/bitforex.js +12 -12
  166. package/js/src/bitget.js +50 -50
  167. package/js/src/bithumb.js +13 -13
  168. package/js/src/bitmart.js +74 -59
  169. package/js/src/bitmex.js +29 -28
  170. package/js/src/bitopro.js +23 -23
  171. package/js/src/bitpanda.js +25 -25
  172. package/js/src/bitrue.js +26 -26
  173. package/js/src/bitso.js +22 -22
  174. package/js/src/bitstamp.js +24 -24
  175. package/js/src/bittrex.js +31 -31
  176. package/js/src/bitvavo.js +23 -23
  177. package/js/src/bl3p.js +7 -7
  178. package/js/src/blockchaincom.js +23 -23
  179. package/js/src/btcalpha.js +17 -17
  180. package/js/src/btcbox.js +9 -9
  181. package/js/src/btcmarkets.js +19 -19
  182. package/js/src/btcturk.js +13 -13
  183. package/js/src/bybit.js +71 -67
  184. package/js/src/cex.js +17 -17
  185. package/js/src/coinbase.js +28 -28
  186. package/js/src/coinbasepro.js +27 -27
  187. package/js/src/coincheck.js +11 -11
  188. package/js/src/coinex.js +42 -42
  189. package/js/src/coinlist.js +29 -29
  190. package/js/src/coinmate.js +14 -14
  191. package/js/src/coinone.js +13 -13
  192. package/js/src/coinsph.js +25 -25
  193. package/js/src/coinspot.js +9 -9
  194. package/js/src/cryptocom.js +33 -32
  195. package/js/src/currencycom.js +24 -24
  196. package/js/src/delta.js +29 -29
  197. package/js/src/deribit.js +35 -35
  198. package/js/src/digifinex.js +43 -43
  199. package/js/src/exmo.js +30 -30
  200. package/js/src/gate.js +39 -39
  201. package/js/src/gemini.js +18 -18
  202. package/js/src/hitbtc.js +40 -40
  203. package/js/src/hollaex.js +26 -26
  204. package/js/src/htx.js +48 -48
  205. package/js/src/huobijp.js +24 -24
  206. package/js/src/idex.js +23 -23
  207. package/js/src/independentreserve.js +12 -12
  208. package/js/src/indodax.js +16 -16
  209. package/js/src/kraken.js +48 -30
  210. package/js/src/krakenfutures.js +16 -16
  211. package/js/src/kucoin.js +39 -39
  212. package/js/src/kucoinfutures.js +24 -24
  213. package/js/src/kuna.js +25 -25
  214. package/js/src/latoken.js +20 -20
  215. package/js/src/lbank.js +24 -24
  216. package/js/src/luno.js +27 -28
  217. package/js/src/lykke.js +18 -18
  218. package/js/src/mercado.js +13 -13
  219. package/js/src/mexc.js +47 -45
  220. package/js/src/ndax.js +23 -23
  221. package/js/src/novadax.js +23 -23
  222. package/js/src/oceanex.js +19 -19
  223. package/js/src/okcoin.js +25 -25
  224. package/js/src/okx.js +53 -53
  225. package/js/src/p2b.js +14 -14
  226. package/js/src/paymium.js +10 -10
  227. package/js/src/phemex.js +162 -123
  228. package/js/src/poloniex.js +27 -27
  229. package/js/src/poloniexfutures.js +21 -21
  230. package/js/src/pro/alpaca.js +6 -6
  231. package/js/src/pro/ascendex.js +5 -5
  232. package/js/src/pro/binance.js +21 -21
  233. package/js/src/pro/bingx.js +6 -6
  234. package/js/src/pro/bitfinex.js +4 -4
  235. package/js/src/pro/bitfinex2.js +7 -7
  236. package/js/src/pro/bitget.js +12 -12
  237. package/js/src/pro/bitmart.js +5 -5
  238. package/js/src/pro/bitmex.js +8 -8
  239. package/js/src/pro/bitopro.js +4 -4
  240. package/js/src/pro/bitpanda.js +7 -7
  241. package/js/src/pro/bitrue.js +2 -2
  242. package/js/src/pro/bitstamp.js +3 -3
  243. package/js/src/pro/bittrex.js +7 -7
  244. package/js/src/pro/bitvavo.js +6 -6
  245. package/js/src/pro/blockchaincom.js +6 -6
  246. package/js/src/pro/bybit.js +12 -12
  247. package/js/src/pro/cex.js +9 -9
  248. package/js/src/pro/coinbase.js +6 -6
  249. package/js/src/pro/coinbasepro.js +10 -10
  250. package/js/src/pro/coinex.js +7 -7
  251. package/js/src/pro/cryptocom.js +13 -13
  252. package/js/src/pro/currencycom.js +5 -5
  253. package/js/src/pro/deribit.js +7 -7
  254. package/js/src/pro/exmo.js +5 -5
  255. package/js/src/pro/gate.js +10 -10
  256. package/js/src/pro/gemini.js +4 -4
  257. package/js/src/pro/hitbtc.js +11 -11
  258. package/js/src/pro/hollaex.js +5 -5
  259. package/js/src/pro/htx.js +8 -8
  260. package/js/src/pro/huobijp.js +4 -4
  261. package/js/src/pro/idex.js +5 -5
  262. package/js/src/pro/independentreserve.js +2 -2
  263. package/js/src/pro/kraken.js +11 -11
  264. package/js/src/pro/krakenfutures.js +12 -9
  265. package/js/src/pro/kucoin.js +10 -10
  266. package/js/src/pro/kucoinfutures.js +8 -8
  267. package/js/src/pro/luno.js +4 -4
  268. package/js/src/pro/mexc.js +7 -7
  269. package/js/src/pro/ndax.js +4 -4
  270. package/js/src/pro/okcoin.js +6 -6
  271. package/js/src/pro/okx.js +16 -16
  272. package/js/src/pro/phemex.js +7 -7
  273. package/js/src/pro/poloniex.js +7 -7
  274. package/js/src/pro/poloniexfutures.js +5 -5
  275. package/js/src/pro/probit.js +6 -6
  276. package/js/src/pro/upbit.js +3 -3
  277. package/js/src/pro/wazirx.js +7 -7
  278. package/js/src/pro/whitebit.js +7 -7
  279. package/js/src/pro/woo.js +1 -1
  280. package/js/src/probit.js +24 -24
  281. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  282. package/js/src/tidex.js +15 -15
  283. package/js/src/timex.js +19 -19
  284. package/js/src/tokocrypto.js +22 -24
  285. package/js/src/upbit.js +22 -22
  286. package/js/src/wavesexchange.js +19 -19
  287. package/js/src/wazirx.js +22 -16
  288. package/js/src/whitebit.js +29 -29
  289. package/js/src/woo.js +26 -26
  290. package/js/src/yobit.js +17 -17
  291. package/js/src/zaif.js +10 -10
  292. package/js/src/zonda.js +16 -16
  293. package/package.json +1 -1
@@ -595,7 +595,7 @@ class bitmart extends bitmart$1 {
595
595
  * @method
596
596
  * @name bitmart#fetchTime
597
597
  * @description fetches the current integer timestamp in milliseconds from the exchange server
598
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
598
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
599
599
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
600
600
  */
601
601
  const response = await this.publicGetSystemTime(params);
@@ -617,7 +617,7 @@ class bitmart extends bitmart$1 {
617
617
  * @method
618
618
  * @name bitmart#fetchStatus
619
619
  * @description the latest known information on the availability of the exchange API
620
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
620
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
621
621
  * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
622
622
  */
623
623
  const options = this.safeValue(this.options, 'fetchStatus', {});
@@ -887,7 +887,7 @@ class bitmart extends bitmart$1 {
887
887
  * @method
888
888
  * @name bitmart#fetchMarkets
889
889
  * @description retrieves data on all markets for bitmart
890
- * @param {object} [params] extra parameters specific to the exchange api endpoint
890
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
891
891
  * @returns {object[]} an array of objects representing market data
892
892
  */
893
893
  const spot = await this.fetchSpotMarkets(params);
@@ -899,7 +899,7 @@ class bitmart extends bitmart$1 {
899
899
  * @method
900
900
  * @name bitmart#fetchCurrencies
901
901
  * @description fetches all available currencies on an exchange
902
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
902
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
903
903
  * @returns {object} an associative dictionary of currencies
904
904
  */
905
905
  const response = await this.publicGetSpotV1Currencies(params);
@@ -953,7 +953,7 @@ class bitmart extends bitmart$1 {
953
953
  * @deprecated
954
954
  * @description please use fetchDepositWithdrawFee instead
955
955
  * @param {string} code unified currency code
956
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
956
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
957
957
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
958
958
  */
959
959
  await this.loadMarkets();
@@ -1012,7 +1012,7 @@ class bitmart extends bitmart$1 {
1012
1012
  * @name bitmart#fetchDepositWithdrawFee
1013
1013
  * @description fetch the fee for deposits and withdrawals
1014
1014
  * @param {string} code unified currency code
1015
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1015
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1016
1016
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1017
1017
  */
1018
1018
  await this.loadMarkets();
@@ -1125,22 +1125,24 @@ class bitmart extends bitmart$1 {
1125
1125
  * @name bitmart#fetchTicker
1126
1126
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1127
1127
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1128
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1128
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1129
1129
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1130
1130
  */
1131
1131
  await this.loadMarkets();
1132
1132
  const market = this.market(symbol);
1133
1133
  const request = {};
1134
- let method = undefined;
1134
+ let response = undefined;
1135
1135
  if (market['swap']) {
1136
- method = 'publicGetContractV1Tickers';
1137
1136
  request['contract_symbol'] = market['id'];
1137
+ response = await this.publicGetContractV1Tickers(this.extend(request, params));
1138
1138
  }
1139
1139
  else if (market['spot']) {
1140
- method = 'publicGetSpotV1Ticker';
1141
1140
  request['symbol'] = market['id'];
1141
+ response = await this.publicGetSpotV1Ticker(this.extend(request, params));
1142
+ }
1143
+ else {
1144
+ throw new errors.NotSupported(this.id + ' fetchTicker() does not support ' + market['type'] + ' markets, only spot and swap markets are accepted');
1142
1145
  }
1143
- const response = await this[method](this.extend(request, params));
1144
1146
  //
1145
1147
  // spot
1146
1148
  //
@@ -1211,10 +1213,10 @@ class bitmart extends bitmart$1 {
1211
1213
  /**
1212
1214
  * @method
1213
1215
  * @name bitmart#fetchTickers
1214
- * @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1216
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
1215
1217
  * @see https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v2
1216
1218
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1217
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1219
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1218
1220
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1219
1221
  */
1220
1222
  await this.loadMarkets();
@@ -1226,11 +1228,16 @@ class bitmart extends bitmart$1 {
1226
1228
  market = this.market(symbol);
1227
1229
  }
1228
1230
  [type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
1229
- const method = this.getSupportedMapping(type, {
1230
- 'spot': 'publicGetSpotV2Ticker',
1231
- 'swap': 'publicGetContractV1Tickers',
1232
- });
1233
- const response = await this[method](params);
1231
+ let response = undefined;
1232
+ if (type === 'spot') {
1233
+ response = await this.publicGetSpotV2Ticker(params);
1234
+ }
1235
+ else if (type === 'swap') {
1236
+ response = await this.publicGetContractV1Tickers(params);
1237
+ }
1238
+ else {
1239
+ throw new errors.NotSupported(this.id + ' fetchTickers() does not support ' + type + ' markets, only spot and swap markets are accepted');
1240
+ }
1234
1241
  const data = this.safeValue(response, 'data', {});
1235
1242
  const tickers = this.safeValue(data, 'tickers', []);
1236
1243
  const result = {};
@@ -1250,7 +1257,7 @@ class bitmart extends bitmart$1 {
1250
1257
  * @see https://developer-pro.bitmart.com/en/futures/#get-market-depth
1251
1258
  * @param {string} symbol unified symbol of the market to fetch the order book for
1252
1259
  * @param {int} [limit] the maximum amount of order book entries to return
1253
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1260
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1254
1261
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
1255
1262
  */
1256
1263
  await this.loadMarkets();
@@ -1423,7 +1430,7 @@ class bitmart extends bitmart$1 {
1423
1430
  * @param {string} symbol unified symbol of the market to fetch trades for
1424
1431
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1425
1432
  * @param {int} [limit] the maximum amount of trades to fetch
1426
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1433
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1427
1434
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1428
1435
  */
1429
1436
  await this.loadMarkets();
@@ -1527,7 +1534,7 @@ class bitmart extends bitmart$1 {
1527
1534
  * @param {string} timeframe the length of time each candle represents
1528
1535
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1529
1536
  * @param {int} [limit] the maximum amount of candles to fetch
1530
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1537
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1531
1538
  * @param {int} [params.until] timestamp of the latest candle in ms
1532
1539
  * @param {boolean} [params.paginate] *spot only* 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)
1533
1540
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
@@ -1632,7 +1639,7 @@ class bitmart extends bitmart$1 {
1632
1639
  * @param {string} symbol unified market symbol
1633
1640
  * @param {int} [since] the earliest time in ms to fetch trades for
1634
1641
  * @param {int} [limit] the maximum number of trades structures to retrieve
1635
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1642
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1636
1643
  * @param {int} [params.until] the latest time in ms to fetch trades for
1637
1644
  * @param {boolean} [params.marginMode] *spot* whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
1638
1645
  * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
@@ -1748,7 +1755,7 @@ class bitmart extends bitmart$1 {
1748
1755
  * @param {string} symbol unified market symbol
1749
1756
  * @param {int} [since] the earliest time in ms to fetch trades for
1750
1757
  * @param {int} [limit] the maximum number of trades to retrieve
1751
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1758
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1752
1759
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1753
1760
  */
1754
1761
  await this.loadMarkets();
@@ -1821,26 +1828,34 @@ class bitmart extends bitmart$1 {
1821
1828
  * @see https://developer-pro.bitmart.com/en/futures/#get-contract-assets-detail
1822
1829
  * @see https://developer-pro.bitmart.com/en/spot/#get-account-balance
1823
1830
  * @see https://developer-pro.bitmart.com/en/spot/#get-margin-account-details-isolated
1824
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1831
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1825
1832
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1826
1833
  */
1827
1834
  await this.loadMarkets();
1828
1835
  let marketType = undefined;
1829
1836
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
1830
- let method = this.getSupportedMapping(marketType, {
1831
- 'spot': 'privateGetSpotV1Wallet',
1832
- 'swap': 'privateGetContractPrivateAssetsDetail',
1833
- 'account': 'privateGetAccountV1Wallet',
1834
- 'margin': 'privateGetSpotV1MarginIsolatedAccount',
1835
- });
1836
1837
  const marginMode = this.safeString(params, 'marginMode');
1837
1838
  const isMargin = this.safeValue(params, 'margin', false);
1838
1839
  params = this.omit(params, ['margin', 'marginMode']);
1839
1840
  if (marginMode !== undefined || isMargin) {
1840
- method = 'privateGetSpotV1MarginIsolatedAccount';
1841
1841
  marketType = 'margin';
1842
1842
  }
1843
- const response = await this[method](params);
1843
+ let response = undefined;
1844
+ if (marketType === 'spot') {
1845
+ response = await this.privateGetSpotV1Wallet(params);
1846
+ }
1847
+ else if (marketType === 'swap') {
1848
+ response = await this.privateGetContractPrivateAssetsDetail(params);
1849
+ }
1850
+ else if (marketType === 'account') {
1851
+ response = await this.privateGetAccountV1Wallet(params);
1852
+ }
1853
+ else if (marketType === 'margin') {
1854
+ response = await this.privateGetSpotV1MarginIsolatedAccount(params);
1855
+ }
1856
+ else {
1857
+ throw new errors.NotSupported(this.id + ' fetchBalance() does not support ' + marketType + ' markets, only spot, swap and account and margin markets are accepted');
1858
+ }
1844
1859
  //
1845
1860
  // spot
1846
1861
  //
@@ -1960,7 +1975,7 @@ class bitmart extends bitmart$1 {
1960
1975
  * @name bitmart#fetchTradingFee
1961
1976
  * @description fetch the trading fees for a market
1962
1977
  * @param {string} symbol unified market symbol
1963
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
1978
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1964
1979
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1965
1980
  */
1966
1981
  await this.loadMarkets();
@@ -2159,7 +2174,7 @@ class bitmart extends bitmart$1 {
2159
2174
  * @param {string} side 'buy' or 'sell'
2160
2175
  * @param {float} amount how much of currency you want to trade in units of base currency
2161
2176
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2162
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2177
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2163
2178
  * @param {string} [params.marginMode] 'cross' or 'isolated'
2164
2179
  * @param {string} [params.leverage] *swap only* leverage level
2165
2180
  * @param {string} [params.clientOrderId] client order id of the order
@@ -2219,7 +2234,7 @@ class bitmart extends bitmart$1 {
2219
2234
  * @param {string} side 'buy' or 'sell'
2220
2235
  * @param {float} amount how much of currency you want to trade in units of base currency
2221
2236
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2222
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2237
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2223
2238
  * @param {int} [params.leverage] leverage level
2224
2239
  * @param {boolean} [params.reduceOnly] *swap only* reduce only
2225
2240
  * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
@@ -2298,7 +2313,7 @@ class bitmart extends bitmart$1 {
2298
2313
  * @param {string} side 'buy' or 'sell'
2299
2314
  * @param {float} amount how much of currency you want to trade in units of base currency
2300
2315
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2301
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2316
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2302
2317
  * @param {string} [params.marginMode] 'cross' or 'isolated'
2303
2318
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2304
2319
  */
@@ -2369,7 +2384,7 @@ class bitmart extends bitmart$1 {
2369
2384
  * @description cancels an open order
2370
2385
  * @param {string} id order id
2371
2386
  * @param {string} symbol unified symbol of the market the order was made in
2372
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2387
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2373
2388
  * @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
2374
2389
  * @param {boolean} [params.stop] *swap only* whether the order is a stop order
2375
2390
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2458,7 +2473,7 @@ class bitmart extends bitmart$1 {
2458
2473
  * @see https://developer-pro.bitmart.com/en/spot/#cancel-all-orders
2459
2474
  * @see https://developer-pro.bitmart.com/en/futures/#cancel-all-orders-signed
2460
2475
  * @param {string} symbol unified market symbol of the market to cancel orders in
2461
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2476
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2462
2477
  * @param {string} [params.side] *spot only* 'buy' or 'sell'
2463
2478
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2464
2479
  */
@@ -2570,7 +2585,7 @@ class bitmart extends bitmart$1 {
2570
2585
  * @param {string} symbol unified market symbol
2571
2586
  * @param {int} [since] the earliest time in ms to fetch open orders for
2572
2587
  * @param {int} [limit] the maximum number of open order structures to retrieve
2573
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2588
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2574
2589
  * @param {boolean} [params.marginMode] *spot* whether to fetch trades for margin orders or spot orders, defaults to spot orders (only isolated margin orders are supported)
2575
2590
  * @param {int} [params.until] *spot* the latest time in ms to fetch orders for
2576
2591
  * @param {string} [params.type] *swap* order type, 'limit' or 'market'
@@ -2679,7 +2694,7 @@ class bitmart extends bitmart$1 {
2679
2694
  * @param {string} symbol unified market symbol of the market orders were made in
2680
2695
  * @param {int} [since] the earliest time in ms to fetch orders for
2681
2696
  * @param {int} [limit] the maximum number of orde structures to retrieve
2682
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2697
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2683
2698
  * @param {int} [params.until] timestamp in ms of the latest entry
2684
2699
  * @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
2685
2700
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -2731,7 +2746,7 @@ class bitmart extends bitmart$1 {
2731
2746
  * @param {string} symbol unified market symbol of the market orders were made in
2732
2747
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
2733
2748
  * @param {int} [limit] max number of orders to return, default is undefined
2734
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2749
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2735
2750
  * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2736
2751
  */
2737
2752
  return await this.fetchOrdersByStatus('canceled', symbol, since, limit, params);
@@ -2746,7 +2761,7 @@ class bitmart extends bitmart$1 {
2746
2761
  * @see https://developer-pro.bitmart.com/en/futures/#get-order-detail-keyed
2747
2762
  * @param {string} id the id of the order
2748
2763
  * @param {string} symbol unified symbol of the market the order was made in
2749
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2764
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2750
2765
  * @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
2751
2766
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2752
2767
  */
@@ -2838,7 +2853,7 @@ class bitmart extends bitmart$1 {
2838
2853
  * @name bitmart#fetchDepositAddress
2839
2854
  * @description fetch the deposit address for a currency associated with this account
2840
2855
  * @param {string} code unified currency code
2841
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2856
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2842
2857
  * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2843
2858
  */
2844
2859
  await this.loadMarkets();
@@ -2903,7 +2918,7 @@ class bitmart extends bitmart$1 {
2903
2918
  * @param {float} amount the amount to withdraw
2904
2919
  * @param {string} address the address to withdraw to
2905
2920
  * @param {string} tag
2906
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
2921
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
2907
2922
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2908
2923
  */
2909
2924
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
@@ -3012,7 +3027,7 @@ class bitmart extends bitmart$1 {
3012
3027
  * @description fetch information on a deposit
3013
3028
  * @param {string} id deposit id
3014
3029
  * @param {string} code not used by bitmart fetchDeposit ()
3015
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3030
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3016
3031
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3017
3032
  */
3018
3033
  await this.loadMarkets();
@@ -3054,7 +3069,7 @@ class bitmart extends bitmart$1 {
3054
3069
  * @param {string} code unified currency code
3055
3070
  * @param {int} [since] the earliest time in ms to fetch deposits for
3056
3071
  * @param {int} [limit] the maximum number of deposits structures to retrieve
3057
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3072
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3058
3073
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3059
3074
  */
3060
3075
  return await this.fetchTransactionsByType('deposit', code, since, limit, params);
@@ -3066,7 +3081,7 @@ class bitmart extends bitmart$1 {
3066
3081
  * @description fetch data on a currency withdrawal via the withdrawal id
3067
3082
  * @param {string} id withdrawal id
3068
3083
  * @param {string} code not used by bitmart.fetchWithdrawal
3069
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3084
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3070
3085
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3071
3086
  */
3072
3087
  await this.loadMarkets();
@@ -3108,7 +3123,7 @@ class bitmart extends bitmart$1 {
3108
3123
  * @param {string} code unified currency code
3109
3124
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
3110
3125
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3111
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3126
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3112
3127
  * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3113
3128
  */
3114
3129
  return await this.fetchTransactionsByType('withdraw', code, since, limit, params);
@@ -3208,7 +3223,7 @@ class bitmart extends bitmart$1 {
3208
3223
  * @param {string} symbol unified market symbol
3209
3224
  * @param {string} code unified currency code of the currency to repay
3210
3225
  * @param {string} amount the amount to repay
3211
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3226
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3212
3227
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
3213
3228
  */
3214
3229
  await this.loadMarkets();
@@ -3246,7 +3261,7 @@ class bitmart extends bitmart$1 {
3246
3261
  * @param {string} symbol unified market symbol
3247
3262
  * @param {string} code unified currency code of the currency to borrow
3248
3263
  * @param {string} amount the amount to borrow
3249
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3264
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3250
3265
  * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
3251
3266
  */
3252
3267
  await this.loadMarkets();
@@ -3307,7 +3322,7 @@ class bitmart extends bitmart$1 {
3307
3322
  // @description fetch the rate of interest to borrow a currency for margin trading
3308
3323
  // @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
3309
3324
  // @param {string} symbol unified symbol of the market to fetch the borrow rate for
3310
- // @param {object} [params] extra parameters specific to the bitmart api endpoint
3325
+ // @param {object} [params] extra parameters specific to the exchange API endpoint
3311
3326
  // <<<<<<< HEAD
3312
3327
  // @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
3313
3328
  // =======
@@ -3405,7 +3420,7 @@ class bitmart extends bitmart$1 {
3405
3420
  * @name bitmart#fetchIsolatedBorrowRates
3406
3421
  * @description fetch the borrow interest rates of all currencies, currently only works for isolated margin
3407
3422
  * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
3408
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3423
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3409
3424
  * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
3410
3425
  */
3411
3426
  await this.loadMarkets();
@@ -3462,7 +3477,7 @@ class bitmart extends bitmart$1 {
3462
3477
  * @param {float} amount amount to transfer
3463
3478
  * @param {string} fromAccount account to transfer from
3464
3479
  * @param {string} toAccount account to transfer to
3465
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3480
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3466
3481
  * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
3467
3482
  */
3468
3483
  await this.loadMarkets();
@@ -3601,7 +3616,7 @@ class bitmart extends bitmart$1 {
3601
3616
  * @param {string} code unified currency code of the currency transferred
3602
3617
  * @param {int} [since] the earliest time in ms to fetch transfers for
3603
3618
  * @param {int} [limit] the maximum number of transfer structures to retrieve
3604
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3619
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3605
3620
  * @param {int} [params.page] the required number of pages, default is 1, max is 1000
3606
3621
  * @param {int} [params.until] the latest time in ms to fetch transfers for
3607
3622
  * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
@@ -3665,7 +3680,7 @@ class bitmart extends bitmart$1 {
3665
3680
  * @param {string} symbol unified market symbol when fetch interest in isolated markets
3666
3681
  * @param {int} [since] the earliest time in ms to fetch borrrow interest for
3667
3682
  * @param {int} [limit] the maximum number of structures to retrieve
3668
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3683
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3669
3684
  * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
3670
3685
  */
3671
3686
  if (symbol === undefined) {
@@ -3800,7 +3815,7 @@ class bitmart extends bitmart$1 {
3800
3815
  * @see https://developer-pro.bitmart.com/en/futures/#submit-leverage-signed
3801
3816
  * @param {float} leverage the rate of leverage
3802
3817
  * @param {string} symbol unified market symbol
3803
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3818
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3804
3819
  * @param {string} [params.marginMode] 'isolated' or 'cross'
3805
3820
  * @returns {object} response from the exchange
3806
3821
  */
@@ -3829,7 +3844,7 @@ class bitmart extends bitmart$1 {
3829
3844
  * @description fetch the current funding rate
3830
3845
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-funding-rate
3831
3846
  * @param {string} symbol unified market symbol
3832
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3847
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3833
3848
  * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3834
3849
  */
3835
3850
  await this.loadMarkets();
@@ -3895,7 +3910,7 @@ class bitmart extends bitmart$1 {
3895
3910
  * @description fetch data on a single open contract trade position
3896
3911
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
3897
3912
  * @param {string} symbol unified market symbol of the market the position is held in
3898
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3913
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3899
3914
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3900
3915
  */
3901
3916
  await this.loadMarkets();
@@ -3944,7 +3959,7 @@ class bitmart extends bitmart$1 {
3944
3959
  * @description fetch all open contract positions
3945
3960
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
3946
3961
  * @param {string[]|undefined} symbols list of unified market symbols
3947
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3962
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
3948
3963
  * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
3949
3964
  */
3950
3965
  await this.loadMarkets();