ccxt 4.5.12 → 4.5.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 +6 -5
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +31 -2
- package/dist/cjs/src/abstract/alpaca.js +1 -1
- package/dist/cjs/src/abstract/apex.js +1 -1
- package/dist/cjs/src/abstract/arkham.js +11 -0
- package/dist/cjs/src/abstract/ascendex.js +1 -1
- package/dist/cjs/src/abstract/backpack.js +1 -1
- package/dist/cjs/src/abstract/bigone.js +1 -1
- package/dist/cjs/src/abstract/binance.js +1 -1
- package/dist/cjs/src/abstract/bingx.js +1 -1
- package/dist/cjs/src/abstract/bit2c.js +1 -1
- package/dist/cjs/src/abstract/bitbank.js +1 -1
- package/dist/cjs/src/abstract/bitbns.js +1 -1
- package/dist/cjs/src/abstract/bitfinex.js +1 -1
- package/dist/cjs/src/abstract/bitflyer.js +1 -1
- package/dist/cjs/src/abstract/bitget.js +1 -1
- package/dist/cjs/src/abstract/bithumb.js +1 -1
- package/dist/cjs/src/abstract/bitmart.js +1 -1
- package/dist/cjs/src/abstract/bitmex.js +1 -1
- package/dist/cjs/src/abstract/bitopro.js +1 -1
- package/dist/cjs/src/abstract/bitrue.js +1 -1
- package/dist/cjs/src/abstract/bitso.js +1 -1
- package/dist/cjs/src/abstract/bitstamp.js +1 -1
- package/dist/cjs/src/abstract/bitteam.js +1 -1
- package/dist/cjs/src/abstract/bittrade.js +1 -1
- package/dist/cjs/src/abstract/bitvavo.js +1 -1
- package/dist/cjs/src/abstract/blockchaincom.js +1 -1
- package/dist/cjs/src/abstract/blofin.js +1 -1
- package/dist/cjs/src/abstract/btcalpha.js +1 -1
- package/dist/cjs/src/abstract/btcbox.js +1 -1
- package/dist/cjs/src/abstract/btcmarkets.js +1 -1
- package/dist/cjs/src/abstract/btcturk.js +1 -1
- package/dist/cjs/src/abstract/bybit.js +1 -1
- package/dist/cjs/src/abstract/cex.js +1 -1
- package/dist/cjs/src/abstract/coinbase.js +1 -1
- package/dist/cjs/src/abstract/coinbaseexchange.js +1 -1
- package/dist/cjs/src/abstract/coinbaseinternational.js +1 -1
- package/dist/cjs/src/abstract/coincatch.js +1 -1
- package/dist/cjs/src/abstract/coincheck.js +1 -1
- package/dist/cjs/src/abstract/coinex.js +1 -1
- package/dist/cjs/src/abstract/coinmate.js +1 -1
- package/dist/cjs/src/abstract/coinmetro.js +1 -1
- package/dist/cjs/src/abstract/coinone.js +1 -1
- package/dist/cjs/src/abstract/coinsph.js +1 -1
- package/dist/cjs/src/abstract/coinspot.js +1 -1
- package/dist/cjs/src/abstract/cryptocom.js +1 -1
- package/dist/cjs/src/abstract/cryptomus.js +1 -1
- package/dist/cjs/src/abstract/defx.js +1 -1
- package/dist/cjs/src/abstract/delta.js +1 -1
- package/dist/cjs/src/abstract/deribit.js +1 -1
- package/dist/cjs/src/abstract/derive.js +1 -1
- package/dist/cjs/src/abstract/digifinex.js +1 -1
- package/dist/cjs/src/abstract/exmo.js +1 -1
- package/dist/cjs/src/abstract/foxbit.js +1 -1
- package/dist/cjs/src/abstract/gate.js +1 -1
- package/dist/cjs/src/abstract/gemini.js +1 -1
- package/dist/cjs/src/abstract/hashkey.js +1 -1
- package/dist/cjs/src/abstract/hibachi.js +1 -1
- package/dist/cjs/src/abstract/hitbtc.js +1 -1
- package/dist/cjs/src/abstract/hollaex.js +1 -1
- package/dist/cjs/src/abstract/htx.js +1 -1
- package/dist/cjs/src/abstract/hyperliquid.js +1 -1
- package/dist/cjs/src/abstract/independentreserve.js +1 -1
- package/dist/cjs/src/abstract/indodax.js +1 -1
- package/dist/cjs/src/abstract/kraken.js +1 -1
- package/dist/cjs/src/abstract/krakenfutures.js +1 -1
- package/dist/cjs/src/abstract/kucoin.js +1 -1
- package/dist/cjs/src/abstract/kucoinfutures.js +1 -1
- package/dist/cjs/src/abstract/latoken.js +1 -1
- package/dist/cjs/src/abstract/lbank.js +1 -1
- package/dist/cjs/src/abstract/luno.js +1 -1
- package/dist/cjs/src/abstract/mercado.js +1 -1
- package/dist/cjs/src/abstract/mexc.js +1 -1
- package/dist/cjs/src/abstract/modetrade.js +1 -1
- package/dist/cjs/src/abstract/ndax.js +1 -1
- package/dist/cjs/src/abstract/novadax.js +1 -1
- package/dist/cjs/src/abstract/oceanex.js +1 -1
- package/dist/cjs/src/abstract/okx.js +1 -1
- package/dist/cjs/src/abstract/onetrading.js +1 -1
- package/dist/cjs/src/abstract/oxfun.js +1 -1
- package/dist/cjs/src/abstract/p2b.js +1 -1
- package/dist/cjs/src/abstract/paradex.js +1 -1
- package/dist/cjs/src/abstract/paymium.js +1 -1
- package/dist/cjs/src/abstract/phemex.js +1 -1
- package/dist/cjs/src/abstract/poloniex.js +1 -1
- package/dist/cjs/src/abstract/probit.js +1 -1
- package/dist/cjs/src/abstract/timex.js +1 -1
- package/dist/cjs/src/abstract/tokocrypto.js +1 -1
- package/dist/cjs/src/abstract/toobit.js +1 -1
- package/dist/cjs/src/abstract/upbit.js +1 -1
- package/dist/cjs/src/abstract/wavesexchange.js +1 -1
- package/dist/cjs/src/abstract/whitebit.js +1 -1
- package/dist/cjs/src/abstract/woo.js +1 -1
- package/dist/cjs/src/abstract/woofipro.js +1 -1
- package/dist/cjs/src/abstract/xt.js +1 -1
- package/dist/cjs/src/abstract/yobit.js +1 -1
- package/dist/cjs/src/abstract/zaif.js +1 -1
- package/dist/cjs/src/abstract/zonda.js +1 -1
- package/dist/cjs/src/alpaca.js +1 -1
- package/dist/cjs/src/apex.js +1 -1
- package/dist/cjs/src/arkham.js +2462 -0
- package/dist/cjs/src/ascendex.js +1 -1
- package/dist/cjs/src/backpack.js +1 -1
- package/dist/cjs/src/base/Precise.js +0 -6
- package/dist/cjs/src/base/errors.js +0 -6
- package/dist/cjs/src/base/functions/crypto.js +1 -1
- package/dist/cjs/src/base/functions/encode.js +1 -1
- package/dist/cjs/src/base/functions/misc.js +0 -1
- package/dist/cjs/src/base/functions/number.js +0 -6
- package/dist/cjs/src/base/functions/platform.js +0 -6
- package/dist/cjs/src/base/functions/rsa.js +0 -1
- package/dist/cjs/src/base/functions/string.js +0 -6
- package/dist/cjs/src/base/functions/throttle.js +1 -1
- package/dist/cjs/src/base/functions/time.js +0 -6
- package/dist/cjs/src/base/functions/totp.js +0 -1
- package/dist/cjs/src/base/functions/type.js +0 -6
- package/dist/cjs/src/base/functions.js +1 -1
- package/dist/cjs/src/base/ws/Cache.js +0 -6
- package/dist/cjs/src/base/ws/Client.js +0 -1
- package/dist/cjs/src/base/ws/Future.js +1 -1
- package/dist/cjs/src/base/ws/OrderBook.js +1 -1
- package/dist/cjs/src/base/ws/OrderBookSide.js +0 -6
- package/dist/cjs/src/base/ws/WsClient.js +1 -1
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/binancecoinm.js +1 -1
- package/dist/cjs/src/binanceus.js +1 -1
- package/dist/cjs/src/binanceusdm.js +1 -1
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bit2c.js +1 -1
- package/dist/cjs/src/bitbank.js +1 -1
- package/dist/cjs/src/bitbns.js +1 -1
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitflyer.js +1 -1
- package/dist/cjs/src/bitget.js +1 -1
- package/dist/cjs/src/bithumb.js +1 -1
- package/dist/cjs/src/bitmart.js +17 -10
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +1 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +1 -1
- package/dist/cjs/src/blockchaincom.js +1 -1
- package/dist/cjs/src/blofin.js +1 -1
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +9 -1
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbaseadvanced.js +1 -1
- package/dist/cjs/src/coincatch.js +1 -1
- package/dist/cjs/src/coincheck.js +1 -1
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/coinmate.js +1 -1
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinone.js +1 -1
- package/dist/cjs/src/coinsph.js +0 -1
- package/dist/cjs/src/coinspot.js +1 -1
- package/dist/cjs/src/cryptocom.js +1 -1
- package/dist/cjs/src/cryptomus.js +1 -1
- package/dist/cjs/src/defx.js +4 -3
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/deribit.js +1 -1
- package/dist/cjs/src/derive.js +1 -1
- package/dist/cjs/src/digifinex.js +1 -1
- package/dist/cjs/src/exmo.js +1 -1
- package/dist/cjs/src/fmfwio.js +1 -1
- package/dist/cjs/src/foxbit.js +1 -1
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/gateio.js +1 -1
- package/dist/cjs/src/gemini.js +1 -1
- package/dist/cjs/src/hashkey.js +1 -1
- package/dist/cjs/src/hibachi.js +4 -4
- package/dist/cjs/src/hitbtc.js +0 -1
- package/dist/cjs/src/hollaex.js +1 -1
- package/dist/cjs/src/htx.js +1 -1
- package/dist/cjs/src/huobi.js +1 -1
- package/dist/cjs/src/hyperliquid.js +51 -12
- package/dist/cjs/src/independentreserve.js +1 -1
- package/dist/cjs/src/indodax.js +1 -1
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/krakenfutures.js +46 -34
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/latoken.js +1 -1
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mercado.js +1 -1
- package/dist/cjs/src/mexc.js +1 -1
- package/dist/cjs/src/modetrade.js +1 -1
- package/dist/cjs/src/myokx.js +1 -1
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/novadax.js +1 -1
- package/dist/cjs/src/oceanex.js +1 -1
- package/dist/cjs/src/okx.js +10 -2
- package/dist/cjs/src/okxus.js +1 -1
- package/dist/cjs/src/onetrading.js +1 -1
- package/dist/cjs/src/oxfun.js +1 -1
- package/dist/cjs/src/p2b.js +1 -1
- package/dist/cjs/src/paradex.js +1 -1
- package/dist/cjs/src/paymium.js +1 -1
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +1 -1
- package/dist/cjs/src/pro/arkham.js +715 -0
- package/dist/cjs/src/pro/ascendex.js +1 -1
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/bequant.js +1 -1
- package/dist/cjs/src/pro/binancecoinm.js +1 -1
- package/dist/cjs/src/pro/binanceus.js +1 -1
- package/dist/cjs/src/pro/binanceusdm.js +1 -1
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +1 -1
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +263 -7
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitrue.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/bitvavo.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/blofin.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinbase.js +1 -1
- package/dist/cjs/src/pro/coinbaseadvanced.js +1 -1
- package/dist/cjs/src/pro/coinbaseexchange.js +1 -1
- package/dist/cjs/src/pro/coinbaseinternational.js +1 -1
- package/dist/cjs/src/pro/coincatch.js +1 -1
- package/dist/cjs/src/pro/coincheck.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +1 -1
- package/dist/cjs/src/pro/defx.js +1 -1
- package/dist/cjs/src/pro/deribit.js +3 -2
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/gateio.js +1 -1
- package/dist/cjs/src/pro/gemini.js +1 -1
- package/dist/cjs/src/pro/hashkey.js +1 -1
- package/dist/cjs/src/pro/hitbtc.js +1 -1
- package/dist/cjs/src/pro/hollaex.js +1 -1
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/pro/huobi.js +1 -1
- package/dist/cjs/src/pro/hyperliquid.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/kraken.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/kucoinfutures.js +1 -1
- package/dist/cjs/src/pro/lbank.js +0 -1
- package/dist/cjs/src/pro/luno.js +1 -1
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/pro/myokx.js +1 -1
- package/dist/cjs/src/pro/ndax.js +1 -1
- package/dist/cjs/src/pro/okx.js +1 -1
- package/dist/cjs/src/pro/okxus.js +1 -1
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/oxfun.js +1 -1
- package/dist/cjs/src/pro/p2b.js +1 -1
- package/dist/cjs/src/pro/paradex.js +1 -1
- package/dist/cjs/src/pro/phemex.js +1 -1
- package/dist/cjs/src/pro/poloniex.js +1 -1
- package/dist/cjs/src/pro/probit.js +1 -1
- package/dist/cjs/src/pro/toobit.js +4 -3
- package/dist/cjs/src/pro/upbit.js +2 -2
- package/dist/cjs/src/pro/whitebit.js +1 -1
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/probit.js +1 -1
- package/dist/cjs/src/protobuf/mexc/compiled.cjs.js +1 -0
- package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/address/address.js +1 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/coders/address.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/array.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/null.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/number.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/string.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +0 -1
- package/dist/cjs/src/static_dependencies/ethers/fragments.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/index.js +10 -1
- package/dist/cjs/src/static_dependencies/ethers/interface.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/typed.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +13 -1
- package/dist/cjs/src/static_dependencies/ethers/utils/data.js +6 -1
- package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +9 -1
- package/dist/cjs/src/static_dependencies/ethers/utils/events.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/utils/index.js +7 -1
- package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +5 -1
- package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +0 -6
- package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +8 -1
- package/dist/cjs/src/static_dependencies/fflake/browser.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/JSEncrypt.js +0 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +0 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +0 -6
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +0 -6
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +0 -6
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +0 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +0 -6
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsbn/util.js +0 -6
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +1 -1
- package/dist/cjs/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +0 -6
- package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +0 -6
- package/dist/cjs/src/static_dependencies/noble-curves/_shortw_utils.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/curve.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/edwards.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/modular.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/montgomery.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/poseidon.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/utils.js +0 -6
- package/dist/cjs/src/static_dependencies/noble-curves/abstract/weierstrass.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/ed25519.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/p256.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-curves/secp256k1.js +1 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/_assert.js +0 -6
- package/dist/cjs/src/static_dependencies/noble-hashes/_sha2.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/_u64.js +0 -6
- package/dist/cjs/src/static_dependencies/noble-hashes/crypto.js +0 -6
- package/dist/cjs/src/static_dependencies/noble-hashes/hmac.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/md5.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/sha1.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/sha256.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/sha3.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/sha512.js +0 -1
- package/dist/cjs/src/static_dependencies/noble-hashes/utils.js +1 -1
- package/dist/cjs/src/static_dependencies/node-fetch/body.js +5 -1
- package/dist/cjs/src/static_dependencies/node-fetch/errors/abort-error.js +0 -1
- package/dist/cjs/src/static_dependencies/node-fetch/errors/base.js +0 -6
- package/dist/cjs/src/static_dependencies/node-fetch/errors/fetch-error.js +0 -1
- package/dist/cjs/src/static_dependencies/node-fetch/headers.js +5 -1
- package/dist/cjs/src/static_dependencies/node-fetch/index.js +7 -1
- package/dist/cjs/src/static_dependencies/node-fetch/request.js +7 -1
- package/dist/cjs/src/static_dependencies/node-fetch/response.js +5 -1
- package/dist/cjs/src/static_dependencies/node-fetch/utils/get-search.js +0 -6
- package/dist/cjs/src/static_dependencies/node-fetch/utils/is-redirect.js +0 -6
- package/dist/cjs/src/static_dependencies/node-fetch/utils/is.js +0 -6
- package/dist/cjs/src/static_dependencies/node-fetch/utils/referrer.js +0 -1
- package/dist/cjs/src/static_dependencies/proxies/agent-base/index.js +0 -1
- package/dist/cjs/src/static_dependencies/proxies/http-proxy-agent/index.js +0 -1
- package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/index.js +0 -1
- package/dist/cjs/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +0 -6
- package/dist/cjs/src/static_dependencies/qs/formats.js +0 -6
- package/dist/cjs/src/static_dependencies/qs/index.js +0 -1
- package/dist/cjs/src/static_dependencies/qs/parse.js +0 -1
- package/dist/cjs/src/static_dependencies/qs/stringify.js +0 -1
- package/dist/cjs/src/static_dependencies/qs/utils.js +0 -6
- package/dist/cjs/src/static_dependencies/scure-base/index.js +0 -6
- package/dist/cjs/src/static_dependencies/scure-starknet/index.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/constants.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/types/calldata.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/types/lib/contract/abi.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/types/lib/contract/index.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/types/lib/index.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/types/typedData.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/utils/assert.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/felt.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/uint256.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/cairoDataTypes/uint512.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/byteArray.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/cairo.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoCustomEnum.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoOption.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/enum/CairoResult.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/formatter.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/index.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/index.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/parser-0-1.1.0.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/parser/parser-2.0.0.js +0 -6
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/propertyOrder.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/requestParser.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/responseParser.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/tuple.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/calldata/validate.js +4 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/encode.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +3 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/merkle.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/num.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/selector.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/shortString.js +0 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/typedData.js +1 -1
- package/dist/cjs/src/static_dependencies/watchable/src/unpromise.js +0 -6
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +0 -6
- package/dist/cjs/src/timex.js +0 -1
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +1 -1
- package/dist/cjs/src/upbit.js +1 -1
- package/dist/cjs/src/wavesexchange.js +1 -1
- package/dist/cjs/src/whitebit.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/woofipro.js +1 -1
- package/dist/cjs/src/xt.js +1 -1
- package/dist/cjs/src/yobit.js +1 -1
- package/dist/cjs/src/zaif.js +1 -1
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -8
- package/js/src/abstract/alpaca.js +0 -6
- package/js/src/abstract/apex.js +0 -6
- package/js/src/abstract/arkham.d.ts +121 -0
- package/js/src/abstract/arkham.js +5 -0
- package/js/src/abstract/ascendex.js +0 -6
- package/js/src/abstract/backpack.js +0 -6
- package/js/src/abstract/bequant.js +0 -6
- package/js/src/abstract/bigone.js +0 -6
- package/js/src/abstract/binance.js +0 -6
- package/js/src/abstract/binancecoinm.js +0 -6
- package/js/src/abstract/binanceus.js +0 -6
- package/js/src/abstract/binanceusdm.js +0 -6
- package/js/src/abstract/bingx.js +0 -6
- package/js/src/abstract/bit2c.js +0 -6
- package/js/src/abstract/bitbank.js +0 -6
- package/js/src/abstract/bitbns.js +0 -6
- package/js/src/abstract/bitfinex.js +0 -6
- package/js/src/abstract/bitflyer.js +0 -6
- package/js/src/abstract/bitget.js +0 -6
- package/js/src/abstract/bithumb.js +0 -6
- package/js/src/abstract/bitmart.js +0 -6
- package/js/src/abstract/bitmex.js +0 -6
- package/js/src/abstract/bitopro.js +0 -6
- package/js/src/abstract/bitrue.js +0 -6
- package/js/src/abstract/bitso.js +0 -6
- package/js/src/abstract/bitstamp.js +0 -6
- package/js/src/abstract/bitteam.js +0 -6
- package/js/src/abstract/bittrade.js +0 -6
- package/js/src/abstract/bitvavo.js +0 -6
- package/js/src/abstract/blockchaincom.js +0 -6
- package/js/src/abstract/blofin.js +0 -6
- package/js/src/abstract/btcalpha.js +0 -6
- package/js/src/abstract/btcbox.js +0 -6
- package/js/src/abstract/btcmarkets.js +0 -6
- package/js/src/abstract/btcturk.js +0 -6
- package/js/src/abstract/bybit.d.ts +8 -0
- package/js/src/abstract/bybit.js +0 -6
- package/js/src/abstract/cex.js +0 -6
- package/js/src/abstract/coinbase.js +0 -6
- package/js/src/abstract/coinbaseadvanced.js +0 -6
- package/js/src/abstract/coinbaseexchange.js +0 -6
- package/js/src/abstract/coinbaseinternational.js +0 -6
- package/js/src/abstract/coincatch.js +0 -6
- package/js/src/abstract/coincheck.js +0 -6
- package/js/src/abstract/coinex.js +0 -6
- package/js/src/abstract/coinmate.js +0 -6
- package/js/src/abstract/coinmetro.js +0 -6
- package/js/src/abstract/coinone.js +0 -6
- package/js/src/abstract/coinsph.js +0 -6
- package/js/src/abstract/coinspot.js +0 -6
- package/js/src/abstract/cryptocom.js +0 -6
- package/js/src/abstract/cryptomus.js +0 -6
- package/js/src/abstract/defx.js +0 -6
- package/js/src/abstract/delta.js +0 -6
- package/js/src/abstract/deribit.js +0 -6
- package/js/src/abstract/derive.js +0 -6
- package/js/src/abstract/digifinex.js +0 -6
- package/js/src/abstract/exmo.js +0 -6
- package/js/src/abstract/fmfwio.js +0 -6
- package/js/src/abstract/foxbit.js +0 -6
- package/js/src/abstract/gate.js +0 -6
- package/js/src/abstract/gateio.js +0 -6
- package/js/src/abstract/gemini.js +0 -6
- package/js/src/abstract/hashkey.js +0 -6
- package/js/src/abstract/hibachi.js +0 -6
- package/js/src/abstract/hitbtc.js +0 -6
- package/js/src/abstract/hollaex.js +0 -6
- package/js/src/abstract/htx.js +0 -6
- package/js/src/abstract/huobi.js +0 -6
- package/js/src/abstract/hyperliquid.js +0 -6
- package/js/src/abstract/independentreserve.js +0 -6
- package/js/src/abstract/indodax.js +0 -6
- package/js/src/abstract/kraken.js +0 -6
- package/js/src/abstract/krakenfutures.js +0 -6
- package/js/src/abstract/kucoin.js +0 -6
- package/js/src/abstract/kucoinfutures.js +0 -6
- package/js/src/abstract/latoken.js +0 -6
- package/js/src/abstract/lbank.js +0 -6
- package/js/src/abstract/luno.js +0 -6
- package/js/src/abstract/mercado.js +0 -6
- package/js/src/abstract/mexc.js +0 -6
- package/js/src/abstract/modetrade.js +0 -6
- package/js/src/abstract/myokx.js +0 -6
- package/js/src/abstract/ndax.js +0 -6
- package/js/src/abstract/novadax.js +0 -6
- package/js/src/abstract/oceanex.js +0 -6
- package/js/src/abstract/okx.js +0 -6
- package/js/src/abstract/okxus.js +0 -6
- package/js/src/abstract/onetrading.js +0 -6
- package/js/src/abstract/oxfun.js +0 -6
- package/js/src/abstract/p2b.js +0 -6
- package/js/src/abstract/paradex.js +0 -6
- package/js/src/abstract/paymium.js +0 -6
- package/js/src/abstract/phemex.js +0 -6
- package/js/src/abstract/poloniex.js +0 -6
- package/js/src/abstract/probit.js +0 -6
- package/js/src/abstract/timex.js +0 -6
- package/js/src/abstract/tokocrypto.js +0 -6
- package/js/src/abstract/toobit.js +0 -6
- package/js/src/abstract/upbit.js +0 -6
- package/js/src/abstract/wavesexchange.js +0 -6
- package/js/src/abstract/whitebit.js +0 -6
- package/js/src/abstract/woo.js +0 -6
- package/js/src/abstract/woofipro.js +0 -6
- package/js/src/abstract/xt.js +0 -6
- package/js/src/abstract/yobit.js +0 -6
- package/js/src/abstract/zaif.js +0 -6
- package/js/src/abstract/zonda.js +0 -6
- package/js/src/alpaca.js +0 -6
- package/js/src/apex.js +0 -6
- package/js/src/arkham.d.ts +358 -0
- package/js/src/arkham.js +2455 -0
- package/js/src/ascendex.js +0 -6
- package/js/src/backpack.js +0 -6
- package/js/src/base/Exchange.js +0 -6
- package/js/src/base/Precise.js +0 -6
- package/js/src/base/errorHierarchy.js +0 -6
- package/js/src/base/errors.js +0 -6
- package/js/src/base/functions/crypto.js +0 -6
- package/js/src/base/functions/encode.js +0 -6
- package/js/src/base/functions/generic.js +0 -6
- package/js/src/base/functions/misc.js +0 -6
- package/js/src/base/functions/number.js +0 -6
- package/js/src/base/functions/platform.js +0 -6
- package/js/src/base/functions/rsa.js +0 -6
- package/js/src/base/functions/string.js +0 -6
- package/js/src/base/functions/throttle.js +0 -6
- package/js/src/base/functions/time.js +0 -6
- package/js/src/base/functions/totp.js +0 -6
- package/js/src/base/functions/type.js +0 -6
- package/js/src/base/functions.js +0 -6
- package/js/src/base/types.js +0 -6
- package/js/src/base/ws/Cache.js +0 -6
- package/js/src/base/ws/Client.js +0 -6
- package/js/src/base/ws/Future.js +0 -6
- package/js/src/base/ws/OrderBook.js +0 -6
- package/js/src/base/ws/OrderBookSide.js +0 -6
- package/js/src/base/ws/WsClient.js +0 -6
- package/js/src/base/ws/functions.js +0 -6
- package/js/src/bequant.js +0 -6
- package/js/src/bigone.js +0 -6
- package/js/src/binance.js +0 -6
- package/js/src/binancecoinm.js +0 -6
- package/js/src/binanceus.js +0 -6
- package/js/src/binanceusdm.js +0 -6
- package/js/src/bingx.js +0 -6
- package/js/src/bit2c.js +0 -6
- package/js/src/bitbank.js +0 -6
- package/js/src/bitbns.js +0 -6
- package/js/src/bitfinex.js +0 -6
- package/js/src/bitflyer.js +0 -6
- package/js/src/bitget.js +0 -6
- package/js/src/bithumb.js +0 -6
- package/js/src/bitmart.js +16 -15
- package/js/src/bitmex.js +0 -6
- package/js/src/bitopro.js +0 -6
- package/js/src/bitrue.js +0 -6
- package/js/src/bitso.js +0 -6
- package/js/src/bitstamp.js +0 -6
- package/js/src/bitteam.js +0 -6
- package/js/src/bittrade.js +0 -6
- package/js/src/bitvavo.js +0 -6
- package/js/src/blockchaincom.js +0 -6
- package/js/src/blofin.js +0 -6
- package/js/src/btcalpha.js +0 -6
- package/js/src/btcbox.js +0 -6
- package/js/src/btcmarkets.js +0 -6
- package/js/src/btcturk.js +0 -6
- package/js/src/bybit.js +8 -6
- package/js/src/cex.js +0 -6
- package/js/src/coinbase.js +0 -6
- package/js/src/coinbaseadvanced.js +0 -6
- package/js/src/coinbaseexchange.js +0 -6
- package/js/src/coinbaseinternational.js +0 -6
- package/js/src/coincatch.js +0 -6
- package/js/src/coincheck.js +0 -6
- package/js/src/coinex.js +0 -6
- package/js/src/coinmate.js +0 -6
- package/js/src/coinmetro.js +0 -6
- package/js/src/coinone.js +0 -6
- package/js/src/coinsph.js +0 -6
- package/js/src/coinspot.js +0 -6
- package/js/src/cryptocom.js +0 -6
- package/js/src/cryptomus.js +0 -6
- package/js/src/defx.js +3 -8
- package/js/src/delta.js +0 -6
- package/js/src/deribit.js +0 -6
- package/js/src/derive.js +0 -6
- package/js/src/digifinex.js +0 -6
- package/js/src/exmo.js +0 -6
- package/js/src/fmfwio.js +0 -6
- package/js/src/foxbit.js +0 -6
- package/js/src/gate.js +0 -6
- package/js/src/gateio.js +0 -6
- package/js/src/gemini.js +0 -6
- package/js/src/hashkey.js +0 -6
- package/js/src/hibachi.js +3 -9
- package/js/src/hitbtc.js +0 -6
- package/js/src/hollaex.js +0 -6
- package/js/src/htx.js +0 -6
- package/js/src/huobi.js +0 -6
- package/js/src/hyperliquid.js +50 -17
- package/js/src/independentreserve.js +0 -6
- package/js/src/indodax.js +0 -6
- package/js/src/kraken.js +0 -6
- package/js/src/krakenfutures.js +45 -39
- package/js/src/kucoin.js +0 -6
- package/js/src/kucoinfutures.js +0 -6
- package/js/src/latoken.js +0 -6
- package/js/src/lbank.js +0 -6
- package/js/src/luno.js +0 -6
- package/js/src/mercado.js +0 -6
- package/js/src/mexc.js +0 -6
- package/js/src/modetrade.js +0 -6
- package/js/src/myokx.js +0 -6
- package/js/src/ndax.js +0 -6
- package/js/src/novadax.js +0 -6
- package/js/src/oceanex.js +0 -6
- package/js/src/okx.js +9 -7
- package/js/src/okxus.js +0 -6
- package/js/src/onetrading.js +0 -6
- package/js/src/oxfun.js +0 -6
- package/js/src/p2b.js +0 -6
- package/js/src/paradex.js +0 -6
- package/js/src/paymium.js +0 -6
- package/js/src/phemex.js +0 -6
- package/js/src/poloniex.js +0 -6
- package/js/src/pro/alpaca.js +0 -6
- package/js/src/pro/apex.js +0 -6
- package/js/src/pro/arkham.d.ts +105 -0
- package/js/src/pro/arkham.js +708 -0
- package/js/src/pro/ascendex.js +0 -6
- package/js/src/pro/backpack.js +0 -6
- package/js/src/pro/bequant.js +0 -6
- package/js/src/pro/binance.js +0 -6
- package/js/src/pro/binancecoinm.js +0 -6
- package/js/src/pro/binanceus.js +0 -6
- package/js/src/pro/binanceusdm.js +0 -6
- package/js/src/pro/bingx.js +0 -6
- package/js/src/pro/bitfinex.js +0 -6
- package/js/src/pro/bitget.js +0 -6
- package/js/src/pro/bithumb.d.ts +28 -1
- package/js/src/pro/bithumb.js +263 -13
- package/js/src/pro/bitmart.js +0 -6
- package/js/src/pro/bitmex.js +0 -6
- package/js/src/pro/bitopro.js +0 -6
- package/js/src/pro/bitrue.js +0 -6
- package/js/src/pro/bitstamp.js +0 -6
- package/js/src/pro/bittrade.js +0 -6
- package/js/src/pro/bitvavo.js +0 -6
- package/js/src/pro/blockchaincom.js +0 -6
- package/js/src/pro/blofin.js +0 -6
- package/js/src/pro/bybit.js +0 -6
- package/js/src/pro/cex.js +0 -6
- package/js/src/pro/coinbase.js +0 -6
- package/js/src/pro/coinbaseadvanced.js +0 -6
- package/js/src/pro/coinbaseexchange.js +0 -6
- package/js/src/pro/coinbaseinternational.js +0 -6
- package/js/src/pro/coincatch.js +0 -6
- package/js/src/pro/coincheck.js +0 -6
- package/js/src/pro/coinex.js +0 -6
- package/js/src/pro/coinone.js +0 -6
- package/js/src/pro/cryptocom.js +0 -6
- package/js/src/pro/defx.js +0 -6
- package/js/src/pro/deribit.js +2 -7
- package/js/src/pro/derive.js +0 -6
- package/js/src/pro/exmo.js +0 -6
- package/js/src/pro/gate.js +0 -6
- package/js/src/pro/gateio.js +0 -6
- package/js/src/pro/gemini.js +0 -6
- package/js/src/pro/hashkey.js +0 -6
- package/js/src/pro/hitbtc.js +0 -6
- package/js/src/pro/hollaex.js +0 -6
- package/js/src/pro/htx.js +0 -6
- package/js/src/pro/huobi.js +0 -6
- package/js/src/pro/hyperliquid.js +0 -6
- package/js/src/pro/independentreserve.js +0 -6
- package/js/src/pro/kraken.js +0 -6
- package/js/src/pro/krakenfutures.js +0 -6
- package/js/src/pro/kucoin.js +0 -6
- package/js/src/pro/kucoinfutures.js +0 -6
- package/js/src/pro/lbank.js +0 -6
- package/js/src/pro/luno.js +0 -6
- package/js/src/pro/mexc.js +0 -6
- package/js/src/pro/modetrade.js +0 -6
- package/js/src/pro/myokx.js +0 -6
- package/js/src/pro/ndax.js +0 -6
- package/js/src/pro/okx.js +0 -6
- package/js/src/pro/okxus.js +0 -6
- package/js/src/pro/onetrading.js +0 -6
- package/js/src/pro/oxfun.js +0 -6
- package/js/src/pro/p2b.js +0 -6
- package/js/src/pro/paradex.js +0 -6
- package/js/src/pro/phemex.js +0 -6
- package/js/src/pro/poloniex.js +0 -6
- package/js/src/pro/probit.js +0 -6
- package/js/src/pro/toobit.js +3 -8
- package/js/src/pro/upbit.js +1 -7
- package/js/src/pro/whitebit.js +0 -6
- package/js/src/pro/woo.js +0 -6
- package/js/src/pro/woofipro.js +0 -6
- package/js/src/pro/xt.js +0 -6
- package/js/src/probit.js +0 -6
- package/js/src/protobuf/mexc/compiled.cjs +0 -6
- package/js/src/static_dependencies/ethers/abi-coder.js +0 -6
- package/js/src/static_dependencies/ethers/address/address.js +0 -6
- package/js/src/static_dependencies/ethers/address/checks.js +0 -6
- package/js/src/static_dependencies/ethers/address/contract-address.js +0 -6
- package/js/src/static_dependencies/ethers/address/index.js +0 -6
- package/js/src/static_dependencies/ethers/bytes32.js +0 -6
- package/js/src/static_dependencies/ethers/coders/abstract-coder.js +0 -6
- package/js/src/static_dependencies/ethers/coders/address.js +0 -6
- package/js/src/static_dependencies/ethers/coders/anonymous.js +0 -6
- package/js/src/static_dependencies/ethers/coders/array.js +0 -6
- package/js/src/static_dependencies/ethers/coders/boolean.js +0 -6
- package/js/src/static_dependencies/ethers/coders/bytes.js +0 -6
- package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +0 -6
- package/js/src/static_dependencies/ethers/coders/null.js +0 -6
- package/js/src/static_dependencies/ethers/coders/number.js +0 -6
- package/js/src/static_dependencies/ethers/coders/string.js +0 -6
- package/js/src/static_dependencies/ethers/coders/tuple.js +0 -6
- package/js/src/static_dependencies/ethers/fragments.js +0 -6
- package/js/src/static_dependencies/ethers/hash/index.js +0 -6
- package/js/src/static_dependencies/ethers/hash/solidity.js +0 -6
- package/js/src/static_dependencies/ethers/hash/typed-data.js +0 -6
- package/js/src/static_dependencies/ethers/index.js +0 -6
- package/js/src/static_dependencies/ethers/interface.js +0 -6
- package/js/src/static_dependencies/ethers/typed.js +0 -6
- package/js/src/static_dependencies/ethers/utils/base58.js +0 -6
- package/js/src/static_dependencies/ethers/utils/base64-browser.js +0 -6
- package/js/src/static_dependencies/ethers/utils/base64.js +0 -6
- package/js/src/static_dependencies/ethers/utils/data.js +0 -6
- package/js/src/static_dependencies/ethers/utils/errors.js +0 -6
- package/js/src/static_dependencies/ethers/utils/events.js +0 -6
- package/js/src/static_dependencies/ethers/utils/fixednumber.js +0 -6
- package/js/src/static_dependencies/ethers/utils/index.js +0 -6
- package/js/src/static_dependencies/ethers/utils/maths.js +0 -6
- package/js/src/static_dependencies/ethers/utils/properties.js +0 -6
- package/js/src/static_dependencies/ethers/utils/rlp-decode.js +0 -6
- package/js/src/static_dependencies/ethers/utils/rlp-encode.js +0 -6
- package/js/src/static_dependencies/ethers/utils/rlp.js +0 -6
- package/js/src/static_dependencies/ethers/utils/units.js +0 -6
- package/js/src/static_dependencies/ethers/utils/utf8.js +0 -6
- package/js/src/static_dependencies/ethers/utils/uuid.js +0 -6
- package/js/src/static_dependencies/fflake/browser.js +0 -6
- package/js/src/static_dependencies/jsencrypt/JSEncrypt.js +0 -6
- package/js/src/static_dependencies/jsencrypt/JSEncryptRSAKey.js +0 -6
- package/js/src/static_dependencies/jsencrypt/index.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/asn1js/base64.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/asn1js/hex.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/asn1js/int10.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/asn1js/oids.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/base64.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/prng4.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/rng.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/rsa.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/util.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/asn1-1.0.js +0 -6
- package/js/src/static_dependencies/jsencrypt/lib/jsrsasign/yahoo.js +0 -6
- package/js/src/static_dependencies/messagepack/msgpack.js +0 -6
- package/js/src/static_dependencies/noble-curves/_shortw_utils.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/curve.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/edwards.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/hash-to-curve.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/modular.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/montgomery.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/poseidon.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/utils.js +0 -6
- package/js/src/static_dependencies/noble-curves/abstract/weierstrass.js +0 -6
- package/js/src/static_dependencies/noble-curves/bn.js +0 -6
- package/js/src/static_dependencies/noble-curves/ed25519.js +0 -6
- package/js/src/static_dependencies/noble-curves/ed448.js +0 -6
- package/js/src/static_dependencies/noble-curves/index.js +0 -6
- package/js/src/static_dependencies/noble-curves/jubjub.js +0 -6
- package/js/src/static_dependencies/noble-curves/p256.js +0 -6
- package/js/src/static_dependencies/noble-curves/p384.js +0 -6
- package/js/src/static_dependencies/noble-curves/p521.js +0 -6
- package/js/src/static_dependencies/noble-curves/pasta.js +0 -6
- package/js/src/static_dependencies/noble-curves/secp256k1.js +0 -6
- package/js/src/static_dependencies/noble-hashes/_assert.js +0 -6
- package/js/src/static_dependencies/noble-hashes/_blake2.js +0 -6
- package/js/src/static_dependencies/noble-hashes/_sha2.js +0 -6
- package/js/src/static_dependencies/noble-hashes/_u64.js +0 -6
- package/js/src/static_dependencies/noble-hashes/argon2.js +0 -6
- package/js/src/static_dependencies/noble-hashes/blake2b.js +0 -6
- package/js/src/static_dependencies/noble-hashes/blake2s.js +0 -6
- package/js/src/static_dependencies/noble-hashes/blake3.js +0 -6
- package/js/src/static_dependencies/noble-hashes/crypto.js +0 -6
- package/js/src/static_dependencies/noble-hashes/cryptoNode.js +0 -6
- package/js/src/static_dependencies/noble-hashes/eskdf.js +0 -6
- package/js/src/static_dependencies/noble-hashes/hkdf.js +0 -6
- package/js/src/static_dependencies/noble-hashes/hmac.js +0 -6
- package/js/src/static_dependencies/noble-hashes/index.js +0 -6
- package/js/src/static_dependencies/noble-hashes/md5.js +0 -6
- package/js/src/static_dependencies/noble-hashes/pbkdf2.js +0 -6
- package/js/src/static_dependencies/noble-hashes/ripemd160.js +0 -6
- package/js/src/static_dependencies/noble-hashes/scrypt.js +0 -6
- package/js/src/static_dependencies/noble-hashes/sha1.js +0 -6
- package/js/src/static_dependencies/noble-hashes/sha256.js +0 -6
- package/js/src/static_dependencies/noble-hashes/sha3-addons.js +0 -6
- package/js/src/static_dependencies/noble-hashes/sha3.js +0 -6
- package/js/src/static_dependencies/noble-hashes/sha512.js +0 -6
- package/js/src/static_dependencies/noble-hashes/utils.js +0 -6
- package/js/src/static_dependencies/node-fetch/body.js +0 -6
- package/js/src/static_dependencies/node-fetch/errors/abort-error.js +0 -6
- package/js/src/static_dependencies/node-fetch/errors/base.js +0 -6
- package/js/src/static_dependencies/node-fetch/errors/fetch-error.js +0 -6
- package/js/src/static_dependencies/node-fetch/headers.js +0 -6
- package/js/src/static_dependencies/node-fetch/index.js +0 -6
- package/js/src/static_dependencies/node-fetch/request.js +0 -6
- package/js/src/static_dependencies/node-fetch/response.js +0 -6
- package/js/src/static_dependencies/node-fetch/utils/get-search.js +0 -6
- package/js/src/static_dependencies/node-fetch/utils/is-redirect.js +0 -6
- package/js/src/static_dependencies/node-fetch/utils/is.js +0 -6
- package/js/src/static_dependencies/node-fetch/utils/referrer.js +0 -6
- package/js/src/static_dependencies/proxies/agent-base/helpers.js +0 -6
- package/js/src/static_dependencies/proxies/agent-base/index.js +0 -6
- package/js/src/static_dependencies/proxies/http-proxy-agent/index.js +0 -6
- package/js/src/static_dependencies/proxies/https-proxy-agent/index.js +0 -6
- package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.js +0 -6
- package/js/src/static_dependencies/qs/formats.js +0 -6
- package/js/src/static_dependencies/qs/index.js +0 -6
- package/js/src/static_dependencies/qs/parse.js +0 -6
- package/js/src/static_dependencies/qs/stringify.js +0 -6
- package/js/src/static_dependencies/qs/utils.js +0 -6
- package/js/src/static_dependencies/scure-base/index.js +0 -6
- package/js/src/static_dependencies/scure-starknet/index.js +0 -6
- package/js/src/static_dependencies/starknet/constants.js +0 -6
- package/js/src/static_dependencies/starknet/index.js +0 -6
- package/js/src/static_dependencies/starknet/types/cairoEnum.js +0 -6
- package/js/src/static_dependencies/starknet/types/calldata.js +0 -6
- package/js/src/static_dependencies/starknet/types/index.js +0 -6
- package/js/src/static_dependencies/starknet/types/lib/contract/abi.js +0 -6
- package/js/src/static_dependencies/starknet/types/lib/contract/index.js +0 -6
- package/js/src/static_dependencies/starknet/types/lib/contract/legacy.js +0 -6
- package/js/src/static_dependencies/starknet/types/lib/contract/sierra.js +0 -6
- package/js/src/static_dependencies/starknet/types/lib/index.js +0 -6
- package/js/src/static_dependencies/starknet/types/typedData.js +0 -6
- package/js/src/static_dependencies/starknet/utils/address.js +0 -6
- package/js/src/static_dependencies/starknet/utils/assert.js +0 -6
- package/js/src/static_dependencies/starknet/utils/cairoDataTypes/felt.js +0 -6
- package/js/src/static_dependencies/starknet/utils/cairoDataTypes/uint256.js +0 -6
- package/js/src/static_dependencies/starknet/utils/cairoDataTypes/uint512.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/byteArray.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/cairo.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/enum/CairoCustomEnum.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/enum/CairoOption.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/enum/CairoResult.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/enum/index.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/formatter.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/index.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/parser/interface.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/parser/parser-0-1.1.0.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/parser/parser-2.0.0.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/propertyOrder.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/requestParser.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/responseParser.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/tuple.js +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/validate.js +0 -6
- package/js/src/static_dependencies/starknet/utils/encode.js +0 -6
- package/js/src/static_dependencies/starknet/utils/hash/classHash.js +0 -6
- package/js/src/static_dependencies/starknet/utils/hash/index.js +0 -6
- package/js/src/static_dependencies/starknet/utils/merkle.js +0 -6
- package/js/src/static_dependencies/starknet/utils/num.js +0 -6
- package/js/src/static_dependencies/starknet/utils/selector.js +0 -6
- package/js/src/static_dependencies/starknet/utils/shortString.js +0 -6
- package/js/src/static_dependencies/starknet/utils/starknetId.js +0 -6
- package/js/src/static_dependencies/starknet/utils/typedData.js +0 -6
- package/js/src/static_dependencies/starknet/utils/uint256.js +0 -6
- package/js/src/static_dependencies/starknet/utils/url.js +0 -6
- package/js/src/static_dependencies/watchable/src/index.js +0 -6
- package/js/src/static_dependencies/watchable/src/types.js +0 -6
- package/js/src/static_dependencies/watchable/src/unpromise.js +0 -6
- package/js/src/static_dependencies/zklink/zklink-sdk-web.js +0 -6
- package/js/src/timex.js +0 -6
- package/js/src/tokocrypto.js +0 -6
- package/js/src/toobit.js +0 -6
- package/js/src/upbit.js +0 -6
- package/js/src/wavesexchange.js +0 -6
- package/js/src/whitebit.js +0 -6
- package/js/src/woo.js +0 -6
- package/js/src/woofipro.js +0 -6
- package/js/src/xt.js +0 -6
- package/js/src/yobit.js +0 -6
- package/js/src/zaif.js +0 -6
- package/js/src/zonda.js +0 -6
- package/package.json +1 -1
|
@@ -0,0 +1,2462 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var arkham$1 = require('./abstract/arkham.js');
|
|
6
|
+
var Precise = require('./base/Precise.js');
|
|
7
|
+
var errors = require('./base/errors.js');
|
|
8
|
+
var number = require('./base/functions/number.js');
|
|
9
|
+
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
/**
|
|
13
|
+
* @class arkham
|
|
14
|
+
* @augments Exchange
|
|
15
|
+
*/
|
|
16
|
+
class arkham extends arkham$1["default"] {
|
|
17
|
+
describe() {
|
|
18
|
+
return this.deepExtend(super.describe(), {
|
|
19
|
+
'id': 'arkham',
|
|
20
|
+
'name': 'ARKHAM',
|
|
21
|
+
'countries': ['US'],
|
|
22
|
+
'version': 'v1',
|
|
23
|
+
'rateLimit': 20 / 3,
|
|
24
|
+
'certified': false,
|
|
25
|
+
'pro': false,
|
|
26
|
+
'has': {
|
|
27
|
+
'CORS': false,
|
|
28
|
+
'spot': true,
|
|
29
|
+
'margin': false,
|
|
30
|
+
'swap': true,
|
|
31
|
+
'future': false,
|
|
32
|
+
'option': false,
|
|
33
|
+
'cancelAllOrders': true,
|
|
34
|
+
'cancelOrder': true,
|
|
35
|
+
'createDepositAddress': true,
|
|
36
|
+
'createOrder': true,
|
|
37
|
+
'fetchAccounts': true,
|
|
38
|
+
'fetchBalance': true,
|
|
39
|
+
'fetchClosedOrders': true,
|
|
40
|
+
'fetchCurrencies': true,
|
|
41
|
+
'fetchDepositAddress': false,
|
|
42
|
+
'fetchDepositAddressesByNetwork': true,
|
|
43
|
+
'fetchDeposits': true,
|
|
44
|
+
'fetchFundingHistory': true,
|
|
45
|
+
'fetchLeverage': true,
|
|
46
|
+
'fetchLeverageTiers': true,
|
|
47
|
+
'fetchMyTrades': true,
|
|
48
|
+
'fetchOHLCV': true,
|
|
49
|
+
'fetchOpenOrders': true,
|
|
50
|
+
'fetchOrder': true,
|
|
51
|
+
'fetchOrderBook': true,
|
|
52
|
+
'fetchPositions': true,
|
|
53
|
+
'fetchTicker': true,
|
|
54
|
+
'fetchTickers': true,
|
|
55
|
+
'fetchTime': true,
|
|
56
|
+
'fetchTrades': true,
|
|
57
|
+
'fetchTradingFees': true,
|
|
58
|
+
'fetchWithdrawals': true,
|
|
59
|
+
'sandbox': false,
|
|
60
|
+
'setLeverage': true,
|
|
61
|
+
'withdraw': true,
|
|
62
|
+
},
|
|
63
|
+
'timeframes': {
|
|
64
|
+
// enums are wrong in DOCS, these string values need to be in request
|
|
65
|
+
'1m': '1m',
|
|
66
|
+
'5m': '5m',
|
|
67
|
+
'15m': '15m',
|
|
68
|
+
'30m': '30m',
|
|
69
|
+
'1h': '1h',
|
|
70
|
+
'6h': '6h',
|
|
71
|
+
'1d': '24h',
|
|
72
|
+
},
|
|
73
|
+
'urls': {
|
|
74
|
+
'logo': '',
|
|
75
|
+
'api': {
|
|
76
|
+
'v1': 'https://arkm.com/api',
|
|
77
|
+
},
|
|
78
|
+
'www': 'https://arkm.com/',
|
|
79
|
+
'referral': {
|
|
80
|
+
'url': 'https://arkm.com/register?ref=ccxt',
|
|
81
|
+
'discount': 0,
|
|
82
|
+
},
|
|
83
|
+
'doc': [
|
|
84
|
+
'https://arkm.com/limits-api',
|
|
85
|
+
'https://info.arkm.com/api-platform',
|
|
86
|
+
],
|
|
87
|
+
'fees': 'https://arkm.com/fees',
|
|
88
|
+
},
|
|
89
|
+
'api': {
|
|
90
|
+
'v1': {
|
|
91
|
+
'public': {
|
|
92
|
+
'get': {
|
|
93
|
+
'alerts': 1,
|
|
94
|
+
'announcements': 1,
|
|
95
|
+
'assets': 1,
|
|
96
|
+
'book': 1,
|
|
97
|
+
'candles': 1,
|
|
98
|
+
'chains': 1,
|
|
99
|
+
'contracts': 1,
|
|
100
|
+
'index-price': 1,
|
|
101
|
+
'index-prices': 1,
|
|
102
|
+
'margin-schedules': 1,
|
|
103
|
+
'marketcapchart': 1,
|
|
104
|
+
'marketcaps': 1,
|
|
105
|
+
'pair': 1,
|
|
106
|
+
'pairs': 1,
|
|
107
|
+
'server-time': 1,
|
|
108
|
+
'ticker': 1,
|
|
109
|
+
'tickers': 1,
|
|
110
|
+
'trades': 1,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
'private': {
|
|
114
|
+
// for orders: spot 20/s, todo: perp 40/s
|
|
115
|
+
'get': {
|
|
116
|
+
'user': 7.5,
|
|
117
|
+
'orders': 7.5,
|
|
118
|
+
'orders/by-client-order-id': 7.5,
|
|
119
|
+
'orders/history': 7.5,
|
|
120
|
+
'orders/history/by-client-order-id': 7.5,
|
|
121
|
+
'orders/history_offset': 7.5,
|
|
122
|
+
'orders/{id}': 7.5,
|
|
123
|
+
'trades': 7.5,
|
|
124
|
+
'trades/history': 7.5,
|
|
125
|
+
'trades/time': 7.5,
|
|
126
|
+
'trigger-orders': 7.5,
|
|
127
|
+
'account/airdrops': 7.5,
|
|
128
|
+
'account/balance-updates': 7.5,
|
|
129
|
+
'account/balances': 7.5,
|
|
130
|
+
'account/balances/ll': 7.5,
|
|
131
|
+
'account/balances/history': 7.5,
|
|
132
|
+
'account/balances/commissions': 7.5,
|
|
133
|
+
'account/deposit/addresses': 7.5,
|
|
134
|
+
'account/deposits': 7.5,
|
|
135
|
+
'account/fees': 7.5,
|
|
136
|
+
'account/funding-rate-payments': 7.5,
|
|
137
|
+
'account/leverage': 7.5,
|
|
138
|
+
'account/lsp-assignments': 7.5,
|
|
139
|
+
'account/margin': 7.5,
|
|
140
|
+
'account/margin/all': 7.5,
|
|
141
|
+
'account/notifications': 7.5,
|
|
142
|
+
'account/position-updates': 7.5,
|
|
143
|
+
'account/positions': 7.5,
|
|
144
|
+
'account/realized-pnl': 7.5,
|
|
145
|
+
'account/rebates': 7.5,
|
|
146
|
+
'account/referral-links': 7.5,
|
|
147
|
+
'account/sessions': 7.5,
|
|
148
|
+
'account/settings': 7.5,
|
|
149
|
+
'account/settings/price-alert': 7.5,
|
|
150
|
+
'account/transfers': 7.5,
|
|
151
|
+
'account/unsubscribe': 7.5,
|
|
152
|
+
'account/watchlist': 7.5,
|
|
153
|
+
'account/withdrawal/addresses': 7.5,
|
|
154
|
+
'account/withdrawal/addresses/{id}': 7.5,
|
|
155
|
+
'account/withdrawals': 7.5,
|
|
156
|
+
'subaccounts': 7.5,
|
|
157
|
+
'airdrop': 7.5,
|
|
158
|
+
'airdrop/claim': 7.5,
|
|
159
|
+
'affiliate-dashboard/commission-earned': 7.5,
|
|
160
|
+
'affiliate-dashboard/min-arkm-last-30d': 7.5,
|
|
161
|
+
'affiliate-dashboard/points': 7.5,
|
|
162
|
+
'affiliate-dashboard/points-season-1': 7.5,
|
|
163
|
+
'affiliate-dashboard/points-season-2': 7.5,
|
|
164
|
+
'affiliate-dashboard/realized-pnl': 7.5,
|
|
165
|
+
'affiliate-dashboard/rebate-balance': 7.5,
|
|
166
|
+
'affiliate-dashboard/referral-count': 7.5,
|
|
167
|
+
'affiliate-dashboard/referrals-season-1': 7.5,
|
|
168
|
+
'affiliate-dashboard/referrals-season-2': 7.5,
|
|
169
|
+
'affiliate-dashboard/trading-volume-stats': 7.5,
|
|
170
|
+
'affiliate-dashboard/volume-season-1': 7.5,
|
|
171
|
+
'affiliate-dashboard/volume-season-2': 7.5,
|
|
172
|
+
'affiliate-dashboard/api-key': 7.5,
|
|
173
|
+
'competitions/opt-in-status': 7.5,
|
|
174
|
+
'rewards/info': 7.5,
|
|
175
|
+
'rewards/vouchers': 7.5,
|
|
176
|
+
},
|
|
177
|
+
'post': {
|
|
178
|
+
'orders/new': 7.5,
|
|
179
|
+
'trigger-orders/new': 7.5,
|
|
180
|
+
'orders/cancel': 7.5,
|
|
181
|
+
'trigger-orders/cancel': 7.5,
|
|
182
|
+
'orders/cancel/all': 7.5,
|
|
183
|
+
'trigger-orders/cancel/all': 7.5,
|
|
184
|
+
'orders/new/simple': 7.5,
|
|
185
|
+
'account/deposit/addresses/new': 7.5,
|
|
186
|
+
'account/leverage': 7.5,
|
|
187
|
+
'account/notifications/read': 7.5,
|
|
188
|
+
'account/referral-links': 7.5,
|
|
189
|
+
'account/sessions/delete': 7.5,
|
|
190
|
+
'account/sessions/terminate-all': 7.5,
|
|
191
|
+
'account/settings/update': 7.5,
|
|
192
|
+
'account/watchlist/add': 7.5,
|
|
193
|
+
'account/watchlist/remove': 7.5,
|
|
194
|
+
'account/withdraw': 7.5,
|
|
195
|
+
'account/withdrawal/addresses/confirm': 7.5,
|
|
196
|
+
'subaccounts': 7.5,
|
|
197
|
+
'subaccounts/transfer': 7.5,
|
|
198
|
+
'subaccounts/perp-transfer': 7.5,
|
|
199
|
+
'subaccounts/update-settings': 7.5,
|
|
200
|
+
'airdrop': 7.5,
|
|
201
|
+
'api-key/create': 7.5,
|
|
202
|
+
'authenticate': 7.5,
|
|
203
|
+
'competitions/opt-in': 7.5,
|
|
204
|
+
'rewards/vouchers/claim': 7.5,
|
|
205
|
+
},
|
|
206
|
+
'put': {
|
|
207
|
+
'account/referral-links/{id}/slug': 7.5,
|
|
208
|
+
'account/settings/price-alert': 7.5,
|
|
209
|
+
'account/withdrawal/addresses/{id}': 7.5,
|
|
210
|
+
'subaccounts': 7.5,
|
|
211
|
+
'api-key/update/{id}': 7.5,
|
|
212
|
+
},
|
|
213
|
+
'delete': {
|
|
214
|
+
'account/settings/price-alert': 7.5,
|
|
215
|
+
'account/withdrawal/addresses/{id}': 7.5,
|
|
216
|
+
'subaccounts/{subaccountId}': 7.5,
|
|
217
|
+
'api-key/{id}': 7.5,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
'options': {
|
|
223
|
+
'networks': {
|
|
224
|
+
'ETH': 'ETH',
|
|
225
|
+
'ERC20': 'ETH',
|
|
226
|
+
'BTC': 'BTC',
|
|
227
|
+
'SOL': 'SOL',
|
|
228
|
+
'TON': 'TON',
|
|
229
|
+
'DOGE': 'DOGE',
|
|
230
|
+
'SUI': 'SUI',
|
|
231
|
+
'XRP': 'XRP',
|
|
232
|
+
'OP': 'OP',
|
|
233
|
+
'AVAXC': 'AVAX',
|
|
234
|
+
'ARBONE': 'ARB',
|
|
235
|
+
},
|
|
236
|
+
'networksById': {
|
|
237
|
+
'ETH': 'ERC20',
|
|
238
|
+
'ERC20': 'ERC20',
|
|
239
|
+
},
|
|
240
|
+
'requestExpiration': 5000,
|
|
241
|
+
'timeframeDurations': {
|
|
242
|
+
'1m': 60000000,
|
|
243
|
+
'5m': 300000000,
|
|
244
|
+
'15m': 900000000,
|
|
245
|
+
'30m': 1800000000,
|
|
246
|
+
'1h': 3600000000,
|
|
247
|
+
'6h': 21600000000,
|
|
248
|
+
'1d': 86400000000,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
'features': {
|
|
252
|
+
'default': {
|
|
253
|
+
'sandbox': false,
|
|
254
|
+
'createOrder': {
|
|
255
|
+
'marginMode': false,
|
|
256
|
+
'triggerPrice': true,
|
|
257
|
+
'triggerPriceType': {
|
|
258
|
+
'mark': true,
|
|
259
|
+
'index': true,
|
|
260
|
+
'last': true,
|
|
261
|
+
},
|
|
262
|
+
'triggerDirection': true,
|
|
263
|
+
'stopLossPrice': true,
|
|
264
|
+
'takeProfitPrice': true,
|
|
265
|
+
'attachedStopLossTakeProfit': undefined,
|
|
266
|
+
'timeInForce': {
|
|
267
|
+
'IOC': true,
|
|
268
|
+
'FOK': true,
|
|
269
|
+
'PO': true,
|
|
270
|
+
'GTD': false,
|
|
271
|
+
},
|
|
272
|
+
'hedged': false,
|
|
273
|
+
'selfTradePrevention': false,
|
|
274
|
+
'trailing': false,
|
|
275
|
+
'iceberg': false,
|
|
276
|
+
'leverage': false,
|
|
277
|
+
'marketBuyByCost': false,
|
|
278
|
+
'marketBuyRequiresPrice': false,
|
|
279
|
+
},
|
|
280
|
+
'createOrders': undefined,
|
|
281
|
+
'fetchMyTrades': {
|
|
282
|
+
'marginMode': false,
|
|
283
|
+
'limit': 100,
|
|
284
|
+
'daysBack': undefined,
|
|
285
|
+
'untilDays': 1,
|
|
286
|
+
'symbolRequired': false,
|
|
287
|
+
},
|
|
288
|
+
'fetchOrder': {
|
|
289
|
+
'marginMode': false,
|
|
290
|
+
'trigger': false,
|
|
291
|
+
'trailing': false,
|
|
292
|
+
'symbolRequired': false,
|
|
293
|
+
},
|
|
294
|
+
'fetchOpenOrders': {
|
|
295
|
+
'marginMode': true,
|
|
296
|
+
'limit': undefined,
|
|
297
|
+
'trigger': false,
|
|
298
|
+
'trailing': false,
|
|
299
|
+
'symbolRequired': false,
|
|
300
|
+
},
|
|
301
|
+
'fetchOrders': undefined,
|
|
302
|
+
'fetchClosedOrders': {
|
|
303
|
+
'marginMode': false,
|
|
304
|
+
'limit': 100,
|
|
305
|
+
'daysBack': undefined,
|
|
306
|
+
'daysBackCanceled': undefined,
|
|
307
|
+
'untilDays': undefined,
|
|
308
|
+
'trigger': false,
|
|
309
|
+
'trailing': false,
|
|
310
|
+
'symbolRequired': false,
|
|
311
|
+
},
|
|
312
|
+
'fetchOHLCV': {
|
|
313
|
+
'limit': 365,
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
'spot': {
|
|
317
|
+
'extends': 'default',
|
|
318
|
+
},
|
|
319
|
+
'swap': {
|
|
320
|
+
'linear': {
|
|
321
|
+
'extends': 'default',
|
|
322
|
+
},
|
|
323
|
+
'inverse': undefined,
|
|
324
|
+
},
|
|
325
|
+
'future': {
|
|
326
|
+
'linear': {
|
|
327
|
+
'extends': 'default',
|
|
328
|
+
},
|
|
329
|
+
'inverse': undefined,
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
'precisionMode': number.TICK_SIZE,
|
|
333
|
+
'exceptions': {
|
|
334
|
+
'exact': {
|
|
335
|
+
// 1XXXX General Errors
|
|
336
|
+
// These errors can occur for a variety of reasons and may be returned by the API or Websocket on any endpoint.
|
|
337
|
+
'10000': errors.OperationFailed,
|
|
338
|
+
'10001': errors.BadRequest,
|
|
339
|
+
'10002': errors.AuthenticationError,
|
|
340
|
+
'10003': errors.BadSymbol,
|
|
341
|
+
'10004': errors.ArgumentsRequired,
|
|
342
|
+
'10005': errors.RateLimitExceeded,
|
|
343
|
+
'10006': errors.PermissionDenied,
|
|
344
|
+
'10007': errors.PermissionDenied,
|
|
345
|
+
'10008': errors.RateLimitExceeded,
|
|
346
|
+
'10009': errors.PermissionDenied,
|
|
347
|
+
'10010': errors.PermissionDenied,
|
|
348
|
+
'10011': errors.AuthenticationError,
|
|
349
|
+
'10012': errors.PermissionDenied,
|
|
350
|
+
'10013': errors.PermissionDenied,
|
|
351
|
+
'10014': errors.AuthenticationError,
|
|
352
|
+
'10015': errors.PermissionDenied,
|
|
353
|
+
'10016': errors.PermissionDenied,
|
|
354
|
+
'10017': errors.PermissionDenied,
|
|
355
|
+
'10018': errors.AuthenticationError,
|
|
356
|
+
'10019': errors.AuthenticationError,
|
|
357
|
+
'10020': errors.PermissionDenied,
|
|
358
|
+
'10021': errors.PermissionDenied,
|
|
359
|
+
'10022': errors.ExchangeError,
|
|
360
|
+
'10023': errors.BadRequest,
|
|
361
|
+
'10024': errors.ExchangeError,
|
|
362
|
+
'10025': errors.BadRequest,
|
|
363
|
+
// #2XXXX General Websocket Errors
|
|
364
|
+
'20001': errors.BadRequest,
|
|
365
|
+
'20002': errors.ArgumentsRequired,
|
|
366
|
+
'20003': errors.BadRequest,
|
|
367
|
+
'20004': errors.ArgumentsRequired,
|
|
368
|
+
'20005': errors.BadRequest,
|
|
369
|
+
// #3XXXX Trading Errors
|
|
370
|
+
'30001': errors.InvalidOrder,
|
|
371
|
+
'30002': errors.InvalidOrder,
|
|
372
|
+
'30003': errors.InvalidOrder,
|
|
373
|
+
'30004': errors.InvalidOrder,
|
|
374
|
+
'30005': errors.InvalidOrder,
|
|
375
|
+
'30006': errors.InvalidOrder,
|
|
376
|
+
'30007': errors.BadSymbol,
|
|
377
|
+
'30008': errors.OperationRejected,
|
|
378
|
+
'30009': errors.OperationRejected,
|
|
379
|
+
'30010': errors.InsufficientFunds,
|
|
380
|
+
'30011': errors.BadSymbol,
|
|
381
|
+
'30012': errors.OperationRejected,
|
|
382
|
+
'30013': errors.OperationRejected,
|
|
383
|
+
'30014': errors.InvalidOrder,
|
|
384
|
+
'30015': errors.OrderNotFound,
|
|
385
|
+
'30016': errors.InvalidOrder,
|
|
386
|
+
'30017': errors.InvalidOrder,
|
|
387
|
+
'30018': errors.InvalidOrder,
|
|
388
|
+
'30019': errors.OperationRejected,
|
|
389
|
+
'30020': errors.InvalidOrder,
|
|
390
|
+
'30021': errors.InvalidOrder,
|
|
391
|
+
'30022': errors.InvalidOrder,
|
|
392
|
+
'30023': errors.InvalidOrder,
|
|
393
|
+
'30024': errors.InvalidOrder,
|
|
394
|
+
'30025': errors.BadRequest,
|
|
395
|
+
'30026': errors.PermissionDenied,
|
|
396
|
+
'30027': errors.PermissionDenied,
|
|
397
|
+
'30028': errors.OrderNotFound,
|
|
398
|
+
// #4XXXX Funding Errors
|
|
399
|
+
'40001': errors.OperationRejected,
|
|
400
|
+
'40002': errors.BadRequest,
|
|
401
|
+
'40003': errors.InvalidAddress,
|
|
402
|
+
'40004': errors.OperationRejected,
|
|
403
|
+
'40005': errors.BadRequest,
|
|
404
|
+
'40006': errors.PermissionDenied,
|
|
405
|
+
'40007': errors.OperationRejected,
|
|
406
|
+
'40008': errors.OperationRejected,
|
|
407
|
+
'40009': errors.OperationRejected,
|
|
408
|
+
'40010': errors.BadRequest,
|
|
409
|
+
'40011': errors.OperationRejected,
|
|
410
|
+
'40012': errors.BadRequest,
|
|
411
|
+
'40013': errors.BadRequest,
|
|
412
|
+
// #9XXXX Other Errors
|
|
413
|
+
'90001': errors.BadRequest,
|
|
414
|
+
'90002': errors.BadRequest,
|
|
415
|
+
'90003': errors.OperationRejected,
|
|
416
|
+
'90004': errors.BadRequest,
|
|
417
|
+
'90005': errors.BadRequest,
|
|
418
|
+
'90006': errors.RateLimitExceeded,
|
|
419
|
+
'90007': errors.AuthenticationError,
|
|
420
|
+
'90008': errors.RateLimitExceeded,
|
|
421
|
+
'90009': errors.PermissionDenied,
|
|
422
|
+
'90010': errors.BadRequest,
|
|
423
|
+
'90011': errors.RateLimitExceeded,
|
|
424
|
+
},
|
|
425
|
+
'broad': {
|
|
426
|
+
'less than min withdrawal ': errors.OperationRejected, // {"message":"amount 1 less than min withdrawal 5"}
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* @method
|
|
433
|
+
* @name arkham#fetchCurrencies
|
|
434
|
+
* @description fetches all available currencies on an exchange
|
|
435
|
+
* @see https://arkm.com/docs#get/public/assets
|
|
436
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
437
|
+
* @returns {object} an associative dictionary of currencies
|
|
438
|
+
*/
|
|
439
|
+
async fetchCurrencies(params = {}) {
|
|
440
|
+
const response = await this.v1PublicGetAssets(params);
|
|
441
|
+
//
|
|
442
|
+
// [
|
|
443
|
+
// {
|
|
444
|
+
// "symbol": "USDT",
|
|
445
|
+
// "name": "Tether",
|
|
446
|
+
// "imageUrl": "https://static.arkhamintelligence.com/tokens/tether.png",
|
|
447
|
+
// "stablecoin": true,
|
|
448
|
+
// "featuredPair": "BTC_USDT",
|
|
449
|
+
// "chains": [
|
|
450
|
+
// {
|
|
451
|
+
// "symbol": "ETH",
|
|
452
|
+
// "assetSymbol": "ETH",
|
|
453
|
+
// "name": "Ethereum",
|
|
454
|
+
// "type": "1",
|
|
455
|
+
// "confirmations": "6",
|
|
456
|
+
// "blockTime": "12000000"
|
|
457
|
+
// }
|
|
458
|
+
// ],
|
|
459
|
+
// "status": "listed",
|
|
460
|
+
// "minDeposit": "5",
|
|
461
|
+
// "minWithdrawal": "5",
|
|
462
|
+
// "withdrawalFee": "2"
|
|
463
|
+
// },
|
|
464
|
+
// ...
|
|
465
|
+
//
|
|
466
|
+
const result = {};
|
|
467
|
+
for (let i = 0; i < response.length; i++) {
|
|
468
|
+
const currency = response[i];
|
|
469
|
+
const id = this.safeString(currency, 'symbol');
|
|
470
|
+
const code = this.safeCurrencyCode(id);
|
|
471
|
+
const networks = {};
|
|
472
|
+
const chains = this.safeList(currency, 'chains', []);
|
|
473
|
+
for (let j = 0; j < chains.length; j++) {
|
|
474
|
+
const chain = chains[j];
|
|
475
|
+
const networkId = this.safeString(chain, 'symbol');
|
|
476
|
+
const network = this.networkIdToCode(networkId);
|
|
477
|
+
networks[network] = {
|
|
478
|
+
'info': chain,
|
|
479
|
+
'id': networkId,
|
|
480
|
+
'network': network,
|
|
481
|
+
'title': this.safeString(chain, 'name'),
|
|
482
|
+
'active': undefined,
|
|
483
|
+
'deposit': undefined,
|
|
484
|
+
'withdraw': undefined,
|
|
485
|
+
'fee': undefined,
|
|
486
|
+
'precision': undefined,
|
|
487
|
+
'limits': {
|
|
488
|
+
'withdraw': {
|
|
489
|
+
'min': undefined,
|
|
490
|
+
'max': undefined,
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
result[code] = this.safeCurrencyStructure({
|
|
496
|
+
'info': currency,
|
|
497
|
+
'id': id,
|
|
498
|
+
'code': code,
|
|
499
|
+
'name': this.safeString(currency, 'name'),
|
|
500
|
+
'active': this.safeString(currency, 'status') === 'listed',
|
|
501
|
+
'deposit': undefined,
|
|
502
|
+
'withdraw': undefined,
|
|
503
|
+
'fee': this.safeNumber(currency, 'withdrawalFee'),
|
|
504
|
+
'precision': undefined,
|
|
505
|
+
'limits': {
|
|
506
|
+
'amount': {
|
|
507
|
+
'min': undefined,
|
|
508
|
+
'max': undefined,
|
|
509
|
+
},
|
|
510
|
+
'withdraw': {
|
|
511
|
+
'min': this.safeNumber(currency, 'minWithdrawal'),
|
|
512
|
+
'max': undefined,
|
|
513
|
+
},
|
|
514
|
+
'deposit': {
|
|
515
|
+
'min': this.safeNumber(currency, 'minDeposit'),
|
|
516
|
+
'max': undefined,
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
'type': 'crypto',
|
|
520
|
+
'networks': networks,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
return result;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* @method
|
|
527
|
+
* @name arkham#fetchMarkets
|
|
528
|
+
* @see https://arkm.com/docs#get/public/pairs
|
|
529
|
+
* @description retrieves data on all markets for arkm
|
|
530
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
531
|
+
* @returns {object[]} an array of objects representing market data
|
|
532
|
+
*/
|
|
533
|
+
async fetchMarkets(params = {}) {
|
|
534
|
+
const response = await this.v1PublicGetPairs(params);
|
|
535
|
+
//
|
|
536
|
+
// [
|
|
537
|
+
// {
|
|
538
|
+
// "symbol": "BTC_USDT",
|
|
539
|
+
// "baseSymbol": "BTC",
|
|
540
|
+
// "baseImageUrl": "https://static.arkhamintelligence.com/tokens/bitcoin.png",
|
|
541
|
+
// "baseIsStablecoin": false,
|
|
542
|
+
// "baseName": "Bitcoin",
|
|
543
|
+
// "quoteSymbol": "USDT",
|
|
544
|
+
// "quoteImageUrl": "https://static.arkhamintelligence.com/tokens/tether.png",
|
|
545
|
+
// "quoteIsStablecoin": true,
|
|
546
|
+
// "quoteName": "Tether",
|
|
547
|
+
// "minTickPrice": "0.01",
|
|
548
|
+
// "minLotSize": "0.00001",
|
|
549
|
+
// "minSize": "0.00001",
|
|
550
|
+
// "maxSize": "9000",
|
|
551
|
+
// "minPrice": "0.01",
|
|
552
|
+
// "maxPrice": "1000000",
|
|
553
|
+
// "minNotional": "5",
|
|
554
|
+
// "maxPriceScalarUp": "1.8",
|
|
555
|
+
// "maxPriceScalarDown": "0.2",
|
|
556
|
+
// "pairType": "spot", // atm, always 'spot' value
|
|
557
|
+
// "maxLeverage": "0",
|
|
558
|
+
// "status": "listed"
|
|
559
|
+
// },
|
|
560
|
+
// {
|
|
561
|
+
// "symbol": "BTC_USDT_PERP",
|
|
562
|
+
// "baseSymbol": "BTC.P",
|
|
563
|
+
// "baseImageUrl": "https://static.arkhamintelligence.com/tokens/bitcoin.png",
|
|
564
|
+
// "baseIsStablecoin": false,
|
|
565
|
+
// "baseName": "Bitcoin Perpetual",
|
|
566
|
+
// "quoteSymbol": "USDT",
|
|
567
|
+
// "quoteImageUrl": "https://static.arkhamintelligence.com/tokens/tether.png",
|
|
568
|
+
// "quoteIsStablecoin": true,
|
|
569
|
+
// "quoteName": "Tether",
|
|
570
|
+
// "minTickPrice": "0.01",
|
|
571
|
+
// "minLotSize": "0.00001",
|
|
572
|
+
// "minSize": "0.00001",
|
|
573
|
+
// "maxSize": "9000",
|
|
574
|
+
// "minPrice": "0.01",
|
|
575
|
+
// "maxPrice": "1000000",
|
|
576
|
+
// "minNotional": "5",
|
|
577
|
+
// "maxPriceScalarUp": "1.5",
|
|
578
|
+
// "maxPriceScalarDown": "0.5",
|
|
579
|
+
// "pairType": "perpetual",
|
|
580
|
+
// "marginSchedule": "C",
|
|
581
|
+
// "maxLeverage": "25",
|
|
582
|
+
// "status": "listed"
|
|
583
|
+
// },
|
|
584
|
+
// ...
|
|
585
|
+
//
|
|
586
|
+
const result = [];
|
|
587
|
+
for (let i = 0; i < response.length; i++) {
|
|
588
|
+
const market = response[i];
|
|
589
|
+
const id = this.safeString(market, 'symbol');
|
|
590
|
+
const baseId = this.safeString(market, 'baseSymbol');
|
|
591
|
+
const quoteId = this.safeString(market, 'quoteSymbol');
|
|
592
|
+
let base = this.safeCurrencyCode(baseId);
|
|
593
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
594
|
+
let marketType = undefined;
|
|
595
|
+
let symbol = undefined;
|
|
596
|
+
const pairType = this.safeString(market, 'pairType');
|
|
597
|
+
const isSpot = pairType === 'spot';
|
|
598
|
+
const isPerpetual = pairType === 'perpetual';
|
|
599
|
+
let settle = undefined;
|
|
600
|
+
let settleId = undefined;
|
|
601
|
+
if (isSpot) {
|
|
602
|
+
marketType = 'spot';
|
|
603
|
+
symbol = base + '/' + quote;
|
|
604
|
+
}
|
|
605
|
+
else if (isPerpetual) {
|
|
606
|
+
marketType = 'swap';
|
|
607
|
+
base = base.replace('.P', '');
|
|
608
|
+
settle = quote;
|
|
609
|
+
settleId = quoteId;
|
|
610
|
+
symbol = base + '/' + quote + ':' + settle;
|
|
611
|
+
}
|
|
612
|
+
result.push({
|
|
613
|
+
'id': id,
|
|
614
|
+
'symbol': symbol,
|
|
615
|
+
'base': base,
|
|
616
|
+
'quote': quote,
|
|
617
|
+
'settle': settle,
|
|
618
|
+
'baseId': baseId,
|
|
619
|
+
'quoteId': quoteId,
|
|
620
|
+
'settleId': settleId,
|
|
621
|
+
'type': marketType,
|
|
622
|
+
'spot': isSpot,
|
|
623
|
+
'margin': undefined,
|
|
624
|
+
'swap': isPerpetual,
|
|
625
|
+
'future': false,
|
|
626
|
+
'option': false,
|
|
627
|
+
'active': this.safeString(market, 'status') === 'listed',
|
|
628
|
+
'contract': isPerpetual,
|
|
629
|
+
'linear': isPerpetual ? true : undefined,
|
|
630
|
+
'inverse': isPerpetual ? false : undefined,
|
|
631
|
+
'contractSize': isSpot ? undefined : 1,
|
|
632
|
+
'expiry': undefined,
|
|
633
|
+
'expiryDatetime': undefined,
|
|
634
|
+
'strike': undefined,
|
|
635
|
+
'optionType': undefined,
|
|
636
|
+
'precision': {
|
|
637
|
+
'price': this.safeNumber(market, 'minTickPrice'),
|
|
638
|
+
'amount': this.safeNumber(market, 'minLotSize'),
|
|
639
|
+
},
|
|
640
|
+
'limits': {
|
|
641
|
+
'leverage': {
|
|
642
|
+
'min': undefined,
|
|
643
|
+
'max': undefined,
|
|
644
|
+
},
|
|
645
|
+
'amount': {
|
|
646
|
+
'min': this.safeNumber(market, 'minSize'),
|
|
647
|
+
'max': this.safeNumber(market, 'maxSize'),
|
|
648
|
+
},
|
|
649
|
+
'price': {
|
|
650
|
+
'min': this.safeNumber(market, 'minPrice'),
|
|
651
|
+
'max': this.safeNumber(market, 'maxPrice'),
|
|
652
|
+
},
|
|
653
|
+
'cost': {
|
|
654
|
+
'min': this.safeNumber(market, 'minNotional'),
|
|
655
|
+
'max': undefined,
|
|
656
|
+
},
|
|
657
|
+
},
|
|
658
|
+
'created': undefined,
|
|
659
|
+
'info': market,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
return result;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* @method
|
|
666
|
+
* @name arkham#fetchTime
|
|
667
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
668
|
+
* @see https://arkm.com/docs#get/public/server-time
|
|
669
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
670
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
671
|
+
*/
|
|
672
|
+
async fetchTime(params = {}) {
|
|
673
|
+
const response = await this.v1PublicGetServerTime(params);
|
|
674
|
+
//
|
|
675
|
+
// {
|
|
676
|
+
// "serverTime": "1753465832770820"
|
|
677
|
+
// }
|
|
678
|
+
//
|
|
679
|
+
return this.safeIntegerProduct(response, 'serverTime', 0.001);
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* @method
|
|
683
|
+
* @name arkham#fetchOrderBook
|
|
684
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
685
|
+
* @see https://arkm.com/docs#get/public/book
|
|
686
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
687
|
+
* @param {int} [limit] the number of order book entries to return, max 50
|
|
688
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
689
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
690
|
+
*/
|
|
691
|
+
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
692
|
+
await this.loadMarkets();
|
|
693
|
+
const market = this.market(symbol);
|
|
694
|
+
const request = {
|
|
695
|
+
'symbol': market['id'],
|
|
696
|
+
};
|
|
697
|
+
if (limit !== undefined) {
|
|
698
|
+
request['limit'] = limit;
|
|
699
|
+
}
|
|
700
|
+
const response = await this.v1PublicGetBook(this.extend(request, params));
|
|
701
|
+
//
|
|
702
|
+
// {
|
|
703
|
+
// "symbol": "BTC_USDT",
|
|
704
|
+
// "group": "0.01",
|
|
705
|
+
// "asks": [
|
|
706
|
+
// {
|
|
707
|
+
// "price": "122900.43",
|
|
708
|
+
// "size": "0.0243"
|
|
709
|
+
// },
|
|
710
|
+
// {
|
|
711
|
+
// "price": "121885.53",
|
|
712
|
+
// "size": "0.00116"
|
|
713
|
+
// },
|
|
714
|
+
// ...
|
|
715
|
+
// ],
|
|
716
|
+
// "bids": [
|
|
717
|
+
// {
|
|
718
|
+
// "price": "20400",
|
|
719
|
+
// "size": "0.00316"
|
|
720
|
+
// },
|
|
721
|
+
// {
|
|
722
|
+
// "price": "30000",
|
|
723
|
+
// "size": "0.00116"
|
|
724
|
+
// },
|
|
725
|
+
// ...
|
|
726
|
+
// ],
|
|
727
|
+
// "lastTime": "1753419275604353"
|
|
728
|
+
// }
|
|
729
|
+
//
|
|
730
|
+
const timestamp = this.safeIntegerProduct(response, 'lastTime', 0.001);
|
|
731
|
+
const marketId = this.safeString(response, 'symbol');
|
|
732
|
+
return this.parseOrderBook(response, this.safeSymbol(marketId, market), timestamp, 'bids', 'asks', 'price', 'size');
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* @method
|
|
736
|
+
* @name arkham#fetchOHLCV
|
|
737
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
738
|
+
* @see https://arkm.com/docs#get/public/candles
|
|
739
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
740
|
+
* @param {string} timeframe the length of time each candle represents
|
|
741
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
742
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
743
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
744
|
+
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
745
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
746
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
747
|
+
*/
|
|
748
|
+
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
749
|
+
const maxLimit = 365;
|
|
750
|
+
await this.loadMarkets();
|
|
751
|
+
let paginate = false;
|
|
752
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
753
|
+
if (paginate) {
|
|
754
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, maxLimit);
|
|
755
|
+
}
|
|
756
|
+
const market = this.market(symbol);
|
|
757
|
+
const request = {
|
|
758
|
+
'symbol': market['id'],
|
|
759
|
+
'duration': this.safeString(this.timeframes, timeframe, timeframe),
|
|
760
|
+
};
|
|
761
|
+
const durationMs = this.parseTimeframe(timeframe) * 1000;
|
|
762
|
+
const until = this.safeInteger(params, 'until');
|
|
763
|
+
params = this.omit(params, ['until']);
|
|
764
|
+
const selectedLimit = (limit !== undefined) ? Math.min(limit, maxLimit) : maxLimit;
|
|
765
|
+
if (since !== undefined) {
|
|
766
|
+
request['start'] = since;
|
|
767
|
+
request['end'] = this.sum(since, selectedLimit * durationMs);
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
const now = this.milliseconds();
|
|
771
|
+
request['end'] = (until !== undefined) ? until : now;
|
|
772
|
+
request['start'] = request['end'] - selectedLimit * durationMs;
|
|
773
|
+
}
|
|
774
|
+
// exchange needs microseconds
|
|
775
|
+
request['start'] = request['start'] * 1000;
|
|
776
|
+
request['end'] = request['end'] * 1000;
|
|
777
|
+
const response = await this.v1PublicGetCandles(this.extend(request, params));
|
|
778
|
+
//
|
|
779
|
+
// [
|
|
780
|
+
// {
|
|
781
|
+
// "symbol": "BTC_USDT_PERP",
|
|
782
|
+
// "time": "1753464720000000",
|
|
783
|
+
// "duration": "60000000",
|
|
784
|
+
// "open": "116051.35",
|
|
785
|
+
// "high": "116060.27",
|
|
786
|
+
// "low": "116051.35",
|
|
787
|
+
// "close": "116060.27",
|
|
788
|
+
// "volume": "0.0257",
|
|
789
|
+
// "quoteVolume": "2982.6724054"
|
|
790
|
+
// },
|
|
791
|
+
// ...
|
|
792
|
+
// ]
|
|
793
|
+
//
|
|
794
|
+
return this.parseOHLCVs(response, market, timeframe, since, limit);
|
|
795
|
+
}
|
|
796
|
+
parseOHLCV(ohlcv, market = undefined) {
|
|
797
|
+
//
|
|
798
|
+
// {
|
|
799
|
+
// "symbol": "BTC_USDT_PERP",
|
|
800
|
+
// "time": "1753464720000000",
|
|
801
|
+
// "duration": "60000000",
|
|
802
|
+
// "open": "116051.35",
|
|
803
|
+
// "high": "116060.27",
|
|
804
|
+
// "low": "116051.35",
|
|
805
|
+
// "close": "116060.27",
|
|
806
|
+
// "volume": "0.0257",
|
|
807
|
+
// "quoteVolume": "2982.6724054"
|
|
808
|
+
// }
|
|
809
|
+
//
|
|
810
|
+
return [
|
|
811
|
+
this.safeIntegerProduct(ohlcv, 'time', 0.001),
|
|
812
|
+
this.safeNumber(ohlcv, 'open'),
|
|
813
|
+
this.safeNumber(ohlcv, 'high'),
|
|
814
|
+
this.safeNumber(ohlcv, 'low'),
|
|
815
|
+
this.safeNumber(ohlcv, 'close'),
|
|
816
|
+
this.safeNumber(ohlcv, 'volume'),
|
|
817
|
+
];
|
|
818
|
+
}
|
|
819
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
820
|
+
const response = await this.v1PublicGetTickers(params);
|
|
821
|
+
//
|
|
822
|
+
// [
|
|
823
|
+
// {
|
|
824
|
+
// "symbol": "BTC_USDT_PERP",
|
|
825
|
+
// "baseSymbol": "BTC.P",
|
|
826
|
+
// "quoteSymbol": "USDT",
|
|
827
|
+
// "indexCurrency": "USDT",
|
|
828
|
+
// "price": "118806.89",
|
|
829
|
+
// "price24hAgo": "118212.29",
|
|
830
|
+
// "high24h": "119468.05",
|
|
831
|
+
// "low24h": "117104.44",
|
|
832
|
+
// "volume24h": "180.99438",
|
|
833
|
+
// "quoteVolume24h": "21430157.5928827",
|
|
834
|
+
// "markPrice": "118814.71",
|
|
835
|
+
// "indexPrice": "118804.222610343",
|
|
836
|
+
// "fundingRate": "0.000007",
|
|
837
|
+
// "nextFundingRate": "0.000006",
|
|
838
|
+
// "nextFundingTime": "1753390800000000",
|
|
839
|
+
// "productType": "perpetual",
|
|
840
|
+
// "openInterest": "2.55847",
|
|
841
|
+
// "usdVolume24h": "21430157.5928827",
|
|
842
|
+
// "openInterestUSD": "303963.8638583"
|
|
843
|
+
// },
|
|
844
|
+
// ...
|
|
845
|
+
//
|
|
846
|
+
return this.parseTickers(response, symbols);
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* @method
|
|
850
|
+
* @name arkham#fetchTicker
|
|
851
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
852
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
853
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
854
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
855
|
+
*/
|
|
856
|
+
async fetchTicker(symbol, params = {}) {
|
|
857
|
+
await this.loadMarkets();
|
|
858
|
+
const market = this.market(symbol);
|
|
859
|
+
const request = {
|
|
860
|
+
'symbol': market['id'],
|
|
861
|
+
};
|
|
862
|
+
const response = await this.v1PublicGetTicker(this.extend(request, params));
|
|
863
|
+
//
|
|
864
|
+
// {
|
|
865
|
+
// "symbol": "BTC_USDT_PERP",
|
|
866
|
+
// "baseSymbol": "BTC.P",
|
|
867
|
+
// "quoteSymbol": "USDT",
|
|
868
|
+
// "indexCurrency": "USDT",
|
|
869
|
+
// "price": "118806.89",
|
|
870
|
+
// "price24hAgo": "118212.29",
|
|
871
|
+
// "high24h": "119468.05",
|
|
872
|
+
// "low24h": "117104.44",
|
|
873
|
+
// "volume24h": "180.99438",
|
|
874
|
+
// "quoteVolume24h": "21430157.5928827",
|
|
875
|
+
// "markPrice": "118814.71",
|
|
876
|
+
// "indexPrice": "118804.222610343",
|
|
877
|
+
// "fundingRate": "0.000007",
|
|
878
|
+
// "nextFundingRate": "0.000006",
|
|
879
|
+
// "nextFundingTime": "1753390800000000",
|
|
880
|
+
// "productType": "perpetual",
|
|
881
|
+
// "openInterest": "2.55847",
|
|
882
|
+
// "usdVolume24h": "21430157.5928827",
|
|
883
|
+
// "openInterestUSD": "303963.8638583"
|
|
884
|
+
// }
|
|
885
|
+
//
|
|
886
|
+
return this.parseTicker(response, market);
|
|
887
|
+
}
|
|
888
|
+
parseTicker(ticker, market = undefined) {
|
|
889
|
+
const marketId = this.safeString(ticker, 'symbol');
|
|
890
|
+
market = this.safeMarket(marketId, market);
|
|
891
|
+
return this.safeTicker({
|
|
892
|
+
'info': ticker,
|
|
893
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
894
|
+
'high': this.safeNumber(ticker, 'high24h'),
|
|
895
|
+
'low': this.safeNumber(ticker, 'low24h'),
|
|
896
|
+
'bid': this.safeNumber(ticker, 'bid'),
|
|
897
|
+
'last': this.safeNumber(ticker, 'price'),
|
|
898
|
+
'open': this.safeNumber(ticker, 'price24hAgo'),
|
|
899
|
+
'change': this.safeNumber(ticker, 'priceChange'),
|
|
900
|
+
'percentage': this.safeNumber(ticker, 'priceChangePercent'),
|
|
901
|
+
'baseVolume': this.safeNumber(ticker, 'volume24h'),
|
|
902
|
+
'quoteVolume': this.safeNumber(ticker, 'usdVolume24h'),
|
|
903
|
+
'markPrice': this.safeNumber(ticker, 'markPrice'),
|
|
904
|
+
'indexPrice': this.safeNumber(ticker, 'indexPrice'),
|
|
905
|
+
'vwap': undefined,
|
|
906
|
+
'average': undefined,
|
|
907
|
+
'previousClose': undefined,
|
|
908
|
+
'askVolume': undefined,
|
|
909
|
+
'bidVolume': undefined,
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* @method
|
|
914
|
+
* @name arkham#fetchTrades
|
|
915
|
+
* @description get the list of most recent trades for a particular symbol
|
|
916
|
+
* @see https://arkm.com/docs#get/public/trades
|
|
917
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
918
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
919
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
920
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
921
|
+
* @param {string} [params.loc] crypto location, default: us
|
|
922
|
+
* @param {string} [params.method] method, default: marketPublicGetV1beta3CryptoLocTrades
|
|
923
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
924
|
+
*/
|
|
925
|
+
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
926
|
+
await this.loadMarkets();
|
|
927
|
+
const market = this.market(symbol);
|
|
928
|
+
const marketId = market['id'];
|
|
929
|
+
const request = {
|
|
930
|
+
'symbol': marketId,
|
|
931
|
+
};
|
|
932
|
+
if (limit !== undefined) {
|
|
933
|
+
request['limit'] = limit;
|
|
934
|
+
}
|
|
935
|
+
const response = await this.v1PublicGetTrades(this.extend(request, params));
|
|
936
|
+
//
|
|
937
|
+
// [
|
|
938
|
+
// {
|
|
939
|
+
// "symbol": "BTC_USDT_PERP",
|
|
940
|
+
// "revisionId": "1130514101",
|
|
941
|
+
// "size": "0.01668",
|
|
942
|
+
// "price": "116309.57",
|
|
943
|
+
// "takerSide": "sell",
|
|
944
|
+
// "time": "1753439710374047"
|
|
945
|
+
// },
|
|
946
|
+
// ...
|
|
947
|
+
// ]
|
|
948
|
+
//
|
|
949
|
+
return this.parseTrades(response, market, since, limit);
|
|
950
|
+
}
|
|
951
|
+
parseTrade(trade, market = undefined) {
|
|
952
|
+
//
|
|
953
|
+
// fetchTrades
|
|
954
|
+
//
|
|
955
|
+
// {
|
|
956
|
+
// "symbol": "BTC_USDT_PERP",
|
|
957
|
+
// "revisionId": "1130514101",
|
|
958
|
+
// "size": "0.01668",
|
|
959
|
+
// "price": "116309.57",
|
|
960
|
+
// "takerSide": "sell",
|
|
961
|
+
// "time": "1753439710374047"
|
|
962
|
+
// }
|
|
963
|
+
//
|
|
964
|
+
// fetchMyTrades
|
|
965
|
+
//
|
|
966
|
+
// {
|
|
967
|
+
// "symbol": "SOL_USDT",
|
|
968
|
+
// "revisionId": "891839406",
|
|
969
|
+
// "size": "0.042",
|
|
970
|
+
// "price": "185.06",
|
|
971
|
+
// "takerSide": "sell",
|
|
972
|
+
// "time": "1753773952039342",
|
|
973
|
+
// "orderId": "3717304929194",
|
|
974
|
+
// "userSide": "sell",
|
|
975
|
+
// "quoteFee": "0.00777252",
|
|
976
|
+
// "arkmFee": "0",
|
|
977
|
+
// "clientOrderId": ""
|
|
978
|
+
// }
|
|
979
|
+
//
|
|
980
|
+
const marketId = this.safeString(trade, 'symbol');
|
|
981
|
+
market = this.safeMarket(marketId, market);
|
|
982
|
+
const timestamp = this.safeIntegerProduct(trade, 'time', 0.001);
|
|
983
|
+
const quoteFee = this.safeNumber(trade, 'quoteFee');
|
|
984
|
+
const arkmFee = this.safeNumber(trade, 'arkmFee');
|
|
985
|
+
let fee = undefined;
|
|
986
|
+
if (quoteFee !== undefined) {
|
|
987
|
+
fee = {
|
|
988
|
+
'cost': quoteFee,
|
|
989
|
+
'currency': market['quote'],
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
else if (arkmFee !== undefined) {
|
|
993
|
+
fee = {
|
|
994
|
+
'cost': arkmFee,
|
|
995
|
+
'currency': 'ARKM',
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
return this.safeTrade({
|
|
999
|
+
'info': trade,
|
|
1000
|
+
'id': this.safeString(trade, 'revisionId'),
|
|
1001
|
+
'timestamp': timestamp,
|
|
1002
|
+
'datetime': this.iso8601(timestamp),
|
|
1003
|
+
'symbol': market['symbol'],
|
|
1004
|
+
'type': undefined,
|
|
1005
|
+
'side': this.safeString2(trade, 'userSide', 'takerSide'),
|
|
1006
|
+
'takerOrMaker': undefined,
|
|
1007
|
+
'price': this.safeString(trade, 'price'),
|
|
1008
|
+
'amount': this.safeString(trade, 'size'),
|
|
1009
|
+
'cost': undefined,
|
|
1010
|
+
'fee': fee,
|
|
1011
|
+
'order': this.safeString(trade, 'orderId'),
|
|
1012
|
+
}, market);
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* @method
|
|
1016
|
+
* @name arkmm#fetchOrder
|
|
1017
|
+
* @description fetches information on an order made by the user
|
|
1018
|
+
* @see https://arkm.com/docs#get/orders/by-client-order-id
|
|
1019
|
+
* @param {string} id the order id
|
|
1020
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1021
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1022
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
1023
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1024
|
+
*/
|
|
1025
|
+
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1026
|
+
const request = {
|
|
1027
|
+
'id': parseInt(id),
|
|
1028
|
+
};
|
|
1029
|
+
const response = await this.v1PrivateGetOrdersId(this.extend(request, params));
|
|
1030
|
+
//
|
|
1031
|
+
// {
|
|
1032
|
+
// "orderId": "3690478767430",
|
|
1033
|
+
// "userId": "2959123",
|
|
1034
|
+
// "subaccountId": "0",
|
|
1035
|
+
// "symbol": "SOL_USDT",
|
|
1036
|
+
// "time": "1753696843913970",
|
|
1037
|
+
// "side": "sell",
|
|
1038
|
+
// "type": "limitGtc",
|
|
1039
|
+
// "size": "0.066",
|
|
1040
|
+
// "price": "293.2",
|
|
1041
|
+
// "postOnly": false,
|
|
1042
|
+
// "reduceOnly": false,
|
|
1043
|
+
// "executedSize": "0",
|
|
1044
|
+
// "status": "booked",
|
|
1045
|
+
// "avgPrice": "0",
|
|
1046
|
+
// "executedNotional": "0",
|
|
1047
|
+
// "creditFeePaid": "0",
|
|
1048
|
+
// "marginBonusFeePaid": "0",
|
|
1049
|
+
// "quoteFeePaid": "0",
|
|
1050
|
+
// "arkmFeePaid": "0",
|
|
1051
|
+
// "revisionId": "887956326",
|
|
1052
|
+
// "lastTime": "1753696843914830",
|
|
1053
|
+
// "clientOrderId": "",
|
|
1054
|
+
// "lastSize": "0",
|
|
1055
|
+
// "lastPrice": "0",
|
|
1056
|
+
// "lastCreditFee": "0",
|
|
1057
|
+
// "lastMarginBonusFee": "0",
|
|
1058
|
+
// "lastQuoteFee": "0",
|
|
1059
|
+
// "lastArkmFee": "0"
|
|
1060
|
+
// }
|
|
1061
|
+
//
|
|
1062
|
+
return this.parseOrder(response);
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* @method
|
|
1066
|
+
* @name arkham#fetchClosedOrders
|
|
1067
|
+
* @description fetches information on multiple closed orders made by the user
|
|
1068
|
+
* @see https://arkm.com/docs#get/orders/history
|
|
1069
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1070
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1071
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1072
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1073
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
1074
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1075
|
+
*/
|
|
1076
|
+
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1077
|
+
await this.loadMarkets();
|
|
1078
|
+
const request = {};
|
|
1079
|
+
let market = undefined;
|
|
1080
|
+
if (symbol !== undefined) {
|
|
1081
|
+
market = this.market(symbol);
|
|
1082
|
+
request['symbol'] = market['id'];
|
|
1083
|
+
}
|
|
1084
|
+
if (limit !== undefined) {
|
|
1085
|
+
request['limit'] = limit; // note, API does not work for this param
|
|
1086
|
+
}
|
|
1087
|
+
const response = await this.v1PrivateGetOrdersHistory(this.extend(request, params));
|
|
1088
|
+
//
|
|
1089
|
+
// [
|
|
1090
|
+
// {
|
|
1091
|
+
// "orderId": "3690478767430",
|
|
1092
|
+
// "userId": "2959123",
|
|
1093
|
+
// "subaccountId": "0",
|
|
1094
|
+
// "symbol": "SOL_USDT",
|
|
1095
|
+
// "time": "1753696843913970",
|
|
1096
|
+
// "side": "sell",
|
|
1097
|
+
// "type": "limitGtc",
|
|
1098
|
+
// "size": "0.066",
|
|
1099
|
+
// "price": "293.2",
|
|
1100
|
+
// "postOnly": false,
|
|
1101
|
+
// "reduceOnly": false,
|
|
1102
|
+
// "executedSize": "0",
|
|
1103
|
+
// "status": "closed",
|
|
1104
|
+
// "avgPrice": "0",
|
|
1105
|
+
// "executedNotional": "0",
|
|
1106
|
+
// "creditFeePaid": "0",
|
|
1107
|
+
// "marginBonusFeePaid": "0",
|
|
1108
|
+
// "quoteFeePaid": "0",
|
|
1109
|
+
// "arkmFeePaid": "0",
|
|
1110
|
+
// "revisionId": "888084076",
|
|
1111
|
+
// "lastTime": "1753701350088305",
|
|
1112
|
+
// "clientOrderId": "",
|
|
1113
|
+
// "lastSize": "0",
|
|
1114
|
+
// "lastPrice": "0",
|
|
1115
|
+
// "lastCreditFee": "0",
|
|
1116
|
+
// "lastMarginBonusFee": "0",
|
|
1117
|
+
// "lastQuoteFee": "0",
|
|
1118
|
+
// "lastArkmFee": "0"
|
|
1119
|
+
// }
|
|
1120
|
+
// ]
|
|
1121
|
+
//
|
|
1122
|
+
return this.parseOrders(response, market, since, limit);
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* @method
|
|
1126
|
+
* @name arkham#fetchOpenOrders
|
|
1127
|
+
* @description fetch all unfilled currently open orders
|
|
1128
|
+
* @see https://arkm.com/docs#get/orders
|
|
1129
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1130
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1131
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1132
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1133
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
1134
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1135
|
+
*/
|
|
1136
|
+
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1137
|
+
await this.loadMarkets();
|
|
1138
|
+
let market = undefined;
|
|
1139
|
+
if (symbol !== undefined) {
|
|
1140
|
+
market = this.market(symbol);
|
|
1141
|
+
}
|
|
1142
|
+
const isTriggerOrder = this.safeBool(params, 'trigger');
|
|
1143
|
+
params = this.omit(params, 'trigger');
|
|
1144
|
+
let response = undefined;
|
|
1145
|
+
if (isTriggerOrder) {
|
|
1146
|
+
response = await this.v1PrivateGetTriggerOrders(this.extend({}, params));
|
|
1147
|
+
//
|
|
1148
|
+
// [
|
|
1149
|
+
// {
|
|
1150
|
+
// "subaccountId": "0",
|
|
1151
|
+
// "symbol": "SOL_USDT",
|
|
1152
|
+
// "side": "sell",
|
|
1153
|
+
// "type": "market",
|
|
1154
|
+
// "size": "0.045",
|
|
1155
|
+
// "price": "99.9",
|
|
1156
|
+
// "postOnly": false,
|
|
1157
|
+
// "reduceOnly": false,
|
|
1158
|
+
// "time": "1753768103780063",
|
|
1159
|
+
// "triggerOrderId": "3715847222127",
|
|
1160
|
+
// "triggerType": "stopLoss",
|
|
1161
|
+
// "triggerPriceType": "last",
|
|
1162
|
+
// "triggerPrice": "111",
|
|
1163
|
+
// "clientOrderId": "",
|
|
1164
|
+
// "status": "staged"
|
|
1165
|
+
// },
|
|
1166
|
+
// ]
|
|
1167
|
+
//
|
|
1168
|
+
}
|
|
1169
|
+
else {
|
|
1170
|
+
response = await this.v1PrivateGetOrders(this.extend({}, params));
|
|
1171
|
+
//
|
|
1172
|
+
// [
|
|
1173
|
+
// {
|
|
1174
|
+
// "orderId": "3690478767430",
|
|
1175
|
+
// "userId": "2959123",
|
|
1176
|
+
// "subaccountId": "0",
|
|
1177
|
+
// "symbol": "SOL_USDT",
|
|
1178
|
+
// "time": "1753696843913970",
|
|
1179
|
+
// "side": "sell",
|
|
1180
|
+
// "type": "limitGtc",
|
|
1181
|
+
// "size": "0.066",
|
|
1182
|
+
// "price": "293.2",
|
|
1183
|
+
// "postOnly": false,
|
|
1184
|
+
// "reduceOnly": false,
|
|
1185
|
+
// "executedSize": "0",
|
|
1186
|
+
// "status": "booked",
|
|
1187
|
+
// "avgPrice": "0",
|
|
1188
|
+
// "executedNotional": "0",
|
|
1189
|
+
// "creditFeePaid": "0",
|
|
1190
|
+
// "marginBonusFeePaid": "0",
|
|
1191
|
+
// "quoteFeePaid": "0",
|
|
1192
|
+
// "arkmFeePaid": "0",
|
|
1193
|
+
// "revisionId": "887956326",
|
|
1194
|
+
// "lastTime": "1753696843914830",
|
|
1195
|
+
// "clientOrderId": "",
|
|
1196
|
+
// "lastSize": "0",
|
|
1197
|
+
// "lastPrice": "0",
|
|
1198
|
+
// "lastCreditFee": "0",
|
|
1199
|
+
// "lastMarginBonusFee": "0",
|
|
1200
|
+
// "lastQuoteFee": "0",
|
|
1201
|
+
// "lastArkmFee": "0"
|
|
1202
|
+
// }
|
|
1203
|
+
// ]
|
|
1204
|
+
//
|
|
1205
|
+
}
|
|
1206
|
+
return this.parseOrders(response, market, since, limit);
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* @method
|
|
1210
|
+
* @name arkham#cancelOrder
|
|
1211
|
+
* @description cancels an open order
|
|
1212
|
+
* @see https://arkm.com/docs#post/orders/cancel
|
|
1213
|
+
* @param {string} id order id
|
|
1214
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1215
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1216
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1217
|
+
*/
|
|
1218
|
+
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1219
|
+
const isTriggerOrder = this.safeBool(params, 'trigger');
|
|
1220
|
+
params = this.omit(params, 'trigger');
|
|
1221
|
+
let response = undefined;
|
|
1222
|
+
const request = {};
|
|
1223
|
+
const clientOrderId = this.safeInteger(params, 'clientOrderId');
|
|
1224
|
+
if (clientOrderId !== undefined) {
|
|
1225
|
+
params = this.omit(params, 'clientOrderId');
|
|
1226
|
+
request['clientOrderId'] = clientOrderId;
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
if (isTriggerOrder) {
|
|
1230
|
+
request['triggerOrderId'] = parseInt(id);
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
request['orderId'] = parseInt(id);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
if (isTriggerOrder) {
|
|
1237
|
+
if (symbol === undefined) {
|
|
1238
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument for trigger orders');
|
|
1239
|
+
}
|
|
1240
|
+
const market = this.market(symbol);
|
|
1241
|
+
request['symbol'] = market['id'];
|
|
1242
|
+
response = await this.v1PrivatePostTriggerOrdersCancel(this.extend(request, params));
|
|
1243
|
+
}
|
|
1244
|
+
else {
|
|
1245
|
+
response = await this.v1PrivatePostOrdersCancel(this.extend(request, params));
|
|
1246
|
+
}
|
|
1247
|
+
//
|
|
1248
|
+
// {"orderId":3691703758327}
|
|
1249
|
+
//
|
|
1250
|
+
return this.parseOrder(response);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* @method
|
|
1254
|
+
* @name arkham#cancelAllOrders
|
|
1255
|
+
* @description cancel all open orders in a market
|
|
1256
|
+
* @see https://arkm.com/docs#post/orders/cancel/all
|
|
1257
|
+
* @param {string} symbol cancel alls open orders
|
|
1258
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1259
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1260
|
+
*/
|
|
1261
|
+
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1262
|
+
if (symbol !== undefined) {
|
|
1263
|
+
throw new errors.BadRequest(this.id + ' cancelAllOrders() does not support a symbol argument, use cancelOrder() or fetchOpenOrders() instead');
|
|
1264
|
+
}
|
|
1265
|
+
const isTriggerOrder = this.safeBool(params, 'trigger');
|
|
1266
|
+
params = this.omit(params, 'trigger');
|
|
1267
|
+
let response = undefined;
|
|
1268
|
+
if (isTriggerOrder) {
|
|
1269
|
+
response = await this.v1PrivatePostTriggerOrdersCancelAll(params);
|
|
1270
|
+
}
|
|
1271
|
+
else {
|
|
1272
|
+
response = await this.v1PrivatePostOrdersCancelAll(params);
|
|
1273
|
+
}
|
|
1274
|
+
//
|
|
1275
|
+
// [] returns an empty array, even when successfully cancels orders
|
|
1276
|
+
//
|
|
1277
|
+
return this.parseOrders(response, undefined);
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* @method
|
|
1281
|
+
* @name arkham#createOrder
|
|
1282
|
+
* @description create a trade order on the exchange
|
|
1283
|
+
* @see https://arkm.com/docs#post/orders/new
|
|
1284
|
+
* @param {string} symbol unified CCXT market symbol
|
|
1285
|
+
* @param {string} type "limit" or "market"
|
|
1286
|
+
* @param {string} side "buy" or "sell"
|
|
1287
|
+
* @param {float} amount the amount of currency to trade
|
|
1288
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1289
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1290
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK", or "PO"
|
|
1291
|
+
* @param {float} [params.triggerPrice] price for a trigger (conditional) order
|
|
1292
|
+
* @param {float} [params.stopLossPrice] price for a stoploss order
|
|
1293
|
+
* @param {float} [params.takeProfitPrice] price for a takeprofit order
|
|
1294
|
+
* @param {string} [params.triggerDirection] the direction for trigger orders, 'ascending' or 'descending'
|
|
1295
|
+
* @param {string} [params.triggerPriceType] mark, index or last
|
|
1296
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1297
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1298
|
+
* @returns [An order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1299
|
+
*/
|
|
1300
|
+
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1301
|
+
await this.loadMarkets();
|
|
1302
|
+
const market = this.market(symbol);
|
|
1303
|
+
const isTriggerOrder = this.safeNumberN(params, ['triggerPrice', 'stopLossPrice', 'takeProfitPrice']) !== undefined;
|
|
1304
|
+
const request = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
1305
|
+
let response = undefined;
|
|
1306
|
+
if (isTriggerOrder) {
|
|
1307
|
+
response = await this.v1PrivatePostTriggerOrdersNew(request);
|
|
1308
|
+
//
|
|
1309
|
+
// {
|
|
1310
|
+
// "triggerOrderId": "3716436645573",
|
|
1311
|
+
// "symbol": "SOL_USDT_PERP",
|
|
1312
|
+
// "side": "buy",
|
|
1313
|
+
// "type": "limitGtc",
|
|
1314
|
+
// "size": "0.05",
|
|
1315
|
+
// "price": "150"
|
|
1316
|
+
// }
|
|
1317
|
+
//
|
|
1318
|
+
}
|
|
1319
|
+
else {
|
|
1320
|
+
response = await this.v1PrivatePostOrdersNew(request);
|
|
1321
|
+
//
|
|
1322
|
+
// {
|
|
1323
|
+
// "orderId": "3694872060678",
|
|
1324
|
+
// "clientOrderId": "test123",
|
|
1325
|
+
// "symbol": "SOL_USDT",
|
|
1326
|
+
// "subaccountId": "0",
|
|
1327
|
+
// "side": "buy",
|
|
1328
|
+
// "type": "limitGtc",
|
|
1329
|
+
// "size": "0.05",
|
|
1330
|
+
// "price": "170",
|
|
1331
|
+
// "time": "1753710501474043"
|
|
1332
|
+
// }
|
|
1333
|
+
//
|
|
1334
|
+
}
|
|
1335
|
+
return this.parseOrder(response, market);
|
|
1336
|
+
}
|
|
1337
|
+
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1338
|
+
const market = this.market(symbol);
|
|
1339
|
+
symbol = market['symbol'];
|
|
1340
|
+
const request = {
|
|
1341
|
+
'symbol': market['id'],
|
|
1342
|
+
'side': side,
|
|
1343
|
+
'size': this.amountToPrecision(symbol, amount),
|
|
1344
|
+
};
|
|
1345
|
+
const isBuy = (side === 'buy');
|
|
1346
|
+
const stopLossPrice = this.safeNumber(params, 'stopLossPrice');
|
|
1347
|
+
const takeProfitPrice = this.safeNumber(params, 'takeProfitPrice');
|
|
1348
|
+
const triggerPriceAny = this.safeStringN(params, ['triggerPrice', 'stopLossPrice', 'takeProfitPrice']);
|
|
1349
|
+
if (triggerPriceAny !== undefined) {
|
|
1350
|
+
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPriceAny);
|
|
1351
|
+
if (stopLossPrice !== undefined) {
|
|
1352
|
+
request['triggerType'] = isBuy ? 'stopLoss' : 'takeProfit';
|
|
1353
|
+
}
|
|
1354
|
+
else if (takeProfitPrice !== undefined) {
|
|
1355
|
+
request['triggerType'] = isBuy ? 'takeProfit' : 'stopLoss';
|
|
1356
|
+
}
|
|
1357
|
+
else {
|
|
1358
|
+
const triggerDirection = this.safeString(params, 'triggerDirection');
|
|
1359
|
+
if (triggerDirection === undefined) {
|
|
1360
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerDirection parameter when triggerPrice is specified, must be "ascending" or "descending"');
|
|
1361
|
+
}
|
|
1362
|
+
if (triggerDirection !== undefined) {
|
|
1363
|
+
if (triggerDirection === 'ascending') {
|
|
1364
|
+
request['triggerType'] = isBuy ? 'stopLoss' : 'takeProfit';
|
|
1365
|
+
}
|
|
1366
|
+
else if (triggerDirection === 'descending') {
|
|
1367
|
+
request['triggerType'] = isBuy ? 'takeProfit' : 'stopLoss';
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
// mandatory triggerPriceType
|
|
1372
|
+
if (this.safeString(params, 'triggerPriceType') === undefined) {
|
|
1373
|
+
request['triggerPriceType'] = 'last'; // default
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
const isMarketOrder = (type === 'market');
|
|
1377
|
+
const isLimitOrder = (type === 'limit');
|
|
1378
|
+
const isLimitExchangeSpecific = this.inArray(type, ['limitGtc', 'limitIoc', 'limitFok']);
|
|
1379
|
+
const postOnly = this.isPostOnly(isMarketOrder, false, params);
|
|
1380
|
+
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1381
|
+
params = this.omit(params, ['postOnly', 'timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerDirection']);
|
|
1382
|
+
if (postOnly) {
|
|
1383
|
+
request['postOnly'] = true;
|
|
1384
|
+
}
|
|
1385
|
+
if (isLimitOrder || isLimitExchangeSpecific) {
|
|
1386
|
+
request['price'] = this.priceToPrecision(symbol, price);
|
|
1387
|
+
//
|
|
1388
|
+
if (timeInForce === 'IOC') {
|
|
1389
|
+
request['type'] = 'limitIoc';
|
|
1390
|
+
}
|
|
1391
|
+
else if (timeInForce === 'FOK') {
|
|
1392
|
+
request['type'] = 'limitFok';
|
|
1393
|
+
}
|
|
1394
|
+
else {
|
|
1395
|
+
request['type'] = 'limitGtc';
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
else if (isMarketOrder) {
|
|
1399
|
+
request['type'] = 'market';
|
|
1400
|
+
}
|
|
1401
|
+
// we don't need to manually handle `reduceOnly`, `clientOrderId`, `triggerPriceType` here as exchange-specific keyname & values matches
|
|
1402
|
+
return this.extend(request, params);
|
|
1403
|
+
}
|
|
1404
|
+
parseOrder(order, market = undefined) {
|
|
1405
|
+
//
|
|
1406
|
+
// createOrder
|
|
1407
|
+
//
|
|
1408
|
+
// {
|
|
1409
|
+
// "orderId": "3694872060678",
|
|
1410
|
+
// "clientOrderId": "test123",
|
|
1411
|
+
// "symbol": "SOL_USDT",
|
|
1412
|
+
// "subaccountId": "0",
|
|
1413
|
+
// "side": "buy",
|
|
1414
|
+
// "type": "limitGtc",
|
|
1415
|
+
// "size": "0.05",
|
|
1416
|
+
// "price": "170",
|
|
1417
|
+
// "time": "1753710501474043"
|
|
1418
|
+
// }
|
|
1419
|
+
//
|
|
1420
|
+
// fetchOrder, fetchOpenOrders, fetchClosedOrders
|
|
1421
|
+
//
|
|
1422
|
+
// {
|
|
1423
|
+
// "orderId": "3690478767430",
|
|
1424
|
+
// "userId": "2959123",
|
|
1425
|
+
// "subaccountId": "0",
|
|
1426
|
+
// "symbol": "SOL_USDT",
|
|
1427
|
+
// "time": "1753696843913970",
|
|
1428
|
+
// "side": "sell",
|
|
1429
|
+
// "type": "limitGtc",
|
|
1430
|
+
// "size": "0.066",
|
|
1431
|
+
// "price": "293.2",
|
|
1432
|
+
// "postOnly": false,
|
|
1433
|
+
// "reduceOnly": false,
|
|
1434
|
+
// "executedSize": "0",
|
|
1435
|
+
// "status": "booked",
|
|
1436
|
+
// "avgPrice": "0",
|
|
1437
|
+
// "executedNotional": "0",
|
|
1438
|
+
// "creditFeePaid": "0",
|
|
1439
|
+
// "marginBonusFeePaid": "0",
|
|
1440
|
+
// "quoteFeePaid": "0",
|
|
1441
|
+
// "arkmFeePaid": "0",
|
|
1442
|
+
// "revisionId": "887956326",
|
|
1443
|
+
// "lastTime": "1753696843914830",
|
|
1444
|
+
// "clientOrderId": "",
|
|
1445
|
+
// "lastSize": "0",
|
|
1446
|
+
// "lastPrice": "0",
|
|
1447
|
+
// "lastCreditFee": "0",
|
|
1448
|
+
// "lastMarginBonusFee": "0",
|
|
1449
|
+
// "lastQuoteFee": "0",
|
|
1450
|
+
// "lastArkmFee": "0"
|
|
1451
|
+
// }
|
|
1452
|
+
//
|
|
1453
|
+
// trigger-orders: createOrder
|
|
1454
|
+
//
|
|
1455
|
+
// {
|
|
1456
|
+
// "triggerOrderId": "3716436645573",
|
|
1457
|
+
// "symbol": "SOL_USDT_PERP",
|
|
1458
|
+
// "side": "buy",
|
|
1459
|
+
// "type": "limitGtc",
|
|
1460
|
+
// "size": "0.05",
|
|
1461
|
+
// "price": "150"
|
|
1462
|
+
// }
|
|
1463
|
+
//
|
|
1464
|
+
// trigger-orders: fetchOpenOrders
|
|
1465
|
+
//
|
|
1466
|
+
// {
|
|
1467
|
+
// "subaccountId": "0",
|
|
1468
|
+
// "symbol": "SOL_USDT",
|
|
1469
|
+
// "side": "sell",
|
|
1470
|
+
// "type": "market",
|
|
1471
|
+
// "size": "0.045",
|
|
1472
|
+
// "price": "99.9",
|
|
1473
|
+
// "postOnly": false,
|
|
1474
|
+
// "reduceOnly": false,
|
|
1475
|
+
// "time": "1753768103780063",
|
|
1476
|
+
// "triggerOrderId": "3715847222127",
|
|
1477
|
+
// "triggerType": "stopLoss",
|
|
1478
|
+
// "triggerPriceType": "last",
|
|
1479
|
+
// "triggerPrice": "111",
|
|
1480
|
+
// "clientOrderId": "",
|
|
1481
|
+
// "status": "staged"
|
|
1482
|
+
// }
|
|
1483
|
+
//
|
|
1484
|
+
const marketId = this.safeString(order, 'symbol');
|
|
1485
|
+
market = this.safeMarket(marketId, market);
|
|
1486
|
+
const isPostOnly = this.safeBool(order, 'postOnly');
|
|
1487
|
+
const typeRaw = this.safeString(order, 'type');
|
|
1488
|
+
const orderType = isPostOnly ? 'limit' : this.parseOrderType(typeRaw);
|
|
1489
|
+
const timeInForce = isPostOnly ? 'PO' : this.parseTimeInForce(typeRaw);
|
|
1490
|
+
const quoteFeePaid = this.safeString(order, 'quoteFeePaid');
|
|
1491
|
+
const arkmFeePaid = this.safeString(order, 'arkmFeePaid');
|
|
1492
|
+
const fees = [];
|
|
1493
|
+
if (quoteFeePaid !== undefined) {
|
|
1494
|
+
fees.push({
|
|
1495
|
+
'cost': quoteFeePaid,
|
|
1496
|
+
'currency': this.safeString(market, 'quote'),
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
if (arkmFeePaid !== undefined) {
|
|
1500
|
+
fees.push({
|
|
1501
|
+
'cost': arkmFeePaid,
|
|
1502
|
+
'currency': 'ARKM',
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
const timestamp = this.safeIntegerProduct(order, 'time', 0.001);
|
|
1506
|
+
return this.safeOrder({
|
|
1507
|
+
'id': this.safeString2(order, 'orderId', 'triggerOrderId'),
|
|
1508
|
+
'clientOrderId': this.safeString(order, 'clientOrderId'),
|
|
1509
|
+
'timestamp': timestamp,
|
|
1510
|
+
'datetime': this.iso8601(timestamp),
|
|
1511
|
+
'lastTradeTimeStamp': undefined,
|
|
1512
|
+
'lastUpdateTimestamp': this.safeIntegerProduct(order, 'lastTime', 0.001),
|
|
1513
|
+
'status': this.parseOrderStatus(this.safeString(order, 'status')),
|
|
1514
|
+
'symbol': market['symbol'],
|
|
1515
|
+
'type': orderType,
|
|
1516
|
+
'timeInForce': timeInForce,
|
|
1517
|
+
'postOnly': undefined,
|
|
1518
|
+
'side': this.safeString(order, 'side'),
|
|
1519
|
+
'price': this.safeNumber(order, 'price'),
|
|
1520
|
+
'triggerPrice': undefined,
|
|
1521
|
+
'cost': this.safeNumber(order, 'executedNotional'),
|
|
1522
|
+
'average': this.safeNumberOmitZero(order, 'avgPrice'),
|
|
1523
|
+
'amount': this.safeNumber(order, 'size'),
|
|
1524
|
+
'filled': this.safeNumber(order, ''),
|
|
1525
|
+
'remaining': undefined,
|
|
1526
|
+
'trades': undefined,
|
|
1527
|
+
'fees': fees,
|
|
1528
|
+
'reduceOnly': this.safeBool(order, 'reduceOnly'),
|
|
1529
|
+
'info': order,
|
|
1530
|
+
}, market);
|
|
1531
|
+
}
|
|
1532
|
+
parseOrderType(type) {
|
|
1533
|
+
const types = {
|
|
1534
|
+
'limitGtc': 'limit',
|
|
1535
|
+
'limitIoc': 'limit',
|
|
1536
|
+
'limitFok': 'limit',
|
|
1537
|
+
'market': 'market',
|
|
1538
|
+
};
|
|
1539
|
+
return this.safeStringUpper(types, type, type);
|
|
1540
|
+
}
|
|
1541
|
+
parseTimeInForce(type) {
|
|
1542
|
+
const types = {
|
|
1543
|
+
'limitGtc': 'GTC',
|
|
1544
|
+
'limitIoc': 'IOC',
|
|
1545
|
+
'limitFok': 'FOK',
|
|
1546
|
+
'market': 'IOC',
|
|
1547
|
+
};
|
|
1548
|
+
return this.safeStringUpper(types, type, type);
|
|
1549
|
+
}
|
|
1550
|
+
parseOrderStatus(status) {
|
|
1551
|
+
const statuses = {
|
|
1552
|
+
'new': 'pending',
|
|
1553
|
+
'staged': 'open',
|
|
1554
|
+
'booked': 'open',
|
|
1555
|
+
'taker': 'closed',
|
|
1556
|
+
'maker': 'closed',
|
|
1557
|
+
'cancelled': 'canceled',
|
|
1558
|
+
'closed': 'closed',
|
|
1559
|
+
};
|
|
1560
|
+
return this.safeString(statuses, status, status);
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* @method
|
|
1564
|
+
* @name arkham#fetchMyTrades
|
|
1565
|
+
* @description fetch all trades made by the user
|
|
1566
|
+
* @see https://arkm.com/docs#get/trades/time
|
|
1567
|
+
* @param {string} [symbol] unified market symbol
|
|
1568
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1569
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
1570
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1571
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
1572
|
+
* @param {string} [params.page_token] page_token - used for paging
|
|
1573
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1574
|
+
*/
|
|
1575
|
+
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1576
|
+
await this.loadMarkets();
|
|
1577
|
+
let request = {};
|
|
1578
|
+
if (limit !== undefined) {
|
|
1579
|
+
request['limit'] = limit;
|
|
1580
|
+
}
|
|
1581
|
+
// exchange needs to obtain some `from & to` values, otherwise it does not return any result
|
|
1582
|
+
const defaultRange = 24 * 60 * 60 * 1000; // default to last 24 hours
|
|
1583
|
+
if (since !== undefined) {
|
|
1584
|
+
request['from'] = since * 1000; // convert ms to microseconds
|
|
1585
|
+
}
|
|
1586
|
+
else {
|
|
1587
|
+
request['from'] = (this.milliseconds() - defaultRange) * 1000; // default to last 24 hours
|
|
1588
|
+
}
|
|
1589
|
+
const until = this.safeInteger(params, 'until');
|
|
1590
|
+
if (until !== undefined) {
|
|
1591
|
+
params = this.omit(params, 'until');
|
|
1592
|
+
request['to'] = until * 1000; // convert ms to microseconds
|
|
1593
|
+
}
|
|
1594
|
+
else {
|
|
1595
|
+
request['to'] = this.sum(request['from'], defaultRange * 1000);
|
|
1596
|
+
}
|
|
1597
|
+
[request, params] = this.handleUntilOption('until', request, params);
|
|
1598
|
+
const response = await this.v1PrivateGetTradesTime(this.extend(request, params));
|
|
1599
|
+
//
|
|
1600
|
+
// [
|
|
1601
|
+
// {
|
|
1602
|
+
// "symbol": "SOL_USDT",
|
|
1603
|
+
// "revisionId": "891839406",
|
|
1604
|
+
// "size": "0.042",
|
|
1605
|
+
// "price": "185.06",
|
|
1606
|
+
// "takerSide": "sell",
|
|
1607
|
+
// "time": "1753773952039342",
|
|
1608
|
+
// "orderId": "3717304929194",
|
|
1609
|
+
// "userSide": "sell",
|
|
1610
|
+
// "quoteFee": "0.00777252",
|
|
1611
|
+
// "arkmFee": "0",
|
|
1612
|
+
// "clientOrderId": ""
|
|
1613
|
+
// },
|
|
1614
|
+
// ...
|
|
1615
|
+
//
|
|
1616
|
+
return this.parseTrades(response, undefined, since, limit);
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* @method
|
|
1620
|
+
* @name arkham#fetchAccounts
|
|
1621
|
+
* @description fetch all the accounts associated with a profile
|
|
1622
|
+
* @see https://arkm.com/docs#get/user
|
|
1623
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1624
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
1625
|
+
*/
|
|
1626
|
+
async fetchAccounts(params = {}) {
|
|
1627
|
+
await this.loadMarkets();
|
|
1628
|
+
const request = {};
|
|
1629
|
+
let accountId = undefined;
|
|
1630
|
+
[accountId, params] = this.handleOptionAndParams(params, 'fetchAccounts', 'accountId');
|
|
1631
|
+
if (accountId !== undefined) {
|
|
1632
|
+
request['subAccountId'] = accountId;
|
|
1633
|
+
}
|
|
1634
|
+
const response = await this.v1PrivateGetUser(this.extend(request, params));
|
|
1635
|
+
//
|
|
1636
|
+
// {
|
|
1637
|
+
// "id": "2959123",
|
|
1638
|
+
// "email": "xyz@gmail.com",
|
|
1639
|
+
// "username": "t.123",
|
|
1640
|
+
// "requireMFA": true,
|
|
1641
|
+
// "kycVerifiedAt": "1753434515850673",
|
|
1642
|
+
// "pmm": false,
|
|
1643
|
+
// "dmm": false,
|
|
1644
|
+
// "becameVipAt": "0",
|
|
1645
|
+
// "subaccounts": [
|
|
1646
|
+
// {
|
|
1647
|
+
// "id": "0",
|
|
1648
|
+
// "name": "Primary",
|
|
1649
|
+
// "pinned": true,
|
|
1650
|
+
// "isLsp": false,
|
|
1651
|
+
// "futuresEnabled": true,
|
|
1652
|
+
// "payFeesInArkm": false,
|
|
1653
|
+
// "lspSettings": []
|
|
1654
|
+
// }
|
|
1655
|
+
// ],
|
|
1656
|
+
// "settings": {
|
|
1657
|
+
// "autogenDepositAddresses": false,
|
|
1658
|
+
// "hideBalances": false,
|
|
1659
|
+
// "confirmBeforePlaceOrder": false,
|
|
1660
|
+
// "tickerTapeScroll": true,
|
|
1661
|
+
// "updatesFlash": true,
|
|
1662
|
+
// "notifyOrderFills": false,
|
|
1663
|
+
// "notifyAnnouncements": false,
|
|
1664
|
+
// "notifyMarginUsage": false,
|
|
1665
|
+
// "marginUsageThreshold": "0.5",
|
|
1666
|
+
// "notifyWithdrawals": true,
|
|
1667
|
+
// "notifyDeposits": true,
|
|
1668
|
+
// "notifySendEmail": true,
|
|
1669
|
+
// "notifyRebates": true,
|
|
1670
|
+
// "notifyCommissions": true,
|
|
1671
|
+
// "allowSequenceEmails": true,
|
|
1672
|
+
// "language": "en"
|
|
1673
|
+
// },
|
|
1674
|
+
// "airdropKycAt": null
|
|
1675
|
+
// }
|
|
1676
|
+
//
|
|
1677
|
+
const subAccounts = this.safeList(response, 'subaccounts', []);
|
|
1678
|
+
return this.parseAccounts(subAccounts, params);
|
|
1679
|
+
}
|
|
1680
|
+
parseAccount(account) {
|
|
1681
|
+
//
|
|
1682
|
+
// {
|
|
1683
|
+
// "id": "0",
|
|
1684
|
+
// "name": "Primary",
|
|
1685
|
+
// "pinned": true,
|
|
1686
|
+
// "isLsp": false,
|
|
1687
|
+
// "futuresEnabled": true,
|
|
1688
|
+
// "payFeesInArkm": false,
|
|
1689
|
+
// "lspSettings": []
|
|
1690
|
+
// }
|
|
1691
|
+
//
|
|
1692
|
+
return {
|
|
1693
|
+
'id': this.safeString(account, 'id'),
|
|
1694
|
+
'type': undefined,
|
|
1695
|
+
'code': undefined,
|
|
1696
|
+
'info': account,
|
|
1697
|
+
};
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* @method
|
|
1701
|
+
* @name arkham#fetchBalance
|
|
1702
|
+
* @description query for account info
|
|
1703
|
+
* @see https://arkm.com/docs#get/account/balances
|
|
1704
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1705
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1706
|
+
*/
|
|
1707
|
+
async fetchBalance(params = {}) {
|
|
1708
|
+
await this.loadMarkets();
|
|
1709
|
+
const response = await this.v1PrivateGetAccountBalances(params);
|
|
1710
|
+
//
|
|
1711
|
+
// [
|
|
1712
|
+
// {
|
|
1713
|
+
// "subaccountId": "0",
|
|
1714
|
+
// "symbol": "USDT",
|
|
1715
|
+
// "balance": "19.66494694",
|
|
1716
|
+
// "free": "19.66494694",
|
|
1717
|
+
// "priceUSDT": "1",
|
|
1718
|
+
// "balanceUSDT": "19.66494694",
|
|
1719
|
+
// "freeUSDT": "19.66494694",
|
|
1720
|
+
// "lastUpdateReason": "orderFill",
|
|
1721
|
+
// "lastUpdateTime": "1753773952039342",
|
|
1722
|
+
// "lastUpdateId": "248507437",
|
|
1723
|
+
// "lastUpdateAmount": "7.77252"
|
|
1724
|
+
// },
|
|
1725
|
+
// {
|
|
1726
|
+
// "subaccountId": "0",
|
|
1727
|
+
// "symbol": "SOL",
|
|
1728
|
+
// "balance": "0",
|
|
1729
|
+
// "free": "0",
|
|
1730
|
+
// "priceUSDT": "186.025584673",
|
|
1731
|
+
// "balanceUSDT": "0",
|
|
1732
|
+
// "freeUSDT": "0",
|
|
1733
|
+
// "lastUpdateReason": "orderFill",
|
|
1734
|
+
// "lastUpdateTime": "1753773952039342",
|
|
1735
|
+
// "lastUpdateId": "248507435",
|
|
1736
|
+
// "lastUpdateAmount": "-0.042"
|
|
1737
|
+
// }
|
|
1738
|
+
// ]
|
|
1739
|
+
//
|
|
1740
|
+
return this.parseBalance(response);
|
|
1741
|
+
}
|
|
1742
|
+
parseBalance(response) {
|
|
1743
|
+
const timestamp = this.safeIntegerProduct(response, 'lastUpdateTime', 0.001);
|
|
1744
|
+
const result = {
|
|
1745
|
+
'info': response,
|
|
1746
|
+
'timestamp': timestamp,
|
|
1747
|
+
'datetime': this.iso8601(timestamp),
|
|
1748
|
+
};
|
|
1749
|
+
for (let i = 0; i < response.length; i++) {
|
|
1750
|
+
const balance = response[i];
|
|
1751
|
+
const symbol = this.safeString(balance, 'symbol');
|
|
1752
|
+
const code = this.safeCurrencyCode(symbol);
|
|
1753
|
+
const account = this.account();
|
|
1754
|
+
account['total'] = this.safeString(balance, 'balance');
|
|
1755
|
+
account['free'] = this.safeString(balance, 'free');
|
|
1756
|
+
result[code] = account;
|
|
1757
|
+
}
|
|
1758
|
+
return this.safeBalance(result);
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* @method
|
|
1762
|
+
* @name arkham#createDepositAddress
|
|
1763
|
+
* @description create a currency deposit address
|
|
1764
|
+
* @see https://arkm.com/docs#post/account/deposit/addresses/new
|
|
1765
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
1766
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1767
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1768
|
+
*/
|
|
1769
|
+
async createDepositAddress(code, params = {}) {
|
|
1770
|
+
await this.loadMarkets();
|
|
1771
|
+
let networkCode = undefined;
|
|
1772
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
1773
|
+
if (networkCode === undefined) {
|
|
1774
|
+
throw new errors.ArgumentsRequired(this.id + ' createDepositAddress() requires a "network" param');
|
|
1775
|
+
}
|
|
1776
|
+
const request = {
|
|
1777
|
+
'chain': networkCode,
|
|
1778
|
+
};
|
|
1779
|
+
const response = await this.v1PrivatePostAccountDepositAddressesNew(this.extend(request, params));
|
|
1780
|
+
//
|
|
1781
|
+
// {
|
|
1782
|
+
// "addresses": "12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV"
|
|
1783
|
+
// }
|
|
1784
|
+
//
|
|
1785
|
+
const address = this.safeString(response, 'addresses');
|
|
1786
|
+
return this.parseDepositAddress(address, this.currency(code));
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* @method
|
|
1790
|
+
* @name arkham#fetchDepositAddressesByNetwork
|
|
1791
|
+
* @description fetch the deposit addresses for a currency associated with this account
|
|
1792
|
+
* @see https://arkm.com/docs#get/account/deposit/addresses
|
|
1793
|
+
* @param {string} code unified currency code
|
|
1794
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1795
|
+
* @returns {object} a dictionary [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}, indexed by the network
|
|
1796
|
+
*/
|
|
1797
|
+
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
1798
|
+
await this.loadMarkets();
|
|
1799
|
+
let networkCode = undefined;
|
|
1800
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
1801
|
+
if (networkCode === undefined) {
|
|
1802
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddressesByNetwork() requires a "network" param');
|
|
1803
|
+
}
|
|
1804
|
+
const request = {
|
|
1805
|
+
'chain': this.networkCodeToId(networkCode),
|
|
1806
|
+
};
|
|
1807
|
+
const response = await this.v1PrivateGetAccountDepositAddresses(this.extend(request, params));
|
|
1808
|
+
//
|
|
1809
|
+
// {
|
|
1810
|
+
// "addresses": [
|
|
1811
|
+
// "12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV"
|
|
1812
|
+
// ]
|
|
1813
|
+
// }
|
|
1814
|
+
//
|
|
1815
|
+
const data = this.safeList(response, 'addresses');
|
|
1816
|
+
const parsed = this.parseDepositAddresses(data, undefined, false, { 'network': networkCode });
|
|
1817
|
+
return this.indexBy(parsed, 'network');
|
|
1818
|
+
}
|
|
1819
|
+
parseDepositAddress(entry, currency = undefined) {
|
|
1820
|
+
//
|
|
1821
|
+
// "12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV"
|
|
1822
|
+
//
|
|
1823
|
+
return {
|
|
1824
|
+
'info': entry,
|
|
1825
|
+
'currency': this.safeString(currency, 'code'),
|
|
1826
|
+
'network': undefined,
|
|
1827
|
+
'address': entry,
|
|
1828
|
+
'tag': undefined,
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* @method
|
|
1833
|
+
* @name arkham#fetchDepositAddress
|
|
1834
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
1835
|
+
* @see https://arkm.com/docs#get/account/deposit/addresses
|
|
1836
|
+
* @param {string} code unified currency code
|
|
1837
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1838
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1839
|
+
*/
|
|
1840
|
+
async fetchDepositAddress(code, params = {}) {
|
|
1841
|
+
await this.loadMarkets();
|
|
1842
|
+
const currency = this.currency(code);
|
|
1843
|
+
const networkCodeAndParams = this.handleNetworkCodeAndParams(params);
|
|
1844
|
+
const networkCode = networkCodeAndParams[0];
|
|
1845
|
+
const indexedAddresses = await this.fetchDepositAddressesByNetwork(code, params);
|
|
1846
|
+
const selectedNetworkCode = this.selectNetworkCodeFromUnifiedNetworks(currency['code'], networkCode, indexedAddresses);
|
|
1847
|
+
const address = this.safeDict(indexedAddresses, selectedNetworkCode);
|
|
1848
|
+
if (address === undefined) {
|
|
1849
|
+
throw new errors.InvalidAddress(this.id + ' fetchDepositAddress() could not find a deposit address for ' + code);
|
|
1850
|
+
}
|
|
1851
|
+
return address;
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* @method
|
|
1855
|
+
* @name arkham#fetchDeposits
|
|
1856
|
+
* @description fetch all deposits made to an account
|
|
1857
|
+
* @see https://arkm.com/docs#get/account/deposits
|
|
1858
|
+
* @param {string} code unified currency code
|
|
1859
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
1860
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
1861
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1862
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1863
|
+
*/
|
|
1864
|
+
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1865
|
+
await this.loadMarkets();
|
|
1866
|
+
const request = {};
|
|
1867
|
+
if (limit !== undefined) {
|
|
1868
|
+
request['limit'] = limit;
|
|
1869
|
+
}
|
|
1870
|
+
const response = await this.v1PrivateGetAccountDeposits(this.extend(request, params));
|
|
1871
|
+
//
|
|
1872
|
+
// [
|
|
1873
|
+
// {
|
|
1874
|
+
// "id": "238644",
|
|
1875
|
+
// "symbol": "SOL",
|
|
1876
|
+
// "amount": "0.104",
|
|
1877
|
+
// "time": "1753436404000000",
|
|
1878
|
+
// "confirmed": true,
|
|
1879
|
+
// "transactionHash": "1DRxbbyePTsMuB82SDf2fG5gLXH5iYnY8TQDstDPLULpLtjMJtF1ug1T4Mf8B6DSb8fp2sb5YtdbyqieZ2tkE1Ve",
|
|
1880
|
+
// "chain": "Solana",
|
|
1881
|
+
// "depositAddress": "12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV",
|
|
1882
|
+
// "price": "180.322010164"
|
|
1883
|
+
// }
|
|
1884
|
+
// ]
|
|
1885
|
+
//
|
|
1886
|
+
let currency = undefined;
|
|
1887
|
+
if (code !== undefined) {
|
|
1888
|
+
currency = this.currency(code);
|
|
1889
|
+
}
|
|
1890
|
+
return this.parseTransactions(response, currency, since, limit);
|
|
1891
|
+
}
|
|
1892
|
+
parseTransaction(transaction, currency = undefined) {
|
|
1893
|
+
//
|
|
1894
|
+
// {
|
|
1895
|
+
// "id": "238644",
|
|
1896
|
+
// "symbol": "SOL",
|
|
1897
|
+
// "amount": "0.104",
|
|
1898
|
+
// "time": "1753436404000000",
|
|
1899
|
+
// "confirmed": true,
|
|
1900
|
+
// "transactionHash": "1DRxbbyePTsMuB82SDf2fG5gLXH5iYnY8TQDstDPLULpLtjMJtF1ug1T4Mf8B6DSb8fp2sb5YtdbyqieZ2tkE1Ve",
|
|
1901
|
+
// "chain": "Solana",
|
|
1902
|
+
// "depositAddress": "12NauJ26TUT9aYkpId7YdePJJDRMGbAsEMVoTVUvBErV",
|
|
1903
|
+
// "price": "180.322010164"
|
|
1904
|
+
// }
|
|
1905
|
+
//
|
|
1906
|
+
const address = this.safeString(transaction, 'depositAddress');
|
|
1907
|
+
const timestamp = this.safeIntegerProduct(transaction, 'time', 0.001);
|
|
1908
|
+
const confirmd = this.safeBool(transaction, 'confirmed');
|
|
1909
|
+
let status = undefined;
|
|
1910
|
+
if (confirmd) {
|
|
1911
|
+
status = 'ok';
|
|
1912
|
+
}
|
|
1913
|
+
const currencyId = this.safeString(transaction, 'symbol');
|
|
1914
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
1915
|
+
return {
|
|
1916
|
+
'info': transaction,
|
|
1917
|
+
'id': this.safeString(transaction, 'id'),
|
|
1918
|
+
'txid': this.safeString(transaction, 'transactionHash'),
|
|
1919
|
+
'type': undefined,
|
|
1920
|
+
'currency': code,
|
|
1921
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'chain')),
|
|
1922
|
+
'amount': this.safeNumber(transaction, 'amount'),
|
|
1923
|
+
'status': status,
|
|
1924
|
+
'timestamp': timestamp,
|
|
1925
|
+
'datetime': this.iso8601(timestamp),
|
|
1926
|
+
'address': address,
|
|
1927
|
+
'addressFrom': undefined,
|
|
1928
|
+
'addressTo': address,
|
|
1929
|
+
'tag': undefined,
|
|
1930
|
+
'tagFrom': undefined,
|
|
1931
|
+
'tagTo': undefined,
|
|
1932
|
+
'updated': undefined,
|
|
1933
|
+
'comment': undefined,
|
|
1934
|
+
'fee': undefined,
|
|
1935
|
+
'internal': false,
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* @method
|
|
1940
|
+
* @name arkham#fetchTradingFees
|
|
1941
|
+
* @description fetch the trading fees for multiple markets
|
|
1942
|
+
* @see https://arkm.com/docs#get/account/fees
|
|
1943
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1944
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
1945
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
1946
|
+
*/
|
|
1947
|
+
async fetchTradingFees(params = {}) {
|
|
1948
|
+
await this.loadMarkets();
|
|
1949
|
+
const response = await this.v1PrivateGetAccountFees(params);
|
|
1950
|
+
//
|
|
1951
|
+
// {
|
|
1952
|
+
// "perpMakerFee": "1.23",
|
|
1953
|
+
// "perpTakerFee": "1.23",
|
|
1954
|
+
// "spotMakerFee": "1.23",
|
|
1955
|
+
// "spotTakerFee": "1.23"
|
|
1956
|
+
// }
|
|
1957
|
+
//
|
|
1958
|
+
const symbols = Object.keys(this.markets);
|
|
1959
|
+
const result = {};
|
|
1960
|
+
const spotMaker = this.safeNumber(response, 'spotMakerFee');
|
|
1961
|
+
const spotTaker = this.safeNumber(response, 'spotTakerFee');
|
|
1962
|
+
const perpMaker = this.safeNumber(response, 'perpMakerFee');
|
|
1963
|
+
const perpTaker = this.safeNumber(response, 'perpTakerFee');
|
|
1964
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
1965
|
+
const symbol = symbols[i];
|
|
1966
|
+
const market = this.markets[symbol];
|
|
1967
|
+
result[symbol] = {
|
|
1968
|
+
'info': response,
|
|
1969
|
+
'symbol': symbol,
|
|
1970
|
+
};
|
|
1971
|
+
if (market['spot']) {
|
|
1972
|
+
result[symbol]['maker'] = spotMaker;
|
|
1973
|
+
result[symbol]['taker'] = spotTaker;
|
|
1974
|
+
}
|
|
1975
|
+
else if (market['swap'] || market['future']) {
|
|
1976
|
+
result[symbol]['maker'] = perpMaker;
|
|
1977
|
+
result[symbol]['taker'] = perpTaker;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
return result;
|
|
1981
|
+
}
|
|
1982
|
+
/**
|
|
1983
|
+
* @method
|
|
1984
|
+
* @name arkham#fetchFundingHistory
|
|
1985
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
1986
|
+
* @see https://arkm.com/docs#get/account/funding-rate-payments
|
|
1987
|
+
* @param {string} [symbol] unified market symbol
|
|
1988
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
1989
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
1990
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1991
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1992
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
1993
|
+
*/
|
|
1994
|
+
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1995
|
+
await this.loadMarkets();
|
|
1996
|
+
let market = undefined;
|
|
1997
|
+
if (symbol !== undefined) {
|
|
1998
|
+
market = this.market(symbol);
|
|
1999
|
+
}
|
|
2000
|
+
const request = {};
|
|
2001
|
+
if (limit !== undefined) {
|
|
2002
|
+
request['limit'] = limit;
|
|
2003
|
+
}
|
|
2004
|
+
const response = await this.v1PrivateGetAccountFundingRatePayments(this.extend(request, params));
|
|
2005
|
+
//
|
|
2006
|
+
// [
|
|
2007
|
+
// {
|
|
2008
|
+
// "amount": "20.1",
|
|
2009
|
+
// "assetSymbol": "BTC",
|
|
2010
|
+
// "indexPrice": "1.23",
|
|
2011
|
+
// "pairSymbol": "BTC_USDT",
|
|
2012
|
+
// "time": 1704067200000000,
|
|
2013
|
+
// "id": 1,
|
|
2014
|
+
// "subaccountId": 1,
|
|
2015
|
+
// "userId": 1
|
|
2016
|
+
// },
|
|
2017
|
+
// ...
|
|
2018
|
+
// ]
|
|
2019
|
+
//
|
|
2020
|
+
return this.parseIncomes(response, market, since, limit);
|
|
2021
|
+
}
|
|
2022
|
+
parseIncome(income, market = undefined) {
|
|
2023
|
+
//
|
|
2024
|
+
// {
|
|
2025
|
+
// "amount": "20.1",
|
|
2026
|
+
// "assetSymbol": "BTC",
|
|
2027
|
+
// "indexPrice": "1.23",
|
|
2028
|
+
// "pairSymbol": "BTC_USDT",
|
|
2029
|
+
// "time": 1704067200000000,
|
|
2030
|
+
// "id": 1,
|
|
2031
|
+
// "subaccountId": 1,
|
|
2032
|
+
// "userId": 1
|
|
2033
|
+
// }
|
|
2034
|
+
//
|
|
2035
|
+
const marketId = this.safeString(income, 'pairSymbol');
|
|
2036
|
+
const currencyId = this.safeString(income, 'assetSymbol');
|
|
2037
|
+
const timestamp = this.safeIntegerProduct(income, 'time', 0.001);
|
|
2038
|
+
return {
|
|
2039
|
+
'info': income,
|
|
2040
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
2041
|
+
'code': this.safeCurrencyCode(currencyId),
|
|
2042
|
+
'timestamp': timestamp,
|
|
2043
|
+
'datetime': this.iso8601(timestamp),
|
|
2044
|
+
'id': this.safeString(income, 'id'),
|
|
2045
|
+
'amount': this.safeNumber(income, 'amount'),
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* @method
|
|
2050
|
+
* @name arkham#fetchLeverage
|
|
2051
|
+
* @description fetch the set leverage for a market
|
|
2052
|
+
* @see https://arkm.com/docs#get/account/leverage
|
|
2053
|
+
* @param {string} symbol unified market symbol
|
|
2054
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2055
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
2056
|
+
*/
|
|
2057
|
+
async fetchLeverage(symbol, params = {}) {
|
|
2058
|
+
await this.loadMarkets();
|
|
2059
|
+
const market = this.market(symbol);
|
|
2060
|
+
const marketId = this.safeString(market, 'id');
|
|
2061
|
+
const request = {
|
|
2062
|
+
'symbol': marketId,
|
|
2063
|
+
};
|
|
2064
|
+
const response = await this.v1PrivateGetAccountLeverage(this.extend(request, params));
|
|
2065
|
+
//
|
|
2066
|
+
// might be empty if not changed from default value (which is 1x)
|
|
2067
|
+
//
|
|
2068
|
+
// [
|
|
2069
|
+
// {
|
|
2070
|
+
// "symbol": "BTC_USDT_PERP",
|
|
2071
|
+
// "leverage": "7"
|
|
2072
|
+
// },
|
|
2073
|
+
// {
|
|
2074
|
+
// "symbol": "ETH_USDT_PERP",
|
|
2075
|
+
// "leverage": "5"
|
|
2076
|
+
// }
|
|
2077
|
+
// ]
|
|
2078
|
+
//
|
|
2079
|
+
const indexed = this.indexBy(response, 'symbol');
|
|
2080
|
+
const data = this.safeDict(indexed, marketId, {});
|
|
2081
|
+
return this.parseLeverage(data, market);
|
|
2082
|
+
}
|
|
2083
|
+
parseLeverage(leverage, market = undefined) {
|
|
2084
|
+
//
|
|
2085
|
+
// {
|
|
2086
|
+
// "symbol": "ETH_USDT_PERP",
|
|
2087
|
+
// "leverage": "5"
|
|
2088
|
+
// }
|
|
2089
|
+
//
|
|
2090
|
+
const marketId = this.safeString(leverage, 'symbol');
|
|
2091
|
+
const leverageNum = this.safeNumber(leverage, 'leverage'); // default leverage is 1 typically
|
|
2092
|
+
return {
|
|
2093
|
+
'info': leverage,
|
|
2094
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
2095
|
+
'marginMode': undefined,
|
|
2096
|
+
'longLeverage': leverageNum,
|
|
2097
|
+
'shortLeverage': leverageNum,
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* @method
|
|
2102
|
+
* @name arkham#setLeverage
|
|
2103
|
+
* @description set the level of leverage for a market
|
|
2104
|
+
* @see https://arkm.com/docs#post/account/leverage
|
|
2105
|
+
* @param {float} leverage the rate of leverage
|
|
2106
|
+
* @param {string} symbol unified market symbol
|
|
2107
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2108
|
+
* @returns {object} response from the exchange
|
|
2109
|
+
*/
|
|
2110
|
+
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
2111
|
+
if (symbol === undefined) {
|
|
2112
|
+
throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
2113
|
+
}
|
|
2114
|
+
await this.loadMarkets();
|
|
2115
|
+
const market = this.market(symbol);
|
|
2116
|
+
const leverageString = this.numberToString(leverage);
|
|
2117
|
+
const marketId = this.safeString(market, 'id');
|
|
2118
|
+
const request = {
|
|
2119
|
+
'symbol': marketId,
|
|
2120
|
+
'leverage': leverageString,
|
|
2121
|
+
};
|
|
2122
|
+
const response = await this.v1PrivatePostAccountLeverage(this.extend(request, params));
|
|
2123
|
+
//
|
|
2124
|
+
// response is just empty string
|
|
2125
|
+
//
|
|
2126
|
+
return this.parseLeverage(response, market);
|
|
2127
|
+
}
|
|
2128
|
+
/**
|
|
2129
|
+
* @method
|
|
2130
|
+
* @name arkkm#fetchPositions
|
|
2131
|
+
* @description fetch all open positions
|
|
2132
|
+
* @see https://arkm.com/docs#get/account/positions
|
|
2133
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2134
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2135
|
+
* @param {boolean} [params.standard] whether to fetch standard contract positions
|
|
2136
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2137
|
+
*/
|
|
2138
|
+
async fetchPositions(symbols = undefined, params = {}) {
|
|
2139
|
+
await this.loadMarkets();
|
|
2140
|
+
symbols = this.marketSymbols(symbols);
|
|
2141
|
+
const response = await this.v1PrivateGetAccountPositions(params);
|
|
2142
|
+
//
|
|
2143
|
+
// [
|
|
2144
|
+
// {
|
|
2145
|
+
// "subaccountId": "0",
|
|
2146
|
+
// "symbol": "SOL_USDT_PERP",
|
|
2147
|
+
// "base": "0.037",
|
|
2148
|
+
// "quote": "-6.44614",
|
|
2149
|
+
// "openBuySize": "0",
|
|
2150
|
+
// "openSellSize": "0",
|
|
2151
|
+
// "openBuyNotional": "0",
|
|
2152
|
+
// "openSellNotional": "0",
|
|
2153
|
+
// "lastUpdateReason": "orderFill",
|
|
2154
|
+
// "lastUpdateTime": "1753903829389966",
|
|
2155
|
+
// "lastUpdateId": "250434684",
|
|
2156
|
+
// "lastUpdateBaseDelta": "0.037",
|
|
2157
|
+
// "lastUpdateQuoteDelta": "-6.44614",
|
|
2158
|
+
// "breakEvenPrice": "174.22",
|
|
2159
|
+
// "markPrice": "174.33",
|
|
2160
|
+
// "value": "6.45021",
|
|
2161
|
+
// "pnl": "0.00407",
|
|
2162
|
+
// "initialMargin": "0.645021",
|
|
2163
|
+
// "maintenanceMargin": "0.3870126",
|
|
2164
|
+
// "averageEntryPrice": "174.22"
|
|
2165
|
+
// }
|
|
2166
|
+
// ]
|
|
2167
|
+
//
|
|
2168
|
+
return this.parsePositions(response, symbols);
|
|
2169
|
+
}
|
|
2170
|
+
parsePosition(position, market = undefined) {
|
|
2171
|
+
//
|
|
2172
|
+
// {
|
|
2173
|
+
// "subaccountId": "0",
|
|
2174
|
+
// "symbol": "SOL_USDT_PERP",
|
|
2175
|
+
// "base": "0.037", // negative for short position
|
|
2176
|
+
// "quote": "-6.44614", // negative for long position
|
|
2177
|
+
// "openBuySize": "0",
|
|
2178
|
+
// "openSellSize": "0",
|
|
2179
|
+
// "openBuyNotional": "0",
|
|
2180
|
+
// "openSellNotional": "0",
|
|
2181
|
+
// "lastUpdateReason": "orderFill",
|
|
2182
|
+
// "lastUpdateTime": "1753903829389966",
|
|
2183
|
+
// "lastUpdateId": "250434684",
|
|
2184
|
+
// "lastUpdateBaseDelta": "0.037",
|
|
2185
|
+
// "lastUpdateQuoteDelta": "-6.44614",
|
|
2186
|
+
// "breakEvenPrice": "174.22",
|
|
2187
|
+
// "markPrice": "174.33",
|
|
2188
|
+
// "value": "6.45021",
|
|
2189
|
+
// "pnl": "0.00407",
|
|
2190
|
+
// "initialMargin": "0.645021",
|
|
2191
|
+
// "maintenanceMargin": "0.3870126",
|
|
2192
|
+
// "averageEntryPrice": "174.22"
|
|
2193
|
+
// }
|
|
2194
|
+
//
|
|
2195
|
+
const base = this.safeString(position, 'base');
|
|
2196
|
+
const baseAbs = Precise["default"].stringAbs(base);
|
|
2197
|
+
const isLong = Precise["default"].stringGe(base, '0');
|
|
2198
|
+
const side = isLong ? 'long' : 'short';
|
|
2199
|
+
const marketId = this.safeString(position, 'symbol');
|
|
2200
|
+
const notional = this.safeString(position, 'value');
|
|
2201
|
+
return this.safePosition({
|
|
2202
|
+
'info': position,
|
|
2203
|
+
'id': undefined,
|
|
2204
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
2205
|
+
'notional': this.parseNumber(Precise["default"].stringAbs(notional)),
|
|
2206
|
+
'marginMode': undefined,
|
|
2207
|
+
'liquidationPrice': undefined,
|
|
2208
|
+
'entryPrice': this.safeNumber(position, 'averageEntryPrice'),
|
|
2209
|
+
'unrealizedPnl': this.safeNumber(position, 'pnl'),
|
|
2210
|
+
'realizedPnl': undefined,
|
|
2211
|
+
'percentage': undefined,
|
|
2212
|
+
'contracts': this.parseNumber(baseAbs),
|
|
2213
|
+
'contractSize': undefined,
|
|
2214
|
+
'markPrice': this.safeNumber(position, 'markPrice'),
|
|
2215
|
+
'lastPrice': undefined,
|
|
2216
|
+
'side': side,
|
|
2217
|
+
'hedged': undefined,
|
|
2218
|
+
'timestamp': undefined,
|
|
2219
|
+
'datetime': undefined,
|
|
2220
|
+
'lastUpdateTimestamp': this.safeInteger(position, 'lastUpdateTime'),
|
|
2221
|
+
'maintenanceMargin': this.safeNumber(position, 'maintenanceMargin'),
|
|
2222
|
+
'maintenanceMarginPercentage': undefined,
|
|
2223
|
+
'collateral': undefined,
|
|
2224
|
+
'initialMargin': this.safeNumber(position, 'initialMargin'),
|
|
2225
|
+
'initialMarginPercentage': undefined,
|
|
2226
|
+
'leverage': undefined,
|
|
2227
|
+
'marginRatio': undefined,
|
|
2228
|
+
'stopLossPrice': undefined,
|
|
2229
|
+
'takeProfitPrice': undefined,
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* @method
|
|
2234
|
+
* @name arkkm#withdraw
|
|
2235
|
+
* @description make a withdrawal
|
|
2236
|
+
* @see https://arkm.com/docs#post/account/withdraw
|
|
2237
|
+
* @see https://arkm.com/docs#get/account/withdrawal/addresses
|
|
2238
|
+
* @param {string} code unified currency code
|
|
2239
|
+
* @param {float} amount the amount to withdraw
|
|
2240
|
+
* @param {string} address the address to withdraw to
|
|
2241
|
+
* @param {string} tag
|
|
2242
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2243
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2244
|
+
*/
|
|
2245
|
+
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
2246
|
+
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
2247
|
+
await this.loadMarkets();
|
|
2248
|
+
const withdrawalAddresses = await this.v1PrivateGetAccountWithdrawalAddresses();
|
|
2249
|
+
//
|
|
2250
|
+
// [
|
|
2251
|
+
// {
|
|
2252
|
+
// "id": "12345",
|
|
2253
|
+
// "chain": "ETH",
|
|
2254
|
+
// "address": "0x743f79D65EA07AA222F4a83c10dee4210A920a6e",
|
|
2255
|
+
// "label": "my_binance",
|
|
2256
|
+
// "createdAt": "1753905200074355",
|
|
2257
|
+
// "updatedAt": "1753905213464278",
|
|
2258
|
+
// "confirmed": true
|
|
2259
|
+
// }
|
|
2260
|
+
// ]
|
|
2261
|
+
//
|
|
2262
|
+
const currency = this.currency(code);
|
|
2263
|
+
const request = {
|
|
2264
|
+
'symbol': currency['id'],
|
|
2265
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
2266
|
+
'subaccountId': this.safeInteger(params, 'subAccountId', 0),
|
|
2267
|
+
};
|
|
2268
|
+
let networkCode = undefined;
|
|
2269
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2270
|
+
if (networkCode === undefined) {
|
|
2271
|
+
throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a "network" param');
|
|
2272
|
+
}
|
|
2273
|
+
const indexedList = this.groupBy(withdrawalAddresses, 'address');
|
|
2274
|
+
if (!(address in indexedList)) {
|
|
2275
|
+
throw new errors.InvalidAddress(this.id + ' withdraw() requires an address that has been previously added to the whitelisted addresses');
|
|
2276
|
+
}
|
|
2277
|
+
const withdrawalObjects = indexedList[address];
|
|
2278
|
+
let foundWithdrawalObject = undefined;
|
|
2279
|
+
for (let i = 0; i < withdrawalObjects.length; i++) {
|
|
2280
|
+
const withdrawalObject = withdrawalObjects[i];
|
|
2281
|
+
if (withdrawalObject['chain'] === networkCode) {
|
|
2282
|
+
foundWithdrawalObject = withdrawalObject;
|
|
2283
|
+
break;
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
if (foundWithdrawalObject === undefined) {
|
|
2287
|
+
throw new errors.InvalidAddress(this.id + ' withdraw() can not find whitelisted withdrawal address for ' + address + ' with network ' + networkCode);
|
|
2288
|
+
}
|
|
2289
|
+
request['addressId'] = this.safeInteger(foundWithdrawalObject, 'id');
|
|
2290
|
+
const response = await this.v1PrivatePostAccountWithdraw(this.extend(request, params));
|
|
2291
|
+
//
|
|
2292
|
+
// response is a weird string like:
|
|
2293
|
+
//
|
|
2294
|
+
// "1234709779980\\n"
|
|
2295
|
+
//
|
|
2296
|
+
const responseString = response.replace('\n', '');
|
|
2297
|
+
const data = { 'id': responseString };
|
|
2298
|
+
return this.parseTransaction(data, currency);
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* @method
|
|
2302
|
+
* @name arkham#fetchLeverageTiers
|
|
2303
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
2304
|
+
* @see https://arkm.com/docs#get/public/margin-schedules
|
|
2305
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2306
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2307
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
2308
|
+
*/
|
|
2309
|
+
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
2310
|
+
await this.loadMarkets();
|
|
2311
|
+
if (symbols === undefined) {
|
|
2312
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchLeverageTiers() requires a symbols argument');
|
|
2313
|
+
}
|
|
2314
|
+
symbols = this.marketSymbols(symbols);
|
|
2315
|
+
const response = await this.v1PublicGetMarginSchedules(params);
|
|
2316
|
+
//
|
|
2317
|
+
// [
|
|
2318
|
+
// {
|
|
2319
|
+
// "name": "A",
|
|
2320
|
+
// "bands": [
|
|
2321
|
+
// {
|
|
2322
|
+
// "positionLimit": "1000000",
|
|
2323
|
+
// "leverageRate": "50",
|
|
2324
|
+
// "marginRate": "0.02",
|
|
2325
|
+
// "rebate": "0"
|
|
2326
|
+
// },
|
|
2327
|
+
// {
|
|
2328
|
+
// "positionLimit": "2000000",
|
|
2329
|
+
// "leverageRate": "25",
|
|
2330
|
+
// "marginRate": "0.04",
|
|
2331
|
+
// "rebate": "20000"
|
|
2332
|
+
// },
|
|
2333
|
+
// {
|
|
2334
|
+
// "positionLimit": "5000000",
|
|
2335
|
+
// "leverageRate": "20",
|
|
2336
|
+
// "marginRate": "0.05",
|
|
2337
|
+
// "rebate": "40000"
|
|
2338
|
+
// }
|
|
2339
|
+
// ]
|
|
2340
|
+
// },
|
|
2341
|
+
// {
|
|
2342
|
+
// "name": "B",
|
|
2343
|
+
// ...
|
|
2344
|
+
//
|
|
2345
|
+
return this.parseLeverageTiers(response, symbols);
|
|
2346
|
+
}
|
|
2347
|
+
parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
|
|
2348
|
+
// overloaded method
|
|
2349
|
+
const indexed = this.indexBy(response, 'name');
|
|
2350
|
+
symbols = this.marketSymbols(symbols);
|
|
2351
|
+
const tiers = {};
|
|
2352
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
2353
|
+
const symbol = symbols[i];
|
|
2354
|
+
const market = this.market(symbol);
|
|
2355
|
+
const marginSchedule = this.safeString(market['info'], 'marginSchedule');
|
|
2356
|
+
if (marginSchedule === undefined) {
|
|
2357
|
+
throw new errors.BadSymbol(this.id + ' fetchLeverageTiers() could not find marginSchedule for ' + symbol);
|
|
2358
|
+
}
|
|
2359
|
+
const selectedDict = this.safeDict(indexed, marginSchedule, {});
|
|
2360
|
+
const bands = this.safeList(selectedDict, 'bands', []);
|
|
2361
|
+
tiers[symbol] = this.parseMarketLeverageTiers(bands, market);
|
|
2362
|
+
}
|
|
2363
|
+
return tiers;
|
|
2364
|
+
}
|
|
2365
|
+
parseMarketLeverageTiers(info, market = undefined) {
|
|
2366
|
+
const tiers = [];
|
|
2367
|
+
const brackets = info;
|
|
2368
|
+
let minNotional = 0;
|
|
2369
|
+
for (let i = 0; i < brackets.length; i++) {
|
|
2370
|
+
const tier = brackets[i];
|
|
2371
|
+
const marketId = this.safeString(info, 'market');
|
|
2372
|
+
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
2373
|
+
const maxNotional = this.safeNumber(tier, 'positionLimit');
|
|
2374
|
+
tiers.push({
|
|
2375
|
+
'tier': this.sum(i, 1),
|
|
2376
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
2377
|
+
'currency': market['linear'] ? market['base'] : market['quote'],
|
|
2378
|
+
'minNotional': minNotional,
|
|
2379
|
+
'maxNotional': maxNotional,
|
|
2380
|
+
'maintenanceMarginRate': this.safeNumber(tier, 'marginRate'),
|
|
2381
|
+
'maxLeverage': this.safeInteger(tier, 'leverageRate'),
|
|
2382
|
+
'info': tier,
|
|
2383
|
+
});
|
|
2384
|
+
minNotional = maxNotional;
|
|
2385
|
+
}
|
|
2386
|
+
return tiers;
|
|
2387
|
+
}
|
|
2388
|
+
findTimeframeByDuration(duration) {
|
|
2389
|
+
// this method is used to find the timeframe by duration in seconds
|
|
2390
|
+
const timeframes = this.safeDict(this.options, 'timeframeDurations', {});
|
|
2391
|
+
const keys = Object.keys(timeframes);
|
|
2392
|
+
for (let i = 0; i < keys.length; i++) {
|
|
2393
|
+
const timeframe = keys[i];
|
|
2394
|
+
const durationInMicroseconds = this.safeInteger(timeframes, timeframe);
|
|
2395
|
+
if (durationInMicroseconds === duration) {
|
|
2396
|
+
return timeframe;
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
return undefined;
|
|
2400
|
+
}
|
|
2401
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
2402
|
+
const type = this.safeString(api, 0);
|
|
2403
|
+
const access = this.safeString(api, 1);
|
|
2404
|
+
const accessPart = (access === 'public') ? access + '/' : '';
|
|
2405
|
+
const query = this.omit(params, this.extractParams(path));
|
|
2406
|
+
path = this.implodeParams(path, params);
|
|
2407
|
+
let url = this.urls['api'][type] + '/' + accessPart + path;
|
|
2408
|
+
let queryString = '';
|
|
2409
|
+
if (method === 'GET') {
|
|
2410
|
+
if (Object.keys(query).length) {
|
|
2411
|
+
queryString = this.urlencode(query);
|
|
2412
|
+
url += '?' + queryString;
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
if (access === 'private') {
|
|
2416
|
+
this.checkRequiredCredentials();
|
|
2417
|
+
const expires = (this.milliseconds() + this.safeInteger(this.options, 'requestExpiration', 5000)) * 1000; // need macroseconds
|
|
2418
|
+
if (method === 'POST') {
|
|
2419
|
+
body = this.json(params);
|
|
2420
|
+
}
|
|
2421
|
+
if (queryString !== '') {
|
|
2422
|
+
path = path + '?' + queryString;
|
|
2423
|
+
}
|
|
2424
|
+
const bodyStr = (body !== undefined) ? body : '';
|
|
2425
|
+
const payload = this.apiKey + expires.toString() + method.toUpperCase() + '/' + path + bodyStr;
|
|
2426
|
+
const decodedSecret = this.base64ToBinary(this.secret);
|
|
2427
|
+
const signature = this.hmac(this.encode(payload), decodedSecret, sha256.sha256, 'base64');
|
|
2428
|
+
headers = {
|
|
2429
|
+
'Content-Type': 'application/json',
|
|
2430
|
+
'Accept': 'application/json',
|
|
2431
|
+
'Arkham-Api-Key': this.apiKey,
|
|
2432
|
+
'Arkham-Expires': expires.toString(),
|
|
2433
|
+
'Arkham-Signature': signature,
|
|
2434
|
+
'Arkham-Broker-Id': '1001',
|
|
2435
|
+
};
|
|
2436
|
+
}
|
|
2437
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
2438
|
+
}
|
|
2439
|
+
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
2440
|
+
//
|
|
2441
|
+
// error example:
|
|
2442
|
+
//
|
|
2443
|
+
// {
|
|
2444
|
+
// "id": "30005",
|
|
2445
|
+
// "name": "InvalidNotional",
|
|
2446
|
+
// "message": "order validation failed: invalid notional: notional 0.25 is less than min notional 1"
|
|
2447
|
+
// }
|
|
2448
|
+
//
|
|
2449
|
+
const message = this.safeString(response, 'message');
|
|
2450
|
+
if (message !== undefined) {
|
|
2451
|
+
const errorCode = this.safeString(response, 'id');
|
|
2452
|
+
const feedback = this.id + ' ' + body;
|
|
2453
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
|
|
2454
|
+
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
2455
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
|
|
2456
|
+
throw new errors.ExchangeError(this.id + ' ' + body);
|
|
2457
|
+
}
|
|
2458
|
+
return undefined;
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
exports["default"] = arkham;
|