ccxt 4.1.56 → 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 (316) hide show
  1. package/.git-templates/hooks/pre-push +2 -2
  2. package/README.md +3 -3
  3. package/build.sh +30 -18
  4. package/dist/ccxt.browser.js +3872 -3202
  5. package/dist/ccxt.browser.min.js +10 -10
  6. package/dist/cjs/ccxt.js +1 -1
  7. package/dist/cjs/src/ace.js +17 -13
  8. package/dist/cjs/src/alpaca.js +6 -6
  9. package/dist/cjs/src/ascendex.js +35 -29
  10. package/dist/cjs/src/base/Exchange.js +39 -26
  11. package/dist/cjs/src/base/Precise.js +1 -3
  12. package/dist/cjs/src/bigone.js +24 -20
  13. package/dist/cjs/src/binance.js +97 -76
  14. package/dist/cjs/src/bingx.js +63 -44
  15. package/dist/cjs/src/bit2c.js +18 -15
  16. package/dist/cjs/src/bitbank.js +16 -15
  17. package/dist/cjs/src/bitbns.js +28 -18
  18. package/dist/cjs/src/bitfinex.js +23 -21
  19. package/dist/cjs/src/bitfinex2.js +32 -28
  20. package/dist/cjs/src/bitflyer.js +28 -20
  21. package/dist/cjs/src/bitforex.js +25 -18
  22. package/dist/cjs/src/bitget.js +184 -147
  23. package/dist/cjs/src/bithumb.js +23 -16
  24. package/dist/cjs/src/bitmart.js +106 -85
  25. package/dist/cjs/src/bitmex.js +104 -64
  26. package/dist/cjs/src/bitopro.js +38 -26
  27. package/dist/cjs/src/bitpanda.js +24 -23
  28. package/dist/cjs/src/bitrue.js +33 -24
  29. package/dist/cjs/src/bitso.js +24 -23
  30. package/dist/cjs/src/bitstamp.js +24 -23
  31. package/dist/cjs/src/bittrex.js +30 -29
  32. package/dist/cjs/src/bitvavo.js +38 -30
  33. package/dist/cjs/src/bl3p.js +11 -10
  34. package/dist/cjs/src/blockchaincom.js +20 -20
  35. package/dist/cjs/src/btcalpha.js +18 -17
  36. package/dist/cjs/src/btcbox.js +13 -12
  37. package/dist/cjs/src/btcmarkets.js +20 -19
  38. package/dist/cjs/src/btcturk.js +14 -13
  39. package/dist/cjs/src/bybit.js +84 -54
  40. package/dist/cjs/src/cex.js +16 -14
  41. package/dist/cjs/src/coinbase.js +29 -27
  42. package/dist/cjs/src/coinbasepro.js +27 -25
  43. package/dist/cjs/src/coincheck.js +15 -14
  44. package/dist/cjs/src/coinex.js +100 -77
  45. package/dist/cjs/src/coinlist.js +28 -27
  46. package/dist/cjs/src/coinmate.js +20 -17
  47. package/dist/cjs/src/coinone.js +21 -16
  48. package/dist/cjs/src/coinsph.js +37 -28
  49. package/dist/cjs/src/coinspot.js +12 -11
  50. package/dist/cjs/src/cryptocom.js +40 -202
  51. package/dist/cjs/src/currencycom.js +32 -25
  52. package/dist/cjs/src/delta.js +34 -28
  53. package/dist/cjs/src/deribit.js +39 -36
  54. package/dist/cjs/src/digifinex.js +64 -44
  55. package/dist/cjs/src/exmo.js +29 -27
  56. package/dist/cjs/src/gate.js +67 -53
  57. package/dist/cjs/src/gemini.js +23 -20
  58. package/dist/cjs/src/hitbtc.js +65 -56
  59. package/dist/cjs/src/hollaex.js +30 -27
  60. package/dist/cjs/src/htx.js +132 -143
  61. package/dist/cjs/src/huobijp.js +22 -20
  62. package/dist/cjs/src/idex.js +22 -21
  63. package/dist/cjs/src/independentreserve.js +15 -14
  64. package/dist/cjs/src/indodax.js +30 -26
  65. package/dist/cjs/src/kraken.js +29 -27
  66. package/dist/cjs/src/krakenfutures.js +29 -22
  67. package/dist/cjs/src/kucoin.js +48 -43
  68. package/dist/cjs/src/kucoinfutures.js +33 -28
  69. package/dist/cjs/src/kuna.js +25 -24
  70. package/dist/cjs/src/latoken.js +24 -22
  71. package/dist/cjs/src/lbank.js +45 -30
  72. package/dist/cjs/src/luno.js +22 -19
  73. package/dist/cjs/src/lykke.js +19 -17
  74. package/dist/cjs/src/mercado.js +30 -19
  75. package/dist/cjs/src/mexc.js +60 -49
  76. package/dist/cjs/src/ndax.js +23 -22
  77. package/dist/cjs/src/novadax.js +23 -22
  78. package/dist/cjs/src/oceanex.js +22 -19
  79. package/dist/cjs/src/okcoin.js +29 -23
  80. package/dist/cjs/src/okx.js +87 -82
  81. package/dist/cjs/src/p2b.js +79 -82
  82. package/dist/cjs/src/paymium.js +10 -10
  83. package/dist/cjs/src/phemex.js +63 -40
  84. package/dist/cjs/src/poloniex.js +22 -22
  85. package/dist/cjs/src/poloniexfutures.js +23 -19
  86. package/dist/cjs/src/pro/alpaca.js +5 -5
  87. package/dist/cjs/src/pro/ascendex.js +4 -4
  88. package/dist/cjs/src/pro/binance.js +16 -16
  89. package/dist/cjs/src/pro/bingx.js +1 -1
  90. package/dist/cjs/src/pro/bitfinex.js +4 -4
  91. package/dist/cjs/src/pro/bitfinex2.js +6 -6
  92. package/dist/cjs/src/pro/bitget.js +7 -7
  93. package/dist/cjs/src/pro/bitmart.js +7 -5
  94. package/dist/cjs/src/pro/bitmex.js +6 -6
  95. package/dist/cjs/src/pro/bitopro.js +4 -4
  96. package/dist/cjs/src/pro/bitpanda.js +6 -6
  97. package/dist/cjs/src/pro/bitrue.js +2 -2
  98. package/dist/cjs/src/pro/bitstamp.js +6 -4
  99. package/dist/cjs/src/pro/bittrex.js +6 -6
  100. package/dist/cjs/src/pro/bitvavo.js +11 -7
  101. package/dist/cjs/src/pro/blockchaincom.js +8 -8
  102. package/dist/cjs/src/pro/bybit.js +7 -7
  103. package/dist/cjs/src/pro/cex.js +13 -9
  104. package/dist/cjs/src/pro/coinbase.js +5 -5
  105. package/dist/cjs/src/pro/coinbasepro.js +11 -10
  106. package/dist/cjs/src/pro/coinex.js +7 -9
  107. package/dist/cjs/src/pro/cryptocom.js +9 -9
  108. package/dist/cjs/src/pro/currencycom.js +4 -4
  109. package/dist/cjs/src/pro/deribit.js +6 -6
  110. package/dist/cjs/src/pro/exmo.js +12 -14
  111. package/dist/cjs/src/pro/gate.js +7 -7
  112. package/dist/cjs/src/pro/gemini.js +3 -3
  113. package/dist/cjs/src/pro/hitbtc.js +263 -4
  114. package/dist/cjs/src/pro/hollaex.js +5 -5
  115. package/dist/cjs/src/pro/htx.js +6 -6
  116. package/dist/cjs/src/pro/huobijp.js +3 -3
  117. package/dist/cjs/src/pro/idex.js +4 -4
  118. package/dist/cjs/src/pro/independentreserve.js +2 -2
  119. package/dist/cjs/src/pro/kraken.js +10 -10
  120. package/dist/cjs/src/pro/krakenfutures.js +41 -17
  121. package/dist/cjs/src/pro/kucoin.js +7 -7
  122. package/dist/cjs/src/pro/kucoinfutures.js +8 -6
  123. package/dist/cjs/src/pro/luno.js +2 -2
  124. package/dist/cjs/src/pro/mexc.js +6 -6
  125. package/dist/cjs/src/pro/ndax.js +3 -3
  126. package/dist/cjs/src/pro/okcoin.js +5 -5
  127. package/dist/cjs/src/pro/okx.js +12 -12
  128. package/dist/cjs/src/pro/phemex.js +6 -6
  129. package/dist/cjs/src/pro/poloniex.js +7 -7
  130. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  131. package/dist/cjs/src/pro/probit.js +6 -6
  132. package/dist/cjs/src/pro/upbit.js +3 -3
  133. package/dist/cjs/src/pro/wazirx.js +8 -8
  134. package/dist/cjs/src/pro/whitebit.js +12 -8
  135. package/dist/cjs/src/pro/woo.js +1 -1
  136. package/dist/cjs/src/probit.js +28 -23
  137. package/dist/cjs/src/tidex.js +16 -15
  138. package/dist/cjs/src/timex.js +19 -18
  139. package/dist/cjs/src/tokocrypto.js +27 -22
  140. package/dist/cjs/src/upbit.js +19 -19
  141. package/dist/cjs/src/wavesexchange.js +22 -19
  142. package/dist/cjs/src/wazirx.js +24 -17
  143. package/dist/cjs/src/whitebit.js +33 -27
  144. package/dist/cjs/src/woo.js +44 -34
  145. package/dist/cjs/src/yobit.js +25 -20
  146. package/dist/cjs/src/zaif.js +9 -9
  147. package/dist/cjs/src/zonda.js +18 -17
  148. package/js/ccxt.d.ts +1 -1
  149. package/js/ccxt.js +1 -1
  150. package/js/src/abstract/bybit.d.ts +1 -0
  151. package/js/src/abstract/cryptocom.d.ts +0 -20
  152. package/js/src/ace.js +18 -14
  153. package/js/src/alpaca.js +6 -6
  154. package/js/src/ascendex.js +35 -29
  155. package/js/src/base/Exchange.d.ts +37 -34
  156. package/js/src/base/Exchange.js +39 -26
  157. package/js/src/base/Precise.d.ts +4 -4
  158. package/js/src/base/Precise.js +1 -3
  159. package/js/src/base/functions/type.d.ts +25 -25
  160. package/js/src/base/types.d.ts +21 -14
  161. package/js/src/bigone.js +25 -21
  162. package/js/src/binance.d.ts +2 -2
  163. package/js/src/binance.js +97 -76
  164. package/js/src/bingx.js +63 -44
  165. package/js/src/bit2c.js +19 -16
  166. package/js/src/bitbank.js +16 -15
  167. package/js/src/bitbns.js +28 -18
  168. package/js/src/bitfinex.js +23 -21
  169. package/js/src/bitfinex2.js +32 -28
  170. package/js/src/bitflyer.js +28 -20
  171. package/js/src/bitforex.js +26 -19
  172. package/js/src/bitget.d.ts +25 -3
  173. package/js/src/bitget.js +184 -147
  174. package/js/src/bithumb.js +23 -16
  175. package/js/src/bitmart.d.ts +1 -1
  176. package/js/src/bitmart.js +106 -85
  177. package/js/src/bitmex.d.ts +2 -2
  178. package/js/src/bitmex.js +104 -64
  179. package/js/src/bitopro.js +38 -26
  180. package/js/src/bitpanda.js +24 -23
  181. package/js/src/bitrue.js +33 -24
  182. package/js/src/bitso.js +24 -23
  183. package/js/src/bitstamp.d.ts +2 -2
  184. package/js/src/bitstamp.js +24 -23
  185. package/js/src/bittrex.js +30 -29
  186. package/js/src/bitvavo.js +38 -30
  187. package/js/src/bl3p.js +11 -10
  188. package/js/src/blockchaincom.js +20 -20
  189. package/js/src/btcalpha.js +18 -17
  190. package/js/src/btcbox.js +13 -12
  191. package/js/src/btcmarkets.js +20 -19
  192. package/js/src/btcturk.js +14 -13
  193. package/js/src/bybit.d.ts +1 -1
  194. package/js/src/bybit.js +84 -54
  195. package/js/src/cex.js +16 -14
  196. package/js/src/coinbase.js +29 -27
  197. package/js/src/coinbasepro.js +27 -25
  198. package/js/src/coincheck.js +15 -14
  199. package/js/src/coinex.d.ts +1 -1
  200. package/js/src/coinex.js +100 -77
  201. package/js/src/coinlist.js +28 -27
  202. package/js/src/coinmate.js +21 -18
  203. package/js/src/coinone.js +21 -16
  204. package/js/src/coinsph.js +37 -28
  205. package/js/src/coinspot.js +12 -11
  206. package/js/src/cryptocom.d.ts +0 -23
  207. package/js/src/cryptocom.js +40 -202
  208. package/js/src/currencycom.js +32 -25
  209. package/js/src/delta.js +35 -29
  210. package/js/src/deribit.js +39 -36
  211. package/js/src/digifinex.d.ts +2 -2
  212. package/js/src/digifinex.js +65 -45
  213. package/js/src/exmo.js +29 -27
  214. package/js/src/gate.d.ts +1 -1
  215. package/js/src/gate.js +67 -53
  216. package/js/src/gemini.js +23 -20
  217. package/js/src/hitbtc.d.ts +1 -0
  218. package/js/src/hitbtc.js +65 -56
  219. package/js/src/hollaex.js +30 -27
  220. package/js/src/htx.d.ts +11 -3
  221. package/js/src/htx.js +132 -143
  222. package/js/src/huobijp.js +23 -21
  223. package/js/src/idex.js +22 -21
  224. package/js/src/independentreserve.js +15 -14
  225. package/js/src/indodax.js +30 -26
  226. package/js/src/kraken.js +29 -27
  227. package/js/src/krakenfutures.js +29 -22
  228. package/js/src/kucoin.d.ts +1 -1
  229. package/js/src/kucoin.js +48 -43
  230. package/js/src/kucoinfutures.js +33 -28
  231. package/js/src/kuna.js +25 -24
  232. package/js/src/latoken.js +25 -23
  233. package/js/src/lbank.js +46 -31
  234. package/js/src/luno.js +22 -19
  235. package/js/src/lykke.js +19 -17
  236. package/js/src/mercado.js +30 -19
  237. package/js/src/mexc.d.ts +1 -1
  238. package/js/src/mexc.js +60 -49
  239. package/js/src/ndax.js +23 -22
  240. package/js/src/novadax.js +23 -22
  241. package/js/src/oceanex.js +22 -19
  242. package/js/src/okcoin.js +29 -23
  243. package/js/src/okx.d.ts +2 -2
  244. package/js/src/okx.js +87 -82
  245. package/js/src/p2b.d.ts +8 -7
  246. package/js/src/p2b.js +79 -81
  247. package/js/src/paymium.js +10 -10
  248. package/js/src/phemex.js +63 -40
  249. package/js/src/poloniex.js +22 -22
  250. package/js/src/poloniexfutures.js +23 -19
  251. package/js/src/pro/alpaca.js +5 -5
  252. package/js/src/pro/ascendex.js +4 -4
  253. package/js/src/pro/binance.js +16 -16
  254. package/js/src/pro/bingx.js +1 -1
  255. package/js/src/pro/bitfinex.js +4 -4
  256. package/js/src/pro/bitfinex2.d.ts +1 -1
  257. package/js/src/pro/bitfinex2.js +6 -6
  258. package/js/src/pro/bitget.js +7 -7
  259. package/js/src/pro/bitmart.js +7 -5
  260. package/js/src/pro/bitmex.js +6 -6
  261. package/js/src/pro/bitopro.js +4 -4
  262. package/js/src/pro/bitpanda.js +6 -6
  263. package/js/src/pro/bitrue.js +2 -2
  264. package/js/src/pro/bitstamp.js +7 -5
  265. package/js/src/pro/bittrex.js +6 -6
  266. package/js/src/pro/bitvavo.js +12 -8
  267. package/js/src/pro/blockchaincom.js +8 -8
  268. package/js/src/pro/bybit.js +7 -7
  269. package/js/src/pro/cex.js +14 -10
  270. package/js/src/pro/coinbase.js +5 -5
  271. package/js/src/pro/coinbasepro.js +12 -11
  272. package/js/src/pro/coinex.js +7 -9
  273. package/js/src/pro/cryptocom.js +9 -9
  274. package/js/src/pro/currencycom.js +4 -4
  275. package/js/src/pro/deribit.js +6 -6
  276. package/js/src/pro/exmo.js +12 -14
  277. package/js/src/pro/gate.js +7 -7
  278. package/js/src/pro/gemini.js +3 -3
  279. package/js/src/pro/hitbtc.d.ts +8 -1
  280. package/js/src/pro/hitbtc.js +264 -5
  281. package/js/src/pro/hollaex.js +5 -5
  282. package/js/src/pro/htx.js +6 -6
  283. package/js/src/pro/huobijp.js +3 -3
  284. package/js/src/pro/idex.js +4 -4
  285. package/js/src/pro/independentreserve.js +2 -2
  286. package/js/src/pro/kraken.js +10 -10
  287. package/js/src/pro/krakenfutures.d.ts +1 -0
  288. package/js/src/pro/krakenfutures.js +42 -18
  289. package/js/src/pro/kucoin.js +7 -7
  290. package/js/src/pro/kucoinfutures.js +8 -6
  291. package/js/src/pro/luno.js +2 -2
  292. package/js/src/pro/mexc.js +6 -6
  293. package/js/src/pro/ndax.js +3 -3
  294. package/js/src/pro/okcoin.js +5 -5
  295. package/js/src/pro/okx.js +12 -12
  296. package/js/src/pro/phemex.js +6 -6
  297. package/js/src/pro/poloniex.js +7 -7
  298. package/js/src/pro/poloniexfutures.js +5 -5
  299. package/js/src/pro/probit.js +6 -6
  300. package/js/src/pro/upbit.js +3 -3
  301. package/js/src/pro/wazirx.js +8 -8
  302. package/js/src/pro/whitebit.js +13 -9
  303. package/js/src/pro/woo.js +1 -1
  304. package/js/src/probit.js +29 -24
  305. package/js/src/tidex.js +16 -15
  306. package/js/src/timex.js +19 -18
  307. package/js/src/tokocrypto.js +28 -23
  308. package/js/src/upbit.js +19 -19
  309. package/js/src/wavesexchange.js +23 -20
  310. package/js/src/wazirx.js +25 -18
  311. package/js/src/whitebit.js +33 -27
  312. package/js/src/woo.js +45 -35
  313. package/js/src/yobit.js +25 -20
  314. package/js/src/zaif.js +9 -9
  315. package/js/src/zonda.js +18 -17
  316. package/package.json +1 -1
