ccxt 4.4.89 → 4.4.91

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 (913) hide show
  1. package/README.md +15 -17
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -4
  4. package/dist/cjs/src/abstract/alpaca.js +1 -1
  5. package/dist/cjs/src/abstract/apex.js +1 -1
  6. package/dist/cjs/src/abstract/ascendex.js +1 -1
  7. package/dist/cjs/src/abstract/bigone.js +1 -1
  8. package/dist/cjs/src/abstract/binance.js +1 -1
  9. package/dist/cjs/src/abstract/bingx.js +1 -1
  10. package/dist/cjs/src/abstract/bit2c.js +1 -1
  11. package/dist/cjs/src/abstract/bitbank.js +1 -1
  12. package/dist/cjs/src/abstract/bitbns.js +1 -1
  13. package/dist/cjs/src/abstract/bitfinex.js +1 -1
  14. package/dist/cjs/src/abstract/bitflyer.js +1 -1
  15. package/dist/cjs/src/abstract/bitget.js +1 -1
  16. package/dist/cjs/src/abstract/bithumb.js +1 -1
  17. package/dist/cjs/src/abstract/bitmart.js +1 -1
  18. package/dist/cjs/src/abstract/bitmex.js +1 -1
  19. package/dist/cjs/src/abstract/bitopro.js +1 -1
  20. package/dist/cjs/src/abstract/bitrue.js +1 -1
  21. package/dist/cjs/src/abstract/bitso.js +1 -1
  22. package/dist/cjs/src/abstract/bitstamp.js +1 -1
  23. package/dist/cjs/src/abstract/bitteam.js +1 -1
  24. package/dist/cjs/src/abstract/bittrade.js +1 -1
  25. package/dist/cjs/src/abstract/bitvavo.js +1 -1
  26. package/dist/cjs/src/abstract/blockchaincom.js +1 -1
  27. package/dist/cjs/src/abstract/blofin.js +1 -1
  28. package/dist/cjs/src/abstract/btcalpha.js +1 -1
  29. package/dist/cjs/src/abstract/btcbox.js +1 -1
  30. package/dist/cjs/src/abstract/btcmarkets.js +1 -1
  31. package/dist/cjs/src/abstract/btcturk.js +1 -1
  32. package/dist/cjs/src/abstract/bybit.js +1 -1
  33. package/dist/cjs/src/abstract/cex.js +1 -1
  34. package/dist/cjs/src/abstract/coinbase.js +1 -1
  35. package/dist/cjs/src/abstract/coinbaseexchange.js +1 -1
  36. package/dist/cjs/src/abstract/coinbaseinternational.js +1 -1
  37. package/dist/cjs/src/abstract/coincatch.js +1 -1
  38. package/dist/cjs/src/abstract/coincheck.js +1 -1
  39. package/dist/cjs/src/abstract/coinex.js +1 -1
  40. package/dist/cjs/src/abstract/coinlist.js +1 -1
  41. package/dist/cjs/src/abstract/coinmate.js +1 -1
  42. package/dist/cjs/src/abstract/coinmetro.js +1 -1
  43. package/dist/cjs/src/abstract/coinone.js +1 -1
  44. package/dist/cjs/src/abstract/coinsph.js +1 -1
  45. package/dist/cjs/src/abstract/coinspot.js +1 -1
  46. package/dist/cjs/src/abstract/cryptocom.js +1 -1
  47. package/dist/cjs/src/abstract/cryptomus.js +1 -1
  48. package/dist/cjs/src/abstract/defx.js +1 -1
  49. package/dist/cjs/src/abstract/delta.js +1 -1
  50. package/dist/cjs/src/abstract/deribit.js +1 -1
  51. package/dist/cjs/src/abstract/derive.js +1 -1
  52. package/dist/cjs/src/abstract/digifinex.js +1 -1
  53. package/dist/cjs/src/abstract/ellipx.js +1 -1
  54. package/dist/cjs/src/abstract/exmo.js +1 -1
  55. package/dist/cjs/src/abstract/gate.js +1 -1
  56. package/dist/cjs/src/abstract/gemini.js +1 -1
  57. package/dist/cjs/src/abstract/hashkey.js +1 -1
  58. package/dist/cjs/src/abstract/hitbtc.js +1 -1
  59. package/dist/cjs/src/abstract/hollaex.js +1 -1
  60. package/dist/cjs/src/abstract/htx.js +1 -1
  61. package/dist/cjs/src/abstract/hyperliquid.js +1 -1
  62. package/dist/cjs/src/abstract/independentreserve.js +1 -1
  63. package/dist/cjs/src/abstract/indodax.js +1 -1
  64. package/dist/cjs/src/abstract/kraken.js +1 -1
  65. package/dist/cjs/src/abstract/krakenfutures.js +1 -1
  66. package/dist/cjs/src/abstract/kucoin.js +1 -1
  67. package/dist/cjs/src/abstract/kucoinfutures.js +1 -1
  68. package/dist/cjs/src/abstract/latoken.js +1 -1
  69. package/dist/cjs/src/abstract/lbank.js +1 -1
  70. package/dist/cjs/src/abstract/luno.js +1 -1
  71. package/dist/cjs/src/abstract/mercado.js +1 -1
  72. package/dist/cjs/src/abstract/mexc.js +1 -1
  73. package/dist/cjs/src/abstract/modetrade.js +1 -1
  74. package/dist/cjs/src/abstract/ndax.js +1 -1
  75. package/dist/cjs/src/abstract/novadax.js +1 -1
  76. package/dist/cjs/src/abstract/oceanex.js +1 -1
  77. package/dist/cjs/src/abstract/okcoin.js +1 -1
  78. package/dist/cjs/src/abstract/okx.js +1 -1
  79. package/dist/cjs/src/abstract/onetrading.js +1 -1
  80. package/dist/cjs/src/abstract/oxfun.js +1 -1
  81. package/dist/cjs/src/abstract/p2b.js +1 -1
  82. package/dist/cjs/src/abstract/paradex.js +1 -1
  83. package/dist/cjs/src/abstract/paymium.js +1 -1
  84. package/dist/cjs/src/abstract/phemex.js +1 -1
  85. package/dist/cjs/src/abstract/poloniex.js +1 -1
  86. package/dist/cjs/src/abstract/probit.js +1 -1
  87. package/dist/cjs/src/abstract/timex.js +1 -1
  88. package/dist/cjs/src/abstract/tokocrypto.js +1 -1
  89. package/dist/cjs/src/abstract/tradeogre.js +1 -1
  90. package/dist/cjs/src/abstract/upbit.js +1 -1
  91. package/dist/cjs/src/abstract/vertex.js +1 -1
  92. package/dist/cjs/src/abstract/wavesexchange.js +1 -1
  93. package/dist/cjs/src/abstract/whitebit.js +1 -1
  94. package/dist/cjs/src/abstract/woo.js +1 -1
  95. package/dist/cjs/src/abstract/woofipro.js +1 -1
  96. package/dist/cjs/src/abstract/xt.js +1 -1
  97. package/dist/cjs/src/abstract/yobit.js +1 -1
  98. package/dist/cjs/src/abstract/zaif.js +1 -1
  99. package/dist/cjs/src/abstract/zonda.js +1 -1
  100. package/dist/cjs/src/alpaca.js +1 -1
  101. package/dist/cjs/src/apex.js +1 -1
  102. package/dist/cjs/src/ascendex.js +1 -1
  103. package/dist/cjs/src/base/Exchange.js +11 -12
  104. package/dist/cjs/src/base/Precise.js +6 -0
  105. package/dist/cjs/src/base/errors.js +6 -0
  106. package/dist/cjs/src/base/functions/crypto.js +1 -1
  107. package/dist/cjs/src/base/functions/encode.js +2 -2
  108. package/dist/cjs/src/base/functions/generic.js +6 -0
  109. package/dist/cjs/src/base/functions/misc.js +1 -0
  110. package/dist/cjs/src/base/functions/number.js +6 -0
  111. package/dist/cjs/src/base/functions/platform.js +6 -0
  112. package/dist/cjs/src/base/functions/rsa.js +1 -0
  113. package/dist/cjs/src/base/functions/string.js +6 -0
  114. package/dist/cjs/src/base/functions/throttle.js +1 -1
  115. package/dist/cjs/src/base/functions/time.js +6 -0
  116. package/dist/cjs/src/base/functions/totp.js +1 -0
  117. package/dist/cjs/src/base/functions/type.js +6 -0
  118. package/dist/cjs/src/base/functions.js +2 -1
  119. package/dist/cjs/src/base/ws/Cache.js +6 -0
  120. package/dist/cjs/src/base/ws/Client.js +5 -34
  121. package/dist/cjs/src/base/ws/Future.js +1 -1
  122. package/dist/cjs/src/base/ws/OrderBook.js +1 -1
  123. package/dist/cjs/src/base/ws/OrderBookSide.js +6 -0
  124. package/dist/cjs/src/base/ws/WsClient.js +1 -1
  125. package/dist/cjs/src/bequant.js +1 -1
  126. package/dist/cjs/src/bigone.js +1 -1
  127. package/dist/cjs/src/binance.js +3 -3
  128. package/dist/cjs/src/binancecoinm.js +1 -1
  129. package/dist/cjs/src/binanceus.js +1 -1
  130. package/dist/cjs/src/binanceusdm.js +1 -1
  131. package/dist/cjs/src/bingx.js +14 -12
  132. package/dist/cjs/src/bit2c.js +1 -1
  133. package/dist/cjs/src/bitbank.js +1 -1
  134. package/dist/cjs/src/bitbns.js +1 -1
  135. package/dist/cjs/src/bitfinex.js +1 -1
  136. package/dist/cjs/src/bitflyer.js +1 -1
  137. package/dist/cjs/src/bitget.js +494 -155
  138. package/dist/cjs/src/bithumb.js +1 -1
  139. package/dist/cjs/src/bitmart.js +1 -1
  140. package/dist/cjs/src/bitmex.js +3 -2
  141. package/dist/cjs/src/bitopro.js +1 -1
  142. package/dist/cjs/src/bitrue.js +73 -67
  143. package/dist/cjs/src/bitso.js +1 -1
  144. package/dist/cjs/src/bitstamp.js +1 -1
  145. package/dist/cjs/src/bitteam.js +1 -1
  146. package/dist/cjs/src/bittrade.js +1 -1
  147. package/dist/cjs/src/blockchaincom.js +1 -1
  148. package/dist/cjs/src/blofin.js +1 -1
  149. package/dist/cjs/src/btcalpha.js +1 -1
  150. package/dist/cjs/src/btcbox.js +36 -1
  151. package/dist/cjs/src/btcmarkets.js +36 -1
  152. package/dist/cjs/src/btcturk.js +36 -1
  153. package/dist/cjs/src/bybit.js +10 -4
  154. package/dist/cjs/src/cex.js +62 -1
  155. package/dist/cjs/src/coinbase.js +1 -4
  156. package/dist/cjs/src/coinbaseadvanced.js +1 -1
  157. package/dist/cjs/src/coincatch.js +1 -1
  158. package/dist/cjs/src/coincheck.js +1 -1
  159. package/dist/cjs/src/coinex.js +1 -1
  160. package/dist/cjs/src/coinlist.js +1 -0
  161. package/dist/cjs/src/coinmate.js +1 -1
  162. package/dist/cjs/src/coinmetro.js +1 -1
  163. package/dist/cjs/src/coinone.js +1 -1
  164. package/dist/cjs/src/coinsph.js +1 -0
  165. package/dist/cjs/src/coinspot.js +1 -1
  166. package/dist/cjs/src/cryptocom.js +22 -3
  167. package/dist/cjs/src/cryptomus.js +2 -2
  168. package/dist/cjs/src/defx.js +1 -1
  169. package/dist/cjs/src/delta.js +3 -3
  170. package/dist/cjs/src/deribit.js +1 -1
  171. package/dist/cjs/src/derive.js +1 -1
  172. package/dist/cjs/src/digifinex.js +1 -1
  173. package/dist/cjs/src/ellipx.js +1 -1
  174. package/dist/cjs/src/exmo.js +15 -8
  175. package/dist/cjs/src/fmfwio.js +2 -2
  176. package/dist/cjs/src/gate.js +3 -3
  177. package/dist/cjs/src/gateio.js +1 -1
  178. package/dist/cjs/src/gemini.js +1 -1
  179. package/dist/cjs/src/hashkey.js +1 -1
  180. package/dist/cjs/src/hitbtc.js +1 -0
  181. package/dist/cjs/src/hollaex.js +29 -25
  182. package/dist/cjs/src/htx.js +1 -1
  183. package/dist/cjs/src/huobi.js +1 -1
  184. package/dist/cjs/src/hyperliquid.js +116 -60
  185. package/dist/cjs/src/independentreserve.js +1 -1
  186. package/dist/cjs/src/indodax.js +1 -1
  187. package/dist/cjs/src/kraken.js +30 -2
  188. package/dist/cjs/src/krakenfutures.js +1 -1
  189. package/dist/cjs/src/kucoin.js +1 -1
  190. package/dist/cjs/src/kucoinfutures.js +1 -1
  191. package/dist/cjs/src/latoken.js +1 -1
  192. package/dist/cjs/src/lbank.js +1 -1
  193. package/dist/cjs/src/luno.js +1 -1
  194. package/dist/cjs/src/mercado.js +1 -1
  195. package/dist/cjs/src/mexc.js +2 -1
  196. package/dist/cjs/src/modetrade.js +3 -3
  197. package/dist/cjs/src/myokx.js +1 -1
  198. package/dist/cjs/src/ndax.js +1 -1
  199. package/dist/cjs/src/novadax.js +1 -1
  200. package/dist/cjs/src/oceanex.js +1 -1
  201. package/dist/cjs/src/okcoin.js +1 -1
  202. package/dist/cjs/src/okx.js +1 -1
  203. package/dist/cjs/src/okxus.js +1 -1
  204. package/dist/cjs/src/onetrading.js +1 -1
  205. package/dist/cjs/src/oxfun.js +1 -1
  206. package/dist/cjs/src/p2b.js +1 -1
  207. package/dist/cjs/src/paradex.js +2 -2
  208. package/dist/cjs/src/paymium.js +1 -1
  209. package/dist/cjs/src/poloniex.js +1 -1
  210. package/dist/cjs/src/pro/alpaca.js +1 -1
  211. package/dist/cjs/src/pro/apex.js +1 -1
  212. package/dist/cjs/src/pro/ascendex.js +1 -1
  213. package/dist/cjs/src/pro/bequant.js +1 -1
  214. package/dist/cjs/src/pro/binancecoinm.js +1 -1
  215. package/dist/cjs/src/pro/binanceus.js +1 -1
  216. package/dist/cjs/src/pro/binanceusdm.js +1 -1
  217. package/dist/cjs/src/pro/bingx.js +1 -1
  218. package/dist/cjs/src/pro/bitfinex.js +1 -1
  219. package/dist/cjs/src/pro/bitget.js +1 -1
  220. package/dist/cjs/src/pro/bithumb.js +1 -1
  221. package/dist/cjs/src/pro/bitmart.js +1 -1
  222. package/dist/cjs/src/pro/bitmex.js +1 -1
  223. package/dist/cjs/src/pro/bitrue.js +1 -1
  224. package/dist/cjs/src/pro/bitstamp.js +2 -2
  225. package/dist/cjs/src/pro/bitvavo.js +1 -1
  226. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  227. package/dist/cjs/src/pro/blofin.js +1 -1
  228. package/dist/cjs/src/pro/bybit.js +7 -144
  229. package/dist/cjs/src/pro/cex.js +1 -1
  230. package/dist/cjs/src/pro/coinbase.js +1 -1
  231. package/dist/cjs/src/pro/coinbaseadvanced.js +1 -1
  232. package/dist/cjs/src/pro/coinbaseexchange.js +1 -1
  233. package/dist/cjs/src/pro/coinbaseinternational.js +1 -1
  234. package/dist/cjs/src/pro/coincatch.js +1 -1
  235. package/dist/cjs/src/pro/coincheck.js +1 -1
  236. package/dist/cjs/src/pro/coinex.js +1 -1
  237. package/dist/cjs/src/pro/coinone.js +1 -1
  238. package/dist/cjs/src/pro/cryptocom.js +1 -1
  239. package/dist/cjs/src/pro/defx.js +1 -1
  240. package/dist/cjs/src/pro/deribit.js +1 -1
  241. package/dist/cjs/src/pro/exmo.js +1 -1
  242. package/dist/cjs/src/pro/gate.js +1 -1
  243. package/dist/cjs/src/pro/gateio.js +1 -1
  244. package/dist/cjs/src/pro/gemini.js +1 -1
  245. package/dist/cjs/src/pro/hashkey.js +1 -1
  246. package/dist/cjs/src/pro/hitbtc.js +1 -1
  247. package/dist/cjs/src/pro/hollaex.js +1 -1
  248. package/dist/cjs/src/pro/htx.js +1 -1
  249. package/dist/cjs/src/pro/huobi.js +1 -1
  250. package/dist/cjs/src/pro/hyperliquid.js +1 -1
  251. package/dist/cjs/src/pro/independentreserve.js +1 -1
  252. package/dist/cjs/src/pro/kraken.js +252 -265
  253. package/dist/cjs/src/pro/krakenfutures.js +1 -1
  254. package/dist/cjs/src/pro/kucoin.js +1 -1
  255. package/dist/cjs/src/pro/kucoinfutures.js +1 -1
  256. package/dist/cjs/src/pro/lbank.js +1 -0
  257. package/dist/cjs/src/pro/luno.js +1 -1
  258. package/dist/cjs/src/pro/mexc.js +1 -2
  259. package/dist/cjs/src/pro/myokx.js +1 -1
  260. package/dist/cjs/src/pro/ndax.js +1 -1
  261. package/dist/cjs/src/pro/okcoin.js +1 -1
  262. package/dist/cjs/src/pro/okx.js +1 -1
  263. package/dist/cjs/src/pro/okxus.js +1 -1
  264. package/dist/cjs/src/pro/onetrading.js +1 -1
  265. package/dist/cjs/src/pro/oxfun.js +1 -1
  266. package/dist/cjs/src/pro/p2b.js +1 -1
  267. package/dist/cjs/src/pro/paradex.js +1 -1
  268. package/dist/cjs/src/pro/phemex.js +1 -1
  269. package/dist/cjs/src/pro/poloniex.js +1 -1
  270. package/dist/cjs/src/pro/probit.js +1 -1
  271. package/dist/cjs/src/pro/tradeogre.js +1 -1
  272. package/dist/cjs/src/pro/upbit.js +1 -1
  273. package/dist/cjs/src/pro/whitebit.js +1 -1
  274. package/dist/cjs/src/pro/xt.js +1 -1
  275. package/dist/cjs/src/probit.js +1 -1
  276. package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +6 -0
  277. package/dist/cjs/src/static_dependencies/ethers/address/address.js +1 -1
  278. package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +6 -0
  279. package/dist/cjs/src/static_dependencies/ethers/coders/address.js +1 -0
  280. package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +1 -0
  281. package/dist/cjs/src/static_dependencies/ethers/coders/array.js +1 -0
  282. package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +1 -0
  283. package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +1 -0
  284. package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +1 -0
  285. package/dist/cjs/src/static_dependencies/ethers/coders/null.js +1 -0
  286. package/dist/cjs/src/static_dependencies/ethers/coders/number.js +1 -0
  287. package/dist/cjs/src/static_dependencies/ethers/coders/string.js +1 -0
  288. package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +1 -0
  289. package/dist/cjs/src/static_dependencies/ethers/fragments.js +6 -0
  290. package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +6 -0
  291. package/dist/cjs/src/static_dependencies/ethers/index.js +1 -10
  292. package/dist/cjs/src/static_dependencies/ethers/interface.js +6 -0
  293. package/dist/cjs/src/static_dependencies/ethers/typed.js +6 -0
  294. package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +1 -13
  295. package/dist/cjs/src/static_dependencies/ethers/utils/data.js +1 -6
  296. package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +1 -9
  297. package/dist/cjs/src/static_dependencies/ethers/utils/events.js +6 -0
  298. package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +6 -0
  299. package/dist/cjs/src/static_dependencies/ethers/utils/index.js +1 -7
  300. package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +1 -5
  301. package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +6 -0
  302. package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +1 -8
  303. package/dist/cjs/src/static_dependencies/fflake/browser.js +1 -1
  304. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncrypt.js +1 -0
  305. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +1 -0
  306. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +1 -1
  307. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +6 -0
  308. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +6 -0
  309. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +6 -0
  310. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +1 -0
  311. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +1 -1
  312. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +6 -0
  313. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +1 -1
  314. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +1 -1
  315. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/util.js +6 -0
  316. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +1 -1
  317. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +6 -0
  318. package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +6 -0
  319. package/dist/cjs/src/static_dependencies/noble-curves/_shortw_utils.js +1 -1
  320. package/dist/cjs/src/static_dependencies/noble-curves/abstract/curve.js +1 -1
  321. package/dist/cjs/src/static_dependencies/noble-curves/abstract/edwards.js +1 -1
  322. package/dist/cjs/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +1 -0
  323. package/dist/cjs/src/static_dependencies/noble-curves/abstract/modular.js +1 -1
  324. package/dist/cjs/src/static_dependencies/noble-curves/abstract/montgomery.js +1 -1
  325. package/dist/cjs/src/static_dependencies/noble-curves/abstract/poseidon.js +1 -1
  326. package/dist/cjs/src/static_dependencies/noble-curves/abstract/utils.js +6 -0
  327. package/dist/cjs/src/static_dependencies/noble-curves/abstract/weierstrass.js +1 -1
  328. package/dist/cjs/src/static_dependencies/noble-curves/ed25519.js +1 -1
  329. package/dist/cjs/src/static_dependencies/noble-curves/p256.js +1 -1
  330. package/dist/cjs/src/static_dependencies/noble-curves/secp256k1.js +1 -1
  331. package/dist/cjs/src/static_dependencies/noble-hashes/_assert.js +6 -0
  332. package/dist/cjs/src/static_dependencies/noble-hashes/_sha2.js +1 -0
  333. package/dist/cjs/src/static_dependencies/noble-hashes/_u64.js +6 -0
  334. package/dist/cjs/src/static_dependencies/noble-hashes/crypto.js +6 -0
  335. package/dist/cjs/src/static_dependencies/noble-hashes/hmac.js +1 -0
  336. package/dist/cjs/src/static_dependencies/noble-hashes/md5.js +1 -0
  337. package/dist/cjs/src/static_dependencies/noble-hashes/sha1.js +1 -0
  338. package/dist/cjs/src/static_dependencies/noble-hashes/sha256.js +1 -0
  339. package/dist/cjs/src/static_dependencies/noble-hashes/sha3.js +1 -0
  340. package/dist/cjs/src/static_dependencies/noble-hashes/sha512.js +1 -0
  341. package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +1 -1
  342. package/dist/cjs/src/static_dependencies/node-fetch/body.js +1 -5
  343. package/dist/cjs/src/static_dependencies/node-fetch/errors/abort-error.js +1 -0
  344. package/dist/cjs/src/static_dependencies/node-fetch/errors/base.js +6 -0
  345. package/dist/cjs/src/static_dependencies/node-fetch/errors/fetch-error.js +1 -0
  346. package/dist/cjs/src/static_dependencies/node-fetch/headers.js +1 -5
  347. package/dist/cjs/src/static_dependencies/node-fetch/index.js +1 -7
  348. package/dist/cjs/src/static_dependencies/node-fetch/request.js +1 -7
  349. package/dist/cjs/src/static_dependencies/node-fetch/response.js +1 -5
  350. package/dist/cjs/src/static_dependencies/node-fetch/utils/get-search.js +6 -0
  351. package/dist/cjs/src/static_dependencies/node-fetch/utils/is-redirect.js +6 -0
  352. package/dist/cjs/src/static_dependencies/node-fetch/utils/is.js +6 -0
  353. package/dist/cjs/src/static_dependencies/node-fetch/utils/referrer.js +1 -0
  354. package/dist/cjs/src/static_dependencies/proxies/agent-base/index.js +1 -0
  355. package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +1 -0
  356. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +1 -0
  357. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +6 -0
  358. package/dist/cjs/src/static_dependencies/scure-base/index.js +6 -0
  359. package/dist/cjs/src/static_dependencies/scure-starknet/index.js +1 -1
  360. package/dist/cjs/src/static_dependencies/starknet/constants.js +1 -1
  361. package/dist/cjs/src/static_dependencies/starknet/types/calldata.js +6 -0
  362. package/dist/cjs/src/static_dependencies/starknet/types/lib/contract/abi.js +6 -0
  363. package/dist/cjs/src/static_dependencies/starknet/types/lib/contract/index.js +6 -0
  364. package/dist/cjs/src/static_dependencies/starknet/types/lib/index.js +6 -0
  365. package/dist/cjs/src/static_dependencies/starknet/types/typedData.js +6 -0
  366. package/dist/cjs/src/static_dependencies/starknet/utils/assert.js +6 -0
  367. package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/felt.js +1 -1
  368. package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/uint256.js +1 -1
  369. package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/uint512.js +1 -1
  370. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/byteArray.js +1 -0
  371. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/cairo.js +1 -0
  372. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoCustomEnum.js +6 -0
  373. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoOption.js +6 -0
  374. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoResult.js +6 -0
  375. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/formatter.js +1 -0
  376. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/index.js +1 -1
  377. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/index.js +1 -0
  378. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/parser-0-1.1.0.js +1 -0
  379. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/parser-2.0.0.js +6 -0
  380. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/propertyOrder.js +1 -0
  381. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/requestParser.js +1 -0
  382. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/responseParser.js +1 -0
  383. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/tuple.js +1 -1
  384. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/validate.js +1 -4
  385. package/dist/cjs/src/static_dependencies/starknet/utils/encode.js +1 -0
  386. package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +1 -3
  387. package/dist/cjs/src/static_dependencies/starknet/utils/merkle.js +1 -0
  388. package/dist/cjs/src/static_dependencies/starknet/utils/num.js +1 -0
  389. package/dist/cjs/src/static_dependencies/starknet/utils/selector.js +1 -0
  390. package/dist/cjs/src/static_dependencies/starknet/utils/shortString.js +1 -0
  391. package/dist/cjs/src/static_dependencies/starknet/utils/typedData.js +1 -1
  392. package/dist/cjs/src/static_dependencies/watchable/src/unpromise.js +6 -0
  393. package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +6 -0
  394. package/dist/cjs/src/timex.js +1 -0
  395. package/dist/cjs/src/tokocrypto.js +1 -1
  396. package/dist/cjs/src/tradeogre.js +4 -4
  397. package/dist/cjs/src/upbit.js +1 -1
  398. package/dist/cjs/src/vertex.js +1 -1
  399. package/dist/cjs/src/wavesexchange.js +1 -1
  400. package/dist/cjs/src/whitebit.js +1 -1
  401. package/dist/cjs/src/woo.js +1 -1
  402. package/dist/cjs/src/woofipro.js +1 -1
  403. package/dist/cjs/src/xt.js +2 -2
  404. package/dist/cjs/src/yobit.js +1 -1
  405. package/dist/cjs/src/zaif.js +1 -1
  406. package/dist/cjs/src/zonda.js +1 -1
  407. package/js/ccxt.d.ts +2 -5
  408. package/js/ccxt.js +8 -4
  409. package/js/src/abstract/alpaca.js +6 -0
  410. package/js/src/abstract/apex.js +6 -0
  411. package/js/src/abstract/ascendex.js +6 -0
  412. package/js/src/abstract/bequant.js +6 -0
  413. package/js/src/abstract/bigone.js +6 -0
  414. package/js/src/abstract/binance.js +6 -0
  415. package/js/src/abstract/binancecoinm.js +6 -0
  416. package/js/src/abstract/binanceus.js +6 -0
  417. package/js/src/abstract/binanceusdm.js +6 -0
  418. package/js/src/abstract/bingx.js +6 -0
  419. package/js/src/abstract/bit2c.js +6 -0
  420. package/js/src/abstract/bitbank.js +6 -0
  421. package/js/src/abstract/bitbns.js +6 -0
  422. package/js/src/abstract/bitfinex.js +6 -0
  423. package/js/src/abstract/bitflyer.js +6 -0
  424. package/js/src/abstract/bitget.d.ts +58 -0
  425. package/js/src/abstract/bitget.js +6 -0
  426. package/js/src/abstract/bithumb.js +6 -0
  427. package/js/src/abstract/bitmart.js +6 -0
  428. package/js/src/abstract/bitmex.js +6 -0
  429. package/js/src/abstract/bitopro.js +6 -0
  430. package/js/src/abstract/bitrue.js +6 -0
  431. package/js/src/abstract/bitso.js +6 -0
  432. package/js/src/abstract/bitstamp.js +6 -0
  433. package/js/src/abstract/bitteam.js +6 -0
  434. package/js/src/abstract/bittrade.js +6 -0
  435. package/js/src/abstract/bitvavo.js +6 -0
  436. package/js/src/abstract/blockchaincom.js +6 -0
  437. package/js/src/abstract/blofin.js +6 -0
  438. package/js/src/abstract/btcalpha.js +6 -0
  439. package/js/src/abstract/btcbox.js +6 -0
  440. package/js/src/abstract/btcmarkets.js +6 -0
  441. package/js/src/abstract/btcturk.js +6 -0
  442. package/js/src/abstract/bybit.js +6 -0
  443. package/js/src/abstract/cex.js +6 -0
  444. package/js/src/abstract/coinbase.js +6 -0
  445. package/js/src/abstract/coinbaseadvanced.js +6 -0
  446. package/js/src/abstract/coinbaseexchange.js +6 -0
  447. package/js/src/abstract/coinbaseinternational.js +6 -0
  448. package/js/src/abstract/coincatch.js +6 -0
  449. package/js/src/abstract/coincheck.js +6 -0
  450. package/js/src/abstract/coinex.js +6 -0
  451. package/js/src/abstract/coinmate.js +6 -0
  452. package/js/src/abstract/coinmetro.js +6 -0
  453. package/js/src/abstract/coinone.js +6 -0
  454. package/js/src/abstract/coinsph.js +6 -0
  455. package/js/src/abstract/coinspot.js +6 -0
  456. package/js/src/abstract/cryptocom.js +6 -0
  457. package/js/src/abstract/cryptomus.js +6 -0
  458. package/js/src/abstract/defx.js +6 -0
  459. package/js/src/abstract/delta.js +6 -0
  460. package/js/src/abstract/deribit.js +6 -0
  461. package/js/src/abstract/derive.js +6 -0
  462. package/js/src/abstract/digifinex.js +6 -0
  463. package/js/src/abstract/ellipx.js +6 -0
  464. package/js/src/abstract/exmo.js +6 -0
  465. package/js/src/abstract/fmfwio.js +6 -0
  466. package/js/src/abstract/gate.js +6 -0
  467. package/js/src/abstract/gateio.js +6 -0
  468. package/js/src/abstract/gemini.js +6 -0
  469. package/js/src/abstract/hashkey.js +6 -0
  470. package/js/src/abstract/hitbtc.js +6 -0
  471. package/js/src/abstract/hollaex.js +6 -0
  472. package/js/src/abstract/htx.js +6 -0
  473. package/js/src/abstract/huobi.js +6 -0
  474. package/js/src/abstract/hyperliquid.js +6 -0
  475. package/js/src/abstract/independentreserve.js +6 -0
  476. package/js/src/abstract/indodax.js +6 -0
  477. package/js/src/abstract/kraken.js +6 -0
  478. package/js/src/abstract/krakenfutures.js +6 -0
  479. package/js/src/abstract/kucoin.js +6 -0
  480. package/js/src/abstract/kucoinfutures.js +6 -0
  481. package/js/src/abstract/latoken.js +6 -0
  482. package/js/src/abstract/lbank.js +6 -0
  483. package/js/src/abstract/luno.js +6 -0
  484. package/js/src/abstract/mercado.js +6 -0
  485. package/js/src/abstract/mexc.js +6 -0
  486. package/js/src/abstract/modetrade.js +6 -0
  487. package/js/src/abstract/myokx.js +6 -0
  488. package/js/src/abstract/ndax.js +6 -0
  489. package/js/src/abstract/novadax.js +6 -0
  490. package/js/src/abstract/oceanex.js +6 -0
  491. package/js/src/abstract/okcoin.js +6 -0
  492. package/js/src/abstract/okx.js +6 -0
  493. package/js/src/abstract/okxus.js +6 -0
  494. package/js/src/abstract/onetrading.js +6 -0
  495. package/js/src/abstract/oxfun.js +6 -0
  496. package/js/src/abstract/p2b.js +6 -0
  497. package/js/src/abstract/paradex.js +6 -0
  498. package/js/src/abstract/paymium.js +6 -0
  499. package/js/src/abstract/phemex.js +6 -0
  500. package/js/src/abstract/poloniex.js +6 -0
  501. package/js/src/abstract/probit.js +6 -0
  502. package/js/src/abstract/timex.js +6 -0
  503. package/js/src/abstract/tokocrypto.js +6 -0
  504. package/js/src/abstract/tradeogre.js +6 -0
  505. package/js/src/abstract/upbit.js +6 -0
  506. package/js/src/abstract/vertex.js +6 -0
  507. package/js/src/abstract/wavesexchange.js +6 -0
  508. package/js/src/abstract/whitebit.js +6 -0
  509. package/js/src/abstract/woo.js +6 -0
  510. package/js/src/abstract/woofipro.js +6 -0
  511. package/js/src/abstract/xt.js +6 -0
  512. package/js/src/abstract/yobit.js +6 -0
  513. package/js/src/abstract/zaif.js +6 -0
  514. package/js/src/abstract/zonda.js +6 -0
  515. package/js/src/alpaca.js +6 -0
  516. package/js/src/apex.js +6 -0
  517. package/js/src/ascendex.js +6 -0
  518. package/js/src/base/Exchange.d.ts +6 -4
  519. package/js/src/base/Exchange.js +18 -13
  520. package/js/src/base/Precise.js +6 -0
  521. package/js/src/base/errorHierarchy.js +6 -0
  522. package/js/src/base/errors.js +6 -0
  523. package/js/src/base/functions/crypto.js +6 -0
  524. package/js/src/base/functions/encode.d.ts +1 -1
  525. package/js/src/base/functions/encode.js +7 -1
  526. package/js/src/base/functions/generic.d.ts +2 -1
  527. package/js/src/base/functions/generic.js +12 -1
  528. package/js/src/base/functions/misc.js +6 -0
  529. package/js/src/base/functions/number.js +6 -0
  530. package/js/src/base/functions/platform.js +6 -0
  531. package/js/src/base/functions/rsa.js +6 -0
  532. package/js/src/base/functions/string.js +6 -0
  533. package/js/src/base/functions/throttle.js +6 -0
  534. package/js/src/base/functions/time.js +6 -0
  535. package/js/src/base/functions/totp.js +6 -0
  536. package/js/src/base/functions/type.js +6 -0
  537. package/js/src/base/functions.js +6 -0
  538. package/js/src/base/types.js +6 -0
  539. package/js/src/base/ws/Cache.js +6 -0
  540. package/js/src/base/ws/Client.d.ts +0 -2
  541. package/js/src/base/ws/Client.js +10 -34
  542. package/js/src/base/ws/Future.js +6 -0
  543. package/js/src/base/ws/OrderBook.js +6 -0
  544. package/js/src/base/ws/OrderBookSide.js +6 -0
  545. package/js/src/base/ws/WsClient.js +6 -0
  546. package/js/src/base/ws/functions.js +6 -0
  547. package/js/src/bequant.js +6 -0
  548. package/js/src/bigone.js +6 -0
  549. package/js/src/binance.js +8 -2
  550. package/js/src/binancecoinm.js +6 -0
  551. package/js/src/binanceus.js +6 -0
  552. package/js/src/binanceusdm.js +6 -0
  553. package/js/src/bingx.d.ts +1 -1
  554. package/js/src/bingx.js +19 -11
  555. package/js/src/bit2c.js +6 -0
  556. package/js/src/bitbank.js +6 -0
  557. package/js/src/bitbns.js +6 -0
  558. package/js/src/bitfinex.js +6 -0
  559. package/js/src/bitflyer.js +6 -0
  560. package/js/src/bitget.d.ts +4 -1
  561. package/js/src/bitget.js +499 -154
  562. package/js/src/bithumb.js +6 -0
  563. package/js/src/bitmart.js +6 -0
  564. package/js/src/bitmex.js +8 -1
  565. package/js/src/bitopro.js +6 -0
  566. package/js/src/bitrue.js +78 -66
  567. package/js/src/bitso.js +6 -0
  568. package/js/src/bitstamp.js +6 -0
  569. package/js/src/bitteam.js +6 -0
  570. package/js/src/bittrade.js +6 -0
  571. package/js/src/bitvavo.js +6 -0
  572. package/js/src/blockchaincom.js +6 -0
  573. package/js/src/blofin.js +6 -0
  574. package/js/src/btcalpha.js +6 -0
  575. package/js/src/btcbox.js +41 -0
  576. package/js/src/btcmarkets.js +41 -0
  577. package/js/src/btcturk.js +41 -0
  578. package/js/src/bybit.js +15 -3
  579. package/js/src/cex.js +67 -0
  580. package/js/src/coinbase.d.ts +1 -1
  581. package/js/src/coinbase.js +7 -4
  582. package/js/src/coinbaseadvanced.js +6 -0
  583. package/js/src/coinbaseexchange.d.ts +1 -1
  584. package/js/src/coinbaseexchange.js +6 -0
  585. package/js/src/coinbaseinternational.js +6 -0
  586. package/js/src/coincatch.js +6 -0
  587. package/js/src/coincheck.js +6 -0
  588. package/js/src/coinex.js +6 -0
  589. package/js/src/coinmate.js +6 -0
  590. package/js/src/coinmetro.js +6 -0
  591. package/js/src/coinone.js +6 -0
  592. package/js/src/coinsph.js +6 -0
  593. package/js/src/coinspot.js +6 -0
  594. package/js/src/cryptocom.js +27 -2
  595. package/js/src/cryptomus.js +7 -1
  596. package/js/src/defx.js +6 -0
  597. package/js/src/delta.js +8 -2
  598. package/js/src/deribit.js +6 -0
  599. package/js/src/derive.js +6 -0
  600. package/js/src/digifinex.js +6 -0
  601. package/js/src/ellipx.js +6 -0
  602. package/js/src/exmo.js +20 -7
  603. package/js/src/fmfwio.js +8 -2
  604. package/js/src/gate.js +8 -2
  605. package/js/src/gateio.js +6 -0
  606. package/js/src/gemini.js +6 -0
  607. package/js/src/hashkey.js +6 -0
  608. package/js/src/hitbtc.js +6 -0
  609. package/js/src/hollaex.d.ts +1 -2
  610. package/js/src/hollaex.js +35 -25
  611. package/js/src/htx.js +6 -0
  612. package/js/src/huobi.js +6 -0
  613. package/js/src/hyperliquid.d.ts +1 -0
  614. package/js/src/hyperliquid.js +121 -59
  615. package/js/src/independentreserve.js +6 -0
  616. package/js/src/indodax.js +6 -0
  617. package/js/src/kraken.js +35 -1
  618. package/js/src/krakenfutures.js +6 -0
  619. package/js/src/kucoin.js +6 -0
  620. package/js/src/kucoinfutures.js +6 -0
  621. package/js/src/latoken.js +6 -0
  622. package/js/src/lbank.js +6 -0
  623. package/js/src/luno.js +6 -0
  624. package/js/src/mercado.js +6 -0
  625. package/js/src/mexc.js +7 -0
  626. package/js/src/modetrade.js +8 -2
  627. package/js/src/myokx.js +6 -0
  628. package/js/src/ndax.js +6 -0
  629. package/js/src/novadax.js +6 -0
  630. package/js/src/oceanex.js +6 -0
  631. package/js/src/okcoin.js +6 -0
  632. package/js/src/okx.js +6 -0
  633. package/js/src/okxus.js +6 -0
  634. package/js/src/onetrading.js +6 -0
  635. package/js/src/oxfun.js +6 -0
  636. package/js/src/p2b.d.ts +1 -2
  637. package/js/src/p2b.js +6 -0
  638. package/js/src/paradex.js +7 -1
  639. package/js/src/paymium.js +6 -0
  640. package/js/src/phemex.js +6 -0
  641. package/js/src/poloniex.js +6 -0
  642. package/js/src/pro/alpaca.js +6 -0
  643. package/js/src/pro/apex.js +6 -0
  644. package/js/src/pro/ascendex.js +6 -0
  645. package/js/src/pro/bequant.js +6 -0
  646. package/js/src/pro/binance.js +6 -0
  647. package/js/src/pro/binancecoinm.js +6 -0
  648. package/js/src/pro/binanceus.js +6 -0
  649. package/js/src/pro/binanceusdm.js +6 -0
  650. package/js/src/pro/bingx.js +6 -0
  651. package/js/src/pro/bitfinex.js +6 -0
  652. package/js/src/pro/bitget.js +6 -0
  653. package/js/src/pro/bithumb.js +6 -0
  654. package/js/src/pro/bitmart.js +6 -0
  655. package/js/src/pro/bitmex.js +6 -0
  656. package/js/src/pro/bitopro.js +6 -0
  657. package/js/src/pro/bitrue.js +6 -0
  658. package/js/src/pro/bitstamp.js +7 -1
  659. package/js/src/pro/bittrade.js +6 -0
  660. package/js/src/pro/bitvavo.js +6 -0
  661. package/js/src/pro/blockchaincom.js +6 -0
  662. package/js/src/pro/blofin.js +6 -0
  663. package/js/src/pro/bybit.d.ts +0 -1
  664. package/js/src/pro/bybit.js +12 -143
  665. package/js/src/pro/cex.js +6 -0
  666. package/js/src/pro/coinbase.js +6 -0
  667. package/js/src/pro/coinbaseadvanced.js +6 -0
  668. package/js/src/pro/coinbaseexchange.js +6 -0
  669. package/js/src/pro/coinbaseinternational.js +6 -0
  670. package/js/src/pro/coincatch.js +6 -0
  671. package/js/src/pro/coincheck.js +6 -0
  672. package/js/src/pro/coinex.js +6 -0
  673. package/js/src/pro/coinone.js +6 -0
  674. package/js/src/pro/cryptocom.js +6 -0
  675. package/js/src/pro/defx.js +6 -0
  676. package/js/src/pro/deribit.js +6 -0
  677. package/js/src/pro/derive.js +6 -0
  678. package/js/src/pro/exmo.js +6 -0
  679. package/js/src/pro/gate.js +6 -0
  680. package/js/src/pro/gateio.js +6 -0
  681. package/js/src/pro/gemini.js +6 -0
  682. package/js/src/pro/hashkey.js +6 -0
  683. package/js/src/pro/hitbtc.js +6 -0
  684. package/js/src/pro/hollaex.js +6 -0
  685. package/js/src/pro/htx.js +6 -0
  686. package/js/src/pro/huobi.js +6 -0
  687. package/js/src/pro/hyperliquid.js +6 -0
  688. package/js/src/pro/independentreserve.js +6 -0
  689. package/js/src/pro/kraken.d.ts +17 -17
  690. package/js/src/pro/kraken.js +257 -264
  691. package/js/src/pro/krakenfutures.js +6 -0
  692. package/js/src/pro/kucoin.js +6 -0
  693. package/js/src/pro/kucoinfutures.js +6 -0
  694. package/js/src/pro/lbank.js +6 -0
  695. package/js/src/pro/luno.js +6 -0
  696. package/js/src/pro/mexc.js +6 -1
  697. package/js/src/pro/modetrade.js +6 -0
  698. package/js/src/pro/myokx.js +6 -0
  699. package/js/src/pro/ndax.js +6 -0
  700. package/js/src/pro/okcoin.js +6 -0
  701. package/js/src/pro/okx.js +6 -0
  702. package/js/src/pro/okxus.js +6 -0
  703. package/js/src/pro/onetrading.js +6 -0
  704. package/js/src/pro/oxfun.js +6 -0
  705. package/js/src/pro/p2b.js +6 -0
  706. package/js/src/pro/paradex.js +6 -0
  707. package/js/src/pro/phemex.js +6 -0
  708. package/js/src/pro/poloniex.js +6 -0
  709. package/js/src/pro/probit.js +6 -0
  710. package/js/src/pro/tradeogre.js +6 -0
  711. package/js/src/pro/upbit.js +6 -0
  712. package/js/src/pro/vertex.js +6 -0
  713. package/js/src/pro/whitebit.js +6 -0
  714. package/js/src/pro/woo.js +6 -0
  715. package/js/src/pro/woofipro.js +6 -0
  716. package/js/src/pro/xt.js +6 -0
  717. package/js/src/probit.js +6 -0
  718. package/js/src/static_dependencies/ethers/abi-coder.js +6 -0
  719. package/js/src/static_dependencies/ethers/address/address.js +6 -0
  720. package/js/src/static_dependencies/ethers/address/checks.js +6 -0
  721. package/js/src/static_dependencies/ethers/address/contract-address.js +6 -0
  722. package/js/src/static_dependencies/ethers/address/index.js +6 -0
  723. package/js/src/static_dependencies/ethers/bytes32.js +6 -0
  724. package/js/src/static_dependencies/ethers/coders/abstract-coder.js +6 -0
  725. package/js/src/static_dependencies/ethers/coders/address.js +6 -0
  726. package/js/src/static_dependencies/ethers/coders/anonymous.js +6 -0
  727. package/js/src/static_dependencies/ethers/coders/array.js +6 -0
  728. package/js/src/static_dependencies/ethers/coders/boolean.js +6 -0
  729. package/js/src/static_dependencies/ethers/coders/bytes.js +6 -0
  730. package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +6 -0
  731. package/js/src/static_dependencies/ethers/coders/null.js +6 -0
  732. package/js/src/static_dependencies/ethers/coders/number.js +6 -0
  733. package/js/src/static_dependencies/ethers/coders/string.js +6 -0
  734. package/js/src/static_dependencies/ethers/coders/tuple.js +6 -0
  735. package/js/src/static_dependencies/ethers/fragments.js +6 -0
  736. package/js/src/static_dependencies/ethers/hash/index.js +6 -0
  737. package/js/src/static_dependencies/ethers/hash/solidity.js +6 -0
  738. package/js/src/static_dependencies/ethers/hash/typed-data.js +6 -0
  739. package/js/src/static_dependencies/ethers/index.js +6 -0
  740. package/js/src/static_dependencies/ethers/interface.js +6 -0
  741. package/js/src/static_dependencies/ethers/typed.js +6 -0
  742. package/js/src/static_dependencies/ethers/utils/base58.js +6 -0
  743. package/js/src/static_dependencies/ethers/utils/base64-browser.js +6 -0
  744. package/js/src/static_dependencies/ethers/utils/base64.js +6 -0
  745. package/js/src/static_dependencies/ethers/utils/data.js +6 -0
  746. package/js/src/static_dependencies/ethers/utils/errors.js +6 -0
  747. package/js/src/static_dependencies/ethers/utils/events.js +6 -0
  748. package/js/src/static_dependencies/ethers/utils/fixednumber.js +6 -0
  749. package/js/src/static_dependencies/ethers/utils/index.js +6 -0
  750. package/js/src/static_dependencies/ethers/utils/maths.js +6 -0
  751. package/js/src/static_dependencies/ethers/utils/properties.js +6 -0
  752. package/js/src/static_dependencies/ethers/utils/rlp-decode.js +6 -0
  753. package/js/src/static_dependencies/ethers/utils/rlp-encode.js +6 -0
  754. package/js/src/static_dependencies/ethers/utils/rlp.js +6 -0
  755. package/js/src/static_dependencies/ethers/utils/units.js +6 -0
  756. package/js/src/static_dependencies/ethers/utils/utf8.js +6 -0
  757. package/js/src/static_dependencies/ethers/utils/uuid.js +6 -0
  758. package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
  759. package/js/src/static_dependencies/fflake/browser.js +6 -0
  760. package/js/src/static_dependencies/jsencrypt/JSEncrypt.js +6 -0
  761. package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +6 -0
  762. package/js/src/static_dependencies/jsencrypt/index.js +6 -0
  763. package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +6 -0
  764. package/js/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +6 -0
  765. package/js/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +6 -0
  766. package/js/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +6 -0
  767. package/js/src/static_dependencies/jsencrypt/lib/asn1js/oids.js +6 -0
  768. package/js/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +6 -0
  769. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  770. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +6 -0
  771. package/js/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +6 -0
  772. package/js/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +6 -0
  773. package/js/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +6 -0
  774. package/js/src/static_dependencies/jsencrypt/lib/jsbn/util.js +6 -0
  775. package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +6 -0
  776. package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +6 -0
  777. package/js/src/static_dependencies/messagepack/msgpack.js +6 -0
  778. package/js/src/static_dependencies/noble-curves/_shortw_utils.js +6 -0
  779. package/js/src/static_dependencies/noble-curves/abstract/curve.js +6 -0
  780. package/js/src/static_dependencies/noble-curves/abstract/edwards.js +6 -0
  781. package/js/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +6 -0
  782. package/js/src/static_dependencies/noble-curves/abstract/modular.js +6 -0
  783. package/js/src/static_dependencies/noble-curves/abstract/montgomery.js +6 -0
  784. package/js/src/static_dependencies/noble-curves/abstract/poseidon.js +6 -0
  785. package/js/src/static_dependencies/noble-curves/abstract/utils.js +6 -0
  786. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +0 -1
  787. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.js +6 -0
  788. package/js/src/static_dependencies/noble-curves/bn.js +6 -0
  789. package/js/src/static_dependencies/noble-curves/ed25519.js +6 -0
  790. package/js/src/static_dependencies/noble-curves/ed448.js +6 -0
  791. package/js/src/static_dependencies/noble-curves/index.js +6 -0
  792. package/js/src/static_dependencies/noble-curves/jubjub.js +6 -0
  793. package/js/src/static_dependencies/noble-curves/p256.js +6 -0
  794. package/js/src/static_dependencies/noble-curves/p384.js +6 -0
  795. package/js/src/static_dependencies/noble-curves/p521.js +6 -0
  796. package/js/src/static_dependencies/noble-curves/pasta.js +6 -0
  797. package/js/src/static_dependencies/noble-curves/secp256k1.js +6 -0
  798. package/js/src/static_dependencies/noble-hashes/_assert.js +6 -0
  799. package/js/src/static_dependencies/noble-hashes/_blake2.js +6 -0
  800. package/js/src/static_dependencies/noble-hashes/_sha2.js +6 -0
  801. package/js/src/static_dependencies/noble-hashes/_u64.js +6 -0
  802. package/js/src/static_dependencies/noble-hashes/argon2.js +6 -0
  803. package/js/src/static_dependencies/noble-hashes/blake2b.js +6 -0
  804. package/js/src/static_dependencies/noble-hashes/blake2s.js +6 -0
  805. package/js/src/static_dependencies/noble-hashes/blake3.js +6 -0
  806. package/js/src/static_dependencies/noble-hashes/crypto.js +6 -0
  807. package/js/src/static_dependencies/noble-hashes/cryptoNode.js +6 -0
  808. package/js/src/static_dependencies/noble-hashes/eskdf.js +6 -0
  809. package/js/src/static_dependencies/noble-hashes/hkdf.js +6 -0
  810. package/js/src/static_dependencies/noble-hashes/hmac.js +6 -0
  811. package/js/src/static_dependencies/noble-hashes/index.js +6 -0
  812. package/js/src/static_dependencies/noble-hashes/md5.js +6 -0
  813. package/js/src/static_dependencies/noble-hashes/pbkdf2.js +6 -0
  814. package/js/src/static_dependencies/noble-hashes/ripemd160.js +6 -0
  815. package/js/src/static_dependencies/noble-hashes/scrypt.js +6 -0
  816. package/js/src/static_dependencies/noble-hashes/sha1.js +6 -0
  817. package/js/src/static_dependencies/noble-hashes/sha256.js +6 -0
  818. package/js/src/static_dependencies/noble-hashes/sha3-addons.js +6 -0
  819. package/js/src/static_dependencies/noble-hashes/sha3.js +6 -0
  820. package/js/src/static_dependencies/noble-hashes/sha512.js +6 -0
  821. package/js/src/static_dependencies/noble-hashes/utils.js +6 -0
  822. package/js/src/static_dependencies/node-fetch/body.js +6 -0
  823. package/js/src/static_dependencies/node-fetch/errors/abort-error.js +6 -0
  824. package/js/src/static_dependencies/node-fetch/errors/base.js +6 -0
  825. package/js/src/static_dependencies/node-fetch/errors/fetch-error.js +6 -0
  826. package/js/src/static_dependencies/node-fetch/headers.js +6 -0
  827. package/js/src/static_dependencies/node-fetch/index.js +6 -0
  828. package/js/src/static_dependencies/node-fetch/request.js +6 -0
  829. package/js/src/static_dependencies/node-fetch/response.js +6 -0
  830. package/js/src/static_dependencies/node-fetch/utils/get-search.js +6 -0
  831. package/js/src/static_dependencies/node-fetch/utils/is-redirect.js +6 -0
  832. package/js/src/static_dependencies/node-fetch/utils/is.js +6 -0
  833. package/js/src/static_dependencies/node-fetch/utils/referrer.js +6 -0
  834. package/js/src/static_dependencies/proxies/agent-base/helpers.js +6 -0
  835. package/js/src/static_dependencies/proxies/agent-base/index.js +6 -0
  836. package/js/src/static_dependencies/proxies/http-proxy-agent/index.js +6 -0
  837. package/js/src/static_dependencies/proxies/https-proxy-agent/index.js +6 -0
  838. package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +6 -0
  839. package/js/src/static_dependencies/qs/formats.cjs +6 -0
  840. package/js/src/static_dependencies/qs/index.cjs +6 -0
  841. package/js/src/static_dependencies/qs/parse.cjs +6 -0
  842. package/js/src/static_dependencies/qs/stringify.cjs +6 -0
  843. package/js/src/static_dependencies/qs/utils.cjs +6 -0
  844. package/js/src/static_dependencies/scure-base/index.js +6 -0
  845. package/js/src/static_dependencies/scure-starknet/index.js +6 -0
  846. package/js/src/static_dependencies/starknet/constants.js +6 -0
  847. package/js/src/static_dependencies/starknet/index.js +6 -0
  848. package/js/src/static_dependencies/starknet/types/cairoEnum.js +6 -0
  849. package/js/src/static_dependencies/starknet/types/calldata.js +6 -0
  850. package/js/src/static_dependencies/starknet/types/index.js +6 -0
  851. package/js/src/static_dependencies/starknet/types/lib/contract/abi.js +6 -0
  852. package/js/src/static_dependencies/starknet/types/lib/contract/index.js +6 -0
  853. package/js/src/static_dependencies/starknet/types/lib/contract/legacy.js +6 -0
  854. package/js/src/static_dependencies/starknet/types/lib/contract/sierra.js +6 -0
  855. package/js/src/static_dependencies/starknet/types/lib/index.js +6 -0
  856. package/js/src/static_dependencies/starknet/types/typedData.js +6 -0
  857. package/js/src/static_dependencies/starknet/utils/address.js +6 -0
  858. package/js/src/static_dependencies/starknet/utils/assert.js +6 -0
  859. package/js/src/static_dependencies/starknet/utils/cairoDataTypes/felt.js +6 -0
  860. package/js/src/static_dependencies/starknet/utils/cairoDataTypes/uint256.js +6 -0
  861. package/js/src/static_dependencies/starknet/utils/cairoDataTypes/uint512.js +6 -0
  862. package/js/src/static_dependencies/starknet/utils/calldata/byteArray.js +6 -0
  863. package/js/src/static_dependencies/starknet/utils/calldata/cairo.js +6 -0
  864. package/js/src/static_dependencies/starknet/utils/calldata/enum/CairoCustomEnum.js +6 -0
  865. package/js/src/static_dependencies/starknet/utils/calldata/enum/CairoOption.js +6 -0
  866. package/js/src/static_dependencies/starknet/utils/calldata/enum/CairoResult.js +6 -0
  867. package/js/src/static_dependencies/starknet/utils/calldata/enum/index.js +6 -0
  868. package/js/src/static_dependencies/starknet/utils/calldata/formatter.js +6 -0
  869. package/js/src/static_dependencies/starknet/utils/calldata/index.js +6 -0
  870. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  871. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.js +6 -0
  872. package/js/src/static_dependencies/starknet/utils/calldata/parser/interface.js +6 -0
  873. package/js/src/static_dependencies/starknet/utils/calldata/parser/parser-0-1.1.0.js +6 -0
  874. package/js/src/static_dependencies/starknet/utils/calldata/parser/parser-2.0.0.js +6 -0
  875. package/js/src/static_dependencies/starknet/utils/calldata/propertyOrder.js +6 -0
  876. package/js/src/static_dependencies/starknet/utils/calldata/requestParser.js +6 -0
  877. package/js/src/static_dependencies/starknet/utils/calldata/responseParser.js +6 -0
  878. package/js/src/static_dependencies/starknet/utils/calldata/tuple.js +6 -0
  879. package/js/src/static_dependencies/starknet/utils/calldata/validate.js +6 -0
  880. package/js/src/static_dependencies/starknet/utils/encode.js +6 -0
  881. package/js/src/static_dependencies/starknet/utils/hash/classHash.js +6 -0
  882. package/js/src/static_dependencies/starknet/utils/hash/index.js +6 -0
  883. package/js/src/static_dependencies/starknet/utils/merkle.js +6 -0
  884. package/js/src/static_dependencies/starknet/utils/num.js +6 -0
  885. package/js/src/static_dependencies/starknet/utils/selector.js +6 -0
  886. package/js/src/static_dependencies/starknet/utils/shortString.js +6 -0
  887. package/js/src/static_dependencies/starknet/utils/starknetId.js +6 -0
  888. package/js/src/static_dependencies/starknet/utils/typedData.js +6 -0
  889. package/js/src/static_dependencies/starknet/utils/uint256.js +6 -0
  890. package/js/src/static_dependencies/starknet/utils/url.js +6 -0
  891. package/js/src/static_dependencies/watchable/src/index.js +6 -0
  892. package/js/src/static_dependencies/watchable/src/types.js +6 -0
  893. package/js/src/static_dependencies/watchable/src/unpromise.js +6 -0
  894. package/js/src/static_dependencies/zklink/zklink-sdk-web.js +6 -0
  895. package/js/src/timex.js +6 -0
  896. package/js/src/tokocrypto.js +6 -0
  897. package/js/src/tradeogre.d.ts +1 -2
  898. package/js/src/tradeogre.js +9 -3
  899. package/js/src/upbit.js +6 -0
  900. package/js/src/vertex.js +6 -0
  901. package/js/src/wavesexchange.js +6 -0
  902. package/js/src/whitebit.js +6 -0
  903. package/js/src/woo.js +6 -0
  904. package/js/src/woofipro.js +6 -0
  905. package/js/src/xt.js +7 -1
  906. package/js/src/yobit.js +6 -0
  907. package/js/src/zaif.js +6 -0
  908. package/js/src/zonda.js +6 -0
  909. package/package.json +1 -1
  910. package/js/src/abstract/coinlist.d.ts +0 -60
  911. package/js/src/abstract/coinlist.js +0 -5
  912. package/js/src/coinlist.d.ts +0 -384
  913. package/js/src/coinlist.js +0 -2604
