ccxt 4.5.37 → 4.5.39

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 (497) hide show
  1. package/README.md +5 -7
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/abstract/alp.js +1 -1
  5. package/dist/cjs/src/abstract/alpaca.js +1 -1
  6. package/dist/cjs/src/abstract/apex.js +1 -1
  7. package/dist/cjs/src/abstract/arkham.js +1 -1
  8. package/dist/cjs/src/abstract/ascendex.js +1 -1
  9. package/dist/cjs/src/abstract/aster.js +1 -1
  10. package/dist/cjs/src/abstract/backpack.js +1 -1
  11. package/dist/cjs/src/abstract/bigone.js +1 -1
  12. package/dist/cjs/src/abstract/binance.js +1 -1
  13. package/dist/cjs/src/abstract/bingx.js +1 -1
  14. package/dist/cjs/src/abstract/bit2c.js +1 -1
  15. package/dist/cjs/src/abstract/bitbank.js +1 -1
  16. package/dist/cjs/src/abstract/bitbns.js +1 -1
  17. package/dist/cjs/src/abstract/bitfinex.js +1 -1
  18. package/dist/cjs/src/abstract/bitflyer.js +1 -1
  19. package/dist/cjs/src/abstract/bitget.js +1 -1
  20. package/dist/cjs/src/abstract/bithumb.js +1 -1
  21. package/dist/cjs/src/abstract/bitmart.js +1 -1
  22. package/dist/cjs/src/abstract/bitmex.js +1 -1
  23. package/dist/cjs/src/abstract/bitopro.js +1 -1
  24. package/dist/cjs/src/abstract/bitrue.js +1 -1
  25. package/dist/cjs/src/abstract/bitso.js +1 -1
  26. package/dist/cjs/src/abstract/bitstamp.js +1 -1
  27. package/dist/cjs/src/abstract/bitteam.js +1 -1
  28. package/dist/cjs/src/abstract/bittrade.js +1 -1
  29. package/dist/cjs/src/abstract/bitvavo.js +1 -1
  30. package/dist/cjs/src/abstract/blockchaincom.js +1 -1
  31. package/dist/cjs/src/abstract/blofin.js +1 -1
  32. package/dist/cjs/src/abstract/btcbox.js +1 -1
  33. package/dist/cjs/src/abstract/btcmarkets.js +1 -1
  34. package/dist/cjs/src/abstract/btcturk.js +1 -1
  35. package/dist/cjs/src/abstract/bullish.js +1 -1
  36. package/dist/cjs/src/abstract/bybit.js +1 -1
  37. package/dist/cjs/src/abstract/bydfi.js +1 -1
  38. package/dist/cjs/src/abstract/cex.js +1 -1
  39. package/dist/cjs/src/abstract/coinbase.js +1 -1
  40. package/dist/cjs/src/abstract/coinbaseexchange.js +1 -1
  41. package/dist/cjs/src/abstract/coinbaseinternational.js +1 -1
  42. package/dist/cjs/src/abstract/coincatch.js +1 -1
  43. package/dist/cjs/src/abstract/coincheck.js +1 -1
  44. package/dist/cjs/src/abstract/coinex.js +1 -1
  45. package/dist/cjs/src/abstract/coinmate.js +1 -1
  46. package/dist/cjs/src/abstract/coinmetro.js +1 -1
  47. package/dist/cjs/src/abstract/coinone.js +1 -1
  48. package/dist/cjs/src/abstract/coinsph.js +1 -1
  49. package/dist/cjs/src/abstract/coinspot.js +1 -1
  50. package/dist/cjs/src/abstract/cryptocom.js +1 -1
  51. package/dist/cjs/src/abstract/cryptomus.js +1 -1
  52. package/dist/cjs/src/abstract/deepcoin.js +1 -1
  53. package/dist/cjs/src/abstract/defx.js +1 -1
  54. package/dist/cjs/src/abstract/delta.js +1 -1
  55. package/dist/cjs/src/abstract/deribit.js +1 -1
  56. package/dist/cjs/src/abstract/derive.js +1 -1
  57. package/dist/cjs/src/abstract/digifinex.js +1 -1
  58. package/dist/cjs/src/abstract/dydx.js +1 -1
  59. package/dist/cjs/src/abstract/exmo.js +1 -1
  60. package/dist/cjs/src/abstract/foxbit.js +1 -1
  61. package/dist/cjs/src/abstract/gate.js +1 -1
  62. package/dist/cjs/src/abstract/gemini.js +1 -1
  63. package/dist/cjs/src/abstract/hashkey.js +1 -1
  64. package/dist/cjs/src/abstract/hibachi.js +1 -1
  65. package/dist/cjs/src/abstract/hitbtc.js +1 -1
  66. package/dist/cjs/src/abstract/hollaex.js +1 -1
  67. package/dist/cjs/src/abstract/htx.js +1 -1
  68. package/dist/cjs/src/abstract/hyperliquid.js +1 -1
  69. package/dist/cjs/src/abstract/independentreserve.js +1 -1
  70. package/dist/cjs/src/abstract/indodax.js +1 -1
  71. package/dist/cjs/src/abstract/kraken.js +1 -1
  72. package/dist/cjs/src/abstract/krakenfutures.js +1 -1
  73. package/dist/cjs/src/abstract/kucoin.js +1 -1
  74. package/dist/cjs/src/abstract/kucoinfutures.js +1 -1
  75. package/dist/cjs/src/abstract/latoken.js +1 -1
  76. package/dist/cjs/src/abstract/lbank.js +1 -1
  77. package/dist/cjs/src/abstract/luno.js +1 -1
  78. package/dist/cjs/src/abstract/mercado.js +1 -1
  79. package/dist/cjs/src/abstract/mexc.js +1 -1
  80. package/dist/cjs/src/abstract/modetrade.js +1 -1
  81. package/dist/cjs/src/abstract/ndax.js +1 -1
  82. package/dist/cjs/src/abstract/novadax.js +1 -1
  83. package/dist/cjs/src/abstract/okx.js +1 -1
  84. package/dist/cjs/src/abstract/onetrading.js +1 -1
  85. package/dist/cjs/src/abstract/oxfun.js +1 -1
  86. package/dist/cjs/src/abstract/p2b.js +1 -1
  87. package/dist/cjs/src/abstract/paradex.js +1 -1
  88. package/dist/cjs/src/abstract/paymium.js +1 -1
  89. package/dist/cjs/src/abstract/phemex.js +1 -1
  90. package/dist/cjs/src/abstract/poloniex.js +1 -1
  91. package/dist/cjs/src/abstract/timex.js +1 -1
  92. package/dist/cjs/src/abstract/tokocrypto.js +1 -1
  93. package/dist/cjs/src/abstract/toobit.js +1 -1
  94. package/dist/cjs/src/abstract/upbit.js +1 -1
  95. package/dist/cjs/src/abstract/wavesexchange.js +1 -1
  96. package/dist/cjs/src/abstract/whitebit.js +1 -1
  97. package/dist/cjs/src/abstract/woo.js +1 -1
  98. package/dist/cjs/src/abstract/woofipro.js +1 -1
  99. package/dist/cjs/src/abstract/xt.js +1 -1
  100. package/dist/cjs/src/abstract/yobit.js +1 -1
  101. package/dist/cjs/src/abstract/zaif.js +1 -1
  102. package/dist/cjs/src/abstract/zebpay.js +1 -1
  103. package/dist/cjs/src/abstract/zonda.js +1 -1
  104. package/dist/cjs/src/alp.js +1 -1
  105. package/dist/cjs/src/alpaca.js +1 -1
  106. package/dist/cjs/src/apex.js +1 -1
  107. package/dist/cjs/src/arkham.js +1 -1
  108. package/dist/cjs/src/ascendex.js +1 -1
  109. package/dist/cjs/src/aster.js +1 -1
  110. package/dist/cjs/src/backpack.js +1 -1
  111. package/dist/cjs/src/base/Precise.js +0 -6
  112. package/dist/cjs/src/base/errors.js +0 -6
  113. package/dist/cjs/src/base/functions/crypto.js +1 -1
  114. package/dist/cjs/src/base/functions/encode.js +1 -1
  115. package/dist/cjs/src/base/functions/misc.js +0 -1
  116. package/dist/cjs/src/base/functions/number.js +0 -6
  117. package/dist/cjs/src/base/functions/platform.js +0 -6
  118. package/dist/cjs/src/base/functions/rsa.js +0 -1
  119. package/dist/cjs/src/base/functions/string.js +0 -6
  120. package/dist/cjs/src/base/functions/throttle.js +1 -1
  121. package/dist/cjs/src/base/functions/time.js +0 -6
  122. package/dist/cjs/src/base/functions/totp.js +0 -1
  123. package/dist/cjs/src/base/functions/type.js +0 -6
  124. package/dist/cjs/src/base/functions.js +1 -1
  125. package/dist/cjs/src/base/ws/Cache.js +0 -6
  126. package/dist/cjs/src/base/ws/Client.js +0 -1
  127. package/dist/cjs/src/base/ws/Future.js +1 -1
  128. package/dist/cjs/src/base/ws/OrderBook.js +1 -1
  129. package/dist/cjs/src/base/ws/OrderBookSide.js +0 -6
  130. package/dist/cjs/src/base/ws/WsClient.js +1 -1
  131. package/dist/cjs/src/bequant.js +1 -1
  132. package/dist/cjs/src/bigone.js +1 -1
  133. package/dist/cjs/src/binance.js +10 -3
  134. package/dist/cjs/src/binancecoinm.js +1 -1
  135. package/dist/cjs/src/binanceus.js +1 -1
  136. package/dist/cjs/src/binanceusdm.js +1 -1
  137. package/dist/cjs/src/bingx.js +1 -1
  138. package/dist/cjs/src/bit2c.js +1 -1
  139. package/dist/cjs/src/bitbank.js +1 -1
  140. package/dist/cjs/src/bitbns.js +1 -1
  141. package/dist/cjs/src/bitfinex.js +1 -1
  142. package/dist/cjs/src/bitflyer.js +1 -1
  143. package/dist/cjs/src/bitget.js +48 -2
  144. package/dist/cjs/src/bithumb.js +1 -1
  145. package/dist/cjs/src/bitmart.js +4 -3
  146. package/dist/cjs/src/bitmex.js +20 -4
  147. package/dist/cjs/src/bitopro.js +1 -1
  148. package/dist/cjs/src/bitrue.js +1 -1
  149. package/dist/cjs/src/bitso.js +1 -1
  150. package/dist/cjs/src/bitstamp.js +273 -43
  151. package/dist/cjs/src/bitteam.js +1 -1
  152. package/dist/cjs/src/bittrade.js +1 -1
  153. package/dist/cjs/src/bitvavo.js +10 -0
  154. package/dist/cjs/src/blockchaincom.js +1 -1
  155. package/dist/cjs/src/blofin.js +1 -1
  156. package/dist/cjs/src/btcbox.js +1 -1
  157. package/dist/cjs/src/btcmarkets.js +2 -2
  158. package/dist/cjs/src/btcturk.js +1 -1
  159. package/dist/cjs/src/bullish.js +1 -1
  160. package/dist/cjs/src/bybit.js +2 -2
  161. package/dist/cjs/src/bydfi.js +1 -1
  162. package/dist/cjs/src/cex.js +1 -1
  163. package/dist/cjs/src/coinbaseadvanced.js +1 -1
  164. package/dist/cjs/src/coincatch.js +1 -1
  165. package/dist/cjs/src/coincheck.js +1 -1
  166. package/dist/cjs/src/coinex.js +1 -1
  167. package/dist/cjs/src/coinmate.js +1 -1
  168. package/dist/cjs/src/coinmetro.js +1 -1
  169. package/dist/cjs/src/coinone.js +1 -1
  170. package/dist/cjs/src/coinsph.js +0 -1
  171. package/dist/cjs/src/coinspot.js +78 -8
  172. package/dist/cjs/src/cryptocom.js +1 -1
  173. package/dist/cjs/src/cryptomus.js +1 -1
  174. package/dist/cjs/src/deepcoin.js +1 -1
  175. package/dist/cjs/src/defx.js +1 -1
  176. package/dist/cjs/src/delta.js +1 -1
  177. package/dist/cjs/src/deribit.js +1 -1
  178. package/dist/cjs/src/derive.js +1 -1
  179. package/dist/cjs/src/digifinex.js +1 -1
  180. package/dist/cjs/src/dydx.js +1 -1
  181. package/dist/cjs/src/exmo.js +1 -1
  182. package/dist/cjs/src/fmfwio.js +1 -1
  183. package/dist/cjs/src/foxbit.js +1 -1
  184. package/dist/cjs/src/gate.js +5 -3
  185. package/dist/cjs/src/gateio.js +1 -1
  186. package/dist/cjs/src/gemini.js +1 -1
  187. package/dist/cjs/src/hashkey.js +1 -1
  188. package/dist/cjs/src/hibachi.js +1 -1
  189. package/dist/cjs/src/hitbtc.js +0 -1
  190. package/dist/cjs/src/hollaex.js +1 -1
  191. package/dist/cjs/src/htx.js +1 -1
  192. package/dist/cjs/src/huobi.js +1 -1
  193. package/dist/cjs/src/hyperliquid.js +43 -10
  194. package/dist/cjs/src/independentreserve.js +1 -1
  195. package/dist/cjs/src/indodax.js +1 -1
  196. package/dist/cjs/src/kraken.js +1 -1
  197. package/dist/cjs/src/krakenfutures.js +74 -2
  198. package/dist/cjs/src/kucoin.js +1 -1
  199. package/dist/cjs/src/kucoinfutures.js +1 -1
  200. package/dist/cjs/src/latoken.js +1 -1
  201. package/dist/cjs/src/lbank.js +1 -1
  202. package/dist/cjs/src/luno.js +1 -1
  203. package/dist/cjs/src/mercado.js +1 -1
  204. package/dist/cjs/src/mexc.js +1 -1
  205. package/dist/cjs/src/modetrade.js +1 -1
  206. package/dist/cjs/src/myokx.js +1 -1
  207. package/dist/cjs/src/ndax.js +1 -1
  208. package/dist/cjs/src/novadax.js +1 -1
  209. package/dist/cjs/src/okx.js +1 -1
  210. package/dist/cjs/src/okxus.js +1 -1
  211. package/dist/cjs/src/onetrading.js +1 -1
  212. package/dist/cjs/src/oxfun.js +1 -1
  213. package/dist/cjs/src/p2b.js +1 -1
  214. package/dist/cjs/src/paradex.js +1 -1
  215. package/dist/cjs/src/paymium.js +1 -1
  216. package/dist/cjs/src/poloniex.js +1 -1
  217. package/dist/cjs/src/pro/alpaca.js +1 -1
  218. package/dist/cjs/src/pro/apex.js +1 -1
  219. package/dist/cjs/src/pro/arkham.js +1 -1
  220. package/dist/cjs/src/pro/ascendex.js +1 -1
  221. package/dist/cjs/src/pro/aster.js +12 -3
  222. package/dist/cjs/src/pro/backpack.js +1 -1
  223. package/dist/cjs/src/pro/bequant.js +1 -1
  224. package/dist/cjs/src/pro/binance.js +115 -28
  225. package/dist/cjs/src/pro/binancecoinm.js +1 -1
  226. package/dist/cjs/src/pro/binanceus.js +1 -1
  227. package/dist/cjs/src/pro/binanceusdm.js +1 -1
  228. package/dist/cjs/src/pro/bingx.js +1 -1
  229. package/dist/cjs/src/pro/bitfinex.js +1 -1
  230. package/dist/cjs/src/pro/bitget.js +1 -1
  231. package/dist/cjs/src/pro/bithumb.js +1 -1
  232. package/dist/cjs/src/pro/bitmart.js +1 -1
  233. package/dist/cjs/src/pro/bitmex.js +3 -2
  234. package/dist/cjs/src/pro/bitrue.js +1 -1
  235. package/dist/cjs/src/pro/bitstamp.js +1 -1
  236. package/dist/cjs/src/pro/bitvavo.js +1 -1
  237. package/dist/cjs/src/pro/blockchaincom.js +1 -1
  238. package/dist/cjs/src/pro/blofin.js +1 -1
  239. package/dist/cjs/src/pro/bullish.js +1 -1
  240. package/dist/cjs/src/pro/bybit.js +7 -5
  241. package/dist/cjs/src/pro/bydfi.js +1 -1
  242. package/dist/cjs/src/pro/cex.js +1 -1
  243. package/dist/cjs/src/pro/coinbase.js +1 -1
  244. package/dist/cjs/src/pro/coinbaseadvanced.js +1 -1
  245. package/dist/cjs/src/pro/coinbaseexchange.js +1 -1
  246. package/dist/cjs/src/pro/coinbaseinternational.js +1 -1
  247. package/dist/cjs/src/pro/coincatch.js +1 -1
  248. package/dist/cjs/src/pro/coincheck.js +1 -1
  249. package/dist/cjs/src/pro/coinex.js +1 -1
  250. package/dist/cjs/src/pro/coinone.js +1 -1
  251. package/dist/cjs/src/pro/cryptocom.js +1 -1
  252. package/dist/cjs/src/pro/deepcoin.js +1 -1
  253. package/dist/cjs/src/pro/defx.js +1 -1
  254. package/dist/cjs/src/pro/deribit.js +1 -1
  255. package/dist/cjs/src/pro/dydx.js +1 -1
  256. package/dist/cjs/src/pro/exmo.js +1 -1
  257. package/dist/cjs/src/pro/gate.js +3 -2
  258. package/dist/cjs/src/pro/gateio.js +1 -1
  259. package/dist/cjs/src/pro/gemini.js +1 -1
  260. package/dist/cjs/src/pro/hashkey.js +1 -1
  261. package/dist/cjs/src/pro/hitbtc.js +1 -1
  262. package/dist/cjs/src/pro/hollaex.js +1 -1
  263. package/dist/cjs/src/pro/htx.js +1 -1
  264. package/dist/cjs/src/pro/huobi.js +1 -1
  265. package/dist/cjs/src/pro/hyperliquid.js +1 -1
  266. package/dist/cjs/src/pro/independentreserve.js +1 -1
  267. package/dist/cjs/src/pro/kraken.js +1 -1
  268. package/dist/cjs/src/pro/krakenfutures.js +1 -1
  269. package/dist/cjs/src/pro/kucoin.js +1 -1
  270. package/dist/cjs/src/pro/kucoinfutures.js +1 -1
  271. package/dist/cjs/src/pro/lbank.js +0 -1
  272. package/dist/cjs/src/pro/luno.js +1 -1
  273. package/dist/cjs/src/pro/mexc.js +1 -1
  274. package/dist/cjs/src/pro/myokx.js +1 -1
  275. package/dist/cjs/src/pro/ndax.js +1 -1
  276. package/dist/cjs/src/pro/okx.js +6 -4
  277. package/dist/cjs/src/pro/okxus.js +1 -1
  278. package/dist/cjs/src/pro/onetrading.js +1 -1
  279. package/dist/cjs/src/pro/oxfun.js +1 -1
  280. package/dist/cjs/src/pro/p2b.js +1 -1
  281. package/dist/cjs/src/pro/paradex.js +1 -1
  282. package/dist/cjs/src/pro/phemex.js +1 -1
  283. package/dist/cjs/src/pro/poloniex.js +1 -1
  284. package/dist/cjs/src/pro/toobit.js +1 -1
  285. package/dist/cjs/src/pro/upbit.js +1 -1
  286. package/dist/cjs/src/pro/whitebit.js +1 -1
  287. package/dist/cjs/src/pro/xt.js +1 -1
  288. package/dist/cjs/src/protobuf/mexc/compiled.cjs.js +1 -0
  289. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/base/v1beta1/coin.js +0 -1
  290. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/multisig/v1beta1/multisig.js +0 -1
  291. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/crypto/secp256k1/keys.js +0 -1
  292. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/signing/v1beta1/signing.js +0 -1
  293. package/dist/cjs/src/static_dependencies/dydx-v4-client/cosmos/tx/v1beta1/tx.js +0 -1
  294. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/accountplus/tx.js +0 -1
  295. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/clob_pair.js +0 -1
  296. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order.js +0 -1
  297. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/order_removals.js +0 -1
  298. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/clob/tx.js +0 -1
  299. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/transfer.js +0 -1
  300. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/sending/tx.js +0 -1
  301. package/dist/cjs/src/static_dependencies/dydx-v4-client/dydxprotocol/subaccounts/subaccount.js +0 -1
  302. package/dist/cjs/src/static_dependencies/dydx-v4-client/google/protobuf/any.js +0 -1
  303. package/dist/cjs/src/static_dependencies/dydx-v4-client/helpers.js +0 -6
  304. package/dist/cjs/src/static_dependencies/dydx-v4-client/onboarding.js +0 -1
  305. package/dist/cjs/src/static_dependencies/dydx-v4-client/registry.js +0 -1
  306. package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +0 -6
  307. package/dist/cjs/src/static_dependencies/ethers/address/address.js +1 -1
  308. package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +0 -6
  309. package/dist/cjs/src/static_dependencies/ethers/coders/address.js +0 -1
  310. package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +0 -1
  311. package/dist/cjs/src/static_dependencies/ethers/coders/array.js +0 -1
  312. package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +0 -1
  313. package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +0 -1
  314. package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +0 -1
  315. package/dist/cjs/src/static_dependencies/ethers/coders/null.js +0 -1
  316. package/dist/cjs/src/static_dependencies/ethers/coders/number.js +0 -1
  317. package/dist/cjs/src/static_dependencies/ethers/coders/string.js +0 -1
  318. package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +0 -1
  319. package/dist/cjs/src/static_dependencies/ethers/fragments.js +0 -6
  320. package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +0 -6
  321. package/dist/cjs/src/static_dependencies/ethers/index.js +10 -1
  322. package/dist/cjs/src/static_dependencies/ethers/interface.js +0 -6
  323. package/dist/cjs/src/static_dependencies/ethers/typed.js +0 -6
  324. package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +13 -1
  325. package/dist/cjs/src/static_dependencies/ethers/utils/data.js +6 -1
  326. package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +9 -1
  327. package/dist/cjs/src/static_dependencies/ethers/utils/events.js +0 -6
  328. package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +0 -6
  329. package/dist/cjs/src/static_dependencies/ethers/utils/index.js +7 -1
  330. package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +5 -1
  331. package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +0 -6
  332. package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +8 -1
  333. package/dist/cjs/src/static_dependencies/fflake/browser.js +1 -1
  334. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncrypt.js +0 -1
  335. package/dist/cjs/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +0 -1
  336. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +1 -1
  337. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +0 -6
  338. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +0 -6
  339. package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +0 -6
  340. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +0 -1
  341. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +1 -1
  342. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +0 -6
  343. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +1 -1
  344. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +1 -1
  345. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/util.js +0 -6
  346. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +1 -1
  347. package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +0 -6
  348. package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +0 -6
  349. package/dist/cjs/src/static_dependencies/noble-curves/_shortw_utils.js +1 -1
  350. package/dist/cjs/src/static_dependencies/noble-curves/abstract/curve.js +1 -1
  351. package/dist/cjs/src/static_dependencies/noble-curves/abstract/edwards.js +1 -1
  352. package/dist/cjs/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +0 -1
  353. package/dist/cjs/src/static_dependencies/noble-curves/abstract/modular.js +1 -1
  354. package/dist/cjs/src/static_dependencies/noble-curves/abstract/montgomery.js +1 -1
  355. package/dist/cjs/src/static_dependencies/noble-curves/abstract/poseidon.js +1 -1
  356. package/dist/cjs/src/static_dependencies/noble-curves/abstract/utils.js +0 -6
  357. package/dist/cjs/src/static_dependencies/noble-curves/abstract/weierstrass.js +1 -1
  358. package/dist/cjs/src/static_dependencies/noble-curves/ed25519.js +1 -1
  359. package/dist/cjs/src/static_dependencies/noble-curves/p256.js +1 -1
  360. package/dist/cjs/src/static_dependencies/noble-curves/secp256k1.js +1 -1
  361. package/dist/cjs/src/static_dependencies/noble-hashes/_assert.js +0 -6
  362. package/dist/cjs/src/static_dependencies/noble-hashes/_sha2.js +0 -1
  363. package/dist/cjs/src/static_dependencies/noble-hashes/_u64.js +0 -6
  364. package/dist/cjs/src/static_dependencies/noble-hashes/crypto.js +0 -6
  365. package/dist/cjs/src/static_dependencies/noble-hashes/hmac.js +0 -1
  366. package/dist/cjs/src/static_dependencies/noble-hashes/md5.js +0 -1
  367. package/dist/cjs/src/static_dependencies/noble-hashes/pbkdf2.js +0 -1
  368. package/dist/cjs/src/static_dependencies/noble-hashes/ripemd160.js +0 -1
  369. package/dist/cjs/src/static_dependencies/noble-hashes/sha1.js +0 -1
  370. package/dist/cjs/src/static_dependencies/noble-hashes/sha256.js +0 -1
  371. package/dist/cjs/src/static_dependencies/noble-hashes/sha3.js +0 -1
  372. package/dist/cjs/src/static_dependencies/noble-hashes/sha512.js +0 -1
  373. package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +1 -1
  374. package/dist/cjs/src/static_dependencies/node-fetch/body.js +5 -1
  375. package/dist/cjs/src/static_dependencies/node-fetch/errors/abort-error.js +0 -1
  376. package/dist/cjs/src/static_dependencies/node-fetch/errors/base.js +0 -6
  377. package/dist/cjs/src/static_dependencies/node-fetch/errors/fetch-error.js +0 -1
  378. package/dist/cjs/src/static_dependencies/node-fetch/headers.js +5 -1
  379. package/dist/cjs/src/static_dependencies/node-fetch/index.js +7 -1
  380. package/dist/cjs/src/static_dependencies/node-fetch/request.js +7 -1
  381. package/dist/cjs/src/static_dependencies/node-fetch/response.js +5 -1
  382. package/dist/cjs/src/static_dependencies/node-fetch/utils/get-search.js +0 -6
  383. package/dist/cjs/src/static_dependencies/node-fetch/utils/is-redirect.js +0 -6
  384. package/dist/cjs/src/static_dependencies/node-fetch/utils/is.js +0 -6
  385. package/dist/cjs/src/static_dependencies/node-fetch/utils/referrer.js +0 -1
  386. package/dist/cjs/src/static_dependencies/proxies/agent-base/index.js +0 -1
  387. package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +0 -1
  388. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +0 -1
  389. package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +0 -6
  390. package/dist/cjs/src/static_dependencies/qs/formats.js +0 -6
  391. package/dist/cjs/src/static_dependencies/qs/index.js +0 -1
  392. package/dist/cjs/src/static_dependencies/qs/parse.js +0 -1
  393. package/dist/cjs/src/static_dependencies/qs/stringify.js +0 -1
  394. package/dist/cjs/src/static_dependencies/qs/utils.js +0 -6
  395. package/dist/cjs/src/static_dependencies/scure-base/index.js +0 -6
  396. package/dist/cjs/src/static_dependencies/scure-bip32/index.js +19 -1
  397. package/dist/cjs/src/static_dependencies/scure-bip39/index.js +1 -1
  398. package/dist/cjs/src/static_dependencies/scure-bip39/wordlists/english.js +0 -6
  399. package/dist/cjs/src/static_dependencies/scure-starknet/index.js +1 -1
  400. package/dist/cjs/src/static_dependencies/starknet/constants.js +1 -1
  401. package/dist/cjs/src/static_dependencies/starknet/types/calldata.js +0 -6
  402. package/dist/cjs/src/static_dependencies/starknet/types/lib/contract/abi.js +0 -6
  403. package/dist/cjs/src/static_dependencies/starknet/types/lib/contract/index.js +0 -6
  404. package/dist/cjs/src/static_dependencies/starknet/types/lib/index.js +0 -6
  405. package/dist/cjs/src/static_dependencies/starknet/types/typedData.js +0 -6
  406. package/dist/cjs/src/static_dependencies/starknet/utils/assert.js +0 -6
  407. package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/felt.js +1 -1
  408. package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/uint256.js +1 -1
  409. package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/uint512.js +1 -1
  410. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/byteArray.js +0 -1
  411. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/cairo.js +0 -1
  412. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoCustomEnum.js +0 -6
  413. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoOption.js +0 -6
  414. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoResult.js +0 -6
  415. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/formatter.js +0 -1
  416. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/index.js +1 -1
  417. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/index.js +0 -1
  418. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/parser-0-1.1.0.js +0 -1
  419. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/parser-2.0.0.js +0 -6
  420. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/propertyOrder.js +0 -1
  421. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/requestParser.js +0 -1
  422. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/responseParser.js +0 -1
  423. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/tuple.js +1 -1
  424. package/dist/cjs/src/static_dependencies/starknet/utils/calldata/validate.js +4 -1
  425. package/dist/cjs/src/static_dependencies/starknet/utils/encode.js +0 -1
  426. package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +3 -1
  427. package/dist/cjs/src/static_dependencies/starknet/utils/merkle.js +0 -1
  428. package/dist/cjs/src/static_dependencies/starknet/utils/num.js +0 -1
  429. package/dist/cjs/src/static_dependencies/starknet/utils/selector.js +0 -1
  430. package/dist/cjs/src/static_dependencies/starknet/utils/shortString.js +0 -1
  431. package/dist/cjs/src/static_dependencies/starknet/utils/typedData.js +1 -1
  432. package/dist/cjs/src/static_dependencies/watchable/src/unpromise.js +0 -6
  433. package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +0 -6
  434. package/dist/cjs/src/timex.js +0 -1
  435. package/dist/cjs/src/tokocrypto.js +24 -1
  436. package/dist/cjs/src/toobit.js +21 -1
  437. package/dist/cjs/src/upbit.js +1 -1
  438. package/dist/cjs/src/wavesexchange.js +1 -1
  439. package/dist/cjs/src/whitebit.js +25 -14
  440. package/dist/cjs/src/woo.js +1 -1
  441. package/dist/cjs/src/woofipro.js +1 -1
  442. package/dist/cjs/src/xt.js +1 -1
  443. package/dist/cjs/src/yobit.js +1 -1
  444. package/dist/cjs/src/zaif.js +1 -1
  445. package/dist/cjs/src/zebpay.js +1 -1
  446. package/dist/cjs/src/zonda.js +1 -1
  447. package/js/ccxt.d.ts +2 -8
  448. package/js/ccxt.js +2 -6
  449. package/js/src/abstract/binance.d.ts +5 -0
  450. package/js/src/abstract/binancecoinm.d.ts +5 -0
  451. package/js/src/abstract/binanceus.d.ts +5 -0
  452. package/js/src/abstract/binanceusdm.d.ts +5 -0
  453. package/js/src/abstract/bitget.d.ts +47 -1
  454. package/js/src/abstract/bitstamp.d.ts +8 -0
  455. package/js/src/abstract/bitvavo.d.ts +10 -0
  456. package/js/src/abstract/coinspot.d.ts +45 -0
  457. package/js/src/base/Exchange.d.ts +2 -2
  458. package/js/src/binance.js +9 -2
  459. package/js/src/bitget.js +47 -1
  460. package/js/src/bitmart.js +3 -2
  461. package/js/src/bitmex.js +19 -3
  462. package/js/src/bitstamp.d.ts +52 -1
  463. package/js/src/bitstamp.js +272 -42
  464. package/js/src/bitvavo.js +10 -0
  465. package/js/src/btcmarkets.js +1 -1
  466. package/js/src/bybit.js +1 -1
  467. package/js/src/coinbaseexchange.d.ts +1 -1
  468. package/js/src/coinspot.js +77 -7
  469. package/js/src/gate.js +4 -2
  470. package/js/src/hyperliquid.js +42 -9
  471. package/js/src/krakenfutures.js +73 -1
  472. package/js/src/pro/aster.js +11 -2
  473. package/js/src/pro/binance.d.ts +13 -0
  474. package/js/src/pro/binance.js +115 -28
  475. package/js/src/pro/bitmex.js +2 -1
  476. package/js/src/pro/bybit.d.ts +1 -1
  477. package/js/src/pro/bybit.js +6 -4
  478. package/js/src/pro/gate.js +2 -1
  479. package/js/src/pro/okx.js +5 -3
  480. package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
  481. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  482. package/js/src/static_dependencies/noble-curves/abstract/weierstrass.d.ts +0 -1
  483. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
  484. package/js/src/tokocrypto.js +23 -0
  485. package/js/src/toobit.js +20 -0
  486. package/js/src/whitebit.d.ts +1 -0
  487. package/js/src/whitebit.js +21 -11
  488. package/package.json +1 -1
  489. package/dist/cjs/src/abstract/probit.js +0 -11
  490. package/dist/cjs/src/pro/probit.js +0 -594
  491. package/dist/cjs/src/probit.js +0 -1936
  492. package/js/src/abstract/probit.d.ts +0 -26
  493. package/js/src/abstract/probit.js +0 -5
  494. package/js/src/pro/probit.d.ts +0 -91
  495. package/js/src/pro/probit.js +0 -587
  496. package/js/src/probit.d.ts +0 -283
  497. package/js/src/probit.js +0 -1929
