ccxt 4.2.18 → 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 +8 -8
- package/dist/ccxt.browser.js +34202 -33193
- package/dist/ccxt.browser.min.js +2 -2
- 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/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 +11 -2
- package/js/ccxt.js +8 -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/bingx.js +1 -1
- 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/deribit.js +11 -3
- 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 +39 -38
- 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 +6 -1
- package/js/src/pro/bitpanda.d.ts +2 -34
- package/js/src/pro/bitpanda.js +5 -1330
- 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/package.json +2 -2
- package/rollup.config.js +2 -0
- package/skip-tests.json +2 -1
- package/test-commonjs.cjs +25 -1
- package/dist/cjs/js/ccxt.js +0 -478
- 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 -5260
- 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 -9851
- 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 -3872
- 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 -7624
- 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 -844
- 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 -3310
- 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 -1062
- package/dist/cjs/js/src/pro/kucoinfutures.js +0 -989
- 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 -1022
- 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 -2310
- 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/coincheck.js +0 -0
- /package/dist/cjs/{js/src → src}/pro/coinone.js +0 -0
- /package/js/src/abstract/{bitpanda.js → onetrading.js} +0 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -94,6 +94,7 @@ var novadax = require('./src/novadax.js');
|
|
|
94
94
|
var oceanex = require('./src/oceanex.js');
|
|
95
95
|
var okcoin = require('./src/okcoin.js');
|
|
96
96
|
var okx = require('./src/okx.js');
|
|
97
|
+
var onetrading = require('./src/onetrading.js');
|
|
97
98
|
var p2b = require('./src/p2b.js');
|
|
98
99
|
var paymium = require('./src/paymium.js');
|
|
99
100
|
var phemex = require('./src/phemex.js');
|
|
@@ -134,7 +135,9 @@ var bybit$1 = require('./src/pro/bybit.js');
|
|
|
134
135
|
var cex$1 = require('./src/pro/cex.js');
|
|
135
136
|
var coinbase$1 = require('./src/pro/coinbase.js');
|
|
136
137
|
var coinbasepro$1 = require('./src/pro/coinbasepro.js');
|
|
138
|
+
var coincheck$1 = require('./src/pro/coincheck.js');
|
|
137
139
|
var coinex$1 = require('./src/pro/coinex.js');
|
|
140
|
+
var coinone$1 = require('./src/pro/coinone.js');
|
|
138
141
|
var cryptocom$1 = require('./src/pro/cryptocom.js');
|
|
139
142
|
var currencycom$1 = require('./src/pro/currencycom.js');
|
|
140
143
|
var deribit$1 = require('./src/pro/deribit.js');
|
|
@@ -153,11 +156,13 @@ var kraken$1 = require('./src/pro/kraken.js');
|
|
|
153
156
|
var krakenfutures$1 = require('./src/pro/krakenfutures.js');
|
|
154
157
|
var kucoin$1 = require('./src/pro/kucoin.js');
|
|
155
158
|
var kucoinfutures$1 = require('./src/pro/kucoinfutures.js');
|
|
159
|
+
var lbank$1 = require('./src/pro/lbank.js');
|
|
156
160
|
var luno$1 = require('./src/pro/luno.js');
|
|
157
161
|
var mexc$1 = require('./src/pro/mexc.js');
|
|
158
162
|
var ndax$1 = require('./src/pro/ndax.js');
|
|
159
163
|
var okcoin$1 = require('./src/pro/okcoin.js');
|
|
160
164
|
var okx$1 = require('./src/pro/okx.js');
|
|
165
|
+
var onetrading$1 = require('./src/pro/onetrading.js');
|
|
161
166
|
var phemex$1 = require('./src/pro/phemex.js');
|
|
162
167
|
var poloniex$1 = require('./src/pro/poloniex.js');
|
|
163
168
|
var poloniexfutures$1 = require('./src/pro/poloniexfutures.js');
|
|
@@ -169,7 +174,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
169
174
|
|
|
170
175
|
//-----------------------------------------------------------------------------
|
|
171
176
|
// this is updated by vss.js when building
|
|
172
|
-
const version = '4.2.
|
|
177
|
+
const version = '4.2.19';
|
|
173
178
|
Exchange["default"].ccxtVersion = version;
|
|
174
179
|
const exchanges = {
|
|
175
180
|
'ace': ace,
|
|
@@ -254,6 +259,7 @@ const exchanges = {
|
|
|
254
259
|
'oceanex': oceanex,
|
|
255
260
|
'okcoin': okcoin,
|
|
256
261
|
'okx': okx,
|
|
262
|
+
'onetrading': onetrading,
|
|
257
263
|
'p2b': p2b,
|
|
258
264
|
'paymium': paymium,
|
|
259
265
|
'phemex': phemex,
|
|
@@ -296,7 +302,9 @@ const pro = {
|
|
|
296
302
|
'cex': cex$1,
|
|
297
303
|
'coinbase': coinbase$1,
|
|
298
304
|
'coinbasepro': coinbasepro$1,
|
|
305
|
+
'coincheck': coincheck$1,
|
|
299
306
|
'coinex': coinex$1,
|
|
307
|
+
'coinone': coinone$1,
|
|
300
308
|
'cryptocom': cryptocom$1,
|
|
301
309
|
'currencycom': currencycom$1,
|
|
302
310
|
'deribit': deribit$1,
|
|
@@ -315,11 +323,13 @@ const pro = {
|
|
|
315
323
|
'krakenfutures': krakenfutures$1,
|
|
316
324
|
'kucoin': kucoin$1,
|
|
317
325
|
'kucoinfutures': kucoinfutures$1,
|
|
326
|
+
'lbank': lbank$1,
|
|
318
327
|
'luno': luno$1,
|
|
319
328
|
'mexc': mexc$1,
|
|
320
329
|
'ndax': ndax$1,
|
|
321
330
|
'okcoin': okcoin$1,
|
|
322
331
|
'okx': okx$1,
|
|
332
|
+
'onetrading': onetrading$1,
|
|
323
333
|
'phemex': phemex$1,
|
|
324
334
|
'poloniex': poloniex$1,
|
|
325
335
|
'poloniexfutures': poloniexfutures$1,
|
|
@@ -452,6 +462,7 @@ exports.novadax = novadax;
|
|
|
452
462
|
exports.oceanex = oceanex;
|
|
453
463
|
exports.okcoin = okcoin;
|
|
454
464
|
exports.okx = okx;
|
|
465
|
+
exports.onetrading = onetrading;
|
|
455
466
|
exports.p2b = p2b;
|
|
456
467
|
exports.paymium = paymium;
|
|
457
468
|
exports.phemex = phemex;
|
package/dist/cjs/src/alpaca.js
CHANGED
|
@@ -36,7 +36,7 @@ class alpaca extends alpaca$1 {
|
|
|
36
36
|
'market': 'https://data.sandbox.{hostname}',
|
|
37
37
|
},
|
|
38
38
|
'doc': 'https://alpaca.markets/docs/',
|
|
39
|
-
'fees': 'https://alpaca.markets/
|
|
39
|
+
'fees': 'https://docs.alpaca.markets/docs/crypto-fees',
|
|
40
40
|
},
|
|
41
41
|
'has': {
|
|
42
42
|
'CORS': false,
|
|
@@ -207,28 +207,28 @@ class alpaca extends alpaca$1 {
|
|
|
207
207
|
'trading': {
|
|
208
208
|
'tierBased': true,
|
|
209
209
|
'percentage': true,
|
|
210
|
-
'maker': this.parseNumber('0.
|
|
211
|
-
'taker': this.parseNumber('0.
|
|
210
|
+
'maker': this.parseNumber('0.0015'),
|
|
211
|
+
'taker': this.parseNumber('0.0025'),
|
|
212
212
|
'tiers': {
|
|
213
213
|
'taker': [
|
|
214
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
215
|
-
[this.parseNumber('
|
|
216
|
-
[this.parseNumber('
|
|
217
|
-
[this.parseNumber('
|
|
218
|
-
[this.parseNumber('10000000'), this.parseNumber('0.
|
|
219
|
-
[this.parseNumber('25000000'), this.parseNumber('0.
|
|
220
|
-
[this.parseNumber('50000000'), this.parseNumber('0.
|
|
214
|
+
[this.parseNumber('0'), this.parseNumber('0.0025')],
|
|
215
|
+
[this.parseNumber('100000'), this.parseNumber('0.0022')],
|
|
216
|
+
[this.parseNumber('500000'), this.parseNumber('0.0020')],
|
|
217
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0018')],
|
|
218
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0015')],
|
|
219
|
+
[this.parseNumber('25000000'), this.parseNumber('0.0013')],
|
|
220
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0012')],
|
|
221
221
|
[this.parseNumber('100000000'), this.parseNumber('0.001')],
|
|
222
222
|
],
|
|
223
223
|
'maker': [
|
|
224
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
225
|
-
[this.parseNumber('
|
|
226
|
-
[this.parseNumber('
|
|
227
|
-
[this.parseNumber('
|
|
228
|
-
[this.parseNumber('10000000'), this.parseNumber('0.
|
|
229
|
-
[this.parseNumber('25000000'), this.parseNumber('0.
|
|
230
|
-
[this.parseNumber('50000000'), this.parseNumber('0.
|
|
231
|
-
[this.parseNumber('100000000'), this.parseNumber('0.
|
|
224
|
+
[this.parseNumber('0'), this.parseNumber('0.0015')],
|
|
225
|
+
[this.parseNumber('100000'), this.parseNumber('0.0012')],
|
|
226
|
+
[this.parseNumber('500000'), this.parseNumber('0.001')],
|
|
227
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0008')],
|
|
228
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0005')],
|
|
229
|
+
[this.parseNumber('25000000'), this.parseNumber('0.0002')],
|
|
230
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0002')],
|
|
231
|
+
[this.parseNumber('100000000'), this.parseNumber('0.00')],
|
|
232
232
|
],
|
|
233
233
|
},
|
|
234
234
|
},
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -64,6 +64,8 @@ class ascendex extends ascendex$1 {
|
|
|
64
64
|
'fetchMarkets': true,
|
|
65
65
|
'fetchMarkOHLCV': false,
|
|
66
66
|
'fetchOHLCV': true,
|
|
67
|
+
'fetchOpenInterest': false,
|
|
68
|
+
'fetchOpenInterestHistory': false,
|
|
67
69
|
'fetchOpenOrders': true,
|
|
68
70
|
'fetchOrder': true,
|
|
69
71
|
'fetchOrderBook': true,
|
|
@@ -808,12 +810,14 @@ class ascendex extends ascendex$1 {
|
|
|
808
810
|
*/
|
|
809
811
|
await this.loadMarkets();
|
|
810
812
|
await this.loadAccounts();
|
|
811
|
-
let query = undefined;
|
|
812
813
|
let marketType = undefined;
|
|
813
|
-
|
|
814
|
+
let marginMode = undefined;
|
|
815
|
+
[marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
816
|
+
[marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
|
|
814
817
|
const isMargin = this.safeValue(params, 'margin', false);
|
|
815
|
-
|
|
816
|
-
|
|
818
|
+
const isCross = marginMode === 'cross';
|
|
819
|
+
marketType = (isMargin || isCross) ? 'margin' : marketType;
|
|
820
|
+
params = this.omit(params, 'margin');
|
|
817
821
|
const accountsByType = this.safeValue(this.options, 'accountsByType', {});
|
|
818
822
|
const accountCategory = this.safeString(accountsByType, marketType, 'cash');
|
|
819
823
|
const account = this.safeValue(this.accounts, 0, {});
|
|
@@ -821,15 +825,18 @@ class ascendex extends ascendex$1 {
|
|
|
821
825
|
const request = {
|
|
822
826
|
'account-group': accountGroup,
|
|
823
827
|
};
|
|
828
|
+
if ((marginMode === 'isolated') && (marketType !== 'swap')) {
|
|
829
|
+
throw new errors.BadRequest(this.id + ' does not supported isolated margin trading');
|
|
830
|
+
}
|
|
824
831
|
if ((accountCategory === 'cash') || (accountCategory === 'margin')) {
|
|
825
832
|
request['account-category'] = accountCategory;
|
|
826
833
|
}
|
|
827
834
|
let response = undefined;
|
|
828
835
|
if ((marketType === 'spot') || (marketType === 'margin')) {
|
|
829
|
-
response = await this.v1PrivateAccountCategoryGetBalance(this.extend(request,
|
|
836
|
+
response = await this.v1PrivateAccountCategoryGetBalance(this.extend(request, params));
|
|
830
837
|
}
|
|
831
838
|
else if (marketType === 'swap') {
|
|
832
|
-
response = await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(request,
|
|
839
|
+
response = await this.v2PrivateAccountGroupGetFuturesPosition(this.extend(request, params));
|
|
833
840
|
}
|
|
834
841
|
else {
|
|
835
842
|
throw new errors.NotSupported(this.id + ' fetchBalance() is not currently supported for ' + marketType + ' markets');
|
|
@@ -365,11 +365,17 @@ class Exchange {
|
|
|
365
365
|
'createMarketOrderWithCost': undefined,
|
|
366
366
|
'createMarketSellOrderWithCost': undefined,
|
|
367
367
|
'createOrders': undefined,
|
|
368
|
+
'createOrderWithTakeProfitAndStopLoss': undefined,
|
|
368
369
|
'createPostOnlyOrder': undefined,
|
|
369
370
|
'createReduceOnlyOrder': undefined,
|
|
371
|
+
'createStopLossOrder': undefined,
|
|
370
372
|
'createStopOrder': undefined,
|
|
371
373
|
'createStopLimitOrder': undefined,
|
|
372
374
|
'createStopMarketOrder': undefined,
|
|
375
|
+
'createTakeProfitOrder': undefined,
|
|
376
|
+
'createTrailingAmountOrder': undefined,
|
|
377
|
+
'createTrailingPercentOrder': undefined,
|
|
378
|
+
'createTriggerOrder': undefined,
|
|
373
379
|
'createOrderWs': undefined,
|
|
374
380
|
'editOrderWs': undefined,
|
|
375
381
|
'fetchOpenOrdersWs': undefined,
|
|
@@ -433,7 +439,7 @@ class Exchange {
|
|
|
433
439
|
'fetchPositionsForSymbol': undefined,
|
|
434
440
|
'fetchPositionsRisk': undefined,
|
|
435
441
|
'fetchPremiumIndexOHLCV': undefined,
|
|
436
|
-
'fetchStatus':
|
|
442
|
+
'fetchStatus': undefined,
|
|
437
443
|
'fetchTicker': true,
|
|
438
444
|
'fetchTickers': undefined,
|
|
439
445
|
'fetchTime': undefined,
|
|
@@ -662,10 +668,28 @@ class Exchange {
|
|
|
662
668
|
console.log(...args);
|
|
663
669
|
}
|
|
664
670
|
async loadProxyModules() {
|
|
671
|
+
if (this.proxyModulesLoaded) {
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
665
674
|
this.proxyModulesLoaded = true;
|
|
666
|
-
//
|
|
667
|
-
|
|
668
|
-
|
|
675
|
+
// we have to handle it with below nested way, because of dynamic
|
|
676
|
+
// import issues (https://github.com/ccxt/ccxt/pull/20687)
|
|
677
|
+
try {
|
|
678
|
+
// todo: possible sync alternatives: https://stackoverflow.com/questions/51069002/convert-import-to-synchronous
|
|
679
|
+
this.httpProxyAgentModule = await Promise.resolve().then(function () { return require(/* webpackIgnore: true */ '../static_dependencies/proxies/http-proxy-agent/index.js'); });
|
|
680
|
+
this.httpsProxyAgentModule = await Promise.resolve().then(function () { return require(/* webpackIgnore: true */ '../static_dependencies/proxies/https-proxy-agent/index.js'); });
|
|
681
|
+
}
|
|
682
|
+
catch (e) {
|
|
683
|
+
// if several users are using those frameworks which cause exceptions,
|
|
684
|
+
// let them to be able to load modules still, by installing them
|
|
685
|
+
try {
|
|
686
|
+
// @ts-ignore
|
|
687
|
+
this.httpProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'http-proxy-agent')); });
|
|
688
|
+
// @ts-ignore
|
|
689
|
+
this.httpProxyAgentModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'https-proxy-agent')); });
|
|
690
|
+
}
|
|
691
|
+
catch { }
|
|
692
|
+
}
|
|
669
693
|
if (this.socksProxyAgentModuleChecked === false) {
|
|
670
694
|
this.socksProxyAgentModuleChecked = true;
|
|
671
695
|
try {
|
|
@@ -757,11 +781,10 @@ class Exchange {
|
|
|
757
781
|
// proxy agents
|
|
758
782
|
const [httpProxy, httpsProxy, socksProxy] = this.checkProxySettings(url, method, headers, body);
|
|
759
783
|
this.checkConflictingProxies(httpProxy || httpsProxy || socksProxy, proxyUrl);
|
|
784
|
+
// skip proxies on the browser
|
|
760
785
|
if (isNode) {
|
|
761
|
-
//
|
|
762
|
-
|
|
763
|
-
await this.loadProxyModules(); // this is needed in JS, independently whether proxy properties were set or not, we have to load them because of necessity in WS, which would happen beyond 'fetch' method (WS/etc)
|
|
764
|
-
}
|
|
786
|
+
// this is needed in JS, independently whether proxy properties were set or not, we have to load them because of necessity in WS, which would happen beyond 'fetch' method (WS/etc)
|
|
787
|
+
await this.loadProxyModules();
|
|
765
788
|
}
|
|
766
789
|
const chosenAgent = this.setProxyAgents(httpProxy, httpsProxy, socksProxy);
|
|
767
790
|
// user-agent
|
|
@@ -783,13 +806,29 @@ class Exchange {
|
|
|
783
806
|
// end of proxies & headers
|
|
784
807
|
if (this.fetchImplementation === undefined) {
|
|
785
808
|
if (isNode) {
|
|
786
|
-
const module = await Promise.resolve().then(function () { return require(/* webpackIgnore: true */ '../static_dependencies/node-fetch/index.js'); });
|
|
787
809
|
if (this.agent === undefined) {
|
|
788
810
|
this.agent = this.httpsAgent;
|
|
789
811
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
812
|
+
try {
|
|
813
|
+
const module = await Promise.resolve().then(function () { return require(/* webpackIgnore: true */ '../static_dependencies/node-fetch/index.js'); });
|
|
814
|
+
this.AbortError = module.AbortError;
|
|
815
|
+
this.fetchImplementation = module.default;
|
|
816
|
+
this.FetchError = module.FetchError;
|
|
817
|
+
}
|
|
818
|
+
catch (e) {
|
|
819
|
+
// some users having issues with dynamic imports (https://github.com/ccxt/ccxt/pull/20687)
|
|
820
|
+
// so let them to fallback to node's native fetch
|
|
821
|
+
if (typeof fetch === 'function') {
|
|
822
|
+
this.fetchImplementation = fetch;
|
|
823
|
+
// as it's browser-compatible implementation ( https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#fetch )
|
|
824
|
+
// it throws same error types
|
|
825
|
+
this.AbortError = DOMException;
|
|
826
|
+
this.FetchError = TypeError;
|
|
827
|
+
}
|
|
828
|
+
else {
|
|
829
|
+
throw new Error('Seems, "fetch" function is not available in your node-js version, please use latest node-js version');
|
|
830
|
+
}
|
|
831
|
+
}
|
|
793
832
|
}
|
|
794
833
|
else {
|
|
795
834
|
this.fetchImplementation = self.fetch;
|
|
@@ -982,7 +1021,10 @@ class Exchange {
|
|
|
982
1021
|
}
|
|
983
1022
|
spawn(method, ...args) {
|
|
984
1023
|
const future = Future.Future();
|
|
985
|
-
|
|
1024
|
+
// using setTimeout 0 to force the execution to run after the future is returned
|
|
1025
|
+
setTimeout(() => {
|
|
1026
|
+
method.apply(this, args).then(future.resolve).catch(future.reject);
|
|
1027
|
+
}, 0);
|
|
986
1028
|
return future;
|
|
987
1029
|
}
|
|
988
1030
|
delay(timeout, method, ...args) {
|
|
@@ -1413,11 +1455,11 @@ class Exchange {
|
|
|
1413
1455
|
let httpsProxy = undefined;
|
|
1414
1456
|
let socksProxy = undefined;
|
|
1415
1457
|
// httpProxy
|
|
1416
|
-
if (this.httpProxy
|
|
1458
|
+
if (this.valueIsDefined(this.httpProxy)) {
|
|
1417
1459
|
usedProxies.push('httpProxy');
|
|
1418
1460
|
httpProxy = this.httpProxy;
|
|
1419
1461
|
}
|
|
1420
|
-
if (this.http_proxy
|
|
1462
|
+
if (this.valueIsDefined(this.http_proxy)) {
|
|
1421
1463
|
usedProxies.push('http_proxy');
|
|
1422
1464
|
httpProxy = this.http_proxy;
|
|
1423
1465
|
}
|
|
@@ -1430,11 +1472,11 @@ class Exchange {
|
|
|
1430
1472
|
httpProxy = this.http_proxy_callback(url, method, headers, body);
|
|
1431
1473
|
}
|
|
1432
1474
|
// httpsProxy
|
|
1433
|
-
if (this.httpsProxy
|
|
1475
|
+
if (this.valueIsDefined(this.httpsProxy)) {
|
|
1434
1476
|
usedProxies.push('httpsProxy');
|
|
1435
1477
|
httpsProxy = this.httpsProxy;
|
|
1436
1478
|
}
|
|
1437
|
-
if (this.https_proxy
|
|
1479
|
+
if (this.valueIsDefined(this.https_proxy)) {
|
|
1438
1480
|
usedProxies.push('https_proxy');
|
|
1439
1481
|
httpsProxy = this.https_proxy;
|
|
1440
1482
|
}
|
|
@@ -1447,11 +1489,11 @@ class Exchange {
|
|
|
1447
1489
|
httpsProxy = this.https_proxy_callback(url, method, headers, body);
|
|
1448
1490
|
}
|
|
1449
1491
|
// socksProxy
|
|
1450
|
-
if (this.socksProxy
|
|
1492
|
+
if (this.valueIsDefined(this.socksProxy)) {
|
|
1451
1493
|
usedProxies.push('socksProxy');
|
|
1452
1494
|
socksProxy = this.socksProxy;
|
|
1453
1495
|
}
|
|
1454
|
-
if (this.socks_proxy
|
|
1496
|
+
if (this.valueIsDefined(this.socks_proxy)) {
|
|
1455
1497
|
usedProxies.push('socks_proxy');
|
|
1456
1498
|
socksProxy = this.socks_proxy;
|
|
1457
1499
|
}
|
|
@@ -1477,29 +1519,29 @@ class Exchange {
|
|
|
1477
1519
|
let wssProxy = undefined;
|
|
1478
1520
|
let wsSocksProxy = undefined;
|
|
1479
1521
|
// ws proxy
|
|
1480
|
-
if (this.wsProxy
|
|
1522
|
+
if (this.valueIsDefined(this.wsProxy)) {
|
|
1481
1523
|
usedProxies.push('wsProxy');
|
|
1482
1524
|
wsProxy = this.wsProxy;
|
|
1483
1525
|
}
|
|
1484
|
-
if (this.ws_proxy
|
|
1526
|
+
if (this.valueIsDefined(this.ws_proxy)) {
|
|
1485
1527
|
usedProxies.push('ws_proxy');
|
|
1486
1528
|
wsProxy = this.ws_proxy;
|
|
1487
1529
|
}
|
|
1488
1530
|
// wss proxy
|
|
1489
|
-
if (this.wssProxy
|
|
1531
|
+
if (this.valueIsDefined(this.wssProxy)) {
|
|
1490
1532
|
usedProxies.push('wssProxy');
|
|
1491
1533
|
wssProxy = this.wssProxy;
|
|
1492
1534
|
}
|
|
1493
|
-
if (this.wss_proxy
|
|
1535
|
+
if (this.valueIsDefined(this.wss_proxy)) {
|
|
1494
1536
|
usedProxies.push('wss_proxy');
|
|
1495
1537
|
wssProxy = this.wss_proxy;
|
|
1496
1538
|
}
|
|
1497
1539
|
// ws socks proxy
|
|
1498
|
-
if (this.wsSocksProxy
|
|
1540
|
+
if (this.valueIsDefined(this.wsSocksProxy)) {
|
|
1499
1541
|
usedProxies.push('wsSocksProxy');
|
|
1500
1542
|
wsSocksProxy = this.wsSocksProxy;
|
|
1501
1543
|
}
|
|
1502
|
-
if (this.ws_socks_proxy
|
|
1544
|
+
if (this.valueIsDefined(this.ws_socks_proxy)) {
|
|
1503
1545
|
usedProxies.push('ws_socks_proxy');
|
|
1504
1546
|
wsSocksProxy = this.ws_socks_proxy;
|
|
1505
1547
|
}
|
|
@@ -3742,6 +3784,60 @@ class Exchange {
|
|
|
3742
3784
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
3743
3785
|
throw new errors.NotSupported(this.id + ' createOrder() is not supported yet');
|
|
3744
3786
|
}
|
|
3787
|
+
async createTrailingAmountOrder(symbol, type, side, amount, price = undefined, trailingAmount = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
3788
|
+
/**
|
|
3789
|
+
* @method
|
|
3790
|
+
* @name createTrailingAmountOrder
|
|
3791
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
|
3792
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3793
|
+
* @param {string} type 'market' or 'limit'
|
|
3794
|
+
* @param {string} side 'buy' or 'sell'
|
|
3795
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
3796
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
3797
|
+
* @param {float} trailingAmount the quote amount to trail away from the current market price
|
|
3798
|
+
* @param {float} [trailingTriggerPrice] the price to activate a trailing order, default uses the price argument
|
|
3799
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3800
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3801
|
+
*/
|
|
3802
|
+
if (trailingAmount === undefined) {
|
|
3803
|
+
throw new errors.ArgumentsRequired(this.id + ' createTrailingAmountOrder() requires a trailingAmount argument');
|
|
3804
|
+
}
|
|
3805
|
+
params['trailingAmount'] = trailingAmount;
|
|
3806
|
+
if (trailingTriggerPrice !== undefined) {
|
|
3807
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
3808
|
+
}
|
|
3809
|
+
if (this.has['createTrailingAmountOrder']) {
|
|
3810
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
3811
|
+
}
|
|
3812
|
+
throw new errors.NotSupported(this.id + ' createTrailingAmountOrder() is not supported yet');
|
|
3813
|
+
}
|
|
3814
|
+
async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
3815
|
+
/**
|
|
3816
|
+
* @method
|
|
3817
|
+
* @name createTrailingPercentOrder
|
|
3818
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
3819
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3820
|
+
* @param {string} type 'market' or 'limit'
|
|
3821
|
+
* @param {string} side 'buy' or 'sell'
|
|
3822
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
3823
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
3824
|
+
* @param {float} trailingPercent the percent to trail away from the current market price
|
|
3825
|
+
* @param {float} [trailingTriggerPrice] the price to activate a trailing order, default uses the price argument
|
|
3826
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3827
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3828
|
+
*/
|
|
3829
|
+
if (trailingPercent === undefined) {
|
|
3830
|
+
throw new errors.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
|
|
3831
|
+
}
|
|
3832
|
+
params['trailingPercent'] = trailingPercent;
|
|
3833
|
+
if (trailingTriggerPrice !== undefined) {
|
|
3834
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
3835
|
+
}
|
|
3836
|
+
if (this.has['createTrailingPercentOrder']) {
|
|
3837
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
3838
|
+
}
|
|
3839
|
+
throw new errors.NotSupported(this.id + ' createTrailingPercentOrder() is not supported yet');
|
|
3840
|
+
}
|
|
3745
3841
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
3746
3842
|
/**
|
|
3747
3843
|
* @method
|
|
@@ -3783,11 +3879,154 @@ class Exchange {
|
|
|
3783
3879
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3784
3880
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3785
3881
|
*/
|
|
3786
|
-
if (this.options['createMarketSellOrderRequiresPrice'] || this.
|
|
3882
|
+
if (this.options['createMarketSellOrderRequiresPrice'] || this.has['createMarketSellOrderWithCost']) {
|
|
3787
3883
|
return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
|
|
3788
3884
|
}
|
|
3789
3885
|
throw new errors.NotSupported(this.id + ' createMarketSellOrderWithCost() is not supported yet');
|
|
3790
3886
|
}
|
|
3887
|
+
async createTriggerOrder(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
|
|
3888
|
+
/**
|
|
3889
|
+
* @method
|
|
3890
|
+
* @name createTriggerOrder
|
|
3891
|
+
* @description create a trigger stop order (type 1)
|
|
3892
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3893
|
+
* @param {string} type 'market' or 'limit'
|
|
3894
|
+
* @param {string} side 'buy' or 'sell'
|
|
3895
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
3896
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
3897
|
+
* @param {float} triggerPrice the price to trigger the stop order, in units of the quote currency
|
|
3898
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3899
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3900
|
+
*/
|
|
3901
|
+
if (triggerPrice === undefined) {
|
|
3902
|
+
throw new errors.ArgumentsRequired(this.id + ' createTriggerOrder() requires a triggerPrice argument');
|
|
3903
|
+
}
|
|
3904
|
+
params['triggerPrice'] = triggerPrice;
|
|
3905
|
+
if (this.has['createTriggerOrder']) {
|
|
3906
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
3907
|
+
}
|
|
3908
|
+
throw new errors.NotSupported(this.id + ' createTriggerOrder() is not supported yet');
|
|
3909
|
+
}
|
|
3910
|
+
async createStopLossOrder(symbol, type, side, amount, price = undefined, stopLossPrice = undefined, params = {}) {
|
|
3911
|
+
/**
|
|
3912
|
+
* @method
|
|
3913
|
+
* @name createStopLossOrder
|
|
3914
|
+
* @description create a trigger stop loss order (type 2)
|
|
3915
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3916
|
+
* @param {string} type 'market' or 'limit'
|
|
3917
|
+
* @param {string} side 'buy' or 'sell'
|
|
3918
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
3919
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
3920
|
+
* @param {float} stopLossPrice the price to trigger the stop loss order, in units of the quote currency
|
|
3921
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3922
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3923
|
+
*/
|
|
3924
|
+
if (stopLossPrice === undefined) {
|
|
3925
|
+
throw new errors.ArgumentsRequired(this.id + ' createStopLossOrder() requires a stopLossPrice argument');
|
|
3926
|
+
}
|
|
3927
|
+
params['stopLossPrice'] = stopLossPrice;
|
|
3928
|
+
if (this.has['createStopLossOrder']) {
|
|
3929
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
3930
|
+
}
|
|
3931
|
+
throw new errors.NotSupported(this.id + ' createStopLossOrder() is not supported yet');
|
|
3932
|
+
}
|
|
3933
|
+
async createTakeProfitOrder(symbol, type, side, amount, price = undefined, takeProfitPrice = undefined, params = {}) {
|
|
3934
|
+
/**
|
|
3935
|
+
* @method
|
|
3936
|
+
* @name createTakeProfitOrder
|
|
3937
|
+
* @description create a trigger take profit order (type 2)
|
|
3938
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3939
|
+
* @param {string} type 'market' or 'limit'
|
|
3940
|
+
* @param {string} side 'buy' or 'sell'
|
|
3941
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
3942
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
3943
|
+
* @param {float} takeProfitPrice the price to trigger the take profit order, in units of the quote currency
|
|
3944
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3945
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3946
|
+
*/
|
|
3947
|
+
if (takeProfitPrice === undefined) {
|
|
3948
|
+
throw new errors.ArgumentsRequired(this.id + ' createTakeProfitOrder() requires a takeProfitPrice argument');
|
|
3949
|
+
}
|
|
3950
|
+
params['takeProfitPrice'] = takeProfitPrice;
|
|
3951
|
+
if (this.has['createTakeProfitOrder']) {
|
|
3952
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
3953
|
+
}
|
|
3954
|
+
throw new errors.NotSupported(this.id + ' createTakeProfitOrder() is not supported yet');
|
|
3955
|
+
}
|
|
3956
|
+
async createOrderWithTakeProfitAndStopLoss(symbol, type, side, amount, price = undefined, takeProfit = undefined, stopLoss = undefined, params = {}) {
|
|
3957
|
+
/**
|
|
3958
|
+
* @method
|
|
3959
|
+
* @name createOrderWithTakeProfitAndStopLoss
|
|
3960
|
+
* @description create an order with a stop loss or take profit attached (type 3)
|
|
3961
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3962
|
+
* @param {string} type 'market' or 'limit'
|
|
3963
|
+
* @param {string} side 'buy' or 'sell'
|
|
3964
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
3965
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
3966
|
+
* @param {float} [takeProfit] the take profit price, in units of the quote currency
|
|
3967
|
+
* @param {float} [stopLoss] the stop loss price, in units of the quote currency
|
|
3968
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3969
|
+
* @param {string} [params.takeProfitType] *not available on all exchanges* 'limit' or 'market'
|
|
3970
|
+
* @param {string} [params.stopLossType] *not available on all exchanges* 'limit' or 'market'
|
|
3971
|
+
* @param {string} [params.takeProfitPriceType] *not available on all exchanges* 'last', 'mark' or 'index'
|
|
3972
|
+
* @param {string} [params.stopLossPriceType] *not available on all exchanges* 'last', 'mark' or 'index'
|
|
3973
|
+
* @param {float} [params.takeProfitLimitPrice] *not available on all exchanges* limit price for a limit take profit order
|
|
3974
|
+
* @param {float} [params.stopLossLimitPrice] *not available on all exchanges* stop loss for a limit stop loss order
|
|
3975
|
+
* @param {float} [params.takeProfitAmount] *not available on all exchanges* the amount for a take profit
|
|
3976
|
+
* @param {float} [params.stopLossAmount] *not available on all exchanges* the amount for a stop loss
|
|
3977
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3978
|
+
*/
|
|
3979
|
+
if ((takeProfit === undefined) && (stopLoss === undefined)) {
|
|
3980
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrderWithTakeProfitAndStopLoss() requires either a takeProfit or stopLoss argument');
|
|
3981
|
+
}
|
|
3982
|
+
if (takeProfit !== undefined) {
|
|
3983
|
+
params['takeProfit'] = {
|
|
3984
|
+
'triggerPrice': takeProfit,
|
|
3985
|
+
};
|
|
3986
|
+
}
|
|
3987
|
+
if (stopLoss !== undefined) {
|
|
3988
|
+
params['stopLoss'] = {
|
|
3989
|
+
'triggerPrice': stopLoss,
|
|
3990
|
+
};
|
|
3991
|
+
}
|
|
3992
|
+
const takeProfitType = this.safeString(params, 'takeProfitType');
|
|
3993
|
+
const takeProfitPriceType = this.safeString(params, 'takeProfitPriceType');
|
|
3994
|
+
const takeProfitLimitPrice = this.safeString(params, 'takeProfitLimitPrice');
|
|
3995
|
+
const takeProfitAmount = this.safeString(params, 'takeProfitAmount');
|
|
3996
|
+
const stopLossType = this.safeString(params, 'stopLossType');
|
|
3997
|
+
const stopLossPriceType = this.safeString(params, 'stopLossPriceType');
|
|
3998
|
+
const stopLossLimitPrice = this.safeString(params, 'stopLossLimitPrice');
|
|
3999
|
+
const stopLossAmount = this.safeString(params, 'stopLossAmount');
|
|
4000
|
+
if (takeProfitType !== undefined) {
|
|
4001
|
+
params['takeProfit']['type'] = takeProfitType;
|
|
4002
|
+
}
|
|
4003
|
+
if (takeProfitPriceType !== undefined) {
|
|
4004
|
+
params['takeProfit']['priceType'] = takeProfitPriceType;
|
|
4005
|
+
}
|
|
4006
|
+
if (takeProfitLimitPrice !== undefined) {
|
|
4007
|
+
params['takeProfit']['price'] = this.parseToNumeric(takeProfitLimitPrice);
|
|
4008
|
+
}
|
|
4009
|
+
if (takeProfitAmount !== undefined) {
|
|
4010
|
+
params['takeProfit']['amount'] = this.parseToNumeric(takeProfitAmount);
|
|
4011
|
+
}
|
|
4012
|
+
if (stopLossType !== undefined) {
|
|
4013
|
+
params['stopLoss']['type'] = stopLossType;
|
|
4014
|
+
}
|
|
4015
|
+
if (stopLossPriceType !== undefined) {
|
|
4016
|
+
params['stopLoss']['priceType'] = stopLossPriceType;
|
|
4017
|
+
}
|
|
4018
|
+
if (stopLossLimitPrice !== undefined) {
|
|
4019
|
+
params['stopLoss']['price'] = this.parseToNumeric(stopLossLimitPrice);
|
|
4020
|
+
}
|
|
4021
|
+
if (stopLossAmount !== undefined) {
|
|
4022
|
+
params['stopLoss']['amount'] = this.parseToNumeric(stopLossAmount);
|
|
4023
|
+
}
|
|
4024
|
+
params = this.omit(params, ['takeProfitType', 'takeProfitPriceType', 'takeProfitLimitPrice', 'takeProfitAmount', 'stopLossType', 'stopLossPriceType', 'stopLossLimitPrice', 'stopLossAmount']);
|
|
4025
|
+
if (this.has['createOrderWithTakeProfitAndStopLoss']) {
|
|
4026
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
4027
|
+
}
|
|
4028
|
+
throw new errors.NotSupported(this.id + ' createOrderWithTakeProfitAndStopLoss() is not supported yet');
|
|
4029
|
+
}
|
|
3791
4030
|
async createOrders(orders, params = {}) {
|
|
3792
4031
|
throw new errors.NotSupported(this.id + ' createOrders() is not supported yet');
|
|
3793
4032
|
}
|
|
@@ -3902,7 +4141,7 @@ class Exchange {
|
|
|
3902
4141
|
throw new errors.NotSupported(this.id + ' fetchFundingHistory() is not supported yet');
|
|
3903
4142
|
}
|
|
3904
4143
|
async closePosition(symbol, side = undefined, params = {}) {
|
|
3905
|
-
throw new errors.NotSupported(this.id + '
|
|
4144
|
+
throw new errors.NotSupported(this.id + ' closePosition() is not supported yet');
|
|
3906
4145
|
}
|
|
3907
4146
|
async closeAllPositions(params = {}) {
|
|
3908
4147
|
throw new errors.NotSupported(this.id + ' closeAllPositions() is not supported yet');
|