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
@@ -47,23 +47,25 @@ class coinex extends coinex$1 {
47
47
  'editOrder': true,
48
48
  'fetchBalance': true,
49
49
  'fetchBorrowInterest': true,
50
- 'fetchBorrowRate': true,
51
50
  'fetchBorrowRateHistories': false,
52
51
  'fetchBorrowRateHistory': false,
53
- 'fetchBorrowRates': true,
54
52
  'fetchClosedOrders': true,
53
+ 'fetchCrossBorrowRate': false,
54
+ 'fetchCrossBorrowRates': false,
55
55
  'fetchCurrencies': true,
56
56
  'fetchDepositAddress': true,
57
57
  'fetchDepositAddressByNetwork': false,
58
58
  'fetchDepositAddresses': false,
59
59
  'fetchDeposits': true,
60
- 'fetchDepositWithdrawFees': true,
61
60
  'fetchDepositWithdrawFee': 'emulated',
61
+ 'fetchDepositWithdrawFees': true,
62
62
  'fetchFundingHistory': true,
63
63
  'fetchFundingRate': true,
64
64
  'fetchFundingRateHistory': true,
65
65
  'fetchFundingRates': true,
66
66
  'fetchIndexOHLCV': false,
67
+ 'fetchIsolatedBorrowRate': true,
68
+ 'fetchIsolatedBorrowRates': true,
67
69
  'fetchLeverage': false,
68
70
  'fetchLeverageTiers': true,
69
71
  'fetchMarketLeverageTiers': 'emulated',
@@ -732,7 +734,7 @@ class coinex extends coinex$1 {
732
734
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
733
735
  * @param {string} symbol unified symbol of the market to fetch the ticker for
734
736
  * @param {object} [params] extra parameters specific to the coinex api endpoint
735
- * @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
737
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
736
738
  */
737
739
  await this.loadMarkets();
738
740
  const market = this.market(symbol);
@@ -806,7 +808,7 @@ class coinex extends coinex$1 {
806
808
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http009_market_ticker_all
807
809
  * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
808
810
  * @param {object} [params] extra parameters specific to the coinex api endpoint
809
- * @returns {object} a dictionary of [ticker structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
811
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
810
812
  */
811
813
  await this.loadMarkets();
812
814
  symbols = this.marketSymbols(symbols);
@@ -920,7 +922,7 @@ class coinex extends coinex$1 {
920
922
  * @param {string} symbol unified symbol of the market to fetch the order book for
921
923
  * @param {int} [limit] the maximum amount of order book entries to return
922
924
  * @param {object} [params] extra parameters specific to the coinex api endpoint
923
- * @returns {object} A dictionary of [order book structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-book-structure} indexed by market symbols
925
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
924
926
  */
925
927
  await this.loadMarkets();
926
928
  const market = this.market(symbol);
@@ -1078,11 +1080,11 @@ class coinex extends coinex$1 {
1078
1080
  }
1079
1081
  let side = undefined;
1080
1082
  if (market['type'] === 'swap') {
1081
- side = this.safeInteger(trade, 'side');
1082
- if (side === 1) {
1083
+ const rawSide = this.safeInteger(trade, 'side');
1084
+ if (rawSide === 1) {
1083
1085
  side = 'sell';
1084
1086
  }
1085
- else if (side === 2) {
1087
+ else if (rawSide === 2) {
1086
1088
  side = 'buy';
1087
1089
  }
1088
1090
  if (side === undefined) {
@@ -1117,7 +1119,7 @@ class coinex extends coinex$1 {
1117
1119
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1118
1120
  * @param {int} [limit] the maximum amount of trades to fetch
1119
1121
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1120
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
1122
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
1121
1123
  */
1122
1124
  await this.loadMarkets();
1123
1125
  const market = this.market(symbol);
@@ -1157,7 +1159,7 @@ class coinex extends coinex$1 {
1157
1159
  * @description fetch the trading fees for a market
1158
1160
  * @param {string} symbol unified market symbol
1159
1161
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1160
- * @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
1162
+ * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
1161
1163
  */
1162
1164
  await this.loadMarkets();
1163
1165
  const market = this.market(symbol);
@@ -1190,7 +1192,7 @@ class coinex extends coinex$1 {
1190
1192
  * @name coinex#fetchTradingFees
1191
1193
  * @description fetch the trading fees for multiple markets
1192
1194
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1193
- * @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
1195
+ * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
1194
1196
  */
1195
1197
  await this.loadMarkets();
1196
1198
  const response = await this.publicGetMarketInfo(params);
@@ -1508,7 +1510,7 @@ class coinex extends coinex$1 {
1508
1510
  * @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http016_asset_query // swap
1509
1511
  * @param {object} [params] extra parameters specific to the coinex api endpoint
1510
1512
  * @param {string} [params.type] 'margin', 'swap', 'financial', or 'spot'
1511
- * @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
1513
+ * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1512
1514
  */
1513
1515
  let marketType = undefined;
1514
1516
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
@@ -1793,11 +1795,11 @@ class coinex extends coinex$1 {
1793
1795
  const rawType = this.safeString(order, 'order_type');
1794
1796
  let type = undefined;
1795
1797
  if (rawType === undefined) {
1796
- type = this.safeInteger(order, 'type');
1797
- if (type === 1) {
1798
+ const typeInteger = this.safeInteger(order, 'type');
1799
+ if (typeInteger === 1) {
1798
1800
  type = 'limit';
1799
1801
  }
1800
- else if (type === 2) {
1802
+ else if (typeInteger === 2) {
1801
1803
  type = 'market';
1802
1804
  }
1803
1805
  }
@@ -1862,7 +1864,7 @@ class coinex extends coinex$1 {
1862
1864
  * @param {bool} params.postOnly
1863
1865
  * @param {bool} params.reduceOnly
1864
1866
  * @param {bool} [params.position_id] *required for reduce only orders* the position id to reduce
1865
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1867
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1866
1868
  */
1867
1869
  await this.loadMarkets();
1868
1870
  const market = this.market(symbol);
@@ -2126,9 +2128,11 @@ class coinex extends coinex$1 {
2126
2128
  * @param {float} amount how much of the currency you want to trade in units of the base currency
2127
2129
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
2128
2130
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2129
- * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2131
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2130
2132
  */
2131
- this.checkRequiredArgument('editOrder', symbol, 'symbol');
2133
+ if (symbol === undefined) {
2134
+ throw new errors.ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
2135
+ }
2132
2136
  await this.loadMarkets();
2133
2137
  const market = this.market(symbol);
2134
2138
  if (!market['spot']) {
@@ -2187,8 +2191,11 @@ class coinex extends coinex$1 {
2187
2191
  * @param {string} id order id
2188
2192
  * @param {string} symbol unified symbol of the market the order was made in
2189
2193
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2190
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2194
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2191
2195
  */
2196
+ if (symbol === undefined) {
2197
+ throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
2198
+ }
2192
2199
  await this.loadMarkets();
2193
2200
  const market = this.market(symbol);
2194
2201
  const stop = this.safeValue(params, 'stop');
@@ -2333,9 +2340,11 @@ class coinex extends coinex$1 {
2333
2340
  * @description cancel all open orders in a market
2334
2341
  * @param {string} symbol unified market symbol of the market to cancel orders in
2335
2342
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2336
- * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2343
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2337
2344
  */
2338
- this.checkRequiredSymbol('cancelAllOrders', symbol);
2345
+ if (symbol === undefined) {
2346
+ throw new errors.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
2347
+ }
2339
2348
  await this.loadMarkets();
2340
2349
  const market = this.market(symbol);
2341
2350
  const marketId = market['id'];
@@ -2347,7 +2356,7 @@ class coinex extends coinex$1 {
2347
2356
  };
2348
2357
  const swap = market['swap'];
2349
2358
  const stop = this.safeValue(params, 'stop');
2350
- let method = undefined;
2359
+ let method;
2351
2360
  if (swap) {
2352
2361
  method = 'perpetualPrivatePostOrderCancelAll';
2353
2362
  if (stop) {
@@ -2381,9 +2390,11 @@ class coinex extends coinex$1 {
2381
2390
  * @description fetches information on an order made by the user
2382
2391
  * @param {string} symbol unified symbol of the market the order was made in
2383
2392
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2384
- * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2393
+ * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
2385
2394
  */
2386
- this.checkRequiredSymbol('fetchOrder', symbol);
2395
+ if (symbol === undefined) {
2396
+ throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
2397
+ }
2387
2398
  await this.loadMarkets();
2388
2399
  const market = this.market(symbol);
2389
2400
  const swap = market['swap'];
@@ -2721,7 +2732,7 @@ class coinex extends coinex$1 {
2721
2732
  * @param {int} [since] the earliest time in ms to fetch open orders for
2722
2733
  * @param {int} [limit] the maximum number of open orders structures to retrieve
2723
2734
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2724
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2735
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2725
2736
  */
2726
2737
  return await this.fetchOrdersByStatus('pending', symbol, since, limit, params);
2727
2738
  }
@@ -2734,7 +2745,7 @@ class coinex extends coinex$1 {
2734
2745
  * @param {int} [since] the earliest time in ms to fetch orders for
2735
2746
  * @param {int} [limit] the maximum number of orde structures to retrieve
2736
2747
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2737
- * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
2748
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2738
2749
  */
2739
2750
  return await this.fetchOrdersByStatus('finished', symbol, since, limit, params);
2740
2751
  }
@@ -2745,7 +2756,7 @@ class coinex extends coinex$1 {
2745
2756
  * @description create a currency deposit address
2746
2757
  * @param {string} code unified currency code of the currency for the deposit address
2747
2758
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2748
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2759
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2749
2760
  */
2750
2761
  await this.loadMarkets();
2751
2762
  const currency = this.currency(code);
@@ -2777,7 +2788,7 @@ class coinex extends coinex$1 {
2777
2788
  * @description fetch the deposit address for a currency associated with this account
2778
2789
  * @param {string} code unified currency code
2779
2790
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2780
- * @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
2791
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
2781
2792
  */
2782
2793
  await this.loadMarkets();
2783
2794
  const currency = this.currency(code);
@@ -2873,7 +2884,7 @@ class coinex extends coinex$1 {
2873
2884
  * @param {int} [since] the earliest time in ms to fetch trades for
2874
2885
  * @param {int} [limit] the maximum number of trades structures to retrieve
2875
2886
  * @param {object} [params] extra parameters specific to the coinex api endpoint
2876
- * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
2887
+ * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
2877
2888
  */
2878
2889
  await this.loadMarkets();
2879
2890
  let market = undefined;
@@ -3009,7 +3020,7 @@ class coinex extends coinex$1 {
3009
3020
  * @description fetch all open positions
3010
3021
  * @param {string[]|undefined} symbols list of unified market symbols
3011
3022
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3012
- * @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3023
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3013
3024
  */
3014
3025
  await this.loadMarkets();
3015
3026
  symbols = this.marketSymbols(symbols);
@@ -3104,7 +3115,7 @@ class coinex extends coinex$1 {
3104
3115
  * @description fetch data on a single open contract trade position
3105
3116
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
3106
3117
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3107
- * @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
3118
+ * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
3108
3119
  */
3109
3120
  await this.loadMarkets();
3110
3121
  const market = this.market(symbol);
@@ -3286,7 +3297,9 @@ class coinex extends coinex$1 {
3286
3297
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3287
3298
  * @returns {object} response from the exchange
3288
3299
  */
3289
- this.checkRequiredSymbol('setMarginMode', symbol);
3300
+ if (symbol === undefined) {
3301
+ throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
3302
+ }
3290
3303
  marginMode = marginMode.toLowerCase();
3291
3304
  if (marginMode !== 'isolated' && marginMode !== 'cross') {
3292
3305
  throw new errors.BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
@@ -3334,7 +3347,9 @@ class coinex extends coinex$1 {
3334
3347
  * @param {string} [params.marginMode] 'cross' or 'isolated' (default is 'cross')
3335
3348
  * @returns {object} response from the exchange
3336
3349
  */
3337
- this.checkRequiredSymbol('setLeverage', symbol);
3350
+ if (symbol === undefined) {
3351
+ throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
3352
+ }
3338
3353
  await this.loadMarkets();
3339
3354
  const market = this.market(symbol);
3340
3355
  if (!market['swap']) {
@@ -3368,7 +3383,7 @@ class coinex extends coinex$1 {
3368
3383
  * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
3369
3384
  * @param {string[]|undefined} symbols list of unified market symbols
3370
3385
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3371
- * @returns {object} a dictionary of [leverage tiers structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-tiers-structure}, indexed by market symbols
3386
+ * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
3372
3387
  */
3373
3388
  await this.loadMarkets();
3374
3389
  const response = await this.perpetualPublicGetMarketLimitConfig(params);
@@ -3533,7 +3548,7 @@ class coinex extends coinex$1 {
3533
3548
  * @param {string} symbol unified market symbol
3534
3549
  * @param {float} amount amount of margin to add
3535
3550
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3536
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure}
3551
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
3537
3552
  */
3538
3553
  return await this.modifyMarginHelper(symbol, amount, 1, params);
3539
3554
  }
@@ -3545,7 +3560,7 @@ class coinex extends coinex$1 {
3545
3560
  * @param {string} symbol unified market symbol
3546
3561
  * @param {float} amount the amount of margin to remove
3547
3562
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3548
- * @returns {object} a [margin structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#reduce-margin-structure}
3563
+ * @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
3549
3564
  */
3550
3565
  return await this.modifyMarginHelper(symbol, amount, 2, params);
3551
3566
  }
@@ -3558,9 +3573,11 @@ class coinex extends coinex$1 {
3558
3573
  * @param {int} [since] the earliest time in ms to fetch funding history for
3559
3574
  * @param {int} [limit] the maximum number of funding history structures to retrieve
3560
3575
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3561
- * @returns {object} a [funding history structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-history-structure}
3576
+ * @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
3562
3577
  */
3563
- this.checkRequiredSymbol('fetchFundingHistory', symbol);
3578
+ if (symbol === undefined) {
3579
+ throw new errors.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
3580
+ }
3564
3581
  limit = (limit === undefined) ? 100 : limit;
3565
3582
  await this.loadMarkets();
3566
3583
  const market = this.market(symbol);
@@ -3629,7 +3646,7 @@ class coinex extends coinex$1 {
3629
3646
  * @description fetch the current funding rate
3630
3647
  * @param {string} symbol unified market symbol
3631
3648
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3632
- * @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
3649
+ * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3633
3650
  */
3634
3651
  await this.loadMarkets();
3635
3652
  const market = this.market(symbol);
@@ -3737,7 +3754,7 @@ class coinex extends coinex$1 {
3737
3754
  * @description fetch the current funding rates
3738
3755
  * @param {string[]} symbols unified market symbols
3739
3756
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3740
- * @returns {object[]} an array of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
3757
+ * @returns {object[]} an array of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
3741
3758
  */
3742
3759
  await this.loadMarkets();
3743
3760
  symbols = this.marketSymbols(symbols);
@@ -3811,7 +3828,7 @@ class coinex extends coinex$1 {
3811
3828
  * @param {string} tag
3812
3829
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3813
3830
  * @param {string} [params.network] unified network code
3814
- * @returns {object} a [transaction structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
3831
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
3815
3832
  */
3816
3833
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3817
3834
  this.checkAddress(address);
@@ -3874,13 +3891,15 @@ class coinex extends coinex$1 {
3874
3891
  * @description fetches historical funding rate prices
3875
3892
  * @param {string} symbol unified symbol of the market to fetch the funding rate history for
3876
3893
  * @param {int} [since] timestamp in ms of the earliest funding rate to fetch
3877
- * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
3894
+ * @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
3878
3895
  * @param {object} [params] extra parameters specific to the coinex api endpoint
3879
3896
  * @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)
3880
3897
  * @param {int} [params.until] timestamp in ms of the latest funding rate
3881
- * @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
3898
+ * @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
3882
3899
  */
3883
- this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
3900
+ if (symbol === undefined) {
3901
+ throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
3902
+ }
3884
3903
  await this.loadMarkets();
3885
3904
  let paginate = false;
3886
3905
  [paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
@@ -4064,7 +4083,7 @@ class coinex extends coinex$1 {
4064
4083
  * @param {string} fromAccount account to transfer from
4065
4084
  * @param {string} toAccount account to transfer to
4066
4085
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4067
- * @returns {object} a [transfer structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
4086
+ * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4068
4087
  */
4069
4088
  await this.loadMarkets();
4070
4089
  const currency = this.currency(code);
@@ -4176,7 +4195,7 @@ class coinex extends coinex$1 {
4176
4195
  * @param {int} [since] the earliest time in ms to fetch transfers for
4177
4196
  * @param {int} [limit] the maximum number of transfers structures to retrieve
4178
4197
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4179
- * @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
4198
+ * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
4180
4199
  */
4181
4200
  await this.loadMarkets();
4182
4201
  let currency = undefined;
@@ -4260,7 +4279,7 @@ class coinex extends coinex$1 {
4260
4279
  * @param {int} [since] the earliest time in ms to fetch withdrawals for
4261
4280
  * @param {int} [limit] the maximum number of withdrawals structures to retrieve
4262
4281
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4263
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4282
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4264
4283
  */
4265
4284
  const request = {};
4266
4285
  let currency = undefined;
@@ -4326,7 +4345,7 @@ class coinex extends coinex$1 {
4326
4345
  * @param {int} [since] the earliest time in ms to fetch deposits for
4327
4346
  * @param {int} [limit] the maximum number of deposits structures to retrieve
4328
4347
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4329
- * @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
4348
+ * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
4330
4349
  */
4331
4350
  const request = {};
4332
4351
  let currency = undefined;
@@ -4383,7 +4402,7 @@ class coinex extends coinex$1 {
4383
4402
  }
4384
4403
  return this.parseTransactions(data, currency, since, limit);
4385
4404
  }
4386
- parseBorrowRate(info, market = undefined) {
4405
+ parseIsolatedBorrowRate(info, market = undefined) {
4387
4406
  //
4388
4407
  // {
4389
4408
  // "market": "BTCUSDT",
@@ -4403,15 +4422,13 @@ class coinex extends coinex$1 {
4403
4422
  const marketId = this.safeString(info, 'market');
4404
4423
  market = this.safeMarket(marketId, market, undefined, 'spot');
4405
4424
  const baseInfo = this.safeValue(info, market['baseId']);
4406
- const baseRate = this.safeNumber(baseInfo, 'day_rate');
4407
4425
  const quoteInfo = this.safeValue(info, market['quoteId']);
4408
- const quoteRate = this.safeNumber(quoteInfo, 'day_rate');
4409
4426
  return {
4410
4427
  'symbol': market['symbol'],
4411
4428
  'base': market['base'],
4412
- 'baseRate': baseRate,
4429
+ 'baseRate': this.safeNumber(baseInfo, 'day_rate'),
4413
4430
  'quote': market['quote'],
4414
- 'quoteRate': quoteRate,
4431
+ 'quoteRate': this.safeNumber(quoteInfo, 'day_rate'),
4415
4432
  'period': 86400000,
4416
4433
  'timestamp': undefined,
4417
4434
  'datetime': undefined,
@@ -4421,19 +4438,17 @@ class coinex extends coinex$1 {
4421
4438
  async fetchIsolatedBorrowRate(symbol, params = {}) {
4422
4439
  /**
4423
4440
  * @method
4424
- * @name coinex#fetchBorrowRate
4441
+ * @name coinex#fetchIsolatedBorrowRate
4425
4442
  * @description fetch the rate of interest to borrow a currency for margin trading
4426
- * @param {string} code unified currency code
4443
+ * @param {string} symbol unified symbol of the market to fetch the borrow rate for
4427
4444
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4428
- * @returns {object} a [borrow rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
4445
+ * @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
4429
4446
  */
4430
4447
  await this.loadMarkets();
4431
- let market = undefined;
4432
- const request = {};
4433
- if (symbol !== undefined) {
4434
- market = this.market(symbol);
4435
- request['market'] = market['id'];
4436
- }
4448
+ const market = this.market(symbol);
4449
+ const request = {
4450
+ 'market': market['id'],
4451
+ };
4437
4452
  const response = await this.privateGetMarginConfig(this.extend(request, params));
4438
4453
  //
4439
4454
  // {
@@ -4456,16 +4471,20 @@ class coinex extends coinex$1 {
4456
4471
  // }
4457
4472
  //
4458
4473
  const data = this.safeValue(response, 'data', {});
4459
- return this.parseBorrowRate(data, market);
4474
+ return this.parseIsolatedBorrowRate(data, market);
4460
4475
  }
4461
4476
  async fetchIsolatedBorrowRates(params = {}) {
4462
- /**
4463
- * @method
4464
- * @name coinex#fetchBorrowRates
4465
- * @description fetch the borrow interest rates of all currencies
4466
- * @param {object} [params] extra parameters specific to the coinex api endpoint
4467
- * @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
4468
- */
4477
+ //
4478
+ // @method
4479
+ // @name coinex#fetchIsolatedBorrowRates
4480
+ // @description fetch the borrow interest rates of all currencies
4481
+ // @param {object} [params] extra parameters specific to the coinex api endpoint
4482
+ // <<<<<<< HEAD
4483
+ // @returns {object} a list of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
4484
+ // =======
4485
+ // @returns {object} a list of [isolated borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#isolated-borrow-rate-structure}
4486
+ // >>>>>>> 3215552206edf1cda1ae63d2063535e19973dbe5
4487
+ //
4469
4488
  await this.loadMarkets();
4470
4489
  const response = await this.privateGetMarginConfig(params);
4471
4490
  //
@@ -4490,10 +4509,10 @@ class coinex extends coinex$1 {
4490
4509
  // "message": "Success"
4491
4510
  // }
4492
4511
  //
4493
- const data = this.safeValue(response, 'data', {});
4512
+ const data = this.safeValue(response, 'data', []);
4494
4513
  const rates = [];
4495
4514
  for (let i = 0; i < data.length; i++) {
4496
- rates.push(this.parseBorrowRate(data[i]));
4515
+ rates.push(this.parseIsolatedBorrowRate(data[i]));
4497
4516
  }
4498
4517
  return rates;
4499
4518
  }
@@ -4594,9 +4613,11 @@ class coinex extends coinex$1 {
4594
4613
  * @param {float} amount the amount to borrow
4595
4614
  * @param {string} symbol unified market symbol, required for coinex
4596
4615
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4597
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
4616
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4598
4617
  */
4599
- this.checkRequiredSymbol('borrowMargin', symbol);
4618
+ if (symbol === undefined) {
4619
+ throw new errors.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
4620
+ }
4600
4621
  await this.loadMarkets();
4601
4622
  const market = this.market(symbol);
4602
4623
  const currency = this.currency(code);
@@ -4633,9 +4654,11 @@ class coinex extends coinex$1 {
4633
4654
  * @param {string} symbol unified market symbol, required for coinex
4634
4655
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4635
4656
  * @param {string} [params.loan_id] extra parameter that is not required
4636
- * @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
4657
+ * @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
4637
4658
  */
4638
- this.checkRequiredSymbol('repayMargin', symbol);
4659
+ if (symbol === undefined) {
4660
+ throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
4661
+ }
4639
4662
  await this.loadMarkets();
4640
4663
  const market = this.market(symbol);
4641
4664
  const currency = this.currency(code);
@@ -4696,7 +4719,7 @@ class coinex extends coinex$1 {
4696
4719
  * @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot001_market010_asset_config
4697
4720
  * @param {string[]|undefined} codes list of unified currency codes
4698
4721
  * @param {object} [params] extra parameters specific to the coinex api endpoint
4699
- * @returns {object[]} a list of [fees structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
4722
+ * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
4700
4723
  */
4701
4724
  await this.loadMarkets();
4702
4725
  const request = {};