package/js/src/probit.js DELETED
@@ -1,1929 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- import Exchange from './abstract/probit.js';
3
- import { ExchangeError, ExchangeNotAvailable, BadResponse, BadRequest, InvalidOrder, InsufficientFunds, AuthenticationError, InvalidAddress, RateLimitExceeded, DDoSProtection, BadSymbol, MarketClosed, ArgumentsRequired } from './base/errors.js';
4
- import { Precise } from './base/Precise.js';
5
- import { TRUNCATE, TICK_SIZE } from './base/functions/number.js';
6
- // ---------------------------------------------------------------------------
7
- /**
8
- * @class probit
9
- * @augments Exchange
10
- */
11
- export default class probit extends Exchange {
12
- describe() {
13
- return this.deepExtend(super.describe(), {
14
- 'id': 'probit',
15
- 'name': 'ProBit',
16
- 'countries': ['SC', 'KR'],
17
- 'rateLimit': 50,
18
- 'pro': true,
19
- 'has': {
20
- 'CORS': true,
21
- 'spot': true,
22
- 'margin': false,
23
- 'swap': false,
24
- 'future': false,
25
- 'option': false,
26
- 'addMargin': false,
27
- 'borrowCrossMargin': false,
28
- 'borrowIsolatedMargin': false,
29
- 'borrowMargin': false,
30
- 'cancelOrder': true,
31
- 'closeAllPositions': false,
32
- 'closePosition': false,
33
- 'createMarketBuyOrderWithCost': true,
34
- 'createMarketOrder': true,
35
- 'createMarketOrderWithCost': false,
36
- 'createMarketSellOrderWithCost': false,
37
- 'createOrder': true,
38
- 'createReduceOnlyOrder': false,
39
- 'createStopLimitOrder': false,
40
- 'createStopMarketOrder': false,
41
- 'createStopOrder': false,
42
- 'fetchAllGreeks': false,
43
- 'fetchBalance': true,
44
- 'fetchBorrowInterest': false,
45
- 'fetchBorrowRate': false,
46
- 'fetchBorrowRateHistories': false,
47
- 'fetchBorrowRateHistory': false,
48
- 'fetchBorrowRates': false,
49
- 'fetchBorrowRatesPerSymbol': false,
50
- 'fetchClosedOrders': true,
51
- 'fetchCrossBorrowRate': false,
52
- 'fetchCrossBorrowRates': false,
53
- 'fetchCurrencies': true,
54
- 'fetchDepositAddress': true,
55
- 'fetchDepositAddresses': true,
56
- 'fetchDepositAddressesByNetwork': false,
57
- 'fetchDeposits': true,
58
- 'fetchDepositsWithdrawals': true,
59
- 'fetchFundingHistory': false,
60
- 'fetchFundingInterval': false,
61
- 'fetchFundingIntervals': false,
62
- 'fetchFundingRate': false,
63
- 'fetchFundingRateHistory': false,
64
- 'fetchFundingRates': false,
65
- 'fetchGreeks': false,
66
- 'fetchIndexOHLCV': false,
67
- 'fetchIsolatedBorrowRate': false,
68
- 'fetchIsolatedBorrowRates': false,
69
- 'fetchIsolatedPositions': false,
70
- 'fetchLeverage': false,
71
- 'fetchLeverages': false,
72
- 'fetchLeverageTiers': false,
73
- 'fetchLiquidations': false,
74
- 'fetchLongShortRatio': false,
75
- 'fetchLongShortRatioHistory': false,
76
- 'fetchMarginAdjustmentHistory': false,
77
- 'fetchMarginMode': false,
78
- 'fetchMarginModes': false,
79
- 'fetchMarketLeverageTiers': false,
80
- 'fetchMarkets': true,
81
- 'fetchMarkOHLCV': false,
82
- 'fetchMarkPrice': false,
83
- 'fetchMarkPrices': false,
84
- 'fetchMyLiquidations': false,
85
- 'fetchMySettlementHistory': false,
86
- 'fetchMyTrades': true,
87
- 'fetchOHLCV': true,
88
- 'fetchOpenInterest': false,
89
- 'fetchOpenInterestHistory': false,
90
- 'fetchOpenInterests': false,
91
- 'fetchOpenOrders': true,
92
- 'fetchOption': false,
93
- 'fetchOptionChain': false,
94
- 'fetchOrder': true,
95
- 'fetchOrderBook': true,
96
- 'fetchPosition': false,
97
- 'fetchPositionHistory': false,
98
- 'fetchPositionMode': false,
99
- 'fetchPositions': false,
100
- 'fetchPositionsForSymbol': false,
101
- 'fetchPositionsHistory': false,
102
- 'fetchPositionsRisk': false,
103
- 'fetchPremiumIndexOHLCV': false,
104
- 'fetchSettlementHistory': false,
105
- 'fetchTicker': true,
106
- 'fetchTickers': true,
107
- 'fetchTime': true,
108
- 'fetchTrades': true,
109
- 'fetchTradingFee': false,
110
- 'fetchTradingFees': false,
111
- 'fetchTransactions': 'emulated',
112
- 'fetchTransfer': false,
113
- 'fetchTransfers': false,
114
- 'fetchUnderlyingAssets': false,
115
- 'fetchVolatilityHistory': false,
116
- 'fetchWithdrawal': false,
117
- 'fetchWithdrawals': true,
118
- 'reduceMargin': false,
119
- 'repayCrossMargin': false,
120
- 'repayIsolatedMargin': false,
121
- 'sandbox': false,
122
- 'setLeverage': false,
123
- 'setMargin': false,
124
- 'setMarginMode': false,
125
- 'setPositionMode': false,
126
- 'signIn': true,
127
- 'transfer': false,
128
- 'withdraw': true,
129
- },
130
- 'timeframes': {
131
- '1m': '1m',
132
- '3m': '3m',
133
- '5m': '5m',
134
- '10m': '10m',
135
- '15m': '15m',
136
- '30m': '30m',
137
- '1h': '1h',
138
- '4h': '4h',
139
- '6h': '6h',
140
- '12h': '12h',
141
- '1d': '1D',
142
- '1w': '1W',
143
- '1M': '1M',
144
- },
145
- 'version': 'v1',
146
- 'urls': {
147
- 'logo': 'https://user-images.githubusercontent.com/51840849/79268032-c4379480-7ea2-11ea-80b3-dd96bb29fd0d.jpg',
148
- 'api': {
149
- 'accounts': 'https://accounts.probit.com',
150
- 'public': 'https://api.probit.com/api/exchange',
151
- 'private': 'https://api.probit.com/api/exchange',
152
- },
153
- 'www': 'https://www.probit.com',
154
- 'doc': [
155
- 'https://docs-en.probit.com',
156
- 'https://docs-ko.probit.com',
157
- ],
158
- 'fees': 'https://support.probit.com/hc/en-us/articles/360020968611-Trading-Fees',
159
- 'referral': 'https://www.probit.com/r/34608773',
160
- },
161
- 'api': {
162
- 'public': {
163
- 'get': {
164
- 'market': 1,
165
- 'currency': 1,
166
- 'currency_with_platform': 1,
167
- 'time': 1,
168
- 'ticker': 1,
169
- 'order_book': 1,
170
- 'trade': 1,
171
- 'candle': 1,
172
- },
173
- },
174
- 'private': {
175
- 'post': {
176
- 'new_order': 2,
177
- 'cancel_order': 1,
178
- 'withdrawal': 2,
179
- },
180
- 'get': {
181
- 'balance': 1,
182
- 'order': 1,
183
- 'open_order': 1,
184
- 'order_history': 1,
185
- 'trade_history': 1,
186
- 'deposit_address': 1,
187
- 'transfer/payment': 1,
188
- },
189
- },
190
- 'accounts': {
191
- 'post': {
192
- 'token': 1,
193
- },
194
- },
195
- },
196
- 'fees': {
197
- 'trading': {
198
- 'tierBased': false,
199
- 'percentage': true,
200
- 'maker': this.parseNumber('0.002'),
201
- 'taker': this.parseNumber('0.002'),
202
- },
203
- },
204
- 'features': {
205
- 'spot': {
206
- 'sandbox': false,
207
- 'createOrder': {
208
- 'marginMode': false,
209
- 'triggerPrice': false,
210
- 'triggerDirection': false,
211
- 'triggerPriceType': undefined,
212
- 'stopLossPrice': false,
213
- 'takeProfitPrice': false,
214
- 'attachedStopLossTakeProfit': undefined,
215
- // todo
216
- 'timeInForce': {
217
- 'IOC': true,
218
- 'FOK': true,
219
- 'PO': false,
220
- 'GTD': false,
221
- },
222
- 'hedged': false,
223
- 'trailing': false,
224
- 'leverage': false,
225
- 'marketBuyByCost': true,
226
- 'marketBuyRequiresPrice': false,
227
- 'selfTradePrevention': false,
228
- 'iceberg': false,
229
- },
230
- 'createOrders': undefined,
231
- 'fetchMyTrades': {
232
- 'marginMode': false,
233
- 'limit': 1000,
234
- 'daysBack': 100000,
235
- 'untilDays': 100000,
236
- 'symbolRequired': false,
237
- },
238
- 'fetchOrder': {
239
- 'marginMode': false,
240
- 'trigger': false,
241
- 'trailing': false,
242
- 'symbolRequired': true,
243
- },
244
- 'fetchOpenOrders': {
245
- 'marginMode': false,
246
- 'limit': undefined,
247
- 'trigger': false,
248
- 'trailing': false,
249
- 'symbolRequired': false,
250
- },
251
- 'fetchOrders': undefined,
252
- 'fetchClosedOrders': {
253
- 'marginMode': false,
254
- 'limit': 1000,
255
- 'daysBack': 100000,
256
- 'daysBackCanceled': 1,
257
- 'untilDays': 90,
258
- 'trigger': false,
259
- 'trailing': false,
260
- 'symbolRequired': false,
261
- },
262
- 'fetchOHLCV': {
263
- 'limit': 4000,
264
- },
265
- },
266
- 'swap': {
267
- 'linear': undefined,
268
- 'inverse': undefined,
269
- },
270
- 'future': {
271
- 'linear': undefined,
272
- 'inverse': undefined,
273
- },
274
- },
275
- 'exceptions': {
276
- 'exact': {
277
- 'UNAUTHORIZED': AuthenticationError,
278
- 'INVALID_ARGUMENT': BadRequest,
279
- 'TRADING_UNAVAILABLE': ExchangeNotAvailable,
280
- 'NOT_ENOUGH_BALANCE': InsufficientFunds,
281
- 'NOT_ALLOWED_COMBINATION': BadRequest,
282
- 'INVALID_ORDER': InvalidOrder,
283
- 'RATE_LIMIT_EXCEEDED': RateLimitExceeded,
284
- 'MARKET_UNAVAILABLE': ExchangeNotAvailable,
285
- 'INVALID_MARKET': BadSymbol,
286
- 'MARKET_CLOSED': MarketClosed,
287
- 'MARKET_NOT_FOUND': BadSymbol,
288
- 'INVALID_CURRENCY': BadRequest,
289
- 'TOO_MANY_OPEN_ORDERS': DDoSProtection,
290
- 'DUPLICATE_ADDRESS': InvalidAddress,
291
- 'invalid_grant': AuthenticationError, // {"error":"invalid_grant"}
292
- },
293
- },
294
- 'requiredCredentials': {
295
- 'apiKey': true,
296
- 'secret': true,
297
- },
298
- 'precisionMode': TICK_SIZE,
299
- 'options': {
300
- 'createMarketBuyOrderRequiresPrice': true,
301
- 'timeInForce': {
302
- 'limit': 'gtc',
303
- 'market': 'ioc',
304
- },
305
- 'networks': {
306
- 'BEP20': 'BSC',
307
- 'ERC20': 'ETH',
308
- 'TRC20': 'TRON',
309
- },
310
- },
311
- 'commonCurrencies': {
312
- 'BB': 'Baby Bali',
313
- 'CBC': 'CryptoBharatCoin',
314
- 'CTK': 'Cryptyk',
315
- 'CTT': 'Castweet',
316
- 'DKT': 'DAKOTA',
317
- 'EGC': 'EcoG9coin',
318
- 'EPS': 'Epanus',
319
- 'FX': 'Fanzy',
320
- 'GM': 'GM Holding',
321
- 'GOGOL': 'GOL',
322
- 'GOL': 'Goldofir',
323
- 'HUSL': 'The Hustle App',
324
- 'LAND': 'Landbox',
325
- 'SST': 'SocialSwap',
326
- 'TCT': 'Top Coin Token',
327
- 'TOR': 'Torex',
328
- 'UNI': 'UNICORN Token',
329
- 'UNISWAP': 'UNI',
330
- },
331
- });
332
- }
333
- /**
334
- * @method
335
- * @name probit#fetchMarkets
336
- * @see https://docs-en.probit.com/reference/market
337
- * @description retrieves data on all markets for probit
338
- * @param {object} [params] extra parameters specific to the exchange API endpoint
339
- * @returns {object[]} an array of objects representing market data
340
- */
341
- async fetchMarkets(params = {}) {
342
- const response = await this.publicGetMarket(params);
343
- //
344
- // {
345
- // "data":[
346
- // {
347
- // "id":"MONA-USDT",
348
- // "base_currency_id":"MONA",
349
- // "quote_currency_id":"USDT",
350
- // "min_price":"0.001",
351
- // "max_price":"9999999999999999",
352
- // "price_increment":"0.001",
353
- // "min_quantity":"0.0001",
354
- // "max_quantity":"9999999999999999",
355
- // "quantity_precision":4,
356
- // "min_cost":"1",
357
- // "max_cost":"9999999999999999",
358
- // "cost_precision":8,
359
- // "taker_fee_rate":"0.2",
360
- // "maker_fee_rate":"0.2",
361
- // "show_in_ui":true,
362
- // "closed":false
363
- // },
364
- // ]
365
- // }
366
- //
367
- const markets = this.safeValue(response, 'data', []);
368
- return this.parseMarkets(markets);
369
- }
370
- parseMarket(market) {
371
- const id = this.safeString(market, 'id');
372
- const baseId = this.safeString(market, 'base_currency_id');
373
- const quoteId = this.safeString(market, 'quote_currency_id');
374
- const base = this.safeCurrencyCode(baseId);
375
- const quote = this.safeCurrencyCode(quoteId);
376
- const closed = this.safeBool(market, 'closed', false);
377
- const showInUI = this.safeBool(market, 'show_in_ui', true);
378
- const active = !closed && showInUI;
379
- const takerFeeRate = this.safeString(market, 'taker_fee_rate');
380
- const taker = Precise.stringDiv(takerFeeRate, '100');
381
- const makerFeeRate = this.safeString(market, 'maker_fee_rate');
382
- const maker = Precise.stringDiv(makerFeeRate, '100');
383
- return {
384
- 'id': id,
385
- 'symbol': base + '/' + quote,
386
- 'base': base,
387
- 'quote': quote,
388
- 'settle': undefined,
389
- 'baseId': baseId,
390
- 'quoteId': quoteId,
391
- 'settleId': undefined,
392
- 'type': 'spot',
393
- 'spot': true,
394
- 'margin': false,
395
- 'swap': false,
396
- 'future': false,
397
- 'option': false,
398
- 'active': active,
399
- 'contract': false,
400
- 'linear': undefined,
401
- 'inverse': undefined,
402
- 'taker': this.parseNumber(taker),
403
- 'maker': this.parseNumber(maker),
404
- 'contractSize': undefined,
405
- 'expiry': undefined,
406
- 'expiryDatetime': undefined,
407
- 'strike': undefined,
408
- 'optionType': undefined,
409
- 'precision': {
410
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantity_precision'))),
411
- 'price': this.safeNumber(market, 'price_increment'),
412
- 'cost': this.parseNumber(this.parsePrecision(this.safeString(market, 'cost_precision'))),
413
- },
414
- 'limits': {
415
- 'leverage': {
416
- 'min': undefined,
417
- 'max': undefined,
418
- },
419
- 'amount': {
420
- 'min': this.safeNumber(market, 'min_quantity'),
421
- 'max': this.safeNumber(market, 'max_quantity'),
422
- },
423
- 'price': {
424
- 'min': this.safeNumber(market, 'min_price'),
425
- 'max': this.safeNumber(market, 'max_price'),
426
- },
427
- 'cost': {
428
- 'min': this.safeNumber(market, 'min_cost'),
429
- 'max': this.safeNumber(market, 'max_cost'),
430
- },
431
- },
432
- 'created': undefined,
433
- 'info': market,
434
- };
435
- }
436
- /**
437
- * @method
438
- * @name probit#fetchCurrencies
439
- * @see https://docs-en.probit.com/reference/currency
440
- * @description fetches all available currencies on an exchange
441
- * @param {object} [params] extra parameters specific to the exchange API endpoint
442
- * @returns {object} an associative dictionary of currencies
443
- */
444
- async fetchCurrencies(params = {}) {
445
- const response = await this.publicGetCurrencyWithPlatform(params);
446
- //
447
- // {
448
- // "data":[
449
- // {
450
- // "id":"USDT",
451
- // "display_name":{"ko-kr":"테더","en-us":"Tether"},
452
- // "show_in_ui":true,
453
- // "platform":[
454
- // {
455
- // "id":"ETH",
456
- // "priority":1,
457
- // "deposit":true,
458
- // "withdrawal":true,
459
- // "currency_id":"USDT",
460
- // "precision":6,
461
- // "min_confirmation_count":15,
462
- // "require_destination_tag":false,
463
- // "display_name":{"name":{"ko-kr":"ERC-20","en-us":"ERC-20"}},
464
- // "min_deposit_amount":"0",
465
- // "min_withdrawal_amount":"1",
466
- // "withdrawal_fee":[
467
- // {"amount":"0.01","priority":2,"currency_id":"ETH"},
468
- // {"amount":"1.5","priority":1,"currency_id":"USDT"},
469
- // ],
470
- // "deposit_fee":{},
471
- // "suspended_reason":"",
472
- // "deposit_suspended":false,
473
- // "withdrawal_suspended":false
474
- // },
475
- // {
476
- // "id":"OMNI",
477
- // "priority":2,
478
- // "deposit":true,
479
- // "withdrawal":true,
480
- // "currency_id":"USDT",
481
- // "precision":6,
482
- // "min_confirmation_count":3,
483
- // "require_destination_tag":false,
484
- // "display_name":{"name":{"ko-kr":"OMNI","en-us":"OMNI"}},
485
- // "min_deposit_amount":"0",
486
- // "min_withdrawal_amount":"5",
487
- // "withdrawal_fee":[{"amount":"5","priority":1,"currency_id":"USDT"}],
488
- // "deposit_fee":{},
489
- // "suspended_reason":"wallet_maintenance",
490
- // "deposit_suspended":false,
491
- // "withdrawal_suspended":false
492
- // }
493
- // ],
494
- // "stakeable":false,
495
- // "unstakeable":false,
496
- // "auto_stake":false,
497
- // "auto_stake_amount":"0"
498
- // }
499
- // ]
500
- // }
501
- //
502
- const currencies = this.safeList(response, 'data', []);
503
- const result = {};
504
- for (let i = 0; i < currencies.length; i++) {
505
- const currency = currencies[i];
506
- const id = this.safeString(currency, 'id');
507
- const code = this.safeCurrencyCode(id);
508
- const displayName = this.safeDict(currency, 'display_name');
509
- const name = this.safeString(displayName, 'en-us');
510
- const platforms = this.safeList(currency, 'platform', []);
511
- const platformsByPriority = this.sortBy(platforms, 'priority');
512
- const networkList = {};
513
- for (let j = 0; j < platformsByPriority.length; j++) {
514
- const network = platformsByPriority[j];
515
- const idInner = this.safeString(network, 'id');
516
- const networkCode = this.networkIdToCode(idInner);
517
- const withdrawFee = this.safeList(network, 'withdrawal_fee', []);
518
- let networkFee = this.safeDict(withdrawFee, 0, {});
519
- for (let k = 0; k < withdrawFee.length; k++) {
520
- const withdrawPlatform = withdrawFee[k];
521
- const feeCurrencyId = this.safeString(withdrawPlatform, 'currency_id');
522
- if (feeCurrencyId === id) {
523
- networkFee = withdrawPlatform;
524
- break;
525
- }
526
- }
527
- networkList[networkCode] = {
528
- 'id': idInner,
529
- 'network': networkCode,
530
- 'active': undefined,
531
- 'deposit': !this.safeBool(network, 'deposit_suspended'),
532
- 'withdraw': !this.safeBool(network, 'withdrawal_suspended'),
533
- 'fee': this.safeNumber(networkFee, 'amount'),
534
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(network, 'precision'))),
535
- 'limits': {
536
- 'withdraw': {
537
- 'min': this.safeNumber(network, 'min_withdrawal_amount'),
538
- 'max': undefined,
539
- },
540
- 'deposit': {
541
- 'min': this.safeNumber(network, 'min_deposit_amount'),
542
- 'max': undefined,
543
- },
544
- },
545
- 'info': network,
546
- };
547
- }
548
- result[code] = this.safeCurrencyStructure({
549
- 'id': id,
550
- 'code': code,
551
- 'info': currency,
552
- 'name': name,
553
- 'active': undefined,
554
- 'deposit': undefined,
555
- 'withdraw': undefined,
556
- 'type': 'crypto',
557
- 'fee': undefined,
558
- 'precision': undefined,
559
- 'limits': {
560
- 'amount': {
561
- 'min': undefined,
562
- 'max': undefined,
563
- },
564
- 'deposit': {
565
- 'min': undefined,
566
- 'max': undefined,
567
- },
568
- 'withdraw': {
569
- 'min': undefined,
570
- 'max': undefined,
571
- },
572
- },
573
- 'networks': networkList,
574
- });
575
- }
576
- return result;
577
- }
578
- parseBalance(response) {
579
- const result = {
580
- 'info': response,
581
- 'timestamp': undefined,
582
- 'datetime': undefined,
583
- };
584
- const data = this.safeValue(response, 'data', []);
585
- for (let i = 0; i < data.length; i++) {
586
- const balance = data[i];
587
- const currencyId = this.safeString(balance, 'currency_id');
588
- const code = this.safeCurrencyCode(currencyId);
589
- const account = this.account();
590
- account['total'] = this.safeString(balance, 'total');
591
- account['free'] = this.safeString(balance, 'available');
592
- result[code] = account;
593
- }
594
- return this.safeBalance(result);
595
- }
596
- /**
597
- * @method
598
- * @name probit#fetchBalance
599
- * @see https://docs-en.probit.com/reference/balance
600
- * @description query for balance and get the amount of funds available for trading or funds locked in orders
601
- * @param {object} [params] extra parameters specific to the exchange API endpoint
602
- * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
603
- */
604
- async fetchBalance(params = {}) {
605
- await this.loadMarkets();
606
- const response = await this.privateGetBalance(params);
607
- //
608
- // {
609
- // "data": [
610
- // {
611
- // "currency_id":"XRP",
612
- // "total":"100",
613
- // "available":"0",
614
- // }
615
- // ]
616
- // }
617
- //
618
- return this.parseBalance(response);
619
- }
620
- /**
621
- * @method
622
- * @name probit#fetchOrderBook
623
- * @see https://docs-en.probit.com/reference/order_book
624
- * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
625
- * @param {string} symbol unified symbol of the market to fetch the order book for
626
- * @param {int} [limit] the maximum amount of order book entries to return
627
- * @param {object} [params] extra parameters specific to the exchange API endpoint
628
- * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
629
- */
630
- async fetchOrderBook(symbol, limit = undefined, params = {}) {
631
- await this.loadMarkets();
632
- const market = this.market(symbol);
633
- const request = {
634
- 'market_id': market['id'],
635
- };
636
- const response = await this.publicGetOrderBook(this.extend(request, params));
637
- //
638
- // {
639
- // data: [
640
- // { side: 'buy', price: '0.000031', quantity: '10' },
641
- // { side: 'buy', price: '0.00356007', quantity: '4.92156877' },
642
- // { side: 'sell', price: '0.1857', quantity: '0.17' },
643
- // ]
644
- // }
645
- //
646
- const data = this.safeValue(response, 'data', []);
647
- const dataBySide = this.groupBy(data, 'side');
648
- return this.parseOrderBook(dataBySide, market['symbol'], undefined, 'buy', 'sell', 'price', 'quantity');
649
- }
650
- /**
651
- * @method
652
- * @name probit#fetchTickers
653
- * @see https://docs-en.probit.com/reference/ticker
654
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
655
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
656
- * @param {object} [params] extra parameters specific to the exchange API endpoint
657
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/?id=ticker-structure}
658
- */
659
- async fetchTickers(symbols = undefined, params = {}) {
660
- await this.loadMarkets();
661
- const request = {};
662
- if (symbols !== undefined) {
663
- const marketIds = this.marketIds(symbols);
664
- request['market_ids'] = marketIds.join(',');
665
- }
666
- const response = await this.publicGetTicker(this.extend(request, params));
667
- //
668
- // {
669
- // "data":[
670
- // {
671
- // "last":"0.022902",
672
- // "low":"0.021693",
673
- // "high":"0.024093",
674
- // "change":"-0.000047",
675
- // "base_volume":"15681.986",
676
- // "quote_volume":"360.514403624",
677
- // "market_id":"ETH-BTC",
678
- // "time":"2020-04-12T18:43:38.000Z"
679
- // }
680
- // ]
681
- // }
682
- //
683
- const data = this.safeList(response, 'data', []);
684
- return this.parseTickers(data, symbols);
685
- }
686
- /**
687
- * @method
688
- * @name probit#fetchTicker
689
- * @see https://docs-en.probit.com/reference/ticker
690
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
691
- * @param {string} symbol unified symbol of the market to fetch the ticker for
692
- * @param {object} [params] extra parameters specific to the exchange API endpoint
693
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
694
- */
695
- async fetchTicker(symbol, params = {}) {
696
- await this.loadMarkets();
697
- const market = this.market(symbol);
698
- const request = {
699
- 'market_ids': market['id'],
700
- };
701
- const response = await this.publicGetTicker(this.extend(request, params));
702
- //
703
- // {
704
- // "data":[
705
- // {
706
- // "last":"0.022902",
707
- // "low":"0.021693",
708
- // "high":"0.024093",
709
- // "change":"-0.000047",
710
- // "base_volume":"15681.986",
711
- // "quote_volume":"360.514403624",
712
- // "market_id":"ETH-BTC",
713
- // "time":"2020-04-12T18:43:38.000Z"
714
- // }
715
- // ]
716
- // }
717
- //
718
- const data = this.safeValue(response, 'data', []);
719
- const ticker = this.safeValue(data, 0);
720
- if (ticker === undefined) {
721
- throw new BadResponse(this.id + ' fetchTicker() returned an empty response');
722
- }
723
- return this.parseTicker(ticker, market);
724
- }
725
- parseTicker(ticker, market = undefined) {
726
- //
727
- // {
728
- // "last":"0.022902",
729
- // "low":"0.021693",
730
- // "high":"0.024093",
731
- // "change":"-0.000047",
732
- // "base_volume":"15681.986",
733
- // "quote_volume":"360.514403624",
734
- // "market_id":"ETH-BTC",
735
- // "time":"2020-04-12T18:43:38.000Z"
736
- // }
737
- //
738
- const timestamp = this.parse8601(this.safeString(ticker, 'time'));
739
- const marketId = this.safeString(ticker, 'market_id');
740
- const symbol = this.safeSymbol(marketId, market, '-');
741
- const close = this.safeString(ticker, 'last');
742
- const change = this.safeString(ticker, 'change');
743
- const baseVolume = this.safeString(ticker, 'base_volume');
744
- const quoteVolume = this.safeString(ticker, 'quote_volume');
745
- return this.safeTicker({
746
- 'symbol': symbol,
747
- 'timestamp': timestamp,
748
- 'datetime': this.iso8601(timestamp),
749
- 'high': this.safeString(ticker, 'high'),
750
- 'low': this.safeString(ticker, 'low'),
751
- 'bid': undefined,
752
- 'bidVolume': undefined,
753
- 'ask': undefined,
754
- 'askVolume': undefined,
755
- 'vwap': undefined,
756
- 'open': undefined,
757
- 'close': close,
758
- 'last': close,
759
- 'previousClose': undefined,
760
- 'change': change,
761
- 'percentage': undefined,
762
- 'average': undefined,
763
- 'baseVolume': baseVolume,
764
- 'quoteVolume': quoteVolume,
765
- 'info': ticker,
766
- }, market);
767
- }
768
- /**
769
- * @method
770
- * @name probit#fetchMyTrades
771
- * @see https://docs-en.probit.com/reference/trade
772
- * @description fetch all trades made by the user
773
- * @param {string} symbol unified market symbol
774
- * @param {int} [since] the earliest time in ms to fetch trades for
775
- * @param {int} [limit] the maximum number of trades structures to retrieve
776
- * @param {object} [params] extra parameters specific to the exchange API endpoint
777
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=trade-structure}
778
- */
779
- async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
780
- await this.loadMarkets();
781
- let market = undefined;
782
- const now = this.milliseconds();
783
- const request = {
784
- 'limit': 100,
785
- 'start_time': this.iso8601(now - 31536000000),
786
- 'end_time': this.iso8601(now),
787
- };
788
- if (symbol !== undefined) {
789
- market = this.market(symbol);
790
- request['market_id'] = market['id'];
791
- }
792
- if (since !== undefined) {
793
- request['start_time'] = this.iso8601(since);
794
- request['end_time'] = this.iso8601(Math.min(now, since + 31536000000));
795
- }
796
- if (limit !== undefined) {
797
- request['limit'] = limit;
798
- }
799
- const response = await this.privateGetTradeHistory(this.extend(request, params));
800
- //
801
- // {
802
- // "data": [
803
- // {
804
- // "id":"BTC-USDT:183566",
805
- // "order_id":"17209376",
806
- // "side":"sell",
807
- // "fee_amount":"0.657396569175",
808
- // "fee_currency_id":"USDT",
809
- // "status":"settled",
810
- // "price":"6573.96569175",
811
- // "quantity":"0.1",
812
- // "cost":"657.396569175",
813
- // "time":"2018-08-10T06:06:46.000Z",
814
- // "market_id":"BTC-USDT"
815
- // }
816
- // ]
817
- // }
818
- //
819
- const data = this.safeList(response, 'data', []);
820
- return this.parseTrades(data, market, since, limit);
821
- }
822
- /**
823
- * @method
824
- * @name probit#fetchTrades
825
- * @see https://docs-en.probit.com/reference/trade-1
826
- * @description get the list of most recent trades for a particular symbol
827
- * @param {string} symbol unified symbol of the market to fetch trades for
828
- * @param {int} [since] timestamp in ms of the earliest trade to fetch
829
- * @param {int} [limit] the maximum amount of trades to fetch
830
- * @param {object} [params] extra parameters specific to the exchange API endpoint
831
- * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
832
- */
833
- async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
834
- await this.loadMarkets();
835
- const market = this.market(symbol);
836
- const request = {
837
- 'market_id': market['id'],
838
- 'start_time': '1970-01-01T00:00:00.000Z',
839
- 'end_time': this.iso8601(this.milliseconds()),
840
- };
841
- if (since !== undefined) {
842
- request['start_time'] = this.iso8601(since);
843
- }
844
- if (limit !== undefined) {
845
- request['limit'] = Math.min(limit, 1000);
846
- }
847
- else {
848
- request['limit'] = 1000; // required to set any value
849
- }
850
- const response = await this.publicGetTrade(this.extend(request, params));
851
- //
852
- // {
853
- // "data":[
854
- // {
855
- // "id":"ETH-BTC:3331886",
856
- // "price":"0.022982",
857
- // "quantity":"12.337",
858
- // "time":"2020-04-12T20:55:42.371Z",
859
- // "side":"sell",
860
- // "tick_direction":"down"
861
- // },
862
- // {
863
- // "id":"ETH-BTC:3331885",
864
- // "price":"0.022982",
865
- // "quantity":"6.472",
866
- // "time":"2020-04-12T20:55:39.652Z",
867
- // "side":"sell",
868
- // "tick_direction":"down"
869
- // }
870
- // ]
871
- // }
872
- //
873
- const data = this.safeList(response, 'data', []);
874
- return this.parseTrades(data, market, since, limit);
875
- }
876
- parseTrade(trade, market = undefined) {
877
- //
878
- // fetchTrades (public)
879
- //
880
- // {
881
- // "id":"ETH-BTC:3331886",
882
- // "price":"0.022981",
883
- // "quantity":"12.337",
884
- // "time":"2020-04-12T20:55:42.371Z",
885
- // "side":"sell",
886
- // "tick_direction":"down"
887
- // }
888
- //
889
- // fetchMyTrades (private)
890
- //
891
- // {
892
- // "id":"BTC-USDT:183566",
893
- // "order_id":"17209376",
894
- // "side":"sell",
895
- // "fee_amount":"0.657396569175",
896
- // "fee_currency_id":"USDT",
897
- // "status":"settled",
898
- // "price":"6573.96569175",
899
- // "quantity":"0.1",
900
- // "cost":"657.396569175",
901
- // "time":"2018-08-10T06:06:46.000Z",
902
- // "market_id":"BTC-USDT"
903
- // }
904
- //
905
- const timestamp = this.parse8601(this.safeString(trade, 'time'));
906
- const id = this.safeString(trade, 'id');
907
- let marketId = undefined;
908
- if (id !== undefined) {
909
- const parts = id.split(':');
910
- marketId = this.safeString(parts, 0);
911
- }
912
- marketId = this.safeString(trade, 'market_id', marketId);
913
- const symbol = this.safeSymbol(marketId, market, '-');
914
- const side = this.safeString(trade, 'side');
915
- const priceString = this.safeString(trade, 'price');
916
- const amountString = this.safeString(trade, 'quantity');
917
- const orderId = this.safeString(trade, 'order_id');
918
- const feeCostString = this.safeString(trade, 'fee_amount');
919
- let fee = undefined;
920
- if (feeCostString !== undefined) {
921
- const feeCurrencyId = this.safeString(trade, 'fee_currency_id');
922
- const feeCurrencyCode = this.safeCurrencyCode(feeCurrencyId);
923
- fee = {
924
- 'cost': feeCostString,
925
- 'currency': feeCurrencyCode,
926
- };
927
- }
928
- return this.safeTrade({
929
- 'id': id,
930
- 'info': trade,
931
- 'timestamp': timestamp,
932
- 'datetime': this.iso8601(timestamp),
933
- 'symbol': symbol,
934
- 'order': orderId,
935
- 'type': undefined,
936
- 'side': side,
937
- 'takerOrMaker': undefined,
938
- 'price': priceString,
939
- 'amount': amountString,
940
- 'cost': undefined,
941
- 'fee': fee,
942
- }, market);
943
- }
944
- /**
945
- * @method
946
- * @name probit#fetchTime
947
- * @see https://docs-en.probit.com/reference/time
948
- * @description fetches the current integer timestamp in milliseconds from the exchange server
949
- * @param {object} [params] extra parameters specific to the exchange API endpoint
950
- * @returns {int} the current integer timestamp in milliseconds from the exchange server
951
- */
952
- async fetchTime(params = {}) {
953
- const response = await this.publicGetTime(params);
954
- //
955
- // { "data":"2020-04-12T18:54:25.390Z" }
956
- //
957
- const timestamp = this.parse8601(this.safeString(response, 'data'));
958
- return timestamp;
959
- }
960
- normalizeOHLCVTimestamp(timestamp, timeframe, after = false) {
961
- const duration = this.parseTimeframe(timeframe);
962
- if (timeframe === '1M') {
963
- const iso8601 = this.iso8601(timestamp);
964
- const parts = iso8601.split('-');
965
- const year = this.safeString(parts, 0);
966
- const month = this.safeInteger(parts, 1);
967
- let monthString = undefined;
968
- if (after) {
969
- monthString = this.sum(month, 1).toString();
970
- }
971
- if (month < 10) {
972
- monthString = '0' + month.toString();
973
- }
974
- return year + '-' + monthString + '-01T00:00:00.000Z';
975
- }
976
- else if (timeframe === '1w') {
977
- timestamp = this.parseToInt(timestamp / 1000);
978
- const firstSunday = 259200; // 1970-01-04T00:00:00.000Z
979
- const difference = timestamp - firstSunday;
980
- const numWeeks = Math.floor(difference / duration);
981
- let previousSunday = this.sum(firstSunday, numWeeks * duration);
982
- if (after) {
983
- previousSunday = this.sum(previousSunday, duration);
984
- }
985
- return this.iso8601(previousSunday * 1000);
986
- }
987
- else {
988
- timestamp = this.parseToInt(timestamp / 1000);
989
- timestamp = duration * this.parseToInt(timestamp / duration);
990
- if (after) {
991
- timestamp = this.sum(timestamp, duration);
992
- }
993
- return this.iso8601(timestamp * 1000);
994
- }
995
- }
996
- /**
997
- * @method
998
- * @name probit#fetchOHLCV
999
- * @see https://docs-en.probit.com/reference/candle
1000
- * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1001
- * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1002
- * @param {string} timeframe the length of time each candle represents
1003
- * @param {int} [since] timestamp in ms of the earliest candle to fetch
1004
- * @param {int} [limit] the maximum amount of candles to fetch
1005
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1006
- * @param {string} [params.until] timestamp in ms of the earliest candle to fetch
1007
- * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
1008
- */
1009
- async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
1010
- await this.loadMarkets();
1011
- const market = this.market(symbol);
1012
- const interval = this.safeString(this.timeframes, timeframe, timeframe);
1013
- limit = (limit === undefined) ? 100 : limit;
1014
- let requestLimit = this.sum(limit, 1);
1015
- requestLimit = Math.min(1000, requestLimit); // max 1000
1016
- const request = {
1017
- 'market_ids': market['id'],
1018
- 'interval': interval,
1019
- 'sort': 'asc',
1020
- 'limit': requestLimit, // max 1000
1021
- };
1022
- const now = this.milliseconds();
1023
- const until = this.safeInteger(params, 'until');
1024
- const durationMilliseconds = this.parseTimeframe(timeframe) * 1000;
1025
- let startTime = since;
1026
- let endTime = (until !== undefined) ? until - durationMilliseconds : now;
1027
- if (since === undefined) {
1028
- if (limit === undefined) {
1029
- limit = requestLimit;
1030
- }
1031
- const startLimit = limit - 1;
1032
- startTime = endTime - startLimit * durationMilliseconds;
1033
- }
1034
- else {
1035
- if (limit !== undefined) {
1036
- const endByLimit = this.sum(since, limit * durationMilliseconds);
1037
- endTime = Math.min(endTime, endByLimit);
1038
- }
1039
- }
1040
- const startTimeNormalized = this.normalizeOHLCVTimestamp(startTime, timeframe);
1041
- const endTimeNormalized = this.normalizeOHLCVTimestamp(endTime, timeframe, true);
1042
- request['start_time'] = startTimeNormalized;
1043
- request['end_time'] = endTimeNormalized;
1044
- const response = await this.publicGetCandle(this.extend(request, params));
1045
- //
1046
- // {
1047
- // "data":[
1048
- // {
1049
- // "market_id":"ETH-BTC",
1050
- // "open":"0.02811",
1051
- // "close":"0.02811",
1052
- // "low":"0.02811",
1053
- // "high":"0.02811",
1054
- // "base_volume":"0.0005",
1055
- // "quote_volume":"0.000014055",
1056
- // "start_time":"2018-11-30T18:19:00.000Z",
1057
- // "end_time":"2018-11-30T18:20:00.000Z"
1058
- // },
1059
- // ]
1060
- // }
1061
- //
1062
- const data = this.safeList(response, 'data', []);
1063
- return this.parseOHLCVs(data, market, timeframe, since, limit);
1064
- }
1065
- parseOHLCV(ohlcv, market = undefined) {
1066
- //
1067
- // {
1068
- // "market_id":"ETH-BTC",
1069
- // "open":"0.02811",
1070
- // "close":"0.02811",
1071
- // "low":"0.02811",
1072
- // "high":"0.02811",
1073
- // "base_volume":"0.0005",
1074
- // "quote_volume":"0.000014055",
1075
- // "start_time":"2018-11-30T18:19:00.000Z",
1076
- // "end_time":"2018-11-30T18:20:00.000Z"
1077
- // }
1078
- //
1079
- return [
1080
- this.parse8601(this.safeString(ohlcv, 'start_time')),
1081
- this.safeNumber(ohlcv, 'open'),
1082
- this.safeNumber(ohlcv, 'high'),
1083
- this.safeNumber(ohlcv, 'low'),
1084
- this.safeNumber(ohlcv, 'close'),
1085
- this.safeNumber(ohlcv, 'base_volume'),
1086
- ];
1087
- }
1088
- /**
1089
- * @method
1090
- * @name probit#fetchOpenOrders
1091
- * @see https://docs-en.probit.com/reference/open_order-1
1092
- * @description fetch all unfilled currently open orders
1093
- * @param {string} symbol unified market symbol
1094
- * @param {int} [since] the earliest time in ms to fetch open orders for
1095
- * @param {int} [limit] the maximum number of open orders structures to retrieve
1096
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1097
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
1098
- */
1099
- async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1100
- await this.loadMarkets();
1101
- since = this.parse8601(since);
1102
- const request = {};
1103
- let market = undefined;
1104
- if (symbol !== undefined) {
1105
- market = this.market(symbol);
1106
- request['market_id'] = market['id'];
1107
- }
1108
- const response = await this.privateGetOpenOrder(this.extend(request, params));
1109
- const data = this.safeList(response, 'data');
1110
- return this.parseOrders(data, market, since, limit);
1111
- }
1112
- /**
1113
- * @method
1114
- * @name probit#fetchClosedOrders
1115
- * @see https://docs-en.probit.com/reference/order
1116
- * @description fetches information on multiple closed orders made by the user
1117
- * @param {string} symbol unified market symbol of the market orders were made in
1118
- * @param {int} [since] the earliest time in ms to fetch orders for
1119
- * @param {int} [limit] the maximum number of order structures to retrieve
1120
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1121
- * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
1122
- */
1123
- async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1124
- await this.loadMarkets();
1125
- const request = {
1126
- 'start_time': this.iso8601(0),
1127
- 'end_time': this.iso8601(this.milliseconds()),
1128
- 'limit': 100,
1129
- };
1130
- let market = undefined;
1131
- if (symbol !== undefined) {
1132
- market = this.market(symbol);
1133
- request['market_id'] = market['id'];
1134
- }
1135
- if (since) {
1136
- request['start_time'] = this.iso8601(since);
1137
- }
1138
- if (limit) {
1139
- request['limit'] = limit;
1140
- }
1141
- const response = await this.privateGetOrderHistory(this.extend(request, params));
1142
- const data = this.safeList(response, 'data');
1143
- return this.parseOrders(data, market, since, limit);
1144
- }
1145
- /**
1146
- * @method
1147
- * @name probit#fetchOrder
1148
- * @see https://docs-en.probit.com/reference/order-3
1149
- * @description fetches information on an order made by the user
1150
- * @param {string} id the order id
1151
- * @param {string} symbol unified symbol of the market the order was made in
1152
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1153
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure}
1154
- */
1155
- async fetchOrder(id, symbol = undefined, params = {}) {
1156
- if (symbol === undefined) {
1157
- throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
1158
- }
1159
- await this.loadMarkets();
1160
- const market = this.market(symbol);
1161
- const request = {
1162
- 'market_id': market['id'],
1163
- };
1164
- const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
1165
- if (clientOrderId !== undefined) {
1166
- request['client_order_id'] = clientOrderId;
1167
- }
1168
- else {
1169
- request['order_id'] = id;
1170
- }
1171
- const query = this.omit(params, ['clientOrderId', 'client_order_id']);
1172
- const response = await this.privateGetOrder(this.extend(request, query));
1173
- const data = this.safeValue(response, 'data', []);
1174
- const order = this.safeDict(data, 0);
1175
- return this.parseOrder(order, market);
1176
- }
1177
- parseOrderStatus(status) {
1178
- const statuses = {
1179
- 'open': 'open',
1180
- 'cancelled': 'canceled',
1181
- 'filled': 'closed',
1182
- };
1183
- return this.safeString(statuses, status, status);
1184
- }
1185
- parseOrder(order, market = undefined) {
1186
- //
1187
- // {
1188
- // id,
1189
- // user_id,
1190
- // market_id,
1191
- // "type": "orderType",
1192
- // "side": "side",
1193
- // quantity,
1194
- // limit_price,
1195
- // "time_in_force": "timeInForce",
1196
- // filled_cost,
1197
- // filled_quantity,
1198
- // open_quantity,
1199
- // cancelled_quantity,
1200
- // "status": "orderStatus",
1201
- // "time": "date",
1202
- // client_order_id,
1203
- // }
1204
- //
1205
- const status = this.parseOrderStatus(this.safeString(order, 'status'));
1206
- const id = this.safeString(order, 'id');
1207
- const type = this.safeString(order, 'type');
1208
- const side = this.safeString(order, 'side');
1209
- const marketId = this.safeString(order, 'market_id');
1210
- const symbol = this.safeSymbol(marketId, market, '-');
1211
- const timestamp = this.parse8601(this.safeString(order, 'time'));
1212
- let price = this.safeString(order, 'limit_price');
1213
- const filled = this.safeString(order, 'filled_quantity');
1214
- let remaining = this.safeString(order, 'open_quantity');
1215
- const canceledAmount = this.safeString(order, 'cancelled_quantity');
1216
- if (canceledAmount !== undefined) {
1217
- remaining = Precise.stringAdd(remaining, canceledAmount);
1218
- }
1219
- const amount = this.safeString(order, 'quantity', Precise.stringAdd(filled, remaining));
1220
- const cost = this.safeString2(order, 'filled_cost', 'cost');
1221
- if (type === 'market') {
1222
- price = undefined;
1223
- }
1224
- const clientOrderId = this.safeString(order, 'client_order_id');
1225
- const timeInForce = this.safeStringUpper(order, 'time_in_force');
1226
- return this.safeOrder({
1227
- 'id': id,
1228
- 'info': order,
1229
- 'clientOrderId': clientOrderId,
1230
- 'timestamp': timestamp,
1231
- 'datetime': this.iso8601(timestamp),
1232
- 'lastTradeTimestamp': undefined,
1233
- 'symbol': symbol,
1234
- 'type': type,
1235
- 'timeInForce': timeInForce,
1236
- 'side': side,
1237
- 'status': status,
1238
- 'price': price,
1239
- 'triggerPrice': undefined,
1240
- 'amount': amount,
1241
- 'filled': filled,
1242
- 'remaining': remaining,
1243
- 'average': undefined,
1244
- 'cost': cost,
1245
- 'fee': undefined,
1246
- 'trades': undefined,
1247
- }, market);
1248
- }
1249
- costToPrecision(symbol, cost) {
1250
- return this.decimalToPrecision(cost, TRUNCATE, this.markets[symbol]['precision']['cost'], this.precisionMode);
1251
- }
1252
- /**
1253
- * @method
1254
- * @name probit#createOrder
1255
- * @description create a trade order
1256
- * @see https://docs-en.probit.com/reference/order-1
1257
- * @param {string} symbol unified symbol of the market to create an order in
1258
- * @param {string} type 'market' or 'limit'
1259
- * @param {string} side 'buy' or 'sell'
1260
- * @param {float} amount how much you want to trade in units of the base currency
1261
- * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1262
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1263
- * @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount for market buy orders
1264
- * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
1265
- */
1266
- async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1267
- await this.loadMarkets();
1268
- const market = this.market(symbol);
1269
- const options = this.safeValue(this.options, 'timeInForce');
1270
- const defaultTimeInForce = this.safeValue(options, type);
1271
- const timeInForce = this.safeString2(params, 'timeInForce', 'time_in_force', defaultTimeInForce);
1272
- const request = {
1273
- 'market_id': market['id'],
1274
- 'type': type,
1275
- 'side': side,
1276
- 'time_in_force': timeInForce,
1277
- };
1278
- const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
1279
- if (clientOrderId !== undefined) {
1280
- request['client_order_id'] = clientOrderId;
1281
- }
1282
- let quoteAmount = undefined;
1283
- if (type === 'limit') {
1284
- request['limit_price'] = this.priceToPrecision(symbol, price);
1285
- request['quantity'] = this.amountToPrecision(symbol, amount);
1286
- }
1287
- else if (type === 'market') {
1288
- // for market buy it requires the amount of quote currency to spend
1289
- if (side === 'buy') {
1290
- let createMarketBuyOrderRequiresPrice = true;
1291
- [createMarketBuyOrderRequiresPrice, params] = this.handleOptionAndParams(params, 'createOrder', 'createMarketBuyOrderRequiresPrice', true);
1292
- const cost = this.safeString(params, 'cost');
1293
- params = this.omit(params, 'cost');
1294
- if (cost !== undefined) {
1295
- quoteAmount = this.costToPrecision(symbol, cost);
1296
- }
1297
- else if (createMarketBuyOrderRequiresPrice) {
1298
- if (price === undefined) {
1299
- throw new InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to false and pass the cost to spend in the amount argument');
1300
- }
1301
- else {
1302
- const amountString = this.numberToString(amount);
1303
- const priceString = this.numberToString(price);
1304
- const costRequest = Precise.stringMul(amountString, priceString);
1305
- quoteAmount = this.costToPrecision(symbol, costRequest);
1306
- }
1307
- }
1308
- else {
1309
- quoteAmount = this.costToPrecision(symbol, amount);
1310
- }
1311
- request['cost'] = quoteAmount;
1312
- }
1313
- else {
1314
- request['quantity'] = this.amountToPrecision(symbol, amount);
1315
- }
1316
- }
1317
- const query = this.omit(params, ['timeInForce', 'time_in_force', 'clientOrderId', 'client_order_id']);
1318
- const response = await this.privatePostNewOrder(this.extend(request, query));
1319
- //
1320
- // {
1321
- // "data": {
1322
- // id,
1323
- // user_id,
1324
- // market_id,
1325
- // "type": "orderType",
1326
- // "side": "side",
1327
- // quantity,
1328
- // limit_price,
1329
- // "time_in_force": "timeInForce",
1330
- // filled_cost,
1331
- // filled_quantity,
1332
- // open_quantity,
1333
- // cancelled_quantity,
1334
- // "status": "orderStatus",
1335
- // "time": "date",
1336
- // client_order_id,
1337
- // }
1338
- // }
1339
- //
1340
- const data = this.safeValue(response, 'data');
1341
- const order = this.parseOrder(data, market);
1342
- // a workaround for incorrect huge amounts
1343
- // returned by the exchange on market buys
1344
- if ((type === 'market') && (side === 'buy')) {
1345
- order['amount'] = undefined;
1346
- order['cost'] = this.parseNumber(quoteAmount);
1347
- order['remaining'] = undefined;
1348
- }
1349
- return order;
1350
- }
1351
- /**
1352
- * @method
1353
- * @name probit#cancelOrder
1354
- * @see https://docs-en.probit.com/reference/order-2
1355
- * @description cancels an open order
1356
- * @param {string} id order id
1357
- * @param {string} symbol unified symbol of the market the order was made in
1358
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1359
- * @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure}
1360
- */
1361
- async cancelOrder(id, symbol = undefined, params = {}) {
1362
- if (symbol === undefined) {
1363
- throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
1364
- }
1365
- await this.loadMarkets();
1366
- const market = this.market(symbol);
1367
- const request = {
1368
- 'market_id': market['id'],
1369
- 'order_id': id,
1370
- };
1371
- const response = await this.privatePostCancelOrder(this.extend(request, params));
1372
- const data = this.safeDict(response, 'data');
1373
- return this.parseOrder(data);
1374
- }
1375
- parseDepositAddress(depositAddress, currency = undefined) {
1376
- const address = this.safeString(depositAddress, 'address');
1377
- const tag = this.safeString(depositAddress, 'destination_tag');
1378
- const currencyId = this.safeString(depositAddress, 'currency_id');
1379
- currency = this.safeCurrency(currencyId, currency);
1380
- const code = currency['code'];
1381
- const network = this.safeString(depositAddress, 'platform_id');
1382
- this.checkAddress(address);
1383
- return {
1384
- 'info': depositAddress,
1385
- 'currency': code,
1386
- 'network': network,
1387
- 'address': address,
1388
- 'tag': tag,
1389
- };
1390
- }
1391
- /**
1392
- * @method
1393
- * @name probit#fetchDepositAddress
1394
- * @see https://docs-en.probit.com/reference/deposit_address
1395
- * @description fetch the deposit address for a currency associated with this account
1396
- * @param {string} code unified currency code
1397
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1398
- * @returns {object} an [address structure]{@link https://docs.ccxt.com/?id=address-structure}
1399
- */
1400
- async fetchDepositAddress(code, params = {}) {
1401
- await this.loadMarkets();
1402
- const currency = this.currency(code);
1403
- const request = {
1404
- 'currency_id': currency['id'],
1405
- // 'platform_id': 'TRON', (undocumented)
1406
- };
1407
- const networks = this.safeValue(this.options, 'networks', {});
1408
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
1409
- network = this.safeString(networks, network, network); // handle ERC20>ETH alias
1410
- if (network !== undefined) {
1411
- request['platform_id'] = network;
1412
- params = this.omit(params, 'platform_id');
1413
- }
1414
- const response = await this.privateGetDepositAddress(this.extend(request, params));
1415
- //
1416
- // without 'platform_id'
1417
- // {
1418
- // "data":[
1419
- // {
1420
- // "currency_id":"ETH",
1421
- // "address":"0x12e2caf3c4051ba1146e612f532901a423a9898a",
1422
- // "destination_tag":null
1423
- // }
1424
- // ]
1425
- // }
1426
- //
1427
- // with 'platform_id'
1428
- // {
1429
- // "data":[
1430
- // {
1431
- // "platform_id":"TRON",
1432
- // "address":"TDQLMxBTa6MzuoZ6deSGZkqET3Ek8v7uC6",
1433
- // "destination_tag":null
1434
- // }
1435
- // ]
1436
- // }
1437
- //
1438
- const data = this.safeValue(response, 'data', []);
1439
- const firstAddress = this.safeValue(data, 0);
1440
- if (firstAddress === undefined) {
1441
- throw new InvalidAddress(this.id + ' fetchDepositAddress() returned an empty response');
1442
- }
1443
- return this.parseDepositAddress(firstAddress, currency);
1444
- }
1445
- /**
1446
- * @method
1447
- * @name probit#fetchDepositAddresses
1448
- * @see https://docs-en.probit.com/reference/deposit_address
1449
- * @description fetch deposit addresses for multiple currencies and chain types
1450
- * @param {string[]|undefined} codes list of unified currency codes, default is undefined
1451
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1452
- * @returns {object} a list of [address structures]{@link https://docs.ccxt.com/?id=address-structure}
1453
- */
1454
- async fetchDepositAddresses(codes = undefined, params = {}) {
1455
- await this.loadMarkets();
1456
- const request = {};
1457
- if (codes) {
1458
- const currencyIds = [];
1459
- for (let i = 0; i < codes.length; i++) {
1460
- const currency = this.currency(codes[i]);
1461
- currencyIds.push(currency['id']);
1462
- }
1463
- request['currency_id'] = codes.join(',');
1464
- }
1465
- const response = await this.privateGetDepositAddress(this.extend(request, params));
1466
- const data = this.safeList(response, 'data', []);
1467
- return this.parseDepositAddresses(data, codes);
1468
- }
1469
- /**
1470
- * @method
1471
- * @name probit#withdraw
1472
- * @see https://docs-en.probit.com/reference/withdrawal
1473
- * @description make a withdrawal
1474
- * @param {string} code unified currency code
1475
- * @param {float} amount the amount to withdraw
1476
- * @param {string} address the address to withdraw to
1477
- * @param {string} tag
1478
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1479
- * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/?id=transaction-structure}
1480
- */
1481
- async withdraw(code, amount, address, tag = undefined, params = {}) {
1482
- [tag, params] = this.handleWithdrawTagAndParams(tag, params);
1483
- // In order to use this method
1484
- // you need to allow API withdrawal from the API Settings Page, and
1485
- // and register the list of withdrawal addresses and destination tags on the API Settings page
1486
- // you can only withdraw to the registered addresses using the API
1487
- this.checkAddress(address);
1488
- await this.loadMarkets();
1489
- const currency = this.currency(code);
1490
- if (tag === undefined) {
1491
- tag = '';
1492
- }
1493
- const request = {
1494
- 'currency_id': currency['id'],
1495
- // 'platform_id': 'ETH', // if omitted it will use the default platform for the currency
1496
- 'address': address,
1497
- 'destination_tag': tag,
1498
- 'amount': this.numberToString(amount),
1499
- // which currency to pay the withdrawal fees
1500
- // only applicable for currencies that accepts multiple withdrawal fee options
1501
- // 'fee_currency_id': 'ETH', // if omitted it will use the default fee policy for each currency
1502
- // whether the amount field includes fees
1503
- // 'include_fee': false, // makes sense only when fee_currency_id is equal to currency_id
1504
- };
1505
- const networks = this.safeValue(this.options, 'networks', {});
1506
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
1507
- network = this.safeString(networks, network, network); // handle ERC20>ETH alias
1508
- if (network !== undefined) {
1509
- request['platform_id'] = network;
1510
- params = this.omit(params, 'network');
1511
- }
1512
- const response = await this.privatePostWithdrawal(this.extend(request, params));
1513
- const data = this.safeDict(response, 'data');
1514
- return this.parseTransaction(data, currency);
1515
- }
1516
- /**
1517
- * @method
1518
- * @name probit#fetchDeposits
1519
- * @description fetch all deposits made to an account
1520
- * @param {string} code unified currency code
1521
- * @param {int} [since] the earliest time in ms to fetch deposits for
1522
- * @param {int} [limit] the maximum number of transaction structures to retrieve
1523
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1524
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure}
1525
- */
1526
- async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
1527
- const request = {
1528
- 'type': 'deposit',
1529
- };
1530
- const result = await this.fetchTransactions(code, since, limit, this.extend(request, params));
1531
- return result;
1532
- }
1533
- /**
1534
- * @method
1535
- * @name probit#fetchWithdrawals
1536
- * @description fetch all withdrawals made to an account
1537
- * @param {string} code unified currency code
1538
- * @param {int} [since] the earliest time in ms to fetch withdrawals for
1539
- * @param {int} [limit] the maximum number of transaction structures to retrieve
1540
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1541
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure}
1542
- */
1543
- async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1544
- const request = {
1545
- 'type': 'withdrawal',
1546
- };
1547
- const result = await this.fetchTransactions(code, since, limit, this.extend(request, params));
1548
- return result;
1549
- }
1550
- /**
1551
- * @method
1552
- * @name probit#fetchDepositsWithdrawals
1553
- * @description fetch history of deposits and withdrawals
1554
- * @see https://docs-en.probit.com/reference/transferpayment
1555
- * @param {string} code unified currency code
1556
- * @param {int} [since] the earliest time in ms to fetch transactions for
1557
- * @param {int} [limit] the maximum number of transaction structures to retrieve
1558
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1559
- * @param {int} [params.until] the latest time in ms to fetch transactions for
1560
- * @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/?id=transaction-structure}
1561
- */
1562
- async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1563
- await this.loadMarkets();
1564
- let currency = undefined;
1565
- const request = {};
1566
- if (code !== undefined) {
1567
- currency = this.currency(code);
1568
- request['currency_id'] = currency['id'];
1569
- }
1570
- if (since !== undefined) {
1571
- request['start_time'] = this.iso8601(since);
1572
- }
1573
- else {
1574
- request['start_time'] = this.iso8601(1);
1575
- }
1576
- const until = this.safeInteger(params, 'until');
1577
- if (until !== undefined) {
1578
- request['end_time'] = this.iso8601(until);
1579
- params = this.omit(params, ['until']);
1580
- }
1581
- else {
1582
- request['end_time'] = this.iso8601(this.milliseconds());
1583
- }
1584
- if (limit !== undefined) {
1585
- request['limit'] = limit;
1586
- }
1587
- else {
1588
- request['limit'] = 100;
1589
- }
1590
- const response = await this.privateGetTransferPayment(this.extend(request, params));
1591
- //
1592
- // {
1593
- // "data": [
1594
- // {
1595
- // "id": "01211d4b-0e68-41d6-97cb-298bfe2cab67",
1596
- // "type": "deposit",
1597
- // "status": "done",
1598
- // "amount": "0.01",
1599
- // "address": "0x9e7430fc0bdd14745bd00a1b92ed25133a7c765f",
1600
- // "time": "2023-06-14T12:03:11.000Z",
1601
- // "hash": "0x0ff5bedc9e378f9529acc6b9840fa8c2ef00fd0275e0bac7fa0589a9b5d1712e",
1602
- // "currency_id": "ETH",
1603
- // "confirmations":0,
1604
- // "fee": "0",
1605
- // "destination_tag": null,
1606
- // "platform_id": "ETH",
1607
- // "fee_currency_id": "ETH",
1608
- // "payment_service_name":null,
1609
- // "payment_service_display_name":null,
1610
- // "crypto":null
1611
- // }
1612
- // ]
1613
- // }
1614
- //
1615
- const data = this.safeList(response, 'data', []);
1616
- return this.parseTransactions(data, currency, since, limit);
1617
- }
1618
- parseTransaction(transaction, currency = undefined) {
1619
- //
1620
- // {
1621
- // "id": "01211d4b-0e68-41d6-97cb-298bfe2cab67",
1622
- // "type": "deposit",
1623
- // "status": "done",
1624
- // "amount": "0.01",
1625
- // "address": "0x9e7430fc0bdd14745bd00a1b92ed25133a7c765f",
1626
- // "time": "2023-06-14T12:03:11.000Z",
1627
- // "hash": "0x0ff5bedc9e378f9529acc6b9840fa8c2ef00fd0275e0bac7fa0589a9b5d1712e",
1628
- // "currency_id": "ETH",
1629
- // "confirmations":0,
1630
- // "fee": "0",
1631
- // "destination_tag": null,
1632
- // "platform_id": "ETH",
1633
- // "fee_currency_id": "ETH",
1634
- // "payment_service_name":null,
1635
- // "payment_service_display_name":null,
1636
- // "crypto":null
1637
- // }
1638
- //
1639
- const id = this.safeString(transaction, 'id');
1640
- const networkId = this.safeString(transaction, 'platform_id');
1641
- const networkCode = this.networkIdToCode(networkId);
1642
- const amount = this.safeNumber(transaction, 'amount');
1643
- const address = this.safeString(transaction, 'address');
1644
- const tag = this.safeString(transaction, 'destination_tag');
1645
- const txid = this.safeString(transaction, 'hash');
1646
- const timestamp = this.parse8601(this.safeString(transaction, 'time'));
1647
- const type = this.safeString(transaction, 'type');
1648
- const currencyId = this.safeString(transaction, 'currency_id');
1649
- const code = this.safeCurrencyCode(currencyId);
1650
- const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
1651
- const feeCostString = this.safeString(transaction, 'fee');
1652
- let fee = undefined;
1653
- if (feeCostString !== undefined && feeCostString !== '0') {
1654
- fee = {
1655
- 'currency': code,
1656
- 'cost': this.parseNumber(feeCostString),
1657
- };
1658
- }
1659
- return {
1660
- 'id': id,
1661
- 'currency': code,
1662
- 'amount': amount,
1663
- 'network': networkCode,
1664
- 'addressFrom': undefined,
1665
- 'address': address,
1666
- 'addressTo': address,
1667
- 'tagFrom': undefined,
1668
- 'tag': tag,
1669
- 'tagTo': tag,
1670
- 'status': status,
1671
- 'type': type,
1672
- 'txid': txid,
1673
- 'timestamp': timestamp,
1674
- 'datetime': this.iso8601(timestamp),
1675
- 'updated': undefined,
1676
- 'internal': undefined,
1677
- 'comment': undefined,
1678
- 'fee': fee,
1679
- 'info': transaction,
1680
- };
1681
- }
1682
- parseTransactionStatus(status) {
1683
- const statuses = {
1684
- 'requested': 'pending',
1685
- 'pending': 'pending',
1686
- 'confirming': 'pending',
1687
- 'confirmed': 'pending',
1688
- 'applying': 'pending',
1689
- 'done': 'ok',
1690
- 'cancelled': 'canceled',
1691
- 'cancelling': 'canceled',
1692
- };
1693
- return this.safeString(statuses, status, status);
1694
- }
1695
- /**
1696
- * @method
1697
- * @name probit#fetchDepositWithdrawFees
1698
- * @see https://docs-en.probit.com/reference/currency
1699
- * @description fetch deposit and withdraw fees
1700
- * @param {string[]|undefined} codes list of unified currency codes
1701
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1702
- * @returns {object[]} a list of [fees structures]{@link https://docs.ccxt.com/?id=fee-structure}
1703
- */
1704
- async fetchDepositWithdrawFees(codes = undefined, params = {}) {
1705
- await this.loadMarkets();
1706
- const response = await this.publicGetCurrencyWithPlatform(params);
1707
- //
1708
- // {
1709
- // "data": [
1710
- // {
1711
- // "id": "AFX",
1712
- // "display_name": {
1713
- // "ko-kr": "아프릭스",
1714
- // "en-us": "Afrix"
1715
- // },
1716
- // "show_in_ui": true,
1717
- // "platform": [
1718
- // {
1719
- // "id": "ZYN",
1720
- // "priority": 1,
1721
- // "deposit": true,
1722
- // "withdrawal": true,
1723
- // "currency_id": "AFX",
1724
- // "precision": 18,
1725
- // "min_confirmation_count": 60,
1726
- // "require_destination_tag": false,
1727
- // "allow_withdrawal_destination_tag": false,
1728
- // "display_name": {
1729
- // "name": {
1730
- // "ko-kr": "지네코인",
1731
- // "en-us": "Wethio"
1732
- // }
1733
- // },
1734
- // "min_deposit_amount": "0",
1735
- // "min_withdrawal_amount": "0",
1736
- // "withdrawal_fee": [
1737
- // {
1738
- // "currency_id": "ZYN",
1739
- // "amount": "0.5",
1740
- // "priority": 1
1741
- // }
1742
- // ],
1743
- // "deposit_fee": {},
1744
- // "suspended_reason": "",
1745
- // "deposit_suspended": false,
1746
- // "withdrawal_suspended": false,
1747
- // "platform_currency_display_name": {}
1748
- // }
1749
- // ],
1750
- // "internal_transfer": {
1751
- // "suspended_reason": null,
1752
- // "suspended": false
1753
- // },
1754
- // "stakeable": false,
1755
- // "unstakeable": false,
1756
- // "auto_stake": false,
1757
- // "auto_stake_amount": "0"
1758
- // },
1759
- // ]
1760
- // }
1761
- //
1762
- const data = this.safeList(response, 'data');
1763
- return this.parseDepositWithdrawFees(data, codes, 'id');
1764
- }
1765
- parseDepositWithdrawFee(fee, currency = undefined) {
1766
- //
1767
- // {
1768
- // "id": "USDT",
1769
- // "display_name": { "ko-kr": '테더', "en-us": "Tether" },
1770
- // "show_in_ui": true,
1771
- // "platform": [
1772
- // {
1773
- // "id": "ETH",
1774
- // "priority": "1",
1775
- // "deposit": true,
1776
- // "withdrawal": true,
1777
- // "currency_id": "USDT",
1778
- // "precision": "6",
1779
- // "min_confirmation_count": "15",
1780
- // "require_destination_tag": false,
1781
- // "allow_withdrawal_destination_tag": false,
1782
- // "display_name": [Object],
1783
- // "min_deposit_amount": "0",
1784
- // "min_withdrawal_amount": "1",
1785
- // "withdrawal_fee": [Array],
1786
- // "deposit_fee": {},
1787
- // "suspended_reason": '',
1788
- // "deposit_suspended": false,
1789
- // "withdrawal_suspended": false,
1790
- // "platform_currency_display_name": [Object]
1791
- // },
1792
- // ],
1793
- // "internal_transfer": { suspended_reason: null, suspended: false },
1794
- // "stakeable": false,
1795
- // "unstakeable": false,
1796
- // "auto_stake": false,
1797
- // "auto_stake_amount": "0"
1798
- // }
1799
- //
1800
- const depositWithdrawFee = this.depositWithdrawFee({});
1801
- const platforms = this.safeValue(fee, 'platform', []);
1802
- const depositResult = {
1803
- 'fee': undefined,
1804
- 'percentage': undefined,
1805
- };
1806
- for (let i = 0; i < platforms.length; i++) {
1807
- const network = platforms[i];
1808
- const networkId = this.safeString(network, 'id');
1809
- const networkCode = this.networkIdToCode(networkId, currency['code']);
1810
- const withdrawalFees = this.safeValue(network, 'withdrawal_fee', {});
1811
- const withdrawFee = this.safeNumber(withdrawalFees[0], 'amount');
1812
- if (withdrawalFees.length) {
1813
- const withdrawResult = {
1814
- 'fee': withdrawFee,
1815
- 'percentage': (withdrawFee !== undefined) ? false : undefined,
1816
- };
1817
- if (i === 0) {
1818
- depositWithdrawFee['withdraw'] = withdrawResult;
1819
- }
1820
- depositWithdrawFee['networks'][networkCode] = {
1821
- 'withdraw': withdrawResult,
1822
- 'deposit': depositResult,
1823
- };
1824
- }
1825
- }
1826
- depositWithdrawFee['info'] = fee;
1827
- return depositWithdrawFee;
1828
- }
1829
- nonce() {
1830
- return this.milliseconds();
1831
- }
1832
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1833
- let url = this.urls['api'][api] + '/';
1834
- const query = this.omit(params, this.extractParams(path));
1835
- if (api === 'accounts') {
1836
- this.checkRequiredCredentials();
1837
- url += this.implodeParams(path, params);
1838
- const auth = this.apiKey + ':' + this.secret;
1839
- const auth64 = this.stringToBase64(auth);
1840
- headers = {
1841
- 'Authorization': 'Basic ' + auth64,
1842
- 'Content-Type': 'application/json',
1843
- };
1844
- if (Object.keys(query).length) {
1845
- body = this.json(query);
1846
- }
1847
- }
1848
- else {
1849
- url += this.version + '/';
1850
- if (api === 'public') {
1851
- url += this.implodeParams(path, params);
1852
- if (Object.keys(query).length) {
1853
- url += '?' + this.urlencode(query);
1854
- }
1855
- }
1856
- else if (api === 'private') {
1857
- const now = this.milliseconds();
1858
- this.checkRequiredCredentials();
1859
- const expires = this.safeInteger(this.options, 'expires');
1860
- if ((expires === undefined) || (expires < now)) {
1861
- throw new AuthenticationError(this.id + ' access token expired, call signIn() method');
1862
- }
1863
- const accessToken = this.safeString(this.options, 'accessToken');
1864
- headers = {
1865
- 'Authorization': 'Bearer ' + accessToken,
1866
- };
1867
- url += this.implodeParams(path, params);
1868
- if (method === 'GET') {
1869
- if (Object.keys(query).length) {
1870
- url += '?' + this.urlencode(query);
1871
- }
1872
- }
1873
- else if (Object.keys(query).length) {
1874
- body = this.json(query);
1875
- headers['Content-Type'] = 'application/json';
1876
- }
1877
- }
1878
- }
1879
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
1880
- }
1881
- /**
1882
- * @method
1883
- * @name probit#signIn
1884
- * @see https://docs-en.probit.com/reference/token
1885
- * @description sign in, must be called prior to using other authenticated methods
1886
- * @param {object} [params] extra parameters specific to the exchange API endpoint
1887
- * @returns response from exchange
1888
- */
1889
- async signIn(params = {}) {
1890
- this.checkRequiredCredentials();
1891
- const request = {
1892
- 'grant_type': 'client_credentials', // the only supported value
1893
- };
1894
- const response = await this.accountsPostToken(this.extend(request, params));
1895
- //
1896
- // {
1897
- // "access_token": "0ttDv/2hTTn3bLi8GP1gKaneiEQ6+0hOBenPrxNQt2s=",
1898
- // "token_type": "bearer",
1899
- // "expires_in": 900
1900
- // }
1901
- //
1902
- const expiresIn = this.safeInteger(response, 'expires_in');
1903
- const accessToken = this.safeString(response, 'access_token');
1904
- this.options['accessToken'] = accessToken;
1905
- this.options['expires'] = this.sum(this.milliseconds(), expiresIn * 1000);
1906
- return response;
1907
- }
1908
- handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
1909
- if (response === undefined) {
1910
- return undefined; // fallback to default error handler
1911
- }
1912
- if ('errorCode' in response) {
1913
- const errorCode = this.safeString(response, 'errorCode');
1914
- if (errorCode !== undefined) {
1915
- const errMessage = this.safeString(response, 'message', '');
1916
- const details = this.safeValue(response, 'details');
1917
- const feedback = this.id + ' ' + errorCode + ' ' + errMessage + ' ' + this.json(details);
1918
- if ('exact' in this.exceptions) {
1919
- this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
1920
- }
1921
- if ('broad' in this.exceptions) {
1922
- this.throwBroadlyMatchedException(this.exceptions['broad'], errMessage, feedback);
1923
- }
1924
- throw new ExchangeError(feedback);
1925
- }
1926
- }
1927
- return undefined;
1928
- }
1929
- }