ccxt 4.2.17 → 4.2.19
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.
- package/README.md +9 -9
- package/dist/ccxt.browser.js +48992 -47725
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +12 -1
- package/dist/cjs/src/alpaca.js +18 -18
- package/dist/cjs/src/ascendex.js +13 -6
- package/dist/cjs/src/base/Exchange.js +266 -27
- package/dist/cjs/src/bigone.js +434 -168
- package/dist/cjs/src/binance.js +163 -34
- package/dist/cjs/src/binanceus.js +8 -0
- package/dist/cjs/src/bingx.js +183 -41
- package/dist/cjs/src/bitfinex.js +2 -3
- package/dist/cjs/src/bitget.js +59 -16
- package/dist/cjs/src/bitmart.js +5 -5
- package/dist/cjs/src/bitmex.js +4 -6
- package/dist/cjs/src/bitpanda.js +5 -1991
- package/dist/cjs/src/bitstamp.js +8 -0
- package/dist/cjs/src/bybit.js +27 -47
- package/dist/cjs/src/coinbase.js +176 -26
- package/dist/cjs/src/coincheck.js +1 -0
- package/dist/cjs/src/coinex.js +3 -0
- package/dist/cjs/src/coinlist.js +13 -6
- package/dist/cjs/src/coinone.js +2 -2
- package/dist/cjs/src/coinsph.js +4 -5
- package/dist/cjs/src/delta.js +7 -1
- package/dist/cjs/src/deribit.js +17 -4
- package/dist/cjs/src/gate.js +151 -169
- package/dist/cjs/src/gemini.js +1 -1
- package/dist/cjs/src/hitbtc.js +2 -3
- package/dist/cjs/src/htx.js +157 -7
- package/dist/cjs/src/huobijp.js +2 -3
- package/dist/cjs/src/independentreserve.js +7 -5
- package/dist/cjs/src/kraken.js +86 -54
- package/dist/cjs/src/kucoin.js +5 -0
- package/dist/cjs/src/kucoinfutures.js +131 -77
- package/dist/cjs/src/lbank.js +60 -33
- package/dist/cjs/src/luno.js +84 -2
- package/dist/cjs/src/mexc.js +3 -3
- package/dist/cjs/src/oceanex.js +1 -1
- package/dist/cjs/src/okx.js +23 -11
- package/dist/cjs/{js/src/bitpanda.js → src/onetrading.js} +39 -39
- package/dist/cjs/src/phemex.js +37 -27
- package/dist/cjs/src/poloniexfutures.js +1 -0
- package/dist/cjs/src/pro/binance.js +66 -25
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitpanda.js +5 -1330
- package/dist/cjs/src/pro/coinbase.js +4 -1
- package/dist/cjs/src/pro/coincheck.js +208 -0
- package/dist/cjs/src/pro/hitbtc.js +5 -4
- package/dist/cjs/src/pro/htx.js +6 -1
- package/dist/cjs/src/pro/kraken.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +7 -1
- package/dist/cjs/src/pro/kucoin.js +46 -36
- package/dist/cjs/src/pro/kucoinfutures.js +45 -37
- package/dist/cjs/src/pro/lbank.js +881 -0
- package/dist/cjs/src/pro/okx.js +52 -2
- package/dist/cjs/{js/src/pro/bitpanda.js → src/pro/onetrading.js} +4 -7
- package/dist/cjs/src/pro/poloniex.js +2 -2
- package/dist/cjs/src/pro/poloniexfutures.js +43 -35
- package/dist/cjs/src/pro/woo.js +126 -0
- package/dist/cjs/src/probit.js +4 -2
- package/dist/cjs/src/upbit.js +12 -12
- package/dist/cjs/src/wavesexchange.js +1 -1
- package/dist/cjs/src/whitebit.js +1 -0
- package/dist/cjs/src/woo.js +56 -0
- package/js/ccxt.d.ts +14 -2
- package/js/ccxt.js +10 -2
- package/js/src/abstract/bitpanda.d.ts +4 -4
- package/js/src/abstract/bitstamp.d.ts +8 -0
- package/js/src/abstract/gate.d.ts +1 -0
- package/js/src/abstract/gateio.d.ts +1 -0
- package/js/src/abstract/htx.d.ts +3 -0
- package/js/src/abstract/huobi.d.ts +3 -0
- package/js/src/abstract/luno.d.ts +1 -0
- package/js/src/abstract/onetrading.d.ts +38 -0
- package/js/src/ascendex.js +2 -0
- package/js/src/base/Exchange.d.ts +2 -3
- package/js/src/base/Exchange.js +5 -2
- package/js/src/binance.js +7 -1
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +26 -0
- package/js/src/bitget.js +22 -3
- package/js/src/bitpanda.d.ts +2 -72
- package/js/src/bitpanda.js +5 -1991
- package/js/src/bitstamp.js +8 -0
- package/js/src/bybit.js +21 -47
- package/js/src/coincheck.js +1 -0
- package/js/src/deribit.js +16 -4
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +50 -110
- package/js/src/htx.js +3 -0
- package/js/src/kraken.d.ts +1 -0
- package/js/src/kraken.js +40 -39
- package/js/src/lbank.js +1 -0
- package/js/src/luno.d.ts +3 -1
- package/js/src/luno.js +84 -2
- package/js/src/mexc.js +1 -2
- package/js/src/onetrading.d.ts +74 -0
- package/js/src/onetrading.js +2003 -0
- package/js/src/poloniexfutures.js +1 -0
- package/js/src/pro/binance.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitpanda.d.ts +2 -34
- package/js/src/pro/bitpanda.js +5 -1330
- package/js/src/pro/coincheck.d.ts +12 -0
- package/js/src/pro/coincheck.js +209 -0
- package/js/src/pro/kucoin.js +43 -35
- package/js/src/pro/kucoinfutures.js +45 -37
- package/js/src/pro/lbank.d.ts +29 -0
- package/js/src/pro/lbank.js +882 -0
- package/js/src/pro/onetrading.d.ts +36 -0
- package/js/src/pro/onetrading.js +1339 -0
- package/js/src/pro/poloniexfutures.js +43 -35
- package/js/src/whitebit.js +1 -0
- package/package.json +2 -2
- package/rollup.config.js +2 -0
- package/skip-tests.json +14 -2
- package/test-commonjs.cjs +25 -1
- package/dist/cjs/js/ccxt.js +0 -476
- package/dist/cjs/js/src/abstract/alpaca.js +0 -9
- package/dist/cjs/js/src/abstract/ascendex.js +0 -9
- package/dist/cjs/js/src/abstract/bigone.js +0 -9
- package/dist/cjs/js/src/abstract/binance.js +0 -9
- package/dist/cjs/js/src/abstract/bingx.js +0 -9
- package/dist/cjs/js/src/abstract/bit2c.js +0 -9
- package/dist/cjs/js/src/abstract/bitbank.js +0 -9
- package/dist/cjs/js/src/abstract/bitbns.js +0 -9
- package/dist/cjs/js/src/abstract/bitfinex.js +0 -9
- package/dist/cjs/js/src/abstract/bitfinex2.js +0 -9
- package/dist/cjs/js/src/abstract/bitflyer.js +0 -9
- package/dist/cjs/js/src/abstract/bitforex.js +0 -9
- package/dist/cjs/js/src/abstract/bitget.js +0 -9
- package/dist/cjs/js/src/abstract/bithumb.js +0 -9
- package/dist/cjs/js/src/abstract/bitmart.js +0 -9
- package/dist/cjs/js/src/abstract/bitmex.js +0 -9
- package/dist/cjs/js/src/abstract/bitopro.js +0 -9
- package/dist/cjs/js/src/abstract/bitpanda.js +0 -9
- package/dist/cjs/js/src/abstract/bitrue.js +0 -9
- package/dist/cjs/js/src/abstract/bitso.js +0 -9
- package/dist/cjs/js/src/abstract/bitstamp.js +0 -9
- package/dist/cjs/js/src/abstract/bitteam.js +0 -9
- package/dist/cjs/js/src/abstract/bitvavo.js +0 -9
- package/dist/cjs/js/src/abstract/bl3p.js +0 -9
- package/dist/cjs/js/src/abstract/blockchaincom.js +0 -9
- package/dist/cjs/js/src/abstract/btcalpha.js +0 -9
- package/dist/cjs/js/src/abstract/btcbox.js +0 -9
- package/dist/cjs/js/src/abstract/btcmarkets.js +0 -9
- package/dist/cjs/js/src/abstract/btcturk.js +0 -9
- package/dist/cjs/js/src/abstract/bybit.js +0 -9
- package/dist/cjs/js/src/abstract/cex.js +0 -9
- package/dist/cjs/js/src/abstract/coinbase.js +0 -9
- package/dist/cjs/js/src/abstract/coinbasepro.js +0 -9
- package/dist/cjs/js/src/abstract/coincheck.js +0 -9
- package/dist/cjs/js/src/abstract/coinex.js +0 -9
- package/dist/cjs/js/src/abstract/coinlist.js +0 -9
- package/dist/cjs/js/src/abstract/coinmate.js +0 -9
- package/dist/cjs/js/src/abstract/coinone.js +0 -9
- package/dist/cjs/js/src/abstract/coinsph.js +0 -9
- package/dist/cjs/js/src/abstract/coinspot.js +0 -9
- package/dist/cjs/js/src/abstract/cryptocom.js +0 -9
- package/dist/cjs/js/src/abstract/currencycom.js +0 -9
- package/dist/cjs/js/src/abstract/delta.js +0 -9
- package/dist/cjs/js/src/abstract/deribit.js +0 -9
- package/dist/cjs/js/src/abstract/digifinex.js +0 -9
- package/dist/cjs/js/src/abstract/exmo.js +0 -9
- package/dist/cjs/js/src/abstract/gate.js +0 -9
- package/dist/cjs/js/src/abstract/gemini.js +0 -9
- package/dist/cjs/js/src/abstract/hitbtc.js +0 -9
- package/dist/cjs/js/src/abstract/hollaex.js +0 -9
- package/dist/cjs/js/src/abstract/htx.js +0 -9
- package/dist/cjs/js/src/abstract/huobijp.js +0 -9
- package/dist/cjs/js/src/abstract/idex.js +0 -9
- package/dist/cjs/js/src/abstract/independentreserve.js +0 -9
- package/dist/cjs/js/src/abstract/indodax.js +0 -9
- package/dist/cjs/js/src/abstract/kraken.js +0 -9
- package/dist/cjs/js/src/abstract/krakenfutures.js +0 -9
- package/dist/cjs/js/src/abstract/kucoin.js +0 -9
- package/dist/cjs/js/src/abstract/kucoinfutures.js +0 -9
- package/dist/cjs/js/src/abstract/kuna.js +0 -9
- package/dist/cjs/js/src/abstract/latoken.js +0 -9
- package/dist/cjs/js/src/abstract/lbank.js +0 -9
- package/dist/cjs/js/src/abstract/luno.js +0 -9
- package/dist/cjs/js/src/abstract/lykke.js +0 -9
- package/dist/cjs/js/src/abstract/mercado.js +0 -9
- package/dist/cjs/js/src/abstract/mexc.js +0 -9
- package/dist/cjs/js/src/abstract/ndax.js +0 -9
- package/dist/cjs/js/src/abstract/novadax.js +0 -9
- package/dist/cjs/js/src/abstract/oceanex.js +0 -9
- package/dist/cjs/js/src/abstract/okcoin.js +0 -9
- package/dist/cjs/js/src/abstract/okx.js +0 -9
- package/dist/cjs/js/src/abstract/p2b.js +0 -9
- package/dist/cjs/js/src/abstract/paymium.js +0 -9
- package/dist/cjs/js/src/abstract/phemex.js +0 -9
- package/dist/cjs/js/src/abstract/poloniex.js +0 -9
- package/dist/cjs/js/src/abstract/poloniexfutures.js +0 -9
- package/dist/cjs/js/src/abstract/probit.js +0 -9
- package/dist/cjs/js/src/abstract/timex.js +0 -9
- package/dist/cjs/js/src/abstract/tokocrypto.js +0 -9
- package/dist/cjs/js/src/abstract/upbit.js +0 -9
- package/dist/cjs/js/src/abstract/wavesexchange.js +0 -9
- package/dist/cjs/js/src/abstract/wazirx.js +0 -9
- package/dist/cjs/js/src/abstract/whitebit.js +0 -9
- package/dist/cjs/js/src/abstract/woo.js +0 -9
- package/dist/cjs/js/src/abstract/yobit.js +0 -9
- package/dist/cjs/js/src/abstract/zaif.js +0 -9
- package/dist/cjs/js/src/abstract/zonda.js +0 -9
- package/dist/cjs/js/src/ace.js +0 -1058
- package/dist/cjs/js/src/alpaca.js +0 -1125
- package/dist/cjs/js/src/ascendex.js +0 -3365
- package/dist/cjs/js/src/base/Exchange.js +0 -5257
- package/dist/cjs/js/src/base/Precise.js +0 -263
- package/dist/cjs/js/src/base/errors.js +0 -299
- package/dist/cjs/js/src/base/functions/crypto.js +0 -78
- package/dist/cjs/js/src/base/functions/encode.js +0 -44
- package/dist/cjs/js/src/base/functions/generic.js +0 -193
- package/dist/cjs/js/src/base/functions/misc.js +0 -96
- package/dist/cjs/js/src/base/functions/number.js +0 -297
- package/dist/cjs/js/src/base/functions/platform.js +0 -28
- package/dist/cjs/js/src/base/functions/rsa.js +0 -34
- package/dist/cjs/js/src/base/functions/string.js +0 -48
- package/dist/cjs/js/src/base/functions/throttle.js +0 -66
- package/dist/cjs/js/src/base/functions/time.js +0 -187
- package/dist/cjs/js/src/base/functions/totp.js +0 -24
- package/dist/cjs/js/src/base/functions/type.js +0 -162
- package/dist/cjs/js/src/base/functions.js +0 -157
- package/dist/cjs/js/src/base/ws/Cache.js +0 -254
- package/dist/cjs/js/src/base/ws/Client.js +0 -299
- package/dist/cjs/js/src/base/ws/Future.js +0 -34
- package/dist/cjs/js/src/base/ws/OrderBook.js +0 -107
- package/dist/cjs/js/src/base/ws/OrderBookSide.js +0 -281
- package/dist/cjs/js/src/base/ws/WsClient.js +0 -69
- package/dist/cjs/js/src/bequant.js +0 -33
- package/dist/cjs/js/src/bigone.js +0 -2213
- package/dist/cjs/js/src/binance.js +0 -9845
- package/dist/cjs/js/src/binancecoinm.js +0 -45
- package/dist/cjs/js/src/binanceus.js +0 -92
- package/dist/cjs/js/src/binanceusdm.js +0 -58
- package/dist/cjs/js/src/bingx.js +0 -3846
- package/dist/cjs/js/src/bit2c.js +0 -916
- package/dist/cjs/js/src/bitbank.js +0 -1000
- package/dist/cjs/js/src/bitbay.js +0 -17
- package/dist/cjs/js/src/bitbns.js +0 -1220
- package/dist/cjs/js/src/bitcoincom.js +0 -17
- package/dist/cjs/js/src/bitfinex.js +0 -1670
- package/dist/cjs/js/src/bitfinex2.js +0 -2990
- package/dist/cjs/js/src/bitflyer.js +0 -1045
- package/dist/cjs/js/src/bitforex.js +0 -852
- package/dist/cjs/js/src/bitget.js +0 -8295
- package/dist/cjs/js/src/bithumb.js +0 -1090
- package/dist/cjs/js/src/bitmart.js +0 -4454
- package/dist/cjs/js/src/bitmex.js +0 -2881
- package/dist/cjs/js/src/bitopro.js +0 -1724
- package/dist/cjs/js/src/bitrue.js +0 -3253
- package/dist/cjs/js/src/bitso.js +0 -1753
- package/dist/cjs/js/src/bitstamp.js +0 -2188
- package/dist/cjs/js/src/bitteam.js +0 -2309
- package/dist/cjs/js/src/bitvavo.js +0 -1968
- package/dist/cjs/js/src/bl3p.js +0 -447
- package/dist/cjs/js/src/blockchaincom.js +0 -1160
- package/dist/cjs/js/src/btcalpha.js +0 -929
- package/dist/cjs/js/src/btcbox.js +0 -565
- package/dist/cjs/js/src/btcmarkets.js +0 -1237
- package/dist/cjs/js/src/btcturk.js +0 -929
- package/dist/cjs/js/src/bybit.js +0 -7650
- package/dist/cjs/js/src/cex.js +0 -1693
- package/dist/cjs/js/src/coinbase.js +0 -3424
- package/dist/cjs/js/src/coinbasepro.js +0 -1866
- package/dist/cjs/js/src/coincheck.js +0 -843
- package/dist/cjs/js/src/coinex.js +0 -5417
- package/dist/cjs/js/src/coinlist.js +0 -2337
- package/dist/cjs/js/src/coinmate.js +0 -989
- package/dist/cjs/js/src/coinone.js +0 -1185
- package/dist/cjs/js/src/coinsph.js +0 -1933
- package/dist/cjs/js/src/coinspot.js +0 -548
- package/dist/cjs/js/src/cryptocom.js +0 -3007
- package/dist/cjs/js/src/currencycom.js +0 -2015
- package/dist/cjs/js/src/delta.js +0 -3262
- package/dist/cjs/js/src/deribit.js +0 -3306
- package/dist/cjs/js/src/digifinex.js +0 -4307
- package/dist/cjs/js/src/exmo.js +0 -2645
- package/dist/cjs/js/src/fmfwio.js +0 -34
- package/dist/cjs/js/src/gate.js +0 -7077
- package/dist/cjs/js/src/gateio.js +0 -16
- package/dist/cjs/js/src/gemini.js +0 -1801
- package/dist/cjs/js/src/hitbtc.js +0 -3660
- package/dist/cjs/js/src/hitbtc3.js +0 -19
- package/dist/cjs/js/src/hollaex.js +0 -1882
- package/dist/cjs/js/src/htx.js +0 -9174
- package/dist/cjs/js/src/huobi.js +0 -16
- package/dist/cjs/js/src/huobijp.js +0 -1918
- package/dist/cjs/js/src/idex.js +0 -1770
- package/dist/cjs/js/src/independentreserve.js +0 -761
- package/dist/cjs/js/src/indodax.js +0 -1069
- package/dist/cjs/js/src/kraken.js +0 -2891
- package/dist/cjs/js/src/krakenfutures.js +0 -2407
- package/dist/cjs/js/src/kucoin.js +0 -4494
- package/dist/cjs/js/src/kucoinfutures.js +0 -2529
- package/dist/cjs/js/src/kuna.js +0 -1949
- package/dist/cjs/js/src/latoken.js +0 -1729
- package/dist/cjs/js/src/lbank.js +0 -2851
- package/dist/cjs/js/src/luno.js +0 -1044
- package/dist/cjs/js/src/lykke.js +0 -1303
- package/dist/cjs/js/src/mercado.js +0 -897
- package/dist/cjs/js/src/mexc.js +0 -5407
- package/dist/cjs/js/src/ndax.js +0 -2450
- package/dist/cjs/js/src/novadax.js +0 -1556
- package/dist/cjs/js/src/oceanex.js +0 -964
- package/dist/cjs/js/src/okcoin.js +0 -3115
- package/dist/cjs/js/src/okx.js +0 -7331
- package/dist/cjs/js/src/p2b.js +0 -1243
- package/dist/cjs/js/src/paymium.js +0 -597
- package/dist/cjs/js/src/phemex.js +0 -4725
- package/dist/cjs/js/src/poloniex.js +0 -2356
- package/dist/cjs/js/src/poloniexfutures.js +0 -1794
- package/dist/cjs/js/src/pro/alpaca.js +0 -714
- package/dist/cjs/js/src/pro/ascendex.js +0 -957
- package/dist/cjs/js/src/pro/bequant.js +0 -33
- package/dist/cjs/js/src/pro/binance.js +0 -2796
- package/dist/cjs/js/src/pro/binancecoinm.js +0 -23
- package/dist/cjs/js/src/pro/binanceus.js +0 -51
- package/dist/cjs/js/src/pro/binanceusdm.js +0 -32
- package/dist/cjs/js/src/pro/bingx.js +0 -944
- package/dist/cjs/js/src/pro/bitcoincom.js +0 -29
- package/dist/cjs/js/src/pro/bitfinex.js +0 -672
- package/dist/cjs/js/src/pro/bitfinex2.js +0 -1159
- package/dist/cjs/js/src/pro/bitget.js +0 -1733
- package/dist/cjs/js/src/pro/bitmart.js +0 -1486
- package/dist/cjs/js/src/pro/bitmex.js +0 -1576
- package/dist/cjs/js/src/pro/bitopro.js +0 -327
- package/dist/cjs/js/src/pro/bitrue.js +0 -462
- package/dist/cjs/js/src/pro/bitstamp.js +0 -547
- package/dist/cjs/js/src/pro/bitvavo.js +0 -704
- package/dist/cjs/js/src/pro/blockchaincom.js +0 -794
- package/dist/cjs/js/src/pro/bybit.js +0 -1843
- package/dist/cjs/js/src/pro/cex.js +0 -1510
- package/dist/cjs/js/src/pro/coinbase.js +0 -561
- package/dist/cjs/js/src/pro/coinbasepro.js +0 -968
- package/dist/cjs/js/src/pro/coinex.js +0 -1095
- package/dist/cjs/js/src/pro/cryptocom.js +0 -1020
- package/dist/cjs/js/src/pro/currencycom.js +0 -563
- package/dist/cjs/js/src/pro/deribit.js +0 -825
- package/dist/cjs/js/src/pro/exmo.js +0 -658
- package/dist/cjs/js/src/pro/gate.js +0 -1316
- package/dist/cjs/js/src/pro/gateio.js +0 -16
- package/dist/cjs/js/src/pro/gemini.js +0 -649
- package/dist/cjs/js/src/pro/hitbtc.js +0 -1294
- package/dist/cjs/js/src/pro/hollaex.js +0 -597
- package/dist/cjs/js/src/pro/htx.js +0 -2388
- package/dist/cjs/js/src/pro/huobi.js +0 -16
- package/dist/cjs/js/src/pro/huobijp.js +0 -606
- package/dist/cjs/js/src/pro/idex.js +0 -714
- package/dist/cjs/js/src/pro/independentreserve.js +0 -280
- package/dist/cjs/js/src/pro/kraken.js +0 -1364
- package/dist/cjs/js/src/pro/krakenfutures.js +0 -1506
- package/dist/cjs/js/src/pro/kucoin.js +0 -1054
- package/dist/cjs/js/src/pro/kucoinfutures.js +0 -981
- package/dist/cjs/js/src/pro/luno.js +0 -322
- package/dist/cjs/js/src/pro/mexc.js +0 -1170
- package/dist/cjs/js/src/pro/ndax.js +0 -545
- package/dist/cjs/js/src/pro/okcoin.js +0 -760
- package/dist/cjs/js/src/pro/okx.js +0 -1608
- package/dist/cjs/js/src/pro/phemex.js +0 -1511
- package/dist/cjs/js/src/pro/poloniex.js +0 -1253
- package/dist/cjs/js/src/pro/poloniexfutures.js +0 -1014
- package/dist/cjs/js/src/pro/probit.js +0 -586
- package/dist/cjs/js/src/pro/upbit.js +0 -234
- package/dist/cjs/js/src/pro/wazirx.js +0 -776
- package/dist/cjs/js/src/pro/whitebit.js +0 -927
- package/dist/cjs/js/src/pro/woo.js +0 -895
- package/dist/cjs/js/src/probit.js +0 -1867
- package/dist/cjs/js/src/static_dependencies/fflake/browser.js +0 -401
- package/dist/cjs/js/src/static_dependencies/jsencrypt/JSEncrypt.js +0 -195
- package/dist/cjs/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +0 -308
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +0 -554
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +0 -94
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +0 -70
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +0 -91
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +0 -16
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +0 -1760
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +0 -52
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +0 -81
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +0 -376
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/util.js +0 -70
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +0 -1580
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +0 -74
- package/dist/cjs/js/src/static_dependencies/noble-curves/_shortw_utils.js +0 -24
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/curve.js +0 -158
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/edwards.js +0 -429
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +0 -176
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/modular.js +0 -324
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/montgomery.js +0 -163
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/utils.js +0 -245
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/weierstrass.js +0 -1018
- package/dist/cjs/js/src/static_dependencies/noble-curves/ed25519.js +0 -383
- package/dist/cjs/js/src/static_dependencies/noble-curves/secp256k1.js +0 -258
- package/dist/cjs/js/src/static_dependencies/noble-hashes/_assert.js +0 -53
- package/dist/cjs/js/src/static_dependencies/noble-hashes/_sha2.js +0 -120
- package/dist/cjs/js/src/static_dependencies/noble-hashes/_u64.js +0 -69
- package/dist/cjs/js/src/static_dependencies/noble-hashes/crypto.js +0 -7
- package/dist/cjs/js/src/static_dependencies/noble-hashes/hmac.js +0 -83
- package/dist/cjs/js/src/static_dependencies/noble-hashes/md5.js +0 -240
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha1.js +0 -91
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha256.js +0 -130
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha3.js +0 -214
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha512.js +0 -239
- package/dist/cjs/js/src/static_dependencies/noble-hashes/utils.js +0 -93
- package/dist/cjs/js/src/static_dependencies/node-fetch/body.js +0 -354
- package/dist/cjs/js/src/static_dependencies/node-fetch/errors/abort-error.js +0 -16
- package/dist/cjs/js/src/static_dependencies/node-fetch/errors/base.js +0 -20
- package/dist/cjs/js/src/static_dependencies/node-fetch/errors/fetch-error.js +0 -30
- package/dist/cjs/js/src/static_dependencies/node-fetch/headers.js +0 -239
- package/dist/cjs/js/src/static_dependencies/node-fetch/index.js +0 -372
- package/dist/cjs/js/src/static_dependencies/node-fetch/request.js +0 -273
- package/dist/cjs/js/src/static_dependencies/node-fetch/response.js +0 -139
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/get-search.js +0 -14
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/is-redirect.js +0 -16
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/is.js +0 -81
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/referrer.js +0 -292
- package/dist/cjs/js/src/static_dependencies/proxies/agent-base/index.js +0 -103
- package/dist/cjs/js/src/static_dependencies/proxies/http-proxy-agent/index.js +0 -140
- package/dist/cjs/js/src/static_dependencies/proxies/https-proxy-agent/index.js +0 -175
- package/dist/cjs/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +0 -95
- package/dist/cjs/js/src/static_dependencies/qs/index.cjs.js +0 -7
- package/dist/cjs/js/src/static_dependencies/scure-base/index.js +0 -383
- package/dist/cjs/js/src/timex.js +0 -1562
- package/dist/cjs/js/src/tokocrypto.js +0 -2542
- package/dist/cjs/js/src/upbit.js +0 -1844
- package/dist/cjs/js/src/wavesexchange.js +0 -2607
- package/dist/cjs/js/src/wazirx.js +0 -953
- package/dist/cjs/js/src/whitebit.js +0 -2309
- package/dist/cjs/js/src/woo.js +0 -2769
- package/dist/cjs/js/src/yobit.js +0 -1314
- package/dist/cjs/js/src/zaif.js +0 -736
- package/dist/cjs/js/src/zonda.js +0 -1883
- package/dist/cjs/src/abstract/bitpanda.js +0 -9
- package/test.ts +0 -0
- /package/dist/cjs/{js/src/abstract/ace.js → src/abstract/onetrading.js} +0 -0
- /package/dist/cjs/{js/src → src}/pro/coinone.js +0 -0
- /package/js/src/abstract/{bitpanda.js → onetrading.js} +0 -0
|
@@ -1,989 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var coinmate$1 = require('./abstract/coinmate.js');
|
|
4
|
-
var errors = require('./base/errors.js');
|
|
5
|
-
var Precise = require('./base/Precise.js');
|
|
6
|
-
var number = require('./base/functions/number.js');
|
|
7
|
-
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
8
|
-
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
/**
|
|
12
|
-
* @class coinmate
|
|
13
|
-
* @augments Exchange
|
|
14
|
-
*/
|
|
15
|
-
class coinmate extends coinmate$1 {
|
|
16
|
-
describe() {
|
|
17
|
-
return this.deepExtend(super.describe(), {
|
|
18
|
-
'id': 'coinmate',
|
|
19
|
-
'name': 'CoinMate',
|
|
20
|
-
'countries': ['GB', 'CZ', 'EU'],
|
|
21
|
-
'rateLimit': 1000,
|
|
22
|
-
'has': {
|
|
23
|
-
'CORS': true,
|
|
24
|
-
'spot': true,
|
|
25
|
-
'margin': false,
|
|
26
|
-
'swap': false,
|
|
27
|
-
'future': false,
|
|
28
|
-
'option': false,
|
|
29
|
-
'addMargin': false,
|
|
30
|
-
'cancelOrder': true,
|
|
31
|
-
'closeAllPositions': false,
|
|
32
|
-
'closePosition': false,
|
|
33
|
-
'createOrder': true,
|
|
34
|
-
'createReduceOnlyOrder': false,
|
|
35
|
-
'fetchBalance': true,
|
|
36
|
-
'fetchBorrowRateHistories': false,
|
|
37
|
-
'fetchBorrowRateHistory': false,
|
|
38
|
-
'fetchCrossBorrowRate': false,
|
|
39
|
-
'fetchCrossBorrowRates': false,
|
|
40
|
-
'fetchDepositsWithdrawals': true,
|
|
41
|
-
'fetchFundingHistory': false,
|
|
42
|
-
'fetchFundingRate': false,
|
|
43
|
-
'fetchFundingRateHistory': false,
|
|
44
|
-
'fetchFundingRates': false,
|
|
45
|
-
'fetchIndexOHLCV': false,
|
|
46
|
-
'fetchIsolatedBorrowRate': false,
|
|
47
|
-
'fetchIsolatedBorrowRates': false,
|
|
48
|
-
'fetchLeverage': false,
|
|
49
|
-
'fetchLeverageTiers': false,
|
|
50
|
-
'fetchMarginMode': false,
|
|
51
|
-
'fetchMarkets': true,
|
|
52
|
-
'fetchMarkOHLCV': false,
|
|
53
|
-
'fetchMyTrades': true,
|
|
54
|
-
'fetchOpenInterestHistory': false,
|
|
55
|
-
'fetchOpenOrders': true,
|
|
56
|
-
'fetchOrder': true,
|
|
57
|
-
'fetchOrderBook': true,
|
|
58
|
-
'fetchOrders': true,
|
|
59
|
-
'fetchPosition': false,
|
|
60
|
-
'fetchPositionMode': false,
|
|
61
|
-
'fetchPositions': false,
|
|
62
|
-
'fetchPositionsRisk': false,
|
|
63
|
-
'fetchPremiumIndexOHLCV': false,
|
|
64
|
-
'fetchTicker': true,
|
|
65
|
-
'fetchTrades': true,
|
|
66
|
-
'fetchTradingFee': true,
|
|
67
|
-
'fetchTradingFees': false,
|
|
68
|
-
'fetchTransactions': 'emulated',
|
|
69
|
-
'reduceMargin': false,
|
|
70
|
-
'setLeverage': false,
|
|
71
|
-
'setMarginMode': false,
|
|
72
|
-
'setPositionMode': false,
|
|
73
|
-
'transfer': false,
|
|
74
|
-
'withdraw': true,
|
|
75
|
-
},
|
|
76
|
-
'urls': {
|
|
77
|
-
'logo': 'https://user-images.githubusercontent.com/51840849/87460806-1c9f3f00-c616-11ea-8c46-a77018a8f3f4.jpg',
|
|
78
|
-
'api': {
|
|
79
|
-
'rest': 'https://coinmate.io/api',
|
|
80
|
-
},
|
|
81
|
-
'www': 'https://coinmate.io',
|
|
82
|
-
'fees': 'https://coinmate.io/fees',
|
|
83
|
-
'doc': [
|
|
84
|
-
'https://coinmate.docs.apiary.io',
|
|
85
|
-
'https://coinmate.io/developers',
|
|
86
|
-
],
|
|
87
|
-
'referral': 'https://coinmate.io?referral=YTFkM1RsOWFObVpmY1ZjMGREQmpTRnBsWjJJNVp3PT0',
|
|
88
|
-
},
|
|
89
|
-
'requiredCredentials': {
|
|
90
|
-
'apiKey': true,
|
|
91
|
-
'secret': true,
|
|
92
|
-
'uid': true,
|
|
93
|
-
},
|
|
94
|
-
'api': {
|
|
95
|
-
'public': {
|
|
96
|
-
'get': [
|
|
97
|
-
'orderBook',
|
|
98
|
-
'ticker',
|
|
99
|
-
'transactions',
|
|
100
|
-
'tradingPairs',
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
'private': {
|
|
104
|
-
'post': [
|
|
105
|
-
'balances',
|
|
106
|
-
'bitcoinCashWithdrawal',
|
|
107
|
-
'bitcoinCashDepositAddresses',
|
|
108
|
-
'bitcoinDepositAddresses',
|
|
109
|
-
'bitcoinWithdrawal',
|
|
110
|
-
'bitcoinWithdrawalFees',
|
|
111
|
-
'buyInstant',
|
|
112
|
-
'buyLimit',
|
|
113
|
-
'cancelOrder',
|
|
114
|
-
'cancelOrderWithInfo',
|
|
115
|
-
'createVoucher',
|
|
116
|
-
'dashDepositAddresses',
|
|
117
|
-
'dashWithdrawal',
|
|
118
|
-
'ethereumWithdrawal',
|
|
119
|
-
'ethereumDepositAddresses',
|
|
120
|
-
'litecoinWithdrawal',
|
|
121
|
-
'litecoinDepositAddresses',
|
|
122
|
-
'openOrders',
|
|
123
|
-
'order',
|
|
124
|
-
'orderHistory',
|
|
125
|
-
'orderById',
|
|
126
|
-
'pusherAuth',
|
|
127
|
-
'redeemVoucher',
|
|
128
|
-
'replaceByBuyLimit',
|
|
129
|
-
'replaceByBuyInstant',
|
|
130
|
-
'replaceBySellLimit',
|
|
131
|
-
'replaceBySellInstant',
|
|
132
|
-
'rippleDepositAddresses',
|
|
133
|
-
'rippleWithdrawal',
|
|
134
|
-
'sellInstant',
|
|
135
|
-
'sellLimit',
|
|
136
|
-
'transactionHistory',
|
|
137
|
-
'traderFees',
|
|
138
|
-
'tradeHistory',
|
|
139
|
-
'transfer',
|
|
140
|
-
'transferHistory',
|
|
141
|
-
'unconfirmedBitcoinDeposits',
|
|
142
|
-
'unconfirmedBitcoinCashDeposits',
|
|
143
|
-
'unconfirmedDashDeposits',
|
|
144
|
-
'unconfirmedEthereumDeposits',
|
|
145
|
-
'unconfirmedLitecoinDeposits',
|
|
146
|
-
'unconfirmedRippleDeposits',
|
|
147
|
-
],
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
'fees': {
|
|
151
|
-
'trading': {
|
|
152
|
-
'tierBased': true,
|
|
153
|
-
'percentage': true,
|
|
154
|
-
'maker': this.parseNumber('0.0012'),
|
|
155
|
-
'taker': this.parseNumber('0.0025'),
|
|
156
|
-
'tiers': {
|
|
157
|
-
'taker': [
|
|
158
|
-
[this.parseNumber('0'), this.parseNumber('0.0035')],
|
|
159
|
-
[this.parseNumber('10000'), this.parseNumber('0.0023')],
|
|
160
|
-
[this.parseNumber('100000'), this.parseNumber('0.0021')],
|
|
161
|
-
[this.parseNumber('250000'), this.parseNumber('0.0020')],
|
|
162
|
-
[this.parseNumber('500000'), this.parseNumber('0.0015')],
|
|
163
|
-
[this.parseNumber('1000000'), this.parseNumber('0.0013')],
|
|
164
|
-
[this.parseNumber('3000000'), this.parseNumber('0.0010')],
|
|
165
|
-
[this.parseNumber('15000000'), this.parseNumber('0.0005')],
|
|
166
|
-
],
|
|
167
|
-
'maker': [
|
|
168
|
-
[this.parseNumber('0'), this.parseNumber('0.003')],
|
|
169
|
-
[this.parseNumber('10000'), this.parseNumber('0.0011')],
|
|
170
|
-
[this.parseNumber('100000'), this.parseNumber('0.0010')],
|
|
171
|
-
[this.parseNumber('250000'), this.parseNumber('0.0008')],
|
|
172
|
-
[this.parseNumber('500000'), this.parseNumber('0.0005')],
|
|
173
|
-
[this.parseNumber('1000000'), this.parseNumber('0.0003')],
|
|
174
|
-
[this.parseNumber('3000000'), this.parseNumber('0.0002')],
|
|
175
|
-
[this.parseNumber('15000000'), this.parseNumber('0')],
|
|
176
|
-
],
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
'options': {
|
|
181
|
-
'withdraw': {
|
|
182
|
-
'fillResponsefromRequest': true,
|
|
183
|
-
'methods': {
|
|
184
|
-
'BTC': 'privatePostBitcoinWithdrawal',
|
|
185
|
-
'LTC': 'privatePostLitecoinWithdrawal',
|
|
186
|
-
'BCH': 'privatePostBitcoinCashWithdrawal',
|
|
187
|
-
'ETH': 'privatePostEthereumWithdrawal',
|
|
188
|
-
'XRP': 'privatePostRippleWithdrawal',
|
|
189
|
-
'DASH': 'privatePostDashWithdrawal',
|
|
190
|
-
'DAI': 'privatePostDaiWithdrawal',
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
'exceptions': {
|
|
195
|
-
'exact': {
|
|
196
|
-
'No order with given ID': errors.OrderNotFound,
|
|
197
|
-
},
|
|
198
|
-
'broad': {
|
|
199
|
-
'Not enough account balance available': errors.InsufficientFunds,
|
|
200
|
-
'Incorrect order ID': errors.InvalidOrder,
|
|
201
|
-
'Minimum Order Size ': errors.InvalidOrder,
|
|
202
|
-
'max allowed precision': errors.InvalidOrder,
|
|
203
|
-
'TOO MANY REQUESTS': errors.RateLimitExceeded,
|
|
204
|
-
'Access denied.': errors.AuthenticationError, // {"error":true,"errorMessage":"Access denied.","data":null}
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
'precisionMode': number.TICK_SIZE,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
async fetchMarkets(params = {}) {
|
|
211
|
-
/**
|
|
212
|
-
* @method
|
|
213
|
-
* @name coinmate#fetchMarkets
|
|
214
|
-
* @description retrieves data on all markets for coinmate
|
|
215
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
216
|
-
* @returns {object[]} an array of objects representing market data
|
|
217
|
-
*/
|
|
218
|
-
const response = await this.publicGetTradingPairs(params);
|
|
219
|
-
//
|
|
220
|
-
// {
|
|
221
|
-
// "error":false,
|
|
222
|
-
// "errorMessage":null,
|
|
223
|
-
// "data": [
|
|
224
|
-
// {
|
|
225
|
-
// "name":"BTC_EUR",
|
|
226
|
-
// "firstCurrency":"BTC",
|
|
227
|
-
// "secondCurrency":"EUR",
|
|
228
|
-
// "priceDecimals":2,
|
|
229
|
-
// "lotDecimals":8,
|
|
230
|
-
// "minAmount":0.0002,
|
|
231
|
-
// "tradesWebSocketChannelId":"trades-BTC_EUR",
|
|
232
|
-
// "orderBookWebSocketChannelId":"order_book-BTC_EUR",
|
|
233
|
-
// "tradeStatisticsWebSocketChannelId":"statistics-BTC_EUR"
|
|
234
|
-
// },
|
|
235
|
-
// ]
|
|
236
|
-
// }
|
|
237
|
-
//
|
|
238
|
-
const data = this.safeValue(response, 'data', []);
|
|
239
|
-
const result = [];
|
|
240
|
-
for (let i = 0; i < data.length; i++) {
|
|
241
|
-
const market = data[i];
|
|
242
|
-
const id = this.safeString(market, 'name');
|
|
243
|
-
const baseId = this.safeString(market, 'firstCurrency');
|
|
244
|
-
const quoteId = this.safeString(market, 'secondCurrency');
|
|
245
|
-
const base = this.safeCurrencyCode(baseId);
|
|
246
|
-
const quote = this.safeCurrencyCode(quoteId);
|
|
247
|
-
const symbol = base + '/' + quote;
|
|
248
|
-
result.push({
|
|
249
|
-
'id': id,
|
|
250
|
-
'symbol': symbol,
|
|
251
|
-
'base': base,
|
|
252
|
-
'quote': quote,
|
|
253
|
-
'settle': undefined,
|
|
254
|
-
'baseId': baseId,
|
|
255
|
-
'quoteId': quoteId,
|
|
256
|
-
'settleId': undefined,
|
|
257
|
-
'type': 'spot',
|
|
258
|
-
'spot': true,
|
|
259
|
-
'margin': false,
|
|
260
|
-
'swap': false,
|
|
261
|
-
'future': false,
|
|
262
|
-
'option': false,
|
|
263
|
-
'active': undefined,
|
|
264
|
-
'contract': false,
|
|
265
|
-
'linear': undefined,
|
|
266
|
-
'inverse': undefined,
|
|
267
|
-
'contractSize': undefined,
|
|
268
|
-
'expiry': undefined,
|
|
269
|
-
'expiryDatetime': undefined,
|
|
270
|
-
'strike': undefined,
|
|
271
|
-
'optionType': undefined,
|
|
272
|
-
'precision': {
|
|
273
|
-
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'lotDecimals'))),
|
|
274
|
-
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'priceDecimals'))),
|
|
275
|
-
},
|
|
276
|
-
'limits': {
|
|
277
|
-
'leverage': {
|
|
278
|
-
'min': undefined,
|
|
279
|
-
'max': undefined,
|
|
280
|
-
},
|
|
281
|
-
'amount': {
|
|
282
|
-
'min': this.safeNumber(market, 'minAmount'),
|
|
283
|
-
'max': undefined,
|
|
284
|
-
},
|
|
285
|
-
'price': {
|
|
286
|
-
'min': undefined,
|
|
287
|
-
'max': undefined,
|
|
288
|
-
},
|
|
289
|
-
'cost': {
|
|
290
|
-
'min': undefined,
|
|
291
|
-
'max': undefined,
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
'created': undefined,
|
|
295
|
-
'info': market,
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
return result;
|
|
299
|
-
}
|
|
300
|
-
parseBalance(response) {
|
|
301
|
-
const balances = this.safeValue(response, 'data', {});
|
|
302
|
-
const result = { 'info': response };
|
|
303
|
-
const currencyIds = Object.keys(balances);
|
|
304
|
-
for (let i = 0; i < currencyIds.length; i++) {
|
|
305
|
-
const currencyId = currencyIds[i];
|
|
306
|
-
const code = this.safeCurrencyCode(currencyId);
|
|
307
|
-
const balance = this.safeValue(balances, currencyId);
|
|
308
|
-
const account = this.account();
|
|
309
|
-
account['free'] = this.safeString(balance, 'available');
|
|
310
|
-
account['used'] = this.safeString(balance, 'reserved');
|
|
311
|
-
account['total'] = this.safeString(balance, 'balance');
|
|
312
|
-
result[code] = account;
|
|
313
|
-
}
|
|
314
|
-
return this.safeBalance(result);
|
|
315
|
-
}
|
|
316
|
-
async fetchBalance(params = {}) {
|
|
317
|
-
/**
|
|
318
|
-
* @method
|
|
319
|
-
* @name coinmate#fetchBalance
|
|
320
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
321
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
322
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
323
|
-
*/
|
|
324
|
-
await this.loadMarkets();
|
|
325
|
-
const response = await this.privatePostBalances(params);
|
|
326
|
-
return this.parseBalance(response);
|
|
327
|
-
}
|
|
328
|
-
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
329
|
-
/**
|
|
330
|
-
* @method
|
|
331
|
-
* @name coinmate#fetchOrderBook
|
|
332
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
333
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
334
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
335
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
336
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
337
|
-
*/
|
|
338
|
-
await this.loadMarkets();
|
|
339
|
-
const market = this.market(symbol);
|
|
340
|
-
const request = {
|
|
341
|
-
'currencyPair': market['id'],
|
|
342
|
-
'groupByPriceLimit': 'False',
|
|
343
|
-
};
|
|
344
|
-
const response = await this.publicGetOrderBook(this.extend(request, params));
|
|
345
|
-
const orderbook = response['data'];
|
|
346
|
-
const timestamp = this.safeTimestamp(orderbook, 'timestamp');
|
|
347
|
-
return this.parseOrderBook(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'amount');
|
|
348
|
-
}
|
|
349
|
-
async fetchTicker(symbol, params = {}) {
|
|
350
|
-
/**
|
|
351
|
-
* @method
|
|
352
|
-
* @name coinmate#fetchTicker
|
|
353
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
354
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
355
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
356
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
357
|
-
*/
|
|
358
|
-
await this.loadMarkets();
|
|
359
|
-
const market = this.market(symbol);
|
|
360
|
-
const request = {
|
|
361
|
-
'currencyPair': market['id'],
|
|
362
|
-
};
|
|
363
|
-
const response = await this.publicGetTicker(this.extend(request, params));
|
|
364
|
-
const ticker = this.safeValue(response, 'data');
|
|
365
|
-
const timestamp = this.safeTimestamp(ticker, 'timestamp');
|
|
366
|
-
const last = this.safeNumber(ticker, 'last');
|
|
367
|
-
return this.safeTicker({
|
|
368
|
-
'symbol': market['symbol'],
|
|
369
|
-
'timestamp': timestamp,
|
|
370
|
-
'datetime': this.iso8601(timestamp),
|
|
371
|
-
'high': this.safeNumber(ticker, 'high'),
|
|
372
|
-
'low': this.safeNumber(ticker, 'low'),
|
|
373
|
-
'bid': this.safeNumber(ticker, 'bid'),
|
|
374
|
-
'bidVolume': undefined,
|
|
375
|
-
'ask': this.safeNumber(ticker, 'ask'),
|
|
376
|
-
'vwap': undefined,
|
|
377
|
-
'askVolume': undefined,
|
|
378
|
-
'open': undefined,
|
|
379
|
-
'close': last,
|
|
380
|
-
'last': last,
|
|
381
|
-
'previousClose': undefined,
|
|
382
|
-
'change': undefined,
|
|
383
|
-
'percentage': undefined,
|
|
384
|
-
'average': undefined,
|
|
385
|
-
'baseVolume': this.safeNumber(ticker, 'amount'),
|
|
386
|
-
'quoteVolume': undefined,
|
|
387
|
-
'info': ticker,
|
|
388
|
-
}, market);
|
|
389
|
-
}
|
|
390
|
-
async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
391
|
-
/**
|
|
392
|
-
* @method
|
|
393
|
-
* @name coinmate#fetchDepositsWithdrawals
|
|
394
|
-
* @description fetch history of deposits and withdrawals
|
|
395
|
-
* @param {string} [code] unified currency code for the currency of the deposit/withdrawals, default is undefined
|
|
396
|
-
* @param {int} [since] timestamp in ms of the earliest deposit/withdrawal, default is undefined
|
|
397
|
-
* @param {int} [limit] max number of deposit/withdrawals to return, default is undefined
|
|
398
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
399
|
-
* @returns {object} a list of [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
400
|
-
*/
|
|
401
|
-
await this.loadMarkets();
|
|
402
|
-
const request = {
|
|
403
|
-
'limit': 1000,
|
|
404
|
-
};
|
|
405
|
-
if (limit !== undefined) {
|
|
406
|
-
request['limit'] = limit;
|
|
407
|
-
}
|
|
408
|
-
if (since !== undefined) {
|
|
409
|
-
request['timestampFrom'] = since;
|
|
410
|
-
}
|
|
411
|
-
if (code !== undefined) {
|
|
412
|
-
const currency = this.currency(code);
|
|
413
|
-
request['currency'] = currency['id'];
|
|
414
|
-
}
|
|
415
|
-
const response = await this.privatePostTransferHistory(this.extend(request, params));
|
|
416
|
-
const items = response['data'];
|
|
417
|
-
return this.parseTransactions(items, undefined, since, limit);
|
|
418
|
-
}
|
|
419
|
-
parseTransactionStatus(status) {
|
|
420
|
-
const statuses = {
|
|
421
|
-
'COMPLETED': 'ok',
|
|
422
|
-
'WAITING': 'pending',
|
|
423
|
-
'SENT': 'pending',
|
|
424
|
-
'CREATED': 'pending',
|
|
425
|
-
'OK': 'ok',
|
|
426
|
-
'NEW': 'pending',
|
|
427
|
-
'CANCELED': 'canceled',
|
|
428
|
-
};
|
|
429
|
-
return this.safeString(statuses, status, status);
|
|
430
|
-
}
|
|
431
|
-
parseTransaction(transaction, currency = undefined) {
|
|
432
|
-
//
|
|
433
|
-
// deposits
|
|
434
|
-
//
|
|
435
|
-
// {
|
|
436
|
-
// "transactionId": 1862815,
|
|
437
|
-
// "timestamp": 1516803982388,
|
|
438
|
-
// "amountCurrency": "LTC",
|
|
439
|
-
// "amount": 1,
|
|
440
|
-
// "fee": 0,
|
|
441
|
-
// "walletType": "LTC",
|
|
442
|
-
// "transferType": "DEPOSIT",
|
|
443
|
-
// "transferStatus": "COMPLETED",
|
|
444
|
-
// "txid":
|
|
445
|
-
// "ccb9255dfa874e6c28f1a64179769164025329d65e5201849c2400abd6bce245",
|
|
446
|
-
// "destination": "LQrtSKA6LnhcwRrEuiborQJnjFF56xqsFn",
|
|
447
|
-
// "destinationTag": null
|
|
448
|
-
// }
|
|
449
|
-
//
|
|
450
|
-
// withdrawals
|
|
451
|
-
//
|
|
452
|
-
// {
|
|
453
|
-
// "transactionId": 2140966,
|
|
454
|
-
// "timestamp": 1519314282976,
|
|
455
|
-
// "amountCurrency": "EUR",
|
|
456
|
-
// "amount": 8421.7228,
|
|
457
|
-
// "fee": 16.8772,
|
|
458
|
-
// "walletType": "BANK_WIRE",
|
|
459
|
-
// "transferType": "WITHDRAWAL",
|
|
460
|
-
// "transferStatus": "COMPLETED",
|
|
461
|
-
// "txid": null,
|
|
462
|
-
// "destination": null,
|
|
463
|
-
// "destinationTag": null
|
|
464
|
-
// }
|
|
465
|
-
//
|
|
466
|
-
// withdraw
|
|
467
|
-
//
|
|
468
|
-
// {
|
|
469
|
-
// "id": 2132583,
|
|
470
|
-
// }
|
|
471
|
-
//
|
|
472
|
-
const timestamp = this.safeInteger(transaction, 'timestamp');
|
|
473
|
-
const currencyId = this.safeString(transaction, 'amountCurrency');
|
|
474
|
-
const code = this.safeCurrencyCode(currencyId, currency);
|
|
475
|
-
return {
|
|
476
|
-
'info': transaction,
|
|
477
|
-
'id': this.safeString2(transaction, 'transactionId', 'id'),
|
|
478
|
-
'txid': this.safeString(transaction, 'txid'),
|
|
479
|
-
'type': this.safeStringLower(transaction, 'transferType'),
|
|
480
|
-
'currency': code,
|
|
481
|
-
'network': this.safeString(transaction, 'walletType'),
|
|
482
|
-
'amount': this.safeNumber(transaction, 'amount'),
|
|
483
|
-
'status': this.parseTransactionStatus(this.safeString(transaction, 'transferStatus')),
|
|
484
|
-
'timestamp': timestamp,
|
|
485
|
-
'datetime': this.iso8601(timestamp),
|
|
486
|
-
'address': this.safeString(transaction, 'destination'),
|
|
487
|
-
'addressFrom': undefined,
|
|
488
|
-
'addressTo': undefined,
|
|
489
|
-
'tag': this.safeString(transaction, 'destinationTag'),
|
|
490
|
-
'tagFrom': undefined,
|
|
491
|
-
'tagTo': undefined,
|
|
492
|
-
'updated': undefined,
|
|
493
|
-
'comment': undefined,
|
|
494
|
-
'internal': undefined,
|
|
495
|
-
'fee': {
|
|
496
|
-
'cost': this.safeNumber(transaction, 'fee'),
|
|
497
|
-
'currency': code,
|
|
498
|
-
'rate': undefined,
|
|
499
|
-
},
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
503
|
-
/**
|
|
504
|
-
* @method
|
|
505
|
-
* @name coinmate#withdraw
|
|
506
|
-
* @description make a withdrawal
|
|
507
|
-
* @param {string} code unified currency code
|
|
508
|
-
* @param {float} amount the amount to withdraw
|
|
509
|
-
* @param {string} address the address to withdraw to
|
|
510
|
-
* @param {string} tag
|
|
511
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
512
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
513
|
-
*/
|
|
514
|
-
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
515
|
-
this.checkAddress(address);
|
|
516
|
-
await this.loadMarkets();
|
|
517
|
-
const currency = this.currency(code);
|
|
518
|
-
const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
|
|
519
|
-
const methods = this.safeValue(withdrawOptions, 'methods', {});
|
|
520
|
-
const method = this.safeString(methods, code);
|
|
521
|
-
if (method === undefined) {
|
|
522
|
-
const allowedCurrencies = Object.keys(methods);
|
|
523
|
-
throw new errors.ExchangeError(this.id + ' withdraw() only allows withdrawing the following currencies: ' + allowedCurrencies.join(', '));
|
|
524
|
-
}
|
|
525
|
-
const request = {
|
|
526
|
-
'amount': this.currencyToPrecision(code, amount),
|
|
527
|
-
'address': address,
|
|
528
|
-
};
|
|
529
|
-
if (tag !== undefined) {
|
|
530
|
-
request['destinationTag'] = tag;
|
|
531
|
-
}
|
|
532
|
-
const response = await this[method](this.extend(request, params));
|
|
533
|
-
//
|
|
534
|
-
// {
|
|
535
|
-
// "error": false,
|
|
536
|
-
// "errorMessage": null,
|
|
537
|
-
// "data": {
|
|
538
|
-
// "id": "9e0a37fc-4ab4-4b9d-b9e7-c9c8f7c4c8e0"
|
|
539
|
-
// }
|
|
540
|
-
// }
|
|
541
|
-
//
|
|
542
|
-
const data = this.safeValue(response, 'data');
|
|
543
|
-
const transaction = this.parseTransaction(data, currency);
|
|
544
|
-
const fillResponseFromRequest = this.safeValue(withdrawOptions, 'fillResponseFromRequest', true);
|
|
545
|
-
if (fillResponseFromRequest) {
|
|
546
|
-
transaction['amount'] = amount;
|
|
547
|
-
transaction['currency'] = code;
|
|
548
|
-
transaction['address'] = address;
|
|
549
|
-
transaction['tag'] = tag;
|
|
550
|
-
transaction['type'] = 'withdrawal';
|
|
551
|
-
transaction['status'] = 'pending';
|
|
552
|
-
}
|
|
553
|
-
return transaction;
|
|
554
|
-
}
|
|
555
|
-
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
556
|
-
/**
|
|
557
|
-
* @method
|
|
558
|
-
* @name coinmate#fetchMyTrades
|
|
559
|
-
* @description fetch all trades made by the user
|
|
560
|
-
* @param {string} symbol unified market symbol
|
|
561
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
562
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
563
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
564
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
565
|
-
*/
|
|
566
|
-
await this.loadMarkets();
|
|
567
|
-
if (limit === undefined) {
|
|
568
|
-
limit = 1000;
|
|
569
|
-
}
|
|
570
|
-
const request = {
|
|
571
|
-
'limit': limit,
|
|
572
|
-
};
|
|
573
|
-
if (symbol !== undefined) {
|
|
574
|
-
const market = this.market(symbol);
|
|
575
|
-
request['currencyPair'] = market['id'];
|
|
576
|
-
}
|
|
577
|
-
if (since !== undefined) {
|
|
578
|
-
request['timestampFrom'] = since;
|
|
579
|
-
}
|
|
580
|
-
const response = await this.privatePostTradeHistory(this.extend(request, params));
|
|
581
|
-
const data = this.safeValue(response, 'data', []);
|
|
582
|
-
return this.parseTrades(data, undefined, since, limit);
|
|
583
|
-
}
|
|
584
|
-
parseTrade(trade, market = undefined) {
|
|
585
|
-
//
|
|
586
|
-
// fetchMyTrades (private)
|
|
587
|
-
//
|
|
588
|
-
// {
|
|
589
|
-
// "transactionId": 2671819,
|
|
590
|
-
// "createdTimestamp": 1529649127605,
|
|
591
|
-
// "currencyPair": "LTC_BTC",
|
|
592
|
-
// "type": "BUY",
|
|
593
|
-
// "orderType": "LIMIT",
|
|
594
|
-
// "orderId": 101810227,
|
|
595
|
-
// "amount": 0.01,
|
|
596
|
-
// "price": 0.01406,
|
|
597
|
-
// "fee": 0,
|
|
598
|
-
// "feeType": "MAKER"
|
|
599
|
-
// }
|
|
600
|
-
//
|
|
601
|
-
// fetchTrades (public)
|
|
602
|
-
//
|
|
603
|
-
// {
|
|
604
|
-
// "timestamp":1561598833416,
|
|
605
|
-
// "transactionId":"4156303",
|
|
606
|
-
// "price":10950.41,
|
|
607
|
-
// "amount":0.004,
|
|
608
|
-
// "currencyPair":"BTC_EUR",
|
|
609
|
-
// "tradeType":"BUY"
|
|
610
|
-
// }
|
|
611
|
-
//
|
|
612
|
-
const marketId = this.safeString(trade, 'currencyPair');
|
|
613
|
-
market = this.safeMarket(marketId, market, '_');
|
|
614
|
-
const priceString = this.safeString(trade, 'price');
|
|
615
|
-
const amountString = this.safeString(trade, 'amount');
|
|
616
|
-
const side = this.safeStringLower2(trade, 'type', 'tradeType');
|
|
617
|
-
const type = this.safeStringLower(trade, 'orderType');
|
|
618
|
-
const orderId = this.safeString(trade, 'orderId');
|
|
619
|
-
const id = this.safeString(trade, 'transactionId');
|
|
620
|
-
const timestamp = this.safeInteger2(trade, 'timestamp', 'createdTimestamp');
|
|
621
|
-
let fee = undefined;
|
|
622
|
-
const feeCostString = this.safeString(trade, 'fee');
|
|
623
|
-
if (feeCostString !== undefined) {
|
|
624
|
-
fee = {
|
|
625
|
-
'cost': feeCostString,
|
|
626
|
-
'currency': market['quote'],
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
let takerOrMaker = this.safeString(trade, 'feeType');
|
|
630
|
-
takerOrMaker = (takerOrMaker === 'MAKER') ? 'maker' : 'taker';
|
|
631
|
-
return this.safeTrade({
|
|
632
|
-
'id': id,
|
|
633
|
-
'info': trade,
|
|
634
|
-
'timestamp': timestamp,
|
|
635
|
-
'datetime': this.iso8601(timestamp),
|
|
636
|
-
'symbol': market['symbol'],
|
|
637
|
-
'type': type,
|
|
638
|
-
'side': side,
|
|
639
|
-
'order': orderId,
|
|
640
|
-
'takerOrMaker': takerOrMaker,
|
|
641
|
-
'price': priceString,
|
|
642
|
-
'amount': amountString,
|
|
643
|
-
'cost': undefined,
|
|
644
|
-
'fee': fee,
|
|
645
|
-
}, market);
|
|
646
|
-
}
|
|
647
|
-
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
648
|
-
/**
|
|
649
|
-
* @method
|
|
650
|
-
* @name coinmate#fetchTrades
|
|
651
|
-
* @description get the list of most recent trades for a particular symbol
|
|
652
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
653
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
654
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
655
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
656
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
657
|
-
*/
|
|
658
|
-
await this.loadMarkets();
|
|
659
|
-
const market = this.market(symbol);
|
|
660
|
-
const request = {
|
|
661
|
-
'currencyPair': market['id'],
|
|
662
|
-
'minutesIntoHistory': 10,
|
|
663
|
-
};
|
|
664
|
-
const response = await this.publicGetTransactions(this.extend(request, params));
|
|
665
|
-
//
|
|
666
|
-
// {
|
|
667
|
-
// "error":false,
|
|
668
|
-
// "errorMessage":null,
|
|
669
|
-
// "data":[
|
|
670
|
-
// {
|
|
671
|
-
// "timestamp":1561598833416,
|
|
672
|
-
// "transactionId":"4156303",
|
|
673
|
-
// "price":10950.41,
|
|
674
|
-
// "amount":0.004,
|
|
675
|
-
// "currencyPair":"BTC_EUR",
|
|
676
|
-
// "tradeType":"BUY"
|
|
677
|
-
// }
|
|
678
|
-
// ]
|
|
679
|
-
// }
|
|
680
|
-
//
|
|
681
|
-
const data = this.safeValue(response, 'data', []);
|
|
682
|
-
return this.parseTrades(data, market, since, limit);
|
|
683
|
-
}
|
|
684
|
-
async fetchTradingFee(symbol, params = {}) {
|
|
685
|
-
/**
|
|
686
|
-
* @method
|
|
687
|
-
* @name coinmate#fetchTradingFee
|
|
688
|
-
* @description fetch the trading fees for a market
|
|
689
|
-
* @param {string} symbol unified market symbol
|
|
690
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
691
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
692
|
-
*/
|
|
693
|
-
await this.loadMarkets();
|
|
694
|
-
const market = this.market(symbol);
|
|
695
|
-
const request = {
|
|
696
|
-
'currencyPair': market['id'],
|
|
697
|
-
};
|
|
698
|
-
const response = await this.privatePostTraderFees(this.extend(request, params));
|
|
699
|
-
//
|
|
700
|
-
// {
|
|
701
|
-
// "error": false,
|
|
702
|
-
// "errorMessage": null,
|
|
703
|
-
// "data": { maker: '0.3', taker: "0.35", timestamp: "1646253217815" }
|
|
704
|
-
// }
|
|
705
|
-
//
|
|
706
|
-
const data = this.safeValue(response, 'data', {});
|
|
707
|
-
const makerString = this.safeString(data, 'maker');
|
|
708
|
-
const takerString = this.safeString(data, 'taker');
|
|
709
|
-
const maker = this.parseNumber(Precise["default"].stringDiv(makerString, '100'));
|
|
710
|
-
const taker = this.parseNumber(Precise["default"].stringDiv(takerString, '100'));
|
|
711
|
-
return {
|
|
712
|
-
'info': data,
|
|
713
|
-
'symbol': market['symbol'],
|
|
714
|
-
'maker': maker,
|
|
715
|
-
'taker': taker,
|
|
716
|
-
'percentage': true,
|
|
717
|
-
'tierBased': true,
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
721
|
-
/**
|
|
722
|
-
* @method
|
|
723
|
-
* @name coinmate#fetchOpenOrders
|
|
724
|
-
* @description fetch all unfilled currently open orders
|
|
725
|
-
* @param {string} symbol unified market symbol
|
|
726
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
727
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
728
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
729
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
730
|
-
*/
|
|
731
|
-
const response = await this.privatePostOpenOrders(this.extend({}, params));
|
|
732
|
-
const extension = { 'status': 'open' };
|
|
733
|
-
return this.parseOrders(response['data'], undefined, since, limit, extension);
|
|
734
|
-
}
|
|
735
|
-
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
736
|
-
/**
|
|
737
|
-
* @method
|
|
738
|
-
* @name coinmate#fetchOrders
|
|
739
|
-
* @description fetches information on multiple orders made by the user
|
|
740
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
741
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
742
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
743
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
744
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
745
|
-
*/
|
|
746
|
-
if (symbol === undefined) {
|
|
747
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
|
|
748
|
-
}
|
|
749
|
-
await this.loadMarkets();
|
|
750
|
-
const market = this.market(symbol);
|
|
751
|
-
const request = {
|
|
752
|
-
'currencyPair': market['id'],
|
|
753
|
-
};
|
|
754
|
-
// offset param that appears in other parts of the API doesn't appear to be supported here
|
|
755
|
-
if (limit !== undefined) {
|
|
756
|
-
request['limit'] = limit;
|
|
757
|
-
}
|
|
758
|
-
const response = await this.privatePostOrderHistory(this.extend(request, params));
|
|
759
|
-
return this.parseOrders(response['data'], market, since, limit);
|
|
760
|
-
}
|
|
761
|
-
parseOrderStatus(status) {
|
|
762
|
-
const statuses = {
|
|
763
|
-
'FILLED': 'closed',
|
|
764
|
-
'CANCELLED': 'canceled',
|
|
765
|
-
'PARTIALLY_FILLED': 'open',
|
|
766
|
-
'OPEN': 'open',
|
|
767
|
-
};
|
|
768
|
-
return this.safeString(statuses, status, status);
|
|
769
|
-
}
|
|
770
|
-
parseOrderType(type) {
|
|
771
|
-
const types = {
|
|
772
|
-
'LIMIT': 'limit',
|
|
773
|
-
'MARKET': 'market',
|
|
774
|
-
};
|
|
775
|
-
return this.safeString(types, type, type);
|
|
776
|
-
}
|
|
777
|
-
parseOrder(order, market = undefined) {
|
|
778
|
-
//
|
|
779
|
-
// limit sell
|
|
780
|
-
//
|
|
781
|
-
// {
|
|
782
|
-
// "id": 781246605,
|
|
783
|
-
// "timestamp": 1584480015133,
|
|
784
|
-
// "trailingUpdatedTimestamp": null,
|
|
785
|
-
// "type": "SELL",
|
|
786
|
-
// "currencyPair": "ETH_BTC",
|
|
787
|
-
// "price": 0.0345,
|
|
788
|
-
// "amount": 0.01,
|
|
789
|
-
// "stopPrice": null,
|
|
790
|
-
// "originalStopPrice": null,
|
|
791
|
-
// "marketPriceAtLastUpdate": null,
|
|
792
|
-
// "marketPriceAtOrderCreation": null,
|
|
793
|
-
// "orderTradeType": "LIMIT",
|
|
794
|
-
// "hidden": false,
|
|
795
|
-
// "trailing": false,
|
|
796
|
-
// "clientOrderId": null
|
|
797
|
-
// }
|
|
798
|
-
//
|
|
799
|
-
// limit buy
|
|
800
|
-
//
|
|
801
|
-
// {
|
|
802
|
-
// "id": 67527001,
|
|
803
|
-
// "timestamp": 1517931722613,
|
|
804
|
-
// "trailingUpdatedTimestamp": null,
|
|
805
|
-
// "type": "BUY",
|
|
806
|
-
// "price": 5897.24,
|
|
807
|
-
// "remainingAmount": 0.002367,
|
|
808
|
-
// "originalAmount": 0.1,
|
|
809
|
-
// "stopPrice": null,
|
|
810
|
-
// "originalStopPrice": null,
|
|
811
|
-
// "marketPriceAtLastUpdate": null,
|
|
812
|
-
// "marketPriceAtOrderCreation": null,
|
|
813
|
-
// "status": "CANCELLED",
|
|
814
|
-
// "orderTradeType": "LIMIT",
|
|
815
|
-
// "hidden": false,
|
|
816
|
-
// "avgPrice": null,
|
|
817
|
-
// "trailing": false,
|
|
818
|
-
// }
|
|
819
|
-
//
|
|
820
|
-
const id = this.safeString(order, 'id');
|
|
821
|
-
const timestamp = this.safeInteger(order, 'timestamp');
|
|
822
|
-
const side = this.safeStringLower(order, 'type');
|
|
823
|
-
const priceString = this.safeString(order, 'price');
|
|
824
|
-
const amountString = this.safeString(order, 'originalAmount');
|
|
825
|
-
const remainingString = this.safeString2(order, 'remainingAmount', 'amount');
|
|
826
|
-
const status = this.parseOrderStatus(this.safeString(order, 'status'));
|
|
827
|
-
const type = this.parseOrderType(this.safeString(order, 'orderTradeType'));
|
|
828
|
-
const averageString = this.safeString(order, 'avgPrice');
|
|
829
|
-
const marketId = this.safeString(order, 'currencyPair');
|
|
830
|
-
const symbol = this.safeSymbol(marketId, market, '_');
|
|
831
|
-
const clientOrderId = this.safeString(order, 'clientOrderId');
|
|
832
|
-
const stopPrice = this.safeNumber(order, 'stopPrice');
|
|
833
|
-
return this.safeOrder({
|
|
834
|
-
'id': id,
|
|
835
|
-
'clientOrderId': clientOrderId,
|
|
836
|
-
'timestamp': timestamp,
|
|
837
|
-
'datetime': this.iso8601(timestamp),
|
|
838
|
-
'lastTradeTimestamp': undefined,
|
|
839
|
-
'symbol': symbol,
|
|
840
|
-
'type': type,
|
|
841
|
-
'timeInForce': undefined,
|
|
842
|
-
'postOnly': undefined,
|
|
843
|
-
'side': side,
|
|
844
|
-
'price': priceString,
|
|
845
|
-
'stopPrice': stopPrice,
|
|
846
|
-
'triggerPrice': stopPrice,
|
|
847
|
-
'amount': amountString,
|
|
848
|
-
'cost': undefined,
|
|
849
|
-
'average': averageString,
|
|
850
|
-
'filled': undefined,
|
|
851
|
-
'remaining': remainingString,
|
|
852
|
-
'status': status,
|
|
853
|
-
'trades': undefined,
|
|
854
|
-
'info': order,
|
|
855
|
-
'fee': undefined,
|
|
856
|
-
}, market);
|
|
857
|
-
}
|
|
858
|
-
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
859
|
-
/**
|
|
860
|
-
* @method
|
|
861
|
-
* @name coinmate#createOrder
|
|
862
|
-
* @description create a trade order
|
|
863
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
864
|
-
* @param {string} type 'market' or 'limit'
|
|
865
|
-
* @param {string} side 'buy' or 'sell'
|
|
866
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
867
|
-
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
868
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
869
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
870
|
-
*/
|
|
871
|
-
await this.loadMarkets();
|
|
872
|
-
let method = 'privatePost' + this.capitalize(side);
|
|
873
|
-
const market = this.market(symbol);
|
|
874
|
-
const request = {
|
|
875
|
-
'currencyPair': market['id'],
|
|
876
|
-
};
|
|
877
|
-
if (type === 'market') {
|
|
878
|
-
if (side === 'buy') {
|
|
879
|
-
request['total'] = this.amountToPrecision(symbol, amount); // amount in fiat
|
|
880
|
-
}
|
|
881
|
-
else {
|
|
882
|
-
request['amount'] = this.amountToPrecision(symbol, amount); // amount in fiat
|
|
883
|
-
}
|
|
884
|
-
method += 'Instant';
|
|
885
|
-
}
|
|
886
|
-
else {
|
|
887
|
-
request['amount'] = this.amountToPrecision(symbol, amount); // amount in crypto
|
|
888
|
-
request['price'] = this.priceToPrecision(symbol, price);
|
|
889
|
-
method += this.capitalize(type);
|
|
890
|
-
}
|
|
891
|
-
const response = await this[method](this.extend(request, params));
|
|
892
|
-
const id = this.safeString(response, 'data');
|
|
893
|
-
return this.safeOrder({
|
|
894
|
-
'info': response,
|
|
895
|
-
'id': id,
|
|
896
|
-
}, market);
|
|
897
|
-
}
|
|
898
|
-
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
899
|
-
/**
|
|
900
|
-
* @method
|
|
901
|
-
* @name coinmate#fetchOrder
|
|
902
|
-
* @description fetches information on an order made by the user
|
|
903
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
904
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
905
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
906
|
-
*/
|
|
907
|
-
await this.loadMarkets();
|
|
908
|
-
const request = {
|
|
909
|
-
'orderId': id,
|
|
910
|
-
};
|
|
911
|
-
let market = undefined;
|
|
912
|
-
if (symbol) {
|
|
913
|
-
market = this.market(symbol);
|
|
914
|
-
}
|
|
915
|
-
const response = await this.privatePostOrderById(this.extend(request, params));
|
|
916
|
-
const data = this.safeValue(response, 'data');
|
|
917
|
-
return this.parseOrder(data, market);
|
|
918
|
-
}
|
|
919
|
-
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
920
|
-
/**
|
|
921
|
-
* @method
|
|
922
|
-
* @name coinmate#cancelOrder
|
|
923
|
-
* @description cancels an open order
|
|
924
|
-
* @param {string} id order id
|
|
925
|
-
* @param {string} symbol not used by coinmate cancelOrder ()
|
|
926
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
927
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
928
|
-
*/
|
|
929
|
-
// {"error":false,"errorMessage":null,"data":{"success":true,"remainingAmount":0.01}}
|
|
930
|
-
const request = { 'orderId': id };
|
|
931
|
-
const response = await this.privatePostCancelOrderWithInfo(this.extend(request, params));
|
|
932
|
-
return {
|
|
933
|
-
'info': response,
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
nonce() {
|
|
937
|
-
return this.milliseconds();
|
|
938
|
-
}
|
|
939
|
-
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
940
|
-
let url = this.urls['api']['rest'] + '/' + path;
|
|
941
|
-
if (api === 'public') {
|
|
942
|
-
if (Object.keys(params).length) {
|
|
943
|
-
url += '?' + this.urlencode(params);
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
else {
|
|
947
|
-
this.checkRequiredCredentials();
|
|
948
|
-
const nonce = this.nonce().toString();
|
|
949
|
-
const auth = nonce + this.uid + this.apiKey;
|
|
950
|
-
const signature = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
|
|
951
|
-
body = this.urlencode(this.extend({
|
|
952
|
-
'clientId': this.uid,
|
|
953
|
-
'nonce': nonce,
|
|
954
|
-
'publicKey': this.apiKey,
|
|
955
|
-
'signature': signature.toUpperCase(),
|
|
956
|
-
}, params));
|
|
957
|
-
headers = {
|
|
958
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
962
|
-
}
|
|
963
|
-
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
964
|
-
if (response !== undefined) {
|
|
965
|
-
if ('error' in response) {
|
|
966
|
-
// {"error":true,"errorMessage":"Minimum Order Size 0.01 ETH","data":null}
|
|
967
|
-
if (response['error']) {
|
|
968
|
-
const message = this.safeString(response, 'errorMessage');
|
|
969
|
-
const feedback = this.id + ' ' + message;
|
|
970
|
-
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
971
|
-
this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
|
|
972
|
-
throw new errors.ExchangeError(this.id + ' ' + this.json(response));
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
if (code > 400) {
|
|
977
|
-
if (body) {
|
|
978
|
-
const feedback = this.id + ' ' + body;
|
|
979
|
-
this.throwExactlyMatchedException(this.exceptions['exact'], body, feedback);
|
|
980
|
-
this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
|
|
981
|
-
throw new errors.ExchangeError(feedback); // unknown message
|
|
982
|
-
}
|
|
983
|
-
throw new errors.ExchangeError(this.id + ' ' + body);
|
|
984
|
-
}
|
|
985
|
-
return undefined;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
module.exports = coinmate;
|