ccxt 4.1.55 → 4.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/.git-templates/hooks/pre-push +2 -2
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +6 -6
  4. package/build.sh +30 -8
  5. package/dist/ccxt.browser.js +5592 -4907
  6. package/dist/ccxt.browser.min.js +13 -13
  7. package/dist/cjs/ccxt.js +1 -1
  8. package/dist/cjs/src/ace.js +17 -13
  9. package/dist/cjs/src/alpaca.js +6 -6
  10. package/dist/cjs/src/ascendex.js +35 -29
  11. package/dist/cjs/src/base/Exchange.js +39 -26
  12. package/dist/cjs/src/base/Precise.js +1 -3
  13. package/dist/cjs/src/bigone.js +24 -20
  14. package/dist/cjs/src/binance.js +97 -76
  15. package/dist/cjs/src/bingx.js +63 -44
  16. package/dist/cjs/src/bit2c.js +18 -15
  17. package/dist/cjs/src/bitbank.js +17 -15
  18. package/dist/cjs/src/bitbns.js +28 -18
  19. package/dist/cjs/src/bitfinex.js +23 -21
  20. package/dist/cjs/src/bitfinex2.js +32 -28
  21. package/dist/cjs/src/bitflyer.js +28 -20
  22. package/dist/cjs/src/bitforex.js +25 -18
  23. package/dist/cjs/src/bitget.js +184 -147
  24. package/dist/cjs/src/bithumb.js +23 -16
  25. package/dist/cjs/src/bitmart.js +129 -94
  26. package/dist/cjs/src/bitmex.js +104 -64
  27. package/dist/cjs/src/bitopro.js +38 -26
  28. package/dist/cjs/src/bitpanda.js +24 -23
  29. package/dist/cjs/src/bitrue.js +33 -24
  30. package/dist/cjs/src/bitso.js +24 -23
  31. package/dist/cjs/src/bitstamp.js +24 -23
  32. package/dist/cjs/src/bittrex.js +30 -29
  33. package/dist/cjs/src/bitvavo.js +38 -30
  34. package/dist/cjs/src/bl3p.js +11 -10
  35. package/dist/cjs/src/blockchaincom.js +20 -20
  36. package/dist/cjs/src/btcalpha.js +18 -17
  37. package/dist/cjs/src/btcbox.js +13 -12
  38. package/dist/cjs/src/btcmarkets.js +20 -19
  39. package/dist/cjs/src/btcturk.js +14 -13
  40. package/dist/cjs/src/bybit.js +84 -54
  41. package/dist/cjs/src/cex.js +16 -14
  42. package/dist/cjs/src/coinbase.js +29 -27
  43. package/dist/cjs/src/coinbasepro.js +27 -25
  44. package/dist/cjs/src/coincheck.js +15 -14
  45. package/dist/cjs/src/coinex.js +101 -78
  46. package/dist/cjs/src/coinlist.js +28 -27
  47. package/dist/cjs/src/coinmate.js +20 -17
  48. package/dist/cjs/src/coinone.js +21 -16
  49. package/dist/cjs/src/coinsph.js +37 -28
  50. package/dist/cjs/src/coinspot.js +12 -11
  51. package/dist/cjs/src/cryptocom.js +40 -202
  52. package/dist/cjs/src/currencycom.js +32 -25
  53. package/dist/cjs/src/delta.js +34 -28
  54. package/dist/cjs/src/deribit.js +39 -36
  55. package/dist/cjs/src/digifinex.js +64 -44
  56. package/dist/cjs/src/exmo.js +29 -27
  57. package/dist/cjs/src/gate.js +67 -53
  58. package/dist/cjs/src/gemini.js +23 -20
  59. package/dist/cjs/src/hitbtc.js +65 -56
  60. package/dist/cjs/src/hollaex.js +30 -27
  61. package/dist/cjs/src/htx.js +135 -143
  62. package/dist/cjs/src/huobijp.js +22 -20
  63. package/dist/cjs/src/idex.js +22 -21
  64. package/dist/cjs/src/independentreserve.js +15 -14
  65. package/dist/cjs/src/indodax.js +30 -26
  66. package/dist/cjs/src/kraken.js +29 -27
  67. package/dist/cjs/src/krakenfutures.js +29 -22
  68. package/dist/cjs/src/kucoin.js +48 -43
  69. package/dist/cjs/src/kucoinfutures.js +33 -28
  70. package/dist/cjs/src/kuna.js +25 -24
  71. package/dist/cjs/src/latoken.js +24 -22
  72. package/dist/cjs/src/lbank.js +45 -30
  73. package/dist/cjs/src/luno.js +22 -19
  74. package/dist/cjs/src/lykke.js +19 -17
  75. package/dist/cjs/src/mercado.js +30 -19
  76. package/dist/cjs/src/mexc.js +60 -49
  77. package/dist/cjs/src/ndax.js +23 -22
  78. package/dist/cjs/src/novadax.js +23 -22
  79. package/dist/cjs/src/oceanex.js +22 -19
  80. package/dist/cjs/src/okcoin.js +29 -23
  81. package/dist/cjs/src/okx.js +92 -84
  82. package/dist/cjs/src/p2b.js +80 -83
  83. package/dist/cjs/src/paymium.js +10 -10
  84. package/dist/cjs/src/phemex.js +63 -40
  85. package/dist/cjs/src/poloniex.js +22 -22
  86. package/dist/cjs/src/poloniexfutures.js +23 -19
  87. package/dist/cjs/src/pro/alpaca.js +5 -5
  88. package/dist/cjs/src/pro/ascendex.js +4 -4
  89. package/dist/cjs/src/pro/binance.js +16 -16
  90. package/dist/cjs/src/pro/bingx.js +1 -1
  91. package/dist/cjs/src/pro/bitfinex.js +4 -4
  92. package/dist/cjs/src/pro/bitfinex2.js +6 -6
  93. package/dist/cjs/src/pro/bitget.js +7 -7
  94. package/dist/cjs/src/pro/bitmart.js +7 -5
  95. package/dist/cjs/src/pro/bitmex.js +6 -6
  96. package/dist/cjs/src/pro/bitopro.js +4 -4
  97. package/dist/cjs/src/pro/bitpanda.js +6 -6
  98. package/dist/cjs/src/pro/bitrue.js +2 -2
  99. package/dist/cjs/src/pro/bitstamp.js +6 -4
  100. package/dist/cjs/src/pro/bittrex.js +6 -6
  101. package/dist/cjs/src/pro/bitvavo.js +11 -7
  102. package/dist/cjs/src/pro/blockchaincom.js +8 -8
  103. package/dist/cjs/src/pro/bybit.js +7 -7
  104. package/dist/cjs/src/pro/cex.js +13 -9
  105. package/dist/cjs/src/pro/coinbase.js +5 -5
  106. package/dist/cjs/src/pro/coinbasepro.js +11 -10
  107. package/dist/cjs/src/pro/coinex.js +7 -9
  108. package/dist/cjs/src/pro/cryptocom.js +9 -9
  109. package/dist/cjs/src/pro/currencycom.js +4 -4
  110. package/dist/cjs/src/pro/deribit.js +6 -6
  111. package/dist/cjs/src/pro/exmo.js +12 -14
  112. package/dist/cjs/src/pro/gate.js +7 -7
  113. package/dist/cjs/src/pro/gemini.js +3 -3
  114. package/dist/cjs/src/pro/hitbtc.js +263 -4
  115. package/dist/cjs/src/pro/hollaex.js +5 -5
  116. package/dist/cjs/src/pro/htx.js +6 -6
  117. package/dist/cjs/src/pro/huobijp.js +3 -3
  118. package/dist/cjs/src/pro/idex.js +4 -4
  119. package/dist/cjs/src/pro/independentreserve.js +2 -2
  120. package/dist/cjs/src/pro/kraken.js +10 -10
  121. package/dist/cjs/src/pro/krakenfutures.js +41 -17
  122. package/dist/cjs/src/pro/kucoin.js +7 -7
  123. package/dist/cjs/src/pro/kucoinfutures.js +8 -6
  124. package/dist/cjs/src/pro/luno.js +2 -2
  125. package/dist/cjs/src/pro/mexc.js +6 -6
  126. package/dist/cjs/src/pro/ndax.js +3 -3
  127. package/dist/cjs/src/pro/okcoin.js +5 -5
  128. package/dist/cjs/src/pro/okx.js +12 -12
  129. package/dist/cjs/src/pro/phemex.js +6 -6
  130. package/dist/cjs/src/pro/poloniex.js +7 -7
  131. package/dist/cjs/src/pro/poloniexfutures.js +5 -5
  132. package/dist/cjs/src/pro/probit.js +6 -6
  133. package/dist/cjs/src/pro/upbit.js +3 -3
  134. package/dist/cjs/src/pro/wazirx.js +8 -8
  135. package/dist/cjs/src/pro/whitebit.js +12 -8
  136. package/dist/cjs/src/pro/woo.js +1 -1
  137. package/dist/cjs/src/probit.js +28 -23
  138. package/dist/cjs/src/tidex.js +16 -15
  139. package/dist/cjs/src/timex.js +19 -18
  140. package/dist/cjs/src/tokocrypto.js +27 -22
  141. package/dist/cjs/src/upbit.js +19 -19
  142. package/dist/cjs/src/wavesexchange.js +22 -19
  143. package/dist/cjs/src/wazirx.js +24 -17
  144. package/dist/cjs/src/whitebit.js +33 -27
  145. package/dist/cjs/src/woo.js +44 -34
  146. package/dist/cjs/src/yobit.js +25 -20
  147. package/dist/cjs/src/zaif.js +9 -9
  148. package/dist/cjs/src/zonda.js +18 -17
  149. package/js/ccxt.d.ts +1 -1
  150. package/js/ccxt.js +1 -1
  151. package/js/src/abstract/bitbank.d.ts +1 -0
  152. package/js/src/abstract/bybit.d.ts +1 -0
  153. package/js/src/abstract/cryptocom.d.ts +0 -20
  154. package/js/src/abstract/htx.d.ts +3 -0
  155. package/js/src/abstract/huobi.d.ts +3 -0
  156. package/js/src/abstract/huobipro.d.ts +3 -0
  157. package/js/src/abstract/okex.d.ts +3 -1
  158. package/js/src/abstract/okex5.d.ts +3 -1
  159. package/js/src/abstract/okx.d.ts +3 -1
  160. package/js/src/ace.js +18 -14
  161. package/js/src/alpaca.js +6 -6
  162. package/js/src/ascendex.js +35 -29
  163. package/js/src/base/Exchange.d.ts +37 -34
  164. package/js/src/base/Exchange.js +39 -26
  165. package/js/src/base/Precise.d.ts +4 -4
  166. package/js/src/base/Precise.js +1 -3
  167. package/js/src/base/functions/type.d.ts +25 -25
  168. package/js/src/base/types.d.ts +21 -14
  169. package/js/src/bigone.js +25 -21
  170. package/js/src/binance.d.ts +2 -2
  171. package/js/src/binance.js +97 -76
  172. package/js/src/bingx.js +63 -44
  173. package/js/src/bit2c.js +19 -16
  174. package/js/src/bitbank.js +17 -15
  175. package/js/src/bitbns.js +28 -18
  176. package/js/src/bitfinex.js +23 -21
  177. package/js/src/bitfinex2.js +32 -28
  178. package/js/src/bitflyer.js +28 -20
  179. package/js/src/bitforex.js +26 -19
  180. package/js/src/bitget.d.ts +25 -3
  181. package/js/src/bitget.js +184 -147
  182. package/js/src/bithumb.js +23 -16
  183. package/js/src/bitmart.d.ts +1 -1
  184. package/js/src/bitmart.js +129 -94
  185. package/js/src/bitmex.d.ts +2 -2
  186. package/js/src/bitmex.js +104 -64
  187. package/js/src/bitopro.js +38 -26
  188. package/js/src/bitpanda.js +24 -23
  189. package/js/src/bitrue.js +33 -24
  190. package/js/src/bitso.js +24 -23
  191. package/js/src/bitstamp.d.ts +2 -2
  192. package/js/src/bitstamp.js +24 -23
  193. package/js/src/bittrex.js +30 -29
  194. package/js/src/bitvavo.js +38 -30
  195. package/js/src/bl3p.js +11 -10
  196. package/js/src/blockchaincom.js +20 -20
  197. package/js/src/btcalpha.js +18 -17
  198. package/js/src/btcbox.js +13 -12
  199. package/js/src/btcmarkets.js +20 -19
  200. package/js/src/btcturk.js +14 -13
  201. package/js/src/bybit.d.ts +1 -1
  202. package/js/src/bybit.js +84 -54
  203. package/js/src/cex.js +16 -14
  204. package/js/src/coinbase.js +29 -27
  205. package/js/src/coinbasepro.js +27 -25
  206. package/js/src/coincheck.js +15 -14
  207. package/js/src/coinex.d.ts +1 -1
  208. package/js/src/coinex.js +101 -78
  209. package/js/src/coinlist.js +28 -27
  210. package/js/src/coinmate.js +21 -18
  211. package/js/src/coinone.js +21 -16
  212. package/js/src/coinsph.js +37 -28
  213. package/js/src/coinspot.js +12 -11
  214. package/js/src/cryptocom.d.ts +0 -23
  215. package/js/src/cryptocom.js +40 -202
  216. package/js/src/currencycom.js +32 -25
  217. package/js/src/delta.js +35 -29
  218. package/js/src/deribit.js +39 -36
  219. package/js/src/digifinex.d.ts +2 -2
  220. package/js/src/digifinex.js +65 -45
  221. package/js/src/exmo.js +29 -27
  222. package/js/src/gate.d.ts +1 -1
  223. package/js/src/gate.js +67 -53
  224. package/js/src/gemini.js +23 -20
  225. package/js/src/hitbtc.d.ts +1 -0
  226. package/js/src/hitbtc.js +65 -56
  227. package/js/src/hollaex.js +30 -27
  228. package/js/src/htx.d.ts +11 -3
  229. package/js/src/htx.js +135 -143
  230. package/js/src/huobijp.js +23 -21
  231. package/js/src/idex.js +22 -21
  232. package/js/src/independentreserve.js +15 -14
  233. package/js/src/indodax.js +30 -26
  234. package/js/src/kraken.js +29 -27
  235. package/js/src/krakenfutures.js +29 -22
  236. package/js/src/kucoin.d.ts +1 -1
  237. package/js/src/kucoin.js +48 -43
  238. package/js/src/kucoinfutures.js +33 -28
  239. package/js/src/kuna.js +25 -24
  240. package/js/src/latoken.js +25 -23
  241. package/js/src/lbank.js +46 -31
  242. package/js/src/luno.js +22 -19
  243. package/js/src/lykke.js +19 -17
  244. package/js/src/mercado.js +30 -19
  245. package/js/src/mexc.d.ts +1 -1
  246. package/js/src/mexc.js +60 -49
  247. package/js/src/ndax.js +23 -22
  248. package/js/src/novadax.js +23 -22
  249. package/js/src/oceanex.js +22 -19
  250. package/js/src/okcoin.js +29 -23
  251. package/js/src/okx.d.ts +2 -2
  252. package/js/src/okx.js +92 -84
  253. package/js/src/p2b.d.ts +8 -7
  254. package/js/src/p2b.js +80 -82
  255. package/js/src/paymium.js +10 -10
  256. package/js/src/phemex.js +63 -40
  257. package/js/src/poloniex.js +22 -22
  258. package/js/src/poloniexfutures.js +23 -19
  259. package/js/src/pro/alpaca.js +5 -5
  260. package/js/src/pro/ascendex.js +4 -4
  261. package/js/src/pro/binance.js +16 -16
  262. package/js/src/pro/bingx.js +1 -1
  263. package/js/src/pro/bitfinex.js +4 -4
  264. package/js/src/pro/bitfinex2.d.ts +1 -1
  265. package/js/src/pro/bitfinex2.js +6 -6
  266. package/js/src/pro/bitget.js +7 -7
  267. package/js/src/pro/bitmart.js +7 -5
  268. package/js/src/pro/bitmex.js +6 -6
  269. package/js/src/pro/bitopro.js +4 -4
  270. package/js/src/pro/bitpanda.js +6 -6
  271. package/js/src/pro/bitrue.js +2 -2
  272. package/js/src/pro/bitstamp.js +7 -5
  273. package/js/src/pro/bittrex.js +6 -6
  274. package/js/src/pro/bitvavo.js +12 -8
  275. package/js/src/pro/blockchaincom.js +8 -8
  276. package/js/src/pro/bybit.js +7 -7
  277. package/js/src/pro/cex.js +14 -10
  278. package/js/src/pro/coinbase.js +5 -5
  279. package/js/src/pro/coinbasepro.js +12 -11
  280. package/js/src/pro/coinex.js +7 -9
  281. package/js/src/pro/cryptocom.js +9 -9
  282. package/js/src/pro/currencycom.js +4 -4
  283. package/js/src/pro/deribit.js +6 -6
  284. package/js/src/pro/exmo.js +12 -14
  285. package/js/src/pro/gate.js +7 -7
  286. package/js/src/pro/gemini.js +3 -3
  287. package/js/src/pro/hitbtc.d.ts +8 -1
  288. package/js/src/pro/hitbtc.js +264 -5
  289. package/js/src/pro/hollaex.js +5 -5
  290. package/js/src/pro/htx.js +6 -6
  291. package/js/src/pro/huobijp.js +3 -3
  292. package/js/src/pro/idex.js +4 -4
  293. package/js/src/pro/independentreserve.js +2 -2
  294. package/js/src/pro/kraken.js +10 -10
  295. package/js/src/pro/krakenfutures.d.ts +1 -0
  296. package/js/src/pro/krakenfutures.js +42 -18
  297. package/js/src/pro/kucoin.js +7 -7
  298. package/js/src/pro/kucoinfutures.js +8 -6
  299. package/js/src/pro/luno.js +2 -2
  300. package/js/src/pro/mexc.js +6 -6
  301. package/js/src/pro/ndax.js +3 -3
  302. package/js/src/pro/okcoin.js +5 -5
  303. package/js/src/pro/okx.js +12 -12
  304. package/js/src/pro/phemex.js +6 -6
  305. package/js/src/pro/poloniex.js +7 -7
  306. package/js/src/pro/poloniexfutures.js +5 -5
  307. package/js/src/pro/probit.js +6 -6
  308. package/js/src/pro/upbit.js +3 -3
  309. package/js/src/pro/wazirx.js +8 -8
  310. package/js/src/pro/whitebit.js +13 -9
  311. package/js/src/pro/woo.js +1 -1
  312. package/js/src/probit.js +29 -24
  313. package/js/src/tidex.js +16 -15
  314. package/js/src/timex.js +19 -18
  315. package/js/src/tokocrypto.js +28 -23
  316. package/js/src/upbit.js +19 -19
  317. package/js/src/wavesexchange.js +23 -20
  318. package/js/src/wazirx.js +25 -18
  319. package/js/src/whitebit.js +33 -27
  320. package/js/src/woo.js +45 -35
  321. package/js/src/yobit.js +25 -20
  322. package/js/src/zaif.js +9 -9
  323. package/js/src/zonda.js +18 -17
  324. package/package.json +2 -2
  325. package/js/src/bitstamp1.d.ts +0 -28
  326. package/js/src/bitstamp1.js +0 -430
  327. package/js/src/lbank2.d.ts +0 -90
  328. package/js/src/lbank2.js +0 -2779
