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
@@ -50,14 +50,13 @@ class binance extends binance$1 {
50
50
  'fetchBalance': true,
51
51
  'fetchBidsAsks': true,
52
52
  'fetchBorrowInterest': true,
53
- 'fetchBorrowRate': true,
54
53
  'fetchBorrowRateHistories': false,
55
54
  'fetchBorrowRateHistory': true,
56
- 'fetchBorrowRates': false,
57
- 'fetchBorrowRatesPerSymbol': false,
58
55
  'fetchCanceledOrders': 'emulated',
59
56
  'fetchClosedOrder': false,
60
57
  'fetchClosedOrders': 'emulated',
58
+ 'fetchCrossBorrowRate': true,
59
+ 'fetchCrossBorrowRates': false,
61
60
  'fetchCurrencies': true,
62
61
  'fetchDeposit': false,
63
62
  'fetchDepositAddress': true,
@@ -73,6 +72,8 @@ class binance extends binance$1 {
73
72
  'fetchFundingRates': true,
74
73
  'fetchGreeks': true,
75
74
  'fetchIndexOHLCV': true,
75
+ 'fetchIsolatedBorrowRate': false,
76
+ 'fetchIsolatedBorrowRates': false,
76
77
  'fetchL3OrderBook': false,
77
78
  'fetchLastPrices': true,
78
79
  'fetchLedger': true,
@@ -2546,7 +2547,7 @@ class binance extends binance$1 {
2546
2547
  * @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
2547
2548
  * @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
2548
2549
  * @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
2549
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
2550
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2550
2551
  */
2551
2552
  await this.loadMarkets();
2552
2553
  const defaultType = this.safeString2(this.options, 'fetchBalance', 'defaultType', 'spot');
@@ -2797,7 +2798,7 @@ class binance extends binance$1 {
2797
2798
  * @param {string} symbol unified symbol of the market to fetch the order book for
2798
2799
  * @param {int} [limit] the maximum amount of order book entries to return
2799
2800
  * @param {object} [params] extra parameters specific to the binance api endpoint
2800
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
2801
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
2801
2802
  */
2802
2803
  await this.loadMarkets();
2803
2804
  const market = this.market(symbol);
@@ -3017,7 +3018,7 @@ class binance extends binance$1 {
3017
3018
  * @description the latest known information on the availability of the exchange API
3018
3019
  * @see https://binance-docs.github.io/apidocs/spot/en/#system-status-system
3019
3020
  * @param {object} [params] extra parameters specific to the binance api endpoint
3020
- * @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
3021
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
3021
3022
  */
3022
3023
  const response = await this.sapiGetSystemStatus(params);
3023
3024
  //
@@ -3048,7 +3049,7 @@ class binance extends binance$1 {
3048
3049
  * @param {string} symbol unified symbol of the market to fetch the ticker for
3049
3050
  * @param {object} [params] extra parameters specific to the binance api endpoint
3050
3051
  * @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
3051
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
3052
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
3052
3053
  */
3053
3054
  await this.loadMarkets();
3054
3055
  const market = this.market(symbol);
@@ -3091,7 +3092,7 @@ class binance extends binance$1 {
3091
3092
  * @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-order-book-ticker // future
3092
3093
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
3093
3094
  * @param {object} [params] extra parameters specific to the binance api endpoint
3094
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
3095
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
3095
3096
  */
3096
3097
  await this.loadMarkets();
3097
3098
  symbols = this.marketSymbols(symbols);
@@ -3126,7 +3127,7 @@ class binance extends binance$1 {
3126
3127
  * @see https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-ticker // future
3127
3128
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
3128
3129
  * @param {object} [params] extra parameters specific to the binance api endpoint
3129
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
3130
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
3130
3131
  */
3131
3132
  await this.loadMarkets();
3132
3133
  symbols = this.marketSymbols(symbols);
@@ -3231,7 +3232,7 @@ class binance extends binance$1 {
3231
3232
  * @see https://binance-docs.github.io/apidocs/voptions/en/#24hr-ticker-price-change-statistics // option
3232
3233
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
3233
3234
  * @param {object} [params] extra parameters specific to the binance api endpoint
3234
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
3235
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
3235
3236
  */
3236
3237
  await this.loadMarkets();
3237
3238
  let type = undefined;
@@ -3691,7 +3692,7 @@ class binance extends binance$1 {
3691
3692
  *
3692
3693
  * EXCHANGE SPECIFIC PARAMETERS
3693
3694
  * @param {int} [params.fromId] trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
3694
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
3695
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
3695
3696
  */
3696
3697
  await this.loadMarkets();
3697
3698
  let paginate = false;
@@ -3823,7 +3824,7 @@ class binance extends binance$1 {
3823
3824
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
3824
3825
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
3825
3826
  * @param {object} [params] extra parameters specific to the binance api endpoint
3826
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3827
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3827
3828
  */
3828
3829
  await this.loadMarkets();
3829
3830
  const market = this.market(symbol);
@@ -4025,7 +4026,7 @@ class binance extends binance$1 {
4025
4026
  * @param {float} amount how much of currency you want to trade in units of base currency
4026
4027
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
4027
4028
  * @param {object} [params] extra parameters specific to the binance api endpoint
4028
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4029
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4029
4030
  */
4030
4031
  await this.loadMarkets();
4031
4032
  const market = this.market(symbol);
@@ -4097,7 +4098,7 @@ class binance extends binance$1 {
4097
4098
  * @param {float} amount how much of currency you want to trade in units of base currency
4098
4099
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
4099
4100
  * @param {object} [params] extra parameters specific to the binance api endpoint
4100
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4101
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4101
4102
  */
4102
4103
  await this.loadMarkets();
4103
4104
  const market = this.market(symbol);
@@ -4384,7 +4385,7 @@ class binance extends binance$1 {
4384
4385
  * @description *contract only* create a list of trade orders
4385
4386
  * @see https://binance-docs.github.io/apidocs/futures/en/#place-multiple-orders-trade
4386
4387
  * @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
4387
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4388
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4388
4389
  */
4389
4390
  await this.loadMarkets();
4390
4391
  const ordersRequests = [];
@@ -4477,7 +4478,7 @@ class binance extends binance$1 {
4477
4478
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
4478
4479
  * @param {boolean} [params.sor] *spot only* whether to use SOR (Smart Order Routing) or not, default is false
4479
4480
  * @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
4480
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4481
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4481
4482
  */
4482
4483
  await this.loadMarkets();
4483
4484
  const market = this.market(symbol);
@@ -4761,9 +4762,11 @@ class binance extends binance$1 {
4761
4762
  * @param {string} symbol unified symbol of the market the order was made in
4762
4763
  * @param {object} [params] extra parameters specific to the binance api endpoint
4763
4764
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
4764
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4765
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4765
4766
  */
4766
- this.checkRequiredSymbol('fetchOrder', symbol);
4767
+ if (symbol === undefined) {
4768
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
4769
+ }
4767
4770
  await this.loadMarkets();
4768
4771
  const market = this.market(symbol);
4769
4772
  const defaultType = this.safeString2(this.options, 'fetchOrder', 'defaultType', 'spot');
@@ -4821,9 +4824,11 @@ class binance extends binance$1 {
4821
4824
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
4822
4825
  * @param {int} [params.until] the latest time in ms to fetch orders for
4823
4826
  * @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)
4824
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4827
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4825
4828
  */
4826
- this.checkRequiredSymbol('fetchOrders', symbol);
4829
+ if (symbol === undefined) {
4830
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
4831
+ }
4827
4832
  await this.loadMarkets();
4828
4833
  let paginate = false;
4829
4834
  [paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
@@ -4960,7 +4965,7 @@ class binance extends binance$1 {
4960
4965
  * @param {int} [limit] the maximum number of open orders structures to retrieve
4961
4966
  * @param {object} [params] extra parameters specific to the binance api endpoint
4962
4967
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
4963
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
4968
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
4964
4969
  */
4965
4970
  await this.loadMarkets();
4966
4971
  let market = undefined;
@@ -5032,7 +5037,7 @@ class binance extends binance$1 {
5032
5037
  * @param {int} [limit] the maximum number of order structures to retrieve
5033
5038
  * @param {object} [params] extra parameters specific to the binance api endpoint
5034
5039
  * @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)
5035
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
5040
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5036
5041
  */
5037
5042
  const orders = await this.fetchOrders(symbol, since, limit, params);
5038
5043
  return this.filterBy(orders, 'status', 'closed');
@@ -5050,9 +5055,11 @@ class binance extends binance$1 {
5050
5055
  * @param {int} [limit] the maximum number of order structures to retrieve
5051
5056
  * @param {object} [params] extra parameters specific to the binance api endpoint
5052
5057
  * @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)
5053
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
5058
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5054
5059
  */
5055
- this.checkRequiredSymbol('fetchCanceledOrders', symbol);
5060
+ if (symbol === undefined) {
5061
+ throw new errors.ArgumentsRequired(this.id + ' fetchCanceledOrders() requires a symbol argument');
5062
+ }
5056
5063
  await this.loadMarkets();
5057
5064
  const market = this.market(symbol);
5058
5065
  if (market['swap'] || market['future']) {
@@ -5076,9 +5083,11 @@ class binance extends binance$1 {
5076
5083
  * @param {string} id order id
5077
5084
  * @param {string} symbol unified symbol of the market the order was made in
5078
5085
  * @param {object} [params] extra parameters specific to the binance api endpoint
5079
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
5086
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
5080
5087
  */
5081
- this.checkRequiredSymbol('cancelOrder', symbol);
5088
+ if (symbol === undefined) {
5089
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
5090
+ }
5082
5091
  await this.loadMarkets();
5083
5092
  const market = this.market(symbol);
5084
5093
  const defaultType = this.safeString2(this.options, 'cancelOrder', 'defaultType', 'spot');
@@ -5134,9 +5143,11 @@ class binance extends binance$1 {
5134
5143
  * @param {string} symbol unified market symbol of the market to cancel orders in
5135
5144
  * @param {object} [params] extra parameters specific to the binance api endpoint
5136
5145
  * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
5137
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
5146
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5138
5147
  */
5139
- this.checkRequiredSymbol('cancelAllOrders', symbol);
5148
+ if (symbol === undefined) {
5149
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
5150
+ }
5140
5151
  await this.loadMarkets();
5141
5152
  const market = this.market(symbol);
5142
5153
  const request = {
@@ -5185,7 +5196,9 @@ class binance extends binance$1 {
5185
5196
  * @param {int[]} [params.recvWindow]
5186
5197
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
5187
5198
  */
5188
- this.checkRequiredSymbol('cancelOrders', symbol);
5199
+ if (symbol === undefined) {
5200
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
5201
+ }
5189
5202
  await this.loadMarkets();
5190
5203
  const market = this.market(symbol);
5191
5204
  if (!market['contract']) {
@@ -5253,9 +5266,11 @@ class binance extends binance$1 {
5253
5266
  * @param {int} [since] the earliest time in ms to fetch trades for
5254
5267
  * @param {int} [limit] the maximum number of trades to retrieve
5255
5268
  * @param {object} [params] extra parameters specific to the binance api endpoint
5256
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
5269
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
5257
5270
  */
5258
- this.checkRequiredSymbol('fetchOrderTrades', symbol);
5271
+ if (symbol === undefined) {
5272
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
5273
+ }
5259
5274
  await this.loadMarkets();
5260
5275
  const market = this.market(symbol);
5261
5276
  const type = this.safeString(params, 'type', market['type']);
@@ -5283,7 +5298,7 @@ class binance extends binance$1 {
5283
5298
  * @param {object} [params] extra parameters specific to the binance api endpoint
5284
5299
  * @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)
5285
5300
  * @param {int} [params.until] the latest time in ms to fetch entries for
5286
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
5301
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
5287
5302
  */
5288
5303
  await this.loadMarkets();
5289
5304
  let paginate = false;
@@ -5305,7 +5320,9 @@ class binance extends binance$1 {
5305
5320
  method = 'eapiPrivateGetUserTrades';
5306
5321
  }
5307
5322
  else {
5308
- this.checkRequiredSymbol('fetchMyTrades', symbol);
5323
+ if (symbol === undefined) {
5324
+ throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
5325
+ }
5309
5326
  [marginMode, params] = this.handleMarginModeAndParams('fetchMyTrades', params);
5310
5327
  if (type === 'spot' || type === 'margin') {
5311
5328
  method = 'privateGetMyTrades';
@@ -5428,7 +5445,7 @@ class binance extends binance$1 {
5428
5445
  * @param {int} [since] the earliest time in ms to fetch my dust trades for
5429
5446
  * @param {int} [limit] the maximum number of dust trades to retrieve
5430
5447
  * @param {object} [params] extra parameters specific to the binance api endpoint
5431
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
5448
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
5432
5449
  */
5433
5450
  //
5434
5451
  // Binance provides an opportunity to trade insignificant (i.e. non-tradable and non-withdrawable)
@@ -5572,7 +5589,7 @@ class binance extends binance$1 {
5572
5589
  * @param {bool} [params.fiat] if true, only fiat deposits will be returned
5573
5590
  * @param {int} [params.until] the latest time in ms to fetch entries for
5574
5591
  * @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)
5575
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
5592
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5576
5593
  */
5577
5594
  await this.loadMarkets();
5578
5595
  let paginate = false;
@@ -5687,7 +5704,7 @@ class binance extends binance$1 {
5687
5704
  * @param {bool} [params.fiat] if true, only fiat withdrawals will be returned
5688
5705
  * @param {int} [params.until] the latest time in ms to fetch withdrawals for
5689
5706
  * @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)
5690
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
5707
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5691
5708
  */
5692
5709
  await this.loadMarkets();
5693
5710
  let paginate = false;
@@ -6068,7 +6085,7 @@ class binance extends binance$1 {
6068
6085
  * @param {string} fromAccount account to transfer from
6069
6086
  * @param {string} toAccount account to transfer to
6070
6087
  * @param {object} [params] extra parameters specific to the binance api endpoint
6071
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
6088
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6072
6089
  */
6073
6090
  await this.loadMarkets();
6074
6091
  const currency = this.currency(code);
@@ -6166,7 +6183,7 @@ class binance extends binance$1 {
6166
6183
  * @param {object} [params] extra parameters specific to the binance api endpoint
6167
6184
  * @param {int} [params.until] the latest time in ms to fetch transfers for
6168
6185
  * @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)
6169
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
6186
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
6170
6187
  */
6171
6188
  await this.loadMarkets();
6172
6189
  let paginate = false;
@@ -6238,7 +6255,7 @@ class binance extends binance$1 {
6238
6255
  * @see https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data
6239
6256
  * @param {string} code unified currency code
6240
6257
  * @param {object} [params] extra parameters specific to the binance api endpoint
6241
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
6258
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
6242
6259
  */
6243
6260
  await this.loadMarkets();
6244
6261
  const currency = this.currency(code);
@@ -6314,7 +6331,7 @@ class binance extends binance$1 {
6314
6331
  * @see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
6315
6332
  * @param {string[]|undefined} codes not used by binance fetchTransactionFees ()
6316
6333
  * @param {object} [params] extra parameters specific to the binance api endpoint
6317
- * @returns {object[]} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
6334
+ * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
6318
6335
  */
6319
6336
  await this.loadMarkets();
6320
6337
  const response = await this.sapiGetCapitalConfigGetall(params);
@@ -6428,7 +6445,7 @@ class binance extends binance$1 {
6428
6445
  * @see https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data
6429
6446
  * @param {string[]|undefined} codes not used by binance fetchDepositWithdrawFees ()
6430
6447
  * @param {object} [params] extra parameters specific to the binance api endpoint
6431
- * @returns {object[]} a list of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
6448
+ * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
6432
6449
  */
6433
6450
  await this.loadMarkets();
6434
6451
  const response = await this.sapiGetCapitalConfigGetall(params);
@@ -6555,7 +6572,7 @@ class binance extends binance$1 {
6555
6572
  * @param {string} address the address to withdraw to
6556
6573
  * @param {string} tag
6557
6574
  * @param {object} [params] extra parameters specific to the binance api endpoint
6558
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
6575
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
6559
6576
  */
6560
6577
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
6561
6578
  this.checkAddress(address);
@@ -6620,7 +6637,7 @@ class binance extends binance$1 {
6620
6637
  * @see https://binance-docs.github.io/apidocs/delivery/en/#user-commission-rate-user_data
6621
6638
  * @param {string} symbol unified market symbol
6622
6639
  * @param {object} [params] extra parameters specific to the binance api endpoint
6623
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
6640
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
6624
6641
  */
6625
6642
  await this.loadMarkets();
6626
6643
  const market = this.market(symbol);
@@ -6677,7 +6694,7 @@ class binance extends binance$1 {
6677
6694
  * @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data
6678
6695
  * @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
6679
6696
  * @param {object} [params] extra parameters specific to the binance api endpoint
6680
- * @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
6697
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
6681
6698
  */
6682
6699
  await this.loadMarkets();
6683
6700
  let method = undefined;
@@ -6858,7 +6875,7 @@ class binance extends binance$1 {
6858
6875
  * @param {string} type 1 - transfer from spot account to USDT-Ⓜ futures account, 2 - transfer from USDT-Ⓜ futures account to spot account, 3 - transfer from spot account to COIN-Ⓜ futures account, 4 - transfer from COIN-Ⓜ futures account to spot account
6859
6876
  * @param {object} [params] extra parameters specific to the binance api endpoint
6860
6877
  * @param {float} params.recvWindow
6861
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#futures-transfer-structure}
6878
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=futures-transfer-structure}
6862
6879
  */
6863
6880
  if ((type < 1) || (type > 4)) {
6864
6881
  throw new errors.ArgumentsRequired(this.id + ' type must be between 1 and 4');
@@ -6887,7 +6904,7 @@ class binance extends binance$1 {
6887
6904
  * @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
6888
6905
  * @param {string} symbol unified market symbol
6889
6906
  * @param {object} [params] extra parameters specific to the binance api endpoint
6890
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
6907
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
6891
6908
  */
6892
6909
  await this.loadMarkets();
6893
6910
  const market = this.market(symbol);
@@ -6931,11 +6948,11 @@ class binance extends binance$1 {
6931
6948
  * @see https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures
6932
6949
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
6933
6950
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
6934
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
6951
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
6935
6952
  * @param {object} [params] extra parameters specific to the binance api endpoint
6936
6953
  * @param {int} [params.until] timestamp in ms of the latest funding rate
6937
6954
  * @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)
6938
- * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
6955
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
6939
6956
  */
6940
6957
  await this.loadMarkets();
6941
6958
  const request = {};
@@ -7009,7 +7026,7 @@ class binance extends binance$1 {
7009
7026
  * @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
7010
7027
  * @param {string[]|undefined} symbols list of unified market symbols
7011
7028
  * @param {object} [params] extra parameters specific to the binance api endpoint
7012
- * @returns {object} a dictionary of [funding rates structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rates-structure}, indexe by market symbols
7029
+ * @returns {object} a dictionary of [funding rates structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexe by market symbols
7013
7030
  */
7014
7031
  await this.loadMarkets();
7015
7032
  symbols = this.marketSymbols(symbols);
@@ -7161,7 +7178,7 @@ class binance extends binance$1 {
7161
7178
  const initialMarginString = this.safeString(position, 'initialMargin');
7162
7179
  const initialMargin = this.parseNumber(initialMarginString);
7163
7180
  let initialMarginPercentageString = Precise["default"].stringDiv('1', leverageString, 8);
7164
- const rational = (1000 % leverage) === 0;
7181
+ const rational = this.isRoundNumber(1000 % leverage);
7165
7182
  if (!rational) {
7166
7183
  initialMarginPercentageString = Precise["default"].stringDiv(Precise["default"].stringAdd(initialMarginPercentageString, '1e-8'), '1', 8);
7167
7184
  }
@@ -7447,7 +7464,7 @@ class binance extends binance$1 {
7447
7464
  const maintenanceMarginString = Precise["default"].stringMul(maintenanceMarginPercentageString, notionalStringAbs);
7448
7465
  const maintenanceMargin = this.parseNumber(maintenanceMarginString);
7449
7466
  let initialMarginPercentageString = Precise["default"].stringDiv('1', leverageString, 8);
7450
- const rational = (1000 % leverage) === 0;
7467
+ const rational = this.isRoundNumber(1000 % leverage);
7451
7468
  if (!rational) {
7452
7469
  initialMarginPercentageString = Precise["default"].stringAdd(initialMarginPercentageString, '1e-8');
7453
7470
  }
@@ -7539,7 +7556,7 @@ class binance extends binance$1 {
7539
7556
  * @see https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-symbol-user_data
7540
7557
  * @param {string[]|undefined} symbols list of unified market symbols
7541
7558
  * @param {object} [params] extra parameters specific to the binance api endpoint
7542
- * @returns {object} a dictionary of [leverage tiers structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}, indexed by market symbols
7559
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
7543
7560
  */
7544
7561
  await this.loadMarkets();
7545
7562
  const [type, query] = this.handleMarketTypeAndParams('fetchLeverageTiers', undefined, params);
@@ -7645,7 +7662,7 @@ class binance extends binance$1 {
7645
7662
  * @description fetch data on an open position
7646
7663
  * @param {string} symbol unified market symbol of the market the position is held in
7647
7664
  * @param {object} [params] extra parameters specific to the binance api endpoint
7648
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
7665
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7649
7666
  */
7650
7667
  await this.loadMarkets();
7651
7668
  const market = this.market(symbol);
@@ -7689,7 +7706,7 @@ class binance extends binance$1 {
7689
7706
  * @description fetch data on open options positions
7690
7707
  * @param {string[]|undefined} symbols list of unified market symbols
7691
7708
  * @param {object} [params] extra parameters specific to the binance api endpoint
7692
- * @returns {object[]} a list of [position structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
7709
+ * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
7693
7710
  */
7694
7711
  await this.loadMarkets();
7695
7712
  symbols = this.marketSymbols(symbols);
@@ -7804,7 +7821,7 @@ class binance extends binance$1 {
7804
7821
  * @description fetch all open positions
7805
7822
  * @param {string[]|undefined} symbols list of unified market symbols
7806
7823
  * @param {object} [params] extra parameters specific to the binance api endpoint
7807
- * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
7824
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
7808
7825
  */
7809
7826
  const defaultMethod = this.safeString(this.options, 'fetchPositions', 'positionRisk');
7810
7827
  if (defaultMethod === 'positionRisk') {
@@ -7967,7 +7984,7 @@ class binance extends binance$1 {
7967
7984
  * @param {int} [since] the earliest time in ms to fetch funding history for
7968
7985
  * @param {int} [limit] the maximum number of funding history structures to retrieve
7969
7986
  * @param {object} [params] extra parameters specific to the binance api endpoint
7970
- * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
7987
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
7971
7988
  */
7972
7989
  await this.loadMarkets();
7973
7990
  let market = undefined;
@@ -8017,7 +8034,9 @@ class binance extends binance$1 {
8017
8034
  * @param {object} [params] extra parameters specific to the binance api endpoint
8018
8035
  * @returns {object} response from the exchange
8019
8036
  */
8020
- this.checkRequiredSymbol('setLeverage', symbol);
8037
+ if (symbol === undefined) {
8038
+ throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
8039
+ }
8021
8040
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
8022
8041
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
8023
8042
  if ((leverage < 1) || (leverage > 125)) {
@@ -8025,7 +8044,7 @@ class binance extends binance$1 {
8025
8044
  }
8026
8045
  await this.loadMarkets();
8027
8046
  const market = this.market(symbol);
8028
- let method = undefined;
8047
+ let method;
8029
8048
  if (market['linear']) {
8030
8049
  method = 'fapiPrivatePostLeverage';
8031
8050
  }
@@ -8053,7 +8072,9 @@ class binance extends binance$1 {
8053
8072
  * @param {object} [params] extra parameters specific to the binance api endpoint
8054
8073
  * @returns {object} response from the exchange
8055
8074
  */
8056
- this.checkRequiredSymbol('setMarginMode', symbol);
8075
+ if (symbol === undefined) {
8076
+ throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
8077
+ }
8057
8078
  //
8058
8079
  // { "code": -4048 , "msg": "Margin type cannot be changed if there exists position." }
8059
8080
  //
@@ -8160,7 +8181,7 @@ class binance extends binance$1 {
8160
8181
  * @param {int} [since] timestamp in ms
8161
8182
  * @param {int} [limit] number of records, default 100, max 100
8162
8183
  * @param {object} [params] exchange specific params
8163
- * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
8184
+ * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
8164
8185
  */
8165
8186
  await this.loadMarkets();
8166
8187
  const market = (symbol === undefined) ? undefined : this.market(symbol);
@@ -8346,7 +8367,7 @@ class binance extends binance$1 {
8346
8367
  * @param {object} [params] extra parameters specific to the binance api endpoint
8347
8368
  * @param {int} [params.until] timestamp in ms of the latest ledger entry
8348
8369
  * @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)
8349
- * @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
8370
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
8350
8371
  */
8351
8372
  await this.loadMarkets();
8352
8373
  let paginate = false;
@@ -8802,7 +8823,7 @@ class binance extends binance$1 {
8802
8823
  * @param {string} symbol unified market symbol
8803
8824
  * @param {float} amount the amount of margin to remove
8804
8825
  * @param {object} [params] extra parameters specific to the binance api endpoint
8805
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
8826
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
8806
8827
  */
8807
8828
  return await this.modifyMarginHelper(symbol, amount, 2, params);
8808
8829
  }
@@ -8816,19 +8837,19 @@ class binance extends binance$1 {
8816
8837
  * @param {string} symbol unified market symbol
8817
8838
  * @param {float} amount amount of margin to add
8818
8839
  * @param {object} [params] extra parameters specific to the binance api endpoint
8819
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
8840
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
8820
8841
  */
8821
8842
  return await this.modifyMarginHelper(symbol, amount, 1, params);
8822
8843
  }
8823
- async fetchBorrowRate(code, params = {}) {
8844
+ async fetchCrossBorrowRate(code, params = {}) {
8824
8845
  /**
8825
8846
  * @method
8826
- * @name binance#fetchBorrowRate
8847
+ * @name binance#fetchCrossBorrowRate
8827
8848
  * @description fetch the rate of interest to borrow a currency for margin trading
8828
8849
  * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
8829
8850
  * @param {string} code unified currency code
8830
8851
  * @param {object} [params] extra parameters specific to the binance api endpoint
8831
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
8852
+ * @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
8832
8853
  */
8833
8854
  await this.loadMarkets();
8834
8855
  const currency = this.currency(code);
@@ -8858,9 +8879,9 @@ class binance extends binance$1 {
8858
8879
  * @see https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data
8859
8880
  * @param {string} code unified currency code
8860
8881
  * @param {int} [since] timestamp for the earliest borrow rate
8861
- * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} to retrieve
8882
+ * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
8862
8883
  * @param {object} [params] extra parameters specific to the exchange api endpoint
8863
- * @returns {object[]} an array of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
8884
+ * @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
8864
8885
  */
8865
8886
  await this.loadMarkets();
8866
8887
  if (limit === undefined) {
@@ -8913,7 +8934,7 @@ class binance extends binance$1 {
8913
8934
  // "vipLevel": 0
8914
8935
  // }
8915
8936
  //
8916
- const timestamp = this.safeNumber(info, 'timestamp');
8937
+ const timestamp = this.safeInteger(info, 'timestamp');
8917
8938
  const currencyId = this.safeString(info, 'asset');
8918
8939
  return {
8919
8940
  'currency': this.safeCurrencyCode(currencyId, currency),
@@ -9024,7 +9045,7 @@ class binance extends binance$1 {
9024
9045
  * @param {int} [since] the earliest time in ms to fetch borrrow interest for
9025
9046
  * @param {int} [limit] the maximum number of structures to retrieve
9026
9047
  * @param {object} [params] extra parameters specific to the binance api endpoint
9027
- * @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
9048
+ * @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
9028
9049
  */
9029
9050
  await this.loadMarkets();
9030
9051
  const request = {};
@@ -9091,7 +9112,7 @@ class binance extends binance$1 {
9091
9112
  * @param {float} amount the amount to repay
9092
9113
  * @param {string} symbol unified market symbol, required for isolated margin
9093
9114
  * @param {object} [params] extra parameters specific to the binance api endpoint
9094
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
9115
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
9095
9116
  */
9096
9117
  const [marginMode, query] = this.handleMarginModeAndParams('repayMargin', params); // cross or isolated
9097
9118
  this.checkRequiredMarginArgument('repayMargin', symbol, marginMode);
@@ -9125,7 +9146,7 @@ class binance extends binance$1 {
9125
9146
  * @param {float} amount the amount to borrow
9126
9147
  * @param {string} symbol unified market symbol, required for isolated margin
9127
9148
  * @param {object} [params] extra parameters specific to the binance api endpoint
9128
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
9149
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
9129
9150
  */
9130
9151
  const [marginMode, query] = this.handleMarginModeAndParams('borrowMargin', params); // cross or isolated
9131
9152
  this.checkRequiredMarginArgument('borrowMargin', symbol, marginMode);
@@ -9179,7 +9200,7 @@ class binance extends binance$1 {
9179
9200
  * @param {int} [limit] default 30, max 500
9180
9201
  * @param {object} [params] exchange specific parameters
9181
9202
  * @param {int} [params.until] the time(ms) of the latest record to retrieve as a unix timestamp
9182
- * @returns {object} an array of [open interest structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
9203
+ * @returns {object} an array of [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
9183
9204
  */
9184
9205
  if (timeframe === '1m') {
9185
9206
  throw new errors.BadRequest(this.id + 'fetchOpenInterestHistory cannot use the 1m timeframe');
@@ -9246,7 +9267,7 @@ class binance extends binance$1 {
9246
9267
  * @see https://binance-docs.github.io/apidocs/voptions/en/#open-interest
9247
9268
  * @param {string} symbol unified CCXT market symbol
9248
9269
  * @param {object} [params] exchange specific parameters
9249
- * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
9270
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
9250
9271
  */
9251
9272
  await this.loadMarkets();
9252
9273
  const market = this.market(symbol);
@@ -9341,7 +9362,7 @@ class binance extends binance$1 {
9341
9362
  * @param {object} [params] exchange specific parameters for the binance api endpoint
9342
9363
  * @param {int} [params.until] timestamp in ms of the latest liquidation
9343
9364
  * @param {boolean} [params.paginate] *spot only* default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
9344
- * @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
9365
+ * @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
9345
9366
  */
9346
9367
  await this.loadMarkets();
9347
9368
  let paginate = false;
@@ -9561,7 +9582,7 @@ class binance extends binance$1 {
9561
9582
  * @see https://binance-docs.github.io/apidocs/voptions/en/#option-mark-price
9562
9583
  * @param {string} symbol unified symbol of the market to fetch greeks for
9563
9584
  * @param {object} [params] extra parameters specific to the binance api endpoint
9564
- * @returns {object} a [greeks structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#greeks-structure}
9585
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
9565
9586
  */
9566
9587
  await this.loadMarkets();
9567
9588
  const market = this.market(symbol);