ccxt 4.2.11 → 4.2.13
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 +5 -5
- package/build.sh +2 -2
- package/dist/ccxt.browser.js +1347 -490
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/_virtual/agent.js +7 -0
- package/dist/cjs/_virtual/parse-proxy-response.js +7 -0
- package/dist/cjs/_virtual/promisify.js +7 -0
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/js/ccxt.js +474 -0
- package/dist/cjs/js/src/abstract/ace.js +9 -0
- package/dist/cjs/js/src/abstract/alpaca.js +9 -0
- package/dist/cjs/js/src/abstract/ascendex.js +9 -0
- package/dist/cjs/js/src/abstract/bigone.js +9 -0
- package/dist/cjs/js/src/abstract/binance.js +9 -0
- package/dist/cjs/js/src/abstract/bingx.js +9 -0
- package/dist/cjs/js/src/abstract/bit2c.js +9 -0
- package/dist/cjs/js/src/abstract/bitbank.js +9 -0
- package/dist/cjs/js/src/abstract/bitbns.js +9 -0
- package/dist/cjs/js/src/abstract/bitfinex.js +9 -0
- package/dist/cjs/js/src/abstract/bitfinex2.js +9 -0
- package/dist/cjs/js/src/abstract/bitflyer.js +9 -0
- package/dist/cjs/js/src/abstract/bitforex.js +9 -0
- package/dist/cjs/js/src/abstract/bitget.js +9 -0
- package/dist/cjs/js/src/abstract/bithumb.js +9 -0
- package/dist/cjs/js/src/abstract/bitmart.js +9 -0
- package/dist/cjs/js/src/abstract/bitmex.js +9 -0
- package/dist/cjs/js/src/abstract/bitopro.js +9 -0
- package/dist/cjs/js/src/abstract/bitpanda.js +9 -0
- package/dist/cjs/js/src/abstract/bitrue.js +9 -0
- package/dist/cjs/js/src/abstract/bitso.js +9 -0
- package/dist/cjs/js/src/abstract/bitstamp.js +9 -0
- package/dist/cjs/js/src/abstract/bitteam.js +9 -0
- package/dist/cjs/js/src/abstract/bitvavo.js +9 -0
- package/dist/cjs/js/src/abstract/bl3p.js +9 -0
- package/dist/cjs/js/src/abstract/blockchaincom.js +9 -0
- package/dist/cjs/js/src/abstract/btcalpha.js +9 -0
- package/dist/cjs/js/src/abstract/btcbox.js +9 -0
- package/dist/cjs/js/src/abstract/btcmarkets.js +9 -0
- package/dist/cjs/js/src/abstract/btcturk.js +9 -0
- package/dist/cjs/js/src/abstract/bybit.js +9 -0
- package/dist/cjs/js/src/abstract/cex.js +9 -0
- package/dist/cjs/js/src/abstract/coinbase.js +9 -0
- package/dist/cjs/js/src/abstract/coinbasepro.js +9 -0
- package/dist/cjs/js/src/abstract/coincheck.js +9 -0
- package/dist/cjs/js/src/abstract/coinex.js +9 -0
- package/dist/cjs/js/src/abstract/coinlist.js +9 -0
- package/dist/cjs/js/src/abstract/coinmate.js +9 -0
- package/dist/cjs/js/src/abstract/coinone.js +9 -0
- package/dist/cjs/js/src/abstract/coinsph.js +9 -0
- package/dist/cjs/js/src/abstract/coinspot.js +9 -0
- package/dist/cjs/js/src/abstract/cryptocom.js +9 -0
- package/dist/cjs/js/src/abstract/currencycom.js +9 -0
- package/dist/cjs/js/src/abstract/delta.js +9 -0
- package/dist/cjs/js/src/abstract/deribit.js +9 -0
- package/dist/cjs/js/src/abstract/digifinex.js +9 -0
- package/dist/cjs/js/src/abstract/exmo.js +9 -0
- package/dist/cjs/js/src/abstract/gate.js +9 -0
- package/dist/cjs/js/src/abstract/gemini.js +9 -0
- package/dist/cjs/js/src/abstract/hitbtc.js +9 -0
- package/dist/cjs/js/src/abstract/hollaex.js +9 -0
- package/dist/cjs/js/src/abstract/htx.js +9 -0
- package/dist/cjs/js/src/abstract/huobijp.js +9 -0
- package/dist/cjs/js/src/abstract/idex.js +9 -0
- package/dist/cjs/js/src/abstract/independentreserve.js +9 -0
- package/dist/cjs/js/src/abstract/indodax.js +9 -0
- package/dist/cjs/js/src/abstract/kraken.js +9 -0
- package/dist/cjs/js/src/abstract/krakenfutures.js +9 -0
- package/dist/cjs/js/src/abstract/kucoin.js +9 -0
- package/dist/cjs/js/src/abstract/kucoinfutures.js +9 -0
- package/dist/cjs/js/src/abstract/kuna.js +9 -0
- package/dist/cjs/js/src/abstract/latoken.js +9 -0
- package/dist/cjs/js/src/abstract/lbank.js +9 -0
- package/dist/cjs/js/src/abstract/luno.js +9 -0
- package/dist/cjs/js/src/abstract/lykke.js +9 -0
- package/dist/cjs/js/src/abstract/mercado.js +9 -0
- package/dist/cjs/js/src/abstract/mexc.js +9 -0
- package/dist/cjs/js/src/abstract/ndax.js +9 -0
- package/dist/cjs/js/src/abstract/novadax.js +9 -0
- package/dist/cjs/js/src/abstract/oceanex.js +9 -0
- package/dist/cjs/js/src/abstract/okcoin.js +9 -0
- package/dist/cjs/js/src/abstract/okx.js +9 -0
- package/dist/cjs/js/src/abstract/p2b.js +9 -0
- package/dist/cjs/js/src/abstract/paymium.js +9 -0
- package/dist/cjs/js/src/abstract/phemex.js +9 -0
- package/dist/cjs/js/src/abstract/poloniex.js +9 -0
- package/dist/cjs/js/src/abstract/poloniexfutures.js +9 -0
- package/dist/cjs/js/src/abstract/probit.js +9 -0
- package/dist/cjs/js/src/abstract/timex.js +9 -0
- package/dist/cjs/js/src/abstract/tokocrypto.js +9 -0
- package/dist/cjs/js/src/abstract/upbit.js +9 -0
- package/dist/cjs/js/src/abstract/wavesexchange.js +9 -0
- package/dist/cjs/js/src/abstract/wazirx.js +9 -0
- package/dist/cjs/js/src/abstract/whitebit.js +9 -0
- package/dist/cjs/js/src/abstract/woo.js +9 -0
- package/dist/cjs/js/src/abstract/yobit.js +9 -0
- package/dist/cjs/js/src/abstract/zaif.js +9 -0
- package/dist/cjs/js/src/abstract/zonda.js +9 -0
- package/dist/cjs/js/src/ace.js +1058 -0
- package/dist/cjs/js/src/alpaca.js +1125 -0
- package/dist/cjs/js/src/ascendex.js +3360 -0
- package/dist/cjs/js/src/base/Exchange.js +5110 -0
- package/dist/cjs/js/src/base/Precise.js +263 -0
- package/dist/cjs/js/src/base/errors.js +299 -0
- package/dist/cjs/js/src/base/functions/crypto.js +78 -0
- package/dist/cjs/js/src/base/functions/encode.js +44 -0
- package/dist/cjs/js/src/base/functions/generic.js +193 -0
- package/dist/cjs/js/src/base/functions/misc.js +96 -0
- package/dist/cjs/js/src/base/functions/number.js +297 -0
- package/dist/cjs/js/src/base/functions/platform.js +28 -0
- package/dist/cjs/js/src/base/functions/rsa.js +34 -0
- package/dist/cjs/js/src/base/functions/string.js +48 -0
- package/dist/cjs/js/src/base/functions/throttle.js +66 -0
- package/dist/cjs/js/src/base/functions/time.js +187 -0
- package/dist/cjs/js/src/base/functions/totp.js +24 -0
- package/dist/cjs/js/src/base/functions/type.js +162 -0
- package/dist/cjs/js/src/base/functions.js +157 -0
- package/dist/cjs/js/src/base/ws/Cache.js +254 -0
- package/dist/cjs/js/src/base/ws/Client.js +299 -0
- package/dist/cjs/js/src/base/ws/Future.js +34 -0
- package/dist/cjs/js/src/base/ws/OrderBook.js +107 -0
- package/dist/cjs/js/src/base/ws/OrderBookSide.js +281 -0
- package/dist/cjs/js/src/base/ws/WsClient.js +69 -0
- package/dist/cjs/js/src/bequant.js +33 -0
- package/dist/cjs/js/src/bigone.js +2209 -0
- package/dist/cjs/js/src/binance.js +9736 -0
- package/dist/cjs/js/src/binancecoinm.js +45 -0
- package/dist/cjs/js/src/binanceus.js +84 -0
- package/dist/cjs/js/src/binanceusdm.js +58 -0
- package/dist/cjs/js/src/bingx.js +3807 -0
- package/dist/cjs/js/src/bit2c.js +916 -0
- package/dist/cjs/js/src/bitbank.js +1000 -0
- package/dist/cjs/js/src/bitbay.js +17 -0
- package/dist/cjs/js/src/bitbns.js +1220 -0
- package/dist/cjs/js/src/bitcoincom.js +17 -0
- package/dist/cjs/js/src/bitfinex.js +1670 -0
- package/dist/cjs/js/src/bitfinex2.js +2990 -0
- package/dist/cjs/js/src/bitflyer.js +1045 -0
- package/dist/cjs/js/src/bitforex.js +852 -0
- package/dist/cjs/js/src/bitget.js +8291 -0
- package/dist/cjs/js/src/bithumb.js +1090 -0
- package/dist/cjs/js/src/bitmart.js +4454 -0
- package/dist/cjs/js/src/bitmex.js +2884 -0
- package/dist/cjs/js/src/bitopro.js +1724 -0
- package/dist/cjs/js/src/bitpanda.js +2002 -0
- package/dist/cjs/js/src/bitrue.js +3253 -0
- package/dist/cjs/js/src/bitso.js +1753 -0
- package/dist/cjs/js/src/bitstamp.js +2188 -0
- package/dist/cjs/js/src/bitteam.js +2309 -0
- package/dist/cjs/js/src/bitvavo.js +1968 -0
- package/dist/cjs/js/src/bl3p.js +447 -0
- package/dist/cjs/js/src/blockchaincom.js +1160 -0
- package/dist/cjs/js/src/btcalpha.js +929 -0
- package/dist/cjs/js/src/btcbox.js +565 -0
- package/dist/cjs/js/src/btcmarkets.js +1237 -0
- package/dist/cjs/js/src/btcturk.js +929 -0
- package/dist/cjs/js/src/bybit.js +7646 -0
- package/dist/cjs/js/src/cex.js +1693 -0
- package/dist/cjs/js/src/coinbase.js +3424 -0
- package/dist/cjs/js/src/coinbasepro.js +1866 -0
- package/dist/cjs/js/src/coincheck.js +843 -0
- package/dist/cjs/js/src/coinex.js +5414 -0
- package/dist/cjs/js/src/coinlist.js +2329 -0
- package/dist/cjs/js/src/coinmate.js +989 -0
- package/dist/cjs/js/src/coinone.js +1185 -0
- package/dist/cjs/js/src/coinsph.js +1933 -0
- package/dist/cjs/js/src/coinspot.js +548 -0
- package/dist/cjs/js/src/cryptocom.js +3007 -0
- package/dist/cjs/js/src/currencycom.js +2015 -0
- package/dist/cjs/js/src/delta.js +3256 -0
- package/dist/cjs/js/src/deribit.js +3306 -0
- package/dist/cjs/js/src/digifinex.js +4307 -0
- package/dist/cjs/js/src/exmo.js +2645 -0
- package/dist/cjs/js/src/fmfwio.js +34 -0
- package/dist/cjs/js/src/gate.js +7072 -0
- package/dist/cjs/js/src/gateio.js +16 -0
- package/dist/cjs/js/src/gemini.js +1801 -0
- package/dist/cjs/js/src/hitbtc.js +3660 -0
- package/dist/cjs/js/src/hitbtc3.js +19 -0
- package/dist/cjs/js/src/hollaex.js +1882 -0
- package/dist/cjs/js/src/htx.js +9049 -0
- package/dist/cjs/js/src/huobi.js +16 -0
- package/dist/cjs/js/src/huobijp.js +1918 -0
- package/dist/cjs/js/src/idex.js +1770 -0
- package/dist/cjs/js/src/independentreserve.js +761 -0
- package/dist/cjs/js/src/indodax.js +1069 -0
- package/dist/cjs/js/src/kraken.js +2857 -0
- package/dist/cjs/js/src/krakenfutures.js +2407 -0
- package/dist/cjs/js/src/kucoin.js +4489 -0
- package/dist/cjs/js/src/kucoinfutures.js +2475 -0
- package/dist/cjs/js/src/kuna.js +1949 -0
- package/dist/cjs/js/src/latoken.js +1729 -0
- package/dist/cjs/js/src/lbank.js +2851 -0
- package/dist/cjs/js/src/luno.js +1044 -0
- package/dist/cjs/js/src/lykke.js +1303 -0
- package/dist/cjs/js/src/mercado.js +897 -0
- package/dist/cjs/js/src/mexc.js +5407 -0
- package/dist/cjs/js/src/ndax.js +2450 -0
- package/dist/cjs/js/src/novadax.js +1556 -0
- package/dist/cjs/js/src/oceanex.js +964 -0
- package/dist/cjs/js/src/okcoin.js +3115 -0
- package/dist/cjs/js/src/okx.js +7330 -0
- package/dist/cjs/js/src/p2b.js +1243 -0
- package/dist/cjs/js/src/paymium.js +597 -0
- package/dist/cjs/js/src/phemex.js +4722 -0
- package/dist/cjs/js/src/poloniex.js +2356 -0
- package/dist/cjs/js/src/poloniexfutures.js +1794 -0
- package/dist/cjs/js/src/pro/alpaca.js +714 -0
- package/dist/cjs/js/src/pro/ascendex.js +957 -0
- package/dist/cjs/js/src/pro/bequant.js +33 -0
- package/dist/cjs/js/src/pro/binance.js +2796 -0
- package/dist/cjs/js/src/pro/binancecoinm.js +23 -0
- package/dist/cjs/js/src/pro/binanceus.js +51 -0
- package/dist/cjs/js/src/pro/binanceusdm.js +32 -0
- package/dist/cjs/js/src/pro/bingx.js +944 -0
- package/dist/cjs/js/src/pro/bitcoincom.js +29 -0
- package/dist/cjs/js/src/pro/bitfinex.js +672 -0
- package/dist/cjs/js/src/pro/bitfinex2.js +1159 -0
- package/dist/cjs/js/src/pro/bitget.js +1733 -0
- package/dist/cjs/js/src/pro/bitmart.js +1486 -0
- package/dist/cjs/js/src/pro/bitmex.js +1576 -0
- package/dist/cjs/js/src/pro/bitopro.js +327 -0
- package/dist/cjs/js/src/pro/bitpanda.js +1341 -0
- package/dist/cjs/js/src/pro/bitrue.js +462 -0
- package/dist/cjs/js/src/pro/bitstamp.js +547 -0
- package/dist/cjs/js/src/pro/bitvavo.js +704 -0
- package/dist/cjs/js/src/pro/blockchaincom.js +794 -0
- package/dist/cjs/js/src/pro/bybit.js +1843 -0
- package/dist/cjs/js/src/pro/cex.js +1510 -0
- package/dist/cjs/js/src/pro/coinbase.js +561 -0
- package/dist/cjs/js/src/pro/coinbasepro.js +968 -0
- package/dist/cjs/js/src/pro/coinex.js +1095 -0
- package/dist/cjs/js/src/pro/cryptocom.js +1020 -0
- package/dist/cjs/js/src/pro/currencycom.js +563 -0
- package/dist/cjs/js/src/pro/deribit.js +825 -0
- package/dist/cjs/js/src/pro/exmo.js +658 -0
- package/dist/cjs/js/src/pro/gate.js +1316 -0
- package/dist/cjs/js/src/pro/gateio.js +16 -0
- package/dist/cjs/js/src/pro/gemini.js +649 -0
- package/dist/cjs/js/src/pro/hitbtc.js +1293 -0
- package/dist/cjs/js/src/pro/hollaex.js +597 -0
- package/dist/cjs/js/src/pro/htx.js +2383 -0
- package/dist/cjs/js/src/pro/huobi.js +16 -0
- package/dist/cjs/js/src/pro/huobijp.js +606 -0
- package/dist/cjs/js/src/pro/idex.js +714 -0
- package/dist/cjs/js/src/pro/independentreserve.js +280 -0
- package/dist/cjs/js/src/pro/kraken.js +1364 -0
- package/dist/cjs/js/src/pro/krakenfutures.js +1500 -0
- package/dist/cjs/js/src/pro/kucoin.js +1052 -0
- package/dist/cjs/js/src/pro/kucoinfutures.js +981 -0
- package/dist/cjs/js/src/pro/luno.js +322 -0
- package/dist/cjs/js/src/pro/mexc.js +1170 -0
- package/dist/cjs/js/src/pro/ndax.js +545 -0
- package/dist/cjs/js/src/pro/okcoin.js +760 -0
- package/dist/cjs/js/src/pro/okx.js +1608 -0
- package/dist/cjs/js/src/pro/phemex.js +1511 -0
- package/dist/cjs/js/src/pro/poloniex.js +1253 -0
- package/dist/cjs/js/src/pro/poloniexfutures.js +1014 -0
- package/dist/cjs/js/src/pro/probit.js +586 -0
- package/dist/cjs/js/src/pro/upbit.js +234 -0
- package/dist/cjs/js/src/pro/wazirx.js +776 -0
- package/dist/cjs/js/src/pro/whitebit.js +927 -0
- package/dist/cjs/js/src/pro/woo.js +769 -0
- package/dist/cjs/js/src/probit.js +1867 -0
- package/dist/cjs/js/src/static_dependencies/fflake/browser.js +401 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/JSEncrypt.js +195 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +308 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +554 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +94 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +70 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +91 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +16 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +1760 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +52 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +81 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +376 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsbn/util.js +70 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +1580 -0
- package/dist/cjs/js/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +74 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/_shortw_utils.js +24 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/curve.js +158 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/edwards.js +429 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +176 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/modular.js +324 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/montgomery.js +163 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/utils.js +245 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/abstract/weierstrass.js +1018 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/ed25519.js +383 -0
- package/dist/cjs/js/src/static_dependencies/noble-curves/secp256k1.js +258 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/_assert.js +53 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/_sha2.js +120 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/_u64.js +69 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/crypto.js +7 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/hmac.js +83 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/md5.js +240 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha1.js +91 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha256.js +130 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha3.js +214 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/sha512.js +239 -0
- package/dist/cjs/js/src/static_dependencies/noble-hashes/utils.js +93 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/body.js +354 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/errors/abort-error.js +16 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/errors/base.js +20 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/errors/fetch-error.js +30 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/headers.js +239 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/index.js +372 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/request.js +273 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/response.js +139 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/get-search.js +14 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/is-redirect.js +16 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/is.js +81 -0
- package/dist/cjs/js/src/static_dependencies/node-fetch/utils/referrer.js +292 -0
- package/dist/cjs/js/src/static_dependencies/proxies/agent-base/index.js +103 -0
- package/dist/cjs/js/src/static_dependencies/proxies/http-proxy-agent/index.js +140 -0
- package/dist/cjs/js/src/static_dependencies/proxies/https-proxy-agent/index.js +175 -0
- package/dist/cjs/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +95 -0
- package/dist/cjs/js/src/static_dependencies/qs/index.cjs.js +7 -0
- package/dist/cjs/js/src/static_dependencies/scure-base/index.js +383 -0
- package/dist/cjs/js/src/timex.js +1562 -0
- package/dist/cjs/js/src/tokocrypto.js +2542 -0
- package/dist/cjs/js/src/upbit.js +1844 -0
- package/dist/cjs/js/src/wavesexchange.js +2607 -0
- package/dist/cjs/js/src/wazirx.js +953 -0
- package/dist/cjs/js/src/whitebit.js +2309 -0
- package/dist/cjs/js/src/woo.js +2765 -0
- package/dist/cjs/js/src/yobit.js +1314 -0
- package/dist/cjs/js/src/zaif.js +736 -0
- package/dist/cjs/js/src/zonda.js +1883 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bigone.d.ts +18 -0
- package/js/src/abstract/binance.d.ts +2 -0
- package/js/src/abstract/binancecoinm.d.ts +2 -0
- package/js/src/abstract/binanceus.d.ts +2 -0
- package/js/src/abstract/binanceusdm.d.ts +2 -0
- package/js/src/abstract/bingx.d.ts +2 -0
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/gate.d.ts +11 -0
- package/js/src/abstract/gateio.d.ts +11 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/alpaca.js +18 -18
- package/js/src/base/Exchange.d.ts +5 -1
- package/js/src/base/Exchange.js +101 -12
- package/js/src/bigone.d.ts +3 -2
- package/js/src/bigone.js +429 -167
- package/js/src/binance.js +48 -34
- package/js/src/bingx.js +115 -38
- package/js/src/bitfinex.d.ts +2 -2
- package/js/src/bitfinex.js +2 -3
- package/js/src/bitget.js +33 -13
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitmart.js +5 -5
- package/js/src/bitmex.js +1 -0
- package/js/src/bybit.js +2 -0
- package/js/src/coinbase.d.ts +26 -3
- package/js/src/coinbase.js +176 -26
- package/js/src/coinlist.js +3 -4
- package/js/src/coinone.js +1 -1
- package/js/src/coinsph.js +2 -3
- package/js/src/deribit.js +1 -0
- package/js/src/gate.d.ts +4 -4
- package/js/src/gate.js +96 -59
- package/js/src/gemini.js +1 -1
- package/js/src/hitbtc.d.ts +4 -4
- package/js/src/hitbtc.js +2 -3
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +29 -7
- package/js/src/huobijp.js +2 -3
- package/js/src/independentreserve.js +7 -5
- package/js/src/kraken.js +3 -6
- package/js/src/lbank.js +59 -33
- package/js/src/mexc.js +2 -1
- package/js/src/oceanex.js +1 -1
- package/js/src/okx.js +14 -3
- package/js/src/phemex.js +9 -2
- package/js/src/pro/binance.d.ts +2 -23
- package/js/src/pro/binance.js +58 -22
- package/js/src/pro/coinbase.d.ts +2 -2
- package/js/src/pro/coinbase.js +4 -1
- package/js/src/pro/coinbasepro.d.ts +2 -2
- package/js/src/pro/hitbtc.d.ts +2 -2
- package/js/src/pro/kraken.js +1 -1
- package/js/src/pro/okx.d.ts +1 -0
- package/js/src/pro/okx.js +52 -2
- package/js/src/pro/poloniex.d.ts +2 -2
- package/js/src/probit.js +4 -2
- package/js/src/upbit.d.ts +3 -101
- package/js/src/upbit.js +12 -12
- package/js/src/wavesexchange.js +1 -1
- package/js/src/woo.d.ts +2 -0
- package/js/src/woo.js +52 -0
- package/package.json +1 -1
- package/skip-tests.json +5 -0
package/dist/ccxt.browser.js
CHANGED
|
@@ -2522,7 +2522,7 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2522
2522
|
'market': 'https://data.sandbox.{hostname}',
|
|
2523
2523
|
},
|
|
2524
2524
|
'doc': 'https://alpaca.markets/docs/',
|
|
2525
|
-
'fees': 'https://alpaca.markets/
|
|
2525
|
+
'fees': 'https://docs.alpaca.markets/docs/crypto-fees',
|
|
2526
2526
|
},
|
|
2527
2527
|
'has': {
|
|
2528
2528
|
'CORS': false,
|
|
@@ -2693,28 +2693,28 @@ class alpaca extends _abstract_alpaca_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
2693
2693
|
'trading': {
|
|
2694
2694
|
'tierBased': true,
|
|
2695
2695
|
'percentage': true,
|
|
2696
|
-
'maker': this.parseNumber('0.
|
|
2697
|
-
'taker': this.parseNumber('0.
|
|
2696
|
+
'maker': this.parseNumber('0.0015'),
|
|
2697
|
+
'taker': this.parseNumber('0.0025'),
|
|
2698
2698
|
'tiers': {
|
|
2699
2699
|
'taker': [
|
|
2700
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
2701
|
-
[this.parseNumber('
|
|
2702
|
-
[this.parseNumber('
|
|
2703
|
-
[this.parseNumber('
|
|
2704
|
-
[this.parseNumber('10000000'), this.parseNumber('0.
|
|
2705
|
-
[this.parseNumber('25000000'), this.parseNumber('0.
|
|
2706
|
-
[this.parseNumber('50000000'), this.parseNumber('0.
|
|
2700
|
+
[this.parseNumber('0'), this.parseNumber('0.0025')],
|
|
2701
|
+
[this.parseNumber('100000'), this.parseNumber('0.0022')],
|
|
2702
|
+
[this.parseNumber('500000'), this.parseNumber('0.0020')],
|
|
2703
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0018')],
|
|
2704
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0015')],
|
|
2705
|
+
[this.parseNumber('25000000'), this.parseNumber('0.0013')],
|
|
2706
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0012')],
|
|
2707
2707
|
[this.parseNumber('100000000'), this.parseNumber('0.001')],
|
|
2708
2708
|
],
|
|
2709
2709
|
'maker': [
|
|
2710
|
-
[this.parseNumber('0'), this.parseNumber('0.
|
|
2711
|
-
[this.parseNumber('
|
|
2712
|
-
[this.parseNumber('
|
|
2713
|
-
[this.parseNumber('
|
|
2714
|
-
[this.parseNumber('10000000'), this.parseNumber('0.
|
|
2715
|
-
[this.parseNumber('25000000'), this.parseNumber('0.
|
|
2716
|
-
[this.parseNumber('50000000'), this.parseNumber('0.
|
|
2717
|
-
[this.parseNumber('100000000'), this.parseNumber('0.
|
|
2710
|
+
[this.parseNumber('0'), this.parseNumber('0.0015')],
|
|
2711
|
+
[this.parseNumber('100000'), this.parseNumber('0.0012')],
|
|
2712
|
+
[this.parseNumber('500000'), this.parseNumber('0.001')],
|
|
2713
|
+
[this.parseNumber('1000000'), this.parseNumber('0.0008')],
|
|
2714
|
+
[this.parseNumber('10000000'), this.parseNumber('0.0005')],
|
|
2715
|
+
[this.parseNumber('25000000'), this.parseNumber('0.0002')],
|
|
2716
|
+
[this.parseNumber('50000000'), this.parseNumber('0.0002')],
|
|
2717
|
+
[this.parseNumber('100000000'), this.parseNumber('0.00')],
|
|
2718
2718
|
],
|
|
2719
2719
|
},
|
|
2720
2720
|
},
|
|
@@ -7357,6 +7357,8 @@ class Exchange {
|
|
|
7357
7357
|
'createStopOrder': undefined,
|
|
7358
7358
|
'createStopLimitOrder': undefined,
|
|
7359
7359
|
'createStopMarketOrder': undefined,
|
|
7360
|
+
'createTrailingAmountOrder': undefined,
|
|
7361
|
+
'createTrailingPercentOrder': undefined,
|
|
7360
7362
|
'createOrderWs': undefined,
|
|
7361
7363
|
'editOrderWs': undefined,
|
|
7362
7364
|
'fetchOpenOrdersWs': undefined,
|
|
@@ -7649,10 +7651,28 @@ class Exchange {
|
|
|
7649
7651
|
console.log(...args);
|
|
7650
7652
|
}
|
|
7651
7653
|
async loadProxyModules() {
|
|
7654
|
+
if (this.proxyModulesLoaded) {
|
|
7655
|
+
return;
|
|
7656
|
+
}
|
|
7652
7657
|
this.proxyModulesLoaded = true;
|
|
7653
|
-
//
|
|
7654
|
-
|
|
7655
|
-
|
|
7658
|
+
// we have to handle it with below nested way, because of dynamic
|
|
7659
|
+
// import issues (https://github.com/ccxt/ccxt/pull/20687)
|
|
7660
|
+
try {
|
|
7661
|
+
// todo: possible sync alternatives: https://stackoverflow.com/questions/51069002/convert-import-to-synchronous
|
|
7662
|
+
this.httpProxyAgentModule = await import(/* webpackIgnore: true */ '../static_dependencies/proxies/http-proxy-agent/index.js');
|
|
7663
|
+
this.httpsProxyAgentModule = await import(/* webpackIgnore: true */ '../static_dependencies/proxies/https-proxy-agent/index.js');
|
|
7664
|
+
}
|
|
7665
|
+
catch (e) {
|
|
7666
|
+
// if several users are using those frameworks which cause exceptions,
|
|
7667
|
+
// let them to be able to load modules still, by installing them
|
|
7668
|
+
try {
|
|
7669
|
+
// @ts-ignore
|
|
7670
|
+
this.httpProxyAgentModule = await import(/* webpackIgnore: true */ 'http-proxy-agent');
|
|
7671
|
+
// @ts-ignore
|
|
7672
|
+
this.httpProxyAgentModule = await import(/* webpackIgnore: true */ 'https-proxy-agent');
|
|
7673
|
+
}
|
|
7674
|
+
catch { }
|
|
7675
|
+
}
|
|
7656
7676
|
if (this.socksProxyAgentModuleChecked === false) {
|
|
7657
7677
|
this.socksProxyAgentModuleChecked = true;
|
|
7658
7678
|
try {
|
|
@@ -7744,11 +7764,10 @@ class Exchange {
|
|
|
7744
7764
|
// proxy agents
|
|
7745
7765
|
const [httpProxy, httpsProxy, socksProxy] = this.checkProxySettings(url, method, headers, body);
|
|
7746
7766
|
this.checkConflictingProxies(httpProxy || httpsProxy || socksProxy, proxyUrl);
|
|
7767
|
+
// skip proxies on the browser
|
|
7747
7768
|
if (isNode) {
|
|
7748
|
-
//
|
|
7749
|
-
|
|
7750
|
-
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)
|
|
7751
|
-
}
|
|
7769
|
+
// 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)
|
|
7770
|
+
await this.loadProxyModules();
|
|
7752
7771
|
}
|
|
7753
7772
|
const chosenAgent = this.setProxyAgents(httpProxy, httpsProxy, socksProxy);
|
|
7754
7773
|
// user-agent
|
|
@@ -7770,13 +7789,29 @@ class Exchange {
|
|
|
7770
7789
|
// end of proxies & headers
|
|
7771
7790
|
if (this.fetchImplementation === undefined) {
|
|
7772
7791
|
if (isNode) {
|
|
7773
|
-
const module = await import(/* webpackIgnore: true */ '../static_dependencies/node-fetch/index.js');
|
|
7774
7792
|
if (this.agent === undefined) {
|
|
7775
7793
|
this.agent = this.httpsAgent;
|
|
7776
7794
|
}
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7795
|
+
try {
|
|
7796
|
+
const module = await import(/* webpackIgnore: true */ '../static_dependencies/node-fetch/index.js');
|
|
7797
|
+
this.AbortError = module.AbortError;
|
|
7798
|
+
this.fetchImplementation = module.default;
|
|
7799
|
+
this.FetchError = module.FetchError;
|
|
7800
|
+
}
|
|
7801
|
+
catch (e) {
|
|
7802
|
+
// some users having issues with dynamic imports (https://github.com/ccxt/ccxt/pull/20687)
|
|
7803
|
+
// so let them to fallback to node's native fetch
|
|
7804
|
+
if (typeof fetch === 'function') {
|
|
7805
|
+
this.fetchImplementation = fetch;
|
|
7806
|
+
// as it's browser-compatible implementation ( https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#fetch )
|
|
7807
|
+
// it throws same error types
|
|
7808
|
+
this.AbortError = DOMException;
|
|
7809
|
+
this.FetchError = TypeError;
|
|
7810
|
+
}
|
|
7811
|
+
else {
|
|
7812
|
+
throw new Error('Seems, "fetch" function is not available in your node-js version, please use latest node-js version');
|
|
7813
|
+
}
|
|
7814
|
+
}
|
|
7780
7815
|
}
|
|
7781
7816
|
else {
|
|
7782
7817
|
this.fetchImplementation = self.fetch;
|
|
@@ -10731,6 +10766,60 @@ class Exchange {
|
|
|
10731
10766
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
10732
10767
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createOrder() is not supported yet');
|
|
10733
10768
|
}
|
|
10769
|
+
async createTrailingAmountOrder(symbol, type, side, amount, price = undefined, trailingAmount = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
10770
|
+
/**
|
|
10771
|
+
* @method
|
|
10772
|
+
* @name createTrailingAmountOrder
|
|
10773
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
|
10774
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
10775
|
+
* @param {string} type 'market' or 'limit'
|
|
10776
|
+
* @param {string} side 'buy' or 'sell'
|
|
10777
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
10778
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
10779
|
+
* @param {float} trailingAmount the quote amount to trail away from the current market price
|
|
10780
|
+
* @param {float} [trailingTriggerPrice] the price to activate a trailing order, default uses the price argument
|
|
10781
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10782
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
10783
|
+
*/
|
|
10784
|
+
if (trailingAmount === undefined) {
|
|
10785
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' createTrailingAmountOrder() requires a trailingAmount argument');
|
|
10786
|
+
}
|
|
10787
|
+
params['trailingAmount'] = trailingAmount;
|
|
10788
|
+
if (trailingTriggerPrice !== undefined) {
|
|
10789
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
10790
|
+
}
|
|
10791
|
+
if (this.has['createTrailingAmountOrder']) {
|
|
10792
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
10793
|
+
}
|
|
10794
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createTrailingAmountOrder() is not supported yet');
|
|
10795
|
+
}
|
|
10796
|
+
async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
10797
|
+
/**
|
|
10798
|
+
* @method
|
|
10799
|
+
* @name createTrailingPercentOrder
|
|
10800
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
10801
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
10802
|
+
* @param {string} type 'market' or 'limit'
|
|
10803
|
+
* @param {string} side 'buy' or 'sell'
|
|
10804
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
10805
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
10806
|
+
* @param {float} trailingPercent the percent to trail away from the current market price
|
|
10807
|
+
* @param {float} [trailingTriggerPrice] the price to activate a trailing order, default uses the price argument
|
|
10808
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10809
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
10810
|
+
*/
|
|
10811
|
+
if (trailingPercent === undefined) {
|
|
10812
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
|
|
10813
|
+
}
|
|
10814
|
+
params['trailingPercent'] = trailingPercent;
|
|
10815
|
+
if (trailingTriggerPrice !== undefined) {
|
|
10816
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
10817
|
+
}
|
|
10818
|
+
if (this.has['createTrailingPercentOrder']) {
|
|
10819
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
10820
|
+
}
|
|
10821
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' createTrailingPercentOrder() is not supported yet');
|
|
10822
|
+
}
|
|
10734
10823
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
10735
10824
|
/**
|
|
10736
10825
|
* @method
|
|
@@ -10891,7 +10980,7 @@ class Exchange {
|
|
|
10891
10980
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchFundingHistory() is not supported yet');
|
|
10892
10981
|
}
|
|
10893
10982
|
async closePosition(symbol, side = undefined, params = {}) {
|
|
10894
|
-
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + '
|
|
10983
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' closePosition() is not supported yet');
|
|
10895
10984
|
}
|
|
10896
10985
|
async closeAllPositions(params = {}) {
|
|
10897
10986
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' closeAllPositions() is not supported yet');
|
|
@@ -15264,10 +15353,10 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15264
15353
|
'has': {
|
|
15265
15354
|
'CORS': undefined,
|
|
15266
15355
|
'spot': true,
|
|
15267
|
-
'margin':
|
|
15356
|
+
'margin': false,
|
|
15268
15357
|
'swap': undefined,
|
|
15269
15358
|
'future': undefined,
|
|
15270
|
-
'option':
|
|
15359
|
+
'option': false,
|
|
15271
15360
|
'cancelAllOrders': true,
|
|
15272
15361
|
'cancelOrder': true,
|
|
15273
15362
|
'createMarketBuyOrderWithCost': true,
|
|
@@ -15321,6 +15410,8 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15321
15410
|
'api': {
|
|
15322
15411
|
'public': 'https://{hostname}/api/v3',
|
|
15323
15412
|
'private': 'https://{hostname}/api/v3/viewer',
|
|
15413
|
+
'contractPublic': 'https://{hostname}/api/contract/v2',
|
|
15414
|
+
'contractPrivate': 'https://{hostname}/api/contract/v2',
|
|
15324
15415
|
'webExchange': 'https://{hostname}/api/',
|
|
15325
15416
|
},
|
|
15326
15417
|
'www': 'https://big.one',
|
|
@@ -15360,6 +15451,38 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15360
15451
|
'transfer',
|
|
15361
15452
|
],
|
|
15362
15453
|
},
|
|
15454
|
+
'contractPublic': {
|
|
15455
|
+
'get': [
|
|
15456
|
+
'instruments',
|
|
15457
|
+
'depth@{symbol}/snapshot',
|
|
15458
|
+
'instruments/difference',
|
|
15459
|
+
'instruments/prices',
|
|
15460
|
+
],
|
|
15461
|
+
},
|
|
15462
|
+
'contractPrivate': {
|
|
15463
|
+
'get': [
|
|
15464
|
+
'accounts',
|
|
15465
|
+
'orders/{id}',
|
|
15466
|
+
'orders',
|
|
15467
|
+
'orders/opening',
|
|
15468
|
+
'orders/count',
|
|
15469
|
+
'orders/opening/count',
|
|
15470
|
+
'trades',
|
|
15471
|
+
'trades/count',
|
|
15472
|
+
],
|
|
15473
|
+
'post': [
|
|
15474
|
+
'orders',
|
|
15475
|
+
'orders/batch',
|
|
15476
|
+
],
|
|
15477
|
+
'put': [
|
|
15478
|
+
'positions/{symbol}/margin',
|
|
15479
|
+
'positions/{symbol}/risk-limit',
|
|
15480
|
+
],
|
|
15481
|
+
'delete': [
|
|
15482
|
+
'orders/{id}',
|
|
15483
|
+
'orders/batch',
|
|
15484
|
+
],
|
|
15485
|
+
},
|
|
15363
15486
|
'webExchange': {
|
|
15364
15487
|
'get': [
|
|
15365
15488
|
'uc/v2/assets',
|
|
@@ -15751,93 +15874,214 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15751
15874
|
// ]
|
|
15752
15875
|
// }
|
|
15753
15876
|
//
|
|
15877
|
+
const contractResponse = await this.contractPublicGetInstruments(params);
|
|
15878
|
+
//
|
|
15879
|
+
// [
|
|
15880
|
+
// {
|
|
15881
|
+
// "usdtPrice": 1.00031998,
|
|
15882
|
+
// "symbol": "BTCUSD",
|
|
15883
|
+
// "btcPrice": 34700.4,
|
|
15884
|
+
// "ethPrice": 1787.83,
|
|
15885
|
+
// "nextFundingRate": 0.00010,
|
|
15886
|
+
// "fundingRate": 0.00010,
|
|
15887
|
+
// "latestPrice": 34708.5,
|
|
15888
|
+
// "last24hPriceChange": 0.0321,
|
|
15889
|
+
// "indexPrice": 34700.4,
|
|
15890
|
+
// "volume24h": 261319063,
|
|
15891
|
+
// "turnover24h": 8204.129380685496,
|
|
15892
|
+
// "nextFundingTime": 1698285600000,
|
|
15893
|
+
// "markPrice": 34702.4646738,
|
|
15894
|
+
// "last24hMaxPrice": 35127.5,
|
|
15895
|
+
// "volume24hInUsd": 0.0,
|
|
15896
|
+
// "openValue": 32.88054722085945,
|
|
15897
|
+
// "last24hMinPrice": 33552.0,
|
|
15898
|
+
// "openInterest": 1141372.0
|
|
15899
|
+
// }
|
|
15900
|
+
// ...
|
|
15901
|
+
// ]
|
|
15902
|
+
//
|
|
15754
15903
|
const markets = this.safeValue(response, 'data', []);
|
|
15755
|
-
|
|
15756
|
-
|
|
15757
|
-
|
|
15758
|
-
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15779
|
-
|
|
15780
|
-
|
|
15781
|
-
|
|
15782
|
-
|
|
15783
|
-
|
|
15784
|
-
|
|
15785
|
-
|
|
15786
|
-
|
|
15787
|
-
|
|
15788
|
-
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
|
|
15792
|
-
},
|
|
15793
|
-
'limits': {
|
|
15794
|
-
'leverage': {
|
|
15795
|
-
'min': undefined,
|
|
15796
|
-
'max': undefined,
|
|
15904
|
+
const result = [];
|
|
15905
|
+
for (let i = 0; i < markets.length; i++) {
|
|
15906
|
+
const market = markets[i];
|
|
15907
|
+
const baseAsset = this.safeValue(market, 'base_asset', {});
|
|
15908
|
+
const quoteAsset = this.safeValue(market, 'quote_asset', {});
|
|
15909
|
+
const baseId = this.safeString(baseAsset, 'symbol');
|
|
15910
|
+
const quoteId = this.safeString(quoteAsset, 'symbol');
|
|
15911
|
+
const base = this.safeCurrencyCode(baseId);
|
|
15912
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
15913
|
+
result.push(this.safeMarketStructure({
|
|
15914
|
+
'id': this.safeString(market, 'name'),
|
|
15915
|
+
'uuid': this.safeString(market, 'id'),
|
|
15916
|
+
'symbol': base + '/' + quote,
|
|
15917
|
+
'base': base,
|
|
15918
|
+
'quote': quote,
|
|
15919
|
+
'settle': undefined,
|
|
15920
|
+
'baseId': baseId,
|
|
15921
|
+
'quoteId': quoteId,
|
|
15922
|
+
'settleId': undefined,
|
|
15923
|
+
'type': 'spot',
|
|
15924
|
+
'spot': true,
|
|
15925
|
+
'margin': false,
|
|
15926
|
+
'swap': false,
|
|
15927
|
+
'future': false,
|
|
15928
|
+
'option': false,
|
|
15929
|
+
'active': true,
|
|
15930
|
+
'contract': false,
|
|
15931
|
+
'linear': undefined,
|
|
15932
|
+
'inverse': undefined,
|
|
15933
|
+
'contractSize': undefined,
|
|
15934
|
+
'expiry': undefined,
|
|
15935
|
+
'expiryDatetime': undefined,
|
|
15936
|
+
'strike': undefined,
|
|
15937
|
+
'optionType': undefined,
|
|
15938
|
+
'precision': {
|
|
15939
|
+
'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'base_scale'))),
|
|
15940
|
+
'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quote_scale'))),
|
|
15797
15941
|
},
|
|
15798
|
-
'
|
|
15799
|
-
'
|
|
15800
|
-
|
|
15942
|
+
'limits': {
|
|
15943
|
+
'leverage': {
|
|
15944
|
+
'min': undefined,
|
|
15945
|
+
'max': undefined,
|
|
15946
|
+
},
|
|
15947
|
+
'amount': {
|
|
15948
|
+
'min': undefined,
|
|
15949
|
+
'max': undefined,
|
|
15950
|
+
},
|
|
15951
|
+
'price': {
|
|
15952
|
+
'min': undefined,
|
|
15953
|
+
'max': undefined,
|
|
15954
|
+
},
|
|
15955
|
+
'cost': {
|
|
15956
|
+
'min': this.safeNumber(market, 'min_quote_value'),
|
|
15957
|
+
'max': this.safeNumber(market, 'max_quote_value'),
|
|
15958
|
+
},
|
|
15801
15959
|
},
|
|
15802
|
-
'
|
|
15803
|
-
|
|
15804
|
-
|
|
15960
|
+
'created': undefined,
|
|
15961
|
+
'info': market,
|
|
15962
|
+
}));
|
|
15963
|
+
}
|
|
15964
|
+
for (let i = 0; i < contractResponse.length; i++) {
|
|
15965
|
+
const market = contractResponse[i];
|
|
15966
|
+
const marketId = this.safeString(market, 'symbol');
|
|
15967
|
+
const index = marketId.indexOf('USD');
|
|
15968
|
+
const baseId = marketId.slice(0, index);
|
|
15969
|
+
const quoteId = marketId.slice(index);
|
|
15970
|
+
const inverse = (quoteId === 'USD');
|
|
15971
|
+
const settleId = inverse ? baseId : quoteId;
|
|
15972
|
+
const base = this.safeCurrencyCode(baseId);
|
|
15973
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
15974
|
+
const settle = this.safeCurrencyCode(settleId);
|
|
15975
|
+
result.push(this.safeMarketStructure({
|
|
15976
|
+
'id': marketId,
|
|
15977
|
+
'symbol': base + '/' + quote + ':' + settle,
|
|
15978
|
+
'base': base,
|
|
15979
|
+
'quote': quote,
|
|
15980
|
+
'settle': settle,
|
|
15981
|
+
'baseId': baseId,
|
|
15982
|
+
'quoteId': quoteId,
|
|
15983
|
+
'settleId': settleId,
|
|
15984
|
+
'type': 'swap',
|
|
15985
|
+
'spot': false,
|
|
15986
|
+
'margin': false,
|
|
15987
|
+
'swap': true,
|
|
15988
|
+
'future': false,
|
|
15989
|
+
'option': false,
|
|
15990
|
+
'active': true,
|
|
15991
|
+
'contract': true,
|
|
15992
|
+
'linear': !inverse,
|
|
15993
|
+
'inverse': inverse,
|
|
15994
|
+
'contractSize': 1,
|
|
15995
|
+
'expiry': undefined,
|
|
15996
|
+
'expiryDatetime': undefined,
|
|
15997
|
+
'strike': undefined,
|
|
15998
|
+
'optionType': undefined,
|
|
15999
|
+
'precision': {
|
|
16000
|
+
'amount': undefined,
|
|
16001
|
+
'price': undefined,
|
|
15805
16002
|
},
|
|
15806
|
-
'
|
|
15807
|
-
'
|
|
15808
|
-
|
|
16003
|
+
'limits': {
|
|
16004
|
+
'leverage': {
|
|
16005
|
+
'min': undefined,
|
|
16006
|
+
'max': undefined,
|
|
16007
|
+
},
|
|
16008
|
+
'amount': {
|
|
16009
|
+
'min': undefined,
|
|
16010
|
+
'max': undefined,
|
|
16011
|
+
},
|
|
16012
|
+
'price': {
|
|
16013
|
+
'min': undefined,
|
|
16014
|
+
'max': undefined,
|
|
16015
|
+
},
|
|
16016
|
+
'cost': {
|
|
16017
|
+
'min': undefined,
|
|
16018
|
+
'max': undefined,
|
|
16019
|
+
},
|
|
15809
16020
|
},
|
|
15810
|
-
|
|
15811
|
-
|
|
15812
|
-
|
|
15813
|
-
|
|
16021
|
+
'info': market,
|
|
16022
|
+
}));
|
|
16023
|
+
}
|
|
16024
|
+
return result;
|
|
15814
16025
|
}
|
|
15815
16026
|
parseTicker(ticker, market = undefined) {
|
|
15816
16027
|
//
|
|
15817
|
-
//
|
|
15818
|
-
// "asset_pair_name":"ETH-BTC",
|
|
15819
|
-
// "bid":{"price":"0.021593","order_count":1,"quantity":"0.20936"},
|
|
15820
|
-
// "ask":{"price":"0.021613","order_count":1,"quantity":"2.87064"},
|
|
15821
|
-
// "open":"0.021795",
|
|
15822
|
-
// "high":"0.021795",
|
|
15823
|
-
// "low":"0.021471",
|
|
15824
|
-
// "close":"0.021613",
|
|
15825
|
-
// "volume":"117078.90431",
|
|
15826
|
-
// "daily_change":"-0.000182"
|
|
15827
|
-
// }
|
|
16028
|
+
// spot
|
|
15828
16029
|
//
|
|
15829
|
-
|
|
15830
|
-
|
|
15831
|
-
|
|
15832
|
-
|
|
16030
|
+
// {
|
|
16031
|
+
// "asset_pair_name": "ETH-BTC",
|
|
16032
|
+
// "bid": {
|
|
16033
|
+
// "price": "0.021593",
|
|
16034
|
+
// "order_count": 1,
|
|
16035
|
+
// "quantity": "0.20936"
|
|
16036
|
+
// },
|
|
16037
|
+
// "ask": {
|
|
16038
|
+
// "price": "0.021613",
|
|
16039
|
+
// "order_count": 1,
|
|
16040
|
+
// "quantity": "2.87064"
|
|
16041
|
+
// },
|
|
16042
|
+
// "open": "0.021795",
|
|
16043
|
+
// "high": "0.021795",
|
|
16044
|
+
// "low": "0.021471",
|
|
16045
|
+
// "close": "0.021613",
|
|
16046
|
+
// "volume": "117078.90431",
|
|
16047
|
+
// "daily_change": "-0.000182"
|
|
16048
|
+
// }
|
|
16049
|
+
//
|
|
16050
|
+
// contract
|
|
16051
|
+
//
|
|
16052
|
+
// {
|
|
16053
|
+
// "usdtPrice": 1.00031998,
|
|
16054
|
+
// "symbol": "BTCUSD",
|
|
16055
|
+
// "btcPrice": 34700.4,
|
|
16056
|
+
// "ethPrice": 1787.83,
|
|
16057
|
+
// "nextFundingRate": 0.00010,
|
|
16058
|
+
// "fundingRate": 0.00010,
|
|
16059
|
+
// "latestPrice": 34708.5,
|
|
16060
|
+
// "last24hPriceChange": 0.0321,
|
|
16061
|
+
// "indexPrice": 34700.4,
|
|
16062
|
+
// "volume24h": 261319063,
|
|
16063
|
+
// "turnover24h": 8204.129380685496,
|
|
16064
|
+
// "nextFundingTime": 1698285600000,
|
|
16065
|
+
// "markPrice": 34702.4646738,
|
|
16066
|
+
// "last24hMaxPrice": 35127.5,
|
|
16067
|
+
// "volume24hInUsd": 0.0,
|
|
16068
|
+
// "openValue": 32.88054722085945,
|
|
16069
|
+
// "last24hMinPrice": 33552.0,
|
|
16070
|
+
// "openInterest": 1141372.0
|
|
16071
|
+
// }
|
|
16072
|
+
//
|
|
16073
|
+
const marketType = ('asset_pair_name' in ticker) ? 'spot' : 'swap';
|
|
16074
|
+
const marketId = this.safeString2(ticker, 'asset_pair_name', 'symbol');
|
|
16075
|
+
const symbol = this.safeSymbol(marketId, market, '-', marketType);
|
|
16076
|
+
const close = this.safeString2(ticker, 'close', 'latestPrice');
|
|
15833
16077
|
const bid = this.safeValue(ticker, 'bid', {});
|
|
15834
16078
|
const ask = this.safeValue(ticker, 'ask', {});
|
|
15835
16079
|
return this.safeTicker({
|
|
15836
16080
|
'symbol': symbol,
|
|
15837
|
-
'timestamp':
|
|
15838
|
-
'datetime':
|
|
15839
|
-
'high': this.
|
|
15840
|
-
'low': this.
|
|
16081
|
+
'timestamp': undefined,
|
|
16082
|
+
'datetime': undefined,
|
|
16083
|
+
'high': this.safeString2(ticker, 'high', 'last24hMaxPrice'),
|
|
16084
|
+
'low': this.safeString2(ticker, 'low', 'last24hMinPrice'),
|
|
15841
16085
|
'bid': this.safeString(bid, 'price'),
|
|
15842
16086
|
'bidVolume': this.safeString(bid, 'quantity'),
|
|
15843
16087
|
'ask': this.safeString(ask, 'price'),
|
|
@@ -15847,11 +16091,11 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15847
16091
|
'close': close,
|
|
15848
16092
|
'last': close,
|
|
15849
16093
|
'previousClose': undefined,
|
|
15850
|
-
'change': this.
|
|
16094
|
+
'change': this.safeString2(ticker, 'daily_change', 'last24hPriceChange'),
|
|
15851
16095
|
'percentage': undefined,
|
|
15852
16096
|
'average': undefined,
|
|
15853
|
-
'baseVolume': this.
|
|
15854
|
-
'quoteVolume':
|
|
16097
|
+
'baseVolume': this.safeString2(ticker, 'volume', 'volume24h'),
|
|
16098
|
+
'quoteVolume': this.safeString(ticker, 'volume24hInUsd'),
|
|
15855
16099
|
'info': ticker,
|
|
15856
16100
|
}, market);
|
|
15857
16101
|
}
|
|
@@ -15866,83 +16110,123 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15866
16110
|
*/
|
|
15867
16111
|
await this.loadMarkets();
|
|
15868
16112
|
const market = this.market(symbol);
|
|
15869
|
-
|
|
15870
|
-
|
|
15871
|
-
|
|
15872
|
-
|
|
15873
|
-
|
|
15874
|
-
|
|
15875
|
-
|
|
15876
|
-
|
|
15877
|
-
|
|
15878
|
-
|
|
15879
|
-
|
|
15880
|
-
|
|
15881
|
-
|
|
15882
|
-
|
|
15883
|
-
|
|
15884
|
-
|
|
15885
|
-
|
|
15886
|
-
|
|
15887
|
-
|
|
15888
|
-
|
|
15889
|
-
|
|
15890
|
-
|
|
16113
|
+
let type = undefined;
|
|
16114
|
+
[type, params] = this.handleMarketTypeAndParams('fetchTicker', market, params);
|
|
16115
|
+
if (type === 'spot') {
|
|
16116
|
+
const request = {
|
|
16117
|
+
'asset_pair_name': market['id'],
|
|
16118
|
+
};
|
|
16119
|
+
const response = await this.publicGetAssetPairsAssetPairNameTicker(this.extend(request, params));
|
|
16120
|
+
//
|
|
16121
|
+
// {
|
|
16122
|
+
// "code":0,
|
|
16123
|
+
// "data":{
|
|
16124
|
+
// "asset_pair_name":"ETH-BTC",
|
|
16125
|
+
// "bid":{"price":"0.021593","order_count":1,"quantity":"0.20936"},
|
|
16126
|
+
// "ask":{"price":"0.021613","order_count":1,"quantity":"2.87064"},
|
|
16127
|
+
// "open":"0.021795",
|
|
16128
|
+
// "high":"0.021795",
|
|
16129
|
+
// "low":"0.021471",
|
|
16130
|
+
// "close":"0.021613",
|
|
16131
|
+
// "volume":"117078.90431",
|
|
16132
|
+
// "daily_change":"-0.000182"
|
|
16133
|
+
// }
|
|
16134
|
+
// }
|
|
16135
|
+
//
|
|
16136
|
+
const ticker = this.safeValue(response, 'data', {});
|
|
16137
|
+
return this.parseTicker(ticker, market);
|
|
16138
|
+
}
|
|
16139
|
+
else {
|
|
16140
|
+
const tickers = await this.fetchTickers([symbol], params);
|
|
16141
|
+
return this.safeValue(tickers, symbol);
|
|
16142
|
+
}
|
|
15891
16143
|
}
|
|
15892
16144
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
15893
16145
|
/**
|
|
15894
16146
|
* @method
|
|
15895
16147
|
* @name bigone#fetchTickers
|
|
15896
16148
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
15897
|
-
* @param {string[]
|
|
16149
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
15898
16150
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
15899
16151
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
15900
16152
|
*/
|
|
15901
16153
|
await this.loadMarkets();
|
|
16154
|
+
let market = undefined;
|
|
16155
|
+
const symbol = this.safeString(symbols, 0);
|
|
16156
|
+
if (symbol !== undefined) {
|
|
16157
|
+
market = this.market(symbol);
|
|
16158
|
+
}
|
|
16159
|
+
let type = undefined;
|
|
16160
|
+
[type, params] = this.handleMarketTypeAndParams('fetchTickers', market, params);
|
|
16161
|
+
const isSpot = type === 'spot';
|
|
15902
16162
|
const request = {};
|
|
15903
16163
|
symbols = this.marketSymbols(symbols);
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
16164
|
+
let data = undefined;
|
|
16165
|
+
if (isSpot) {
|
|
16166
|
+
if (symbols !== undefined) {
|
|
16167
|
+
const ids = this.marketIds(symbols);
|
|
16168
|
+
request['pair_names'] = ids.join(',');
|
|
16169
|
+
}
|
|
16170
|
+
const response = await this.publicGetAssetPairsTickers(this.extend(request, params));
|
|
16171
|
+
//
|
|
16172
|
+
// {
|
|
16173
|
+
// "code": 0,
|
|
16174
|
+
// "data": [
|
|
16175
|
+
// {
|
|
16176
|
+
// "asset_pair_name": "PCX-BTC",
|
|
16177
|
+
// "bid": {
|
|
16178
|
+
// "price": "0.000234",
|
|
16179
|
+
// "order_count": 1,
|
|
16180
|
+
// "quantity": "0.518"
|
|
16181
|
+
// },
|
|
16182
|
+
// "ask": {
|
|
16183
|
+
// "price": "0.0002348",
|
|
16184
|
+
// "order_count": 1,
|
|
16185
|
+
// "quantity": "2.348"
|
|
16186
|
+
// },
|
|
16187
|
+
// "open": "0.0002343",
|
|
16188
|
+
// "high": "0.0002348",
|
|
16189
|
+
// "low": "0.0002162",
|
|
16190
|
+
// "close": "0.0002348",
|
|
16191
|
+
// "volume": "12887.016",
|
|
16192
|
+
// "daily_change": "0.0000005"
|
|
16193
|
+
// },
|
|
16194
|
+
// ...
|
|
16195
|
+
// ]
|
|
16196
|
+
// }
|
|
16197
|
+
//
|
|
16198
|
+
data = this.safeValue(response, 'data', []);
|
|
15907
16199
|
}
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
// ]
|
|
15936
|
-
// }
|
|
15937
|
-
//
|
|
15938
|
-
const tickers = this.safeValue(response, 'data', []);
|
|
15939
|
-
const result = {};
|
|
15940
|
-
for (let i = 0; i < tickers.length; i++) {
|
|
15941
|
-
const ticker = this.parseTicker(tickers[i]);
|
|
15942
|
-
const symbol = ticker['symbol'];
|
|
15943
|
-
result[symbol] = ticker;
|
|
16200
|
+
else {
|
|
16201
|
+
data = await this.contractPublicGetInstruments(params);
|
|
16202
|
+
//
|
|
16203
|
+
// [
|
|
16204
|
+
// {
|
|
16205
|
+
// "usdtPrice": 1.00031998,
|
|
16206
|
+
// "symbol": "BTCUSD",
|
|
16207
|
+
// "btcPrice": 34700.4,
|
|
16208
|
+
// "ethPrice": 1787.83,
|
|
16209
|
+
// "nextFundingRate": 0.00010,
|
|
16210
|
+
// "fundingRate": 0.00010,
|
|
16211
|
+
// "latestPrice": 34708.5,
|
|
16212
|
+
// "last24hPriceChange": 0.0321,
|
|
16213
|
+
// "indexPrice": 34700.4,
|
|
16214
|
+
// "volume24h": 261319063,
|
|
16215
|
+
// "turnover24h": 8204.129380685496,
|
|
16216
|
+
// "nextFundingTime": 1698285600000,
|
|
16217
|
+
// "markPrice": 34702.4646738,
|
|
16218
|
+
// "last24hMaxPrice": 35127.5,
|
|
16219
|
+
// "volume24hInUsd": 0.0,
|
|
16220
|
+
// "openValue": 32.88054722085945,
|
|
16221
|
+
// "last24hMinPrice": 33552.0,
|
|
16222
|
+
// "openInterest": 1141372.0
|
|
16223
|
+
// }
|
|
16224
|
+
// ...
|
|
16225
|
+
// ]
|
|
16226
|
+
//
|
|
15944
16227
|
}
|
|
15945
|
-
|
|
16228
|
+
const tickers = this.parseTickers(data, symbols);
|
|
16229
|
+
return this.filterByArrayTickers(tickers, 'symbol', symbols);
|
|
15946
16230
|
}
|
|
15947
16231
|
async fetchTime(params = {}) {
|
|
15948
16232
|
/**
|
|
@@ -15976,29 +16260,90 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
15976
16260
|
*/
|
|
15977
16261
|
await this.loadMarkets();
|
|
15978
16262
|
const market = this.market(symbol);
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
16263
|
+
let response = undefined;
|
|
16264
|
+
if (market['contract']) {
|
|
16265
|
+
const request = {
|
|
16266
|
+
'symbol': market['id'],
|
|
16267
|
+
};
|
|
16268
|
+
response = await this.contractPublicGetDepthSymbolSnapshot(this.extend(request, params));
|
|
16269
|
+
//
|
|
16270
|
+
// {
|
|
16271
|
+
// bids: {
|
|
16272
|
+
// '20000': '20',
|
|
16273
|
+
// ...
|
|
16274
|
+
// '34552': '64851',
|
|
16275
|
+
// '34526.5': '59594',
|
|
16276
|
+
// ...
|
|
16277
|
+
// '34551.5': '29711'
|
|
16278
|
+
// },
|
|
16279
|
+
// asks: {
|
|
16280
|
+
// '34557': '34395',
|
|
16281
|
+
// ...
|
|
16282
|
+
// '40000': '20',
|
|
16283
|
+
// '34611.5': '56024',
|
|
16284
|
+
// ...
|
|
16285
|
+
// '34578.5': '66367'
|
|
16286
|
+
// },
|
|
16287
|
+
// to: '59737174',
|
|
16288
|
+
// lastPrice: '34554.5',
|
|
16289
|
+
// bestPrices: {
|
|
16290
|
+
// ask: '34557.0',
|
|
16291
|
+
// bid: '34552.0'
|
|
16292
|
+
// },
|
|
16293
|
+
// from: '0'
|
|
16294
|
+
// }
|
|
16295
|
+
//
|
|
16296
|
+
return this.parseContractOrderBook(response, market['symbol'], limit);
|
|
16297
|
+
}
|
|
16298
|
+
else {
|
|
16299
|
+
const request = {
|
|
16300
|
+
'asset_pair_name': market['id'],
|
|
16301
|
+
};
|
|
16302
|
+
if (limit !== undefined) {
|
|
16303
|
+
request['limit'] = limit; // default 50, max 200
|
|
16304
|
+
}
|
|
16305
|
+
response = await this.publicGetAssetPairsAssetPairNameDepth(this.extend(request, params));
|
|
16306
|
+
//
|
|
16307
|
+
// {
|
|
16308
|
+
// "code":0,
|
|
16309
|
+
// "data": {
|
|
16310
|
+
// "asset_pair_name": "EOS-BTC",
|
|
16311
|
+
// "bids": [
|
|
16312
|
+
// { "price": "42", "order_count": 4, "quantity": "23.33363711" }
|
|
16313
|
+
// ],
|
|
16314
|
+
// "asks": [
|
|
16315
|
+
// { "price": "45", "order_count": 2, "quantity": "4193.3283464" }
|
|
16316
|
+
// ]
|
|
16317
|
+
// }
|
|
16318
|
+
// }
|
|
16319
|
+
//
|
|
16320
|
+
const orderbook = this.safeValue(response, 'data', {});
|
|
16321
|
+
return this.parseOrderBook(orderbook, market['symbol'], undefined, 'bids', 'asks', 'price', 'quantity');
|
|
15984
16322
|
}
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
const
|
|
16001
|
-
return
|
|
16323
|
+
}
|
|
16324
|
+
parseContractBidsAsks(bidsAsks) {
|
|
16325
|
+
const bidsAsksKeys = Object.keys(bidsAsks);
|
|
16326
|
+
const result = [];
|
|
16327
|
+
for (let i = 0; i < bidsAsksKeys.length; i++) {
|
|
16328
|
+
const price = bidsAsksKeys[i];
|
|
16329
|
+
const amount = bidsAsks[price];
|
|
16330
|
+
result.push([this.parseNumber(price), this.parseNumber(amount)]);
|
|
16331
|
+
}
|
|
16332
|
+
return result;
|
|
16333
|
+
}
|
|
16334
|
+
parseContractOrderBook(orderbook, symbol, limit = undefined) {
|
|
16335
|
+
const responseBids = this.safeValue(orderbook, 'bids');
|
|
16336
|
+
const responseAsks = this.safeValue(orderbook, 'asks');
|
|
16337
|
+
const bids = this.parseContractBidsAsks(responseBids);
|
|
16338
|
+
const asks = this.parseContractBidsAsks(responseAsks);
|
|
16339
|
+
return {
|
|
16340
|
+
'symbol': symbol,
|
|
16341
|
+
'bids': this.filterByLimit(this.sortBy(bids, 0, true), limit),
|
|
16342
|
+
'asks': this.filterByLimit(this.sortBy(asks, 0), limit),
|
|
16343
|
+
'timestamp': undefined,
|
|
16344
|
+
'datetime': undefined,
|
|
16345
|
+
'nonce': undefined,
|
|
16346
|
+
};
|
|
16002
16347
|
}
|
|
16003
16348
|
parseTrade(trade, market = undefined) {
|
|
16004
16349
|
//
|
|
@@ -16158,6 +16503,9 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16158
16503
|
*/
|
|
16159
16504
|
await this.loadMarkets();
|
|
16160
16505
|
const market = this.market(symbol);
|
|
16506
|
+
if (market['contract']) {
|
|
16507
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchTrades () can only fetch trades for spot markets');
|
|
16508
|
+
}
|
|
16161
16509
|
const request = {
|
|
16162
16510
|
'asset_pair_name': market['id'],
|
|
16163
16511
|
};
|
|
@@ -16220,6 +16568,9 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16220
16568
|
*/
|
|
16221
16569
|
await this.loadMarkets();
|
|
16222
16570
|
const market = this.market(symbol);
|
|
16571
|
+
if (market['contract']) {
|
|
16572
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' fetchOHLCV () can only fetch ohlcvs for spot markets');
|
|
16573
|
+
}
|
|
16223
16574
|
if (limit === undefined) {
|
|
16224
16575
|
limit = 100; // default 100, max 500
|
|
16225
16576
|
}
|
|
@@ -16756,7 +17107,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16756
17107
|
const baseUrl = this.implodeHostname(this.urls['api'][api]);
|
|
16757
17108
|
let url = baseUrl + '/' + this.implodeParams(path, params);
|
|
16758
17109
|
headers = {};
|
|
16759
|
-
if (api === 'public' || api === 'webExchange') {
|
|
17110
|
+
if (api === 'public' || api === 'webExchange' || api === 'contractPublic') {
|
|
16760
17111
|
if (Object.keys(query).length) {
|
|
16761
17112
|
url += '?' + this.urlencode(query);
|
|
16762
17113
|
}
|
|
@@ -16779,7 +17130,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
16779
17130
|
}
|
|
16780
17131
|
else if (method === 'POST') {
|
|
16781
17132
|
headers['Content-Type'] = 'application/json';
|
|
16782
|
-
body =
|
|
17133
|
+
body = query;
|
|
16783
17134
|
}
|
|
16784
17135
|
}
|
|
16785
17136
|
headers['User-Agent'] = 'ccxt/' + this.id + '-' + this.version;
|
|
@@ -17173,7 +17524,7 @@ class bigone extends _abstract_bigone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
17173
17524
|
//
|
|
17174
17525
|
const code = this.safeString(response, 'code');
|
|
17175
17526
|
const message = this.safeString(response, 'message');
|
|
17176
|
-
if (code !== '0') {
|
|
17527
|
+
if ((code !== '0') && (code !== undefined)) {
|
|
17177
17528
|
const feedback = this.id + ' ' + body;
|
|
17178
17529
|
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
17179
17530
|
this.throwExactlyMatchedException(this.exceptions['exact'], code, feedback);
|
|
@@ -17251,6 +17602,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
17251
17602
|
'createStopLimitOrder': true,
|
|
17252
17603
|
'createStopMarketOrder': false,
|
|
17253
17604
|
'createStopOrder': true,
|
|
17605
|
+
'createTrailingPercentOrder': true,
|
|
17254
17606
|
'editOrder': true,
|
|
17255
17607
|
'fetchAccounts': undefined,
|
|
17256
17608
|
'fetchBalance': true,
|
|
@@ -17426,6 +17778,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
17426
17778
|
'asset/convert-transfer/queryByPage': 0.033335,
|
|
17427
17779
|
'asset/wallet/balance': 6,
|
|
17428
17780
|
'asset/custody/transfer-history': 6,
|
|
17781
|
+
'margin/borrow-repay': 1,
|
|
17429
17782
|
'margin/loan': 1,
|
|
17430
17783
|
'margin/repay': 1,
|
|
17431
17784
|
'margin/account': 1,
|
|
@@ -17677,6 +18030,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
17677
18030
|
'capital/withdraw/apply': 4.0002,
|
|
17678
18031
|
'capital/contract/convertible-coins': 4.0002,
|
|
17679
18032
|
'capital/deposit/credit-apply': 0.1,
|
|
18033
|
+
'margin/borrow-repay': 20.001,
|
|
17680
18034
|
'margin/transfer': 4.0002,
|
|
17681
18035
|
'margin/loan': 20.001,
|
|
17682
18036
|
'margin/repay': 20.001,
|
|
@@ -23302,12 +23656,13 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
23302
23656
|
* @name binance#transfer
|
|
23303
23657
|
* @description transfer currency internally between wallets on the same account
|
|
23304
23658
|
* @see https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer-user_data
|
|
23305
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#isolated-margin-account-transfer-margin
|
|
23306
23659
|
* @param {string} code unified currency code
|
|
23307
23660
|
* @param {float} amount amount to transfer
|
|
23308
23661
|
* @param {string} fromAccount account to transfer from
|
|
23309
23662
|
* @param {string} toAccount account to transfer to
|
|
23310
23663
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
23664
|
+
* @param {string} [params.type] exchange specific transfer type
|
|
23665
|
+
* @param {string} [params.symbol] the unified symbol, required for isolated margin transfers
|
|
23311
23666
|
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
23312
23667
|
*/
|
|
23313
23668
|
await this.loadMarkets();
|
|
@@ -23318,76 +23673,82 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
23318
23673
|
};
|
|
23319
23674
|
request['type'] = this.safeString(params, 'type');
|
|
23320
23675
|
params = this.omit(params, 'type');
|
|
23321
|
-
let response = undefined;
|
|
23322
23676
|
if (request['type'] === undefined) {
|
|
23323
23677
|
const symbol = this.safeString(params, 'symbol');
|
|
23678
|
+
let market = undefined;
|
|
23324
23679
|
if (symbol !== undefined) {
|
|
23680
|
+
market = this.market(symbol);
|
|
23325
23681
|
params = this.omit(params, 'symbol');
|
|
23326
23682
|
}
|
|
23327
23683
|
let fromId = this.convertTypeToAccount(fromAccount).toUpperCase();
|
|
23328
23684
|
let toId = this.convertTypeToAccount(toAccount).toUpperCase();
|
|
23685
|
+
let isolatedSymbol = undefined;
|
|
23686
|
+
if (market !== undefined) {
|
|
23687
|
+
isolatedSymbol = market['id'];
|
|
23688
|
+
}
|
|
23329
23689
|
if (fromId === 'ISOLATED') {
|
|
23330
23690
|
if (symbol === undefined) {
|
|
23331
23691
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' transfer () requires params["symbol"] when fromAccount is ' + fromAccount);
|
|
23332
23692
|
}
|
|
23333
|
-
else {
|
|
23334
|
-
fromId = this.marketId(symbol);
|
|
23335
|
-
}
|
|
23336
23693
|
}
|
|
23337
23694
|
if (toId === 'ISOLATED') {
|
|
23338
23695
|
if (symbol === undefined) {
|
|
23339
23696
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' transfer () requires params["symbol"] when toAccount is ' + toAccount);
|
|
23340
23697
|
}
|
|
23341
|
-
else {
|
|
23342
|
-
toId = this.marketId(symbol);
|
|
23343
|
-
}
|
|
23344
23698
|
}
|
|
23345
23699
|
const accountsById = this.safeValue(this.options, 'accountsById', {});
|
|
23346
23700
|
const fromIsolated = !(fromId in accountsById);
|
|
23347
23701
|
const toIsolated = !(toId in accountsById);
|
|
23702
|
+
if (fromIsolated && (market === undefined)) {
|
|
23703
|
+
isolatedSymbol = fromId; // allow user provide symbol as the from/to account
|
|
23704
|
+
}
|
|
23705
|
+
if (toIsolated && (market === undefined)) {
|
|
23706
|
+
isolatedSymbol = toId;
|
|
23707
|
+
}
|
|
23348
23708
|
if (fromIsolated || toIsolated) { // Isolated margin transfer
|
|
23349
23709
|
const fromFuture = fromId === 'UMFUTURE' || fromId === 'CMFUTURE';
|
|
23350
23710
|
const toFuture = toId === 'UMFUTURE' || toId === 'CMFUTURE';
|
|
23351
23711
|
const fromSpot = fromId === 'MAIN';
|
|
23352
23712
|
const toSpot = toId === 'MAIN';
|
|
23353
23713
|
const funding = fromId === 'FUNDING' || toId === 'FUNDING';
|
|
23354
|
-
const mining = fromId === 'MINING' || toId === 'MINING';
|
|
23355
23714
|
const option = fromId === 'OPTION' || toId === 'OPTION';
|
|
23356
|
-
const prohibitedWithIsolated = fromFuture || toFuture ||
|
|
23715
|
+
const prohibitedWithIsolated = fromFuture || toFuture || funding || option;
|
|
23357
23716
|
if ((fromIsolated || toIsolated) && prohibitedWithIsolated) {
|
|
23358
23717
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest(this.id + ' transfer () does not allow transfers between ' + fromAccount + ' and ' + toAccount);
|
|
23359
23718
|
}
|
|
23360
23719
|
else if (toSpot && fromIsolated) {
|
|
23361
|
-
|
|
23362
|
-
request['
|
|
23363
|
-
request['symbol'] = fromId;
|
|
23364
|
-
response = await this.sapiPostMarginIsolatedTransfer(this.extend(request, params));
|
|
23720
|
+
fromId = 'ISOLATED_MARGIN';
|
|
23721
|
+
request['fromSymbol'] = isolatedSymbol;
|
|
23365
23722
|
}
|
|
23366
23723
|
else if (fromSpot && toIsolated) {
|
|
23367
|
-
|
|
23368
|
-
request['
|
|
23369
|
-
request['symbol'] = toId;
|
|
23370
|
-
response = await this.sapiPostMarginIsolatedTransfer(this.extend(request, params));
|
|
23724
|
+
toId = 'ISOLATED_MARGIN';
|
|
23725
|
+
request['toSymbol'] = isolatedSymbol;
|
|
23371
23726
|
}
|
|
23372
23727
|
else {
|
|
23373
|
-
if (fromIsolated) {
|
|
23728
|
+
if (fromIsolated && toIsolated) {
|
|
23374
23729
|
request['fromSymbol'] = fromId;
|
|
23375
|
-
fromId = 'ISOLATEDMARGIN';
|
|
23376
|
-
}
|
|
23377
|
-
if (toIsolated) {
|
|
23378
23730
|
request['toSymbol'] = toId;
|
|
23731
|
+
fromId = 'ISOLATEDMARGIN';
|
|
23379
23732
|
toId = 'ISOLATEDMARGIN';
|
|
23380
23733
|
}
|
|
23381
|
-
|
|
23734
|
+
else {
|
|
23735
|
+
if (fromIsolated) {
|
|
23736
|
+
request['fromSymbol'] = isolatedSymbol;
|
|
23737
|
+
fromId = 'ISOLATEDMARGIN';
|
|
23738
|
+
}
|
|
23739
|
+
if (toIsolated) {
|
|
23740
|
+
request['toSymbol'] = isolatedSymbol;
|
|
23741
|
+
toId = 'ISOLATEDMARGIN';
|
|
23742
|
+
}
|
|
23743
|
+
}
|
|
23382
23744
|
}
|
|
23745
|
+
request['type'] = fromId + '_' + toId;
|
|
23383
23746
|
}
|
|
23384
23747
|
else {
|
|
23385
23748
|
request['type'] = fromId + '_' + toId;
|
|
23386
23749
|
}
|
|
23387
23750
|
}
|
|
23388
|
-
|
|
23389
|
-
response = await this.sapiPostAssetTransfer(this.extend(request, params));
|
|
23390
|
-
}
|
|
23751
|
+
const response = await this.sapiPostAssetTransfer(this.extend(request, params));
|
|
23391
23752
|
//
|
|
23392
23753
|
// {
|
|
23393
23754
|
// "tranId":13526853623
|
|
@@ -26325,7 +26686,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26325
26686
|
* @method
|
|
26326
26687
|
* @name binance#repayCrossMargin
|
|
26327
26688
|
* @description repay borrowed margin and interest
|
|
26328
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-repay-margin
|
|
26689
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin
|
|
26329
26690
|
* @param {string} code unified currency code of the currency to repay
|
|
26330
26691
|
* @param {float} amount the amount to repay
|
|
26331
26692
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -26337,8 +26698,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26337
26698
|
'asset': currency['id'],
|
|
26338
26699
|
'amount': this.currencyToPrecision(code, amount),
|
|
26339
26700
|
'isIsolated': 'FALSE',
|
|
26701
|
+
'type': 'REPAY',
|
|
26340
26702
|
};
|
|
26341
|
-
const response = await this.
|
|
26703
|
+
const response = await this.sapiPostMarginBorrowRepay(this.extend(request, params));
|
|
26342
26704
|
//
|
|
26343
26705
|
// {
|
|
26344
26706
|
// "tranId": 108988250265,
|
|
@@ -26352,7 +26714,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26352
26714
|
* @method
|
|
26353
26715
|
* @name binance#repayIsolatedMargin
|
|
26354
26716
|
* @description repay borrowed margin and interest
|
|
26355
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-repay-margin
|
|
26717
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin
|
|
26356
26718
|
* @param {string} symbol unified market symbol, required for isolated margin
|
|
26357
26719
|
* @param {string} code unified currency code of the currency to repay
|
|
26358
26720
|
* @param {float} amount the amount to repay
|
|
@@ -26367,8 +26729,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26367
26729
|
'amount': this.currencyToPrecision(code, amount),
|
|
26368
26730
|
'symbol': market['id'],
|
|
26369
26731
|
'isIsolated': 'TRUE',
|
|
26732
|
+
'type': 'REPAY',
|
|
26370
26733
|
};
|
|
26371
|
-
const response = await this.
|
|
26734
|
+
const response = await this.sapiPostMarginBorrowRepay(this.extend(request, params));
|
|
26372
26735
|
//
|
|
26373
26736
|
// {
|
|
26374
26737
|
// "tranId": 108988250265,
|
|
@@ -26382,7 +26745,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26382
26745
|
* @method
|
|
26383
26746
|
* @name binance#borrowCrossMargin
|
|
26384
26747
|
* @description create a loan to borrow margin
|
|
26385
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-margin
|
|
26748
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin
|
|
26386
26749
|
* @param {string} code unified currency code of the currency to borrow
|
|
26387
26750
|
* @param {float} amount the amount to borrow
|
|
26388
26751
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -26394,8 +26757,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26394
26757
|
'asset': currency['id'],
|
|
26395
26758
|
'amount': this.currencyToPrecision(code, amount),
|
|
26396
26759
|
'isIsolated': 'FALSE',
|
|
26760
|
+
'type': 'BORROW',
|
|
26397
26761
|
};
|
|
26398
|
-
const response = await this.
|
|
26762
|
+
const response = await this.sapiPostMarginBorrowRepay(this.extend(request, params));
|
|
26399
26763
|
//
|
|
26400
26764
|
// {
|
|
26401
26765
|
// "tranId": 108988250265,
|
|
@@ -26409,7 +26773,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26409
26773
|
* @method
|
|
26410
26774
|
* @name binance#borrowIsolatedMargin
|
|
26411
26775
|
* @description create a loan to borrow margin
|
|
26412
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-margin
|
|
26776
|
+
* @see https://binance-docs.github.io/apidocs/spot/en/#margin-account-borrow-repay-margin
|
|
26413
26777
|
* @param {string} symbol unified market symbol, required for isolated margin
|
|
26414
26778
|
* @param {string} code unified currency code of the currency to borrow
|
|
26415
26779
|
* @param {float} amount the amount to borrow
|
|
@@ -26424,8 +26788,9 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
26424
26788
|
'amount': this.currencyToPrecision(code, amount),
|
|
26425
26789
|
'symbol': market['id'],
|
|
26426
26790
|
'isIsolated': 'TRUE',
|
|
26791
|
+
'type': 'BORROW',
|
|
26427
26792
|
};
|
|
26428
|
-
const response = await this.
|
|
26793
|
+
const response = await this.sapiPostMarginBorrowRepay(this.extend(request, params));
|
|
26429
26794
|
//
|
|
26430
26795
|
// {
|
|
26431
26796
|
// "tranId": 108988250265,
|
|
@@ -27174,6 +27539,8 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27174
27539
|
'createMarketSellOrderWithCost': true,
|
|
27175
27540
|
'createOrder': true,
|
|
27176
27541
|
'createOrders': true,
|
|
27542
|
+
'createTrailingAmountOrder': true,
|
|
27543
|
+
'createTrailingPercentOrder': true,
|
|
27177
27544
|
'fetchBalance': true,
|
|
27178
27545
|
'fetchClosedOrders': true,
|
|
27179
27546
|
'fetchCurrencies': true,
|
|
@@ -27255,6 +27622,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27255
27622
|
'trade/query': 3,
|
|
27256
27623
|
'trade/openOrders': 3,
|
|
27257
27624
|
'trade/historyOrders': 3,
|
|
27625
|
+
'trade/myTrades': 3,
|
|
27258
27626
|
'user/commissionRate': 3,
|
|
27259
27627
|
'account/balance': 3,
|
|
27260
27628
|
},
|
|
@@ -27314,6 +27682,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27314
27682
|
'user/positions': 3,
|
|
27315
27683
|
'user/income': 3,
|
|
27316
27684
|
'trade/openOrders': 3,
|
|
27685
|
+
'trade/openOrder': 3,
|
|
27317
27686
|
'trade/order': 3,
|
|
27318
27687
|
'trade/marginType': 3,
|
|
27319
27688
|
'trade/leverage': 3,
|
|
@@ -27981,6 +28350,22 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
27981
28350
|
// "buyerMaker": false
|
|
27982
28351
|
// }
|
|
27983
28352
|
//
|
|
28353
|
+
// spot
|
|
28354
|
+
// fetchMyTrades
|
|
28355
|
+
// {
|
|
28356
|
+
// "symbol": "LTC-USDT",
|
|
28357
|
+
// "id": 36237072,
|
|
28358
|
+
// "orderId": 1674069326895775744,
|
|
28359
|
+
// "price": "85.891",
|
|
28360
|
+
// "qty": "0.0582",
|
|
28361
|
+
// "quoteQty": "4.9988562000000005",
|
|
28362
|
+
// "commission": -0.00005820000000000001,
|
|
28363
|
+
// "commissionAsset": "LTC",
|
|
28364
|
+
// "time": 1687964205000,
|
|
28365
|
+
// "isBuyer": true,
|
|
28366
|
+
// "isMaker": false
|
|
28367
|
+
// }
|
|
28368
|
+
//
|
|
27984
28369
|
// swap
|
|
27985
28370
|
// fetchTrades
|
|
27986
28371
|
//
|
|
@@ -28043,7 +28428,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28043
28428
|
}
|
|
28044
28429
|
const cost = this.safeString(trade, 'quoteQty');
|
|
28045
28430
|
const type = (cost === undefined) ? 'spot' : 'swap';
|
|
28046
|
-
const currencyId = this.
|
|
28431
|
+
const currencyId = this.safeStringN(trade, ['currency', 'N', 'commissionAsset']);
|
|
28047
28432
|
const currencyCode = this.safeCurrencyCode(currencyId);
|
|
28048
28433
|
const m = this.safeValue(trade, 'm');
|
|
28049
28434
|
const marketId = this.safeString(trade, 's');
|
|
@@ -28059,6 +28444,14 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
28059
28444
|
takeOrMaker = 'taker';
|
|
28060
28445
|
}
|
|
28061
28446
|
}
|
|
28447
|
+
const isBuyer = this.safeValue(trade, 'isBuyer');
|
|
28448
|
+
if (isBuyer !== undefined) {
|
|
28449
|
+
side = isBuyer ? 'buy' : 'sell';
|
|
28450
|
+
}
|
|
28451
|
+
const isMaker = this.safeValue(trade, 'isMaker');
|
|
28452
|
+
if (isMaker !== undefined) {
|
|
28453
|
+
takeOrMaker = isMaker ? 'maker' : 'taker';
|
|
28454
|
+
}
|
|
28062
28455
|
return this.safeTrade({
|
|
28063
28456
|
'id': this.safeStringN(trade, ['id', 't']),
|
|
28064
28457
|
'info': trade,
|
|
@@ -29555,6 +29948,7 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
29555
29948
|
'symbol': market['id'],
|
|
29556
29949
|
};
|
|
29557
29950
|
const clientOrderIds = this.safeValue(params, 'clientOrderIds');
|
|
29951
|
+
params = this.omit(params, 'clientOrderIds');
|
|
29558
29952
|
let idsToParse = ids;
|
|
29559
29953
|
const areClientOrderIds = (clientOrderIds !== undefined);
|
|
29560
29954
|
if (areClientOrderIds) {
|
|
@@ -29573,8 +29967,12 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
29573
29967
|
response = await this.spotV1PrivatePostTradeCancelOrders(this.extend(request, params));
|
|
29574
29968
|
}
|
|
29575
29969
|
else {
|
|
29576
|
-
|
|
29577
|
-
|
|
29970
|
+
if (areClientOrderIds) {
|
|
29971
|
+
request['clientOrderIDList'] = this.json(parsedIds);
|
|
29972
|
+
}
|
|
29973
|
+
else {
|
|
29974
|
+
request['orderIdList'] = parsedIds;
|
|
29975
|
+
}
|
|
29578
29976
|
response = await this.swapV2PrivateDeleteTradeBatchOrders(this.extend(request, params));
|
|
29579
29977
|
}
|
|
29580
29978
|
//
|
|
@@ -30388,57 +30786,101 @@ class bingx extends _abstract_bingx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
30388
30786
|
* @method
|
|
30389
30787
|
* @name bingx#fetchMyTrades
|
|
30390
30788
|
* @description fetch all trades made by the user
|
|
30789
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20History
|
|
30391
30790
|
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
|
30392
30791
|
* @param {string} [symbol] unified market symbol
|
|
30393
30792
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
30394
30793
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
30395
30794
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
30795
|
+
* @param {int} [params.until] timestamp in ms for the ending date filter, default is undefined
|
|
30396
30796
|
* @param {string} params.trandingUnit COIN (directly represent assets such as BTC and ETH) or CONT (represents the number of contract sheets)
|
|
30397
30797
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
30398
30798
|
*/
|
|
30399
30799
|
if (symbol === undefined) {
|
|
30400
30800
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
30401
30801
|
}
|
|
30402
|
-
if (since === undefined) {
|
|
30403
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a since argument');
|
|
30404
|
-
}
|
|
30405
|
-
const tradingUnit = this.safeStringUpper(params, 'tradingUnit', 'CONT');
|
|
30406
30802
|
await this.loadMarkets();
|
|
30407
30803
|
const market = this.market(symbol);
|
|
30408
|
-
|
|
30409
|
-
|
|
30410
|
-
}
|
|
30804
|
+
const now = this.milliseconds();
|
|
30805
|
+
let response = undefined;
|
|
30411
30806
|
const request = {
|
|
30412
30807
|
'symbol': market['id'],
|
|
30413
|
-
'tradingUnit': tradingUnit,
|
|
30414
|
-
'startTs': since,
|
|
30415
|
-
'endTs': this.nonce(),
|
|
30416
30808
|
};
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30420
|
-
|
|
30421
|
-
|
|
30422
|
-
|
|
30423
|
-
|
|
30424
|
-
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30809
|
+
if (since !== undefined) {
|
|
30810
|
+
const startTimeReq = market['spot'] ? 'startTime' : 'startTs';
|
|
30811
|
+
request[startTimeReq] = since;
|
|
30812
|
+
}
|
|
30813
|
+
else if (market['swap']) {
|
|
30814
|
+
request['startTs'] = now - 7776000000; // 90 days
|
|
30815
|
+
}
|
|
30816
|
+
const until = this.safeInteger(params, 'until');
|
|
30817
|
+
params = this.omit(params, 'until');
|
|
30818
|
+
if (until !== undefined) {
|
|
30819
|
+
const endTimeReq = market['spot'] ? 'endTime' : 'endTs';
|
|
30820
|
+
request[endTimeReq] = until;
|
|
30821
|
+
}
|
|
30822
|
+
else if (market['swap']) {
|
|
30823
|
+
request['endTs'] = now;
|
|
30824
|
+
}
|
|
30825
|
+
let fills = undefined;
|
|
30826
|
+
if (market['spot']) {
|
|
30827
|
+
response = await this.spotV1PrivateGetTradeMyTrades(this.extend(request, params));
|
|
30828
|
+
const data = this.safeValue(response, 'data', []);
|
|
30829
|
+
fills = this.safeValue(data, 'fills', []);
|
|
30830
|
+
//
|
|
30831
|
+
// {
|
|
30832
|
+
// "code": 0,
|
|
30833
|
+
// "msg": "",
|
|
30834
|
+
// "debugMsg": "",
|
|
30835
|
+
// "data": {
|
|
30836
|
+
// "fills": [
|
|
30837
|
+
// {
|
|
30838
|
+
// "symbol": "LTC-USDT",
|
|
30839
|
+
// "id": 36237072,
|
|
30840
|
+
// "orderId": 1674069326895775744,
|
|
30841
|
+
// "price": "85.891",
|
|
30842
|
+
// "qty": "0.0582",
|
|
30843
|
+
// "quoteQty": "4.9988562000000005",
|
|
30844
|
+
// "commission": -0.00005820000000000001,
|
|
30845
|
+
// "commissionAsset": "LTC",
|
|
30846
|
+
// "time": 1687964205000,
|
|
30847
|
+
// "isBuyer": true,
|
|
30848
|
+
// "isMaker": false
|
|
30849
|
+
// }
|
|
30850
|
+
// ]
|
|
30851
|
+
// }
|
|
30852
|
+
// }
|
|
30853
|
+
//
|
|
30854
|
+
}
|
|
30855
|
+
else {
|
|
30856
|
+
const tradingUnit = this.safeStringUpper(params, 'tradingUnit', 'CONT');
|
|
30857
|
+
params = this.omit(params, 'tradingUnit');
|
|
30858
|
+
request['tradingUnit'] = tradingUnit;
|
|
30859
|
+
response = await this.swapV2PrivateGetTradeAllFillOrders(this.extend(request, params));
|
|
30860
|
+
const data = this.safeValue(response, 'data', []);
|
|
30861
|
+
fills = this.safeValue(data, 'fill_orders', []);
|
|
30862
|
+
//
|
|
30863
|
+
// {
|
|
30864
|
+
// "code": "0",
|
|
30865
|
+
// "msg": '',
|
|
30866
|
+
// "data": { fill_orders: [
|
|
30867
|
+
// {
|
|
30868
|
+
// "volume": "0.1",
|
|
30869
|
+
// "price": "106.75",
|
|
30870
|
+
// "amount": "10.6750",
|
|
30871
|
+
// "commission": "-0.0053",
|
|
30872
|
+
// "currency": "USDT",
|
|
30873
|
+
// "orderId": "1676213270274379776",
|
|
30874
|
+
// "liquidatedPrice": "0.00",
|
|
30875
|
+
// "liquidatedMarginRatio": "0.00",
|
|
30876
|
+
// "filledTime": "2023-07-04T20:56:01.000+0800"
|
|
30877
|
+
// }
|
|
30878
|
+
// ]
|
|
30879
|
+
// }
|
|
30880
|
+
// }
|
|
30881
|
+
//
|
|
30882
|
+
}
|
|
30883
|
+
return this.parseTrades(fills, market, since, limit, params);
|
|
30442
30884
|
}
|
|
30443
30885
|
parseDepositWithdrawFee(fee, currency = undefined) {
|
|
30444
30886
|
//
|
|
@@ -34878,12 +35320,11 @@ class bitfinex extends _abstract_bitfinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
34878
35320
|
// "message": "0.0001 Bitcoin transfered from Margin to Exchange"
|
|
34879
35321
|
// }
|
|
34880
35322
|
//
|
|
34881
|
-
const timestamp = this.milliseconds();
|
|
34882
35323
|
return {
|
|
34883
35324
|
'info': transfer,
|
|
34884
35325
|
'id': undefined,
|
|
34885
|
-
'timestamp':
|
|
34886
|
-
'datetime':
|
|
35326
|
+
'timestamp': undefined,
|
|
35327
|
+
'datetime': undefined,
|
|
34887
35328
|
'currency': this.safeCurrencyCode(undefined, currency),
|
|
34888
35329
|
'amount': undefined,
|
|
34889
35330
|
'fromAccount': undefined,
|
|
@@ -40729,6 +41170,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40729
41170
|
'createOrder': true,
|
|
40730
41171
|
'createOrders': true,
|
|
40731
41172
|
'createReduceOnlyOrder': false,
|
|
41173
|
+
'createTrailingPercentOrder': true,
|
|
40732
41174
|
'editOrder': true,
|
|
40733
41175
|
'fetchAccounts': false,
|
|
40734
41176
|
'fetchBalance': true,
|
|
@@ -43642,7 +44084,12 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
43642
44084
|
'symbol': market['id'],
|
|
43643
44085
|
};
|
|
43644
44086
|
if (limit !== undefined) {
|
|
43645
|
-
|
|
44087
|
+
if (market['contract']) {
|
|
44088
|
+
request['limit'] = Math.min(limit, 1000);
|
|
44089
|
+
}
|
|
44090
|
+
else {
|
|
44091
|
+
request['limit'] = limit;
|
|
44092
|
+
}
|
|
43646
44093
|
}
|
|
43647
44094
|
const options = this.safeValue(this.options, 'fetchTrades', {});
|
|
43648
44095
|
let response = undefined;
|
|
@@ -43954,31 +44401,45 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
43954
44401
|
const marketType = market['spot'] ? 'spot' : 'swap';
|
|
43955
44402
|
const timeframes = this.options['timeframes'][marketType];
|
|
43956
44403
|
const selectedTimeframe = this.safeString(timeframes, timeframe, timeframe);
|
|
43957
|
-
|
|
44404
|
+
const request = {
|
|
43958
44405
|
'symbol': market['id'],
|
|
43959
44406
|
'granularity': selectedTimeframe,
|
|
43960
44407
|
};
|
|
43961
|
-
|
|
43962
|
-
|
|
43963
|
-
request['startTime'] = limit;
|
|
43964
|
-
}
|
|
44408
|
+
const until = this.safeInteger2(params, 'until', 'till');
|
|
44409
|
+
params = this.omit(params, ['until', 'till']);
|
|
43965
44410
|
if (limit !== undefined) {
|
|
43966
44411
|
request['limit'] = limit;
|
|
43967
44412
|
}
|
|
43968
44413
|
const options = this.safeValue(this.options, 'fetchOHLCV', {});
|
|
44414
|
+
const spotOptions = this.safeValue(options, 'spot', {});
|
|
44415
|
+
const defaultSpotMethod = this.safeString(spotOptions, 'method', 'publicSpotGetV2SpotMarketCandles');
|
|
44416
|
+
const method = this.safeString(params, 'method', defaultSpotMethod);
|
|
44417
|
+
params = this.omit(params, 'method');
|
|
44418
|
+
if (method !== 'publicSpotGetV2SpotMarketHistoryCandles') {
|
|
44419
|
+
if (since !== undefined) {
|
|
44420
|
+
request['startTime'] = since;
|
|
44421
|
+
}
|
|
44422
|
+
if (until !== undefined) {
|
|
44423
|
+
request['endTime'] = until;
|
|
44424
|
+
}
|
|
44425
|
+
}
|
|
43969
44426
|
let response = undefined;
|
|
43970
44427
|
if (market['spot']) {
|
|
43971
|
-
const spotOptions = this.safeValue(options, 'spot', {});
|
|
43972
|
-
const defaultSpotMethod = this.safeString(spotOptions, 'method', 'publicSpotGetV2SpotMarketCandles');
|
|
43973
|
-
const method = this.safeString(params, 'method', defaultSpotMethod);
|
|
43974
|
-
params = this.omit(params, 'method');
|
|
43975
44428
|
if (method === 'publicSpotGetV2SpotMarketCandles') {
|
|
43976
44429
|
response = await this.publicSpotGetV2SpotMarketCandles(this.extend(request, params));
|
|
43977
44430
|
}
|
|
43978
44431
|
else if (method === 'publicSpotGetV2SpotMarketHistoryCandles') {
|
|
43979
|
-
|
|
43980
|
-
|
|
43981
|
-
|
|
44432
|
+
if (since !== undefined) {
|
|
44433
|
+
if (limit === undefined) {
|
|
44434
|
+
limit = 100; // exchange default
|
|
44435
|
+
}
|
|
44436
|
+
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
44437
|
+
request['endTime'] = this.sum(since, duration * limit);
|
|
44438
|
+
}
|
|
44439
|
+
else if (until !== undefined) {
|
|
44440
|
+
request['endTime'] = until;
|
|
44441
|
+
}
|
|
44442
|
+
else {
|
|
43982
44443
|
request['endTime'] = this.milliseconds();
|
|
43983
44444
|
}
|
|
43984
44445
|
response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
|
|
@@ -50111,6 +50572,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50111
50572
|
'createStopLimitOrder': false,
|
|
50112
50573
|
'createStopMarketOrder': false,
|
|
50113
50574
|
'createStopOrder': false,
|
|
50575
|
+
'createTrailingPercentOrder': true,
|
|
50114
50576
|
'fetchBalance': true,
|
|
50115
50577
|
'fetchBorrowInterest': true,
|
|
50116
50578
|
'fetchBorrowRateHistories': false,
|
|
@@ -50329,8 +50791,8 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50329
50791
|
'trading': {
|
|
50330
50792
|
'tierBased': true,
|
|
50331
50793
|
'percentage': true,
|
|
50332
|
-
'taker': this.parseNumber('0.
|
|
50333
|
-
'maker': this.parseNumber('0.
|
|
50794
|
+
'taker': this.parseNumber('0.0040'),
|
|
50795
|
+
'maker': this.parseNumber('0.0035'),
|
|
50334
50796
|
'tiers': {
|
|
50335
50797
|
'taker': [
|
|
50336
50798
|
[this.parseNumber('0'), this.parseNumber('0.0020')],
|
|
@@ -53579,14 +54041,13 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
53579
54041
|
// "repay_id": "2afcc16d99bd4707818c5a355dc89bed",
|
|
53580
54042
|
// }
|
|
53581
54043
|
//
|
|
53582
|
-
const timestamp = this.milliseconds();
|
|
53583
54044
|
return {
|
|
53584
54045
|
'id': this.safeString2(info, 'borrow_id', 'repay_id'),
|
|
53585
54046
|
'currency': this.safeCurrencyCode(undefined, currency),
|
|
53586
54047
|
'amount': undefined,
|
|
53587
54048
|
'symbol': undefined,
|
|
53588
|
-
'timestamp':
|
|
53589
|
-
'datetime':
|
|
54049
|
+
'timestamp': undefined,
|
|
54050
|
+
'datetime': undefined,
|
|
53590
54051
|
'info': info,
|
|
53591
54052
|
};
|
|
53592
54053
|
}
|
|
@@ -54573,6 +55034,7 @@ class bitmex extends _abstract_bitmex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
54573
55034
|
'closePosition': true,
|
|
54574
55035
|
'createOrder': true,
|
|
54575
55036
|
'createReduceOnlyOrder': true,
|
|
55037
|
+
'createTrailingAmountOrder': true,
|
|
54576
55038
|
'editOrder': true,
|
|
54577
55039
|
'fetchBalance': true,
|
|
54578
55040
|
'fetchClosedOrders': true,
|
|
@@ -78061,6 +78523,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
78061
78523
|
'createStopLimitOrder': true,
|
|
78062
78524
|
'createStopMarketOrder': true,
|
|
78063
78525
|
'createStopOrder': true,
|
|
78526
|
+
'createTrailingAmountOrder': true,
|
|
78064
78527
|
'editOrder': true,
|
|
78065
78528
|
'fetchBalance': true,
|
|
78066
78529
|
'fetchBorrowInterest': false,
|
|
@@ -78307,6 +78770,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
78307
78770
|
'v5/account/wallet-balance': 1,
|
|
78308
78771
|
'v5/account/borrow-history': 1,
|
|
78309
78772
|
'v5/account/set-collateral-switch': 5,
|
|
78773
|
+
'v5/account/set-collateral-switch-batch': 5,
|
|
78310
78774
|
'v5/account/collateral-info': 1,
|
|
78311
78775
|
'v5/asset/coin-greeks': 1,
|
|
78312
78776
|
'v5/account/fee-rate': 10,
|
|
@@ -87478,7 +87942,7 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
87478
87942
|
'setLeverage': false,
|
|
87479
87943
|
'setMarginMode': false,
|
|
87480
87944
|
'setPositionMode': false,
|
|
87481
|
-
'withdraw':
|
|
87945
|
+
'withdraw': true,
|
|
87482
87946
|
},
|
|
87483
87947
|
'urls': {
|
|
87484
87948
|
'logo': 'https://user-images.githubusercontent.com/1294454/40811661-b6eceae2-653a-11e8-829e-10bfadb078cf.jpg',
|
|
@@ -88149,46 +88613,102 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
88149
88613
|
// "next_step": null
|
|
88150
88614
|
// }
|
|
88151
88615
|
//
|
|
88152
|
-
|
|
88153
|
-
|
|
88154
|
-
|
|
88155
|
-
|
|
88156
|
-
|
|
88157
|
-
|
|
88158
|
-
|
|
88159
|
-
|
|
88160
|
-
|
|
88161
|
-
|
|
88162
|
-
|
|
88163
|
-
|
|
88164
|
-
|
|
88165
|
-
|
|
88166
|
-
|
|
88167
|
-
|
|
88616
|
+
// withdraw
|
|
88617
|
+
//
|
|
88618
|
+
// {
|
|
88619
|
+
// "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
88620
|
+
// "type": "send",
|
|
88621
|
+
// "status": "pending",
|
|
88622
|
+
// "amount": {
|
|
88623
|
+
// "amount": "-14.008308",
|
|
88624
|
+
// "currency": "USDC"
|
|
88625
|
+
// },
|
|
88626
|
+
// "native_amount": {
|
|
88627
|
+
// "amount": "-18.74",
|
|
88628
|
+
// "currency": "CAD"
|
|
88629
|
+
// },
|
|
88630
|
+
// "description": null,
|
|
88631
|
+
// "created_at": "2024-01-12T01:27:31Z",
|
|
88632
|
+
// "updated_at": "2024-01-12T01:27:31Z",
|
|
88633
|
+
// "resource": "transaction",
|
|
88634
|
+
// "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
88635
|
+
// "instant_exchange": false,
|
|
88636
|
+
// "network": {
|
|
88637
|
+
// "status": "pending",
|
|
88638
|
+
// "status_description": "Pending (est. less than 10 minutes)",
|
|
88639
|
+
// "transaction_fee": {
|
|
88640
|
+
// "amount": "4.008308",
|
|
88641
|
+
// "currency": "USDC"
|
|
88642
|
+
// },
|
|
88643
|
+
// "transaction_amount": {
|
|
88644
|
+
// "amount": "10.000000",
|
|
88645
|
+
// "currency": "USDC"
|
|
88646
|
+
// },
|
|
88647
|
+
// "confirmations": 0
|
|
88648
|
+
// },
|
|
88649
|
+
// "to": {
|
|
88650
|
+
// "resource": "ethereum_address",
|
|
88651
|
+
// "address": "0x9...",
|
|
88652
|
+
// "currency": "USDC",
|
|
88653
|
+
// "address_info": {
|
|
88654
|
+
// "address": "0x9..."
|
|
88655
|
+
// }
|
|
88656
|
+
// },
|
|
88657
|
+
// "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
|
|
88658
|
+
// "details": {
|
|
88659
|
+
// "title": "Sent USDC",
|
|
88660
|
+
// "subtitle": "To USDC address on Ethereum network",
|
|
88661
|
+
// "header": "Sent 14.008308 USDC ($18.74)",
|
|
88662
|
+
// "health": "warning"
|
|
88663
|
+
// },
|
|
88664
|
+
// "hide_native_amount": false
|
|
88665
|
+
// }
|
|
88666
|
+
//
|
|
88667
|
+
const transactionType = this.safeString(transaction, 'type');
|
|
88668
|
+
let amountAndCurrencyObject = undefined;
|
|
88669
|
+
let feeObject = undefined;
|
|
88670
|
+
if (transactionType === 'send') {
|
|
88671
|
+
const network = this.safeValue(transaction, 'network', {});
|
|
88672
|
+
amountAndCurrencyObject = this.safeValue(network, 'transaction_amount', {});
|
|
88673
|
+
feeObject = this.safeValue(network, 'transaction_fee', {});
|
|
88674
|
+
}
|
|
88675
|
+
else {
|
|
88676
|
+
amountAndCurrencyObject = this.safeValue(transaction, 'subtotal', {});
|
|
88677
|
+
feeObject = this.safeValue(transaction, 'fee', {});
|
|
88678
|
+
}
|
|
88168
88679
|
let status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
88169
88680
|
if (status === undefined) {
|
|
88170
88681
|
const committed = this.safeValue(transaction, 'committed');
|
|
88171
88682
|
status = committed ? 'ok' : 'pending';
|
|
88172
88683
|
}
|
|
88684
|
+
const id = this.safeString(transaction, 'id');
|
|
88685
|
+
const currencyId = this.safeString(amountAndCurrencyObject, 'currency');
|
|
88686
|
+
const feeCurrencyId = this.safeString(feeObject, 'currency');
|
|
88687
|
+
const datetime = this.safeValue(transaction, 'created_at');
|
|
88688
|
+
const toObject = this.safeValue(transaction, 'to', {});
|
|
88689
|
+
const toAddress = this.safeString(toObject, 'address');
|
|
88173
88690
|
return {
|
|
88174
88691
|
'info': transaction,
|
|
88175
88692
|
'id': id,
|
|
88176
88693
|
'txid': id,
|
|
88177
|
-
'timestamp':
|
|
88178
|
-
'datetime':
|
|
88694
|
+
'timestamp': this.parse8601(datetime),
|
|
88695
|
+
'datetime': datetime,
|
|
88179
88696
|
'network': undefined,
|
|
88180
|
-
'address':
|
|
88181
|
-
'addressTo':
|
|
88697
|
+
'address': toAddress,
|
|
88698
|
+
'addressTo': toAddress,
|
|
88182
88699
|
'addressFrom': undefined,
|
|
88183
88700
|
'tag': undefined,
|
|
88184
88701
|
'tagTo': undefined,
|
|
88185
88702
|
'tagFrom': undefined,
|
|
88186
|
-
'type':
|
|
88187
|
-
'amount': amount,
|
|
88188
|
-
'currency':
|
|
88703
|
+
'type': this.safeString(transaction, 'resource'),
|
|
88704
|
+
'amount': this.safeNumber(amountAndCurrencyObject, 'amount'),
|
|
88705
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
88189
88706
|
'status': status,
|
|
88190
|
-
'updated':
|
|
88191
|
-
'fee':
|
|
88707
|
+
'updated': this.parse8601(this.safeValue(transaction, 'updated_at')),
|
|
88708
|
+
'fee': {
|
|
88709
|
+
'cost': this.safeNumber(feeObject, 'amount'),
|
|
88710
|
+
'currency': this.safeCurrencyCode(feeCurrencyId),
|
|
88711
|
+
},
|
|
88192
88712
|
};
|
|
88193
88713
|
}
|
|
88194
88714
|
parseTrade(trade, market = undefined) {
|
|
@@ -90542,6 +91062,100 @@ class coinbase extends _abstract_coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
90542
91062
|
const tickers = this.safeValue(response, 'pricebooks', []);
|
|
90543
91063
|
return this.parseTickers(tickers, symbols);
|
|
90544
91064
|
}
|
|
91065
|
+
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
91066
|
+
/**
|
|
91067
|
+
* @method
|
|
91068
|
+
* @name coinbase#withdraw
|
|
91069
|
+
* @description make a withdrawal
|
|
91070
|
+
* @see https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-transactions#send-money
|
|
91071
|
+
* @param {string} code unified currency code
|
|
91072
|
+
* @param {float} amount the amount to withdraw
|
|
91073
|
+
* @param {string} address the address to withdraw to
|
|
91074
|
+
* @param {string} [tag] an optional tag for the withdrawal
|
|
91075
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
91076
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
91077
|
+
*/
|
|
91078
|
+
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
91079
|
+
this.checkAddress(address);
|
|
91080
|
+
await this.loadMarkets();
|
|
91081
|
+
const currency = this.currency(code);
|
|
91082
|
+
let accountId = this.safeString2(params, 'account_id', 'accountId');
|
|
91083
|
+
params = this.omit(params, ['account_id', 'accountId']);
|
|
91084
|
+
if (accountId === undefined) {
|
|
91085
|
+
if (code === undefined) {
|
|
91086
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' withdraw() requires an account_id (or accountId) parameter OR a currency code argument');
|
|
91087
|
+
}
|
|
91088
|
+
accountId = await this.findAccountId(code);
|
|
91089
|
+
if (accountId === undefined) {
|
|
91090
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' withdraw() could not find account id for ' + code);
|
|
91091
|
+
}
|
|
91092
|
+
}
|
|
91093
|
+
const request = {
|
|
91094
|
+
'account_id': accountId,
|
|
91095
|
+
'type': 'send',
|
|
91096
|
+
'to': address,
|
|
91097
|
+
'amount': amount,
|
|
91098
|
+
'currency': currency['id'],
|
|
91099
|
+
};
|
|
91100
|
+
if (tag !== undefined) {
|
|
91101
|
+
request['destination_tag'] = tag;
|
|
91102
|
+
}
|
|
91103
|
+
const response = await this.v2PrivatePostAccountsAccountIdTransactions(this.extend(request, params));
|
|
91104
|
+
//
|
|
91105
|
+
// {
|
|
91106
|
+
// "data": {
|
|
91107
|
+
// "id": "a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
91108
|
+
// "type": "send",
|
|
91109
|
+
// "status": "pending",
|
|
91110
|
+
// "amount": {
|
|
91111
|
+
// "amount": "-14.008308",
|
|
91112
|
+
// "currency": "USDC"
|
|
91113
|
+
// },
|
|
91114
|
+
// "native_amount": {
|
|
91115
|
+
// "amount": "-18.74",
|
|
91116
|
+
// "currency": "CAD"
|
|
91117
|
+
// },
|
|
91118
|
+
// "description": null,
|
|
91119
|
+
// "created_at": "2024-01-12T01:27:31Z",
|
|
91120
|
+
// "updated_at": "2024-01-12T01:27:31Z",
|
|
91121
|
+
// "resource": "transaction",
|
|
91122
|
+
// "resource_path": "/v2/accounts/a34bgfad-ed67-538b-bffc-730c98c10da0/transactions/a1794ecf-5693-55fa-70cf-ef731748ed82",
|
|
91123
|
+
// "instant_exchange": false,
|
|
91124
|
+
// "network": {
|
|
91125
|
+
// "status": "pending",
|
|
91126
|
+
// "status_description": "Pending (est. less than 10 minutes)",
|
|
91127
|
+
// "transaction_fee": {
|
|
91128
|
+
// "amount": "4.008308",
|
|
91129
|
+
// "currency": "USDC"
|
|
91130
|
+
// },
|
|
91131
|
+
// "transaction_amount": {
|
|
91132
|
+
// "amount": "10.000000",
|
|
91133
|
+
// "currency": "USDC"
|
|
91134
|
+
// },
|
|
91135
|
+
// "confirmations": 0
|
|
91136
|
+
// },
|
|
91137
|
+
// "to": {
|
|
91138
|
+
// "resource": "ethereum_address",
|
|
91139
|
+
// "address": "0x9...",
|
|
91140
|
+
// "currency": "USDC",
|
|
91141
|
+
// "address_info": {
|
|
91142
|
+
// "address": "0x9..."
|
|
91143
|
+
// }
|
|
91144
|
+
// },
|
|
91145
|
+
// "idem": "748d8591-dg9a-7831-a45b-crd61dg78762",
|
|
91146
|
+
// "details": {
|
|
91147
|
+
// "title": "Sent USDC",
|
|
91148
|
+
// "subtitle": "To USDC address on Ethereum network",
|
|
91149
|
+
// "header": "Sent 14.008308 USDC ($18.74)",
|
|
91150
|
+
// "health": "warning"
|
|
91151
|
+
// },
|
|
91152
|
+
// "hide_native_amount": false
|
|
91153
|
+
// }
|
|
91154
|
+
// }
|
|
91155
|
+
//
|
|
91156
|
+
const data = this.safeValue(response, 'data', {});
|
|
91157
|
+
return this.parseTransaction(data, currency);
|
|
91158
|
+
}
|
|
90545
91159
|
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
90546
91160
|
const version = api[0];
|
|
90547
91161
|
const signed = api[1] === 'private';
|
|
@@ -99563,7 +100177,7 @@ class coinlist extends _abstract_coinlist_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
99563
100177
|
request['start_time'] = this.iso8601(since);
|
|
99564
100178
|
}
|
|
99565
100179
|
if (limit !== undefined) {
|
|
99566
|
-
request['count'] = limit;
|
|
100180
|
+
request['count'] = Math.min(limit, 500);
|
|
99567
100181
|
}
|
|
99568
100182
|
const until = this.safeInteger2(params, 'till', 'until');
|
|
99569
100183
|
if (until !== undefined) {
|
|
@@ -99922,11 +100536,10 @@ class coinlist extends _abstract_coinlist_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
99922
100536
|
// "net_liquidation_value_usd": "string"
|
|
99923
100537
|
// }
|
|
99924
100538
|
//
|
|
99925
|
-
const timestamp = this.milliseconds();
|
|
99926
100539
|
const result = {
|
|
99927
100540
|
'info': response,
|
|
99928
|
-
'timestamp':
|
|
99929
|
-
'datetime':
|
|
100541
|
+
'timestamp': undefined,
|
|
100542
|
+
'datetime': undefined,
|
|
99930
100543
|
};
|
|
99931
100544
|
const totalBalances = this.safeValue(response, 'asset_balances', {});
|
|
99932
100545
|
const usedBalances = this.safeValue(response, 'asset_holds', {});
|
|
@@ -102861,7 +103474,7 @@ class coinone extends _abstract_coinone_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
102861
103474
|
'target_currency': market['base'],
|
|
102862
103475
|
};
|
|
102863
103476
|
if (limit !== undefined) {
|
|
102864
|
-
request['size'] = limit
|
|
103477
|
+
request['size'] = Math.min(limit, 200);
|
|
102865
103478
|
}
|
|
102866
103479
|
const response = await this.v2PublicGetTradesQuoteCurrencyTargetCurrency(this.extend(request, params));
|
|
102867
103480
|
//
|
|
@@ -104408,11 +105021,10 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
104408
105021
|
}
|
|
104409
105022
|
parseBalance(response) {
|
|
104410
105023
|
const balances = this.safeValue(response, 'balances', []);
|
|
104411
|
-
const timestamp = this.milliseconds();
|
|
104412
105024
|
const result = {
|
|
104413
105025
|
'info': response,
|
|
104414
|
-
'timestamp':
|
|
104415
|
-
'datetime':
|
|
105026
|
+
'timestamp': undefined,
|
|
105027
|
+
'datetime': undefined,
|
|
104416
105028
|
};
|
|
104417
105029
|
for (let i = 0; i < balances.length; i++) {
|
|
104418
105030
|
const balance = balances[i];
|
|
@@ -114198,6 +114810,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
114198
114810
|
'createStopLimitOrder': true,
|
|
114199
114811
|
'createStopMarketOrder': true,
|
|
114200
114812
|
'createStopOrder': true,
|
|
114813
|
+
'createTrailingAmountOrder': true,
|
|
114201
114814
|
'editOrder': true,
|
|
114202
114815
|
'fetchAccounts': true,
|
|
114203
114816
|
'fetchBalance': true,
|
|
@@ -124939,6 +125552,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
124939
125552
|
'{settle}/orders': 0.4,
|
|
124940
125553
|
'{settle}/batch_orders': 0.4,
|
|
124941
125554
|
'{settle}/countdown_cancel_all': 0.4,
|
|
125555
|
+
'{settle}/batch_cancel_orders': 0.4,
|
|
124942
125556
|
'{settle}/price_orders': 0.4,
|
|
124943
125557
|
},
|
|
124944
125558
|
'put': {
|
|
@@ -125029,11 +125643,21 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
125029
125643
|
'collateral/total_amount': 20 / 15,
|
|
125030
125644
|
'collateral/ltv': 20 / 15,
|
|
125031
125645
|
'collateral/currencies': 20 / 15,
|
|
125646
|
+
'multi_collateral/orders': 20 / 15,
|
|
125647
|
+
'multi_collateral/orders/{order_id}': 20 / 15,
|
|
125648
|
+
'multi_collateral/repay': 20 / 15,
|
|
125649
|
+
'multi_collateral/mortgage': 20 / 15,
|
|
125650
|
+
'multi_collateral/currency_quota': 20 / 15,
|
|
125651
|
+
'multi_collateral/currencies': 20 / 15,
|
|
125652
|
+
'multi_collateral/ltv': 20 / 15,
|
|
125032
125653
|
},
|
|
125033
125654
|
'post': {
|
|
125034
125655
|
'collateral/orders': 20 / 15,
|
|
125035
125656
|
'collateral/repay': 20 / 15,
|
|
125036
125657
|
'collateral/collaterals': 20 / 15,
|
|
125658
|
+
'multi_collateral/orders': 20 / 15,
|
|
125659
|
+
'multi_collateral/repay': 20 / 15,
|
|
125660
|
+
'multi_collateral/mortgage': 20 / 15,
|
|
125037
125661
|
},
|
|
125038
125662
|
},
|
|
125039
125663
|
'account': {
|
|
@@ -127621,7 +128245,7 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
127621
128245
|
request['to'] = this.parseToInt(until / 1000);
|
|
127622
128246
|
}
|
|
127623
128247
|
if (limit !== undefined) {
|
|
127624
|
-
request['limit'] = limit; // default 100, max 1000
|
|
128248
|
+
request['limit'] = Math.min(limit, 1000); // default 100, max 1000
|
|
127625
128249
|
}
|
|
127626
128250
|
if (since !== undefined && (market['contract'])) {
|
|
127627
128251
|
request['from'] = this.parseToInt(since / 1000);
|
|
@@ -129659,11 +130283,19 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129659
130283
|
return this.parseTransfer(response, currency);
|
|
129660
130284
|
}
|
|
129661
130285
|
parseTransfer(transfer, currency = undefined) {
|
|
129662
|
-
|
|
130286
|
+
//
|
|
130287
|
+
// {
|
|
130288
|
+
// "currency": "BTC",
|
|
130289
|
+
// "from": "spot",
|
|
130290
|
+
// "to": "margin",
|
|
130291
|
+
// "amount": "1",
|
|
130292
|
+
// "currency_pair": "BTC_USDT"
|
|
130293
|
+
// }
|
|
130294
|
+
//
|
|
129663
130295
|
return {
|
|
129664
130296
|
'id': this.safeString(transfer, 'tx_id'),
|
|
129665
|
-
'timestamp':
|
|
129666
|
-
'datetime':
|
|
130297
|
+
'timestamp': undefined,
|
|
130298
|
+
'datetime': undefined,
|
|
129667
130299
|
'currency': this.safeCurrencyCode(undefined, currency),
|
|
129668
130300
|
'amount': undefined,
|
|
129669
130301
|
'fromAccount': undefined,
|
|
@@ -129753,29 +130385,35 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129753
130385
|
// swap and future
|
|
129754
130386
|
//
|
|
129755
130387
|
// {
|
|
129756
|
-
// "value": "
|
|
130388
|
+
// "value": "4.60516",
|
|
129757
130389
|
// "leverage": "0",
|
|
129758
130390
|
// "mode": "single",
|
|
129759
130391
|
// "realised_point": "0",
|
|
129760
130392
|
// "contract": "BTC_USDT",
|
|
129761
|
-
// "entry_price": "
|
|
129762
|
-
// "mark_price": "
|
|
130393
|
+
// "entry_price": "46030.3",
|
|
130394
|
+
// "mark_price": "46051.6",
|
|
129763
130395
|
// "history_point": "0",
|
|
129764
|
-
// "realised_pnl": "-0.
|
|
129765
|
-
// "close_order":
|
|
129766
|
-
// "size":
|
|
129767
|
-
// "cross_leverage_limit": "
|
|
129768
|
-
// "pending_orders":
|
|
129769
|
-
// "adl_ranking":
|
|
129770
|
-
// "maintenance_rate": "0.
|
|
129771
|
-
// "unrealised_pnl": "
|
|
129772
|
-
// "user":
|
|
129773
|
-
// "leverage_max": "
|
|
129774
|
-
// "history_pnl": "
|
|
130396
|
+
// "realised_pnl": "-0.002301515",
|
|
130397
|
+
// "close_order": null,
|
|
130398
|
+
// "size": 1,
|
|
130399
|
+
// "cross_leverage_limit": "0",
|
|
130400
|
+
// "pending_orders": 0,
|
|
130401
|
+
// "adl_ranking": 5,
|
|
130402
|
+
// "maintenance_rate": "0.004",
|
|
130403
|
+
// "unrealised_pnl": "0.00213",
|
|
130404
|
+
// "user": 5691076,
|
|
130405
|
+
// "leverage_max": "125",
|
|
130406
|
+
// "history_pnl": "0",
|
|
129775
130407
|
// "risk_limit": "1000000",
|
|
129776
|
-
// "margin": "
|
|
129777
|
-
// "last_close_pnl": "
|
|
129778
|
-
// "liq_price": "
|
|
130408
|
+
// "margin": "8.997698485",
|
|
130409
|
+
// "last_close_pnl": "0",
|
|
130410
|
+
// "liq_price": "0",
|
|
130411
|
+
// "update_time": 1705034246,
|
|
130412
|
+
// "update_id": 1,
|
|
130413
|
+
// "initial_margin": "0",
|
|
130414
|
+
// "maintenance_margin": "0",
|
|
130415
|
+
// "open_time": 1705034246,
|
|
130416
|
+
// "trade_max_size": "0"
|
|
129779
130417
|
// }
|
|
129780
130418
|
//
|
|
129781
130419
|
// option
|
|
@@ -129826,14 +130464,14 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129826
130464
|
const takerFee = '0.00075';
|
|
129827
130465
|
const feePaid = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(takerFee, notional);
|
|
129828
130466
|
const initialMarginString = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(notional, leverage), feePaid);
|
|
129829
|
-
const timestamp = this.
|
|
130467
|
+
const timestamp = this.safeTimestamp(position, 'open_time');
|
|
129830
130468
|
return this.safePosition({
|
|
129831
130469
|
'info': position,
|
|
129832
130470
|
'id': undefined,
|
|
129833
130471
|
'symbol': this.safeString(market, 'symbol'),
|
|
129834
|
-
'timestamp':
|
|
129835
|
-
'datetime':
|
|
129836
|
-
'lastUpdateTimestamp':
|
|
130472
|
+
'timestamp': timestamp,
|
|
130473
|
+
'datetime': this.iso8601(timestamp),
|
|
130474
|
+
'lastUpdateTimestamp': this.safeTimestamp(position, 'update_time'),
|
|
129837
130475
|
'initialMargin': this.parseNumber(initialMarginString),
|
|
129838
130476
|
'initialMarginPercentage': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringDiv(initialMarginString, notional)),
|
|
129839
130477
|
'maintenanceMargin': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMul(maintenanceRate, notional)),
|
|
@@ -129892,29 +130530,35 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129892
130530
|
// swap and future
|
|
129893
130531
|
//
|
|
129894
130532
|
// {
|
|
129895
|
-
// "value": "
|
|
130533
|
+
// "value": "4.60516",
|
|
129896
130534
|
// "leverage": "0",
|
|
129897
130535
|
// "mode": "single",
|
|
129898
130536
|
// "realised_point": "0",
|
|
129899
130537
|
// "contract": "BTC_USDT",
|
|
129900
|
-
// "entry_price": "
|
|
129901
|
-
// "mark_price": "
|
|
130538
|
+
// "entry_price": "46030.3",
|
|
130539
|
+
// "mark_price": "46051.6",
|
|
129902
130540
|
// "history_point": "0",
|
|
129903
|
-
// "realised_pnl": "-0.
|
|
129904
|
-
// "close_order":
|
|
129905
|
-
// "size":
|
|
129906
|
-
// "cross_leverage_limit": "
|
|
129907
|
-
// "pending_orders":
|
|
129908
|
-
// "adl_ranking":
|
|
129909
|
-
// "maintenance_rate": "0.
|
|
129910
|
-
// "unrealised_pnl": "
|
|
129911
|
-
// "user":
|
|
129912
|
-
// "leverage_max": "
|
|
129913
|
-
// "history_pnl": "
|
|
130541
|
+
// "realised_pnl": "-0.002301515",
|
|
130542
|
+
// "close_order": null,
|
|
130543
|
+
// "size": 1,
|
|
130544
|
+
// "cross_leverage_limit": "0",
|
|
130545
|
+
// "pending_orders": 0,
|
|
130546
|
+
// "adl_ranking": 5,
|
|
130547
|
+
// "maintenance_rate": "0.004",
|
|
130548
|
+
// "unrealised_pnl": "0.00213",
|
|
130549
|
+
// "user": 5691076,
|
|
130550
|
+
// "leverage_max": "125",
|
|
130551
|
+
// "history_pnl": "0",
|
|
129914
130552
|
// "risk_limit": "1000000",
|
|
129915
|
-
// "margin": "
|
|
129916
|
-
// "last_close_pnl": "
|
|
129917
|
-
// "liq_price": "
|
|
130553
|
+
// "margin": "8.997698485",
|
|
130554
|
+
// "last_close_pnl": "0",
|
|
130555
|
+
// "liq_price": "0",
|
|
130556
|
+
// "update_time": 1705034246,
|
|
130557
|
+
// "update_id": 1,
|
|
130558
|
+
// "initial_margin": "0",
|
|
130559
|
+
// "maintenance_margin": "0",
|
|
130560
|
+
// "open_time": 1705034246,
|
|
130561
|
+
// "trade_max_size": "0"
|
|
129918
130562
|
// }
|
|
129919
130563
|
//
|
|
129920
130564
|
// option
|
|
@@ -129994,29 +130638,35 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
129994
130638
|
//
|
|
129995
130639
|
// [
|
|
129996
130640
|
// {
|
|
129997
|
-
// "value": "
|
|
130641
|
+
// "value": "4.602828",
|
|
129998
130642
|
// "leverage": "0",
|
|
129999
130643
|
// "mode": "single",
|
|
130000
130644
|
// "realised_point": "0",
|
|
130001
130645
|
// "contract": "BTC_USDT",
|
|
130002
|
-
// "entry_price": "
|
|
130003
|
-
// "mark_price": "
|
|
130646
|
+
// "entry_price": "46030.3",
|
|
130647
|
+
// "mark_price": "46028.28",
|
|
130004
130648
|
// "history_point": "0",
|
|
130005
|
-
// "realised_pnl": "-0.
|
|
130006
|
-
// "close_order":
|
|
130007
|
-
// "size":
|
|
130008
|
-
// "cross_leverage_limit": "
|
|
130009
|
-
// "pending_orders":
|
|
130010
|
-
// "adl_ranking":
|
|
130011
|
-
// "maintenance_rate": "0.
|
|
130012
|
-
// "unrealised_pnl": "-0.
|
|
130013
|
-
// "user":
|
|
130014
|
-
// "leverage_max": "
|
|
130015
|
-
// "history_pnl": "
|
|
130649
|
+
// "realised_pnl": "-0.002301515",
|
|
130650
|
+
// "close_order": null,
|
|
130651
|
+
// "size": 1,
|
|
130652
|
+
// "cross_leverage_limit": "0",
|
|
130653
|
+
// "pending_orders": 0,
|
|
130654
|
+
// "adl_ranking": 5,
|
|
130655
|
+
// "maintenance_rate": "0.004",
|
|
130656
|
+
// "unrealised_pnl": "-0.000202",
|
|
130657
|
+
// "user": 5691076,
|
|
130658
|
+
// "leverage_max": "125",
|
|
130659
|
+
// "history_pnl": "0",
|
|
130016
130660
|
// "risk_limit": "1000000",
|
|
130017
|
-
// "margin": "
|
|
130018
|
-
// "last_close_pnl": "
|
|
130019
|
-
// "liq_price": "
|
|
130661
|
+
// "margin": "8.997698485",
|
|
130662
|
+
// "last_close_pnl": "0",
|
|
130663
|
+
// "liq_price": "0",
|
|
130664
|
+
// "update_time": 1705034246,
|
|
130665
|
+
// "update_id": 1,
|
|
130666
|
+
// "initial_margin": "0",
|
|
130667
|
+
// "maintenance_margin": "0",
|
|
130668
|
+
// "open_time": 1705034246,
|
|
130669
|
+
// "trade_max_size": "0"
|
|
130020
130670
|
// }
|
|
130021
130671
|
// ]
|
|
130022
130672
|
//
|
|
@@ -132530,7 +133180,7 @@ class gemini extends _abstract_gemini_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
132530
133180
|
'symbol': market['id'],
|
|
132531
133181
|
};
|
|
132532
133182
|
if (limit !== undefined) {
|
|
132533
|
-
request['limit_trades'] = limit;
|
|
133183
|
+
request['limit_trades'] = Math.min(limit, 500);
|
|
132534
133184
|
}
|
|
132535
133185
|
if (since !== undefined) {
|
|
132536
133186
|
request['timestamp'] = since;
|
|
@@ -136020,11 +136670,10 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
136020
136670
|
// "2db6ebab-fb26-4537-9ef8-1a689472d236"
|
|
136021
136671
|
// ]
|
|
136022
136672
|
//
|
|
136023
|
-
const timestamp = this.milliseconds();
|
|
136024
136673
|
return {
|
|
136025
136674
|
'id': this.safeString(transfer, 0),
|
|
136026
|
-
'timestamp':
|
|
136027
|
-
'datetime':
|
|
136675
|
+
'timestamp': undefined,
|
|
136676
|
+
'datetime': undefined,
|
|
136028
136677
|
'currency': this.safeCurrencyCode(undefined, currency),
|
|
136029
136678
|
'amount': undefined,
|
|
136030
136679
|
'fromAccount': undefined,
|
|
@@ -139025,6 +139674,7 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
139025
139674
|
'createStopLimitOrder': true,
|
|
139026
139675
|
'createStopMarketOrder': true,
|
|
139027
139676
|
'createStopOrder': true,
|
|
139677
|
+
'createTrailingPercentOrder': true,
|
|
139028
139678
|
'fetchAccounts': true,
|
|
139029
139679
|
'fetchBalance': true,
|
|
139030
139680
|
'fetchBidsAsks': undefined,
|
|
@@ -143946,6 +144596,31 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
143946
144596
|
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
143947
144597
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
143948
144598
|
}
|
|
144599
|
+
async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
144600
|
+
/**
|
|
144601
|
+
* @method
|
|
144602
|
+
* @name createTrailingPercentOrder
|
|
144603
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
144604
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
144605
|
+
* @param {string} type 'market' or 'limit'
|
|
144606
|
+
* @param {string} side 'buy' or 'sell'
|
|
144607
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
144608
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
144609
|
+
* @param {float} trailingPercent the percent to trail away from the current market price
|
|
144610
|
+
* @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
|
|
144611
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
144612
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
144613
|
+
*/
|
|
144614
|
+
if (trailingPercent === undefined) {
|
|
144615
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
|
|
144616
|
+
}
|
|
144617
|
+
if (trailingTriggerPrice === undefined) {
|
|
144618
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingTriggerPrice argument');
|
|
144619
|
+
}
|
|
144620
|
+
params['trailingPercent'] = trailingPercent;
|
|
144621
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
144622
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
144623
|
+
}
|
|
143949
144624
|
async createSpotOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
143950
144625
|
/**
|
|
143951
144626
|
* @method
|
|
@@ -144158,15 +144833,11 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
144158
144833
|
}
|
|
144159
144834
|
}
|
|
144160
144835
|
if (!isStopLossTriggerOrder && !isTakeProfitTriggerOrder) {
|
|
144161
|
-
const leverRate = this.safeIntegerN(params, ['leverRate', 'lever_rate', 'leverage'], 1);
|
|
144162
144836
|
const reduceOnly = this.safeValue2(params, 'reduceOnly', 'reduce_only', false);
|
|
144163
|
-
const openOrClose = (reduceOnly) ? 'close' : 'open';
|
|
144164
|
-
const offset = this.safeString(params, 'offset', openOrClose);
|
|
144165
|
-
request['offset'] = offset;
|
|
144166
144837
|
if (reduceOnly) {
|
|
144167
144838
|
request['reduce_only'] = 1;
|
|
144168
144839
|
}
|
|
144169
|
-
request['lever_rate'] = leverRate;
|
|
144840
|
+
request['lever_rate'] = this.safeIntegerN(params, ['leverRate', 'lever_rate', 'leverage'], 1);
|
|
144170
144841
|
if (!isTrailingPercentOrder) {
|
|
144171
144842
|
request['order_price_type'] = type;
|
|
144172
144843
|
}
|
|
@@ -144230,10 +144901,10 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
144230
144901
|
response = await this.spotPrivatePostV1OrderOrdersPlace(spotRequest);
|
|
144231
144902
|
}
|
|
144232
144903
|
else {
|
|
144233
|
-
|
|
144904
|
+
let contractRequest = this.createContractOrderRequest(symbol, type, side, amount, price, params);
|
|
144234
144905
|
if (market['linear']) {
|
|
144235
144906
|
let marginMode = undefined;
|
|
144236
|
-
[marginMode,
|
|
144907
|
+
[marginMode, contractRequest] = this.handleMarginModeAndParams('createOrder', contractRequest);
|
|
144237
144908
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
144238
144909
|
if (marginMode === 'isolated') {
|
|
144239
144910
|
if (isStop) {
|
|
@@ -149485,13 +150156,12 @@ class huobijp extends _abstract_huobijp_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
149485
150156
|
}
|
|
149486
150157
|
const method = this.options['createOrderMethod'];
|
|
149487
150158
|
const response = await this[method](this.extend(request, params));
|
|
149488
|
-
const timestamp = this.milliseconds();
|
|
149489
150159
|
const id = this.safeString(response, 'data');
|
|
149490
150160
|
return this.safeOrder({
|
|
149491
150161
|
'info': response,
|
|
149492
150162
|
'id': id,
|
|
149493
|
-
'timestamp':
|
|
149494
|
-
'datetime':
|
|
150163
|
+
'timestamp': undefined,
|
|
150164
|
+
'datetime': undefined,
|
|
149495
150165
|
'lastTradeTimestamp': undefined,
|
|
149496
150166
|
'status': undefined,
|
|
149497
150167
|
'symbol': symbol,
|
|
@@ -152431,20 +153101,22 @@ class independentreserve extends _abstract_independentreserve_js__WEBPACK_IMPORT
|
|
|
152431
153101
|
*/
|
|
152432
153102
|
await this.loadMarkets();
|
|
152433
153103
|
const market = this.market(symbol);
|
|
152434
|
-
|
|
152435
|
-
const method = 'privatePostPlace' + capitalizedOrderType + 'Order';
|
|
152436
|
-
let orderType = capitalizedOrderType;
|
|
153104
|
+
let orderType = this.capitalize(type);
|
|
152437
153105
|
orderType += (side === 'sell') ? 'Offer' : 'Bid';
|
|
152438
153106
|
const request = this.ordered({
|
|
152439
153107
|
'primaryCurrencyCode': market['baseId'],
|
|
152440
153108
|
'secondaryCurrencyCode': market['quoteId'],
|
|
152441
153109
|
'orderType': orderType,
|
|
152442
153110
|
});
|
|
153111
|
+
let response = undefined;
|
|
153112
|
+
request['volume'] = amount;
|
|
152443
153113
|
if (type === 'limit') {
|
|
152444
153114
|
request['price'] = price;
|
|
153115
|
+
response = await this.privatePostPlaceLimitOrder(this.extend(request, params));
|
|
153116
|
+
}
|
|
153117
|
+
else {
|
|
153118
|
+
response = await this.privatePostPlaceMarketOrder(this.extend(request, params));
|
|
152445
153119
|
}
|
|
152446
|
-
request['volume'] = amount;
|
|
152447
|
-
const response = await this[method](this.extend(request, params));
|
|
152448
153120
|
return this.safeOrder({
|
|
152449
153121
|
'info': response,
|
|
152450
153122
|
'id': response['OrderGuid'],
|
|
@@ -153635,6 +154307,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
153635
154307
|
'createStopLimitOrder': true,
|
|
153636
154308
|
'createStopMarketOrder': true,
|
|
153637
154309
|
'createStopOrder': true,
|
|
154310
|
+
'createTrailingAmountOrder': true,
|
|
153638
154311
|
'editOrder': true,
|
|
153639
154312
|
'fetchBalance': true,
|
|
153640
154313
|
'fetchBorrowInterest': false,
|
|
@@ -154859,12 +155532,8 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
154859
155532
|
request['since'] = since * 1e6;
|
|
154860
155533
|
request['since'] = since.toString() + '000000'; // expected to be in nanoseconds
|
|
154861
155534
|
}
|
|
154862
|
-
|
|
154863
|
-
|
|
154864
|
-
const fetchTradesWarning = this.safeValue(this.options, 'fetchTradesWarning', true);
|
|
154865
|
-
if (fetchTradesWarning) {
|
|
154866
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError(this.id + ' fetchTrades() cannot serve ' + limit.toString() + " trades without breaking the pagination, see https://github.com/ccxt/ccxt/issues/5698 for more details. Set exchange.options['fetchTradesWarning'] to acknowledge this warning and silence it.");
|
|
154867
|
-
}
|
|
155535
|
+
if (limit !== undefined) {
|
|
155536
|
+
request['count'] = limit;
|
|
154868
155537
|
}
|
|
154869
155538
|
const response = await this.publicGetTrades(this.extend(request, params));
|
|
154870
155539
|
//
|
|
@@ -170496,13 +171165,17 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
170496
171165
|
else {
|
|
170497
171166
|
request['size'] = 600; // max
|
|
170498
171167
|
}
|
|
170499
|
-
|
|
171168
|
+
const options = this.safeValue(this.options, 'fetchTrades', {});
|
|
171169
|
+
const defaultMethod = this.safeString(options, 'method', 'spotPublicGetTrades');
|
|
171170
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
170500
171171
|
params = this.omit(params, 'method');
|
|
170501
|
-
|
|
170502
|
-
|
|
170503
|
-
|
|
171172
|
+
let response = undefined;
|
|
171173
|
+
if (method === 'spotPublicGetSupplementTrades') {
|
|
171174
|
+
response = await this.spotPublicGetSupplementTrades(this.extend(request, params));
|
|
171175
|
+
}
|
|
171176
|
+
else {
|
|
171177
|
+
response = await this.spotPublicGetTrades(this.extend(request, params));
|
|
170504
171178
|
}
|
|
170505
|
-
const response = await this[method](this.extend(request, params));
|
|
170506
171179
|
//
|
|
170507
171180
|
// {
|
|
170508
171181
|
// "result":"true",
|
|
@@ -170739,12 +171412,19 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
170739
171412
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
170740
171413
|
*/
|
|
170741
171414
|
await this.loadMarkets();
|
|
170742
|
-
|
|
170743
|
-
|
|
170744
|
-
|
|
170745
|
-
|
|
171415
|
+
const options = this.safeValue(this.options, 'fetchBalance', {});
|
|
171416
|
+
const defaultMethod = this.safeString(options, 'method', 'spotPrivatePostSupplementUserInfo');
|
|
171417
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
171418
|
+
let response = undefined;
|
|
171419
|
+
if (method === 'spotPrivatePostSupplementUserInfoAccount') {
|
|
171420
|
+
response = await this.spotPrivatePostSupplementUserInfoAccount();
|
|
171421
|
+
}
|
|
171422
|
+
else if (method === 'spotPrivatePostUserInfo') {
|
|
171423
|
+
response = await this.spotPrivatePostUserInfo();
|
|
171424
|
+
}
|
|
171425
|
+
else {
|
|
171426
|
+
response = await this.spotPrivatePostSupplementUserInfo();
|
|
170746
171427
|
}
|
|
170747
|
-
const response = await this[method]();
|
|
170748
171428
|
//
|
|
170749
171429
|
// {
|
|
170750
171430
|
// "result": "true",
|
|
@@ -170929,14 +171609,17 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
170929
171609
|
if (clientOrderId !== undefined) {
|
|
170930
171610
|
request['custom_id'] = clientOrderId;
|
|
170931
171611
|
}
|
|
170932
|
-
|
|
170933
|
-
|
|
171612
|
+
const options = this.safeValue(this.options, 'createOrder', {});
|
|
171613
|
+
const defaultMethod = this.safeString(options, 'method', 'spotPrivatePostSupplementCreateOrder');
|
|
171614
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
170934
171615
|
params = this.omit(params, 'method');
|
|
170935
|
-
|
|
170936
|
-
|
|
170937
|
-
|
|
171616
|
+
let response = undefined;
|
|
171617
|
+
if (method === 'spotPrivatePostCreateOrder') {
|
|
171618
|
+
response = await this.spotPrivatePostCreateOrder(this.extend(request, params));
|
|
171619
|
+
}
|
|
171620
|
+
else {
|
|
171621
|
+
response = await this.spotPrivatePostSupplementCreateOrder(this.extend(request, params));
|
|
170938
171622
|
}
|
|
170939
|
-
const response = await this[method](this.extend(request, params));
|
|
170940
171623
|
//
|
|
170941
171624
|
// {
|
|
170942
171625
|
// "result":true,
|
|
@@ -171471,13 +172154,18 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
171471
172154
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
171472
172155
|
*/
|
|
171473
172156
|
await this.loadMarkets();
|
|
171474
|
-
|
|
172157
|
+
const options = this.safeValue(this.options, 'fetchDepositAddress', {});
|
|
172158
|
+
const defaultMethod = this.safeString(options, 'method', 'fetchDepositAddressDefault');
|
|
172159
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
171475
172160
|
params = this.omit(params, 'method');
|
|
171476
|
-
|
|
171477
|
-
|
|
171478
|
-
|
|
172161
|
+
let response = undefined;
|
|
172162
|
+
if (method === 'fetchDepositAddressSupplement') {
|
|
172163
|
+
response = await this.fetchDepositAddressSupplement(code, params);
|
|
171479
172164
|
}
|
|
171480
|
-
|
|
172165
|
+
else {
|
|
172166
|
+
response = await this.fetchDepositAddressDefault(code, params);
|
|
172167
|
+
}
|
|
172168
|
+
return response;
|
|
171481
172169
|
}
|
|
171482
172170
|
async fetchDepositAddressDefault(code, params = {}) {
|
|
171483
172171
|
await this.loadMarkets();
|
|
@@ -171849,13 +172537,16 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
171849
172537
|
const isAuthorized = this.checkRequiredCredentials(false);
|
|
171850
172538
|
let result = undefined;
|
|
171851
172539
|
if (isAuthorized === true) {
|
|
171852
|
-
|
|
172540
|
+
const options = this.safeValue(this.options, 'fetchTransactionFees', {});
|
|
172541
|
+
const defaultMethod = this.safeString(options, 'method', 'fetchPrivateTransactionFees');
|
|
172542
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
171853
172543
|
params = this.omit(params, 'method');
|
|
171854
|
-
if (method ===
|
|
171855
|
-
|
|
171856
|
-
|
|
172544
|
+
if (method === 'fetchPublicTransactionFees') {
|
|
172545
|
+
result = await this.fetchPublicTransactionFees(params);
|
|
172546
|
+
}
|
|
172547
|
+
else {
|
|
172548
|
+
result = await this.fetchPrivateTransactionFees(params);
|
|
171857
172549
|
}
|
|
171858
|
-
result = await this[method](params);
|
|
171859
172550
|
}
|
|
171860
172551
|
else {
|
|
171861
172552
|
result = await this.fetchPublicTransactionFees(params);
|
|
@@ -171993,19 +172684,23 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
171993
172684
|
*/
|
|
171994
172685
|
await this.loadMarkets();
|
|
171995
172686
|
const isAuthorized = this.checkRequiredCredentials(false);
|
|
171996
|
-
|
|
172687
|
+
const response = undefined;
|
|
171997
172688
|
if (isAuthorized === true) {
|
|
171998
|
-
|
|
172689
|
+
const options = this.safeValue(this.options, 'fetchDepositWithdrawFees', {});
|
|
172690
|
+
const defaultMethod = this.safeString(options, 'method', 'fetchPrivateDepositWithdrawFees');
|
|
172691
|
+
const method = this.safeString(params, 'method', defaultMethod);
|
|
171999
172692
|
params = this.omit(params, 'method');
|
|
172000
|
-
if (method ===
|
|
172001
|
-
|
|
172002
|
-
|
|
172693
|
+
if (method === 'fetchPublicDepositWithdrawFees') {
|
|
172694
|
+
await this.fetchPublicDepositWithdrawFees(codes, params);
|
|
172695
|
+
}
|
|
172696
|
+
else {
|
|
172697
|
+
await this.fetchPrivateDepositWithdrawFees(codes, params);
|
|
172003
172698
|
}
|
|
172004
172699
|
}
|
|
172005
172700
|
else {
|
|
172006
|
-
|
|
172701
|
+
await this.fetchPublicDepositWithdrawFees(codes, params);
|
|
172007
172702
|
}
|
|
172008
|
-
return
|
|
172703
|
+
return response;
|
|
172009
172704
|
}
|
|
172010
172705
|
async fetchPrivateDepositWithdrawFees(codes = undefined, params = {}) {
|
|
172011
172706
|
// complete response
|
|
@@ -176998,7 +177693,8 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
176998
177693
|
// ]
|
|
176999
177694
|
// }
|
|
177000
177695
|
//
|
|
177001
|
-
|
|
177696
|
+
const spotTimestamp = this.safeInteger(response, 'timestamp');
|
|
177697
|
+
orderbook = this.parseOrderBook(response, symbol, spotTimestamp);
|
|
177002
177698
|
orderbook['nonce'] = this.safeInteger(response, 'lastUpdateId');
|
|
177003
177699
|
}
|
|
177004
177700
|
else if (market['swap']) {
|
|
@@ -185590,7 +186286,7 @@ class oceanex extends _abstract_oceanex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
185590
186286
|
'market': market['id'],
|
|
185591
186287
|
};
|
|
185592
186288
|
if (limit !== undefined) {
|
|
185593
|
-
request['limit'] = limit;
|
|
186289
|
+
request['limit'] = Math.min(limit, 1000);
|
|
185594
186290
|
}
|
|
185595
186291
|
const response = await this.publicGetTrades(this.extend(request, params));
|
|
185596
186292
|
//
|
|
@@ -189262,6 +189958,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189262
189958
|
'createStopLimitOrder': true,
|
|
189263
189959
|
'createStopMarketOrder': true,
|
|
189264
189960
|
'createStopOrder': true,
|
|
189961
|
+
'createTrailingPercentOrder': true,
|
|
189265
189962
|
'editOrder': true,
|
|
189266
189963
|
'fetchAccounts': true,
|
|
189267
189964
|
'fetchBalance': true,
|
|
@@ -189374,8 +190071,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189374
190071
|
'referral': {
|
|
189375
190072
|
// old reflink 0% discount https://www.okx.com/join/1888677
|
|
189376
190073
|
// new reflink 20% discount https://www.okx.com/join/CCXT2023
|
|
189377
|
-
|
|
189378
|
-
'url': 'https://www.okx.com/activities/ccxt-trade-and-earn?channelid=CCXT2023',
|
|
190074
|
+
'url': 'https://www.okx.com/join/CCXT2023',
|
|
189379
190075
|
'discount': 0.2,
|
|
189380
190076
|
},
|
|
189381
190077
|
'test': {
|
|
@@ -189476,6 +190172,7 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
189476
190172
|
'sprd/order': 1 / 3,
|
|
189477
190173
|
'sprd/orders-pending': 1 / 3,
|
|
189478
190174
|
'sprd/orders-history': 1 / 2,
|
|
190175
|
+
'sprd/orders-history-archive': 1 / 2,
|
|
189479
190176
|
'sprd/trades': 1 / 3,
|
|
189480
190177
|
// trade
|
|
189481
190178
|
'trade/order': 1 / 3,
|
|
@@ -190432,10 +191129,20 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
190432
191129
|
for (let i = 0; i < data.length; i++) {
|
|
190433
191130
|
const event = data[i];
|
|
190434
191131
|
const state = this.safeString(event, 'state');
|
|
191132
|
+
update['eta'] = this.safeInteger(event, 'end');
|
|
191133
|
+
update['url'] = this.safeString(event, 'href');
|
|
190435
191134
|
if (state === 'ongoing') {
|
|
190436
|
-
update['eta'] = this.safeInteger(event, 'end');
|
|
190437
191135
|
update['status'] = 'maintenance';
|
|
190438
191136
|
}
|
|
191137
|
+
else if (state === 'scheduled') {
|
|
191138
|
+
update['status'] = 'ok';
|
|
191139
|
+
}
|
|
191140
|
+
else if (state === 'completed') {
|
|
191141
|
+
update['status'] = 'ok';
|
|
191142
|
+
}
|
|
191143
|
+
else if (state === 'canceled') {
|
|
191144
|
+
update['status'] = 'ok';
|
|
191145
|
+
}
|
|
190439
191146
|
}
|
|
190440
191147
|
return update;
|
|
190441
191148
|
}
|
|
@@ -198857,7 +199564,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
198857
199564
|
},
|
|
198858
199565
|
},
|
|
198859
199566
|
'options': {
|
|
198860
|
-
'brokerId': '
|
|
199567
|
+
'brokerId': 'CCXT123456',
|
|
198861
199568
|
'x-phemex-request-expiry': 60,
|
|
198862
199569
|
'createOrderByQuoteRequiresPrice': true,
|
|
198863
199570
|
'networks': {
|
|
@@ -200882,7 +201589,7 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
200882
201589
|
const takeProfit = this.safeValue(params, 'takeProfit');
|
|
200883
201590
|
const takeProfitDefined = (takeProfit !== undefined);
|
|
200884
201591
|
if (clientOrderId === undefined) {
|
|
200885
|
-
const brokerId = this.safeString(this.options, 'brokerId');
|
|
201592
|
+
const brokerId = this.safeString(this.options, 'brokerId', 'CCXT123456');
|
|
200886
201593
|
if (brokerId !== undefined) {
|
|
200887
201594
|
request['clOrdID'] = brokerId + this.uuid16();
|
|
200888
201595
|
}
|
|
@@ -202678,6 +203385,13 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
202678
203385
|
};
|
|
202679
203386
|
let payload = '';
|
|
202680
203387
|
if (method === 'POST') {
|
|
203388
|
+
const isOrderPlacement = (path === 'g-orders') || (path === 'spot/orders') || (path === 'orders');
|
|
203389
|
+
if (isOrderPlacement) {
|
|
203390
|
+
if (this.safeString(params, 'clOrdID') === undefined) {
|
|
203391
|
+
const id = this.safeString(this.options, 'brokerId', 'CCXT123456');
|
|
203392
|
+
params['clOrdID'] = id + this.uuid16();
|
|
203393
|
+
}
|
|
203394
|
+
}
|
|
202681
203395
|
payload = this.json(params);
|
|
202682
203396
|
body = payload;
|
|
202683
203397
|
headers['Content-Type'] = 'application/json';
|
|
@@ -209100,6 +209814,12 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209100
209814
|
'future': 50,
|
|
209101
209815
|
'delivery': 50, // max 200
|
|
209102
209816
|
},
|
|
209817
|
+
'subscriptionLimitByStream': {
|
|
209818
|
+
'spot': 200,
|
|
209819
|
+
'margin': 200,
|
|
209820
|
+
'future': 200,
|
|
209821
|
+
'delivery': 200,
|
|
209822
|
+
},
|
|
209103
209823
|
'streamBySubscriptionsHash': {},
|
|
209104
209824
|
'streamIndex': -1,
|
|
209105
209825
|
// get updates every 1000ms or 100ms
|
|
@@ -209148,7 +209868,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209148
209868
|
this.options['requestId'][url] = newValue;
|
|
209149
209869
|
return newValue;
|
|
209150
209870
|
}
|
|
209151
|
-
stream(type, subscriptionHash) {
|
|
209871
|
+
stream(type, subscriptionHash, numSubscriptions = 1) {
|
|
209152
209872
|
const streamBySubscriptionsHash = this.safeValue(this.options, 'streamBySubscriptionsHash', {});
|
|
209153
209873
|
let stream = this.safeString(streamBySubscriptionsHash, subscriptionHash);
|
|
209154
209874
|
if (stream === undefined) {
|
|
@@ -209160,6 +209880,17 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209160
209880
|
this.options['streamIndex'] = streamIndex;
|
|
209161
209881
|
stream = this.numberToString(normalizedIndex);
|
|
209162
209882
|
this.options['streamBySubscriptionsHash'][subscriptionHash] = stream;
|
|
209883
|
+
const subscriptionsByStreams = this.safeValue(this.options, 'numSubscriptionsByStream');
|
|
209884
|
+
if (subscriptionsByStreams === undefined) {
|
|
209885
|
+
this.options['numSubscriptionsByStream'] = {};
|
|
209886
|
+
}
|
|
209887
|
+
const subscriptionsByStream = this.safeInteger(this.options['numSubscriptionsByStream'], stream, 0);
|
|
209888
|
+
const newNumSubscriptions = subscriptionsByStream + numSubscriptions;
|
|
209889
|
+
const subscriptionLimitByStream = this.safeInteger(this.options, 'subscriptionLimitByStream', 200);
|
|
209890
|
+
if (newNumSubscriptions > subscriptionLimitByStream) {
|
|
209891
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' reached the limit of subscriptions by stream. Increase the number of streams, or increase the stream limit or subscription limit by stream if the exchange allows.');
|
|
209892
|
+
}
|
|
209893
|
+
this.options['numSubscriptionsByStream'][stream] = subscriptionsByStream + numSubscriptions;
|
|
209163
209894
|
}
|
|
209164
209895
|
return stream;
|
|
209165
209896
|
}
|
|
@@ -209230,8 +209961,14 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209230
209961
|
type = firstMarket['linear'] ? 'future' : 'delivery';
|
|
209231
209962
|
}
|
|
209232
209963
|
const name = 'depth';
|
|
209233
|
-
|
|
209234
|
-
|
|
209964
|
+
let streamHash = 'multipleOrderbook';
|
|
209965
|
+
if (symbols !== undefined) {
|
|
209966
|
+
const symbolsLength = symbols.length;
|
|
209967
|
+
if (symbolsLength > 200) {
|
|
209968
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchOrderBookForSymbols() accepts 200 symbols at most. To watch more symbols call watchOrderBookForSymbols() multiple times');
|
|
209969
|
+
}
|
|
209970
|
+
streamHash += '::' + symbols.join(',');
|
|
209971
|
+
}
|
|
209235
209972
|
const watchOrderBookRate = this.safeString(this.options, 'watchOrderBookRate', '100');
|
|
209236
209973
|
const subParams = [];
|
|
209237
209974
|
const messageHashes = [];
|
|
@@ -209243,6 +209980,9 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209243
209980
|
const symbolHash = messageHash + '@' + watchOrderBookRate + 'ms';
|
|
209244
209981
|
subParams.push(symbolHash);
|
|
209245
209982
|
}
|
|
209983
|
+
const messageHashesLength = messageHashes.length;
|
|
209984
|
+
const url = this.urls['api']['ws'][type] + '/' + this.stream(type, streamHash, messageHashesLength);
|
|
209985
|
+
const requestId = this.requestId(url);
|
|
209246
209986
|
const request = {
|
|
209247
209987
|
'method': 'SUBSCRIBE',
|
|
209248
209988
|
'params': subParams,
|
|
@@ -209486,6 +210226,14 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209486
210226
|
*/
|
|
209487
210227
|
await this.loadMarkets();
|
|
209488
210228
|
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
210229
|
+
let streamHash = 'multipleTrades';
|
|
210230
|
+
if (symbols !== undefined) {
|
|
210231
|
+
const symbolsLength = symbols.length;
|
|
210232
|
+
if (symbolsLength > 200) {
|
|
210233
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' watchTradesForSymbols() accepts 200 symbols at most. To watch more symbols call watchTradesForSymbols() multiple times');
|
|
210234
|
+
}
|
|
210235
|
+
streamHash += '::' + symbols.join(',');
|
|
210236
|
+
}
|
|
209489
210237
|
const options = this.safeValue(this.options, 'watchTradesForSymbols', {});
|
|
209490
210238
|
const name = this.safeString(options, 'name', 'trade');
|
|
209491
210239
|
const firstMarket = this.market(symbols[0]);
|
|
@@ -209501,7 +210249,8 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209501
210249
|
subParams.push(currentMessageHash);
|
|
209502
210250
|
}
|
|
209503
210251
|
const query = this.omit(params, 'type');
|
|
209504
|
-
const
|
|
210252
|
+
const subParamsLength = subParams.length;
|
|
210253
|
+
const url = this.urls['api']['ws'][type] + '/' + this.stream(type, streamHash, subParamsLength);
|
|
209505
210254
|
const requestId = this.requestId(url);
|
|
209506
210255
|
const request = {
|
|
209507
210256
|
'method': 'SUBSCRIBE',
|
|
@@ -209985,30 +210734,30 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209985
210734
|
}
|
|
209986
210735
|
const marketId = this.safeString(message, 's');
|
|
209987
210736
|
const symbol = this.safeSymbol(marketId, undefined, undefined, marketType);
|
|
209988
|
-
const
|
|
209989
|
-
const
|
|
210737
|
+
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
210738
|
+
const last = this.safeString(message, 'c');
|
|
210739
|
+
return this.safeTicker({
|
|
209990
210740
|
'symbol': symbol,
|
|
209991
210741
|
'timestamp': timestamp,
|
|
209992
210742
|
'datetime': this.iso8601(timestamp),
|
|
209993
|
-
'high': this.
|
|
209994
|
-
'low': this.
|
|
209995
|
-
'bid': this.
|
|
209996
|
-
'bidVolume': this.
|
|
209997
|
-
'ask': this.
|
|
209998
|
-
'askVolume': this.
|
|
209999
|
-
'vwap': this.
|
|
210000
|
-
'open': this.
|
|
210743
|
+
'high': this.safeString(message, 'h'),
|
|
210744
|
+
'low': this.safeString(message, 'l'),
|
|
210745
|
+
'bid': this.safeString(message, 'b'),
|
|
210746
|
+
'bidVolume': this.safeString(message, 'B'),
|
|
210747
|
+
'ask': this.safeString(message, 'a'),
|
|
210748
|
+
'askVolume': this.safeString(message, 'A'),
|
|
210749
|
+
'vwap': this.safeString(message, 'w'),
|
|
210750
|
+
'open': this.safeString(message, 'o'),
|
|
210001
210751
|
'close': last,
|
|
210002
210752
|
'last': last,
|
|
210003
|
-
'previousClose': this.
|
|
210004
|
-
'change': this.
|
|
210005
|
-
'percentage': this.
|
|
210753
|
+
'previousClose': this.safeString(message, 'x'),
|
|
210754
|
+
'change': this.safeString(message, 'p'),
|
|
210755
|
+
'percentage': this.safeString(message, 'P'),
|
|
210006
210756
|
'average': undefined,
|
|
210007
|
-
'baseVolume': this.
|
|
210008
|
-
'quoteVolume': this.
|
|
210757
|
+
'baseVolume': this.safeString(message, 'v'),
|
|
210758
|
+
'quoteVolume': this.safeString(message, 'q'),
|
|
210009
210759
|
'info': message,
|
|
210010
|
-
};
|
|
210011
|
-
return ticker;
|
|
210760
|
+
}, market);
|
|
210012
210761
|
}
|
|
210013
210762
|
handleTicker(client, message) {
|
|
210014
210763
|
//
|
|
@@ -211273,7 +212022,8 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
211273
212022
|
market = this.getMarketFromSymbols(symbols);
|
|
211274
212023
|
messageHash = '::' + symbols.join(',');
|
|
211275
212024
|
}
|
|
211276
|
-
let type =
|
|
212025
|
+
let type = undefined;
|
|
212026
|
+
[type, params] = this.handleMarketTypeAndParams('watchPositions', market, params);
|
|
211277
212027
|
if (type === 'spot' || type === 'margin') {
|
|
211278
212028
|
type = 'future';
|
|
211279
212029
|
}
|
|
@@ -227297,7 +228047,10 @@ class coinbase extends _coinbase_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
227297
228047
|
}
|
|
227298
228048
|
const name = 'ticker_batch';
|
|
227299
228049
|
const tickers = await this.subscribe(name, symbols, params);
|
|
227300
|
-
|
|
228050
|
+
if (this.newUpdates) {
|
|
228051
|
+
return tickers;
|
|
228052
|
+
}
|
|
228053
|
+
return this.tickers;
|
|
227301
228054
|
}
|
|
227302
228055
|
handleTickers(client, message) {
|
|
227303
228056
|
//
|
|
@@ -241431,7 +242184,7 @@ class kraken extends _kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
241431
242184
|
],
|
|
241432
242185
|
'subscription': {
|
|
241433
242186
|
'name': name,
|
|
241434
|
-
'interval': this.
|
|
242187
|
+
'interval': this.safeValue(this.timeframes, timeframe, timeframe),
|
|
241435
242188
|
},
|
|
241436
242189
|
};
|
|
241437
242190
|
const request = this.deepExtend(subscribe, params);
|
|
@@ -248671,6 +249424,7 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
248671
249424
|
'watchOrderBookForSymbols': true,
|
|
248672
249425
|
'watchBalance': true,
|
|
248673
249426
|
'watchOHLCV': true,
|
|
249427
|
+
'watchOHLCVForSymbols': true,
|
|
248674
249428
|
'watchOrders': true,
|
|
248675
249429
|
'watchMyTrades': true,
|
|
248676
249430
|
'watchPositions': true,
|
|
@@ -249007,6 +249761,50 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
249007
249761
|
}
|
|
249008
249762
|
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
249009
249763
|
}
|
|
249764
|
+
async watchOHLCVForSymbols(symbolsAndTimeframes, since = undefined, limit = undefined, params = {}) {
|
|
249765
|
+
/**
|
|
249766
|
+
* @method
|
|
249767
|
+
* @name okx#watchOHLCVForSymbols
|
|
249768
|
+
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
249769
|
+
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
249770
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
249771
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
249772
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
249773
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
249774
|
+
*/
|
|
249775
|
+
const symbolsLength = symbolsAndTimeframes.length;
|
|
249776
|
+
if (symbolsLength === 0 || !Array.isArray(symbolsAndTimeframes[0])) {
|
|
249777
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + " watchOHLCVForSymbols() requires a an array of symbols and timeframes, like [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]");
|
|
249778
|
+
}
|
|
249779
|
+
await this.loadMarkets();
|
|
249780
|
+
const topics = [];
|
|
249781
|
+
const messageHashes = [];
|
|
249782
|
+
for (let i = 0; i < symbolsAndTimeframes.length; i++) {
|
|
249783
|
+
const symbolAndTimeframe = symbolsAndTimeframes[i];
|
|
249784
|
+
const sym = symbolAndTimeframe[0];
|
|
249785
|
+
const tf = symbolAndTimeframe[1];
|
|
249786
|
+
const marketId = this.marketId(sym);
|
|
249787
|
+
const interval = this.safeString(this.timeframes, tf, tf);
|
|
249788
|
+
const channel = 'candle' + interval;
|
|
249789
|
+
const topic = {
|
|
249790
|
+
'channel': channel,
|
|
249791
|
+
'instId': marketId,
|
|
249792
|
+
};
|
|
249793
|
+
topics.push(topic);
|
|
249794
|
+
messageHashes.push('multi:' + channel + ':' + sym);
|
|
249795
|
+
}
|
|
249796
|
+
const request = {
|
|
249797
|
+
'op': 'subscribe',
|
|
249798
|
+
'args': topics,
|
|
249799
|
+
};
|
|
249800
|
+
const url = this.getUrl('candle', 'public');
|
|
249801
|
+
const [symbol, timeframe, candles] = await this.watchMultiple(url, messageHashes, request, messageHashes);
|
|
249802
|
+
if (this.newUpdates) {
|
|
249803
|
+
limit = candles.getLimit(symbol, limit);
|
|
249804
|
+
}
|
|
249805
|
+
const filtered = this.filterBySinceLimit(candles, since, limit, 0, true);
|
|
249806
|
+
return this.createOHLCVObject(symbol, timeframe, filtered);
|
|
249807
|
+
}
|
|
249010
249808
|
handleOHLCV(client, message) {
|
|
249011
249809
|
//
|
|
249012
249810
|
// {
|
|
@@ -249029,7 +249827,7 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
249029
249827
|
const data = this.safeValue(message, 'data', []);
|
|
249030
249828
|
const marketId = this.safeString(arg, 'instId');
|
|
249031
249829
|
const market = this.safeMarket(marketId);
|
|
249032
|
-
const symbol = market['
|
|
249830
|
+
const symbol = market['symbol'];
|
|
249033
249831
|
const interval = channel.replace('candle', '');
|
|
249034
249832
|
// use a reverse lookup in a static map instead
|
|
249035
249833
|
const timeframe = this.findTimeframe(interval);
|
|
@@ -249043,8 +249841,13 @@ class okx extends _okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
249043
249841
|
this.ohlcvs[symbol][timeframe] = stored;
|
|
249044
249842
|
}
|
|
249045
249843
|
stored.append(parsed);
|
|
249046
|
-
const messageHash = channel + ':' +
|
|
249844
|
+
const messageHash = channel + ':' + market['id'];
|
|
249047
249845
|
client.resolve(stored, messageHash);
|
|
249846
|
+
// for multiOHLCV we need special object, as opposed to other "multi"
|
|
249847
|
+
// methods, because OHLCV response item does not contain symbol
|
|
249848
|
+
// or timeframe, thus otherwise it would be unrecognizable
|
|
249849
|
+
const messageHashForMulti = 'multi:' + channel + ':' + symbol;
|
|
249850
|
+
client.resolve([symbol, timeframe, stored], messageHashForMulti);
|
|
249048
249851
|
}
|
|
249049
249852
|
}
|
|
249050
249853
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
@@ -258138,7 +258941,6 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
258138
258941
|
const market = this.market(symbol);
|
|
258139
258942
|
const request = {
|
|
258140
258943
|
'market_id': market['id'],
|
|
258141
|
-
'limit': 100,
|
|
258142
258944
|
'start_time': '1970-01-01T00:00:00.000Z',
|
|
258143
258945
|
'end_time': this.iso8601(this.milliseconds()),
|
|
258144
258946
|
};
|
|
@@ -258146,7 +258948,10 @@ class probit extends _abstract_probit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
258146
258948
|
request['start_time'] = this.iso8601(since);
|
|
258147
258949
|
}
|
|
258148
258950
|
if (limit !== undefined) {
|
|
258149
|
-
request['limit'] = Math.min(limit,
|
|
258951
|
+
request['limit'] = Math.min(limit, 1000);
|
|
258952
|
+
}
|
|
258953
|
+
else {
|
|
258954
|
+
request['limit'] = 1000; // required to set any value
|
|
258150
258955
|
}
|
|
258151
258956
|
const response = await this.publicGetTrade(this.extend(request, params));
|
|
258152
258957
|
//
|
|
@@ -272554,11 +273359,11 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
272554
273359
|
else if ((locked !== undefined) && locked) {
|
|
272555
273360
|
active = false;
|
|
272556
273361
|
}
|
|
272557
|
-
const maxOnetimeWithdrawal = this.
|
|
272558
|
-
const maxDailyWithdrawal = this.
|
|
272559
|
-
const remainingDailyWithdrawal = this.
|
|
273362
|
+
const maxOnetimeWithdrawal = this.safeString(withdrawLimits, 'onetime');
|
|
273363
|
+
const maxDailyWithdrawal = this.safeString(withdrawLimits, 'daily', maxOnetimeWithdrawal);
|
|
273364
|
+
const remainingDailyWithdrawal = this.safeString(withdrawLimits, 'remaining_daily', maxDailyWithdrawal);
|
|
272560
273365
|
let maxWithdrawLimit = undefined;
|
|
272561
|
-
if (remainingDailyWithdrawal
|
|
273366
|
+
if (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringGt(remainingDailyWithdrawal, '0')) {
|
|
272562
273367
|
maxWithdrawLimit = remainingDailyWithdrawal;
|
|
272563
273368
|
}
|
|
272564
273369
|
else {
|
|
@@ -272577,7 +273382,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
272577
273382
|
'limits': {
|
|
272578
273383
|
'withdraw': {
|
|
272579
273384
|
'min': this.safeNumber(withdrawLimits, 'minimum'),
|
|
272580
|
-
'max': maxWithdrawLimit,
|
|
273385
|
+
'max': this.parseNumber(maxWithdrawLimit),
|
|
272581
273386
|
},
|
|
272582
273387
|
},
|
|
272583
273388
|
};
|
|
@@ -272637,10 +273442,10 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
272637
273442
|
const base = this.safeCurrencyCode(baseId);
|
|
272638
273443
|
const quote = this.safeCurrencyCode(quoteId);
|
|
272639
273444
|
const state = this.safeString(marketInfo, 'state');
|
|
272640
|
-
const bidFee = this.
|
|
272641
|
-
const askFee = this.
|
|
272642
|
-
const fee =
|
|
272643
|
-
return {
|
|
273445
|
+
const bidFee = this.safeString(response, 'bid_fee');
|
|
273446
|
+
const askFee = this.safeString(response, 'ask_fee');
|
|
273447
|
+
const fee = this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringMax(bidFee, askFee));
|
|
273448
|
+
return this.safeMarketStructure({
|
|
272644
273449
|
'id': marketId,
|
|
272645
273450
|
'symbol': base + '/' + quote,
|
|
272646
273451
|
'base': base,
|
|
@@ -272689,7 +273494,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
272689
273494
|
},
|
|
272690
273495
|
'info': response,
|
|
272691
273496
|
},
|
|
272692
|
-
};
|
|
273497
|
+
});
|
|
272693
273498
|
}
|
|
272694
273499
|
async fetchMarkets(params = {}) {
|
|
272695
273500
|
/**
|
|
@@ -272718,7 +273523,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
272718
273523
|
const [quoteId, baseId] = id.split('-');
|
|
272719
273524
|
const base = this.safeCurrencyCode(baseId);
|
|
272720
273525
|
const quote = this.safeCurrencyCode(quoteId);
|
|
272721
|
-
return {
|
|
273526
|
+
return this.safeMarketStructure({
|
|
272722
273527
|
'id': id,
|
|
272723
273528
|
'symbol': base + '/' + quote,
|
|
272724
273529
|
'base': base,
|
|
@@ -272768,7 +273573,7 @@ class upbit extends _abstract_upbit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
272768
273573
|
},
|
|
272769
273574
|
'created': undefined,
|
|
272770
273575
|
'info': market,
|
|
272771
|
-
};
|
|
273576
|
+
});
|
|
272772
273577
|
}
|
|
272773
273578
|
parseBalance(response) {
|
|
272774
273579
|
const result = {
|
|
@@ -276239,7 +277044,7 @@ class wavesexchange extends _abstract_wavesexchange_js__WEBPACK_IMPORTED_MODULE_
|
|
|
276239
277044
|
'priceAsset': market['quoteId'],
|
|
276240
277045
|
};
|
|
276241
277046
|
if (limit !== undefined) {
|
|
276242
|
-
request['limit'] = limit;
|
|
277047
|
+
request['limit'] = Math.min(limit, 100);
|
|
276243
277048
|
}
|
|
276244
277049
|
if (since !== undefined) {
|
|
276245
277050
|
request['timeStart'] = since;
|
|
@@ -280092,6 +280897,8 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
280092
280897
|
'createStopLimitOrder': false,
|
|
280093
280898
|
'createStopMarketOrder': false,
|
|
280094
280899
|
'createStopOrder': false,
|
|
280900
|
+
'createTrailingAmountOrder': true,
|
|
280901
|
+
'createTrailingPercentOrder': true,
|
|
280095
280902
|
'fetchAccounts': true,
|
|
280096
280903
|
'fetchBalance': true,
|
|
280097
280904
|
'fetchCanceledOrders': false,
|
|
@@ -280807,6 +281614,56 @@ class woo extends _abstract_woo_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
280807
281614
|
params['createMarketBuyOrderRequiresPrice'] = false;
|
|
280808
281615
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
280809
281616
|
}
|
|
281617
|
+
async createTrailingAmountOrder(symbol, type, side, amount, price = undefined, trailingAmount = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
281618
|
+
/**
|
|
281619
|
+
* @method
|
|
281620
|
+
* @name createTrailingAmountOrder
|
|
281621
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
|
281622
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
281623
|
+
* @param {string} type 'market' or 'limit'
|
|
281624
|
+
* @param {string} side 'buy' or 'sell'
|
|
281625
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
281626
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
281627
|
+
* @param {float} trailingAmount the quote amount to trail away from the current market price
|
|
281628
|
+
* @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
|
|
281629
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
281630
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
281631
|
+
*/
|
|
281632
|
+
if (trailingAmount === undefined) {
|
|
281633
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' createTrailingAmountOrder() requires a trailingAmount argument');
|
|
281634
|
+
}
|
|
281635
|
+
if (trailingTriggerPrice === undefined) {
|
|
281636
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' createTrailingAmountOrder() requires a trailingTriggerPrice argument');
|
|
281637
|
+
}
|
|
281638
|
+
params['trailingAmount'] = trailingAmount;
|
|
281639
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
281640
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
281641
|
+
}
|
|
281642
|
+
async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
281643
|
+
/**
|
|
281644
|
+
* @method
|
|
281645
|
+
* @name createTrailingPercentOrder
|
|
281646
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
281647
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
281648
|
+
* @param {string} type 'market' or 'limit'
|
|
281649
|
+
* @param {string} side 'buy' or 'sell'
|
|
281650
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
281651
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
281652
|
+
* @param {float} trailingPercent the percent to trail away from the current market price
|
|
281653
|
+
* @param {float} trailingTriggerPrice the price to activate a trailing order, default uses the price argument
|
|
281654
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
281655
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
281656
|
+
*/
|
|
281657
|
+
if (trailingPercent === undefined) {
|
|
281658
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingPercent argument');
|
|
281659
|
+
}
|
|
281660
|
+
if (trailingTriggerPrice === undefined) {
|
|
281661
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' createTrailingPercentOrder() requires a trailingTriggerPrice argument');
|
|
281662
|
+
}
|
|
281663
|
+
params['trailingPercent'] = trailingPercent;
|
|
281664
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
281665
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
281666
|
+
}
|
|
280810
281667
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
280811
281668
|
/**
|
|
280812
281669
|
* @method
|
|
@@ -292275,7 +293132,7 @@ SOFTWARE.
|
|
|
292275
293132
|
|
|
292276
293133
|
//-----------------------------------------------------------------------------
|
|
292277
293134
|
// this is updated by vss.js when building
|
|
292278
|
-
const version = '4.2.
|
|
293135
|
+
const version = '4.2.13';
|
|
292279
293136
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
292280
293137
|
//-----------------------------------------------------------------------------
|
|
292281
293138
|
|