package/js/src/coinex.js CHANGED
@@ -50,23 +50,25 @@ export default class coinex extends Exchange {
50
50
  'editOrder': true,
51
51
  'fetchBalance': true,
52
52
  'fetchBorrowInterest': true,
53
- 'fetchBorrowRate': true,
54
53
  'fetchBorrowRateHistories': false,
55
54
  'fetchBorrowRateHistory': false,
56
- 'fetchBorrowRates': true,
57
55
  'fetchClosedOrders': true,
56
+ 'fetchCrossBorrowRate': false,
57
+ 'fetchCrossBorrowRates': false,
58
58
  'fetchCurrencies': true,
59
59
  'fetchDepositAddress': true,
60
60
  'fetchDepositAddressByNetwork': false,
61
61
  'fetchDepositAddresses': false,
62
62
  'fetchDeposits': true,
63
- 'fetchDepositWithdrawFees': true,
64
63
  'fetchDepositWithdrawFee': 'emulated',
64
+ 'fetchDepositWithdrawFees': true,
65
65
  'fetchFundingHistory': true,
66
66
  'fetchFundingRate': true,
67
67
  'fetchFundingRateHistory': true,
68
68
  'fetchFundingRates': true,
69
69
  'fetchIndexOHLCV': false,
70
+ 'fetchIsolatedBorrowRate': true,
71
+ 'fetchIsolatedBorrowRates': true,
70
72
  'fetchLeverage': false,
71
73
  'fetchLeverageTiers': true,
72
74
  'fetchMarketLeverageTiers': 'emulated',
@@ -735,7 +737,7 @@ export default class coinex extends Exchange {
735
737
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
736
738
  * @param {string} symbol unified symbol of the market to fetch the ticker for
737
739
  * @param {object} [params] extra parameters specific to the coinex api endpoint
738
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
740
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
739
741
  */
740
742
  await this.loadMarkets();
741
743
  const market = this.market(symbol);
@@ -809,7 +811,7 @@ export default class coinex extends Exchange {
809
811
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http009_market_ticker_all
810
812
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
811
813
  * @param {object} [params] extra parameters specific to the coinex api endpoint
812
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
814
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
813
815
  */
814
816
  await this.loadMarkets();
815
817
  symbols = this.marketSymbols(symbols);
@@ -923,7 +925,7 @@ export default class coinex extends Exchange {
923
925
  * @param {string} symbol unified symbol of the market to fetch the order book for
924
926
  * @param {int} [limit] the maximum amount of order book entries to return
925
927
  * @param {object} [params] extra parameters specific to the coinex api endpoint
926
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
928
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
927
929
  */
928
930
  await this.loadMarkets();
929
931
  const market = this.market(symbol);
@@ -1081,11 +1083,11 @@ export default class coinex extends Exchange {
1081
1083
  }
1082
1084
  let side = undefined;
1083
1085
  if (market['type'] === 'swap') {
1084
- side = this.safeInteger(trade, 'side');
1085
- if (side === 1) {
1086
+ const rawSide = this.safeInteger(trade, 'side');
1087
+ if (rawSide === 1) {
1086
1088
  side = 'sell';
1087
1089
  }
1088
- else if (side === 2) {
1090
+ else if (rawSide === 2) {
1089
1091
  side = 'buy';
1090
1092
  }
1091
1093
  if (side === undefined) {
@@ -1120,7 +1122,7 @@ export default class coinex extends Exchange {
1120
1122
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1121
1123
  * @param {int} [limit] the maximum amount of trades to fetch
1122
1124
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1123
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
1125
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1124
1126
  */
1125
1127
  await this.loadMarkets();
1126
1128
  const market = this.market(symbol);
@@ -1160,7 +1162,7 @@ export default class coinex extends Exchange {
1160
1162
  * @description fetch the trading fees for a market
1161
1163
  * @param {string} symbol unified market symbol
1162
1164
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1163
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
1165
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1164
1166
  */
1165
1167
  await this.loadMarkets();
1166
1168
  const market = this.market(symbol);
@@ -1193,7 +1195,7 @@ export default class coinex extends Exchange {
1193
1195
  * @name coinex#fetchTradingFees
1194
1196
  * @description fetch the trading fees for multiple markets
1195
1197
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1196
- * @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
1198
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
1197
1199
  */
1198
1200
  await this.loadMarkets();
1199
1201
  const response = await this.publicGetMarketInfo(params);
@@ -1511,7 +1513,7 @@ export default class coinex extends Exchange {
1511
1513
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http016_asset_query // swap
1512
1514
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1513
1515
  * @param {string} [params.type] 'margin', 'swap', 'financial', or 'spot'
1514
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1516
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1515
1517
  */
1516
1518
  let marketType = undefined;
1517
1519
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
@@ -1796,11 +1798,11 @@ export default class coinex extends Exchange {
1796
1798
  const rawType = this.safeString(order, 'order_type');
1797
1799
  let type = undefined;
1798
1800
  if (rawType === undefined) {
1799
- type = this.safeInteger(order, 'type');
1800
- if (type === 1) {
1801
+ const typeInteger = this.safeInteger(order, 'type');
1802
+ if (typeInteger === 1) {
1801
1803
  type = 'limit';
1802
1804
  }
1803
- else if (type === 2) {
1805
+ else if (typeInteger === 2) {
1804
1806
  type = 'market';
1805
1807
  }
1806
1808
  }
@@ -1865,7 +1867,7 @@ export default class coinex extends Exchange {
1865
1867
  * @param {bool} params.postOnly
1866
1868
  * @param {bool} params.reduceOnly
1867
1869
  * @param {bool} [params.position_id] *required for reduce only orders* the position id to reduce
1868
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1870
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1869
1871
  */
1870
1872
  await this.loadMarkets();
1871
1873
  const market = this.market(symbol);
@@ -2129,9 +2131,11 @@ export default class coinex extends Exchange {
2129
2131
  * @param {float} amount how much of the currency you want to trade in units of the base currency
2130
2132
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2131
2133
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2132
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2134
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2133
2135
  */
2134
- this.checkRequiredArgument('editOrder', symbol, 'symbol');
2136
+ if (symbol === undefined) {
2137
+ throw new ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
2138
+ }
2135
2139
  await this.loadMarkets();
2136
2140
  const market = this.market(symbol);
2137
2141
  if (!market['spot']) {
@@ -2190,8 +2194,11 @@ export default class coinex extends Exchange {
2190
2194
  * @param {string} id order id
2191
2195
  * @param {string} symbol unified symbol of the market the order was made in
2192
2196
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2193
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2197
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2194
2198
  */
2199
+ if (symbol === undefined) {
2200
+ throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2201
+ }
2195
2202
  await this.loadMarkets();
2196
2203
  const market = this.market(symbol);
2197
2204
  const stop = this.safeValue(params, 'stop');
@@ -2336,9 +2343,11 @@ export default class coinex extends Exchange {
2336
2343
  * @description cancel all open orders in a market
2337
2344
  * @param {string} symbol unified market symbol of the market to cancel orders in
2338
2345
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2339
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2346
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2340
2347
  */
2341
- this.checkRequiredSymbol('cancelAllOrders', symbol);
2348
+ if (symbol === undefined) {
2349
+ throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
2350
+ }
2342
2351
  await this.loadMarkets();
2343
2352
  const market = this.market(symbol);
2344
2353
  const marketId = market['id'];
@@ -2350,7 +2359,7 @@ export default class coinex extends Exchange {
2350
2359
  };
2351
2360
  const swap = market['swap'];
2352
2361
  const stop = this.safeValue(params, 'stop');
2353
- let method = undefined;
2362
+ let method;
2354
2363
  if (swap) {
2355
2364
  method = 'perpetualPrivatePostOrderCancelAll';
2356
2365
  if (stop) {
@@ -2384,9 +2393,11 @@ export default class coinex extends Exchange {
2384
2393
  * @description fetches information on an order made by the user
2385
2394
  * @param {string} symbol unified symbol of the market the order was made in
2386
2395
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2387
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2396
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2388
2397
  */
2389
- this.checkRequiredSymbol('fetchOrder', symbol);
2398
+ if (symbol === undefined) {
2399
+ throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
2400
+ }
2390
2401
  await this.loadMarkets();
2391
2402
  const market = this.market(symbol);
2392
2403
  const swap = market['swap'];
@@ -2724,7 +2735,7 @@ export default class coinex extends Exchange {
2724
2735
  * @param {int} [since] the earliest time in ms to fetch open orders for
2725
2736
  * @param {int} [limit] the maximum number of open orders structures to retrieve
2726
2737
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2727
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2738
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2728
2739
  */
2729
2740
  return await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
2730
2741
  }
@@ -2737,7 +2748,7 @@ export default class coinex extends Exchange {
2737
2748
  * @param {int} [since] the earliest time in ms to fetch orders for
2738
2749
  * @param {int} [limit] the maximum number of orde structures to retrieve
2739
2750
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2740
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2751
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2741
2752
  */
2742
2753
  return await this.fetchOrdersByStatus('finished', symbol, since, limit, params);
2743
2754
  }
@@ -2748,7 +2759,7 @@ export default class coinex extends Exchange {
2748
2759
  * @description create a currency deposit address
2749
2760
  * @param {string} code unified currency code of the currency for the deposit address
2750
2761
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2751
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2762
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2752
2763
  */
2753
2764
  await this.loadMarkets();
2754
2765
  const currency = this.currency(code);
@@ -2780,7 +2791,7 @@ export default class coinex extends Exchange {
2780
2791
  * @description fetch the deposit address for a currency associated with this account
2781
2792
  * @param {string} code unified currency code
2782
2793
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2783
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2794
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2784
2795
  */
2785
2796
  await this.loadMarkets();
2786
2797
  const currency = this.currency(code);
@@ -2876,7 +2887,7 @@ export default class coinex extends Exchange {
2876
2887
  * @param {int} [since] the earliest time in ms to fetch trades for
2877
2888
  * @param {int} [limit] the maximum number of trades structures to retrieve
2878
2889
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2879
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
2890
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2880
2891
  */
2881
2892
  await this.loadMarkets();
2882
2893
  let market = undefined;
@@ -3012,7 +3023,7 @@ export default class coinex extends Exchange {
3012
3023
  * @description fetch all open positions
3013
3024
  * @param {string[]|undefined} symbols list of unified market symbols
3014
3025
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3015
- * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3026
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3016
3027
  */
3017
3028
  await this.loadMarkets();
3018
3029
  symbols = this.marketSymbols(symbols);
@@ -3107,7 +3118,7 @@ export default class coinex extends Exchange {
3107
3118
  * @description fetch data on a single open contract trade position
3108
3119
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
3109
3120
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3110
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3121
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3111
3122
  */
3112
3123
  await this.loadMarkets();
3113
3124
  const market = this.market(symbol);
@@ -3289,7 +3300,9 @@ export default class coinex extends Exchange {
3289
3300
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3290
3301
  * @returns {object} response from the exchange
3291
3302
  */
3292
- this.checkRequiredSymbol('setMarginMode', symbol);
3303
+ if (symbol === undefined) {
3304
+ throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
3305
+ }
3293
3306
  marginMode = marginMode.toLowerCase();
3294
3307
  if (marginMode !== 'isolated' && marginMode !== 'cross') {
3295
3308
  throw new BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
@@ -3337,7 +3350,9 @@ export default class coinex extends Exchange {
3337
3350
  * @param {string} [params.marginMode] 'cross' or 'isolated' (default is 'cross')
3338
3351
  * @returns {object} response from the exchange
3339
3352
  */
3340
- this.checkRequiredSymbol('setLeverage', symbol);
3353
+ if (symbol === undefined) {
3354
+ throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
3355
+ }
3341
3356
  await this.loadMarkets();
3342
3357
  const market = this.market(symbol);
3343
3358
  if (!market['swap']) {
@@ -3371,7 +3386,7 @@ export default class coinex extends Exchange {
3371
3386
  * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
3372
3387
  * @param {string[]|undefined} symbols list of unified market symbols
3373
3388
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3374
- * @returns {object} a dictionary of [leverage tiers structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}, indexed by market symbols
3389
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
3375
3390
  */
3376
3391
  await this.loadMarkets();
3377
3392
  const response = await this.perpetualPublicGetMarketLimitConfig(params);
@@ -3536,7 +3551,7 @@ export default class coinex extends Exchange {
3536
3551
  * @param {string} symbol unified market symbol
3537
3552
  * @param {float} amount amount of margin to add
3538
3553
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3539
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
3554
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
3540
3555
  */
3541
3556
  return await this.modifyMarginHelper(symbol, amount, 1, params);
3542
3557
  }
@@ -3548,7 +3563,7 @@ export default class coinex extends Exchange {
3548
3563
  * @param {string} symbol unified market symbol
3549
3564
  * @param {float} amount the amount of margin to remove
3550
3565
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3551
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
3566
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
3552
3567
  */
3553
3568
  return await this.modifyMarginHelper(symbol, amount, 2, params);
3554
3569
  }
@@ -3561,9 +3576,11 @@ export default class coinex extends Exchange {
3561
3576
  * @param {int} [since] the earliest time in ms to fetch funding history for
3562
3577
  * @param {int} [limit] the maximum number of funding history structures to retrieve
3563
3578
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3564
- * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
3579
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
3565
3580
  */
3566
- this.checkRequiredSymbol('fetchFundingHistory', symbol);
3581
+ if (symbol === undefined) {
3582
+ throw new ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
3583
+ }
3567
3584
  limit = (limit === undefined) ? 100 : limit;
3568
3585
  await this.loadMarkets();
3569
3586
  const market = this.market(symbol);
@@ -3632,7 +3649,7 @@ export default class coinex extends Exchange {
3632
3649
  * @description fetch the current funding rate
3633
3650
  * @param {string} symbol unified market symbol
3634
3651
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3635
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
3652
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3636
3653
  */
3637
3654
  await this.loadMarkets();
3638
3655
  const market = this.market(symbol);
@@ -3740,7 +3757,7 @@ export default class coinex extends Exchange {
3740
3757
  * @description fetch the current funding rates
3741
3758
  * @param {string[]} symbols unified market symbols
3742
3759
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3743
- * @returns {object[]} an array of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
3760
+ * @returns {object[]} an array of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3744
3761
  */
3745
3762
  await this.loadMarkets();
3746
3763
  symbols = this.marketSymbols(symbols);
@@ -3814,7 +3831,7 @@ export default class coinex extends Exchange {
3814
3831
  * @param {string} tag
3815
3832
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3816
3833
  * @param {string} [params.network] unified network code
3817
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3834
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3818
3835
  */
3819
3836
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3820
3837
  this.checkAddress(address);
@@ -3877,13 +3894,15 @@ export default class coinex extends Exchange {
3877
3894
  * @description fetches historical funding rate prices
3878
3895
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
3879
3896
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
3880
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
3897
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
3881
3898
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3882
3899
  * @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)
3883
3900
  * @param {int} [params.until] timestamp in ms of the latest funding rate
3884
- * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
3901
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
3885
3902
  */
3886
- this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
3903
+ if (symbol === undefined) {
3904
+ throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
3905
+ }
3887
3906
  await this.loadMarkets();
3888
3907
  let paginate = false;
3889
3908
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -4067,7 +4086,7 @@ export default class coinex extends Exchange {
4067
4086
  * @param {string} fromAccount account to transfer from
4068
4087
  * @param {string} toAccount account to transfer to
4069
4088
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4070
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
4089
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4071
4090
  */
4072
4091
  await this.loadMarkets();
4073
4092
  const currency = this.currency(code);
@@ -4179,7 +4198,7 @@ export default class coinex extends Exchange {
4179
4198
  * @param {int} [since] the earliest time in ms to fetch transfers for
4180
4199
  * @param {int} [limit] the maximum number of transfers structures to retrieve
4181
4200
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4182
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
4201
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4183
4202
  */
4184
4203
  await this.loadMarkets();
4185
4204
  let currency = undefined;
@@ -4263,7 +4282,7 @@ export default class coinex extends Exchange {
4263
4282
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
4264
4283
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
4265
4284
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4266
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4285
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4267
4286
  */
4268
4287
  const request = {};
4269
4288
  let currency = undefined;
@@ -4329,7 +4348,7 @@ export default class coinex extends Exchange {
4329
4348
  * @param {int} [since] the earliest time in ms to fetch deposits for
4330
4349
  * @param {int} [limit] the maximum number of deposits structures to retrieve
4331
4350
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4332
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4351
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4333
4352
  */
4334
4353
  const request = {};
4335
4354
  let currency = undefined;
@@ -4386,7 +4405,7 @@ export default class coinex extends Exchange {
4386
4405
  }
4387
4406
  return this.parseTransactions(data, currency, since, limit);
4388
4407
  }
4389
- parseBorrowRate(info, market = undefined) {
4408
+ parseIsolatedBorrowRate(info, market = undefined) {
4390
4409
  //
4391
4410
  // {
4392
4411
  // "market": "BTCUSDT",
@@ -4406,15 +4425,13 @@ export default class coinex extends Exchange {
4406
4425
  const marketId = this.safeString(info, 'market');
4407
4426
  market = this.safeMarket(marketId, market, undefined, 'spot');
4408
4427
  const baseInfo = this.safeValue(info, market['baseId']);
4409
- const baseRate = this.safeNumber(baseInfo, 'day_rate');
4410
4428
  const quoteInfo = this.safeValue(info, market['quoteId']);
4411
- const quoteRate = this.safeNumber(quoteInfo, 'day_rate');
4412
4429
  return {
4413
4430
  'symbol': market['symbol'],
4414
4431
  'base': market['base'],
4415
- 'baseRate': baseRate,
4432
+ 'baseRate': this.safeNumber(baseInfo, 'day_rate'),
4416
4433
  'quote': market['quote'],
4417
- 'quoteRate': quoteRate,
4434
+ 'quoteRate': this.safeNumber(quoteInfo, 'day_rate'),
4418
4435
  'period': 86400000,
4419
4436
  'timestamp': undefined,
4420
4437
  'datetime': undefined,
@@ -4424,19 +4441,17 @@ export default class coinex extends Exchange {
4424
4441
  async fetchIsolatedBorrowRate(symbol, params = {}) {
4425
4442
  /**
4426
4443
  * @method
4427
- * @name coinex#fetchBorrowRate
4444
+ * @name coinex#fetchIsolatedBorrowRate
4428
4445
  * @description fetch the rate of interest to borrow a currency for margin trading
4429
- * @param {string} code unified currency code
4446
+ * @param {string} symbol unified symbol of the market to fetch the borrow rate for
4430
4447
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4431
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
4448
+ * @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
4432
4449
  */
4433
4450
  await this.loadMarkets();
4434
- let market = undefined;
4435
- const request = {};
4436
- if (symbol !== undefined) {
4437
- market = this.market(symbol);
4438
- request['market'] = market['id'];
4439
- }
4451
+ const market = this.market(symbol);
4452
+ const request = {
4453
+ 'market': market['id'],
4454
+ };
4440
4455
  const response = await this.privateGetMarginConfig(this.extend(request, params));
4441
4456
  //
4442
4457
  // {
@@ -4459,16 +4474,20 @@ export default class coinex extends Exchange {
4459
4474
  // }
4460
4475
  //
4461
4476
  const data = this.safeValue(response, 'data', {});
4462
- return this.parseBorrowRate(data, market);
4477
+ return this.parseIsolatedBorrowRate(data, market);
4463
4478
  }
4464
4479
  async fetchIsolatedBorrowRates(params = {}) {
4465
- /**
4466
- * @method
4467
- * @name coinex#fetchBorrowRates
4468
- * @description fetch the borrow interest rates of all currencies
4469
- * @param {object} [params] extra parameters specific to the coinex api endpoint
4470
- * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
4471
- */
4480
+ //
4481
+ // @method
4482
+ // @name coinex#fetchIsolatedBorrowRates
4483
+ // @description fetch the borrow interest rates of all currencies
4484
+ // @param {object} [params] extra parameters specific to the coinex api endpoint
4485
+ // <<<<<<< HEAD
4486
+ // @returns {object} a list of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
4487
+ // =======
4488
+ // @returns {object} a list of [isolated borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
4489
+ // >>>>>>> 3215552206edf1cda1ae63d2063535e19973dbe5
4490
+ //
4472
4491
  await this.loadMarkets();
4473
4492
  const response = await this.privateGetMarginConfig(params);
4474
4493
  //
@@ -4493,10 +4512,10 @@ export default class coinex extends Exchange {
4493
4512
  // "message": "Success"
4494
4513
  // }
4495
4514
  //
4496
- const data = this.safeValue(response, 'data', {});
4515
+ const data = this.safeValue(response, 'data', []);
4497
4516
  const rates = [];
4498
4517
  for (let i = 0; i < data.length; i++) {
4499
- rates.push(this.parseBorrowRate(data[i]));
4518
+ rates.push(this.parseIsolatedBorrowRate(data[i]));
4500
4519
  }
4501
4520
  return rates;
4502
4521
  }
@@ -4597,9 +4616,11 @@ export default class coinex extends Exchange {
4597
4616
  * @param {float} amount the amount to borrow
4598
4617
  * @param {string} symbol unified market symbol, required for coinex
4599
4618
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4600
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
4619
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4601
4620
  */
4602
- this.checkRequiredSymbol('borrowMargin', symbol);
4621
+ if (symbol === undefined) {
4622
+ throw new ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
4623
+ }
4603
4624
  await this.loadMarkets();
4604
4625
  const market = this.market(symbol);
4605
4626
  const currency = this.currency(code);
@@ -4636,9 +4657,11 @@ export default class coinex extends Exchange {
4636
4657
  * @param {string} symbol unified market symbol, required for coinex
4637
4658
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4638
4659
  * @param {string} [params.loan_id] extra parameter that is not required
4639
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
4660
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4640
4661
  */
4641
- this.checkRequiredSymbol('repayMargin', symbol);
4662
+ if (symbol === undefined) {
4663
+ throw new ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
4664
+ }
4642
4665
  await this.loadMarkets();
4643
4666
  const market = this.market(symbol);
4644
4667
  const currency = this.currency(code);
@@ -4699,7 +4722,7 @@ export default class coinex extends Exchange {
4699
4722
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market010_asset_config
4700
4723
  * @param {string[]|undefined} codes list of unified currency codes
4701
4724
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4702
- * @returns {object[]} a list of [fees structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
4725
+ * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
4703
4726
  */
4704
4727
  await this.loadMarkets();
4705
4728
  const request = {};