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/bitget.js CHANGED
@@ -44,13 +44,12 @@ export default class bitget extends Exchange {
44
44
  'fetchAccounts': false,
45
45
  'fetchBalance': true,
46
46
  'fetchBorrowInterest': true,
47
- 'fetchBorrowRate': true,
48
47
  'fetchBorrowRateHistories': false,
49
48
  'fetchBorrowRateHistory': false,
50
- 'fetchBorrowRates': false,
51
- 'fetchBorrowRatesPerSymbol': false,
52
49
  'fetchCanceledOrders': true,
53
50
  'fetchClosedOrders': true,
51
+ 'fetchCrossBorrowRate': true,
52
+ 'fetchCrossBorrowRates': false,
54
53
  'fetchCurrencies': true,
55
54
  'fetchDepositAddress': true,
56
55
  'fetchDepositAddresses': false,
@@ -62,6 +61,8 @@ export default class bitget extends Exchange {
62
61
  'fetchFundingRateHistory': true,
63
62
  'fetchFundingRates': false,
64
63
  'fetchIndexOHLCV': true,
64
+ 'fetchIsolatedBorrowRate': true,
65
+ 'fetchIsolatedBorrowRates': false,
65
66
  'fetchLedger': true,
66
67
  'fetchLeverage': true,
67
68
  'fetchLeverageTiers': false,
@@ -1784,7 +1785,7 @@ export default class bitget extends Exchange {
1784
1785
  * @param {object} [params] extra parameters specific to the bitget api endpoint
1785
1786
  * @param {string} [params.marginMode] for spot margin 'cross' or 'isolated', default is 'isolated'
1786
1787
  * @param {string} [params.code] required for cross spot margin
1787
- * @returns {object} a [leverage tiers structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}
1788
+ * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
1788
1789
  */
1789
1790
  await this.loadMarkets();
1790
1791
  const request = {};
@@ -1808,7 +1809,9 @@ export default class bitget extends Exchange {
1808
1809
  }
1809
1810
  else if (marginMode === 'cross') {
1810
1811
  const code = this.safeString(params, 'code');
1811
- this.checkRequiredArgument('fetchMarketLeverageTiers', code, 'code');
1812
+ if (code === undefined) {
1813
+ throw new ArgumentsRequired(this.id + ' fetchMarketLeverageTiers() requires a code argument');
1814
+ }
1812
1815
  params = this.omit(params, 'code');
1813
1816
  const currency = this.currency(code);
1814
1817
  request['coin'] = currency['code'];
@@ -1956,7 +1959,7 @@ export default class bitget extends Exchange {
1956
1959
  * @param {string} [params.pageSize] pageSize default 20. Max 100
1957
1960
  * @param {int} [params.until] end tim in ms
1958
1961
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
1959
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
1962
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1960
1963
  */
1961
1964
  await this.loadMarkets();
1962
1965
  let paginate = false;
@@ -2017,7 +2020,7 @@ export default class bitget extends Exchange {
2017
2020
  * @param {string} tag
2018
2021
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2019
2022
  * @param {string} [params.chain] the chain to withdraw to
2020
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
2023
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2021
2024
  */
2022
2025
  this.checkAddress(address);
2023
2026
  const chain = this.safeString2(params, 'chain', 'network');
@@ -2112,7 +2115,7 @@ export default class bitget extends Exchange {
2112
2115
  * @param {string} [params.pageSize] pageSize default 20. Max 100
2113
2116
  * @param {int} [params.until] end time in ms
2114
2117
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
2115
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
2118
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2116
2119
  */
2117
2120
  await this.loadMarkets();
2118
2121
  let paginate = false;
@@ -2234,7 +2237,7 @@ export default class bitget extends Exchange {
2234
2237
  * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-address
2235
2238
  * @param {string} code unified currency code
2236
2239
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2237
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2240
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2238
2241
  */
2239
2242
  await this.loadMarkets();
2240
2243
  const networkCode = this.safeString(params, 'network');
@@ -2294,7 +2297,7 @@ export default class bitget extends Exchange {
2294
2297
  * @param {string} symbol unified symbol of the market to fetch the order book for
2295
2298
  * @param {int} [limit] the maximum amount of order book entries to return
2296
2299
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2297
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
2300
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2298
2301
  */
2299
2302
  await this.loadMarkets();
2300
2303
  const market = this.market(symbol);
@@ -2453,7 +2456,7 @@ export default class bitget extends Exchange {
2453
2456
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-symbol-ticker
2454
2457
  * @param {string} symbol unified symbol of the market to fetch the ticker for
2455
2458
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2456
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
2459
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2457
2460
  */
2458
2461
  await this.loadMarkets();
2459
2462
  const market = this.market(symbol);
@@ -2499,7 +2502,7 @@ export default class bitget extends Exchange {
2499
2502
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbol-ticker
2500
2503
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
2501
2504
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2502
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
2505
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
2503
2506
  */
2504
2507
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
2505
2508
  await this.loadMarkets();
@@ -2697,7 +2700,7 @@ export default class bitget extends Exchange {
2697
2700
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2698
2701
  * @param {int} [params.until] the latest time in ms to fetch deposits for
2699
2702
  * @param {boolean} [params.paginate] *only applies to publicSpotGetMarketFillsHistory and publicMixGetMarketFillsHistory* default false, when true will automatically paginate by calling this endpoint multiple times
2700
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
2703
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
2701
2704
  */
2702
2705
  await this.loadMarkets();
2703
2706
  let paginate = false;
@@ -2808,7 +2811,7 @@ export default class bitget extends Exchange {
2808
2811
  * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-symbol
2809
2812
  * @param {string} symbol unified market symbol
2810
2813
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2811
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
2814
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
2812
2815
  */
2813
2816
  await this.loadMarkets();
2814
2817
  const market = this.market(symbol);
@@ -2846,7 +2849,7 @@ export default class bitget extends Exchange {
2846
2849
  * @description fetch the trading fees for multiple markets
2847
2850
  * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
2848
2851
  * @param {object} [params] extra parameters specific to the bitget api endpoint
2849
- * @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
2852
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
2850
2853
  */
2851
2854
  await this.loadMarkets();
2852
2855
  const response = await this.publicSpotGetSpotV1PublicProducts(params);
@@ -3055,7 +3058,7 @@ export default class bitget extends Exchange {
3055
3058
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-assets
3056
3059
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-assets
3057
3060
  * @param {object} [params] extra parameters specific to the bitget api endpoint
3058
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
3061
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
3059
3062
  */
3060
3063
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
3061
3064
  await this.loadMarkets();
@@ -3477,7 +3480,7 @@ export default class bitget extends Exchange {
3477
3480
  * @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
3478
3481
  * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
3479
3482
  * @param {string} [params.loanType] *spot margin only* 'normal', 'autoLoan', 'autoRepay', or 'autoLoanAndRepay' default is 'normal'
3480
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3483
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3481
3484
  */
3482
3485
  await this.loadMarkets();
3483
3486
  const market = this.market(symbol);
@@ -3725,7 +3728,7 @@ export default class bitget extends Exchange {
3725
3728
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-batch-order
3726
3729
  * @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
3727
3730
  * @param {object} [params] extra parameters specific to the api endpoint
3728
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3731
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3729
3732
  */
3730
3733
  await this.loadMarkets();
3731
3734
  const ordersRequests = [];
@@ -3829,7 +3832,7 @@ export default class bitget extends Exchange {
3829
3832
  * @param {float} amount how much of currency you want to trade in units of base currency
3830
3833
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
3831
3834
  * @param {object} [params] extra parameters specific to the bitget api endpoint
3832
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3835
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3833
3836
  */
3834
3837
  await this.loadMarkets();
3835
3838
  const market = this.market(symbol);
@@ -3937,9 +3940,11 @@ export default class bitget extends Exchange {
3937
3940
  * @param {string} symbol unified symbol of the market the order was made in
3938
3941
  * @param {object} [params] extra parameters specific to the bitget api endpoint
3939
3942
  * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
3940
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3943
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3941
3944
  */
3942
- this.checkRequiredSymbol('cancelOrder', symbol);
3945
+ if (symbol === undefined) {
3946
+ throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
3947
+ }
3943
3948
  await this.loadMarkets();
3944
3949
  const market = this.market(symbol);
3945
3950
  let marketType = undefined;
@@ -4069,9 +4074,11 @@ export default class bitget extends Exchange {
4069
4074
  * @param {string} symbol unified market symbol, default is undefined
4070
4075
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4071
4076
  * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
4072
- * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4077
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4073
4078
  */
4074
- this.checkRequiredSymbol('cancelOrders', symbol);
4079
+ if (symbol === undefined) {
4080
+ throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
4081
+ }
4075
4082
  await this.loadMarkets();
4076
4083
  const market = this.market(symbol);
4077
4084
  let type = undefined;
@@ -4151,7 +4158,7 @@ export default class bitget extends Exchange {
4151
4158
  * @param {string} symbol unified market symbol
4152
4159
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4153
4160
  * @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
4154
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4161
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4155
4162
  */
4156
4163
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
4157
4164
  await this.loadMarkets();
@@ -4173,7 +4180,9 @@ export default class bitget extends Exchange {
4173
4180
  if (marginMode === undefined) {
4174
4181
  throw new NotSupported(this.id + ' cancelAllOrders () does not support spot markets, only spot-margin');
4175
4182
  }
4176
- this.checkRequiredSymbol('cancelAllOrders', symbol);
4183
+ if (symbol === undefined) {
4184
+ throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
4185
+ }
4177
4186
  const spotMarginRequest = {
4178
4187
  'symbol': market['info']['symbolName'], // regular id like LTCUSDT_SPBL does not work here
4179
4188
  };
@@ -4230,9 +4239,11 @@ export default class bitget extends Exchange {
4230
4239
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-details
4231
4240
  * @param {string} symbol unified symbol of the market the order was made in
4232
4241
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4233
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4242
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4234
4243
  */
4235
- this.checkRequiredSymbol('fetchOrder', symbol);
4244
+ if (symbol === undefined) {
4245
+ throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
4246
+ }
4236
4247
  await this.loadMarkets();
4237
4248
  const market = this.market(symbol);
4238
4249
  const [marketType, query] = this.handleMarketTypeAndParams('fetchOrder', market, params);
@@ -4325,7 +4336,7 @@ export default class bitget extends Exchange {
4325
4336
  * @param {int} [since] the earliest time in ms to fetch open orders for
4326
4337
  * @param {int} [limit] the maximum number of open order structures to retrieve
4327
4338
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4328
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4339
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4329
4340
  */
4330
4341
  await this.loadMarkets();
4331
4342
  const request = {};
@@ -4343,7 +4354,9 @@ export default class bitget extends Exchange {
4343
4354
  const stop = this.safeValue2(params, 'stop', 'trigger');
4344
4355
  params = this.omit(params, ['stop', 'trigger']);
4345
4356
  if (stop) {
4346
- this.checkRequiredSymbol('fetchOpenOrders', symbol);
4357
+ if (symbol === undefined) {
4358
+ throw new ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
4359
+ }
4347
4360
  if (marketType === 'spot') {
4348
4361
  if (limit !== undefined) {
4349
4362
  request['pageSize'] = limit;
@@ -4396,7 +4409,9 @@ export default class bitget extends Exchange {
4396
4409
  response = await this.privateMixGetMixV1OrderMarginCoinCurrent(this.extend(request, params));
4397
4410
  }
4398
4411
  else {
4399
- this.checkRequiredSymbol('fetchOpenOrders', symbol);
4412
+ if (symbol === undefined) {
4413
+ throw new ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
4414
+ }
4400
4415
  response = await this.privateMixGetMixV1OrderCurrent(this.extend(request, params));
4401
4416
  }
4402
4417
  }
@@ -4565,10 +4580,12 @@ export default class bitget extends Exchange {
4565
4580
  * @param {int} [limit] the max number of closed orders to return
4566
4581
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4567
4582
  * @param {int} [params.until] the latest time in ms to fetch entries for
4568
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4583
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4569
4584
  */
4570
4585
  await this.loadMarkets();
4571
- this.checkRequiredSymbol('fetchClosedOrders', symbol);
4586
+ if (symbol === undefined) {
4587
+ throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
4588
+ }
4572
4589
  const market = this.market(symbol);
4573
4590
  let paginate = false;
4574
4591
  [paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
@@ -4605,10 +4622,12 @@ export default class bitget extends Exchange {
4605
4622
  * @param {int} [limit] the max number of canceled orders to return
4606
4623
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4607
4624
  * @param {int} [params.until] the latest time in ms to fetch entries for
4608
- * @returns {object} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4625
+ * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4609
4626
  */
4627
+ if (symbol === undefined) {
4628
+ throw new ArgumentsRequired(this.id + ' fetchCanceledOrders() requires a symbol argument');
4629
+ }
4610
4630
  await this.loadMarkets();
4611
- this.checkRequiredSymbol('fetchCanceledOrders', symbol);
4612
4631
  const market = this.market(symbol);
4613
4632
  let paginate = false;
4614
4633
  [paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledOrders', 'paginate');
@@ -4902,7 +4921,7 @@ export default class bitget extends Exchange {
4902
4921
  * @param {object} [params] extra parameters specific to the bitget api endpoint
4903
4922
  * @param {int} [params.until] end tim in ms
4904
4923
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4905
- * @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
4924
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4906
4925
  */
4907
4926
  await this.loadMarkets();
4908
4927
  let paginate = false;
@@ -5003,11 +5022,13 @@ export default class bitget extends Exchange {
5003
5022
  * @param {int} [since] the earliest time in ms to fetch trades for
5004
5023
  * @param {int} [limit] the maximum number of trades structures to retrieve
5005
5024
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5006
- * @param {int} [params.until] the latest time in ms to fetch entries for
5025
+ * @param {int} [params.until] *swap only* the latest time in ms to fetch entries for
5007
5026
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5008
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
5027
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
5009
5028
  */
5010
- this.checkRequiredSymbol('fetchMyTrades', symbol);
5029
+ if (symbol === undefined) {
5030
+ throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
5031
+ }
5011
5032
  await this.loadMarkets();
5012
5033
  const market = this.market(symbol);
5013
5034
  let paginate = false;
@@ -5049,9 +5070,6 @@ export default class bitget extends Exchange {
5049
5070
  }
5050
5071
  else {
5051
5072
  [request, params] = this.handleUntilOption('before', request, params);
5052
- if (since !== undefined) {
5053
- request['after'] = since;
5054
- }
5055
5073
  if (limit !== undefined) {
5056
5074
  request['limit'] = limit;
5057
5075
  }
@@ -5169,9 +5187,11 @@ export default class bitget extends Exchange {
5169
5187
  * @param {int} [since] the earliest time in ms to fetch trades for
5170
5188
  * @param {int} [limit] the maximum number of trades to retrieve
5171
5189
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5172
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
5190
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
5173
5191
  */
5174
- this.checkRequiredSymbol('fetchOrderTrades', symbol);
5192
+ if (symbol === undefined) {
5193
+ throw new ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
5194
+ }
5175
5195
  await this.loadMarkets();
5176
5196
  const market = this.market(symbol);
5177
5197
  const [marketType, query] = this.handleMarketTypeAndParams('fetchOrderTrades', market, params);
@@ -5223,7 +5243,7 @@ export default class bitget extends Exchange {
5223
5243
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-symbol-position-v2
5224
5244
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
5225
5245
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5226
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
5246
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5227
5247
  */
5228
5248
  await this.loadMarkets();
5229
5249
  const market = this.market(symbol);
@@ -5274,7 +5294,7 @@ export default class bitget extends Exchange {
5274
5294
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-position
5275
5295
  * @param {string[]|undefined} symbols list of unified market symbols
5276
5296
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5277
- * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
5297
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5278
5298
  */
5279
5299
  const sandboxMode = this.safeValue(this.options, 'sandboxMode', false);
5280
5300
  await this.loadMarkets();
@@ -5534,12 +5554,14 @@ export default class bitget extends Exchange {
5534
5554
  * @description fetches historical funding rate prices
5535
5555
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
5536
5556
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
5537
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
5557
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
5538
5558
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5539
5559
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
5540
- * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
5560
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
5541
5561
  */
5542
- this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
5562
+ if (symbol === undefined) {
5563
+ throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
5564
+ }
5543
5565
  await this.loadMarkets();
5544
5566
  let paginate = false;
5545
5567
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -5598,7 +5620,7 @@ export default class bitget extends Exchange {
5598
5620
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-current-funding-rate
5599
5621
  * @param {string} symbol unified market symbol
5600
5622
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5601
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
5623
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
5602
5624
  */
5603
5625
  await this.loadMarkets();
5604
5626
  const market = this.market(symbol);
@@ -5662,10 +5684,12 @@ export default class bitget extends Exchange {
5662
5684
  * @param {int} [since] the starting timestamp in milliseconds
5663
5685
  * @param {int} [limit] the number of entries to return
5664
5686
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5665
- * @returns {object[]} a list of [funding history structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
5687
+ * @returns {object[]} a list of [funding history structures]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
5666
5688
  */
5667
5689
  await this.loadMarkets();
5668
- this.checkRequiredSymbol('fetchFundingHistory', symbol);
5690
+ if (symbol === undefined) {
5691
+ throw new ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
5692
+ }
5669
5693
  const market = this.market(symbol);
5670
5694
  if (!market['swap']) {
5671
5695
  throw new BadSymbol(this.id + ' fetchFundingHistory() supports swap contracts only');
@@ -5804,7 +5828,7 @@ export default class bitget extends Exchange {
5804
5828
  * @param {string} symbol unified market symbol
5805
5829
  * @param {float} amount the amount of margin to remove
5806
5830
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5807
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
5831
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
5808
5832
  */
5809
5833
  if (amount > 0) {
5810
5834
  throw new BadRequest(this.id + ' reduceMargin() amount parameter must be a negative value');
@@ -5824,7 +5848,7 @@ export default class bitget extends Exchange {
5824
5848
  * @param {string} symbol unified market symbol
5825
5849
  * @param {float} amount amount of margin to add
5826
5850
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5827
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
5851
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
5828
5852
  */
5829
5853
  const holdSide = this.safeString(params, 'holdSide');
5830
5854
  if (holdSide === undefined) {
@@ -5840,7 +5864,7 @@ export default class bitget extends Exchange {
5840
5864
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-account
5841
5865
  * @param {string} symbol unified market symbol
5842
5866
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5843
- * @returns {object} a [leverage structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-structure}
5867
+ * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
5844
5868
  */
5845
5869
  await this.loadMarkets();
5846
5870
  const market = this.market(symbol);
@@ -5888,7 +5912,9 @@ export default class bitget extends Exchange {
5888
5912
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5889
5913
  * @returns {object} response from the exchange
5890
5914
  */
5891
- this.checkRequiredSymbol('setLeverage', symbol);
5915
+ if (symbol === undefined) {
5916
+ throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
5917
+ }
5892
5918
  await this.loadMarkets();
5893
5919
  const market = this.market(symbol);
5894
5920
  const request = {
@@ -5910,7 +5936,9 @@ export default class bitget extends Exchange {
5910
5936
  * @param {object} [params] extra parameters specific to the bitget api endpoint
5911
5937
  * @returns {object} response from the exchange
5912
5938
  */
5913
- this.checkRequiredSymbol('setMarginMode', symbol);
5939
+ if (symbol === undefined) {
5940
+ throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
5941
+ }
5914
5942
  marginMode = marginMode.toLowerCase();
5915
5943
  if (marginMode === 'isolated') {
5916
5944
  marginMode = 'fixed';
@@ -5978,7 +6006,7 @@ export default class bitget extends Exchange {
5978
6006
  * @see https://bitgetlimited.github.io/apidoc/en/mix/#get-open-interest
5979
6007
  * @param {string} symbol Unified CCXT market symbol
5980
6008
  * @param {object} [params] exchange specific parameters
5981
- * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
6009
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
5982
6010
  */
5983
6011
  await this.loadMarkets();
5984
6012
  const market = this.market(symbol);
@@ -6016,7 +6044,7 @@ export default class bitget extends Exchange {
6016
6044
  * @param {object} [params] extra parameters specific to the bitget api endpoint
6017
6045
  * @param {int} [params.until] the latest time in ms to fetch entries for
6018
6046
  * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
6019
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
6047
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6020
6048
  */
6021
6049
  await this.loadMarkets();
6022
6050
  let paginate = false;
@@ -6080,7 +6108,7 @@ export default class bitget extends Exchange {
6080
6108
  *
6081
6109
  * EXCHANGE SPECIFIC PARAMS
6082
6110
  * @param {string} [params.clientOid] custom id
6083
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
6111
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6084
6112
  */
6085
6113
  await this.loadMarkets();
6086
6114
  const currency = this.currency(code);
@@ -6235,7 +6263,7 @@ export default class bitget extends Exchange {
6235
6263
  * @see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
6236
6264
  * @param {string[]|undefined} codes list of unified currency codes
6237
6265
  * @param {object} [params] extra parameters specific to the bitget api endpoint
6238
- * @returns {object} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
6266
+ * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
6239
6267
  */
6240
6268
  await this.loadMarkets();
6241
6269
  const response = await this.publicSpotGetSpotV1PublicCurrencies(params);
@@ -6282,7 +6310,7 @@ export default class bitget extends Exchange {
6282
6310
  * @param {string} [symbol] unified market symbol
6283
6311
  * @param {object} [params] extra parameters specific to the bitget api endpoint
6284
6312
  * @param {string} [params.marginMode] 'isolated' or 'cross', symbol is required for 'isolated'
6285
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
6313
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6286
6314
  */
6287
6315
  await this.loadMarkets();
6288
6316
  const currency = this.currency(code);
@@ -6294,7 +6322,9 @@ export default class bitget extends Exchange {
6294
6322
  let marginMode = undefined;
6295
6323
  [marginMode, params] = this.handleMarginModeAndParams('borrowMargin', params);
6296
6324
  if ((symbol !== undefined) || (marginMode === 'isolated')) {
6297
- this.checkRequiredSymbol('borrowMargin', symbol);
6325
+ if (symbol === undefined) {
6326
+ throw new ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
6327
+ }
6298
6328
  const market = this.market(symbol);
6299
6329
  const marketId = market['id'];
6300
6330
  const parts = marketId.split('_');
@@ -6348,7 +6378,7 @@ export default class bitget extends Exchange {
6348
6378
  * @param {string} [symbol] unified market symbol
6349
6379
  * @param {object} [params] extra parameters specific to the bitget api endpoint
6350
6380
  * @param {string} [params.marginMode] 'isolated' or 'cross', symbol is required for 'isolated'
6351
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
6381
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6352
6382
  */
6353
6383
  await this.loadMarkets();
6354
6384
  const currency = this.currency(code);
@@ -6360,7 +6390,9 @@ export default class bitget extends Exchange {
6360
6390
  let marginMode = undefined;
6361
6391
  [marginMode, params] = this.handleMarginModeAndParams('repayMargin', params);
6362
6392
  if ((symbol !== undefined) || (marginMode === 'isolated')) {
6363
- this.checkRequiredSymbol('repayMargin', symbol);
6393
+ if (symbol === undefined) {
6394
+ throw new ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
6395
+ }
6364
6396
  const market = this.market(symbol);
6365
6397
  const marketId = market['id'];
6366
6398
  const parts = marketId.split('_');
@@ -6471,7 +6503,7 @@ export default class bitget extends Exchange {
6471
6503
  * @param {object} [params] exchange specific parameters for the bitget api endpoint
6472
6504
  * @param {int} [params.until] timestamp in ms of the latest liquidation
6473
6505
  * @param {string} [params.marginMode] 'cross' or 'isolated' default value is 'cross'
6474
- * @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
6506
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
6475
6507
  */
6476
6508
  await this.loadMarkets();
6477
6509
  let market = undefined;
@@ -6498,7 +6530,9 @@ export default class bitget extends Exchange {
6498
6530
  let marginMode = undefined;
6499
6531
  [marginMode, params] = this.handleMarginModeAndParams('fetchMyLiquidations', params, 'cross');
6500
6532
  if (marginMode === 'isolated') {
6501
- this.checkRequiredSymbol('fetchMyLiquidations', symbol);
6533
+ if (symbol === undefined) {
6534
+ throw new ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
6535
+ }
6502
6536
  request['symbol'] = market['info']['symbolName'];
6503
6537
  response = await this.privateMarginGetMarginV1IsolatedLiquidationList(this.extend(request, params));
6504
6538
  }
@@ -6605,41 +6639,23 @@ export default class bitget extends Exchange {
6605
6639
  'datetime': this.iso8601(timestamp),
6606
6640
  });
6607
6641
  }
6608
- async fetchBorrowRate(code, params = {}) {
6642
+ async fetchIsolatedBorrowRate(symbol, params = {}) {
6609
6643
  /**
6610
6644
  * @method
6611
- * @name bitget#fetchBorrowRate
6645
+ * @name bitget#fetchIsolatedBorrowRate
6612
6646
  * @description fetch the rate of interest to borrow a currency for margin trading
6613
6647
  * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-isolated-margin-interest-rate-and-max-borrowable-amount
6614
- * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-margin-interest-rate-and-borrowable
6615
- * @param {string} code unified currency code
6648
+ * @param {string} symbol unified market symbol
6616
6649
  * @param {object} [params] extra parameters specific to the bitget api endpoint
6617
6650
  * @param {string} [params.symbol] required for isolated margin
6618
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
6651
+ * @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
6619
6652
  */
6620
6653
  await this.loadMarkets();
6621
- const currency = this.currency(code);
6622
- let market = undefined;
6623
- const symbol = this.safeString(params, 'symbol');
6624
- params = this.omit(params, 'symbol');
6625
- if (symbol !== undefined) {
6626
- market = this.market(symbol);
6627
- }
6628
- const request = {};
6629
- let response = undefined;
6630
- let marginMode = undefined;
6631
- [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowRate', params, 'cross');
6632
- if ((symbol !== undefined) || (marginMode === 'isolated')) {
6633
- this.checkRequiredSymbol('fetchBorrowRate', symbol);
6634
- request['symbol'] = market['info']['symbolName'];
6635
- response = await this.publicMarginGetMarginV1IsolatedPublicInterestRateAndLimit(this.extend(request, params));
6636
- }
6637
- else if (marginMode === 'cross') {
6638
- request['coin'] = currency['code'];
6639
- response = await this.publicMarginGetMarginV1CrossPublicInterestRateAndLimit(this.extend(request, params));
6640
- }
6641
- //
6642
- // isolated
6654
+ const market = this.market(symbol);
6655
+ const request = {
6656
+ 'symbol': market['info']['symbolName'],
6657
+ };
6658
+ const response = await this.publicMarginGetMarginV1IsolatedPublicInterestRateAndLimit(this.extend(request, params));
6643
6659
  //
6644
6660
  // {
6645
6661
  // "code": "00000",
@@ -6681,42 +6697,13 @@ export default class bitget extends Exchange {
6681
6697
  // ]
6682
6698
  // }
6683
6699
  //
6684
- // cross
6685
- //
6686
- // {
6687
- // "code": "00000",
6688
- // "msg": "success",
6689
- // "requestTime": 1698208150986,
6690
- // "data": [
6691
- // {
6692
- // "coin": "BTC",
6693
- // "leverage": "3",
6694
- // "transferInAble": true,
6695
- // "borrowAble": true,
6696
- // "dailyInterestRate": "0.00007",
6697
- // "yearlyInterestRate": "0.02555",
6698
- // "maxBorrowableAmount": "26",
6699
- // "vips": [
6700
- // {
6701
- // "level": "0",
6702
- // "dailyInterestRate": "0.00007",
6703
- // "yearlyInterestRate": "0.02555",
6704
- // "discountRate": "1"
6705
- // },
6706
- // ]
6707
- // }
6708
- // ]
6709
- // }
6710
- //
6711
6700
  const timestamp = this.safeInteger(response, 'requestTime');
6712
6701
  const data = this.safeValue(response, 'data', []);
6713
6702
  const first = this.safeValue(data, 0, {});
6714
6703
  first['timestamp'] = timestamp;
6715
- return this.parseBorrowRate(first, currency);
6704
+ return this.parseIsolatedBorrowRate(first, market);
6716
6705
  }
6717
- parseBorrowRate(info, currency = undefined) {
6718
- //
6719
- // isolated
6706
+ parseIsolatedBorrowRate(info, market = undefined) {
6720
6707
  //
6721
6708
  // {
6722
6709
  // "symbol": "BTCUSDT",
@@ -6751,7 +6738,73 @@ export default class bitget extends Exchange {
6751
6738
  // ]
6752
6739
  // }
6753
6740
  //
6754
- // cross
6741
+ const marketId = this.safeString(info, 'symbol');
6742
+ const symbol = this.safeSymbol(marketId, market);
6743
+ const baseId = this.safeString(info, 'baseCoin');
6744
+ const quoteId = this.safeString(info, 'quoteCoin');
6745
+ const timestamp = this.safeInteger(info, 'timestamp');
6746
+ return {
6747
+ 'symbol': symbol,
6748
+ 'base': this.safeCurrencyCode(baseId),
6749
+ 'baseRate': this.safeNumber(info, 'baseDailyInterestRate'),
6750
+ 'quote': this.safeCurrencyCode(quoteId),
6751
+ 'quoteRate': this.safeNumber(info, 'quoteDailyInterestRate'),
6752
+ 'period': 86400000,
6753
+ 'timestamp': timestamp,
6754
+ 'datetime': this.iso8601(timestamp),
6755
+ 'info': info,
6756
+ };
6757
+ }
6758
+ async fetchCrossBorrowRate(code, params = {}) {
6759
+ /**
6760
+ * @method
6761
+ * @name bitget#fetchCrossBorrowRate
6762
+ * @description fetch the rate of interest to borrow a currency for margin trading
6763
+ * @see https://bitgetlimited.github.io/apidoc/en/margin/#get-cross-margin-interest-rate-and-borrowable
6764
+ * @param {string} code unified currency code
6765
+ * @param {object} [params] extra parameters specific to the bitget api endpoint
6766
+ * @param {string} [params.symbol] required for isolated margin
6767
+ * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
6768
+ */
6769
+ await this.loadMarkets();
6770
+ const currency = this.currency(code);
6771
+ const request = {
6772
+ 'coin': currency['code'],
6773
+ };
6774
+ const response = await this.publicMarginGetMarginV1CrossPublicInterestRateAndLimit(this.extend(request, params));
6775
+ //
6776
+ // {
6777
+ // "code": "00000",
6778
+ // "msg": "success",
6779
+ // "requestTime": 1698208150986,
6780
+ // "data": [
6781
+ // {
6782
+ // "coin": "BTC",
6783
+ // "leverage": "3",
6784
+ // "transferInAble": true,
6785
+ // "borrowAble": true,
6786
+ // "dailyInterestRate": "0.00007",
6787
+ // "yearlyInterestRate": "0.02555",
6788
+ // "maxBorrowableAmount": "26",
6789
+ // "vips": [
6790
+ // {
6791
+ // "level": "0",
6792
+ // "dailyInterestRate": "0.00007",
6793
+ // "yearlyInterestRate": "0.02555",
6794
+ // "discountRate": "1"
6795
+ // },
6796
+ // ]
6797
+ // }
6798
+ // ]
6799
+ // }
6800
+ //
6801
+ const timestamp = this.safeInteger(response, 'requestTime');
6802
+ const data = this.safeValue(response, 'data', []);
6803
+ const first = this.safeValue(data, 0, {});
6804
+ first['timestamp'] = timestamp;
6805
+ return this.parseBorrowRate(first, currency);
6806
+ }
6807
+ parseBorrowRate(info, currency = undefined) {
6755
6808
  //
6756
6809
  // {
6757
6810
  // "coin": "BTC",
@@ -6771,29 +6824,11 @@ export default class bitget extends Exchange {
6771
6824
  // ]
6772
6825
  // }
6773
6826
  //
6774
- const code = currency['code'];
6775
- const baseCoin = this.safeString(info, 'baseCoin');
6776
- const quoteCoin = this.safeString(info, 'quoteCoin');
6777
- let currencyId = undefined;
6778
- let interestRate = undefined;
6779
- if (baseCoin !== undefined) {
6780
- if (code === baseCoin) {
6781
- currencyId = baseCoin;
6782
- interestRate = this.safeNumber(info, 'baseDailyInterestRate');
6783
- }
6784
- else if (code === quoteCoin) {
6785
- currencyId = quoteCoin;
6786
- interestRate = this.safeNumber(info, 'quoteDailyInterestRate');
6787
- }
6788
- }
6789
- else {
6790
- currencyId = this.safeString(info, 'coin');
6791
- interestRate = this.safeNumber(info, 'dailyInterestRate');
6792
- }
6827
+ const currencyId = this.safeString(info, 'coin');
6793
6828
  const timestamp = this.safeInteger(info, 'timestamp');
6794
6829
  return {
6795
6830
  'currency': this.safeCurrencyCode(currencyId, currency),
6796
- 'rate': interestRate,
6831
+ 'rate': this.safeNumber(info, 'dailyInterestRate'),
6797
6832
  'period': 86400000,
6798
6833
  'timestamp': timestamp,
6799
6834
  'datetime': this.iso8601(timestamp),
@@ -6812,7 +6847,7 @@ export default class bitget extends Exchange {
6812
6847
  * @param {int} [since] the earliest time in ms to fetch borrow interest for
6813
6848
  * @param {int} [limit] the maximum number of structures to retrieve
6814
6849
  * @param {object} [params] extra parameters specific to the bitget api endpoint
6815
- * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
6850
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
6816
6851
  */
6817
6852
  await this.loadMarkets();
6818
6853
  let market = undefined;
@@ -6838,7 +6873,9 @@ export default class bitget extends Exchange {
6838
6873
  let marginMode = undefined;
6839
6874
  [marginMode, params] = this.handleMarginModeAndParams('fetchBorrowInterest', params, 'cross');
6840
6875
  if (marginMode === 'isolated') {
6841
- this.checkRequiredSymbol('fetchBorrowInterest', symbol);
6876
+ if (symbol === undefined) {
6877
+ throw new ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
6878
+ }
6842
6879
  request['symbol'] = market['info']['symbolName'];
6843
6880
  response = await this.privateMarginGetMarginV1IsolatedInterestList(this.extend(request, params));
6844
6881
  }