ccxt 4.1.55 → 4.1.57

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 (328) hide show
  1. package/.git-templates/hooks/pre-push +2 -2
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +6 -6
  4. package/build.sh +30 -8
  5. package/dist/ccxt.browser.js +5592 -4907
  6. package/dist/ccxt.browser.min.js +13 -13
  7. package/dist/cjs/ccxt.js +1 -1
  8. package/dist/cjs/src/ace.js +17 -13
  9. package/dist/cjs/src/alpaca.js +6 -6
  10. package/dist/cjs/src/ascendex.js +35 -29
  11. package/dist/cjs/src/base/Exchange.js +39 -26
  12. package/dist/cjs/src/base/Precise.js +1 -3
  13. package/dist/cjs/src/bigone.js +24 -20
  14. package/dist/cjs/src/binance.js +97 -76
  15. package/dist/cjs/src/bingx.js +63 -44
  16. package/dist/cjs/src/bit2c.js +18 -15
  17. package/dist/cjs/src/bitbank.js +17 -15
  18. package/dist/cjs/src/bitbns.js +28 -18
  19. package/dist/cjs/src/bitfinex.js +23 -21
  20. package/dist/cjs/src/bitfinex2.js +32 -28
  21. package/dist/cjs/src/bitflyer.js +28 -20
  22. package/dist/cjs/src/bitforex.js +25 -18
  23. package/dist/cjs/src/bitget.js +184 -147
  24. package/dist/cjs/src/bithumb.js +23 -16
  25. package/dist/cjs/src/bitmart.js +129 -94
  26. package/dist/cjs/src/bitmex.js +104 -64
  27. package/dist/cjs/src/bitopro.js +38 -26
  28. package/dist/cjs/src/bitpanda.js +24 -23
  29. package/dist/cjs/src/bitrue.js +33 -24
  30. package/dist/cjs/src/bitso.js +24 -23
  31. package/dist/cjs/src/bitstamp.js +24 -23
  32. package/dist/cjs/src/bittrex.js +30 -29
  33. package/dist/cjs/src/bitvavo.js +38 -30
  34. package/dist/cjs/src/bl3p.js +11 -10
  35. package/dist/cjs/src/blockchaincom.js +20 -20
  36. package/dist/cjs/src/btcalpha.js +18 -17
  37. package/dist/cjs/src/btcbox.js +13 -12
  38. package/dist/cjs/src/btcmarkets.js +20 -19
  39. package/dist/cjs/src/btcturk.js +14 -13
  40. package/dist/cjs/src/bybit.js +84 -54
  41. package/dist/cjs/src/cex.js +16 -14
  42. package/dist/cjs/src/coinbase.js +29 -27
  43. package/dist/cjs/src/coinbasepro.js +27 -25
  44. package/dist/cjs/src/coincheck.js +15 -14
  45. package/dist/cjs/src/coinex.js +101 -78
  46. package/dist/cjs/src/coinlist.js +28 -27
  47. package/dist/cjs/src/coinmate.js +20 -17
  48. package/dist/cjs/src/coinone.js +21 -16
  49. package/dist/cjs/src/coinsph.js +37 -28
  50. package/dist/cjs/src/coinspot.js +12 -11
  51. package/dist/cjs/src/cryptocom.js +40 -202
  52. package/dist/cjs/src/currencycom.js +32 -25
  53. package/dist/cjs/src/delta.js +34 -28
  54. package/dist/cjs/src/deribit.js +39 -36
  55. package/dist/cjs/src/digifinex.js +64 -44
  56. package/dist/cjs/src/exmo.js +29 -27
  57. package/dist/cjs/src/gate.js +67 -53
  58. package/dist/cjs/src/gemini.js +23 -20
  59. package/dist/cjs/src/hitbtc.js +65 -56
  60. package/dist/cjs/src/hollaex.js +30 -27
  61. package/dist/cjs/src/htx.js +135 -143
  62. package/dist/cjs/src/huobijp.js +22 -20
  63. package/dist/cjs/src/idex.js +22 -21
  64. package/dist/cjs/src/independentreserve.js +15 -14
  65. package/dist/cjs/src/indodax.js +30 -26
  66. package/dist/cjs/src/kraken.js +29 -27
  67. package/dist/cjs/src/krakenfutures.js +29 -22
  68. package/dist/cjs/src/kucoin.js +48 -43
  69. package/dist/cjs/src/kucoinfutures.js +33 -28
  70. package/dist/cjs/src/kuna.js +25 -24
  71. package/dist/cjs/src/latoken.js +24 -22
  72. package/dist/cjs/src/lbank.js +45 -30
  73. package/dist/cjs/src/luno.js +22 -19
  74. package/dist/cjs/src/lykke.js +19 -17
  75. package/dist/cjs/src/mercado.js +30 -19
  76. package/dist/cjs/src/mexc.js +60 -49
  77. package/dist/cjs/src/ndax.js +23 -22
  78. package/dist/cjs/src/novadax.js +23 -22
  79. package/dist/cjs/src/oceanex.js +22 -19
  80. package/dist/cjs/src/okcoin.js +29 -23
  81. package/dist/cjs/src/okx.js +92 -84
  82. package/dist/cjs/src/p2b.js +80 -83
  83. package/dist/cjs/src/paymium.js +10 -10
  84. package/dist/cjs/src/phemex.js +63 -40
  85. package/dist/cjs/src/poloniex.js +22 -22
  86. package/dist/cjs/src/poloniexfutures.js +23 -19
  87. package/dist/cjs/src/pro/alpaca.js +5 -5
  88. package/dist/cjs/src/pro/ascendex.js +4 -4
  89. package/dist/cjs/src/pro/binance.js +16 -16
  90. package/dist/cjs/src/pro/bingx.js +1 -1
  91. package/dist/cjs/src/pro/bitfinex.js +4 -4
  92. package/dist/cjs/src/pro/bitfinex2.js +6 -6
  93. package/dist/cjs/src/pro/bitget.js +7 -7
  94. package/dist/cjs/src/pro/bitmart.js +7 -5
  95. package/dist/cjs/src/pro/bitmex.js +6 -6
  96. package/dist/cjs/src/pro/bitopro.js +4 -4
  97. package/dist/cjs/src/pro/bitpanda.js +6 -6
  98. package/dist/cjs/src/pro/bitrue.js +2 -2
  99. package/dist/cjs/src/pro/bitstamp.js +6 -4
  100. package/dist/cjs/src/pro/bittrex.js +6 -6
  101. package/dist/cjs/src/pro/bitvavo.js +11 -7
  102. package/dist/cjs/src/pro/blockchaincom.js +8 -8
  103. package/dist/cjs/src/pro/bybit.js +7 -7
  104. package/dist/cjs/src/pro/cex.js +13 -9
  105. package/dist/cjs/src/pro/coinbase.js +5 -5
  106. package/dist/cjs/src/pro/coinbasepro.js +11 -10
  107. package/dist/cjs/src/pro/coinex.js +7 -9
  108. package/dist/cjs/src/pro/cryptocom.js +9 -9
  109. package/dist/cjs/src/pro/currencycom.js +4 -4
  110. package/dist/cjs/src/pro/deribit.js +6 -6
  111. package/dist/cjs/src/pro/exmo.js +12 -14
  112. package/dist/cjs/src/pro/gate.js +7 -7
  113. package/dist/cjs/src/pro/gemini.js +3 -3
  114. package/dist/cjs/src/pro/hitbtc.js +263 -4
  115. package/dist/cjs/src/pro/hollaex.js +5 -5
  116. package/dist/cjs/src/pro/htx.js +6 -6
  117. package/dist/cjs/src/pro/huobijp.js +3 -3
  118. package/dist/cjs/src/pro/idex.js +4 -4
  119. package/dist/cjs/src/pro/independentreserve.js +2 -2
  120. package/dist/cjs/src/pro/kraken.js +10 -10
  121. package/dist/cjs/src/pro/krakenfutures.js +41 -17
  122. package/dist/cjs/src/pro/kucoin.js +7 -7
  123. package/dist/cjs/src/pro/kucoinfutures.js +8 -6
  124. package/dist/cjs/src/pro/luno.js +2 -2
  125. package/dist/cjs/src/pro/mexc.js +6 -6
  126. package/dist/cjs/src/pro/ndax.js +3 -3
  127. package/dist/cjs/src/pro/okcoin.js +5 -5
  128. package/dist/cjs/src/pro/okx.js +12 -12
  129. package/dist/cjs/src/pro/phemex.js +6 -6
  130. package/dist/cjs/src/pro/poloniex.js +7 -7
  131. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  132. package/dist/cjs/src/pro/probit.js +6 -6
  133. package/dist/cjs/src/pro/upbit.js +3 -3
  134. package/dist/cjs/src/pro/wazirx.js +8 -8
  135. package/dist/cjs/src/pro/whitebit.js +12 -8
  136. package/dist/cjs/src/pro/woo.js +1 -1
  137. package/dist/cjs/src/probit.js +28 -23
  138. package/dist/cjs/src/tidex.js +16 -15
  139. package/dist/cjs/src/timex.js +19 -18
  140. package/dist/cjs/src/tokocrypto.js +27 -22
  141. package/dist/cjs/src/upbit.js +19 -19
  142. package/dist/cjs/src/wavesexchange.js +22 -19
  143. package/dist/cjs/src/wazirx.js +24 -17
  144. package/dist/cjs/src/whitebit.js +33 -27
  145. package/dist/cjs/src/woo.js +44 -34
  146. package/dist/cjs/src/yobit.js +25 -20
  147. package/dist/cjs/src/zaif.js +9 -9
  148. package/dist/cjs/src/zonda.js +18 -17
  149. package/js/ccxt.d.ts +1 -1
  150. package/js/ccxt.js +1 -1
  151. package/js/src/abstract/bitbank.d.ts +1 -0
  152. package/js/src/abstract/bybit.d.ts +1 -0
  153. package/js/src/abstract/cryptocom.d.ts +0 -20
  154. package/js/src/abstract/htx.d.ts +3 -0
  155. package/js/src/abstract/huobi.d.ts +3 -0
  156. package/js/src/abstract/huobipro.d.ts +3 -0
  157. package/js/src/abstract/okex.d.ts +3 -1
  158. package/js/src/abstract/okex5.d.ts +3 -1
  159. package/js/src/abstract/okx.d.ts +3 -1
  160. package/js/src/ace.js +18 -14
  161. package/js/src/alpaca.js +6 -6
  162. package/js/src/ascendex.js +35 -29
  163. package/js/src/base/Exchange.d.ts +37 -34
  164. package/js/src/base/Exchange.js +39 -26
  165. package/js/src/base/Precise.d.ts +4 -4
  166. package/js/src/base/Precise.js +1 -3
  167. package/js/src/base/functions/type.d.ts +25 -25
  168. package/js/src/base/types.d.ts +21 -14
  169. package/js/src/bigone.js +25 -21
  170. package/js/src/binance.d.ts +2 -2
  171. package/js/src/binance.js +97 -76
  172. package/js/src/bingx.js +63 -44
  173. package/js/src/bit2c.js +19 -16
  174. package/js/src/bitbank.js +17 -15
  175. package/js/src/bitbns.js +28 -18
  176. package/js/src/bitfinex.js +23 -21
  177. package/js/src/bitfinex2.js +32 -28
  178. package/js/src/bitflyer.js +28 -20
  179. package/js/src/bitforex.js +26 -19
  180. package/js/src/bitget.d.ts +25 -3
  181. package/js/src/bitget.js +184 -147
  182. package/js/src/bithumb.js +23 -16
  183. package/js/src/bitmart.d.ts +1 -1
  184. package/js/src/bitmart.js +129 -94
  185. package/js/src/bitmex.d.ts +2 -2
  186. package/js/src/bitmex.js +104 -64
  187. package/js/src/bitopro.js +38 -26
  188. package/js/src/bitpanda.js +24 -23
  189. package/js/src/bitrue.js +33 -24
  190. package/js/src/bitso.js +24 -23
  191. package/js/src/bitstamp.d.ts +2 -2
  192. package/js/src/bitstamp.js +24 -23
  193. package/js/src/bittrex.js +30 -29
  194. package/js/src/bitvavo.js +38 -30
  195. package/js/src/bl3p.js +11 -10
  196. package/js/src/blockchaincom.js +20 -20
  197. package/js/src/btcalpha.js +18 -17
  198. package/js/src/btcbox.js +13 -12
  199. package/js/src/btcmarkets.js +20 -19
  200. package/js/src/btcturk.js +14 -13
  201. package/js/src/bybit.d.ts +1 -1
  202. package/js/src/bybit.js +84 -54
  203. package/js/src/cex.js +16 -14
  204. package/js/src/coinbase.js +29 -27
  205. package/js/src/coinbasepro.js +27 -25
  206. package/js/src/coincheck.js +15 -14
  207. package/js/src/coinex.d.ts +1 -1
  208. package/js/src/coinex.js +101 -78
  209. package/js/src/coinlist.js +28 -27
  210. package/js/src/coinmate.js +21 -18
  211. package/js/src/coinone.js +21 -16
  212. package/js/src/coinsph.js +37 -28
  213. package/js/src/coinspot.js +12 -11
  214. package/js/src/cryptocom.d.ts +0 -23
  215. package/js/src/cryptocom.js +40 -202
  216. package/js/src/currencycom.js +32 -25
  217. package/js/src/delta.js +35 -29
  218. package/js/src/deribit.js +39 -36
  219. package/js/src/digifinex.d.ts +2 -2
  220. package/js/src/digifinex.js +65 -45
  221. package/js/src/exmo.js +29 -27
  222. package/js/src/gate.d.ts +1 -1
  223. package/js/src/gate.js +67 -53
  224. package/js/src/gemini.js +23 -20
  225. package/js/src/hitbtc.d.ts +1 -0
  226. package/js/src/hitbtc.js +65 -56
  227. package/js/src/hollaex.js +30 -27
  228. package/js/src/htx.d.ts +11 -3
  229. package/js/src/htx.js +135 -143
  230. package/js/src/huobijp.js +23 -21
  231. package/js/src/idex.js +22 -21
  232. package/js/src/independentreserve.js +15 -14
  233. package/js/src/indodax.js +30 -26
  234. package/js/src/kraken.js +29 -27
  235. package/js/src/krakenfutures.js +29 -22
  236. package/js/src/kucoin.d.ts +1 -1
  237. package/js/src/kucoin.js +48 -43
  238. package/js/src/kucoinfutures.js +33 -28
  239. package/js/src/kuna.js +25 -24
  240. package/js/src/latoken.js +25 -23
  241. package/js/src/lbank.js +46 -31
  242. package/js/src/luno.js +22 -19
  243. package/js/src/lykke.js +19 -17
  244. package/js/src/mercado.js +30 -19
  245. package/js/src/mexc.d.ts +1 -1
  246. package/js/src/mexc.js +60 -49
  247. package/js/src/ndax.js +23 -22
  248. package/js/src/novadax.js +23 -22
  249. package/js/src/oceanex.js +22 -19
  250. package/js/src/okcoin.js +29 -23
  251. package/js/src/okx.d.ts +2 -2
  252. package/js/src/okx.js +92 -84
  253. package/js/src/p2b.d.ts +8 -7
  254. package/js/src/p2b.js +80 -82
  255. package/js/src/paymium.js +10 -10
  256. package/js/src/phemex.js +63 -40
  257. package/js/src/poloniex.js +22 -22
  258. package/js/src/poloniexfutures.js +23 -19
  259. package/js/src/pro/alpaca.js +5 -5
  260. package/js/src/pro/ascendex.js +4 -4
  261. package/js/src/pro/binance.js +16 -16
  262. package/js/src/pro/bingx.js +1 -1
  263. package/js/src/pro/bitfinex.js +4 -4
  264. package/js/src/pro/bitfinex2.d.ts +1 -1
  265. package/js/src/pro/bitfinex2.js +6 -6
  266. package/js/src/pro/bitget.js +7 -7
  267. package/js/src/pro/bitmart.js +7 -5
  268. package/js/src/pro/bitmex.js +6 -6
  269. package/js/src/pro/bitopro.js +4 -4
  270. package/js/src/pro/bitpanda.js +6 -6
  271. package/js/src/pro/bitrue.js +2 -2
  272. package/js/src/pro/bitstamp.js +7 -5
  273. package/js/src/pro/bittrex.js +6 -6
  274. package/js/src/pro/bitvavo.js +12 -8
  275. package/js/src/pro/blockchaincom.js +8 -8
  276. package/js/src/pro/bybit.js +7 -7
  277. package/js/src/pro/cex.js +14 -10
  278. package/js/src/pro/coinbase.js +5 -5
  279. package/js/src/pro/coinbasepro.js +12 -11
  280. package/js/src/pro/coinex.js +7 -9
  281. package/js/src/pro/cryptocom.js +9 -9
  282. package/js/src/pro/currencycom.js +4 -4
  283. package/js/src/pro/deribit.js +6 -6
  284. package/js/src/pro/exmo.js +12 -14
  285. package/js/src/pro/gate.js +7 -7
  286. package/js/src/pro/gemini.js +3 -3
  287. package/js/src/pro/hitbtc.d.ts +8 -1
  288. package/js/src/pro/hitbtc.js +264 -5
  289. package/js/src/pro/hollaex.js +5 -5
  290. package/js/src/pro/htx.js +6 -6
  291. package/js/src/pro/huobijp.js +3 -3
  292. package/js/src/pro/idex.js +4 -4
  293. package/js/src/pro/independentreserve.js +2 -2
  294. package/js/src/pro/kraken.js +10 -10
  295. package/js/src/pro/krakenfutures.d.ts +1 -0
  296. package/js/src/pro/krakenfutures.js +42 -18
  297. package/js/src/pro/kucoin.js +7 -7
  298. package/js/src/pro/kucoinfutures.js +8 -6
  299. package/js/src/pro/luno.js +2 -2
  300. package/js/src/pro/mexc.js +6 -6
  301. package/js/src/pro/ndax.js +3 -3
  302. package/js/src/pro/okcoin.js +5 -5
  303. package/js/src/pro/okx.js +12 -12
  304. package/js/src/pro/phemex.js +6 -6
  305. package/js/src/pro/poloniex.js +7 -7
  306. package/js/src/pro/poloniexfutures.js +5 -5
  307. package/js/src/pro/probit.js +6 -6
  308. package/js/src/pro/upbit.js +3 -3
  309. package/js/src/pro/wazirx.js +8 -8
  310. package/js/src/pro/whitebit.js +13 -9
  311. package/js/src/pro/woo.js +1 -1
  312. package/js/src/probit.js +29 -24
  313. package/js/src/tidex.js +16 -15
  314. package/js/src/timex.js +19 -18
  315. package/js/src/tokocrypto.js +28 -23
  316. package/js/src/upbit.js +19 -19
  317. package/js/src/wavesexchange.js +23 -20
  318. package/js/src/wazirx.js +25 -18
  319. package/js/src/whitebit.js +33 -27
  320. package/js/src/woo.js +45 -35
  321. package/js/src/yobit.js +25 -20
  322. package/js/src/zaif.js +9 -9
  323. package/js/src/zonda.js +18 -17
  324. package/package.json +2 -2
  325. package/js/src/bitstamp1.d.ts +0 -28
  326. package/js/src/bitstamp1.js +0 -430
  327. package/js/src/lbank2.d.ts +0 -90
  328. package/js/src/lbank2.js +0 -2779