@@ -1,2604 +0,0 @@
1
- import Exchange from './abstract/coinlist.js';
2
- import { ArgumentsRequired, AuthenticationError, BadRequest, BadSymbol, ExchangeError, InsufficientFunds, InvalidAddress, InvalidOrder, NotSupported, OnMaintenance, OrderNotFound, PermissionDenied } from './base/errors.js';
3
- import { TICK_SIZE } from './base/functions/number.js';
4
- import { Precise } from './base/Precise.js';
5
- import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
6
- /**
7
- * @class coinlist
8
- * @augments Exchange
9
- */
10
- export default class coinlist extends Exchange {
11
- describe() {
12
- return this.deepExtend(super.describe(), {
13
- 'id': 'coinlist',
14
- 'name': 'Coinlist',
15
- 'countries': ['US'],
16
- 'version': 'v1',
17
- 'rateLimit': 300,
18
- 'certified': false,
19
- 'pro': false,
20
- 'has': {
21
- 'CORS': undefined,
22
- 'spot': true,
23
- 'margin': false,
24
- 'swap': false,
25
- 'future': false,
26
- 'option': false,
27
- 'addMargin': false,
28
- 'cancelAllOrders': true,
29
- 'cancelOrder': true,
30
- 'cancelOrders': true,
31
- 'closeAllPositions': false,
32
- 'closePosition': false,
33
- 'createDepositAddress': false,
34
- 'createOrder': true,
35
- 'createPostOnlyOrder': true,
36
- 'createReduceOnlyOrder': false,
37
- 'createStopLimitOrder': true,
38
- 'createStopMarketOrder': true,
39
- 'createStopOrder': true,
40
- 'deposit': false,
41
- 'editOrder': true,
42
- 'fetchAccounts': true,
43
- 'fetchBalance': true,
44
- 'fetchBidsAsks': false,
45
- 'fetchBorrowInterest': false,
46
- 'fetchBorrowRateHistories': false,
47
- 'fetchBorrowRateHistory': false,
48
- 'fetchCanceledOrders': true,
49
- 'fetchClosedOrder': false,
50
- 'fetchClosedOrders': true,
51
- 'fetchCrossBorrowRate': false,
52
- 'fetchCrossBorrowRates': false,
53
- 'fetchCurrencies': true,
54
- 'fetchDeposit': false,
55
- 'fetchDepositAddress': false,
56
- 'fetchDepositAddresses': false,
57
- 'fetchDepositAddressesByNetwork': false,
58
- 'fetchDeposits': false,
59
- 'fetchDepositsWithdrawals': true,
60
- 'fetchDepositWithdrawFee': false,
61
- 'fetchDepositWithdrawFees': false,
62
- 'fetchFundingHistory': false,
63
- 'fetchFundingRate': true,
64
- 'fetchFundingRateHistory': false,
65
- 'fetchFundingRates': false,
66
- 'fetchIndexOHLCV': false,
67
- 'fetchIsolatedBorrowRate': false,
68
- 'fetchIsolatedBorrowRates': false,
69
- 'fetchL3OrderBook': false,
70
- 'fetchLedger': true,
71
- 'fetchLeverage': false,
72
- 'fetchLeverageTiers': false,
73
- 'fetchMarketLeverageTiers': false,
74
- 'fetchMarkets': true,
75
- 'fetchMarkOHLCV': false,
76
- 'fetchMyTrades': true,
77
- 'fetchOHLCV': true,
78
- 'fetchOpenInterestHistory': false,
79
- 'fetchOpenOrder': false,
80
- 'fetchOpenOrders': true,
81
- 'fetchOrder': true,
82
- 'fetchOrderBook': true,
83
- 'fetchOrderBooks': false,
84
- 'fetchOrders': true,
85
- 'fetchOrderTrades': true,
86
- 'fetchPosition': false,
87
- 'fetchPositionHistory': false,
88
- 'fetchPositionMode': false,
89
- 'fetchPositions': false,
90
- 'fetchPositionsForSymbol': false,
91
- 'fetchPositionsHistory': false,
92
- 'fetchPositionsRisk': false,
93
- 'fetchPremiumIndexOHLCV': false,
94
- 'fetchStatus': false,
95
- 'fetchTicker': true,
96
- 'fetchTickers': true,
97
- 'fetchTime': true,
98
- 'fetchTrades': true,
99
- 'fetchTradingFee': false,
100
- 'fetchTradingFees': true,
101
- 'fetchTradingLimits': false,
102
- 'fetchTransactionFee': false,
103
- 'fetchTransactionFees': false,
104
- 'fetchTransactions': true,
105
- 'fetchTransfers': true,
106
- 'fetchWithdrawal': false,
107
- 'fetchWithdrawals': false,
108
- 'fetchWithdrawalWhitelist': false,
109
- 'reduceMargin': false,
110
- 'repayCrossMargin': false,
111
- 'repayIsolatedMargin': false,
112
- 'setLeverage': false,
113
- 'setMargin': false,
114
- 'setMarginMode': false,
115
- 'setPositionMode': false,
116
- 'signIn': false,
117
- 'transfer': true,
118
- 'withdraw': true,
119
- 'ws': false,
120
- },
121
- 'timeframes': {
122
- '1m': '1m',
123
- '5m': '5m',
124
- '30m': '30m',
125
- },
126
- 'urls': {
127
- 'logo': 'https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/281108917-eff2ae1d-ce8a-4b2a-950d-8678b12da965.jpg',
128
- 'api': {
129
- 'public': 'https://trade-api.coinlist.co',
130
- 'private': 'https://trade-api.coinlist.co',
131
- },
132
- 'www': 'https://coinlist.co',
133
- 'doc': [
134
- 'https://trade-docs.coinlist.co',
135
- ],
136
- 'fees': 'https://coinlist.co/fees',
137
- },
138
- 'api': {
139
- 'public': {
140
- 'get': {
141
- 'v1/symbols': 1,
142
- 'v1/symbols/summary': 1,
143
- 'v1/symbols/{symbol}': 1,
144
- 'v1/symbols/{symbol}/summary': 1,
145
- 'v1/symbols/{symbol}/book': 1,
146
- 'v1/symbols/{symbol}/quote': 1,
147
- 'v1/symbols/{symbol}/candles': 1,
148
- 'v1/symbols/{symbol}/auctions': 1,
149
- 'v1/symbols/{symbol}/auctions/{auction_code}': 1,
150
- 'v1/time': 1,
151
- 'v1/assets': 1,
152
- 'v1/leaderboard': 1,
153
- 'v1/affiliate/{competition_code}': 1,
154
- 'v1/competition/{competition_id}': 1,
155
- 'v1/symbols/{symbol}/funding': 1,
156
- },
157
- },
158
- 'private': {
159
- 'get': {
160
- 'v1/fees': 1,
161
- 'v1/accounts': 1,
162
- 'v1/accounts/{trader_id}': 1,
163
- 'v1/accounts/{trader_id}/alias': 1,
164
- 'v1/accounts/{trader_id}/ledger': 1,
165
- 'v1/accounts/{trader_id}/wallets': 1,
166
- 'v1/accounts/{trader_id}/wallet-ledger': 1,
167
- 'v1/accounts/{trader_id}/ledger-summary': 1,
168
- 'v1/keys': 1,
169
- 'v1/fills': 1,
170
- 'v1/orders': 1,
171
- 'v1/orders/{order_id}': 1,
172
- 'v1/reports': 1,
173
- 'v1/balances': 1,
174
- 'v1/transfers': 1,
175
- 'v1/user': 1,
176
- 'v1/credits': 1,
177
- 'v1/positions': 1,
178
- 'v1/accounts/{trader_id}/competitions': 1,
179
- 'v1/closedPositions': 1,
180
- },
181
- 'post': {
182
- 'v1/keys': 1,
183
- 'v1/orders': 1,
184
- 'v1/orders/cancel-all-after': 1,
185
- 'v1/reports': 1,
186
- 'v1/transfers/to-wallet': 1,
187
- 'v1/transfers/from-wallet': 1,
188
- 'v1/transfers/internal-transfer': 1,
189
- 'v1/transfers/withdrawal-request': 1,
190
- 'v1/orders/bulk': 1,
191
- 'v1/accounts/{trader_id}/competitions': 1,
192
- 'v1/accounts/{trader_id}/create-competition': 1,
193
- },
194
- 'patch': {
195
- 'v1/orders/{order_id}': 1,
196
- 'v1/orders/bulk': 1, // not unified
197
- },
198
- 'put': {
199
- 'v1/accounts/{trader_id}/alias': 1,
200
- },
201
- 'delete': {
202
- 'v1/keys/{key}': 1,
203
- 'v1/orders': 1,
204
- 'v1/orders/{order_id}': 1,
205
- 'v1/orders/bulk': 1,
206
- },
207
- },
208
- },
209
- 'features': {
210
- 'default': {
211
- 'sandbox': false,
212
- 'createOrder': {
213
- 'marginMode': false,
214
- 'triggerPrice': true,
215
- 'triggerPriceType': {
216
- 'last': true,
217
- 'mark': true,
218
- 'index': true,
219
- },
220
- 'triggerDirection': false,
221
- 'stopLossPrice': false,
222
- 'takeProfitPrice': false,
223
- 'attachedStopLossTakeProfit': undefined,
224
- 'timeInForce': {
225
- 'IOC': false,
226
- 'FOK': false,
227
- 'PO': true,
228
- 'GTD': false,
229
- },
230
- 'hedged': false,
231
- 'trailing': true,
232
- 'leverage': false,
233
- 'marketBuyByCost': false,
234
- 'marketBuyRequiresPrice': false,
235
- 'selfTradePrevention': true,
236
- 'iceberg': false,
237
- },
238
- 'createOrders': undefined,
239
- 'fetchMyTrades': {
240
- 'marginMode': false,
241
- 'limit': 500,
242
- 'daysBack': 100000,
243
- 'untilDays': 100000,
244
- 'symbolRequired': false,
245
- },
246
- 'fetchOrder': {
247
- 'marginMode': false,
248
- 'trigger': false,
249
- 'trailing': false,
250
- 'symbolRequired': false,
251
- },
252
- 'fetchOpenOrders': {
253
- 'marginMode': false,
254
- 'limit': 500,
255
- 'trigger': false,
256
- 'trailing': false,
257
- 'symbolRequired': false,
258
- },
259
- 'fetchOrders': {
260
- 'marginMode': false,
261
- 'limit': 500,
262
- 'daysBack': 100000,
263
- 'untilDays': 100000,
264
- 'trigger': false,
265
- 'trailing': false,
266
- 'symbolRequired': false,
267
- },
268
- 'fetchClosedOrders': {
269
- 'marginMode': false,
270
- 'limit': 500,
271
- 'daysBack': 100000,
272
- 'daysBackCanceled': undefined,
273
- 'untilDays': 100000,
274
- 'trigger': false,
275
- 'trailing': false,
276
- 'symbolRequired': false,
277
- },
278
- 'fetchOHLCV': {
279
- 'limit': 300,
280
- },
281
- },
282
- 'swap': {
283
- 'linear': undefined,
284
- 'inverse': undefined,
285
- },
286
- 'future': {
287
- 'linear': undefined,
288
- 'inverse': undefined,
289
- },
290
- },
291
- 'fees': {
292
- 'trading': {
293
- 'feeSide': 'get',
294
- 'tierBased': true,
295
- 'percentage': true,
296
- 'taker': this.parseNumber('0.0045'),
297
- 'maker': this.parseNumber('0.0025'),
298
- 'tiers': {
299
- 'taker': [
300
- [this.parseNumber('0'), this.parseNumber('0.0045')],
301
- [this.parseNumber('20000'), this.parseNumber('0.003')],
302
- [this.parseNumber('50000'), this.parseNumber('0.0025')],
303
- [this.parseNumber('100000'), this.parseNumber('0.002')],
304
- [this.parseNumber('500000'), this.parseNumber('0.0018')],
305
- [this.parseNumber('750000'), this.parseNumber('0.0018')],
306
- [this.parseNumber('1000000'), this.parseNumber('0.0016')],
307
- [this.parseNumber('2500000'), this.parseNumber('0.0013')],
308
- [this.parseNumber('5000000'), this.parseNumber('0.0012')],
309
- [this.parseNumber('10000000'), this.parseNumber('0.001')],
310
- [this.parseNumber('50000000'), this.parseNumber('0.0005')],
311
- [this.parseNumber('100000000'), this.parseNumber('0.0005')],
312
- ],
313
- 'maker': [
314
- [this.parseNumber('0'), this.parseNumber('0.0025')],
315
- [this.parseNumber('20000'), this.parseNumber('0.0025')],
316
- [this.parseNumber('50000'), this.parseNumber('0.0025')],
317
- [this.parseNumber('100000'), this.parseNumber('0.002')],
318
- [this.parseNumber('500000'), this.parseNumber('0.0015')],
319
- [this.parseNumber('750000'), this.parseNumber('0.0012')],
320
- [this.parseNumber('1000000'), this.parseNumber('0.001')],
321
- [this.parseNumber('2500000'), this.parseNumber('0.0008')],
322
- [this.parseNumber('5000000'), this.parseNumber('0.0007')],
323
- [this.parseNumber('10000000'), this.parseNumber('0.0006')],
324
- [this.parseNumber('50000000'), this.parseNumber('0.0000')],
325
- [this.parseNumber('100000000'), this.parseNumber('0.00')],
326
- ],
327
- },
328
- },
329
- },
330
- 'precisionMode': TICK_SIZE,
331
- // exchange-specific options
332
- 'options': {
333
- 'accountsByType': {
334
- 'CoinList Pro': 'trading',
335
- 'CoinList Pro trading account': 'trading',
336
- 'Pro': 'trading',
337
- 'pro': 'trading',
338
- 'trade': 'trading',
339
- 'trading': 'trading',
340
- 'CoinList': 'funding',
341
- 'CoinList wallet': 'funding',
342
- 'Wallet': 'funding',
343
- 'wallet': 'funding',
344
- 'fund': 'funding',
345
- 'funding': 'funding',
346
- },
347
- },
348
- 'exceptions': {
349
- // https://trade-docs.coinlist.co/?javascript--nodejs#message-codes
350
- 'exact': {
351
- 'AUTH_SIG_INVALID': AuthenticationError,
352
- 'DENIED_MAINTENANCE': OnMaintenance,
353
- 'ORDER_REJECT_BAD_STATUS': InvalidOrder,
354
- 'ORDER_REJECT_INVALID_POST_ONLY': InvalidOrder,
355
- 'ORDER_REJECT_INVALID_CLOSE_ONLY': InvalidOrder,
356
- 'ORDER_REJECT_POST_ONLY_REQUIRED': InvalidOrder,
357
- 'ORDER_REJECT_FROZEN_ORDER': InvalidOrder,
358
- 'ORDER_REJECT_LIMIT_PRICE_PROTECTION_VIOLATION': InvalidOrder,
359
- 'ORDER_REJECT_CLOSED': NotSupported,
360
- 'ORDER_REJECT_MAX_ORDERS': BadRequest,
361
- 'ORDER_REJECT_NOT_FOUND': OrderNotFound,
362
- 'ORDER_REJECT_PARSE_ERROR': BadRequest,
363
- 'ORDER_REJECT_PRICE_INVALID': InvalidOrder,
364
- 'ORDER_REJECT_QUANTITY_ZERO': InvalidOrder,
365
- 'ORDER_REJECT_TOKEN_LIMIT': InsufficientFunds,
366
- 'ORDER_REJECT_TOKEN_LIMIT_OTHER': InvalidOrder,
367
- 'ORDER_REJECT_SELF_TRADE': InvalidOrder,
368
- 'ORDER_VALIDATE_BAD_SIZE_ALIGNMENT': InvalidOrder,
369
- 'ORDER_VALIDATE_BAD_TICK_ALIGNMENT': InvalidOrder,
370
- 'ORDER_VALIDATE_SYMBOL_NOT_FOUND': BadSymbol,
371
- 'TRANSFERS_WITHDRAWAL_REQUEST_TOO_LARGE': InsufficientFunds,
372
- 'WITHDRAWAL_REQUEST_NOT_ALLOWED': PermissionDenied, // {"message":"Withdrawal from CoinList not allowed for trader.","message_code":"WITHDRAWAL_REQUEST_NOT_ALLOWED","message_details":{"asset":"USDT","amount":"5","trader_id":"9c6f737e-a829-4843-87b1-b1ce86f2853b","destination_address":"0x9050dfA063D1bE7cA711c750b18D51fDD13e90Ee"}}
373
- },
374
- 'broad': {
375
- 'A destinationAddress is required for non-USD withdrawals': InvalidAddress,
376
- 'fails to match the JsonSchema date-time format pattern': BadRequest,
377
- 'is required': ArgumentsRequired,
378
- 'must be a string': BadRequest,
379
- 'must be a valid GUID': BadRequest,
380
- 'must be greater than or equal to': BadRequest,
381
- 'must be less than or equal to': BadRequest,
382
- 'must be one of': BadRequest,
383
- 'Symbol not found': BadSymbol, // {"message":"Symbol not found: {symbol}"}
384
- },
385
- },
386
- });
387
- }
388
- calculateRateLimiterCost(api, method, path, params, config = {}) {
389
- if (Array.isArray(params)) {
390
- const length = params.length;
391
- return Math.ceil(length / 2);
392
- }
393
- return 1;
394
- }
395
- /**
396
- * @method
397
- * @name coinlist#fetchTime
398
- * @description fetches the current integer timestamp in milliseconds from the exchange server
399
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-system-time
400
- * @param {object} [params] extra parameters specific to the exchange API endpoint
401
- * @returns {int} the current integer timestamp in milliseconds from the exchange server
402
- */
403
- async fetchTime(params = {}) {
404
- const response = await this.publicGetV1Time(params);
405
- //
406
- // {
407
- // "epoch": 1698087996.039,
408
- // "iso": "2023-10-23T19:06:36.039Z"
409
- // }
410
- //
411
- const string = this.safeString(response, 'iso');
412
- return this.parse8601(string);
413
- }
414
- /**
415
- * @method
416
- * @name coinlist#fetchCurrencies
417
- * @description fetches all available currencies on an exchange
418
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-supported-assets
419
- * @param {object} [params] extra parameters specific to the exchange API endpoint
420
- * @returns {object} an associative dictionary of currencies
421
- */
422
- async fetchCurrencies(params = {}) {
423
- const response = await this.publicGetV1Assets(params);
424
- //
425
- // {
426
- // "assets": [
427
- // {
428
- // "asset": "AAVE",
429
- // "index_code": ".AAVEUSD",
430
- // "decimal_places": 18,
431
- // "min_withdrawal": "1.0000",
432
- // "is_transferable": true,
433
- // "is_visible": true
434
- // },
435
- // {
436
- // "asset": "ALGO",
437
- // "index_code": ".ALGOUSD",
438
- // "decimal_places": 6,
439
- // "min_withdrawal": "1.0000",
440
- // "is_transferable": true,
441
- // "is_visible": true
442
- // }
443
- // ]
444
- // }
445
- //
446
- const currencies = this.safeValue(response, 'assets', []);
447
- const result = {};
448
- for (let i = 0; i < currencies.length; i++) {
449
- const currency = currencies[i];
450
- const id = this.safeString(currency, 'asset');
451
- const code = this.safeCurrencyCode(id);
452
- const isFiat = code === 'USD';
453
- const isTransferable = this.safeBool(currency, 'is_transferable', false);
454
- result[code] = this.safeCurrencyStructure({
455
- 'id': id,
456
- 'code': code,
457
- 'name': code,
458
- 'info': currency,
459
- 'active': undefined,
460
- 'deposit': isTransferable,
461
- 'withdraw': isTransferable,
462
- 'fee': undefined,
463
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimal_places'))),
464
- 'limits': {
465
- 'amount': {
466
- 'min': undefined,
467
- 'max': undefined,
468
- },
469
- 'withdraw': {
470
- 'min': this.safeNumber(currency, 'min_withdrawal'),
471
- 'max': undefined,
472
- },
473
- },
474
- 'networks': {},
475
- 'type': isFiat ? 'fiat' : 'crypto',
476
- });
477
- }
478
- return result;
479
- }
480
- /**
481
- * @method
482
- * @name coinlist#fetchMarkets
483
- * @description retrieves data on all markets for coinlist
484
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-symbols
485
- * @param {object} [params] extra parameters specific to the exchange API endpoint
486
- * @returns {object[]} an array of objects representing market data
487
- */
488
- async fetchMarkets(params = {}) {
489
- const response = await this.publicGetV1Symbols(params);
490
- //
491
- // {
492
- // "symbols": [
493
- // {
494
- // "symbol": "CQT-USDT", // spot
495
- // "base_currency": "CQT",
496
- // "is_trader_geofenced": false,
497
- // "list_time": "2021-06-15T00:00:00.000Z",
498
- // "type": "spot",
499
- // "series_code": "CQT-USDT-SPOT",
500
- // "long_name": "Covalent",
501
- // "asset_class": "CRYPTO",
502
- // "minimum_price_increment": "0.0001",
503
- // "minimum_size_increment": "0.0001",
504
- // "quote_currency": "USDT",
505
- // "index_code": null,
506
- // "price_band_threshold_market": "0.05",
507
- // "price_band_threshold_limit": "0.25",
508
- // "last_price": "0.12160000",
509
- // "fair_price": "0.12300000",
510
- // "index_price": null
511
- // },
512
- // ]
513
- // }
514
- //
515
- const markets = this.safeValue(response, 'symbols', []);
516
- return this.parseMarkets(markets);
517
- }
518
- parseMarket(market) {
519
- // perp
520
- // {
521
- // "symbol":"BTC-PERP",
522
- // "base_currency":"BTC",
523
- // "is_trader_geofenced":false,
524
- // "expiry_name":null,
525
- // "expiry_time":null,
526
- // "list_time":"2024-09-16T00:00:00.000Z",
527
- // "type":"perp-swap",
528
- // "series_code":"BTC",
529
- // "long_name":"Bitcoin",
530
- // "asset_class":"CRYPTO",
531
- // "minimum_price_increment":"0.01",
532
- // "minimum_size_increment":"0.0001",
533
- // "quote_currency":"USDT",
534
- // "multiplier":"1",
535
- // "contract_frequency":"FGHJKMNQUVXZ",
536
- // "index_code":".BTC-USDT",
537
- // "price_band_threshold_market":"0.05",
538
- // "price_band_threshold_limit":"0.25",
539
- // "maintenance_initial_ratio":"0.500000000000000000",
540
- // "liquidation_initial_ratio":"0.500000000000000000",
541
- // "last_price":"75881.36000000",
542
- // "fair_price":"76256.00000000",
543
- // "index_price":"77609.90000000",
544
- // "mark_price":"76237.75000000",
545
- // "mark_price_dollarizer":"0.99950000",
546
- // "funding_interval":{
547
- // "hours":"8"
548
- // },
549
- // "funding_rate_index_code":".BTC-USDT-FR8H",
550
- // "initial_margin_base":"0.200000000000000000",
551
- // "initial_margin_per_contract":"0.160000000000000000",
552
- // "position_limit":"5.0000"
553
- // }
554
- // spot
555
- // {
556
- // "symbol": "CQT-USDT", // spot
557
- // "base_currency": "CQT",
558
- // "is_trader_geofenced": false,
559
- // "list_time": "2021-06-15T00:00:00.000Z",
560
- // "type": "spot",
561
- // "series_code": "CQT-USDT-SPOT",
562
- // "long_name": "Covalent",
563
- // "asset_class": "CRYPTO",
564
- // "minimum_price_increment": "0.0001",
565
- // "minimum_size_increment": "0.0001",
566
- // "quote_currency": "USDT",
567
- // "index_code": null,
568
- // "price_band_threshold_market": "0.05",
569
- // "price_band_threshold_limit": "0.25",
570
- // "last_price": "0.12160000",
571
- // "fair_price": "0.12300000",
572
- // "index_price": null
573
- // }
574
- const isSwap = this.safeString(market, 'type') === 'perp-swap';
575
- const id = this.safeString(market, 'symbol');
576
- const baseId = this.safeString(market, 'base_currency');
577
- const quoteId = this.safeString(market, 'quote_currency');
578
- const base = this.safeCurrencyCode(baseId);
579
- const quote = this.safeCurrencyCode(quoteId);
580
- const amountPrecision = this.safeString(market, 'minimum_size_increment');
581
- const pricePrecision = this.safeString(market, 'minimum_price_increment');
582
- const created = this.safeString(market, 'list_time');
583
- let settledId = undefined;
584
- let settled = undefined;
585
- let linear = undefined;
586
- let inverse = undefined;
587
- let contractSize = undefined;
588
- let symbol = base + '/' + quote;
589
- if (isSwap) {
590
- contractSize = this.parseNumber('1');
591
- linear = true;
592
- inverse = false;
593
- settledId = quoteId;
594
- settled = quote;
595
- symbol = symbol + ':' + quote;
596
- }
597
- const type = isSwap ? 'swap' : 'spot';
598
- return {
599
- 'id': id,
600
- 'symbol': symbol,
601
- 'base': base,
602
- 'quote': quote,
603
- 'settle': settled,
604
- 'baseId': baseId,
605
- 'quoteId': quoteId,
606
- 'settleId': settledId,
607
- 'type': type,
608
- 'spot': !isSwap,
609
- 'margin': false,
610
- 'swap': isSwap,
611
- 'future': false,
612
- 'option': false,
613
- 'active': true,
614
- 'contract': isSwap,
615
- 'linear': linear,
616
- 'inverse': inverse,
617
- 'contractSize': contractSize,
618
- 'expiry': undefined,
619
- 'expiryDatetime': undefined,
620
- 'strike': undefined,
621
- 'optionType': undefined,
622
- 'precision': {
623
- 'amount': this.parseNumber(amountPrecision),
624
- 'price': this.parseNumber(pricePrecision),
625
- },
626
- 'limits': {
627
- 'leverage': {
628
- 'min': undefined,
629
- 'max': undefined,
630
- },
631
- 'amount': {
632
- 'min': undefined,
633
- 'max': undefined,
634
- },
635
- 'price': {
636
- 'min': undefined,
637
- 'max': undefined,
638
- },
639
- 'cost': {
640
- 'min': undefined,
641
- 'max': undefined,
642
- },
643
- },
644
- 'created': this.parse8601(created),
645
- 'info': market,
646
- };
647
- }
648
- /**
649
- * @method
650
- * @name coinlist#fetchTickers
651
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
652
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-symbol-summaries
653
- * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
654
- * @param {object} [params] extra parameters specific to the exchange API endpoint
655
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
656
- */
657
- async fetchTickers(symbols = undefined, params = {}) {
658
- await this.loadMarkets();
659
- const request = {};
660
- const tickers = await this.publicGetV1SymbolsSummary(this.extend(request, params));
661
- //
662
- // {
663
- // "MATIC-USD": {
664
- // "type":"spot",
665
- // "last_price":"0.60990000",
666
- // "lowest_ask":"0.61190000",
667
- // "highest_bid":"0.60790000",
668
- // "last_trade": {
669
- // "price":"0.60000000",
670
- // "volume":"2.0000",
671
- // "imbalance":"198.0000",
672
- // "logicalTime":"2023-10-22T23:02:25.000Z",
673
- // "auctionCode":"MATIC-USD-2023-10-22T23:02:25.000Z"
674
- // },
675
- // "volume_base_24h":"34.0555",
676
- // "volume_quote_24h":"19.9282",
677
- // "price_change_percent_24h":"7.50925436",
678
- // "highest_price_24h":"0.68560000",
679
- // "lowest_price_24h":"0.55500000"
680
- // },
681
- // }
682
- //
683
- return this.parseTickers(tickers, symbols, params);
684
- }
685
- /**
686
- * @method
687
- * @name coinlist#fetchTicker
688
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
689
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-market-summary
690
- * @param {string} symbol unified symbol of the market to fetch the ticker for
691
- * @param {object} [params] extra parameters specific to the exchange API endpoint
692
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
693
- */
694
- async fetchTicker(symbol, params = {}) {
695
- await this.loadMarkets();
696
- const market = this.market(symbol);
697
- const request = {
698
- 'symbol': market['id'],
699
- };
700
- const ticker = await this.publicGetV1SymbolsSymbolSummary(this.extend(request, params));
701
- //
702
- // {
703
- // "type":"spot",
704
- // "last_price":"31125.00000000",
705
- // "lowest_ask":"31349.99000000",
706
- // "highest_bid":"30900.00000000",
707
- // "last_trade": {
708
- // "price":"31000.00000000",
709
- // "volume":"0.0003",
710
- // "imbalance":"0.0000",
711
- // "logicalTime":"2023-10-23T16:57:15.000Z",
712
- // "auctionCode":"BTC-USDT-2023-10-23T16:57:15.000Z"
713
- // },
714
- // "volume_base_24h":"0.3752",
715
- // "volume_quote_24h":"11382.7181",
716
- // "price_change_percent_24h":"3.66264694",
717
- // "highest_price_24h":"31225.12000000",
718
- // "lowest_price_24h":"29792.81000000"
719
- // }
720
- //
721
- return this.parseTicker(ticker, market);
722
- }
723
- parseTicker(ticker, market = undefined) {
724
- //
725
- // {
726
- // "type":"spot",
727
- // "last_price":"0.60990000",
728
- // "lowest_ask":"0.61190000",
729
- // "highest_bid":"0.60790000",
730
- // "last_trade": {
731
- // "price":"0.60000000",
732
- // "volume":"2.0000",
733
- // "imbalance":"198.0000",
734
- // "logicalTime":"2023-10-22T23:02:25.000Z",
735
- // "auctionCode":"MATIC-USD-2023-10-22T23:02:25.000Z"
736
- // },
737
- // "volume_base_24h":"34.0555",
738
- // "volume_quote_24h":"19.9282",
739
- // "price_change_percent_24h":"7.50925436",
740
- // "highest_price_24h":"0.68560000",
741
- // "lowest_price_24h":"0.55500000"
742
- // }
743
- //
744
- const lastTrade = this.safeValue(ticker, 'last_trade', {});
745
- const timestamp = this.parse8601(this.safeString(lastTrade, 'logicalTime'));
746
- const bid = this.safeString(ticker, 'highest_bid');
747
- const ask = this.safeString(ticker, 'lowest_ask');
748
- const baseVolume = this.safeString(ticker, 'volume_base_24h');
749
- const quoteVolume = this.safeString(ticker, 'volume_quote_24h');
750
- const high = this.safeString(ticker, 'highest_price_24h');
751
- const low = this.safeString(ticker, 'lowest_price_24h');
752
- const close = this.safeString(ticker, 'last_price');
753
- const changePcnt = this.safeString(ticker, 'price_change_percent_24h');
754
- return this.safeTicker({
755
- 'symbol': market['symbol'],
756
- 'timestamp': timestamp,
757
- 'datetime': this.iso8601(timestamp),
758
- 'open': undefined,
759
- 'high': high,
760
- 'low': low,
761
- 'close': close,
762
- 'bid': bid,
763
- 'bidVolume': undefined,
764
- 'ask': ask,
765
- 'askVolume': undefined,
766
- 'vwap': undefined,
767
- 'previousClose': undefined,
768
- 'change': undefined,
769
- 'percentage': changePcnt,
770
- 'average': undefined,
771
- 'baseVolume': baseVolume,
772
- 'quoteVolume': quoteVolume,
773
- 'info': ticker,
774
- }, market);
775
- }
776
- /**
777
- * @method
778
- * @name coinlist#fetchOrderBook
779
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
780
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-order-book-level-2
781
- * @param {string} symbol unified symbol of the market to fetch the order book for
782
- * @param {int} [limit] the maximum amount of order book entries to return (default 100, max 200)
783
- * @param {object} [params] extra parameters specific to the exchange API endpoint
784
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
785
- */
786
- async fetchOrderBook(symbol, limit = undefined, params = {}) {
787
- await this.loadMarkets();
788
- const market = this.market(symbol);
789
- const request = {
790
- 'symbol': market['id'],
791
- };
792
- const response = await this.publicGetV1SymbolsSymbolBook(this.extend(request, params));
793
- //
794
- // {
795
- // "bids": [
796
- // [ "30900.00000000", "0.0001" ],
797
- // [ "30664.21000000", "0.0172" ],
798
- // [ "30664.20000000", "0.0906" ],
799
- // ],
800
- // "asks": [
801
- // [ "31349.99000000", "0.0003" ],
802
- // [ "31350.00000000", "0.0023" ],
803
- // [ "31359.33000000", "0.0583" ],
804
- // ],
805
- // "after_auction_code": "BTC-USDT-2023-10-23T18:40:51.000Z",
806
- // "call_time": "2023-10-23T18:40:51.068Z",
807
- // "logical_time": "2023-10-23T18:40:51.000Z"
808
- // }
809
- //
810
- const logical_time = this.parse8601(this.safeString(response, 'logical_time'));
811
- const orderbook = this.parseOrderBook(response, symbol, logical_time);
812
- orderbook['nonce'] = undefined;
813
- return orderbook;
814
- }
815
- /**
816
- * @method
817
- * @name coinlist#fetchOHLCV
818
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
819
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-candles
820
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
821
- * @param {string} timeframe the length of time each candle represents
822
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
823
- * @param {int} [limit] the maximum amount of candles to fetch
824
- * @param {object} [params] extra parameters specific to the exchange API endpoint
825
- * @param {int} [params.until] the latest time in ms to fetch entries for
826
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
827
- */
828
- async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
829
- await this.loadMarkets();
830
- const market = this.market(symbol);
831
- const granularity = this.safeString(this.timeframes, timeframe);
832
- const request = {
833
- 'symbol': market['id'],
834
- 'granularity': granularity,
835
- };
836
- if (since !== undefined) {
837
- request['start_time'] = this.iso8601(since);
838
- if (limit !== undefined) {
839
- const duration = this.parseTimeframe(timeframe) * 1000;
840
- request['end_time'] = this.iso8601(this.sum(since, duration * (limit)));
841
- }
842
- else {
843
- request['end_time'] = this.iso8601(this.milliseconds());
844
- }
845
- }
846
- const until = this.safeInteger(params, 'until');
847
- if (until !== undefined) {
848
- params = this.omit(params, ['until']);
849
- request['end_time'] = this.iso8601(until);
850
- }
851
- const response = await this.publicGetV1SymbolsSymbolCandles(this.extend(request, params));
852
- //
853
- // {
854
- // "candles": [
855
- // [
856
- // "2023-10-17T15:00:00.000Z",
857
- // "28522.96000000",
858
- // "28522.96000000",
859
- // "28522.96000000",
860
- // "28522.96000000",
861
- // "0.1881",
862
- // null
863
- // ],
864
- // [
865
- // "2023-10-17T15:30:00.000Z",
866
- // "28582.64000000",
867
- // "28582.64000000",
868
- // "28582.64000000",
869
- // "28582.64000000",
870
- // "0.0050",
871
- // null
872
- // ]
873
- // ]
874
- // }
875
- //
876
- const candles = this.safeList(response, 'candles', []);
877
- return this.parseOHLCVs(candles, market, timeframe, since, limit);
878
- }
879
- parseOHLCV(ohlcv, market = undefined) {
880
- //
881
- // [
882
- // "2023-10-17T15:30:00.000Z",
883
- // "28582.64000000",
884
- // "28582.64000000",
885
- // "28582.64000000",
886
- // "28582.64000000",
887
- // "0.0050",
888
- // null
889
- // ]
890
- //
891
- return [
892
- this.parse8601(this.safeString(ohlcv, 0)),
893
- this.safeNumber(ohlcv, 1),
894
- this.safeNumber(ohlcv, 2),
895
- this.safeNumber(ohlcv, 3),
896
- this.safeNumber(ohlcv, 4),
897
- this.safeNumber(ohlcv, 5),
898
- ];
899
- }
900
- /**
901
- * @method
902
- * @name coinlist#fetchTrades
903
- * @description get the list of most recent trades for a particular symbol
904
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-auctions
905
- * @param {string} symbol unified symbol of the market to fetch trades for
906
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
907
- * @param {int} [limit] the maximum amount of trades to fetch (default 200, max 500)
908
- * @param {object} [params] extra parameters specific to the exchange API endpoint
909
- * @param {int} [params.until] the latest time in ms to fetch entries for
910
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
911
- */
912
- async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
913
- await this.loadMarkets();
914
- const market = this.market(symbol);
915
- const request = {
916
- 'symbol': market['id'],
917
- };
918
- if (since !== undefined) {
919
- request['start_time'] = this.iso8601(since);
920
- }
921
- if (limit !== undefined) {
922
- request['count'] = Math.min(limit, 500);
923
- }
924
- const until = this.safeInteger(params, 'until');
925
- if (until !== undefined) {
926
- params = this.omit(params, ['until']);
927
- request['end_time'] = this.iso8601(until);
928
- }
929
- const response = await this.publicGetV1SymbolsSymbolAuctions(this.extend(request, params));
930
- //
931
- // {
932
- // "auctions": [
933
- // {
934
- // "symbol":"BTC-USDT",
935
- // "auction_code":"BTC-USDT-2023-10-01T08:05:56.000Z",
936
- // "price":"27241.53000000",
937
- // "volume":"0.0052",
938
- // "imbalance":"-1.0983",
939
- // "logical_time":"2023-10-01T08:05:56.000Z",
940
- // "call_time":"2023-10-01T08:05:56.068Z"
941
- // },
942
- // {
943
- // "symbol":"BTC-USDT",
944
- // "auction_code":"BTC-USDT-2023-10-01T08:09:09.000Z",
945
- // "price":"27236.83000000",
946
- // "volume":"0.0283",
947
- // "imbalance":"-1.0754",
948
- // "logical_time":"2023-10-01T08:09:09.000Z",
949
- // "call_time":"2023-10-01T08:09:09.078Z"
950
- // }
951
- // ]
952
- // }
953
- //
954
- const auctions = this.safeList(response, 'auctions', []);
955
- return this.parseTrades(auctions, market, since, limit);
956
- }
957
- parseTrade(trade, market = undefined) {
958
- //
959
- // fetchTrades
960
- // {
961
- // "symbol": "BTC-USDT",
962
- // "auction_code": "BTC-USDT-2023-10-01T08:05:56.000Z",
963
- // "price": "27241.53000000",
964
- // "volume": "0.0052",
965
- // "imbalance": "-1.0983",
966
- // "logical_time": "2023-10-01T08:05:56.000Z",
967
- // "call_time": "2023-10-01T08:05:56.068Z"
968
- // }
969
- //
970
- // fetchMyTrades
971
- // {
972
- // "symbol": "ETH-USDT",
973
- // "auction_code": "ETH-USDT-2023-10-20T13:22:14.000Z",
974
- // "order_id": "83ed365f-497d-433b-96c1-9d08c1a12842",
975
- // "quantity": "0.0008",
976
- // "price": "1615.24000000",
977
- // "fee": "0.005815",
978
- // "fee_type": "taker",
979
- // "fee_currency": "USDT",
980
- // "logical_time": "2023-10-20T13:22:14.000Z"
981
- // }
982
- //
983
- const marketId = this.safeString(trade, 'symbol');
984
- market = this.safeMarket(marketId, market);
985
- const symbol = market['symbol'];
986
- const id = this.safeString(trade, 'auction_code');
987
- const timestamp = this.parse8601(this.safeString(trade, 'logical_time'));
988
- const priceString = this.safeString(trade, 'price');
989
- let amountString = this.safeString2(trade, 'volume', 'quantity');
990
- const order = this.safeString(trade, 'order_id');
991
- let fee = undefined;
992
- let side = undefined;
993
- const feeCost = this.safeString(trade, 'fee');
994
- if (feeCost !== undefined) {
995
- // only in fetchMyTrades
996
- const amountIsNegative = Precise.stringLt(amountString, '0');
997
- if (amountIsNegative) {
998
- side = 'sell';
999
- amountString = Precise.stringNeg(amountString);
1000
- }
1001
- else {
1002
- side = 'buy';
1003
- }
1004
- fee = {
1005
- 'cost': feeCost,
1006
- 'currency': this.safeString(trade, 'fee_currency'),
1007
- };
1008
- }
1009
- else {
1010
- const imbalance = this.safeString(trade, 'imbalance');
1011
- if (Precise.stringLt(imbalance, '0')) {
1012
- side = 'buy';
1013
- }
1014
- else {
1015
- side = 'sell';
1016
- }
1017
- }
1018
- const takerOrMaker = this.safeString(trade, 'fee_type');
1019
- return this.safeTrade({
1020
- 'id': id,
1021
- 'order': order,
1022
- 'timestamp': timestamp,
1023
- 'datetime': this.iso8601(timestamp),
1024
- 'symbol': symbol,
1025
- 'type': undefined,
1026
- 'side': side,
1027
- 'takerOrMaker': takerOrMaker,
1028
- 'price': priceString,
1029
- 'amount': amountString,
1030
- 'cost': undefined,
1031
- 'fee': fee,
1032
- 'info': trade,
1033
- }, market);
1034
- }
1035
- /**
1036
- * @method
1037
- * @name coinlist#fetchTradingFees
1038
- * @description fetch the trading fees for multiple markets
1039
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-fees
1040
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1041
- * @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
1042
- */
1043
- async fetchTradingFees(params = {}) {
1044
- await this.loadMarkets();
1045
- const response = await this.privateGetV1Fees(params);
1046
- //
1047
- // {
1048
- // fees_by_symbols: {
1049
- // 'BTC-USD,BTC-USDT,ETH-USD,ETH-USDT,ETH-BTC,AAVE-USD,AAVE-USDT,ALGO-USD,ALGO-USDT,AVAX-USD,AVAX-USDT,BICO-USD,BICO-USDT,BLD-USD,BLD-USDT,BTRST-USDT,BZZ-USDT,CELO-USD,CELO-BTC,CFG-USD,CFG-USDT,CLV-USDT,COMP-USD,COMP-USDT,CYBER-USDT,CQT-USDT,CSPR-USD,CSPR-USDT,CUSD-USD,CUSD-USDC,DOGE-USD,DOGE-USDT,DOT-USD,DOT-USDT,EFI-USDT,FIL-USD,FIL-USDT,FLOW-USD,FLOW-USDT,GAL-USD,GAL-USDT,GODS-USDT,GOG-USDT,HMT-USD,HMT-USDT,ICP-USD,ICP-USDT,IMX-USD,IMX-USDT,LINK-USD,LINK-USDT,MATIC-USD,MATIC-USDT,MINA-USD,MINA-USDT,MKR-USD,MKR-USDT,NEON-USDT,NYM-USD,NYM-USDT,OCEAN-USD,OXT-USD,ROSE-USD,ROSE-USDT,SKL-USD,SKL-USDT,SOL-USD,SOL-USDT,STX-USDT,SUI-USDT,T-USDT,UNI-USD,UNI-USDT,USDT-USD,VEGA-USDT,WAXL-USD,WAXL-USDT,WBTC-BTC,WCFG-USD,WCFG-USDT,XTZ-USD': {
1050
- // base: {
1051
- // fees: { maker: '0', taker: '0.0045', liquidation: '0' },
1052
- // floors: { maker: null, taker: null }
1053
- // },
1054
- // volume_tier_1: {
1055
- // fees: { maker: '0', taker: '0.003', liquidation: '0' },
1056
- // floors: { maker: null, taker: null }
1057
- // },
1058
- // volume_tier_2: {
1059
- // fees: { maker: '0', taker: '0.0025', liquidation: '0' },
1060
- // floors: { maker: null, taker: null }
1061
- // },
1062
- // volume_tier_3: {
1063
- // fees: { maker: '0', taker: '0.002', liquidation: '0' },
1064
- // floors: { maker: null, taker: null }
1065
- // },
1066
- // volume_tier_4: {
1067
- // fees: { maker: '0', taker: '0.0018', liquidation: '0' },
1068
- // floors: { maker: null, taker: null }
1069
- // },
1070
- // volume_tier_5: {
1071
- // fees: { maker: '0', taker: '0.0018', liquidation: '0' },
1072
- // floors: { maker: null, taker: null }
1073
- // },
1074
- // volume_tier_6: {
1075
- // fees: { maker: '0', taker: '0.0016', liquidation: '0' },
1076
- // floors: { maker: null, taker: null }
1077
- // },
1078
- // volume_tier_7: {
1079
- // fees: { maker: '0', taker: '0.0013', liquidation: '0' },
1080
- // floors: { maker: null, taker: null }
1081
- // },
1082
- // volume_tier_8: {
1083
- // fees: { maker: '0', taker: '0.0012', liquidation: '0' },
1084
- // floors: { maker: null, taker: null }
1085
- // },
1086
- // volume_tier_9: {
1087
- // fees: { maker: '0', taker: '0.001', liquidation: '0' },
1088
- // floors: { maker: null, taker: null }
1089
- // }
1090
- // volume_tier_10: {
1091
- // fees: { maker: '0', taker: '0.0005', liquidation: '0' },
1092
- // floors: { maker: null, taker: null }
1093
- // },
1094
- // volume_tier_11: {
1095
- // fees: { maker: '0', taker: '0.0005', liquidation: '0' },
1096
- // floors: { maker: null, taker: null }
1097
- // },
1098
- // }
1099
- // }
1100
- // }
1101
- //
1102
- const fees = this.safeValue(response, 'fees_by_symbols', {});
1103
- const result = {};
1104
- const groupsOfSymbols = Object.keys(fees);
1105
- for (let i = 0; i < groupsOfSymbols.length; i++) {
1106
- const group = groupsOfSymbols[i];
1107
- const feeTiers = this.safeValue(fees, group, {});
1108
- const tiers = this.parseFeeTiers(feeTiers);
1109
- const firstTier = this.safeValue(feeTiers, 'base', {});
1110
- const firstTierFees = this.safeValue(firstTier, 'fees', {});
1111
- const ids = group.split(',');
1112
- for (let j = 0; j < ids.length; j++) {
1113
- const id = ids[j];
1114
- const market = this.safeMarket(id);
1115
- const symbol = market['symbol'];
1116
- const info = {};
1117
- info[group] = feeTiers;
1118
- result[symbol] = {
1119
- 'info': info,
1120
- 'symbol': symbol,
1121
- 'maker': this.safeNumber(firstTierFees, 'maker'),
1122
- 'taker': this.safeNumber(firstTierFees, 'taker'),
1123
- 'percentage': true,
1124
- 'tierBased': true,
1125
- 'tiers': tiers,
1126
- };
1127
- }
1128
- }
1129
- return result;
1130
- }
1131
- parseFeeTiers(feeTiers, market = undefined) {
1132
- //
1133
- // base: {
1134
- // fees: { maker: '0', taker: '0.0045', liquidation: '0' },
1135
- // floors: { maker: null, taker: null }
1136
- // },
1137
- // volume_tier_1: {
1138
- // fees: { maker: '0', taker: '0.003', liquidation: '0' },
1139
- // floors: { maker: null, taker: null }
1140
- // },
1141
- // volume_tier_2: {
1142
- // fees: { maker: '0', taker: '0.0025', liquidation: '0' },
1143
- // floors: { maker: null, taker: null }
1144
- // },
1145
- // volume_tier_3: {
1146
- // fees: { maker: '0', taker: '0.002', liquidation: '0' },
1147
- // floors: { maker: null, taker: null }
1148
- // },
1149
- // volume_tier_4: {
1150
- // fees: { maker: '0', taker: '0.0018', liquidation: '0' },
1151
- // floors: { maker: null, taker: null }
1152
- // },
1153
- // volume_tier_5: {
1154
- // fees: { maker: '0', taker: '0.0018', liquidation: '0' },
1155
- // floors: { maker: null, taker: null }
1156
- // },
1157
- // volume_tier_6: {
1158
- // fees: { maker: '0', taker: '0.0016', liquidation: '0' },
1159
- // floors: { maker: null, taker: null }
1160
- // },
1161
- // volume_tier_7: {
1162
- // fees: { maker: '0', taker: '0.0013', liquidation: '0' },
1163
- // floors: { maker: null, taker: null }
1164
- // },
1165
- // volume_tier_8: {
1166
- // fees: { maker: '0', taker: '0.0012', liquidation: '0' },
1167
- // floors: { maker: null, taker: null }
1168
- // },
1169
- // volume_tier_9: {
1170
- // fees: { maker: '0', taker: '0.001', liquidation: '0' },
1171
- // floors: { maker: null, taker: null }
1172
- // }
1173
- // volume_tier_10: {
1174
- // fees: { maker: '0', taker: '0.0005', liquidation: '0' },
1175
- // floors: { maker: null, taker: null }
1176
- // },
1177
- // volume_tier_11: {
1178
- // fees: { maker: '0', taker: '0.0005', liquidation: '0' },
1179
- // floors: { maker: null, taker: null }
1180
- // },
1181
- //
1182
- let takerFees = [];
1183
- let makerFees = [];
1184
- const keys = Object.keys(feeTiers);
1185
- const keysLength = keys.length;
1186
- if (keysLength > 0) {
1187
- for (let i = 0; i < keysLength; i++) {
1188
- const key = keys[i];
1189
- const tier = this.safeValue(feeTiers, key, {});
1190
- const tierFees = this.safeValue(tier, 'fees', {});
1191
- const taker = this.safeString(tierFees, 'taker');
1192
- const maker = this.safeString(tierFees, 'maker');
1193
- makerFees.push([undefined, this.parseNumber(maker)]);
1194
- takerFees.push([undefined, this.parseNumber(taker)]);
1195
- }
1196
- takerFees = this.sortBy(takerFees, 1, true);
1197
- makerFees = this.sortBy(makerFees, 1, true);
1198
- const firstTier = this.safeDict(takerFees, 0, []);
1199
- const exchangeFees = this.safeDict(this, 'fees', {});
1200
- const exchangeFeesTrading = this.safeDict(exchangeFees, 'trading', {});
1201
- const exchangeFeesTradingTiers = this.safeDict(exchangeFeesTrading, 'tiers', {});
1202
- const exchangeFeesTradingTiersTaker = this.safeList(exchangeFeesTradingTiers, 'taker', []);
1203
- const exchangeFeesTradingTiersMaker = this.safeList(exchangeFeesTradingTiers, 'maker', []);
1204
- const exchangeFeesTradingTiersTakerLength = exchangeFeesTradingTiersTaker.length;
1205
- const firstTierLength = firstTier.length;
1206
- if ((keysLength === exchangeFeesTradingTiersTakerLength) && (firstTierLength > 0)) {
1207
- for (let i = 0; i < keysLength; i++) {
1208
- takerFees[i][0] = exchangeFeesTradingTiersTaker[i][0];
1209
- makerFees[i][0] = exchangeFeesTradingTiersMaker[i][0];
1210
- }
1211
- }
1212
- }
1213
- return {
1214
- 'maker': makerFees,
1215
- 'taker': takerFees,
1216
- };
1217
- }
1218
- /**
1219
- * @method
1220
- * @name coinlist#fetchAccounts
1221
- * @description fetch all the accounts associated with a profile
1222
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-accounts
1223
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1224
- * @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
1225
- */
1226
- async fetchAccounts(params = {}) {
1227
- await this.loadMarkets();
1228
- const response = await this.privateGetV1Accounts(params);
1229
- //
1230
- // {
1231
- // "accounts": [
1232
- // {
1233
- // "trader_id": "b18507ce-7d55-4bf1-b12a-0ccca5b90936",
1234
- // "name": "string"
1235
- // }
1236
- // ]
1237
- // }
1238
- //
1239
- const accounts = this.safeValue(response, 'accounts', []);
1240
- return this.parseAccounts(accounts, params);
1241
- }
1242
- parseAccount(account) {
1243
- //
1244
- // {
1245
- // "trader_id": "b18507ce-7d55-4bf1-b12a-0ccca5b90936",
1246
- // "name": "string"
1247
- // }
1248
- //
1249
- return {
1250
- 'id': this.safeString(account, 'trader_id'),
1251
- 'type': 'trading',
1252
- 'code': undefined,
1253
- 'info': account,
1254
- };
1255
- }
1256
- /**
1257
- * @method
1258
- * @name coinlist#fetchBalance
1259
- * @description query for balance and get the amount of funds available for trading or funds locked in orders
1260
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-balances
1261
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1262
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
1263
- */
1264
- async fetchBalance(params = {}) {
1265
- await this.loadMarkets();
1266
- const response = await this.privateGetV1Balances(params);
1267
- return this.parseBalance(response);
1268
- }
1269
- parseBalance(response) {
1270
- //
1271
- // {
1272
- // "asset_balances": {
1273
- // "BTC": "0.00308696",
1274
- // "ETH": "20.000000000000000000"
1275
- // },
1276
- // "asset_holds": {
1277
- // "BTC": "0.00000000",
1278
- // "ETH": "1.000000000000000000"
1279
- // },
1280
- // "net_liquidation_value_usd": "string"
1281
- // }
1282
- //
1283
- const result = {
1284
- 'info': response,
1285
- 'timestamp': undefined,
1286
- 'datetime': undefined,
1287
- };
1288
- const totalBalances = this.safeValue(response, 'asset_balances', {});
1289
- const usedBalances = this.safeValue(response, 'asset_holds', {});
1290
- const currencyIds = Object.keys(totalBalances);
1291
- for (let i = 0; i < currencyIds.length; i++) {
1292
- const currencyId = currencyIds[i];
1293
- const code = this.safeCurrencyCode(currencyId);
1294
- const account = this.account();
1295
- account['total'] = this.safeString(totalBalances, currencyId);
1296
- account['used'] = this.safeString(usedBalances, currencyId, '0');
1297
- result[code] = account;
1298
- }
1299
- return this.safeBalance(result);
1300
- }
1301
- /**
1302
- * @method
1303
- * @name coinlist#fetchMyTrades
1304
- * @description fetch all trades made by the user
1305
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-fills
1306
- * @param {string} symbol unified market symbol
1307
- * @param {int} [since] the earliest time in ms to fetch trades for
1308
- * @param {int} [limit] the maximum number of trades structures to retrieve (default 200, max 500)
1309
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1310
- * @param {int} [params.until] the latest time in ms to fetch entries for
1311
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1312
- */
1313
- async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1314
- await this.loadMarkets();
1315
- const request = {};
1316
- let market = undefined;
1317
- if (symbol !== undefined) {
1318
- market = this.market(symbol);
1319
- request['symbol'] = market['id'];
1320
- }
1321
- if (since !== undefined) {
1322
- request['start_time'] = this.iso8601(since);
1323
- }
1324
- if (limit !== undefined) {
1325
- request['count'] = limit;
1326
- }
1327
- const until = this.safeInteger(params, 'until');
1328
- if (until !== undefined) {
1329
- params = this.omit(params, ['until']);
1330
- request['end_time'] = this.iso8601(until);
1331
- }
1332
- const response = await this.privateGetV1Fills(this.extend(request, params));
1333
- //
1334
- // {
1335
- // "fills": [
1336
- // {
1337
- // "symbol": "ETH-USDT",
1338
- // "auction_code": "ETH-USDT-2023-10-20T13:16:30.000Z",
1339
- // "order_id": "39911d5f-c789-4a7d-ad34-820a804d1da6",
1340
- // "quantity": "-0.0009",
1341
- // "price": "1608.83000000",
1342
- // "fee": "0.006516",
1343
- // "fee_type": "taker",
1344
- // "fee_currency": "USDT",
1345
- // "logical_time": "2023-10-20T13:16:30.000Z"
1346
- // },
1347
- // {
1348
- // "symbol": "ETH-USDT",
1349
- // "auction_code": "ETH-USDT-2023-10-20T13:22:14.000Z",
1350
- // "order_id": "83ed365f-497d-433b-96c1-9d08c1a12842",
1351
- // "quantity": "0.0008",
1352
- // "price": "1615.24000000",
1353
- // "fee": "0.005815",
1354
- // "fee_type": "taker",
1355
- // "fee_currency": "USDT",
1356
- // "logical_time": "2023-10-20T13:22:14.000Z"
1357
- // },
1358
- // ]
1359
- // }
1360
- //
1361
- const fills = this.safeList(response, 'fills', []);
1362
- return this.parseTrades(fills, market, since, limit);
1363
- }
1364
- /**
1365
- * @method
1366
- * @name coinlist#fetchOrderTrades
1367
- * @description fetch all the trades made from a single order
1368
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-fills
1369
- * @param {string} id order id
1370
- * @param {string} symbol unified market symbol
1371
- * @param {int} [since] the earliest time in ms to fetch trades for
1372
- * @param {int} [limit] the maximum number of trades to retrieve
1373
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1374
- * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
1375
- */
1376
- async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
1377
- const request = {
1378
- 'order_id': id,
1379
- };
1380
- return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
1381
- }
1382
- /**
1383
- * @method
1384
- * @name coinlist#fetchOrders
1385
- * @description fetches information on multiple orders made by the user
1386
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
1387
- * @param {string} symbol unified market symbol of the market orders were made in
1388
- * @param {int} [since] the earliest time in ms to fetch orders for
1389
- * @param {int} [limit] the maximum number of order structures to retrieve (default 200, max 500)
1390
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1391
- * @param {int} [params.until] the latest time in ms to fetch entries for
1392
- * @param {string|string[]} [params.status] the status of the order - 'accepted', 'done', 'canceled', 'rejected', 'pending' (default [ 'accepted', 'done', 'canceled', 'rejected', 'pending' ])
1393
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1394
- */
1395
- async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1396
- await this.loadMarkets();
1397
- let status = this.safeString(params, 'status');
1398
- if (status === undefined) {
1399
- status = ['accepted', 'done', 'canceled', 'rejected', 'pending'];
1400
- }
1401
- const request = {
1402
- 'status': status,
1403
- };
1404
- let market = undefined;
1405
- if (symbol !== undefined) {
1406
- market = this.market(symbol);
1407
- request['symbol'] = market['id'];
1408
- }
1409
- if (since !== undefined) {
1410
- request['start_time'] = this.iso8601(since);
1411
- }
1412
- if (limit !== undefined) {
1413
- request['count'] = limit;
1414
- }
1415
- const until = this.safeInteger(params, 'until');
1416
- if (until !== undefined) {
1417
- params = this.omit(params, ['until']);
1418
- request['end_time'] = this.iso8601(until);
1419
- }
1420
- const response = await this.privateGetV1Orders(this.extend(request, params));
1421
- //
1422
- // {
1423
- // "orders":[
1424
- // {
1425
- // "order_id":"913ea6e7-9fc9-43fb-9db1-f195d3baa93f",
1426
- // "price":"35800.00000000",
1427
- // "stop_price":null,
1428
- // "cost":"0.00000000",
1429
- // "fill_fees":"0.00000000",
1430
- // "trader_id":"9c6f737e-a829-4843-87b1-b1ce86f2853b",
1431
- // "status":"accepted",
1432
- // "epoch_timestamp":"2023-10-26T08:20:56.307Z",
1433
- // "origin":"web",
1434
- // "self_trade_prevention":null,
1435
- // "client_id":null,
1436
- // "created_at":"2023-10-26T08:20:56.307Z",
1437
- // "symbol":"BTC-USDT",
1438
- // "size":"0.0003",
1439
- // "side":"sell",
1440
- // "type":"limit",
1441
- // "post_only":false,
1442
- // "size_filled":"0.0000"
1443
- // }
1444
- // ]
1445
- // }
1446
- //
1447
- const orders = this.safeList(response, 'orders', []);
1448
- return this.parseOrders(orders, market, since, limit);
1449
- }
1450
- /**
1451
- * @method
1452
- * @name coinlist#fetchOrder
1453
- * @description fetches information on an order made by the user
1454
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-specific-order-by-id
1455
- * @param {int|string} id order id
1456
- * @param {string} symbol not used by coinlist fetchOrder ()
1457
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1458
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1459
- */
1460
- async fetchOrder(id, symbol = undefined, params = {}) {
1461
- await this.loadMarkets();
1462
- const request = {
1463
- 'order_id': id,
1464
- };
1465
- const response = await this.privateGetV1OrdersOrderId(this.extend(request, params));
1466
- //
1467
- // {
1468
- // "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe",
1469
- // "client_id": "string",
1470
- // "symbol": "string",
1471
- // "type": "market",
1472
- // "side": "buy",
1473
- // "size": "string",
1474
- // "price": "string",
1475
- // "stop_price": "string",
1476
- // "stop_trigger": "last",
1477
- // "self_trade_prevention": "keep-newest",
1478
- // "average_fill_price": "string",
1479
- // "fill_fees": "string",
1480
- // "size_filled": "string",
1481
- // "created_at": "2019-08-24T14:15:22Z",
1482
- // "epoch_timestamp": "2019-08-24T14:15:22Z",
1483
- // "post_only": true,
1484
- // "peg_price_type": "trailing-stop",
1485
- // "peg_offset_value": "string",
1486
- // "origin": "web",
1487
- // "status": "pending"
1488
- // }
1489
- //
1490
- return this.parseOrder(response);
1491
- }
1492
- /**
1493
- * @method
1494
- * @name coinlist#fetchOpenOrders
1495
- * @description fetch all unfilled currently open orders
1496
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
1497
- * @param {string} symbol unified market symbol
1498
- * @param {int} [since] the earliest time in ms to fetch open orders for
1499
- * @param {int} [limit] the maximum number of open order structures to retrieve (default 200, max 500)
1500
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1501
- * @param {int} [params.until] the latest time in ms to fetch entries for
1502
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1503
- */
1504
- async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1505
- await this.loadMarkets();
1506
- const request = {
1507
- 'status': 'accepted',
1508
- };
1509
- return this.fetchOrders(symbol, since, limit, this.extend(request, params));
1510
- }
1511
- /**
1512
- * @method
1513
- * @name coinlist#fetchClosedOrders
1514
- * @description fetches information on multiple closed orders made by the user
1515
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
1516
- * @param {string} symbol unified market symbol of the market orders were made in
1517
- * @param {int} [since] the earliest time in ms to fetch orders for
1518
- * @param {int} [limit] the maximum number of closed order structures to retrieve (default 200, max 500)
1519
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1520
- * @param {int} [params.until] the latest time in ms to fetch entries for
1521
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1522
- */
1523
- async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1524
- await this.loadMarkets();
1525
- const request = {
1526
- 'status': 'done',
1527
- };
1528
- return this.fetchOrders(symbol, since, limit, this.extend(request, params));
1529
- }
1530
- /**
1531
- * @method
1532
- * @name coinlist#fetchCanceledOrders
1533
- * @description fetches information on multiple canceled orders made by the user
1534
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-orders
1535
- * @param {string} symbol unified market symbol of the market orders were made in
1536
- * @param {int} [since] the earliest time in ms to fetch orders for
1537
- * @param {int} [limit] the maximum number of canceled order structures to retrieve (default 200, max 500)
1538
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1539
- * @param {int} [params.until] the latest time in ms to fetch entries for
1540
- * @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1541
- */
1542
- async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1543
- await this.loadMarkets();
1544
- const request = {
1545
- 'status': 'canceled',
1546
- };
1547
- return this.fetchOrders(symbol, since, limit, this.extend(request, params));
1548
- }
1549
- /**
1550
- * @method
1551
- * @name coinlist#cancelAllOrders
1552
- * @description cancel open orders of market
1553
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#cancel-all-orders
1554
- * @param {string} symbol unified market symbol
1555
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1556
- * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1557
- */
1558
- async cancelAllOrders(symbol = undefined, params = {}) {
1559
- await this.loadMarkets();
1560
- let market = undefined;
1561
- const request = {};
1562
- if (symbol !== undefined) {
1563
- market = this.market(symbol);
1564
- request['symbol'] = market['id'];
1565
- }
1566
- const response = await this.privateDeleteV1Orders(this.extend(request, params));
1567
- //
1568
- // {
1569
- // "message": "Order cancellation request received.",
1570
- // "timestamp": "2023-10-26T10:29:28.652Z"
1571
- // }
1572
- //
1573
- const orders = [response];
1574
- return this.parseOrders(orders, market);
1575
- }
1576
- /**
1577
- * @method
1578
- * @name coinlist#cancelOrder
1579
- * @description cancels an open order
1580
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#cancel-specific-order-by-id
1581
- * @param {string} id order id
1582
- * @param {string} symbol not used by coinlist cancelOrder ()
1583
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1584
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1585
- */
1586
- async cancelOrder(id, symbol = undefined, params = {}) {
1587
- await this.loadMarkets();
1588
- const request = {
1589
- 'order_id': id,
1590
- };
1591
- const response = await this.privateDeleteV1OrdersOrderId(this.extend(request, params));
1592
- //
1593
- // {
1594
- // "message": "Cancel order request received.",
1595
- // "order_id": "d36e7588-6525-485c-b768-8ad8b3f745f9",
1596
- // "timestamp": "2023-10-26T14:36:37.559Z"
1597
- // }
1598
- //
1599
- return this.parseOrder(response);
1600
- }
1601
- /**
1602
- * @method
1603
- * @name coinlist#cancelOrders
1604
- * @description cancel multiple orders
1605
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#cancel-specific-orders
1606
- * @param {string[]} ids order ids
1607
- * @param {string} symbol not used by coinlist cancelOrders ()
1608
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1609
- * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1610
- */
1611
- async cancelOrders(ids, symbol = undefined, params = {}) {
1612
- await this.loadMarkets();
1613
- params = ids;
1614
- const response = await this.privateDeleteV1OrdersBulk(params);
1615
- //
1616
- // {
1617
- // "message": "Cancel order requests received.",
1618
- // "order_ids": [
1619
- // "ff132955-43bc-4fe5-9d9c-5ba226cc89a0"
1620
- // ],
1621
- // "timestamp": "2024-06-01T02:32:30.305Z"
1622
- // }
1623
- //
1624
- const orderIds = this.safeList(response, 'order_ids', []);
1625
- const orders = [];
1626
- const datetime = this.safeString(response, 'timestamp');
1627
- for (let i = 0; i < orderIds.length; i++) {
1628
- orders.push(this.safeOrder({
1629
- 'info': orderIds[i],
1630
- 'id': orderIds[i],
1631
- 'lastUpdateTimestamp': this.parse8601(datetime),
1632
- }));
1633
- }
1634
- return orders;
1635
- }
1636
- /**
1637
- * @method
1638
- * @name coinlist#createOrder
1639
- * @description create a trade order
1640
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#create-new-order
1641
- * @param {string} symbol unified symbol of the market to create an order in
1642
- * @param {string} type 'market' or 'limit' or 'stop_market' or 'stop_limit' or 'take_market' or 'take_limit'
1643
- * @param {string} side 'buy' or 'sell'
1644
- * @param {float} amount how much of currency you want to trade in units of base currency
1645
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1646
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1647
- * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately (default false)
1648
- * @param {float} [params.triggerPrice] only for the 'stop_market', 'stop_limit', 'take_market' or 'take_limit' orders (the price at which an order is triggered)
1649
- * @param {string} [params.clientOrderId] client order id (default undefined)
1650
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1651
- */
1652
- async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1653
- await this.loadMarkets();
1654
- const market = this.market(symbol);
1655
- const request = {
1656
- 'symbol': market['id'],
1657
- 'type': type,
1658
- 'side': side,
1659
- 'size': this.amountToPrecision(symbol, amount),
1660
- };
1661
- let isMarket = false;
1662
- if ((type === 'limit') || (type === 'stop_limit') || (type === 'take_limit')) {
1663
- if (price === undefined) {
1664
- throw new ArgumentsRequired(this.id + ' createOrder() requires a price argument for a ' + type + ' order');
1665
- }
1666
- request['price'] = this.priceToPrecision(symbol, price);
1667
- }
1668
- else {
1669
- isMarket = true;
1670
- }
1671
- let postOnly = undefined;
1672
- [postOnly, params] = this.handlePostOnly(isMarket, false, params);
1673
- if (postOnly) {
1674
- request['post_only'] = true;
1675
- }
1676
- const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'trigger_price', 'stopPrice', 'stop_price']);
1677
- if (triggerPrice !== undefined) {
1678
- params = this.omit(params, ['triggerPrice', 'trigger_price', 'stopPrice']);
1679
- request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
1680
- if (type === 'market') {
1681
- request['type'] = 'stop_market';
1682
- }
1683
- else if (type === 'limit') {
1684
- request['type'] = 'stop_limit';
1685
- }
1686
- }
1687
- else if ((type === 'stop_market') || (type === 'stop_limit') || (type === 'take_market') || (type === 'take_limit')) {
1688
- throw new ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders');
1689
- }
1690
- const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_id');
1691
- if (clientOrderId !== undefined) {
1692
- request['client_id'] = clientOrderId;
1693
- params = this.omit(params, ['clientOrderId', 'client_id']);
1694
- }
1695
- const response = await this.privatePostV1Orders(this.extend(request, params));
1696
- //
1697
- // {
1698
- // "message": "New order request received.",
1699
- // "order": {
1700
- // "symbol": "BTC-USDT",
1701
- // "type": "market",
1702
- // "side": "sell",
1703
- // "size": "0.0003",
1704
- // "order_id": "cad67c0f-9aec-4ac8-ac03-aaf5db299ff7",
1705
- // "trader_id": "9c6f737e-a829-4843-87b1-b1ce86f2853b"
1706
- // },
1707
- // "timestamp": "2023-10-26T11:30:55.376Z"
1708
- // }
1709
- //
1710
- const order = this.safeDict(response, 'order', {});
1711
- return this.parseOrder(order, market);
1712
- }
1713
- /**
1714
- * @method
1715
- * @name coinlist#editOrder
1716
- * @description create a trade order
1717
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#modify-existing-order
1718
- * @param {string} id order id
1719
- * @param {string} symbol unified symbol of the market to create an order in
1720
- * @param {string} type 'market' or 'limit' or 'stop_market' or 'stop_limit' or 'take_market' or 'take_limit'
1721
- * @param {string} side 'buy' or 'sell'
1722
- * @param {float} amount how much of currency you want to trade in units of base currency
1723
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1724
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1725
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1726
- */
1727
- async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
1728
- await this.loadMarkets();
1729
- if (amount === undefined) {
1730
- throw new ArgumentsRequired(this.id + ' editOrder() requires an amount argument');
1731
- }
1732
- const market = this.market(symbol);
1733
- const request = {
1734
- 'order_id': id,
1735
- 'type': type,
1736
- 'side': side,
1737
- 'size': this.amountToPrecision(symbol, amount),
1738
- };
1739
- if (price !== undefined) {
1740
- request['price'] = this.priceToPrecision(symbol, price);
1741
- }
1742
- const response = await this.privatePatchV1OrdersOrderId(this.extend(request, params));
1743
- return this.parseOrder(response, market);
1744
- }
1745
- parseOrder(order, market = undefined) {
1746
- //
1747
- // fetchOrder
1748
- // {
1749
- // "order_id": "913ea6e7-9fc9-43fb-9db1-f195d3baa93f",
1750
- // "price": "35800.00000000",
1751
- // "stop_price":null,
1752
- // "cost": "0.00000000",
1753
- // "fill_fees": "0.00000000",
1754
- // "trader_id": "9c6f737e-a829-4843-87b1-b1ce86f2853b",
1755
- // "status": "canceled",
1756
- // "epoch_timestamp": "2023-10-26T08:20:56.307Z",
1757
- // "origin": "web",
1758
- // "self_trade_prevention":null,
1759
- // "client_id":null,
1760
- // "symbol": "BTC-USDT",
1761
- // "size": "0.0003",
1762
- // "side": "sell",
1763
- // "type": "limit",
1764
- // "post_only":false,
1765
- // "size_filled": "0.0000"
1766
- // }
1767
- //
1768
- // fetchOrders
1769
- // {
1770
- // "order_id":"913ea6e7-9fc9-43fb-9db1-f195d3baa93f",
1771
- // "price":"35800.00000000",
1772
- // "stop_price":null,
1773
- // "cost":"0.00000000",
1774
- // "fill_fees":"0.00000000",
1775
- // "trader_id":"9c6f737e-a829-4843-87b1-b1ce86f2853b",
1776
- // "status":"accepted",
1777
- // "epoch_timestamp":"2023-10-26T08:20:56.307Z",
1778
- // "origin":"web",
1779
- // "self_trade_prevention":null,
1780
- // "client_id":null,
1781
- // "created_at":"2023-10-26T08:20:56.307Z",
1782
- // "symbol":"BTC-USDT",
1783
- // "size":"0.0003",
1784
- // "side":"sell",
1785
- // "type":"limit",
1786
- // "post_only":false,
1787
- // "size_filled":"0.0000"
1788
- // }
1789
- //
1790
- // createOrder
1791
- // {
1792
- // "symbol": "BTC-USDT",
1793
- // "type": "market",
1794
- // "side": "sell",
1795
- // "size": "0.0003",
1796
- // "order_id": "cad67c0f-9aec-4ac8-ac03-aaf5db299ff7",
1797
- // "trader_id": "9c6f737e-a829-4843-87b1-b1ce86f2853b"
1798
- // },
1799
- //
1800
- // cancelOrder
1801
- // {
1802
- // "message": "Cancel order request received.",
1803
- // "order_id": "d36e7588-6525-485c-b768-8ad8b3f745f9",
1804
- // "timestamp": "2023-10-26T14:36:37.559Z"
1805
- // }
1806
- //
1807
- // cancelOrders
1808
- // {
1809
- // "message": "Order cancellation request received.",
1810
- // "timestamp": "2023-10-26T10:29:28.652Z"
1811
- // }
1812
- //
1813
- // cancelAllOrders
1814
- // {
1815
- // "message": "Order cancellation request received.",
1816
- // "timestamp": "2023-10-26T10:29:28.652Z"
1817
- // }
1818
- //
1819
- const id = this.safeString(order, 'order_id');
1820
- const marketId = this.safeString(order, 'symbol');
1821
- market = this.safeMarket(marketId, market);
1822
- const clientOrderId = this.safeString(order, 'client_id');
1823
- let timestampString = this.safeString2(order, 'created_at', 'epoch_timestamp');
1824
- if (timestampString === undefined) {
1825
- timestampString = this.safeString(order, 'timestamp');
1826
- }
1827
- const timestamp = this.parse8601(timestampString);
1828
- const status = this.parseOrderStatus(this.safeString(order, 'status'));
1829
- const type = this.parseOrderType(this.safeString(order, 'type'));
1830
- const side = this.safeString(order, 'side');
1831
- const price = this.safeString(order, 'price');
1832
- const triggerPrice = this.safeString(order, 'stop_price');
1833
- const average = this.safeString(order, 'average_fill_price'); // from documentation
1834
- const amount = this.safeString(order, 'size');
1835
- const filled = this.safeString(order, 'size_filled');
1836
- const feeCost = this.safeString(order, 'fill_fees');
1837
- const postOnly = this.safeValue(order, 'post_only');
1838
- let fee = undefined;
1839
- if (feeCost !== undefined) {
1840
- fee = {
1841
- 'currency': market['quote'],
1842
- 'cost': feeCost,
1843
- 'rate': undefined,
1844
- };
1845
- }
1846
- return this.safeOrder({
1847
- 'id': id,
1848
- 'clientOrderId': clientOrderId,
1849
- 'timestamp': timestamp,
1850
- 'datetime': this.iso8601(timestamp),
1851
- 'lastTradeTimestamp': undefined,
1852
- 'status': status,
1853
- 'symbol': market['symbol'],
1854
- 'type': type,
1855
- 'timeInForce': 'GTC',
1856
- 'side': side,
1857
- 'price': price,
1858
- 'triggerPrice': triggerPrice,
1859
- 'average': average,
1860
- 'amount': amount,
1861
- 'cost': undefined,
1862
- 'filled': filled,
1863
- 'remaining': undefined,
1864
- 'fee': fee,
1865
- 'trades': undefined,
1866
- 'info': order,
1867
- 'postOnly': postOnly,
1868
- }, market);
1869
- }
1870
- parseOrderStatus(status) {
1871
- const statuses = {
1872
- 'pending': 'open',
1873
- 'accepted': 'open',
1874
- 'rejected': 'rejected',
1875
- 'done': 'closed',
1876
- 'canceled': 'canceled',
1877
- };
1878
- return this.safeString(statuses, status, status);
1879
- }
1880
- parseOrderType(status) {
1881
- const statuses = {
1882
- 'market': 'market',
1883
- 'limit': 'limit',
1884
- 'stop_market': 'market',
1885
- 'stop_limit': 'limit',
1886
- 'take_market': 'market',
1887
- 'take_limit': 'limit',
1888
- };
1889
- return this.safeString(statuses, status, status);
1890
- }
1891
- /**
1892
- * @method
1893
- * @name coinlist#transfer
1894
- * @description transfer currency internally between wallets on the same account
1895
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-between-entities
1896
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-from-wallet-to-pro
1897
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#transfer-funds-from-pro-to-wallet
1898
- * @param {string} code unified currency code
1899
- * @param {float} amount amount to transfer
1900
- * @param {string} fromAccount account to transfer from
1901
- * @param {string} toAccount account to transfer to
1902
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1903
- * @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1904
- */
1905
- async transfer(code, amount, fromAccount, toAccount, params = {}) {
1906
- await this.loadMarkets();
1907
- const currency = this.currency(code);
1908
- const request = {
1909
- 'asset': currency['id'],
1910
- 'amount': this.currencyToPrecision(code, amount),
1911
- };
1912
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
1913
- const fromAcc = this.safeString(accountsByType, fromAccount, fromAccount);
1914
- const toAcc = this.safeString(accountsByType, toAccount, toAccount);
1915
- let response = undefined;
1916
- if ((fromAcc === 'funding') && (toAcc === 'trading')) {
1917
- response = await this.privatePostV1TransfersFromWallet(this.extend(request, params));
1918
- }
1919
- else if ((fromAcc === 'trading') && (toAcc === 'funding')) {
1920
- response = await this.privatePostV1TransfersToWallet(this.extend(request, params));
1921
- }
1922
- else {
1923
- request['from_trader_id'] = fromAcc;
1924
- request['to_trader_id'] = toAcc;
1925
- response = await this.privatePostV1TransfersInternalTransfer(this.extend(request, params));
1926
- }
1927
- //
1928
- // privatePostV1TransfersInternalTransfer
1929
- // {
1930
- // "from_trader_id": "1f494ace-b3ed-4324-b202-55526ed06381",
1931
- // "to_trader_id": "d32c7a40-cc24-44b0-8597-f9edb3da989f",
1932
- // "asset": "string",
1933
- // "amount": "string"
1934
- // }
1935
- //
1936
- // privatePostV1TransfersFromWallet, privatePostV1TransfersToWallet
1937
- // {
1938
- // "transfer_id": "bb34f528-d9b0-47c6-b11f-4d4840b86ee3"
1939
- // }
1940
- //
1941
- const transfer = this.parseTransfer(response, currency);
1942
- return transfer;
1943
- }
1944
- /**
1945
- * @method
1946
- * @name coinlist#fetchTransfers
1947
- * @description fetch a history of internal transfers between CoinList.co and CoinList Pro. It does not return external deposits or withdrawals
1948
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#list-transfers
1949
- * @param {string} code unified currency code
1950
- * @param {int} [since] the earliest time in ms to fetch transfers for
1951
- * @param {int} [limit] the maximum number of transfer structures to retrieve (default 200, max 500)
1952
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1953
- * @param {int} [params.until] the latest time in ms to fetch entries for
1954
- * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
1955
- */
1956
- async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
1957
- await this.loadMarkets();
1958
- let currency = undefined;
1959
- if (code !== undefined) {
1960
- currency = this.currency(code);
1961
- }
1962
- const request = {};
1963
- if (since !== undefined) {
1964
- request['start_time'] = this.iso8601(since);
1965
- }
1966
- if (limit !== undefined) {
1967
- request['count'] = limit;
1968
- }
1969
- const until = this.safeInteger(params, 'until');
1970
- if (until !== undefined) {
1971
- params = this.omit(params, ['until']);
1972
- request['end_time'] = this.iso8601(until);
1973
- }
1974
- const response = await this.privateGetV1Transfers(this.extend(request, params));
1975
- //
1976
- // {
1977
- // "transfers": [
1978
- // {
1979
- // "transfer_id": "2c02db25-e8f2-4271-8222-e110bfd0aa2a",
1980
- // "created_at": "2023-10-20T13:15:37.000Z",
1981
- // "confirmed_at": "2023-10-20T13:15:37.000Z",
1982
- // "asset": "ETH",
1983
- // "amount": "0.010000000000000000",
1984
- // "status": "confirmed"
1985
- // },
1986
- // {
1987
- // "transfer_id": "890694db-156c-4e93-a3ef-4db61685aca7",
1988
- // "created_at": "2023-10-26T14:32:22.000Z",
1989
- // "confirmed_at": "2023-10-26T14:32:22.000Z",
1990
- // "asset": "USD",
1991
- // "amount": "-3.00",
1992
- // "status": "confirmed"
1993
- // }
1994
- // ]
1995
- // }
1996
- //
1997
- const transfers = this.safeList(response, 'transfers', []);
1998
- return this.parseTransfers(transfers, currency, since, limit);
1999
- }
2000
- parseTransfer(transfer, currency = undefined) {
2001
- //
2002
- // fetchTransfers
2003
- // {
2004
- // "transfer_id": "890694db-156c-4e93-a3ef-4db61685aca7",
2005
- // "created_at": "2023-10-26T14:32:22.000Z",
2006
- // "confirmed_at": "2023-10-26T14:32:22.000Z",
2007
- // "asset": "USD",
2008
- // "amount": "-3.00",
2009
- // "status": "confirmed"
2010
- // }
2011
- //
2012
- // transfer - privatePostV1TransfersInternalTransfer
2013
- // {
2014
- // "from_trader_id": "1f494ace-b3ed-4324-b202-55526ed06381",
2015
- // "to_trader_id": "d32c7a40-cc24-44b0-8597-f9edb3da989f",
2016
- // "asset": "string",
2017
- // "amount": "string"
2018
- // }
2019
- //
2020
- // transfer - privatePostV1TransfersFromWallet, privatePostV1TransfersToWallet
2021
- // {
2022
- // "transfer_id": "bb34f528-d9b0-47c6-b11f-4d4840b86ee3"
2023
- // }
2024
- //
2025
- const currencyId = this.safeString(transfer, 'asset');
2026
- const confirmedAt = this.safeString(transfer, 'confirmed_at');
2027
- const timetstamp = this.parse8601(confirmedAt);
2028
- const status = this.safeString(transfer, 'status');
2029
- let amountString = this.safeString(transfer, 'amount');
2030
- let fromAccount = undefined;
2031
- let toAccount = undefined;
2032
- let amount = undefined;
2033
- if (amountString !== undefined) {
2034
- const amountIsNegative = Precise.stringLt(amountString, '0');
2035
- if (amountIsNegative) {
2036
- fromAccount = 'trading';
2037
- toAccount = 'funding';
2038
- amountString = Precise.stringNeg(amountString);
2039
- }
2040
- else {
2041
- fromAccount = 'funding';
2042
- toAccount = 'trading';
2043
- }
2044
- amount = this.parseNumber(amountString);
2045
- }
2046
- return {
2047
- 'info': transfer,
2048
- 'id': this.safeString(transfer, 'transfer_id'),
2049
- 'timestamp': timetstamp,
2050
- 'datetime': this.iso8601(timetstamp),
2051
- 'currency': this.safeCurrencyCode(currencyId, currency),
2052
- 'amount': amount,
2053
- 'fromAccount': fromAccount,
2054
- 'toAccount': toAccount,
2055
- 'status': this.parseTransferStatus(status),
2056
- };
2057
- }
2058
- parseTransferStatus(status) {
2059
- const statuses = {
2060
- 'confirmed': 'ok',
2061
- };
2062
- return this.safeString(statuses, status, status);
2063
- }
2064
- /**
2065
- * @method
2066
- * @name coinlist#fetchDepositsWithdrawals
2067
- * @description fetch history of deposits and withdrawals from external wallets and between CoinList Pro trading account and CoinList wallet
2068
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-coinlist-wallet-ledger
2069
- * @param {string} [code] unified currency code for the currency of the deposit/withdrawals
2070
- * @param {int} [since] timestamp in ms of the earliest deposit/withdrawal
2071
- * @param {int} [limit] max number of deposit/withdrawals to return (default 200, max 500)
2072
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2073
- * @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2074
- */
2075
- async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
2076
- if (code === undefined) {
2077
- throw new ArgumentsRequired(this.id + ' fetchDepositsWithdrawals() requires a code argument');
2078
- }
2079
- const traderId = this.safeString2(params, 'trader_id', 'traderId');
2080
- if (traderId === undefined) {
2081
- throw new ArgumentsRequired(this.id + ' fetchDepositsWithdrawals() requires a traderId argument in the params');
2082
- }
2083
- await this.loadMarkets();
2084
- const currency = this.currency(code);
2085
- const request = {
2086
- 'asset': currency['id'],
2087
- 'trader_id': traderId,
2088
- };
2089
- if (limit !== undefined) {
2090
- request['count'] = limit;
2091
- }
2092
- params = this.omit(params, ['trader_id', 'traderId']);
2093
- const response = await this.privateGetV1AccountsTraderIdWalletLedger(this.extend(request, params));
2094
- //
2095
- // [
2096
- // {
2097
- // "id": "2c02db25-e8f2-4271-8222-e110bfd0aa2a",
2098
- // "asset": "ETH",
2099
- // "amount": "0.01",
2100
- // "created_at": "2023-10-20T13:15:37.000Z",
2101
- // "description": "Transfer to CoinList Pro",
2102
- // "type": "PRO_TRANSFER",
2103
- // "delta": "-0.010000000000000000"
2104
- // },
2105
- // {
2106
- // "id": "7139384d-6cec-479e-a19c-d498647ccb47",
2107
- // "asset": "ETH",
2108
- // "amount": "0.01",
2109
- // "created_at": "2023-10-20T13:10:55.000Z",
2110
- // "description": "CRYPTO_DEPOSIT",
2111
- // "type": "CRYPTO_DEPOSIT",
2112
- // "delta": "0.010000000000000000"
2113
- // },
2114
- //
2115
- // ...
2116
- //
2117
- // {
2118
- // "id": "91bbbb22-5ede-4e9a-81ef-3f9318aa83d2",
2119
- // "asset": "USDT",
2120
- // "amount": "4.169654",
2121
- // "withdrawal_fee_amount": "8.830346000000000000",
2122
- // "created_at": "2023-10-27T16:14:11.000Z",
2123
- // "description": "CRYPTO_WITHDRAWAL",
2124
- // "type": "CRYPTO_WITHDRAWAL",
2125
- // "delta": "-4.169654000000000000"
2126
- // },
2127
- // {
2128
- // "id": "830261bd-cda9-401f-b6df-105f4da3b37c",
2129
- // "asset": "USDT",
2130
- // "amount": "13",
2131
- // "created_at": "2023-10-27T14:52:05.000Z",
2132
- // "description": "Transfer from CoinList Pro",
2133
- // "type": "PRO_TRANSFER",
2134
- // "delta": "13.000000000000000000"
2135
- // }
2136
- // ]
2137
- //
2138
- // coinlist returns both internal transfers and blockchain transactions
2139
- return this.parseTransactions(response, currency, since, limit);
2140
- }
2141
- /**
2142
- * @method
2143
- * @name coinlist#withdraw
2144
- * @description request a withdrawal from CoinList wallet. (Disabled by default. Contact CoinList to apply for an exception.)
2145
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#request-withdrawal-from-wallet
2146
- * @param {string} code unified currency code
2147
- * @param {float} amount the amount to withdraw
2148
- * @param {string} address the address to withdraw to
2149
- * @param {string} tag
2150
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2151
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
2152
- */
2153
- async withdraw(code, amount, address, tag = undefined, params = {}) {
2154
- await this.loadMarkets();
2155
- const currency = this.currency(code);
2156
- const request = {
2157
- 'asset': currency['id'],
2158
- 'amount': this.currencyToPrecision(code, amount),
2159
- 'destination_address': address,
2160
- };
2161
- const response = await this.privatePostV1TransfersWithdrawalRequest(this.extend(request, params));
2162
- //
2163
- // {
2164
- // "transfer_id": "d4a2d8dd-7def-4545-a062-761683b9aa05"
2165
- // }
2166
- //
2167
- const data = this.safeDict(response, 'data', {});
2168
- return this.parseTransaction(data, currency);
2169
- }
2170
- parseTransaction(transaction, currency = undefined) {
2171
- // withdraw
2172
- //
2173
- // {
2174
- // "transfer_id": "d4a2d8dd-7def-4545-a062-761683b9aa05"
2175
- // }
2176
- //
2177
- // fetchDepositsWithdrawals
2178
- // {
2179
- // "id": "91bbbb22-5ede-4e9a-81ef-3f9318aa83d2",
2180
- // "asset": "USDT",
2181
- // "amount": "4.169654",
2182
- // "withdrawal_fee_amount": "8.830346000000000000",
2183
- // "created_at": "2023-10-27T16:14:11.000Z",
2184
- // "description": "CRYPTO_WITHDRAWAL",
2185
- // "type": "CRYPTO_WITHDRAWAL",
2186
- // "delta": "-4.169654000000000000"
2187
- // },
2188
- //
2189
- const currencyId = this.safeString(transaction, 'asset');
2190
- const code = this.safeCurrencyCode(currencyId, currency);
2191
- const id = this.safeString2(transaction, 'id', 'transfer_id');
2192
- const amount = this.safeNumber(transaction, 'amount');
2193
- const timestamp = this.parse8601(this.safeString(transaction, 'created_at'));
2194
- let type = this.safeString(transaction, 'type', undefined);
2195
- if (type === undefined) {
2196
- type = 'withdrawal'; // undefined only in withdraw() method
2197
- }
2198
- else {
2199
- type = this.parseTransactionType(type);
2200
- }
2201
- let fee = undefined;
2202
- const feeCost = this.safeString(transaction, 'withdrawal_fee_amount');
2203
- if (feeCost !== undefined) {
2204
- fee = {
2205
- 'cost': feeCost,
2206
- 'currency': code,
2207
- };
2208
- }
2209
- return {
2210
- 'info': transaction,
2211
- 'id': id,
2212
- 'txid': undefined,
2213
- 'timestamp': timestamp,
2214
- 'datetime': this.iso8601(timestamp),
2215
- 'network': undefined,
2216
- 'addressFrom': undefined,
2217
- 'address': undefined,
2218
- 'addressTo': undefined,
2219
- 'tagFrom': undefined,
2220
- 'tag': undefined,
2221
- 'tagTo': undefined,
2222
- 'type': type,
2223
- 'amount': amount,
2224
- 'currency': code,
2225
- 'status': undefined,
2226
- 'updated': undefined,
2227
- 'fee': fee,
2228
- 'comment': this.safeString(transaction, 'description'),
2229
- 'internal': undefined,
2230
- };
2231
- }
2232
- parseTransactionType(type) {
2233
- const types = {
2234
- 'CRYPTO_DEPOSIT': 'deposit',
2235
- 'CRYPTO_WITHDRAWAL': 'withdrawal',
2236
- 'PRO_TRANSFER': 'transfer',
2237
- };
2238
- return this.safeString(types, type, type);
2239
- }
2240
- /**
2241
- * @method
2242
- * @name coinlist#fetchLedger
2243
- * @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
2244
- * @see https://trade-docs.coinlist.co/?javascript--nodejs#get-account-history
2245
- * @param {string} [code] unified currency code, default is undefined
2246
- * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
2247
- * @param {int} [limit] max number of ledger entries to return (default 200, max 500)
2248
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2249
- * @param {int} [params.until] the latest time in ms to fetch entries for
2250
- * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2251
- */
2252
- async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2253
- const traderId = this.safeString2(params, 'trader_id', 'traderId');
2254
- if (traderId === undefined) {
2255
- throw new ArgumentsRequired(this.id + ' fetchLedger() requires a traderId argument in the params');
2256
- }
2257
- await this.loadMarkets();
2258
- const request = {
2259
- 'trader_id': traderId,
2260
- };
2261
- let currency = undefined;
2262
- if (code !== undefined) {
2263
- currency = this.currency(code);
2264
- }
2265
- if (since !== undefined) {
2266
- request['start_time'] = this.iso8601(since);
2267
- }
2268
- if (limit !== undefined) {
2269
- request['count'] = limit;
2270
- }
2271
- const until = this.safeInteger(params, 'until');
2272
- if (until !== undefined) {
2273
- params = this.omit(params, ['until']);
2274
- request['end_time'] = this.iso8601(until);
2275
- }
2276
- params = this.omit(params, ['trader_id', 'traderId']);
2277
- const response = await this.privateGetV1AccountsTraderIdLedger(this.extend(request, params));
2278
- //
2279
- // {
2280
- // "transactions": [
2281
- // {
2282
- // "transaction_id": "0288634e-49bd-494d-b04a-18fd1832d394",
2283
- // "transaction_type": "XFER",
2284
- // "type": "deposit",
2285
- // "asset": "ETH",
2286
- // "symbol": null,
2287
- // "amount": "0.010000000000000000",
2288
- // "details": null,
2289
- // "created_at": "2023-10-20T13:15:39.443Z"
2290
- // },
2291
- // {
2292
- // "transaction_id": "47a45928-abcd-4c12-8bd6-587c3028025f",
2293
- // "transaction_type": "SWAP",
2294
- // "type": "atomic token swap",
2295
- // "asset": "USDT",
2296
- // "symbol": "ETH-USDT",
2297
- // "amount": "1.447947",
2298
- // "details": null,
2299
- // "created_at": "2023-10-20T13:16:30.373Z"
2300
- // },
2301
- // {
2302
- // "transaction_id": "1ffe3a54-916e-41f0-b957-3a01309eb009",
2303
- // "transaction_type": "FEE",
2304
- // "type": "fee",
2305
- // "asset": "USDT",
2306
- // "symbol": "ETH-USDT",
2307
- // "amount": "-0.006516",
2308
- // "details": {
2309
- // "fee_details": [
2310
- // {
2311
- // "insurance_fee": "0",
2312
- // "order_id": "39911d5f-c789-4a7d-ad34-820a804d1da6",
2313
- // "fee_type": "taker",
2314
- // "fee_currency": "USDT"
2315
- // }
2316
- // ]
2317
- // },
2318
- // "created_at": "2023-10-20T13:16:30.373Z"
2319
- // },
2320
- // {
2321
- // "transaction_id": "3930e8a3-2218-481f-8c3c-2219287e205e",
2322
- // "transaction_type": "SWAP",
2323
- // "type": "atomic token swap",
2324
- // "asset": "ETH",
2325
- // "symbol": "ETH-USDT",
2326
- // "amount": "-0.000900000000000000",
2327
- // "details": null,
2328
- // "created_at": "2023-10-20T13:16:30.373Z"
2329
- // },
2330
- // {
2331
- // "transaction_id": "a6c65cb3-95d0-44e2-8202-f70581d6e55c",
2332
- // "transaction_type": "XFER",
2333
- // "type": "withdrawal",
2334
- // "asset": "USD",
2335
- // "symbol": null,
2336
- // "amount": "-3.00",
2337
- // "details": null,
2338
- // "created_at": "2023-10-26T14:32:24.887Z"
2339
- // }
2340
- // ]
2341
- // }
2342
- //
2343
- const ledger = this.safeValue(response, 'transactions', []);
2344
- return this.parseLedger(ledger, currency, since, limit);
2345
- }
2346
- parseLedgerEntry(item, currency = undefined) {
2347
- //
2348
- // deposit transaction from wallet (funding) to pro (trading)
2349
- // {
2350
- // "transaction_id": "0288634e-49bd-494d-b04a-18fd1832d394",
2351
- // "transaction_type": "XFER",
2352
- // "type": "deposit",
2353
- // "asset": "ETH",
2354
- // "symbol": null,
2355
- // "amount": "0.010000000000000000",
2356
- // "details": null,
2357
- // "created_at": "2023-10-20T13:15:39.443Z"
2358
- // }
2359
- //
2360
- // withdrawal transaction from pro (trading) to wallet (funding)
2361
- // {
2362
- // "transaction_id": "a6c65cb3-95d0-44e2-8202-f70581d6e55c",
2363
- // "transaction_type": "XFER",
2364
- // "type": "withdrawal",
2365
- // "asset": "USD",
2366
- // "symbol": null,
2367
- // "amount": "-3.00",
2368
- // "details": null,
2369
- // "created_at": "2023-10-26T14:32:24.887Z"
2370
- // }
2371
- //
2372
- // sell trade
2373
- // {
2374
- // "transaction_id": "47a45928-abcd-4c12-8bd6-587c3028025f",
2375
- // "transaction_type": "SWAP",
2376
- // "type": "atomic token swap",
2377
- // "asset": "USDT",
2378
- // "symbol": "ETH-USDT",
2379
- // "amount": "1.447947",
2380
- // "details": null,
2381
- // "created_at": "2023-10-20T13:16:30.373Z"
2382
- // }
2383
- //
2384
- // buy trade
2385
- // {
2386
- // "transaction_id": "46d20a93-45c4-4441-a238-f89602eb8c8c",
2387
- // "transaction_type": "SWAP",
2388
- // "type": "atomic token swap",
2389
- // "asset": "ETH",
2390
- // "symbol": "ETH-USDT",
2391
- // "amount": "0.000800000000000000",
2392
- // "details": null,
2393
- // "created_at": "2023-10-20T13:22:14.256Z"
2394
- // },
2395
- //
2396
- // fee
2397
- // {
2398
- // "transaction_id": "57fd526c-36b1-4721-83ce-42aadcb1e953",
2399
- // "transaction_type": "FEE",
2400
- // "type": "fee",
2401
- // "asset": "USDT",
2402
- // "symbol": "BTC-USDT",
2403
- // "amount": "-0.047176",
2404
- // "details": {
2405
- // "fee_details": [
2406
- // {
2407
- // "insurance_fee": "0",
2408
- // "order_id": "c0bc33cd-eeb9-40a0-ab5f-2d99f323ef58",
2409
- // "fee_type": "taker",
2410
- // "fee_currency": "USDT"
2411
- // }
2412
- // ]
2413
- // },
2414
- // "created_at": "2023-10-25T16:46:24.294Z"
2415
- // }
2416
- //
2417
- const id = this.safeString(item, 'transaction_id');
2418
- const createdAt = this.safeString(item, 'created_at');
2419
- const timestamp = this.parse8601(createdAt);
2420
- let amount = this.safeString(item, 'amount');
2421
- const amountIsNegative = Precise.stringLt(amount, '0');
2422
- let direction = undefined;
2423
- if (amountIsNegative) {
2424
- direction = 'out';
2425
- amount = Precise.stringNeg(amount);
2426
- }
2427
- else {
2428
- direction = 'in';
2429
- }
2430
- const currencyId = this.safeString(item, 'asset');
2431
- const code = this.safeCurrencyCode(currencyId, currency);
2432
- currency = this.safeCurrency(currencyId, currency);
2433
- const type = this.parseLedgerEntryType(this.safeString(item, 'type'));
2434
- return this.safeLedgerEntry({
2435
- 'info': item,
2436
- 'id': id,
2437
- 'timestamp': timestamp,
2438
- 'datetime': this.iso8601(timestamp),
2439
- 'direction': direction,
2440
- 'account': 'trading',
2441
- 'referenceId': undefined,
2442
- 'referenceAccount': undefined,
2443
- 'type': type,
2444
- 'currency': code,
2445
- 'amount': this.parseNumber(amount),
2446
- 'before': undefined,
2447
- 'after': undefined,
2448
- 'status': 'ok',
2449
- 'fee': undefined,
2450
- }, currency);
2451
- }
2452
- parseLedgerEntryType(type) {
2453
- const types = {
2454
- 'atomic token swap': 'trade',
2455
- 'fee': 'fee',
2456
- 'deposit': 'transfer',
2457
- 'withdrawal': 'transfer',
2458
- };
2459
- return this.safeString(types, type, type);
2460
- }
2461
- /**
2462
- * @method
2463
- * @name coinlist#fetchFundingRate
2464
- * @description fetch the current funding rate
2465
- * @see https://trade-docs.coinlist.co/#coinlist-pro-api-Funding-Rates
2466
- * @param {string} symbol unified market symbol
2467
- * @param {object} [params] extra parameters specific to the exchange API endpoint
2468
- * @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
2469
- */
2470
- async fetchFundingRate(symbol, params = {}) {
2471
- await this.loadMarkets();
2472
- const market = this.market(symbol);
2473
- if (!market['swap']) {
2474
- throw new BadSymbol(this.id + ' fetchFundingRate() supports swap contracts only');
2475
- }
2476
- const request = {
2477
- 'symbol': market['id'],
2478
- };
2479
- const response = await this.publicGetV1SymbolsSymbolFunding(this.extend(request, params));
2480
- //
2481
- // {
2482
- // "last": {
2483
- // "funding_rate": "-0.00043841",
2484
- // "funding_time": "2025-04-15T04:00:00.000Z"
2485
- // },
2486
- // "next": {
2487
- // "funding_rate": "-0.00046952",
2488
- // "funding_time": "2025-04-15T12:00:00.000Z"
2489
- // },
2490
- // "indicative": {
2491
- // "funding_rate": "-0.00042517",
2492
- // "funding_time": "2025-04-15T20:00:00.000Z"
2493
- // },
2494
- // "timestamp": "2025-04-15T07:01:15.219Z"
2495
- // }
2496
- //
2497
- return this.parseFundingRate(response, market);
2498
- }
2499
- parseFundingRate(contract, market = undefined) {
2500
- //
2501
- // {
2502
- // "last": {
2503
- // "funding_rate": "-0.00043841",
2504
- // "funding_time": "2025-04-15T04:00:00.000Z"
2505
- // },
2506
- // "next": {
2507
- // "funding_rate": "-0.00046952",
2508
- // "funding_time": "2025-04-15T12:00:00.000Z"
2509
- // },
2510
- // "indicative": {
2511
- // "funding_rate": "-0.00042517",
2512
- // "funding_time": "2025-04-15T20:00:00.000Z"
2513
- // },
2514
- // "timestamp": "2025-04-15T07:01:15.219Z"
2515
- // }
2516
- //
2517
- const previous = this.safeDict(contract, 'last', {});
2518
- const current = this.safeDict(contract, 'next', {});
2519
- const next = this.safeDict(contract, 'indicative', {});
2520
- const previousDatetime = this.safeString(previous, 'funding_time');
2521
- const currentDatetime = this.safeString(current, 'funding_time');
2522
- const nextDatetime = this.safeString(next, 'funding_time');
2523
- const datetime = this.safeString(contract, 'timestamp');
2524
- return {
2525
- 'info': contract,
2526
- 'symbol': this.safeSymbol(undefined, market),
2527
- 'markPrice': undefined,
2528
- 'indexPrice': undefined,
2529
- 'interestRate': undefined,
2530
- 'estimatedSettlePrice': undefined,
2531
- 'timestamp': this.parse8601(datetime),
2532
- 'datetime': datetime,
2533
- 'fundingRate': this.safeNumber(current, 'funding_rate'),
2534
- 'fundingTimestamp': this.parse8601(currentDatetime),
2535
- 'fundingDatetime': currentDatetime,
2536
- 'nextFundingRate': this.safeNumber(next, 'funding_rate'),
2537
- 'nextFundingTimestamp': this.parse8601(nextDatetime),
2538
- 'nextFundingDatetime': nextDatetime,
2539
- 'previousFundingRate': this.safeNumber(previous, 'funding_rate'),
2540
- 'previousFundingTimestamp': this.parse8601(previousDatetime),
2541
- 'previousFundingDatetime': previousDatetime,
2542
- 'interval': '8h',
2543
- };
2544
- }
2545
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
2546
- const request = this.omit(params, this.extractParams(path));
2547
- const endpoint = '/' + this.implodeParams(path, params);
2548
- let url = this.urls['api'][api] + endpoint;
2549
- const isBulk = Array.isArray(params);
2550
- let query = undefined;
2551
- if (!isBulk) {
2552
- query = this.urlencode(request);
2553
- }
2554
- if (api === 'private') {
2555
- this.checkRequiredCredentials();
2556
- const timestamp = this.seconds().toString();
2557
- let auth = timestamp + method + endpoint;
2558
- if ((method === 'POST') || (method === 'PATCH') || isBulk) {
2559
- body = this.json(request);
2560
- auth += body;
2561
- }
2562
- else if (query !== undefined && query.length !== 0) {
2563
- auth += '?' + query;
2564
- url += '?' + query;
2565
- }
2566
- const signature = this.hmac(this.encode(auth), this.base64ToBinary(this.secret), sha256, 'base64');
2567
- headers = {
2568
- 'CL-ACCESS-KEY': this.apiKey,
2569
- 'CL-ACCESS-SIG': signature,
2570
- 'CL-ACCESS-TIMESTAMP': timestamp,
2571
- 'Content-Type': 'application/json',
2572
- };
2573
- }
2574
- else if (query !== undefined && query.length !== 0) {
2575
- url += '?' + query;
2576
- }
2577
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
2578
- }
2579
- handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
2580
- if (response === undefined) {
2581
- // In some cases the exchange returns 202 Accepted for bad orders.
2582
- // The body of that response contains order_id of the order.
2583
- // Some bad orders will get status 'rejected' and could be fetched later (by using fetchOrders() or fetchOrder(order_id)).
2584
- // While others don't get any status, they simply disappear, but the response is still 202 Accepted and contains their order_id.
2585
- // When using fechOrder(order_id) for such disappeared orders, the exchange returns an empty response with code 404.
2586
- if ((code === 404) && (url.indexOf('/orders/') >= 0) && (method === 'GET')) {
2587
- const parts = url.split('/orders/');
2588
- const orderId = this.safeString(parts, 1);
2589
- throw new OrderNotFound(this.id + ' order ' + orderId + ' not found (or rejected on the exchange side)');
2590
- }
2591
- return undefined;
2592
- }
2593
- const responseCode = this.safeString(response, 'status');
2594
- const messageCode = this.safeString(response, 'message_code');
2595
- if ((messageCode !== undefined) || ((responseCode !== undefined) && (code !== 200) && (code !== 202) && (responseCode !== '200') && (responseCode !== '202'))) {
2596
- const feedback = this.id + ' ' + body;
2597
- const message = this.safeString(response, 'message');
2598
- this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
2599
- this.throwExactlyMatchedException(this.exceptions['exact'], messageCode, feedback);
2600
- throw new ExchangeError(feedback);
2601
- }
2602
- return undefined;
2603
- }
2604
- }