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
@@ -28,9 +28,9 @@ class bitmart extends bitmart$1 {
28
28
  'CORS': undefined,
29
29
  'spot': true,
30
30
  'margin': true,
31
- 'swap': undefined,
31
+ 'swap': true,
32
32
  'future': false,
33
- 'option': undefined,
33
+ 'option': false,
34
34
  'borrowMargin': true,
35
35
  'cancelAllOrders': true,
36
36
  'cancelOrder': true,
@@ -42,12 +42,12 @@ class bitmart extends bitmart$1 {
42
42
  'createStopOrder': false,
43
43
  'fetchBalance': true,
44
44
  'fetchBorrowInterest': true,
45
- 'fetchBorrowRate': true,
46
45
  'fetchBorrowRateHistories': false,
47
46
  'fetchBorrowRateHistory': false,
48
- 'fetchBorrowRates': true,
49
47
  'fetchCanceledOrders': true,
50
48
  'fetchClosedOrders': true,
49
+ 'fetchCrossBorrowRate': false,
50
+ 'fetchCrossBorrowRates': false,
51
51
  'fetchCurrencies': true,
52
52
  'fetchDeposit': true,
53
53
  'fetchDepositAddress': true,
@@ -60,6 +60,8 @@ class bitmart extends bitmart$1 {
60
60
  'fetchFundingRate': true,
61
61
  'fetchFundingRateHistory': false,
62
62
  'fetchFundingRates': false,
63
+ 'fetchIsolatedBorrowRate': true,
64
+ 'fetchIsolatedBorrowRates': true,
63
65
  'fetchLiquidations': false,
64
66
  'fetchMarginMode': false,
65
67
  'fetchMarkets': true,
@@ -132,7 +134,7 @@ class bitmart extends bitmart$1 {
132
134
  'spot/quotation/v3/books': 4,
133
135
  'spot/quotation/v3/trades': 4,
134
136
  'spot/v1/ticker': 5,
135
- 'spot/v2/ticker': 5,
137
+ 'spot/v2/ticker': 30,
136
138
  'spot/v1/ticker_detail': 5,
137
139
  'spot/v1/steps': 30,
138
140
  'spot/v1/symbols/kline': 5,
@@ -177,10 +179,10 @@ class bitmart extends bitmart$1 {
177
179
  // margin
178
180
  'spot/v1/margin/isolated/borrow_record': 1,
179
181
  'spot/v1/margin/isolated/repay_record': 1,
180
- 'spot/v1/margin/isolated/pairs': 1,
181
- 'spot/v1/margin/isolated/account': 6,
182
- 'spot/v1/trade_fee': 6,
183
- 'spot/v1/user_fee': 6,
182
+ 'spot/v1/margin/isolated/pairs': 30,
183
+ 'spot/v1/margin/isolated/account': 5,
184
+ 'spot/v1/trade_fee': 30,
185
+ 'spot/v1/user_fee': 30,
184
186
  // broker
185
187
  'spot/v1/broker/rebate': 1,
186
188
  // contract
@@ -220,9 +222,9 @@ class bitmart extends bitmart$1 {
220
222
  'spot/v2/submit_order': 1,
221
223
  // margin
222
224
  'spot/v1/margin/submit_order': 1,
223
- 'spot/v1/margin/isolated/borrow': 6,
224
- 'spot/v1/margin/isolated/repay': 6,
225
- 'spot/v1/margin/isolated/transfer': 6,
225
+ 'spot/v1/margin/isolated/borrow': 30,
226
+ 'spot/v1/margin/isolated/repay': 30,
227
+ 'spot/v1/margin/isolated/transfer': 30,
226
228
  // contract
227
229
  'account/v1/transfer-contract-list': 60,
228
230
  'account/v1/transfer-contract': 60,
@@ -614,7 +616,7 @@ class bitmart extends bitmart$1 {
614
616
  * @name bitmart#fetchStatus
615
617
  * @description the latest known information on the availability of the exchange API
616
618
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
617
- * @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
619
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
618
620
  */
619
621
  const options = this.safeValue(this.options, 'fetchStatus', {});
620
622
  const defaultType = this.safeString(this.options, 'defaultType');
@@ -950,7 +952,7 @@ class bitmart extends bitmart$1 {
950
952
  * @description please use fetchDepositWithdrawFee instead
951
953
  * @param {string} code unified currency code
952
954
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
953
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
955
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
954
956
  */
955
957
  await this.loadMarkets();
956
958
  const currency = this.currency(code);
@@ -1009,7 +1011,7 @@ class bitmart extends bitmart$1 {
1009
1011
  * @description fetch the fee for deposits and withdrawals
1010
1012
  * @param {string} code unified currency code
1011
1013
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1012
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
1014
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1013
1015
  */
1014
1016
  await this.loadMarkets();
1015
1017
  const currency = this.currency(code);
@@ -1122,7 +1124,7 @@ class bitmart extends bitmart$1 {
1122
1124
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1123
1125
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1124
1126
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1125
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
1127
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1126
1128
  */
1127
1129
  await this.loadMarkets();
1128
1130
  const market = this.market(symbol);
@@ -1211,7 +1213,7 @@ class bitmart extends bitmart$1 {
1211
1213
  * @see https://developer-pro.bitmart.com/en/spot/#get-ticker-of-all-pairs-v2
1212
1214
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1213
1215
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1214
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
1216
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1215
1217
  */
1216
1218
  await this.loadMarkets();
1217
1219
  symbols = this.marketSymbols(symbols);
@@ -1247,7 +1249,7 @@ class bitmart extends bitmart$1 {
1247
1249
  * @param {string} symbol unified symbol of the market to fetch the order book for
1248
1250
  * @param {int} [limit] the maximum amount of order book entries to return
1249
1251
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1250
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
1252
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
1251
1253
  */
1252
1254
  await this.loadMarkets();
1253
1255
  const market = this.market(symbol);
@@ -1420,7 +1422,7 @@ class bitmart extends bitmart$1 {
1420
1422
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1421
1423
  * @param {int} [limit] the maximum amount of trades to fetch
1422
1424
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1423
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
1425
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1424
1426
  */
1425
1427
  await this.loadMarkets();
1426
1428
  const market = this.market(symbol);
@@ -1631,7 +1633,7 @@ class bitmart extends bitmart$1 {
1631
1633
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1632
1634
  * @param {int} [params.until] the latest time in ms to fetch trades for
1633
1635
  * @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)
1634
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
1636
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1635
1637
  */
1636
1638
  await this.loadMarkets();
1637
1639
  let market = undefined;
@@ -1666,7 +1668,9 @@ class bitmart extends bitmart$1 {
1666
1668
  response = await this.privatePostSpotV4QueryTrades(this.extend(request, params));
1667
1669
  }
1668
1670
  else if (type === 'swap') {
1669
- this.checkRequiredSymbol('fetchMyTrades', symbol);
1671
+ if (symbol === undefined) {
1672
+ throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
1673
+ }
1670
1674
  if (since !== undefined) {
1671
1675
  request['start_time'] = since;
1672
1676
  }
@@ -1743,7 +1747,7 @@ class bitmart extends bitmart$1 {
1743
1747
  * @param {int} [since] the earliest time in ms to fetch trades for
1744
1748
  * @param {int} [limit] the maximum number of trades to retrieve
1745
1749
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1746
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
1750
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1747
1751
  */
1748
1752
  await this.loadMarkets();
1749
1753
  const request = {
@@ -1816,7 +1820,7 @@ class bitmart extends bitmart$1 {
1816
1820
  * @see https://developer-pro.bitmart.com/en/spot/#get-account-balance
1817
1821
  * @see https://developer-pro.bitmart.com/en/spot/#get-margin-account-details-isolated
1818
1822
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1819
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1823
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1820
1824
  */
1821
1825
  await this.loadMarkets();
1822
1826
  let marketType = undefined;
@@ -1955,7 +1959,7 @@ class bitmart extends bitmart$1 {
1955
1959
  * @description fetch the trading fees for a market
1956
1960
  * @param {string} symbol unified market symbol
1957
1961
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
1958
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
1962
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1959
1963
  */
1960
1964
  await this.loadMarkets();
1961
1965
  const market = this.market(symbol);
@@ -2118,17 +2122,17 @@ class bitmart extends bitmart$1 {
2118
2122
  parseOrderStatusByType(type, status) {
2119
2123
  const statusesByType = {
2120
2124
  'spot': {
2121
- '1': 'failed',
2125
+ '1': 'rejected',
2122
2126
  '2': 'open',
2123
- '3': 'failed',
2127
+ '3': 'rejected',
2124
2128
  '4': 'open',
2125
2129
  '5': 'open',
2126
2130
  '6': 'closed',
2127
- '7': 'canceling',
2131
+ '7': 'canceled',
2128
2132
  '8': 'canceled',
2129
2133
  'new': 'open',
2130
2134
  'partially_filled': 'open',
2131
- 'filled': 'filled',
2135
+ 'filled': 'closed',
2132
2136
  'partially_canceled': 'canceled',
2133
2137
  },
2134
2138
  'swap': {
@@ -2159,7 +2163,7 @@ class bitmart extends bitmart$1 {
2159
2163
  * @param {string} [params.clientOrderId] client order id of the order
2160
2164
  * @param {boolean} [params.reduceOnly] *swap only* reduce only
2161
2165
  * @param {boolean} [params.postOnly] make sure the order is posted to the order book and not matched immediately
2162
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2166
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2163
2167
  */
2164
2168
  await this.loadMarkets();
2165
2169
  const market = this.market(symbol);
@@ -2218,7 +2222,7 @@ class bitmart extends bitmart$1 {
2218
2222
  * @param {boolean} [params.reduceOnly] *swap only* reduce only
2219
2223
  * @param {string} [params.marginMode] 'cross' or 'isolated', default is 'cross'
2220
2224
  * @param {string} [params.clientOrderId] client order id of the order
2221
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2225
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2222
2226
  */
2223
2227
  const market = this.market(symbol);
2224
2228
  const request = {
@@ -2294,7 +2298,7 @@ class bitmart extends bitmart$1 {
2294
2298
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2295
2299
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2296
2300
  * @param {string} [params.marginMode] 'cross' or 'isolated'
2297
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2301
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2298
2302
  */
2299
2303
  const market = this.market(symbol);
2300
2304
  const request = {
@@ -2366,9 +2370,11 @@ class bitmart extends bitmart$1 {
2366
2370
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2367
2371
  * @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
2368
2372
  * @param {boolean} [params.stop] *swap only* whether the order is a stop order
2369
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2373
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2370
2374
  */
2371
- this.checkRequiredSymbol('cancelOrder', symbol);
2375
+ if (symbol === undefined) {
2376
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2377
+ }
2372
2378
  await this.loadMarkets();
2373
2379
  const market = this.market(symbol);
2374
2380
  const request = {
@@ -2452,7 +2458,7 @@ class bitmart extends bitmart$1 {
2452
2458
  * @param {string} symbol unified market symbol of the market to cancel orders in
2453
2459
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2454
2460
  * @param {string} [params.side] *spot only* 'buy' or 'sell'
2455
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2461
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2456
2462
  */
2457
2463
  await this.loadMarkets();
2458
2464
  const request = {};
@@ -2468,7 +2474,9 @@ class bitmart extends bitmart$1 {
2468
2474
  response = await this.privatePostSpotV1CancelOrders(this.extend(request, params));
2469
2475
  }
2470
2476
  else if (type === 'swap') {
2471
- this.checkRequiredSymbol('cancelAllOrders', symbol);
2477
+ if (symbol === undefined) {
2478
+ throw new errors.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
2479
+ }
2472
2480
  response = await this.privatePostContractPrivateCancelOrders(this.extend(request, params));
2473
2481
  }
2474
2482
  //
@@ -2492,7 +2500,9 @@ class bitmart extends bitmart$1 {
2492
2500
  return response;
2493
2501
  }
2494
2502
  async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
2495
- this.checkRequiredSymbol('fetchOrdersByStatus', symbol);
2503
+ if (symbol === undefined) {
2504
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrdersByStatus() requires a symbol argument');
2505
+ }
2496
2506
  await this.loadMarkets();
2497
2507
  const market = this.market(symbol);
2498
2508
  if (!market['spot']) {
@@ -2563,7 +2573,7 @@ class bitmart extends bitmart$1 {
2563
2573
  * @param {int} [params.until] *spot* the latest time in ms to fetch orders for
2564
2574
  * @param {string} [params.type] *swap* order type, 'limit' or 'market'
2565
2575
  * @param {string} [params.order_state] *swap* the order state, 'all' or 'partially_filled', default is 'all'
2566
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2576
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2567
2577
  */
2568
2578
  await this.loadMarkets();
2569
2579
  let market = undefined;
@@ -2662,12 +2672,15 @@ class bitmart extends bitmart$1 {
2662
2672
  * @method
2663
2673
  * @name bitmart#fetchClosedOrders
2664
2674
  * @see https://developer-pro.bitmart.com/en/spot/#account-orders-v4-signed
2675
+ * @see https://developer-pro.bitmart.com/en/futures/#get-order-history-keyed
2665
2676
  * @description fetches information on multiple closed orders made by the user
2666
2677
  * @param {string} symbol unified market symbol of the market orders were made in
2667
2678
  * @param {int} [since] the earliest time in ms to fetch orders for
2668
2679
  * @param {int} [limit] the maximum number of orde structures to retrieve
2669
2680
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2670
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2681
+ * @param {int} [params.until] timestamp in ms of the latest entry
2682
+ * @param {string} [params.marginMode] *spot only* 'cross' or 'isolated', for margin trading
2683
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2671
2684
  */
2672
2685
  await this.loadMarkets();
2673
2686
  let market = undefined;
@@ -2679,20 +2692,33 @@ class bitmart extends bitmart$1 {
2679
2692
  let type = undefined;
2680
2693
  [type, params] = this.handleMarketTypeAndParams('fetchClosedOrders', market, params);
2681
2694
  if (type !== 'spot') {
2682
- throw new errors.NotSupported(this.id + ' fetchClosedOrders() does not support ' + type + ' orders, only spot orders are accepted');
2695
+ if (symbol === undefined) {
2696
+ throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
2697
+ }
2683
2698
  }
2684
2699
  let marginMode = undefined;
2685
2700
  [marginMode, params] = this.handleMarginModeAndParams('fetchClosedOrders', params);
2686
2701
  if (marginMode === 'isolated') {
2687
2702
  request['orderMode'] = 'iso_margin';
2688
2703
  }
2689
- const until = this.safeInteger2(params, 'until', 'endTime');
2704
+ const startTimeKey = (type === 'spot') ? 'startTime' : 'start_time';
2705
+ if (since !== undefined) {
2706
+ request[startTimeKey] = since;
2707
+ }
2708
+ const endTimeKey = (type === 'spot') ? 'endTime' : 'end_time';
2709
+ const until = this.safeInteger2(params, 'until', endTimeKey);
2690
2710
  if (until !== undefined) {
2691
- params = this.omit(params, ['endTime']);
2692
- request['endTime'] = until;
2711
+ params = this.omit(params, ['until']);
2712
+ request[endTimeKey] = until;
2693
2713
  }
2694
- const response = await this.privatePostSpotV4QueryHistoryOrders(this.extend(request, params));
2695
- const data = this.safeValue(response, 'data');
2714
+ let response = undefined;
2715
+ if (type === 'spot') {
2716
+ response = await this.privatePostSpotV4QueryHistoryOrders(this.extend(request, params));
2717
+ }
2718
+ else {
2719
+ response = await this.privateGetContractPrivateOrderHistory(this.extend(request, params));
2720
+ }
2721
+ const data = this.safeValue(response, 'data', []);
2696
2722
  return this.parseOrders(data, market, since, limit);
2697
2723
  }
2698
2724
  async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -2704,7 +2730,7 @@ class bitmart extends bitmart$1 {
2704
2730
  * @param {int} [since] timestamp in ms of the earliest order, default is undefined
2705
2731
  * @param {int} [limit] max number of orders to return, default is undefined
2706
2732
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2707
- * @returns {object} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2733
+ * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2708
2734
  */
2709
2735
  return await this.fetchOrdersByStatus('canceled', symbol, since, limit, params);
2710
2736
  }
@@ -2720,7 +2746,7 @@ class bitmart extends bitmart$1 {
2720
2746
  * @param {string} symbol unified symbol of the market the order was made in
2721
2747
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2722
2748
  * @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
2723
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2749
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2724
2750
  */
2725
2751
  await this.loadMarkets();
2726
2752
  const request = {};
@@ -2744,7 +2770,9 @@ class bitmart extends bitmart$1 {
2744
2770
  }
2745
2771
  }
2746
2772
  else if (type === 'swap') {
2747
- this.checkRequiredSymbol('fetchOrder', symbol);
2773
+ if (symbol === undefined) {
2774
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
2775
+ }
2748
2776
  request['symbol'] = market['id'];
2749
2777
  request['order_id'] = id;
2750
2778
  response = await this.privateGetContractPrivateOrder(this.extend(request, params));
@@ -2809,7 +2837,7 @@ class bitmart extends bitmart$1 {
2809
2837
  * @description fetch the deposit address for a currency associated with this account
2810
2838
  * @param {string} code unified currency code
2811
2839
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2812
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2840
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2813
2841
  */
2814
2842
  await this.loadMarkets();
2815
2843
  const currency = this.currency(code);
@@ -2874,7 +2902,7 @@ class bitmart extends bitmart$1 {
2874
2902
  * @param {string} address the address to withdraw to
2875
2903
  * @param {string} tag
2876
2904
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2877
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
2905
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2878
2906
  */
2879
2907
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
2880
2908
  this.checkAddress(address);
@@ -2983,7 +3011,7 @@ class bitmart extends bitmart$1 {
2983
3011
  * @param {string} id deposit id
2984
3012
  * @param {string} code not used by bitmart fetchDeposit ()
2985
3013
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
2986
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3014
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2987
3015
  */
2988
3016
  await this.loadMarkets();
2989
3017
  const request = {
@@ -3025,7 +3053,7 @@ class bitmart extends bitmart$1 {
3025
3053
  * @param {int} [since] the earliest time in ms to fetch deposits for
3026
3054
  * @param {int} [limit] the maximum number of deposits structures to retrieve
3027
3055
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3028
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3056
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3029
3057
  */
3030
3058
  return await this.fetchTransactionsByType('deposit', code, since, limit, params);
3031
3059
  }
@@ -3037,7 +3065,7 @@ class bitmart extends bitmart$1 {
3037
3065
  * @param {string} id withdrawal id
3038
3066
  * @param {string} code not used by bitmart.fetchWithdrawal
3039
3067
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3040
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3068
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3041
3069
  */
3042
3070
  await this.loadMarkets();
3043
3071
  const request = {
@@ -3079,7 +3107,7 @@ class bitmart extends bitmart$1 {
3079
3107
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
3080
3108
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
3081
3109
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3082
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3110
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3083
3111
  */
3084
3112
  return await this.fetchTransactionsByType('withdraw', code, since, limit, params);
3085
3113
  }
@@ -3180,9 +3208,11 @@ class bitmart extends bitmart$1 {
3180
3208
  * @param {string} symbol unified market symbol
3181
3209
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3182
3210
  * @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
3183
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
3211
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
3184
3212
  */
3185
- this.checkRequiredSymbol('repayMargin', symbol);
3213
+ if (symbol === undefined) {
3214
+ throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
3215
+ }
3186
3216
  await this.loadMarkets();
3187
3217
  const market = this.market(symbol);
3188
3218
  const currency = this.currency(code);
@@ -3221,9 +3251,11 @@ class bitmart extends bitmart$1 {
3221
3251
  * @param {string} symbol unified market symbol
3222
3252
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3223
3253
  * @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
3224
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
3254
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
3225
3255
  */
3226
- this.checkRequiredSymbol('borrowMargin', symbol);
3256
+ if (symbol === undefined) {
3257
+ throw new errors.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
3258
+ }
3227
3259
  await this.loadMarkets();
3228
3260
  const market = this.market(symbol);
3229
3261
  const currency = this.currency(code);
@@ -3277,20 +3309,21 @@ class bitmart extends bitmart$1 {
3277
3309
  };
3278
3310
  }
3279
3311
  async fetchIsolatedBorrowRate(symbol, params = {}) {
3280
- /**
3281
- * @method
3282
- * @name bitmart#fetchBorrowRate
3283
- * @description fetch the rate of interest to borrow a currency for margin trading
3284
- * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount
3285
- * @param {string} code unified currency code
3286
- * @param {object} [params] extra parameters specific to the bitmart api endpoint
3287
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
3288
- */
3312
+ //
3313
+ // @method
3314
+ // @name bitmart#fetchIsolatedBorrowRate
3315
+ // @description fetch the rate of interest to borrow a currency for margin trading
3316
+ // @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
3317
+ // @param {string} symbol unified symbol of the market to fetch the borrow rate for
3318
+ // @param {object} [params] extra parameters specific to the bitmart api endpoint
3319
+ // <<<<<<< HEAD
3320
+ // @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
3321
+ // =======
3322
+ // @returns {object} an [isolated borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
3323
+ // >>>>>>> 3215552206edf1cda1ae63d2063535e19973dbe5
3324
+ //
3289
3325
  await this.loadMarkets();
3290
- let market = undefined;
3291
- if (symbol !== undefined) {
3292
- market = this.market(symbol);
3293
- }
3326
+ const market = this.market(symbol);
3294
3327
  const request = {
3295
3328
  'symbol': market['id'],
3296
3329
  };
@@ -3358,20 +3391,16 @@ class bitmart extends bitmart$1 {
3358
3391
  //
3359
3392
  const marketId = this.safeString(info, 'symbol');
3360
3393
  const symbol = this.safeSymbol(marketId, market);
3361
- const baseData = this.safeValue(info, 'base');
3362
- const quoteData = this.safeValue(info, 'quote');
3394
+ const baseData = this.safeValue(info, 'base', {});
3395
+ const quoteData = this.safeValue(info, 'quote', {});
3363
3396
  const baseId = this.safeString(baseData, 'currency');
3364
3397
  const quoteId = this.safeString(quoteData, 'currency');
3365
- const base = this.safeCurrencyCode(baseId);
3366
- const quote = this.safeCurrencyCode(quoteId);
3367
- const baseRate = this.safeNumber(baseData, 'hourly_interest');
3368
- const quoteRate = this.safeNumber(quoteData, 'hourly_interest');
3369
3398
  return {
3370
3399
  'symbol': symbol,
3371
- 'base': base,
3372
- 'baseRate': baseRate,
3373
- 'quote': quote,
3374
- 'quoteRate': quoteRate,
3400
+ 'base': this.safeCurrencyCode(baseId),
3401
+ 'baseRate': this.safeNumber(baseData, 'hourly_interest'),
3402
+ 'quote': this.safeCurrencyCode(quoteId),
3403
+ 'quoteRate': this.safeNumber(quoteData, 'hourly_interest'),
3375
3404
  'period': 3600000,
3376
3405
  'timestamp': undefined,
3377
3406
  'datetime': undefined,
@@ -3381,11 +3410,11 @@ class bitmart extends bitmart$1 {
3381
3410
  async fetchIsolatedBorrowRates(params = {}) {
3382
3411
  /**
3383
3412
  * @method
3384
- * @name bitmart#fetchBorrowRates
3413
+ * @name bitmart#fetchIsolatedBorrowRates
3385
3414
  * @description fetch the borrow interest rates of all currencies, currently only works for isolated margin
3386
- * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount
3415
+ * @see https://developer-pro.bitmart.com/en/spot/#get-trading-pair-borrowing-rate-and-amount-keyed
3387
3416
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3388
- * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
3417
+ * @returns {object} a list of [isolated borrow rate structures]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
3389
3418
  */
3390
3419
  await this.loadMarkets();
3391
3420
  const response = await this.privateGetSpotV1MarginIsolatedPairs(params);
@@ -3442,7 +3471,7 @@ class bitmart extends bitmart$1 {
3442
3471
  * @param {string} fromAccount account to transfer from
3443
3472
  * @param {string} toAccount account to transfer to
3444
3473
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3445
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
3474
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
3446
3475
  */
3447
3476
  await this.loadMarkets();
3448
3477
  const currency = this.currency(code);
@@ -3583,7 +3612,7 @@ class bitmart extends bitmart$1 {
3583
3612
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3584
3613
  * @param {int} [params.page] the required number of pages, default is 1, max is 1000
3585
3614
  * @param {int} [params.until] the latest time in ms to fetch transfers for
3586
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
3615
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
3587
3616
  */
3588
3617
  await this.loadMarkets();
3589
3618
  if (limit === undefined) {
@@ -3645,9 +3674,11 @@ class bitmart extends bitmart$1 {
3645
3674
  * @param {int} [since] the earliest time in ms to fetch borrrow interest for
3646
3675
  * @param {int} [limit] the maximum number of structures to retrieve
3647
3676
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3648
- * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
3677
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
3649
3678
  */
3650
- this.checkRequiredSymbol('fetchBorrowInterest', symbol);
3679
+ if (symbol === undefined) {
3680
+ throw new errors.ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
3681
+ }
3651
3682
  await this.loadMarkets();
3652
3683
  const market = this.market(symbol);
3653
3684
  const request = {
@@ -3722,7 +3753,7 @@ class bitmart extends bitmart$1 {
3722
3753
  * @see https://developer-pro.bitmart.com/en/futures/#get-futures-openinterest
3723
3754
  * @param {string} symbol Unified CCXT market symbol
3724
3755
  * @param {object} [params] exchange specific parameters
3725
- * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
3756
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
3726
3757
  */
3727
3758
  await this.loadMarkets();
3728
3759
  const market = this.market(symbol);
@@ -3781,7 +3812,9 @@ class bitmart extends bitmart$1 {
3781
3812
  * @param {string} [params.marginMode] 'isolated' or 'cross'
3782
3813
  * @returns {object} response from the exchange
3783
3814
  */
3784
- this.checkRequiredSymbol('setLeverage', symbol);
3815
+ if (symbol === undefined) {
3816
+ throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
3817
+ }
3785
3818
  let marginMode = undefined;
3786
3819
  [marginMode, params] = this.handleMarginModeAndParams('setLeverage', params);
3787
3820
  this.checkRequiredArgument('setLeverage', marginMode, 'marginMode', ['isolated', 'cross']);
@@ -3805,7 +3838,7 @@ class bitmart extends bitmart$1 {
3805
3838
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-funding-rate
3806
3839
  * @param {string} symbol unified market symbol
3807
3840
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3808
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
3841
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3809
3842
  */
3810
3843
  await this.loadMarkets();
3811
3844
  const market = this.market(symbol);
@@ -3871,7 +3904,7 @@ class bitmart extends bitmart$1 {
3871
3904
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
3872
3905
  * @param {string} symbol unified market symbol of the market the position is held in
3873
3906
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3874
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3907
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3875
3908
  */
3876
3909
  await this.loadMarkets();
3877
3910
  const market = this.market(symbol);
@@ -3920,7 +3953,7 @@ class bitmart extends bitmart$1 {
3920
3953
  * @see https://developer-pro.bitmart.com/en/futures/#get-current-position-keyed
3921
3954
  * @param {string[]|undefined} symbols list of unified market symbols
3922
3955
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
3923
- * @returns {object[]} a list of [position structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3956
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
3924
3957
  */
3925
3958
  await this.loadMarkets();
3926
3959
  let market = undefined;
@@ -4048,9 +4081,11 @@ class bitmart extends bitmart$1 {
4048
4081
  * @param {int} [limit] the maximum number of liquidation structures to retrieve
4049
4082
  * @param {object} [params] exchange specific parameters for the bitmart api endpoint
4050
4083
  * @param {int} [params.until] timestamp in ms of the latest liquidation
4051
- * @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
4084
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
4052
4085
  */
4053
- this.checkRequiredSymbol('fetchMyLiquidations', symbol);
4086
+ if (symbol === undefined) {
4087
+ throw new errors.ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
4088
+ }
4054
4089
  await this.loadMarkets();
4055
4090
  const market = this.market(symbol);
4056
4091
  if (!market['swap']) {