package/js/src/bitmart.js CHANGED
@@ -31,9 +31,9 @@ export default class bitmart extends Exchange {
31
31
  'CORS': undefined,
32
32
  'spot': true,
33
33
  'margin': true,
34
- 'swap': undefined,
34
+ 'swap': true,
35
35
  'future': false,
36
- 'option': undefined,
36
+ 'option': false,
37
37
  'borrowMargin': true,
38
38
  'cancelAllOrders': true,
39
39
  'cancelOrder': true,
@@ -45,12 +45,12 @@ export default class bitmart extends Exchange {
45
45
  'createStopOrder': false,
46
46
  'fetchBalance': true,
47
47
  'fetchBorrowInterest': true,
48
- 'fetchBorrowRate': true,
49
48
  'fetchBorrowRateHistories': false,
50
49
  'fetchBorrowRateHistory': false,
51
- 'fetchBorrowRates': true,
52
50
  'fetchCanceledOrders': true,
53
51
  'fetchClosedOrders': true,
52
+ 'fetchCrossBorrowRate': false,
53
+ 'fetchCrossBorrowRates': false,
54
54
  'fetchCurrencies': true,
55
55
  'fetchDeposit': true,
56
56
  'fetchDepositAddress': true,
@@ -63,6 +63,8 @@ export default class bitmart extends Exchange {
63
63
  'fetchFundingRate': true,
64
64
  'fetchFundingRateHistory': false,
65
65
  'fetchFundingRates': false,
66
+ 'fetchIsolatedBorrowRate': true,
67
+ 'fetchIsolatedBorrowRates': true,
66
68
  'fetchLiquidations': false,
67
69
  'fetchMarginMode': false,
68
70
  'fetchMarkets': true,
@@ -135,7 +137,7 @@ export default class bitmart extends Exchange {
135
137
  'spot/quotation/v3/books': 4,
136
138
  'spot/quotation/v3/trades': 4,
137
139
  'spot/v1/ticker': 5,
138
- 'spot/v2/ticker': 5,
140
+ 'spot/v2/ticker': 30,
139
141
  'spot/v1/ticker_detail': 5,
140
142
  'spot/v1/steps': 30,
141
143
  'spot/v1/symbols/kline': 5,
@@ -180,10 +182,10 @@ export default class bitmart extends Exchange {
180
182
  // margin
181
183
  'spot/v1/margin/isolated/borrow_record': 1,
182
184
  'spot/v1/margin/isolated/repay_record': 1,
183
- 'spot/v1/margin/isolated/pairs': 1,
184
- 'spot/v1/margin/isolated/account': 6,
185
- 'spot/v1/trade_fee': 6,
186
- 'spot/v1/user_fee': 6,
185
+ 'spot/v1/margin/isolated/pairs': 30,
186
+ 'spot/v1/margin/isolated/account': 5,
187
+ 'spot/v1/trade_fee': 30,
188
+ 'spot/v1/user_fee': 30,
187
189
  // broker
188
190
  'spot/v1/broker/rebate': 1,
189
191
  // contract
@@ -223,9 +225,9 @@ export default class bitmart extends Exchange {
223
225
  'spot/v2/submit_order': 1,
224
226
  // margin
225
227
  'spot/v1/margin/submit_order': 1,
226
- 'spot/v1/margin/isolated/borrow': 6,
227
- 'spot/v1/margin/isolated/repay': 6,
228
- 'spot/v1/margin/isolated/transfer': 6,
228
+ 'spot/v1/margin/isolated/borrow': 30,
229
+ 'spot/v1/margin/isolated/repay': 30,
230
+ 'spot/v1/margin/isolated/transfer': 30,
229
231
  // contract
230
232
  'account/v1/transfer-contract-list': 60,
231
233
  'account/v1/transfer-contract': 60,
@@ -617,7 +619,7 @@ export default class bitmart extends Exchange {
617
619
  * @name bitmart#fetchStatus
618
620
  * @description the latest known information on the availability of the exchange API
619
621
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
620
- * @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
622
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
621
623
  */
622
624
  const options = this.safeValue(this.options, 'fetchStatus', {});
623
625
  const defaultType = this.safeString(this.options, 'defaultType');
@@ -953,7 +955,7 @@ export default class bitmart extends Exchange {
953
955
  * @description please use fetchDepositWithdrawFee instead
954
956
  * @param {string} code unified currency code
955
957
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
956
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
958
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
957
959
  */
958
960
  await this.loadMarkets();
959
961
  const currency = this.currency(code);
@@ -1012,7 +1014,7 @@ export default class bitmart extends Exchange {
1012
1014
  * @description fetch the fee for deposits and withdrawals
1013
1015
  * @param {string} code unified currency code
1014
1016
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1015
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
1017
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1016
1018
  */
1017
1019
  await this.loadMarkets();
1018
1020
  const currency = this.currency(code);
@@ -1125,7 +1127,7 @@ export default class bitmart extends Exchange {
1125
1127
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1126
1128
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1127
1129
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1128
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
1130
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1129
1131
  */
1130
1132
  await this.loadMarkets();
1131
1133
  const market = this.market(symbol);
@@ -1214,7 +1216,7 @@ export default class bitmart extends Exchange {
1214
1216
  * @see https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v2
1215
1217
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1216
1218
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1217
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
1219
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1218
1220
  */
1219
1221
  await this.loadMarkets();
1220
1222
  symbols = this.marketSymbols(symbols);
@@ -1250,7 +1252,7 @@ export default class bitmart extends Exchange {
1250
1252
  * @param {string} symbol unified symbol of the market to fetch the order book for
1251
1253
  * @param {int} [limit] the maximum amount of order book entries to return
1252
1254
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1253
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
1255
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
1254
1256
  */
1255
1257
  await this.loadMarkets();
1256
1258
  const market = this.market(symbol);
@@ -1423,7 +1425,7 @@ export default class bitmart extends Exchange {
1423
1425
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1424
1426
  * @param {int} [limit] the maximum amount of trades to fetch
1425
1427
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1426
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
1428
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1427
1429
  */
1428
1430
  await this.loadMarkets();
1429
1431
  const market = this.market(symbol);
@@ -1634,7 +1636,7 @@ export default class bitmart extends Exchange {
1634
1636
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1635
1637
  * @param {int} [params.until] the latest time in ms to fetch trades for
1636
1638
  * @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)
1637
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
1639
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1638
1640
  */
1639
1641
  await this.loadMarkets();
1640
1642
  let market = undefined;
@@ -1669,7 +1671,9 @@ export default class bitmart extends Exchange {
1669
1671
  response = await this.privatePostSpotV4QueryTrades(this.extend(request, params));
1670
1672
  }
1671
1673
  else if (type === 'swap') {
1672
- this.checkRequiredSymbol('fetchMyTrades', symbol);
1674
+ if (symbol === undefined) {
1675
+ throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
1676
+ }
1673
1677
  if (since !== undefined) {
1674
1678
  request['start_time'] = since;
1675
1679
  }
@@ -1746,7 +1750,7 @@ export default class bitmart extends Exchange {
1746
1750
  * @param {int} [since] the earliest time in ms to fetch trades for
1747
1751
  * @param {int} [limit] the maximum number of trades to retrieve
1748
1752
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1749
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
1753
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1750
1754
  */
1751
1755
  await this.loadMarkets();
1752
1756
  const request = {
@@ -1819,7 +1823,7 @@ export default class bitmart extends Exchange {
1819
1823
  * @see https://developer-pro.bitmart.com/en/spot/#get-account-balance
1820
1824
  * @see https://developer-pro.bitmart.com/en/spot/#get-margin-account-details-isolated
1821
1825
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1822
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1826
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1823
1827
  */
1824
1828
  await this.loadMarkets();
1825
1829
  let marketType = undefined;
@@ -1958,7 +1962,7 @@ export default class bitmart extends Exchange {
1958
1962
  * @description fetch the trading fees for a market
1959
1963
  * @param {string} symbol unified market symbol
1960
1964
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1961
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
1965
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1962
1966
  */
1963
1967
  await this.loadMarkets();
1964
1968
  const market = this.market(symbol);
@@ -2121,17 +2125,17 @@ export default class bitmart extends Exchange {
2121
2125
  parseOrderStatusByType(type, status) {
2122
2126
  const statusesByType = {
2123
2127
  'spot': {
2124
- '1': 'failed',
2128
+ '1': 'rejected',
2125
2129
  '2': 'open',
2126
- '3': 'failed',
2130
+ '3': 'rejected',
2127
2131
  '4': 'open',
2128
2132
  '5': 'open',
2129
2133
  '6': 'closed',
2130
- '7': 'canceling',
2134
+ '7': 'canceled',
2131
2135
  '8': 'canceled',
2132
2136
  'new': 'open',
2133
2137
  'partially_filled': 'open',
2134
- 'filled': 'filled',
2138
+ 'filled': 'closed',
2135
2139
  'partially_canceled': 'canceled',
2136
2140
  },
2137
2141
  'swap': {
@@ -2162,7 +2166,7 @@ export default class bitmart extends Exchange {
2162
2166
  * @param {string} [params.clientOrderId] client order id of the order
2163
2167
  * @param {boolean} [params.reduceOnly] *swap only* reduce only
2164
2168
  * @param {boolean} [params.postOnly] make sure the order is posted to the order book and not matched immediately
2165
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2169
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2166
2170
  */
2167
2171
  await this.loadMarkets();
2168
2172
  const market = this.market(symbol);
@@ -2221,7 +2225,7 @@ export default class bitmart extends Exchange {
2221
2225
  * @param {boolean} [params.reduceOnly] *swap only* reduce only
2222
2226
  * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
2223
2227
  * @param {string} [params.clientOrderId] client order id of the order
2224
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2228
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2225
2229
  */
2226
2230
  const market = this.market(symbol);
2227
2231
  const request = {
@@ -2297,7 +2301,7 @@ export default class bitmart extends Exchange {
2297
2301
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2298
2302
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2299
2303
  * @param {string} [params.marginMode] 'cross' or 'isolated'
2300
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2304
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2301
2305
  */
2302
2306
  const market = this.market(symbol);
2303
2307
  const request = {
@@ -2369,9 +2373,11 @@ export default class bitmart extends Exchange {
2369
2373
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2370
2374
  * @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
2371
2375
  * @param {boolean} [params.stop] *swap only* whether the order is a stop order
2372
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2376
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2373
2377
  */
2374
- this.checkRequiredSymbol('cancelOrder', symbol);
2378
+ if (symbol === undefined) {
2379
+ throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2380
+ }
2375
2381
  await this.loadMarkets();
2376
2382
  const market = this.market(symbol);
2377
2383
  const request = {
@@ -2455,7 +2461,7 @@ export default class bitmart extends Exchange {
2455
2461
  * @param {string} symbol unified market symbol of the market to cancel orders in
2456
2462
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2457
2463
  * @param {string} [params.side] *spot only* 'buy' or 'sell'
2458
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2464
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2459
2465
  */
2460
2466
  await this.loadMarkets();
2461
2467
  const request = {};
@@ -2471,7 +2477,9 @@ export default class bitmart extends Exchange {
2471
2477
  response = await this.privatePostSpotV1CancelOrders(this.extend(request, params));
2472
2478
  }
2473
2479
  else if (type === 'swap') {
2474
- this.checkRequiredSymbol('cancelAllOrders', symbol);
2480
+ if (symbol === undefined) {
2481
+ throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
2482
+ }
2475
2483
  response = await this.privatePostContractPrivateCancelOrders(this.extend(request, params));
2476
2484
  }
2477
2485
  //
@@ -2495,7 +2503,9 @@ export default class bitmart extends Exchange {
2495
2503
  return response;
2496
2504
  }
2497
2505
  async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2498
- this.checkRequiredSymbol('fetchOrdersByStatus', symbol);
2506
+ if (symbol === undefined) {
2507
+ throw new ArgumentsRequired(this.id + ' fetchOrdersByStatus() requires a symbol argument');
2508
+ }
2499
2509
  await this.loadMarkets();
2500
2510
  const market = this.market(symbol);
2501
2511
  if (!market['spot']) {
@@ -2566,7 +2576,7 @@ export default class bitmart extends Exchange {
2566
2576
  * @param {int} [params.until] *spot* the latest time in ms to fetch orders for
2567
2577
  * @param {string} [params.type] *swap* order type, 'limit' or 'market'
2568
2578
  * @param {string} [params.order_state] *swap* the order state, 'all' or 'partially_filled', default is 'all'
2569
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2579
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2570
2580
  */
2571
2581
  await this.loadMarkets();
2572
2582
  let market = undefined;
@@ -2665,12 +2675,15 @@ export default class bitmart extends Exchange {
2665
2675
  * @method
2666
2676
  * @name bitmart#fetchClosedOrders
2667
2677
  * @see https://developer-pro.bitmart.com/en/spot/#account-orders-v4-signed
2678
+ * @see https://developer-pro.bitmart.com/en/futures/#get-order-history-keyed
2668
2679
  * @description fetches information on multiple closed orders made by the user
2669
2680
  * @param {string} symbol unified market symbol of the market orders were made in
2670
2681
  * @param {int} [since] the earliest time in ms to fetch orders for
2671
2682
  * @param {int} [limit] the maximum number of orde structures to retrieve
2672
2683
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2673
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2684
+ * @param {int} [params.until] timestamp in ms of the latest entry
2685
+ * @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
2686
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2674
2687
  */
2675
2688
  await this.loadMarkets();
2676
2689
  let market = undefined;
@@ -2682,20 +2695,33 @@ export default class bitmart extends Exchange {
2682
2695
  let type = undefined;
2683
2696
  [type, params] = this.handleMarketTypeAndParams('fetchClosedOrders', market, params);
2684
2697
  if (type !== 'spot') {
2685
- throw new NotSupported(this.id + ' fetchClosedOrders() does not support ' + type + ' orders, only spot orders are accepted');
2698
+ if (symbol === undefined) {
2699
+ throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
2700
+ }
2686
2701
  }
2687
2702
  let marginMode = undefined;
2688
2703
  [marginMode, params] = this.handleMarginModeAndParams('fetchClosedOrders', params);
2689
2704
  if (marginMode === 'isolated') {
2690
2705
  request['orderMode'] = 'iso_margin';
2691
2706
  }
2692
- const until = this.safeInteger2(params, 'until', 'endTime');
2707
+ const startTimeKey = (type === 'spot') ? 'startTime' : 'start_time';
2708
+ if (since !== undefined) {
2709
+ request[startTimeKey] = since;
2710
+ }
2711
+ const endTimeKey = (type === 'spot') ? 'endTime' : 'end_time';
2712
+ const until = this.safeInteger2(params, 'until', endTimeKey);
2693
2713
  if (until !== undefined) {
2694
- params = this.omit(params, ['endTime']);
2695
- request['endTime'] = until;
2714
+ params = this.omit(params, ['until']);
2715
+ request[endTimeKey] = until;
2696
2716
  }
2697
- const response = await this.privatePostSpotV4QueryHistoryOrders(this.extend(request, params));
2698
- const data = this.safeValue(response, 'data');
2717
+ let response = undefined;
2718
+ if (type === 'spot') {
2719
+ response = await this.privatePostSpotV4QueryHistoryOrders(this.extend(request, params));
2720
+ }
2721
+ else {
2722
+ response = await this.privateGetContractPrivateOrderHistory(this.extend(request, params));
2723
+ }
2724
+ const data = this.safeValue(response, 'data', []);
2699
2725
  return this.parseOrders(data, market, since, limit);
2700
2726
  }
2701
2727
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -2707,7 +2733,7 @@ export default class bitmart extends Exchange {
2707
2733
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
2708
2734
  * @param {int} [limit] max number of orders to return, default is undefined
2709
2735
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2710
- * @returns {object} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2736
+ * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2711
2737
  */
2712
2738
  return await this.fetchOrdersByStatus('canceled', symbol, since, limit, params);
2713
2739
  }
@@ -2723,7 +2749,7 @@ export default class bitmart extends Exchange {
2723
2749
  * @param {string} symbol unified symbol of the market the order was made in
2724
2750
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2725
2751
  * @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
2726
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2752
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2727
2753
  */
2728
2754
  await this.loadMarkets();
2729
2755
  const request = {};
@@ -2747,7 +2773,9 @@ export default class bitmart extends Exchange {
2747
2773
  }
2748
2774
  }
2749
2775
  else if (type === 'swap') {
2750
- this.checkRequiredSymbol('fetchOrder', symbol);
2776
+ if (symbol === undefined) {
2777
+ throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
2778
+ }
2751
2779
  request['symbol'] = market['id'];
2752
2780
  request['order_id'] = id;
2753
2781
  response = await this.privateGetContractPrivateOrder(this.extend(request, params));
@@ -2812,7 +2840,7 @@ export default class bitmart extends Exchange {
2812
2840
  * @description fetch the deposit address for a currency associated with this account
2813
2841
  * @param {string} code unified currency code
2814
2842
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2815
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2843
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2816
2844
  */
2817
2845
  await this.loadMarkets();
2818
2846
  const currency = this.currency(code);
@@ -2877,7 +2905,7 @@ export default class bitmart extends Exchange {
2877
2905
  * @param {string} address the address to withdraw to
2878
2906
  * @param {string} tag
2879
2907
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2880
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
2908
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2881
2909
  */
2882
2910
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
2883
2911
  this.checkAddress(address);
@@ -2986,7 +3014,7 @@ export default class bitmart extends Exchange {
2986
3014
  * @param {string} id deposit id
2987
3015
  * @param {string} code not used by bitmart fetchDeposit ()
2988
3016
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2989
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3017
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2990
3018
  */
2991
3019
  await this.loadMarkets();
2992
3020
  const request = {
@@ -3028,7 +3056,7 @@ export default class bitmart extends Exchange {
3028
3056
  * @param {int} [since] the earliest time in ms to fetch deposits for
3029
3057
  * @param {int} [limit] the maximum number of deposits structures to retrieve
3030
3058
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3031
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3059
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3032
3060
  */
3033
3061
  return await this.fetchTransactionsByType('deposit', code, since, limit, params);
3034
3062
  }
@@ -3040,7 +3068,7 @@ export default class bitmart extends Exchange {
3040
3068
  * @param {string} id withdrawal id
3041
3069
  * @param {string} code not used by bitmart.fetchWithdrawal
3042
3070
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3043
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3071
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3044
3072
  */
3045
3073
  await this.loadMarkets();
3046
3074
  const request = {
@@ -3082,7 +3110,7 @@ export default class bitmart extends Exchange {
3082
3110
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
3083
3111
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3084
3112
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3085
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3113
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3086
3114
  */
3087
3115
  return await this.fetchTransactionsByType('withdraw', code, since, limit, params);
3088
3116
  }
@@ -3183,9 +3211,11 @@ export default class bitmart extends Exchange {
3183
3211
  * @param {string} symbol unified market symbol
3184
3212
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3185
3213
  * @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
3186
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
3214
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
3187
3215
  */
3188
- this.checkRequiredSymbol('repayMargin', symbol);
3216
+ if (symbol === undefined) {
3217
+ throw new ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
3218
+ }
3189
3219
  await this.loadMarkets();
3190
3220
  const market = this.market(symbol);
3191
3221
  const currency = this.currency(code);
@@ -3224,9 +3254,11 @@ export default class bitmart extends Exchange {
3224
3254
  * @param {string} symbol unified market symbol
3225
3255
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3226
3256
  * @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
3227
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
3257
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
3228
3258
  */
3229
- this.checkRequiredSymbol('borrowMargin', symbol);
3259
+ if (symbol === undefined) {
3260
+ throw new ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
3261
+ }
3230
3262
  await this.loadMarkets();
3231
3263
  const market = this.market(symbol);
3232
3264
  const currency = this.currency(code);
@@ -3280,20 +3312,21 @@ export default class bitmart extends Exchange {
3280
3312
  };
3281
3313
  }
3282
3314
  async fetchIsolatedBorrowRate(symbol, params = {}) {
3283
- /**
3284
- * @method
3285
- * @name bitmart#fetchBorrowRate
3286
- * @description fetch the rate of interest to borrow a currency for margin trading
3287
- * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount
3288
- * @param {string} code unified currency code
3289
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3290
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
3291
- */
3315
+ //
3316
+ // @method
3317
+ // @name bitmart#fetchIsolatedBorrowRate
3318
+ // @description fetch the rate of interest to borrow a currency for margin trading
3319
+ // @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
3320
+ // @param {string} symbol unified symbol of the market to fetch the borrow rate for
3321
+ // @param {object} [params] extra parameters specific to the bitmart api endpoint
3322
+ // <<<<<<< HEAD
3323
+ // @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
3324
+ // =======
3325
+ // @returns {object} an [isolated borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
3326
+ // >>>>>>> 3215552206edf1cda1ae63d2063535e19973dbe5
3327
+ //
3292
3328
  await this.loadMarkets();
3293
- let market = undefined;
3294
- if (symbol !== undefined) {
3295
- market = this.market(symbol);
3296
- }
3329
+ const market = this.market(symbol);
3297
3330
  const request = {
3298
3331
  'symbol': market['id'],
3299
3332
  };
@@ -3361,20 +3394,16 @@ export default class bitmart extends Exchange {
3361
3394
  //
3362
3395
  const marketId = this.safeString(info, 'symbol');
3363
3396
  const symbol = this.safeSymbol(marketId, market);
3364
- const baseData = this.safeValue(info, 'base');
3365
- const quoteData = this.safeValue(info, 'quote');
3397
+ const baseData = this.safeValue(info, 'base', {});
3398
+ const quoteData = this.safeValue(info, 'quote', {});
3366
3399
  const baseId = this.safeString(baseData, 'currency');
3367
3400
  const quoteId = this.safeString(quoteData, 'currency');
3368
- const base = this.safeCurrencyCode(baseId);
3369
- const quote = this.safeCurrencyCode(quoteId);
3370
- const baseRate = this.safeNumber(baseData, 'hourly_interest');
3371
- const quoteRate = this.safeNumber(quoteData, 'hourly_interest');
3372
3401
  return {
3373
3402
  'symbol': symbol,
3374
- 'base': base,
3375
- 'baseRate': baseRate,
3376
- 'quote': quote,
3377
- 'quoteRate': quoteRate,
3403
+ 'base': this.safeCurrencyCode(baseId),
3404
+ 'baseRate': this.safeNumber(baseData, 'hourly_interest'),
3405
+ 'quote': this.safeCurrencyCode(quoteId),
3406
+ 'quoteRate': this.safeNumber(quoteData, 'hourly_interest'),
3378
3407
  'period': 3600000,
3379
3408
  'timestamp': undefined,
3380
3409
  'datetime': undefined,
@@ -3384,11 +3413,11 @@ export default class bitmart extends Exchange {
3384
3413
  async fetchIsolatedBorrowRates(params = {}) {
3385
3414
  /**
3386
3415
  * @method
3387
- * @name bitmart#fetchBorrowRates
3416
+ * @name bitmart#fetchIsolatedBorrowRates
3388
3417
  * @description fetch the borrow interest rates of all currencies, currently only works for isolated margin
3389
- * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount
3418
+ * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
3390
3419
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3391
- * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
3420
+ * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
3392
3421
  */
3393
3422
  await this.loadMarkets();
3394
3423
  const response = await this.privateGetSpotV1MarginIsolatedPairs(params);
@@ -3445,7 +3474,7 @@ export default class bitmart extends Exchange {
3445
3474
  * @param {string} fromAccount account to transfer from
3446
3475
  * @param {string} toAccount account to transfer to
3447
3476
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3448
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
3477
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
3449
3478
  */
3450
3479
  await this.loadMarkets();
3451
3480
  const currency = this.currency(code);
@@ -3586,7 +3615,7 @@ export default class bitmart extends Exchange {
3586
3615
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3587
3616
  * @param {int} [params.page] the required number of pages, default is 1, max is 1000
3588
3617
  * @param {int} [params.until] the latest time in ms to fetch transfers for
3589
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
3618
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
3590
3619
  */
3591
3620
  await this.loadMarkets();
3592
3621
  if (limit === undefined) {
@@ -3648,9 +3677,11 @@ export default class bitmart extends Exchange {
3648
3677
  * @param {int} [since] the earliest time in ms to fetch borrrow interest for
3649
3678
  * @param {int} [limit] the maximum number of structures to retrieve
3650
3679
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3651
- * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
3680
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
3652
3681
  */
3653
- this.checkRequiredSymbol('fetchBorrowInterest', symbol);
3682
+ if (symbol === undefined) {
3683
+ throw new ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
3684
+ }
3654
3685
  await this.loadMarkets();
3655
3686
  const market = this.market(symbol);
3656
3687
  const request = {
@@ -3725,7 +3756,7 @@ export default class bitmart extends Exchange {
3725
3756
  * @see https://developer-pro.bitmart.com/en/futures/#get-futures-openinterest
3726
3757
  * @param {string} symbol Unified CCXT market symbol
3727
3758
  * @param {object} [params] exchange specific parameters
3728
- * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
3759
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
3729
3760
  */
3730
3761
  await this.loadMarkets();
3731
3762
  const market = this.market(symbol);
@@ -3784,7 +3815,9 @@ export default class bitmart extends Exchange {
3784
3815
  * @param {string} [params.marginMode] 'isolated' or 'cross'
3785
3816
  * @returns {object} response from the exchange
3786
3817
  */
3787
- this.checkRequiredSymbol('setLeverage', symbol);
3818
+ if (symbol === undefined) {
3819
+ throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
3820
+ }
3788
3821
  let marginMode = undefined;
3789
3822
  [marginMode, params] = this.handleMarginModeAndParams('setLeverage', params);
3790
3823
  this.checkRequiredArgument('setLeverage', marginMode, 'marginMode', ['isolated', 'cross']);
@@ -3808,7 +3841,7 @@ export default class bitmart extends Exchange {
3808
3841
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-funding-rate
3809
3842
  * @param {string} symbol unified market symbol
3810
3843
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3811
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
3844
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3812
3845
  */
3813
3846
  await this.loadMarkets();
3814
3847
  const market = this.market(symbol);
@@ -3874,7 +3907,7 @@ export default class bitmart extends Exchange {
3874
3907
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
3875
3908
  * @param {string} symbol unified market symbol of the market the position is held in
3876
3909
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3877
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3910
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3878
3911
  */
3879
3912
  await this.loadMarkets();
3880
3913
  const market = this.market(symbol);
@@ -3923,7 +3956,7 @@ export default class bitmart extends Exchange {
3923
3956
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
3924
3957
  * @param {string[]|undefined} symbols list of unified market symbols
3925
3958
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3926
- * @returns {object[]} a list of [position structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3959
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
3927
3960
  */
3928
3961
  await this.loadMarkets();
3929
3962
  let market = undefined;
@@ -4051,9 +4084,11 @@ export default class bitmart extends Exchange {
4051
4084
  * @param {int} [limit] the maximum number of liquidation structures to retrieve
4052
4085
  * @param {object} [params] exchange specific parameters for the bitmart api endpoint
4053
4086
  * @param {int} [params.until] timestamp in ms of the latest liquidation
4054
- * @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
4087
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
4055
4088
  */
4056
- this.checkRequiredSymbol('fetchMyLiquidations', symbol);
4089
+ if (symbol === undefined) {
4090
+ throw new ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
4091
+ }
4057
4092
  await this.loadMarkets();
4058
4093
  const market = this.market(symbol);
4059
4094
  if (!market['swap']) {
@@ -8,7 +8,7 @@ export default class bitmex extends Exchange {
8
8
  describe(): any;
9
9
  fetchCurrencies(params?: {}): Promise<{}>;
10
10
  convertFromRealAmount(code: any, amount: any): number;
11
- convertToRealAmount(code: any, amount: any): number;
11
+ convertToRealAmount(code: string, amount: string): string;
12
12
  amountToPrecision(symbol: any, amount: any): any;
13
13
  convertFromRawQuantity(symbol: any, rawQuantity: any, currencySide?: string): number;
14
14
  convertFromRawCost(symbol: any, rawQuantity: any): number;
@@ -34,7 +34,7 @@ export default class bitmex extends Exchange {
34
34
  referenceAccount: any;
35
35
  type: string;
36
36
  currency: string;
37
- amount: number;
37
+ amount: string;
38
38
  before: number;
39
39
  after: number;
40
40
  status: string;