@@ -47,14 +47,13 @@ class okx extends okx$1 {
47
47
  'fetchBalance': true,
48
48
  'fetchBidsAsks': undefined,
49
49
  'fetchBorrowInterest': true,
50
- 'fetchBorrowRate': true,
51
50
  'fetchBorrowRateHistories': true,
52
51
  'fetchBorrowRateHistory': true,
53
- 'fetchBorrowRates': true,
54
- 'fetchBorrowRatesPerSymbol': false,
55
52
  'fetchCanceledOrders': true,
56
53
  'fetchClosedOrder': undefined,
57
54
  'fetchClosedOrders': true,
55
+ 'fetchCrossBorrowRate': true,
56
+ 'fetchCrossBorrowRates': true,
58
57
  'fetchCurrencies': true,
59
58
  'fetchDeposit': true,
60
59
  'fetchDepositAddress': true,
@@ -70,6 +69,8 @@ class okx extends okx$1 {
70
69
  'fetchFundingRates': false,
71
70
  'fetchGreeks': true,
72
71
  'fetchIndexOHLCV': true,
72
+ 'fetchIsolatedBorrowRate': false,
73
+ 'fetchIsolatedBorrowRates': false,
73
74
  'fetchL3OrderBook': false,
74
75
  'fetchLedger': true,
75
76
  'fetchLedgerEntry': undefined,
@@ -1163,7 +1164,7 @@ class okx extends okx$1 {
1163
1164
  * @description the latest known information on the availability of the exchange API
1164
1165
  * @see https://www.okx.com/docs-v5/en/#status-get-status
1165
1166
  * @param {object} [params] extra parameters specific to the okx api endpoint
1166
- * @returns {object} a [status structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#exchange-status-structure}
1167
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
1167
1168
  */
1168
1169
  const response = await this.publicGetSystemStatus(params);
1169
1170
  //
@@ -1235,7 +1236,7 @@ class okx extends okx$1 {
1235
1236
  * @description fetch all the accounts associated with a profile
1236
1237
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-account-configuration
1237
1238
  * @param {object} [params] extra parameters specific to the okx api endpoint
1238
- * @returns {object} a dictionary of [account structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#account-structure} indexed by the account type
1239
+ * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
1239
1240
  */
1240
1241
  const response = await this.privateGetAccountConfig(params);
1241
1242
  //
@@ -1656,7 +1657,7 @@ class okx extends okx$1 {
1656
1657
  * @param {string} symbol unified symbol of the market to fetch the order book for
1657
1658
  * @param {int} [limit] the maximum amount of order book entries to return
1658
1659
  * @param {object} [params] extra parameters specific to the okx api endpoint
1659
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
1660
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
1660
1661
  */
1661
1662
  await this.loadMarkets();
1662
1663
  const market = this.market(symbol);
@@ -1757,7 +1758,7 @@ class okx extends okx$1 {
1757
1758
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-ticker
1758
1759
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1759
1760
  * @param {object} [params] extra parameters specific to the okx api endpoint
1760
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
1761
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1761
1762
  */
1762
1763
  await this.loadMarkets();
1763
1764
  const market = this.market(symbol);
@@ -1848,7 +1849,7 @@ class okx extends okx$1 {
1848
1849
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-get-tickers
1849
1850
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1850
1851
  * @param {object} [params] extra parameters specific to the okx api endpoint
1851
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
1852
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
1852
1853
  */
1853
1854
  await this.loadMarkets();
1854
1855
  symbols = this.marketSymbols(symbols);
@@ -1965,7 +1966,7 @@ class okx extends okx$1 {
1965
1966
  * @param {int} [limit] the maximum amount of trades to fetch
1966
1967
  * @param {object} [params] extra parameters specific to the okx api endpoint
1967
1968
  * @param {boolean} [params.paginate] *only applies to publicGetMarketHistoryTrades* default false, when true will automatically paginate by calling this endpoint multiple times
1968
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
1969
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1969
1970
  */
1970
1971
  await this.loadMarkets();
1971
1972
  let paginate = false;
@@ -2174,12 +2175,14 @@ class okx extends okx$1 {
2174
2175
  * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
2175
2176
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
2176
2177
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
2177
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
2178
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
2178
2179
  * @param {object} [params] extra parameters specific to the okx api endpoint
2179
2180
  * @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)
2180
- * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
2181
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
2181
2182
  */
2182
- this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
2183
+ if (symbol === undefined) {
2184
+ throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
2185
+ }
2183
2186
  await this.loadMarkets();
2184
2187
  let paginate = false;
2185
2188
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -2317,7 +2320,7 @@ class okx extends okx$1 {
2317
2320
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-fee-rates
2318
2321
  * @param {string} symbol unified market symbol
2319
2322
  * @param {object} [params] extra parameters specific to the okx api endpoint
2320
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
2323
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
2321
2324
  */
2322
2325
  await this.loadMarkets();
2323
2326
  const market = this.market(symbol);
@@ -2367,7 +2370,7 @@ class okx extends okx$1 {
2367
2370
  * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2368
2371
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2369
2372
  * @param {object} [params] extra parameters specific to the okx api endpoint
2370
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
2373
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2371
2374
  */
2372
2375
  await this.loadMarkets();
2373
2376
  const [marketType, query] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
@@ -2762,7 +2765,7 @@ class okx extends okx$1 {
2762
2765
  * @param {float} [params.stopLoss.price] used for stop loss limit orders, not used for stop loss market price orders
2763
2766
  * @param {string} [params.stopLoss.type] 'market' or 'limit' used to specify the stop loss price type
2764
2767
  * @param {string} [params.positionSide] if position mode is one-way: set to 'net', if position mode is hedge-mode: set to 'long' or 'short'
2765
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2768
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2766
2769
  */
2767
2770
  await this.loadMarkets();
2768
2771
  const market = this.market(symbol);
@@ -2805,7 +2808,7 @@ class okx extends okx$1 {
2805
2808
  * @description create a list of trade orders
2806
2809
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-place-multiple-orders
2807
2810
  * @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
2808
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2811
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2809
2812
  */
2810
2813
  await this.loadMarkets();
2811
2814
  const ordersRequests = [];
@@ -2932,7 +2935,7 @@ class okx extends okx$1 {
2932
2935
  * @param {float} [params.takeProfit.triggerPrice] take profit trigger price
2933
2936
  * @param {float} [params.takeProfit.price] used for take profit limit orders, not used for take profit market price orders
2934
2937
  * @param {string} [params.takeProfit.type] 'market' or 'limit' used to specify the take profit price type
2935
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2938
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2936
2939
  */
2937
2940
  await this.loadMarkets();
2938
2941
  const market = this.market(symbol);
@@ -2969,9 +2972,11 @@ class okx extends okx$1 {
2969
2972
  * @param {string} id order id
2970
2973
  * @param {string} symbol unified symbol of the market the order was made in
2971
2974
  * @param {object} [params] extra parameters specific to the okx api endpoint
2972
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2975
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2973
2976
  */
2974
- this.checkRequiredSymbol('cancelOrder', symbol);
2977
+ if (symbol === undefined) {
2978
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2979
+ }
2975
2980
  const stop = this.safeValue(params, 'stop');
2976
2981
  if (stop) {
2977
2982
  const orderInner = await this.cancelOrders([id], symbol, params);
@@ -3023,10 +3028,12 @@ class okx extends okx$1 {
3023
3028
  * @param {string[]} ids order ids
3024
3029
  * @param {string} symbol unified market symbol
3025
3030
  * @param {object} [params] extra parameters specific to the okx api endpoint
3026
- * @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3031
+ * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3027
3032
  */
3028
3033
  // TODO : the original endpoint signature differs, according to that you can skip individual symbol and assign ids in batch. At this moment, `params` is not being used too.
3029
- this.checkRequiredSymbol('cancelOrders', symbol);
3034
+ if (symbol === undefined) {
3035
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
3036
+ }
3030
3037
  await this.loadMarkets();
3031
3038
  const market = this.market(symbol);
3032
3039
  const request = [];
@@ -3335,9 +3342,11 @@ class okx extends okx$1 {
3335
3342
  * @param {string} id the order id
3336
3343
  * @param {string} symbol unified market symbol
3337
3344
  * @param {object} [params] extra and exchange specific parameters
3338
- * @returns [an order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3345
+ * @returns [an order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
3339
3346
  */
3340
- this.checkRequiredSymbol('fetchOrder', symbol);
3347
+ if (symbol === undefined) {
3348
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
3349
+ }
3341
3350
  await this.loadMarkets();
3342
3351
  const market = this.market(symbol);
3343
3352
  const request = {
@@ -3487,7 +3496,7 @@ class okx extends okx$1 {
3487
3496
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
3488
3497
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
3489
3498
  * @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)
3490
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3499
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3491
3500
  */
3492
3501
  await this.loadMarkets();
3493
3502
  let paginate = false;
@@ -3642,7 +3651,7 @@ class okx extends okx$1 {
3642
3651
  * @param {string} [params.ordType] "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
3643
3652
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
3644
3653
  * @param {int} [params.until] timestamp in ms to fetch orders for
3645
- * @returns {object} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3654
+ * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3646
3655
  */
3647
3656
  await this.loadMarkets();
3648
3657
  const request = {
@@ -3819,7 +3828,7 @@ class okx extends okx$1 {
3819
3828
  * @param {string} [params.algoId] Algo ID "'433845797218942976'"
3820
3829
  * @param {int} [params.until] timestamp in ms to fetch orders for
3821
3830
  * @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)
3822
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
3831
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
3823
3832
  */
3824
3833
  await this.loadMarkets();
3825
3834
  let paginate = false;
@@ -3988,7 +3997,7 @@ class okx extends okx$1 {
3988
3997
  * @param {object} [params] extra parameters specific to the okx api endpoint
3989
3998
  * @param {int} [params.until] Timestamp in ms of the latest time to retrieve trades for
3990
3999
  * @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)
3991
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
4000
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
3992
4001
  */
3993
4002
  await this.loadMarkets();
3994
4003
  let paginate = false;
@@ -4056,7 +4065,7 @@ class okx extends okx$1 {
4056
4065
  * @param {int} [since] the earliest time in ms to fetch trades for
4057
4066
  * @param {int} [limit] the maximum number of trades to retrieve
4058
4067
  * @param {object} [params] extra parameters specific to the okx api endpoint
4059
- * @returns {object[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
4068
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
4060
4069
  */
4061
4070
  const request = {
4062
4071
  // 'instrument_id': market['id'],
@@ -4082,7 +4091,7 @@ class okx extends okx$1 {
4082
4091
  * @param {string} [params.marginMode] 'cross' or 'isolated'
4083
4092
  * @param {int} [params.until] the latest time in ms to fetch entries for
4084
4093
  * @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)
4085
- * @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
4094
+ * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
4086
4095
  */
4087
4096
  await this.loadMarkets();
4088
4097
  let paginate = false;
@@ -4380,7 +4389,7 @@ class okx extends okx$1 {
4380
4389
  * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
4381
4390
  * @param {string} code unified currency code of the currency for the deposit address
4382
4391
  * @param {object} [params] extra parameters specific to the okx api endpoint
4383
- * @returns {object} a dictionary of [address structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure} indexed by the network
4392
+ * @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
4384
4393
  */
4385
4394
  await this.loadMarkets();
4386
4395
  const currency = this.currency(code);
@@ -4422,7 +4431,7 @@ class okx extends okx$1 {
4422
4431
  * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
4423
4432
  * @param {string} code unified currency code
4424
4433
  * @param {object} [params] extra parameters specific to the okx api endpoint
4425
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
4434
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
4426
4435
  */
4427
4436
  const rawNetwork = this.safeStringUpper(params, 'network');
4428
4437
  const networks = this.safeValue(this.options, 'networks', {});
@@ -4466,7 +4475,7 @@ class okx extends okx$1 {
4466
4475
  * @param {string} address the address to withdraw to
4467
4476
  * @param {string} tag
4468
4477
  * @param {object} [params] extra parameters specific to the okx api endpoint
4469
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4478
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4470
4479
  */
4471
4480
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
4472
4481
  this.checkAddress(address);
@@ -4546,7 +4555,7 @@ class okx extends okx$1 {
4546
4555
  * @param {object} [params] extra parameters specific to the okx api endpoint
4547
4556
  * @param {int} [params.until] the latest time in ms to fetch entries for
4548
4557
  * @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)
4549
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4558
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4550
4559
  */
4551
4560
  await this.loadMarkets();
4552
4561
  let paginate = false;
@@ -4624,7 +4633,7 @@ class okx extends okx$1 {
4624
4633
  * @param {string} id deposit id
4625
4634
  * @param {string} code filter by currency code
4626
4635
  * @param {object} [params] extra parameters specific to the okx api endpoint
4627
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4636
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4628
4637
  */
4629
4638
  await this.loadMarkets();
4630
4639
  const request = {
@@ -4652,7 +4661,7 @@ class okx extends okx$1 {
4652
4661
  * @param {object} [params] extra parameters specific to the okx api endpoint
4653
4662
  * @param {int} [params.until] the latest time in ms to fetch entries for
4654
4663
  * @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)
4655
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4664
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4656
4665
  */
4657
4666
  await this.loadMarkets();
4658
4667
  let paginate = false;
@@ -4722,7 +4731,7 @@ class okx extends okx$1 {
4722
4731
  * @param {string} id withdrawal id
4723
4732
  * @param {string} code unified currency code of the currency withdrawn, default is undefined
4724
4733
  * @param {object} [params] extra parameters specific to the okx api endpoint
4725
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4734
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4726
4735
  */
4727
4736
  await this.loadMarkets();
4728
4737
  const request = {
@@ -4902,7 +4911,7 @@ class okx extends okx$1 {
4902
4911
  * @param {string} symbol unified market symbol
4903
4912
  * @param {object} [params] extra parameters specific to the okx api endpoint
4904
4913
  * @param {string} [params.marginMode] 'cross' or 'isolated'
4905
- * @returns {object} a [leverage structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-structure}
4914
+ * @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
4906
4915
  */
4907
4916
  await this.loadMarkets();
4908
4917
  let marginMode = undefined;
@@ -4944,7 +4953,7 @@ class okx extends okx$1 {
4944
4953
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
4945
4954
  * @param {object} [params] extra parameters specific to the okx api endpoint
4946
4955
  * @param {string} [params.instType] MARGIN, SWAP, FUTURES, OPTION
4947
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
4956
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
4948
4957
  */
4949
4958
  await this.loadMarkets();
4950
4959
  const market = this.market(symbol);
@@ -5020,7 +5029,7 @@ class okx extends okx$1 {
5020
5029
  * @param {string[]|undefined} symbols list of unified market symbols
5021
5030
  * @param {object} [params] extra parameters specific to the okx api endpoint
5022
5031
  * @param {string} [params.instType] MARGIN, SWAP, FUTURES, OPTION
5023
- * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
5032
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
5024
5033
  */
5025
5034
  await this.loadMarkets();
5026
5035
  const request = {
@@ -5254,7 +5263,7 @@ class okx extends okx$1 {
5254
5263
  * @param {string} fromAccount account to transfer from
5255
5264
  * @param {string} toAccount account to transfer to
5256
5265
  * @param {object} [params] extra parameters specific to the okx api endpoint
5257
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
5266
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
5258
5267
  */
5259
5268
  await this.loadMarkets();
5260
5269
  const currency = this.currency(code);
@@ -5428,7 +5437,7 @@ class okx extends okx$1 {
5428
5437
  * @param {int} [since] the earliest time in ms to fetch transfers for
5429
5438
  * @param {int} [limit] the maximum number of transfers structures to retrieve
5430
5439
  * @param {object} [params] extra parameters specific to the okx api endpoint
5431
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
5440
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
5432
5441
  */
5433
5442
  await this.loadMarkets();
5434
5443
  let currency = undefined;
@@ -5593,7 +5602,7 @@ class okx extends okx$1 {
5593
5602
  * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate
5594
5603
  * @param {string} symbol unified market symbol
5595
5604
  * @param {object} [params] extra parameters specific to the okx api endpoint
5596
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
5605
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
5597
5606
  */
5598
5607
  await this.loadMarkets();
5599
5608
  const market = this.market(symbol);
@@ -5634,7 +5643,7 @@ class okx extends okx$1 {
5634
5643
  * @param {int} [since] the earliest time in ms to fetch funding history for
5635
5644
  * @param {int} [limit] the maximum number of funding history structures to retrieve
5636
5645
  * @param {object} [params] extra parameters specific to the okx api endpoint
5637
- * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
5646
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
5638
5647
  */
5639
5648
  await this.loadMarkets();
5640
5649
  const request = {
@@ -5796,7 +5805,9 @@ class okx extends okx$1 {
5796
5805
  * @param {string} [params.posSide] 'long' or 'short' for isolated margin long/short mode on futures and swap markets
5797
5806
  * @returns {object} response from the exchange
5798
5807
  */
5799
- this.checkRequiredSymbol('setLeverage', symbol);
5808
+ if (symbol === undefined) {
5809
+ throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
5810
+ }
5800
5811
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
5801
5812
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
5802
5813
  if ((leverage < 1) || (leverage > 125)) {
@@ -5890,7 +5901,9 @@ class okx extends okx$1 {
5890
5901
  * @param {int} [params.leverage] leverage
5891
5902
  * @returns {object} response from the exchange
5892
5903
  */
5893
- this.checkRequiredSymbol('setMarginMode', symbol);
5904
+ if (symbol === undefined) {
5905
+ throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
5906
+ }
5894
5907
  // WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
5895
5908
  // AND DECREASE LIQUIDATION PRICE FOR OPEN ISOLATED SHORT POSITIONS
5896
5909
  marginMode = marginMode.toLowerCase();
@@ -5926,14 +5939,14 @@ class okx extends okx$1 {
5926
5939
  //
5927
5940
  return response;
5928
5941
  }
5929
- async fetchBorrowRates(params = {}) {
5942
+ async fetchCrossBorrowRates(params = {}) {
5930
5943
  /**
5931
5944
  * @method
5932
- * @name okx#fetchBorrowRates
5945
+ * @name okx#fetchCrossBorrowRates
5933
5946
  * @description fetch the borrow interest rates of all currencies
5934
5947
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
5935
5948
  * @param {object} [params] extra parameters specific to the okx api endpoint
5936
- * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
5949
+ * @returns {object} a list of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
5937
5950
  */
5938
5951
  await this.loadMarkets();
5939
5952
  const response = await this.privateGetAccountInterestRate(params);
@@ -5949,32 +5962,22 @@ class okx extends okx$1 {
5949
5962
  // ],
5950
5963
  // }
5951
5964
  //
5952
- const timestamp = this.milliseconds();
5953
- const data = this.safeValue(response, 'data');
5954
- const rates = {};
5965
+ const data = this.safeValue(response, 'data', []);
5966
+ const rates = [];
5955
5967
  for (let i = 0; i < data.length; i++) {
5956
- const rate = data[i];
5957
- const code = this.safeCurrencyCode(this.safeString(rate, 'ccy'));
5958
- rates[code] = {
5959
- 'currency': code,
5960
- 'rate': this.safeNumber(rate, 'interestRate'),
5961
- 'period': 86400000,
5962
- 'timestamp': timestamp,
5963
- 'datetime': this.iso8601(timestamp),
5964
- 'info': rate,
5965
- };
5968
+ rates.push(this.parseBorrowRate(data[i]));
5966
5969
  }
5967
5970
  return rates;
5968
5971
  }
5969
- async fetchBorrowRate(code, params = {}) {
5972
+ async fetchCrossBorrowRate(code, params = {}) {
5970
5973
  /**
5971
5974
  * @method
5972
- * @name okx#fetchBorrowRate
5975
+ * @name okx#fetchCrossBorrowRate
5973
5976
  * @description fetch the rate of interest to borrow a currency for margin trading
5974
5977
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-interest-rate
5975
5978
  * @param {string} code unified currency code
5976
5979
  * @param {object} [params] extra parameters specific to the okx api endpoint
5977
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
5980
+ * @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
5978
5981
  */
5979
5982
  await this.loadMarkets();
5980
5983
  const currency = this.currency(code);
@@ -6070,7 +6073,7 @@ class okx extends okx$1 {
6070
6073
  * @param {int} [since] timestamp in ms of the earliest borrowRate, default is undefined
6071
6074
  * @param {int} [limit] max number of borrow rate prices to return, default is undefined
6072
6075
  * @param {object} [params] extra parameters specific to the okx api endpoint
6073
- * @returns {object} a dictionary of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} indexed by the market symbol
6076
+ * @returns {object} a dictionary of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} indexed by the market symbol
6074
6077
  */
6075
6078
  await this.loadMarkets();
6076
6079
  const request = {
@@ -6111,9 +6114,9 @@ class okx extends okx$1 {
6111
6114
  * @see https://www.okx.com/docs-v5/en/#financial-product-savings-get-public-borrow-history-public
6112
6115
  * @param {string} code unified currency code
6113
6116
  * @param {int} [since] timestamp for the earliest borrow rate
6114
- * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure} to retrieve
6117
+ * @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
6115
6118
  * @param {object} [params] extra parameters specific to the exchange api endpoint
6116
- * @returns {object[]} an array of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
6119
+ * @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
6117
6120
  */
6118
6121
  await this.loadMarkets();
6119
6122
  const currency = this.currency(code);
@@ -6204,7 +6207,7 @@ class okx extends okx$1 {
6204
6207
  * @param {string} symbol unified market symbol
6205
6208
  * @param {float} amount the amount of margin to remove
6206
6209
  * @param {object} [params] extra parameters specific to the okx api endpoint
6207
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
6210
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
6208
6211
  */
6209
6212
  return await this.modifyMarginHelper(symbol, amount, 'reduce', params);
6210
6213
  }
@@ -6217,7 +6220,7 @@ class okx extends okx$1 {
6217
6220
  * @param {string} symbol unified market symbol
6218
6221
  * @param {float} amount amount of margin to add
6219
6222
  * @param {object} [params] extra parameters specific to the okx api endpoint
6220
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
6223
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
6221
6224
  */
6222
6225
  return await this.modifyMarginHelper(symbol, amount, 'add', params);
6223
6226
  }
@@ -6230,7 +6233,7 @@ class okx extends okx$1 {
6230
6233
  * @param {string} symbol unified market symbol
6231
6234
  * @param {object} [params] extra parameters specific to the okx api endpoint
6232
6235
  * @param {string} [params.marginMode] 'cross' or 'isolated'
6233
- * @returns {object} a [leverage tiers structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}
6236
+ * @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
6234
6237
  */
6235
6238
  await this.loadMarkets();
6236
6239
  const market = this.market(symbol);
@@ -6328,11 +6331,11 @@ class okx extends okx$1 {
6328
6331
  * @param {string} code the unified currency code for the currency of the interest
6329
6332
  * @param {string} symbol the market symbol of an isolated margin market, if undefined, the interest for cross margin markets is returned
6330
6333
  * @param {int} [since] timestamp in ms of the earliest time to receive interest records for
6331
- * @param {int} [limit] the number of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure} to retrieve
6334
+ * @param {int} [limit] the number of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure} to retrieve
6332
6335
  * @param {object} [params] exchange specific parameters
6333
6336
  * @param {int} [params.type] Loan type 1 - VIP loans 2 - Market loans *Default is Market loans*
6334
6337
  * @param {string} [params.marginMode] 'cross' or 'isolated'
6335
- * @returns {object[]} An list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
6338
+ * @returns {object[]} An list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
6336
6339
  */
6337
6340
  await this.loadMarkets();
6338
6341
  let marginMode = undefined;
@@ -6410,7 +6413,7 @@ class okx extends okx$1 {
6410
6413
  * @param {float} amount the amount to borrow
6411
6414
  * @param {string} symbol not used by okx.borrowMargin ()
6412
6415
  * @param {object} [params] extra parameters specific to the okx api endpoint
6413
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
6416
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6414
6417
  */
6415
6418
  await this.loadMarkets();
6416
6419
  const currency = this.currency(code);
@@ -6454,7 +6457,7 @@ class okx extends okx$1 {
6454
6457
  * @param {float} amount the amount to repay
6455
6458
  * @param {string} symbol not used by okx.repayMargin ()
6456
6459
  * @param {object} [params] extra parameters specific to the okx api endpoint
6457
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
6460
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
6458
6461
  */
6459
6462
  await this.loadMarkets();
6460
6463
  const currency = this.currency(code);
@@ -6519,7 +6522,7 @@ class okx extends okx$1 {
6519
6522
  * @see https://www.okx.com/docs-v5/en/#rest-api-public-data-get-open-interest
6520
6523
  * @param {string} symbol Unified CCXT market symbol
6521
6524
  * @param {object} [params] exchange specific parameters
6522
- * @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
6525
+ * @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6523
6526
  */
6524
6527
  await this.loadMarkets();
6525
6528
  const market = this.market(symbol);
@@ -6565,7 +6568,7 @@ class okx extends okx$1 {
6565
6568
  * @param {int} [limit] Not used by okx, but parsed internally by CCXT
6566
6569
  * @param {object} [params] Exchange specific parameters
6567
6570
  * @param {int} [params.until] The time in ms of the latest record to retrieve as a unix timestamp
6568
- * @returns An array of [open interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#open-interest-structure}
6571
+ * @returns An array of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
6569
6572
  */
6570
6573
  const options = this.safeValue(this.options, 'fetchOpenInterestHistory', {});
6571
6574
  const timeframes = this.safeValue(options, 'timeframes', {});
@@ -6696,7 +6699,7 @@ class okx extends okx$1 {
6696
6699
  * @see https://www.okx.com/docs-v5/en/#rest-api-funding-get-currencies
6697
6700
  * @param {string[]|undefined} codes list of unified currency codes
6698
6701
  * @param {object} [params] extra parameters specific to the okx api endpoint
6699
- * @returns {object[]} a list of [fees structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
6702
+ * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
6700
6703
  */
6701
6704
  await this.loadMarkets();
6702
6705
  const response = await this.privateGetAssetCurrencies(params);
@@ -6817,11 +6820,13 @@ class okx extends okx$1 {
6817
6820
  * @param {int} [since] timestamp in ms
6818
6821
  * @param {int} [limit] number of records
6819
6822
  * @param {object} [params] exchange specific params
6820
- * @returns {object[]} a list of [settlement history objects]{@link https://github.com/ccxt/ccxt/wiki/Manual#settlement-history-structure}
6823
+ * @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
6821
6824
  */
6822
- this.checkRequiredSymbol('fetchSettlementHistory', symbol);
6825
+ if (symbol === undefined) {
6826
+ throw new errors.ArgumentsRequired(this.id + ' fetchSettlementHistory() requires a symbol argument');
6827
+ }
6823
6828
  await this.loadMarkets();
6824
- const market = (symbol === undefined) ? undefined : this.market(symbol);
6829
+ const market = this.market(symbol);
6825
6830
  let type = undefined;
6826
6831
  [type, params] = this.handleMarketTypeAndParams('fetchSettlementHistory', market, params);
6827
6832
  if (type !== 'future' && type !== 'option') {
@@ -6914,7 +6919,7 @@ class okx extends okx$1 {
6914
6919
  * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-underlying
6915
6920
  * @param {object} [params] exchange specific params
6916
6921
  * @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
6917
- * @returns {object[]} a list of [underlying assets]{@link https://github.com/ccxt/ccxt/wiki/Manual#underlying-assets-structure}
6922
+ * @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/#/?id=underlying-assets-structure}
6918
6923
  */
6919
6924
  await this.loadMarkets();
6920
6925
  let marketType = undefined;
@@ -6952,7 +6957,7 @@ class okx extends okx$1 {
6952
6957
  * @see https://www.okx.com/docs-v5/en/#public-data-rest-api-get-option-market-data
6953
6958
  * @param {string} symbol unified symbol of the market to fetch greeks for
6954
6959
  * @param {object} [params] extra parameters specific to the okx api endpoint
6955
- * @returns {object} a [greeks structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#greeks-structure}
6960
+ * @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
6956
6961
  */
6957
6962
  await this.loadMarkets();
6958
6963
  const market = this.market(symbol);