ccxt 4.5.28 → 4.5.30
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 +24 -7
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +6 -1
- package/dist/cjs/src/abstract/bydfi.js +11 -0
- package/dist/cjs/src/alpaca.js +21 -21
- package/dist/cjs/src/apex.js +20 -20
- package/dist/cjs/src/arkham.js +22 -22
- package/dist/cjs/src/ascendex.js +28 -28
- package/dist/cjs/src/backpack.js +22 -22
- package/dist/cjs/src/base/Exchange.js +48 -38
- package/dist/cjs/src/base/functions/throttle.js +54 -5
- package/dist/cjs/src/bigone.js +19 -19
- package/dist/cjs/src/binance.js +83 -82
- package/dist/cjs/src/bingx.js +47 -47
- package/dist/cjs/src/bit2c.js +11 -11
- package/dist/cjs/src/bitbank.js +49 -48
- package/dist/cjs/src/bitbns.js +13 -13
- package/dist/cjs/src/bitfinex.js +33 -33
- package/dist/cjs/src/bitflyer.js +17 -17
- package/dist/cjs/src/bitget.js +58 -57
- package/dist/cjs/src/bithumb.js +10 -10
- package/dist/cjs/src/bitmart.js +44 -44
- package/dist/cjs/src/bitmex.js +24 -24
- package/dist/cjs/src/bitopro.js +20 -20
- package/dist/cjs/src/bitrue.js +18 -18
- package/dist/cjs/src/bitso.js +20 -20
- package/dist/cjs/src/bitstamp.js +21 -21
- package/dist/cjs/src/bittrade.js +20 -20
- package/dist/cjs/src/bitvavo.js +19 -19
- package/dist/cjs/src/blockchaincom.js +20 -20
- package/dist/cjs/src/blofin.js +26 -26
- package/dist/cjs/src/btcalpha.js +35 -34
- package/dist/cjs/src/btcbox.js +10 -10
- package/dist/cjs/src/btcmarkets.js +16 -16
- package/dist/cjs/src/btcturk.js +10 -10
- package/dist/cjs/src/bullish.js +27 -27
- package/dist/cjs/src/bybit.js +69 -67
- package/dist/cjs/src/bydfi.js +2907 -0
- package/dist/cjs/src/cex.js +18 -18
- package/dist/cjs/src/coinbase.js +74 -41
- package/dist/cjs/src/coinbaseexchange.js +22 -22
- package/dist/cjs/src/coinbaseinternational.js +22 -22
- package/dist/cjs/src/coincatch.js +39 -39
- package/dist/cjs/src/coincheck.js +11 -11
- package/dist/cjs/src/coinex.js +48 -48
- package/dist/cjs/src/coinmate.js +14 -14
- package/dist/cjs/src/coinmetro.js +14 -14
- package/dist/cjs/src/coinone.js +11 -11
- package/dist/cjs/src/coinsph.js +20 -20
- package/dist/cjs/src/coinspot.js +8 -8
- package/dist/cjs/src/cryptocom.js +32 -32
- package/dist/cjs/src/cryptomus.js +9 -9
- package/dist/cjs/src/deepcoin.js +33 -33
- package/dist/cjs/src/defx.js +23 -23
- package/dist/cjs/src/delta.js +29 -29
- package/dist/cjs/src/deribit.js +36 -36
- package/dist/cjs/src/derive.js +19 -19
- package/dist/cjs/src/digifinex.js +36 -36
- package/dist/cjs/src/dydx.js +25 -25
- package/dist/cjs/src/exmo.js +29 -29
- package/dist/cjs/src/foxbit.js +23 -23
- package/dist/cjs/src/gate.js +60 -59
- package/dist/cjs/src/gemini.js +16 -16
- package/dist/cjs/src/hashkey.js +35 -35
- package/dist/cjs/src/hibachi.js +24 -24
- package/dist/cjs/src/hitbtc.js +38 -38
- package/dist/cjs/src/hollaex.js +22 -22
- package/dist/cjs/src/htx.js +50 -50
- package/dist/cjs/src/hyperliquid.js +86 -45
- package/dist/cjs/src/independentreserve.js +13 -13
- package/dist/cjs/src/indodax.js +14 -14
- package/dist/cjs/src/kraken.js +30 -30
- package/dist/cjs/src/krakenfutures.js +21 -21
- package/dist/cjs/src/kucoin.js +156 -48
- package/dist/cjs/src/kucoinfutures.js +42 -40
- package/dist/cjs/src/latoken.js +16 -16
- package/dist/cjs/src/lbank.js +23 -23
- package/dist/cjs/src/luno.js +17 -17
- package/dist/cjs/src/mercado.js +11 -11
- package/dist/cjs/src/mexc.js +47 -47
- package/dist/cjs/src/modetrade.js +37 -35
- package/dist/cjs/src/ndax.js +19 -19
- package/dist/cjs/src/novadax.js +19 -19
- package/dist/cjs/src/oceanex.js +16 -16
- package/dist/cjs/src/okx.js +83 -83
- package/dist/cjs/src/onetrading.js +34 -33
- package/dist/cjs/src/oxfun.js +25 -25
- package/dist/cjs/src/p2b.js +11 -11
- package/dist/cjs/src/paradex.js +54 -54
- package/dist/cjs/src/paymium.js +20 -21
- package/dist/cjs/src/phemex.js +35 -35
- package/dist/cjs/src/poloniex.js +27 -27
- package/dist/cjs/src/pro/alpaca.js +5 -5
- package/dist/cjs/src/pro/apex.js +13 -11
- package/dist/cjs/src/pro/arkham.js +5 -5
- package/dist/cjs/src/pro/ascendex.js +5 -5
- package/dist/cjs/src/pro/backpack.js +16 -16
- package/dist/cjs/src/pro/binance.js +45 -41
- package/dist/cjs/src/pro/bingx.js +14 -12
- package/dist/cjs/src/pro/bitfinex.js +8 -8
- package/dist/cjs/src/pro/bitget.js +12 -12
- package/dist/cjs/src/pro/bithumb.js +3 -3
- package/dist/cjs/src/pro/bitmart.js +393 -34
- package/dist/cjs/src/pro/bitmex.js +9 -9
- package/dist/cjs/src/pro/bitopro.js +5 -5
- package/dist/cjs/src/pro/bitrue.js +2 -2
- package/dist/cjs/src/pro/bitstamp.js +3 -3
- package/dist/cjs/src/pro/bittrade.js +3 -3
- package/dist/cjs/src/pro/bitvavo.js +19 -19
- package/dist/cjs/src/pro/blockchaincom.js +5 -5
- package/dist/cjs/src/pro/blofin.js +10 -10
- package/dist/cjs/src/pro/bullish.js +6 -6
- package/dist/cjs/src/pro/bybit.js +24 -22
- package/dist/cjs/src/pro/bydfi.js +1077 -0
- package/dist/cjs/src/pro/cex.js +13 -13
- package/dist/cjs/src/pro/coinbase.js +13 -13
- package/dist/cjs/src/pro/coinbaseexchange.js +10 -10
- package/dist/cjs/src/pro/coinbaseinternational.js +8 -8
- package/dist/cjs/src/pro/coincatch.js +10 -10
- package/dist/cjs/src/pro/coincheck.js +2 -2
- package/dist/cjs/src/pro/coinex.js +10 -10
- package/dist/cjs/src/pro/coinone.js +3 -3
- package/dist/cjs/src/pro/cryptocom.js +25 -23
- package/dist/cjs/src/pro/deepcoin.js +8 -8
- package/dist/cjs/src/pro/defx.js +15 -15
- package/dist/cjs/src/pro/deribit.js +10 -10
- package/dist/cjs/src/pro/derive.js +6 -6
- package/dist/cjs/src/pro/dydx.js +3 -3
- package/dist/cjs/src/pro/exmo.js +7 -7
- package/dist/cjs/src/pro/gate.js +26 -62
- package/dist/cjs/src/pro/gemini.js +6 -6
- package/dist/cjs/src/pro/hashkey.js +11 -9
- package/dist/cjs/src/pro/hitbtc.js +8 -8
- package/dist/cjs/src/pro/hollaex.js +5 -5
- package/dist/cjs/src/pro/htx.js +9 -9
- package/dist/cjs/src/pro/hyperliquid.js +103 -14
- package/dist/cjs/src/pro/independentreserve.js +2 -2
- package/dist/cjs/src/pro/kraken.js +15 -15
- package/dist/cjs/src/pro/krakenfutures.js +10 -10
- package/dist/cjs/src/pro/kucoin.js +15 -15
- package/dist/cjs/src/pro/kucoinfutures.js +18 -16
- package/dist/cjs/src/pro/lbank.js +5 -5
- package/dist/cjs/src/pro/luno.js +2 -2
- package/dist/cjs/src/pro/mexc.js +13 -13
- package/dist/cjs/src/pro/modetrade.js +13 -11
- package/dist/cjs/src/pro/ndax.js +3 -3
- package/dist/cjs/src/pro/okx.js +25 -25
- package/dist/cjs/src/pro/onetrading.js +6 -6
- package/dist/cjs/src/pro/oxfun.js +13 -13
- package/dist/cjs/src/pro/p2b.js +5 -5
- package/dist/cjs/src/pro/paradex.js +8 -8
- package/dist/cjs/src/pro/phemex.js +7 -7
- package/dist/cjs/src/pro/poloniex.js +8 -8
- package/dist/cjs/src/pro/probit.js +6 -6
- package/dist/cjs/src/pro/toobit.js +20 -16
- package/dist/cjs/src/pro/upbit.js +9 -9
- package/dist/cjs/src/pro/whitebit.js +7 -7
- package/dist/cjs/src/pro/woo.js +18 -16
- package/dist/cjs/src/pro/woofipro.js +25 -23
- package/dist/cjs/src/pro/xt.js +7 -5
- package/dist/cjs/src/probit.js +18 -18
- package/dist/cjs/src/static_dependencies/ethers/utils/index.js +11 -0
- package/dist/cjs/src/timex.js +16 -16
- package/dist/cjs/src/tokocrypto.js +17 -17
- package/dist/cjs/src/toobit.js +33 -30
- package/dist/cjs/src/upbit.js +23 -23
- package/dist/cjs/src/wavesexchange.js +86 -85
- package/dist/cjs/src/whitebit.js +44 -44
- package/dist/cjs/src/woo.js +51 -49
- package/dist/cjs/src/woofipro.js +104 -82
- package/dist/cjs/src/xt.js +17 -12
- package/dist/cjs/src/yobit.js +15 -15
- package/dist/cjs/src/zaif.js +38 -9
- package/dist/cjs/src/zebpay.js +35 -20
- package/dist/cjs/src/zonda.js +14 -14
- package/js/ccxt.d.ts +8 -2
- package/js/ccxt.js +6 -2
- package/js/src/abstract/bydfi.d.ts +52 -0
- package/js/src/abstract/bydfi.js +11 -0
- package/js/src/alpaca.d.ts +21 -21
- package/js/src/alpaca.js +21 -21
- package/js/src/apex.d.ts +20 -20
- package/js/src/apex.js +20 -20
- package/js/src/arkham.d.ts +22 -22
- package/js/src/arkham.js +22 -22
- package/js/src/ascendex.d.ts +28 -28
- package/js/src/ascendex.js +28 -28
- package/js/src/backpack.d.ts +21 -21
- package/js/src/backpack.js +22 -22
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +48 -38
- package/js/src/base/functions/throttle.d.ts +22 -0
- package/js/src/base/functions/throttle.js +54 -5
- package/js/src/bigone.d.ts +19 -19
- package/js/src/bigone.js +19 -19
- package/js/src/binance.d.ts +82 -82
- package/js/src/binance.js +83 -82
- package/js/src/bingx.d.ts +46 -46
- package/js/src/bingx.js +47 -47
- package/js/src/bit2c.d.ts +11 -11
- package/js/src/bit2c.js +11 -11
- package/js/src/bitbank.d.ts +12 -12
- package/js/src/bitbank.js +49 -48
- package/js/src/bitbns.d.ts +13 -13
- package/js/src/bitbns.js +13 -13
- package/js/src/bitfinex.d.ts +33 -33
- package/js/src/bitfinex.js +33 -33
- package/js/src/bitflyer.d.ts +17 -17
- package/js/src/bitflyer.js +17 -17
- package/js/src/bitget.d.ts +57 -57
- package/js/src/bitget.js +58 -57
- package/js/src/bithumb.d.ts +10 -10
- package/js/src/bithumb.js +10 -10
- package/js/src/bitmart.d.ts +42 -42
- package/js/src/bitmart.js +44 -44
- package/js/src/bitmex.d.ts +24 -24
- package/js/src/bitmex.js +24 -24
- package/js/src/bitopro.d.ts +20 -20
- package/js/src/bitopro.js +20 -20
- package/js/src/bitrue.d.ts +18 -18
- package/js/src/bitrue.js +18 -18
- package/js/src/bitso.d.ts +20 -20
- package/js/src/bitso.js +20 -20
- package/js/src/bitstamp.d.ts +21 -21
- package/js/src/bitstamp.js +21 -21
- package/js/src/bittrade.d.ts +20 -20
- package/js/src/bittrade.js +20 -20
- package/js/src/bitvavo.d.ts +19 -19
- package/js/src/bitvavo.js +19 -19
- package/js/src/blockchaincom.d.ts +20 -20
- package/js/src/blockchaincom.js +20 -20
- package/js/src/blofin.d.ts +26 -26
- package/js/src/blofin.js +26 -26
- package/js/src/btcalpha.d.ts +14 -14
- package/js/src/btcalpha.js +35 -34
- package/js/src/btcbox.d.ts +10 -10
- package/js/src/btcbox.js +10 -10
- package/js/src/btcmarkets.d.ts +16 -16
- package/js/src/btcmarkets.js +16 -16
- package/js/src/btcturk.d.ts +10 -10
- package/js/src/btcturk.js +10 -10
- package/js/src/bullish.d.ts +26 -26
- package/js/src/bullish.js +27 -27
- package/js/src/bybit.d.ts +66 -66
- package/js/src/bybit.js +69 -67
- package/js/src/bydfi.d.ts +472 -0
- package/js/src/bydfi.js +2905 -0
- package/js/src/cex.d.ts +18 -18
- package/js/src/cex.js +18 -18
- package/js/src/coinbase.d.ts +51 -40
- package/js/src/coinbase.js +74 -41
- package/js/src/coinbaseexchange.d.ts +22 -22
- package/js/src/coinbaseexchange.js +22 -22
- package/js/src/coinbaseinternational.d.ts +22 -22
- package/js/src/coinbaseinternational.js +22 -22
- package/js/src/coincatch.d.ts +39 -39
- package/js/src/coincatch.js +39 -39
- package/js/src/coincheck.d.ts +11 -11
- package/js/src/coincheck.js +11 -11
- package/js/src/coinex.d.ts +48 -48
- package/js/src/coinex.js +48 -48
- package/js/src/coinmate.d.ts +14 -14
- package/js/src/coinmate.js +14 -14
- package/js/src/coinmetro.d.ts +14 -14
- package/js/src/coinmetro.js +14 -14
- package/js/src/coinone.d.ts +11 -11
- package/js/src/coinone.js +11 -11
- package/js/src/coinsph.d.ts +20 -20
- package/js/src/coinsph.js +20 -20
- package/js/src/coinspot.d.ts +8 -8
- package/js/src/coinspot.js +8 -8
- package/js/src/cryptocom.d.ts +32 -32
- package/js/src/cryptocom.js +32 -32
- package/js/src/cryptomus.d.ts +9 -9
- package/js/src/cryptomus.js +9 -9
- package/js/src/deepcoin.d.ts +33 -33
- package/js/src/deepcoin.js +33 -33
- package/js/src/defx.d.ts +23 -23
- package/js/src/defx.js +23 -23
- package/js/src/delta.d.ts +29 -29
- package/js/src/delta.js +29 -29
- package/js/src/deribit.d.ts +36 -36
- package/js/src/deribit.js +36 -36
- package/js/src/derive.d.ts +19 -19
- package/js/src/derive.js +19 -19
- package/js/src/digifinex.d.ts +36 -36
- package/js/src/digifinex.js +36 -36
- package/js/src/dydx.d.ts +22 -22
- package/js/src/dydx.js +25 -25
- package/js/src/exmo.d.ts +29 -29
- package/js/src/exmo.js +29 -29
- package/js/src/foxbit.d.ts +23 -23
- package/js/src/foxbit.js +23 -23
- package/js/src/gate.d.ts +57 -57
- package/js/src/gate.js +60 -59
- package/js/src/gemini.d.ts +16 -16
- package/js/src/gemini.js +16 -16
- package/js/src/hashkey.d.ts +35 -35
- package/js/src/hashkey.js +35 -35
- package/js/src/hibachi.d.ts +24 -24
- package/js/src/hibachi.js +24 -24
- package/js/src/hitbtc.d.ts +38 -38
- package/js/src/hitbtc.js +38 -38
- package/js/src/hollaex.d.ts +22 -22
- package/js/src/hollaex.js +22 -22
- package/js/src/htx.d.ts +50 -50
- package/js/src/htx.js +50 -50
- package/js/src/hyperliquid.d.ts +46 -36
- package/js/src/hyperliquid.js +86 -45
- package/js/src/independentreserve.d.ts +13 -13
- package/js/src/independentreserve.js +13 -13
- package/js/src/indodax.d.ts +14 -14
- package/js/src/indodax.js +14 -14
- package/js/src/kraken.d.ts +30 -30
- package/js/src/kraken.js +30 -30
- package/js/src/krakenfutures.d.ts +21 -21
- package/js/src/krakenfutures.js +21 -21
- package/js/src/kucoin.d.ts +58 -44
- package/js/src/kucoin.js +156 -48
- package/js/src/kucoinfutures.d.ts +35 -35
- package/js/src/kucoinfutures.js +42 -40
- package/js/src/latoken.d.ts +16 -16
- package/js/src/latoken.js +16 -16
- package/js/src/lbank.d.ts +23 -23
- package/js/src/lbank.js +23 -23
- package/js/src/luno.d.ts +17 -17
- package/js/src/luno.js +17 -17
- package/js/src/mercado.d.ts +11 -11
- package/js/src/mercado.js +11 -11
- package/js/src/mexc.d.ts +47 -47
- package/js/src/mexc.js +47 -47
- package/js/src/modetrade.d.ts +31 -31
- package/js/src/modetrade.js +37 -35
- package/js/src/ndax.d.ts +19 -19
- package/js/src/ndax.js +19 -19
- package/js/src/novadax.d.ts +19 -19
- package/js/src/novadax.js +19 -19
- package/js/src/oceanex.d.ts +16 -16
- package/js/src/oceanex.js +16 -16
- package/js/src/okx.d.ts +74 -74
- package/js/src/okx.js +83 -83
- package/js/src/onetrading.d.ts +34 -33
- package/js/src/onetrading.js +34 -33
- package/js/src/oxfun.d.ts +25 -25
- package/js/src/oxfun.js +25 -25
- package/js/src/p2b.d.ts +11 -11
- package/js/src/p2b.js +11 -11
- package/js/src/paradex.d.ts +54 -54
- package/js/src/paradex.js +54 -54
- package/js/src/paymium.d.ts +20 -21
- package/js/src/paymium.js +20 -21
- package/js/src/phemex.d.ts +30 -30
- package/js/src/phemex.js +35 -35
- package/js/src/poloniex.d.ts +26 -26
- package/js/src/poloniex.js +27 -27
- package/js/src/pro/alpaca.d.ts +5 -5
- package/js/src/pro/alpaca.js +5 -5
- package/js/src/pro/apex.d.ts +8 -8
- package/js/src/pro/apex.js +13 -11
- package/js/src/pro/arkham.d.ts +5 -5
- package/js/src/pro/arkham.js +5 -5
- package/js/src/pro/ascendex.d.ts +5 -5
- package/js/src/pro/ascendex.js +5 -5
- package/js/src/pro/backpack.d.ts +16 -16
- package/js/src/pro/backpack.js +16 -16
- package/js/src/pro/binance.d.ts +35 -35
- package/js/src/pro/binance.js +45 -41
- package/js/src/pro/bingx.d.ts +9 -9
- package/js/src/pro/bingx.js +14 -12
- package/js/src/pro/bitfinex.d.ts +8 -8
- package/js/src/pro/bitfinex.js +8 -8
- package/js/src/pro/bitget.d.ts +12 -12
- package/js/src/pro/bitget.js +12 -12
- package/js/src/pro/bithumb.d.ts +3 -3
- package/js/src/pro/bithumb.js +3 -3
- package/js/src/pro/bitmart.d.ts +120 -9
- package/js/src/pro/bitmart.js +393 -34
- package/js/src/pro/bitmex.d.ts +9 -9
- package/js/src/pro/bitmex.js +9 -9
- package/js/src/pro/bitopro.d.ts +5 -5
- package/js/src/pro/bitopro.js +5 -5
- package/js/src/pro/bitrue.d.ts +2 -2
- package/js/src/pro/bitrue.js +2 -2
- package/js/src/pro/bitstamp.d.ts +3 -3
- package/js/src/pro/bitstamp.js +3 -3
- package/js/src/pro/bittrade.d.ts +3 -3
- package/js/src/pro/bittrade.js +3 -3
- package/js/src/pro/bitvavo.d.ts +19 -19
- package/js/src/pro/bitvavo.js +19 -19
- package/js/src/pro/blockchaincom.d.ts +5 -5
- package/js/src/pro/blockchaincom.js +5 -5
- package/js/src/pro/blofin.d.ts +10 -10
- package/js/src/pro/blofin.js +10 -10
- package/js/src/pro/bullish.d.ts +6 -6
- package/js/src/pro/bullish.js +6 -6
- package/js/src/pro/bybit.d.ts +19 -19
- package/js/src/pro/bybit.js +24 -22
- package/js/src/pro/bydfi.d.ts +206 -0
- package/js/src/pro/bydfi.js +1076 -0
- package/js/src/pro/cex.d.ts +13 -13
- package/js/src/pro/cex.js +13 -13
- package/js/src/pro/coinbase.d.ts +13 -13
- package/js/src/pro/coinbase.js +13 -13
- package/js/src/pro/coinbaseexchange.d.ts +10 -10
- package/js/src/pro/coinbaseexchange.js +10 -10
- package/js/src/pro/coinbaseinternational.d.ts +8 -8
- package/js/src/pro/coinbaseinternational.js +8 -8
- package/js/src/pro/coincatch.d.ts +10 -10
- package/js/src/pro/coincatch.js +10 -10
- package/js/src/pro/coincheck.d.ts +2 -2
- package/js/src/pro/coincheck.js +2 -2
- package/js/src/pro/coinex.d.ts +10 -10
- package/js/src/pro/coinex.js +10 -10
- package/js/src/pro/coinone.d.ts +3 -3
- package/js/src/pro/coinone.js +3 -3
- package/js/src/pro/cryptocom.d.ts +20 -20
- package/js/src/pro/cryptocom.js +25 -23
- package/js/src/pro/deepcoin.d.ts +8 -8
- package/js/src/pro/deepcoin.js +8 -8
- package/js/src/pro/defx.d.ts +15 -15
- package/js/src/pro/defx.js +15 -15
- package/js/src/pro/deribit.d.ts +10 -10
- package/js/src/pro/deribit.js +10 -10
- package/js/src/pro/derive.d.ts +6 -6
- package/js/src/pro/derive.js +6 -6
- package/js/src/pro/dydx.d.ts +3 -3
- package/js/src/pro/dydx.js +3 -3
- package/js/src/pro/exmo.d.ts +7 -7
- package/js/src/pro/exmo.js +7 -7
- package/js/src/pro/gate.d.ts +22 -23
- package/js/src/pro/gate.js +26 -62
- package/js/src/pro/gemini.d.ts +6 -6
- package/js/src/pro/gemini.js +6 -6
- package/js/src/pro/hashkey.d.ts +6 -6
- package/js/src/pro/hashkey.js +11 -9
- package/js/src/pro/hitbtc.d.ts +8 -8
- package/js/src/pro/hitbtc.js +8 -8
- package/js/src/pro/hollaex.d.ts +5 -5
- package/js/src/pro/hollaex.js +5 -5
- package/js/src/pro/htx.d.ts +9 -9
- package/js/src/pro/htx.js +9 -9
- package/js/src/pro/hyperliquid.d.ts +38 -14
- package/js/src/pro/hyperliquid.js +103 -14
- package/js/src/pro/independentreserve.d.ts +2 -2
- package/js/src/pro/independentreserve.js +2 -2
- package/js/src/pro/kraken.d.ts +15 -15
- package/js/src/pro/kraken.js +15 -15
- package/js/src/pro/krakenfutures.d.ts +10 -10
- package/js/src/pro/krakenfutures.js +10 -10
- package/js/src/pro/kucoin.d.ts +15 -15
- package/js/src/pro/kucoin.js +15 -15
- package/js/src/pro/kucoinfutures.d.ts +13 -13
- package/js/src/pro/kucoinfutures.js +18 -16
- package/js/src/pro/lbank.d.ts +5 -5
- package/js/src/pro/lbank.js +5 -5
- package/js/src/pro/luno.d.ts +2 -2
- package/js/src/pro/luno.js +2 -2
- package/js/src/pro/mexc.d.ts +13 -13
- package/js/src/pro/mexc.js +13 -13
- package/js/src/pro/modetrade.d.ts +8 -8
- package/js/src/pro/modetrade.js +13 -11
- package/js/src/pro/ndax.d.ts +3 -3
- package/js/src/pro/ndax.js +3 -3
- package/js/src/pro/okx.d.ts +25 -25
- package/js/src/pro/okx.js +25 -25
- package/js/src/pro/onetrading.d.ts +6 -6
- package/js/src/pro/onetrading.js +6 -6
- package/js/src/pro/oxfun.d.ts +13 -13
- package/js/src/pro/oxfun.js +13 -13
- package/js/src/pro/p2b.d.ts +5 -5
- package/js/src/pro/p2b.js +5 -5
- package/js/src/pro/paradex.d.ts +8 -8
- package/js/src/pro/paradex.js +8 -8
- package/js/src/pro/phemex.d.ts +7 -7
- package/js/src/pro/phemex.js +7 -7
- package/js/src/pro/poloniex.d.ts +8 -8
- package/js/src/pro/poloniex.js +8 -8
- package/js/src/pro/probit.d.ts +6 -6
- package/js/src/pro/probit.js +6 -6
- package/js/src/pro/toobit.d.ts +9 -9
- package/js/src/pro/toobit.js +20 -16
- package/js/src/pro/upbit.d.ts +9 -9
- package/js/src/pro/upbit.js +9 -9
- package/js/src/pro/whitebit.d.ts +7 -7
- package/js/src/pro/whitebit.js +7 -7
- package/js/src/pro/woo.d.ts +13 -13
- package/js/src/pro/woo.js +18 -16
- package/js/src/pro/woofipro.d.ts +20 -20
- package/js/src/pro/woofipro.js +25 -23
- package/js/src/pro/xt.d.ts +2 -2
- package/js/src/pro/xt.js +7 -5
- package/js/src/probit.d.ts +18 -18
- package/js/src/probit.js +18 -18
- package/js/src/static_dependencies/ethers/utils/index.d.ts +2 -1
- package/js/src/static_dependencies/ethers/utils/index.js +8 -1
- package/js/src/timex.d.ts +16 -16
- package/js/src/timex.js +16 -16
- package/js/src/tokocrypto.d.ts +17 -17
- package/js/src/tokocrypto.js +17 -17
- package/js/src/toobit.d.ts +27 -27
- package/js/src/toobit.js +33 -30
- package/js/src/upbit.d.ts +23 -23
- package/js/src/upbit.js +23 -23
- package/js/src/wavesexchange.d.ts +15 -15
- package/js/src/wavesexchange.js +86 -85
- package/js/src/whitebit.d.ts +44 -44
- package/js/src/whitebit.js +44 -44
- package/js/src/woo.d.ts +45 -45
- package/js/src/woo.js +51 -49
- package/js/src/woofipro.d.ts +77 -77
- package/js/src/woofipro.js +104 -82
- package/js/src/xt.d.ts +12 -12
- package/js/src/xt.js +17 -12
- package/js/src/yobit.d.ts +15 -15
- package/js/src/yobit.js +15 -15
- package/js/src/zaif.d.ts +9 -9
- package/js/src/zaif.js +38 -9
- package/js/src/zebpay.d.ts +20 -20
- package/js/src/zebpay.js +35 -20
- package/js/src/zonda.d.ts +14 -14
- package/js/src/zonda.js +14 -14
- package/package.json +1 -1
|
@@ -34,6 +34,16 @@ class bitmart extends bitmart$1["default"] {
|
|
|
34
34
|
'watchOHLCV': true,
|
|
35
35
|
'watchPosition': 'emulated',
|
|
36
36
|
'watchPositions': true,
|
|
37
|
+
'unWatchBidsAsks': false,
|
|
38
|
+
'unWatchOHLCV': true,
|
|
39
|
+
'unWatchOrderBook': true,
|
|
40
|
+
'unWatchOrderBookForSymbols': true,
|
|
41
|
+
'unWatchOrders': true,
|
|
42
|
+
'unWatchPositions': true,
|
|
43
|
+
'unWatchTicker': true,
|
|
44
|
+
'unWatchTickers': true,
|
|
45
|
+
'unWatchTrades': true,
|
|
46
|
+
'unWatchTradesForSymbols': true,
|
|
37
47
|
},
|
|
38
48
|
'urls': {
|
|
39
49
|
'api': {
|
|
@@ -97,10 +107,18 @@ class bitmart extends bitmart$1["default"] {
|
|
|
97
107
|
const url = this.implodeHostname(this.urls['api']['ws'][type]['public']);
|
|
98
108
|
let request = {};
|
|
99
109
|
let messageHash = undefined;
|
|
110
|
+
const unsubscribe = this.safeBool(params, 'unsubscribe', false);
|
|
111
|
+
let prefix = '';
|
|
112
|
+
let requestOp = 'subscribe';
|
|
113
|
+
if (unsubscribe) {
|
|
114
|
+
params = this.omit(params, 'unsubscribe');
|
|
115
|
+
prefix = 'unsubscribe::';
|
|
116
|
+
requestOp = 'unsubscribe';
|
|
117
|
+
}
|
|
100
118
|
if (type === 'spot') {
|
|
101
119
|
messageHash = 'spot/' + channel + ':' + market['id'];
|
|
102
120
|
request = {
|
|
103
|
-
'op':
|
|
121
|
+
'op': requestOp,
|
|
104
122
|
'args': [messageHash],
|
|
105
123
|
};
|
|
106
124
|
}
|
|
@@ -112,10 +130,11 @@ class bitmart extends bitmart$1["default"] {
|
|
|
112
130
|
messageHash += ':' + speed;
|
|
113
131
|
}
|
|
114
132
|
request = {
|
|
115
|
-
'action':
|
|
133
|
+
'action': requestOp,
|
|
116
134
|
'args': [messageHash],
|
|
117
135
|
};
|
|
118
136
|
}
|
|
137
|
+
messageHash = prefix + messageHash;
|
|
119
138
|
return await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
120
139
|
}
|
|
121
140
|
async subscribeMultiple(channel, type, symbols = undefined, params = {}) {
|
|
@@ -125,11 +144,23 @@ class bitmart extends bitmart$1["default"] {
|
|
|
125
144
|
const actionType = (type === 'spot') ? 'op' : 'action';
|
|
126
145
|
const rawSubscriptions = [];
|
|
127
146
|
const messageHashes = [];
|
|
147
|
+
const subHashes = [];
|
|
148
|
+
const unsubscribe = this.safeBool(params, 'unsubscribe', false);
|
|
149
|
+
let prefix = '';
|
|
150
|
+
let requestOp = 'subscribe';
|
|
151
|
+
if (unsubscribe) {
|
|
152
|
+
params = this.omit(params, 'unsubscribe');
|
|
153
|
+
prefix = 'unsubscribe::';
|
|
154
|
+
requestOp = 'unsubscribe';
|
|
155
|
+
}
|
|
128
156
|
for (let i = 0; i < symbols.length; i++) {
|
|
129
157
|
const market = this.market(symbols[i]);
|
|
130
158
|
const message = channelType + '/' + channel + ':' + market['id'];
|
|
159
|
+
const subHash = prefix + message;
|
|
160
|
+
const messageHash = prefix + channel + ':' + market['symbol'];
|
|
131
161
|
rawSubscriptions.push(message);
|
|
132
|
-
|
|
162
|
+
subHashes.push(subHash);
|
|
163
|
+
messageHashes.push(messageHash);
|
|
133
164
|
}
|
|
134
165
|
// as an exclusion, futures "tickers" need one generic request for all symbols
|
|
135
166
|
// if ((type !== 'spot') && (channel === 'ticker')) {
|
|
@@ -139,8 +170,8 @@ class bitmart extends bitmart$1["default"] {
|
|
|
139
170
|
const request = {
|
|
140
171
|
'args': rawSubscriptions,
|
|
141
172
|
};
|
|
142
|
-
request[actionType] =
|
|
143
|
-
return await this.watchMultiple(url, messageHashes, this.deepExtend(request, params),
|
|
173
|
+
request[actionType] = requestOp;
|
|
174
|
+
return await this.watchMultiple(url, messageHashes, this.deepExtend(request, params), subHashes);
|
|
144
175
|
}
|
|
145
176
|
/**
|
|
146
177
|
* @method
|
|
@@ -149,7 +180,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
149
180
|
* @see https://developer-pro.bitmart.com/en/futuresv2/#private-assets-channel
|
|
150
181
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
151
182
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
152
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com
|
|
183
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
|
|
153
184
|
*/
|
|
154
185
|
async watchBalance(params = {}) {
|
|
155
186
|
await this.loadMarkets();
|
|
@@ -175,8 +206,8 @@ class bitmart extends bitmart$1["default"] {
|
|
|
175
206
|
this.setBalanceCache(client, type, messageHash);
|
|
176
207
|
let fetchBalanceSnapshot = undefined;
|
|
177
208
|
let awaitBalanceSnapshot = undefined;
|
|
178
|
-
[fetchBalanceSnapshot, params] = this.handleOptionAndParams(
|
|
179
|
-
[awaitBalanceSnapshot, params] = this.handleOptionAndParams(
|
|
209
|
+
[fetchBalanceSnapshot, params] = this.handleOptionAndParams(params, 'watchBalance', 'fetchBalanceSnapshot', true);
|
|
210
|
+
[awaitBalanceSnapshot, params] = this.handleOptionAndParams(params, 'watchBalance', 'awaitBalanceSnapshot', false);
|
|
180
211
|
if (fetchBalanceSnapshot && awaitBalanceSnapshot) {
|
|
181
212
|
await client.future(type + ':fetchBalanceSnapshot');
|
|
182
213
|
}
|
|
@@ -186,7 +217,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
186
217
|
if (subscribeHash in client.subscriptions) {
|
|
187
218
|
return;
|
|
188
219
|
}
|
|
189
|
-
const options = this.
|
|
220
|
+
const options = this.safeDict(this.options, 'watchBalance');
|
|
190
221
|
const snapshot = this.safeBool(options, 'fetchBalanceSnapshot', true);
|
|
191
222
|
if (snapshot) {
|
|
192
223
|
const messageHash = type + ':' + 'fetchBalanceSnapshot';
|
|
@@ -202,9 +233,11 @@ class bitmart extends bitmart$1["default"] {
|
|
|
202
233
|
const response = await this.fetchBalance({ 'type': type });
|
|
203
234
|
this.balance[type] = this.extend(response, this.safeValue(this.balance, type, {}));
|
|
204
235
|
// don't remove the future from the .futures cache
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
236
|
+
if (messageHash in client.futures) {
|
|
237
|
+
const future = client.futures[messageHash];
|
|
238
|
+
future.resolve();
|
|
239
|
+
client.resolve(this.balance[type], 'balance:' + type);
|
|
240
|
+
}
|
|
208
241
|
}
|
|
209
242
|
handleBalance(client, message) {
|
|
210
243
|
//
|
|
@@ -252,7 +285,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
252
285
|
const timestamp = this.safeInteger(message, 'event_time');
|
|
253
286
|
this.balance[type]['timestamp'] = timestamp;
|
|
254
287
|
this.balance[type]['datetime'] = this.iso8601(timestamp);
|
|
255
|
-
const balanceDetails = this.
|
|
288
|
+
const balanceDetails = this.safeList(data[i], 'balance_details', []);
|
|
256
289
|
for (let ii = 0; ii < balanceDetails.length; ii++) {
|
|
257
290
|
const rawBalance = balanceDetails[i];
|
|
258
291
|
const account = this.account();
|
|
@@ -286,7 +319,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
286
319
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
287
320
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
288
321
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
289
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com
|
|
322
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
|
|
290
323
|
*/
|
|
291
324
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
292
325
|
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
@@ -295,12 +328,13 @@ class bitmart extends bitmart$1["default"] {
|
|
|
295
328
|
* @method
|
|
296
329
|
* @name bitmart#watchTradesForSymbols
|
|
297
330
|
* @see https://developer-pro.bitmart.com/en/spot/#public-trade-channel
|
|
331
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-trade-channel
|
|
298
332
|
* @description get the list of most recent trades for a list of symbols
|
|
299
333
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
300
334
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
301
335
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
302
336
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
303
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com
|
|
337
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/?id=public-trades}
|
|
304
338
|
*/
|
|
305
339
|
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
306
340
|
await this.loadMarkets();
|
|
@@ -321,6 +355,37 @@ class bitmart extends bitmart$1["default"] {
|
|
|
321
355
|
}
|
|
322
356
|
return result;
|
|
323
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* @method
|
|
360
|
+
* @name bitmart#unWatchTrades
|
|
361
|
+
* @description unWatches from the stream channel
|
|
362
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-trade-channel
|
|
363
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-trade-channel
|
|
364
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
365
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
366
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
367
|
+
*/
|
|
368
|
+
async unWatchTrades(symbol, params = {}) {
|
|
369
|
+
return await this.unWatchTradesForSymbols([symbol], params);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @method
|
|
373
|
+
* @name bitmart#unWatchTradesForSymbols
|
|
374
|
+
* @description unsubscribes from the trades channel
|
|
375
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-trade-channel
|
|
376
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-trade-channel
|
|
377
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
378
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
379
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
380
|
+
*/
|
|
381
|
+
async unWatchTradesForSymbols(symbols, params = {}) {
|
|
382
|
+
await this.loadMarkets();
|
|
383
|
+
let marketType = undefined;
|
|
384
|
+
[symbols, marketType, params] = this.getParamsForMultipleSub('unWatchTradesForSymbols', symbols, undefined, params);
|
|
385
|
+
const channelName = 'trade';
|
|
386
|
+
params = this.extend(params, { 'unsubscribe': true });
|
|
387
|
+
return await this.subscribeMultiple(channelName, marketType, symbols, params);
|
|
388
|
+
}
|
|
324
389
|
getParamsForMultipleSub(methodName, symbols, limit = undefined, params = {}) {
|
|
325
390
|
symbols = this.marketSymbols(symbols, undefined, false, true);
|
|
326
391
|
const length = symbols.length;
|
|
@@ -340,7 +405,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
340
405
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
341
406
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
342
407
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
343
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com
|
|
408
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
344
409
|
*/
|
|
345
410
|
async watchTicker(symbol, params = {}) {
|
|
346
411
|
await this.loadMarkets();
|
|
@@ -356,7 +421,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
356
421
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
357
422
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
358
423
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
359
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com
|
|
424
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
360
425
|
*/
|
|
361
426
|
async watchTickers(symbols = undefined, params = {}) {
|
|
362
427
|
await this.loadMarkets();
|
|
@@ -371,6 +436,37 @@ class bitmart extends bitmart$1["default"] {
|
|
|
371
436
|
}
|
|
372
437
|
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
373
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* @method
|
|
441
|
+
* @name bitmart#unWatchTicker
|
|
442
|
+
* @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
443
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-ticker-channel
|
|
444
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-ticker-channel
|
|
445
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
446
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
447
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
448
|
+
*/
|
|
449
|
+
async unWatchTicker(symbol, params = {}) {
|
|
450
|
+
return await this.unWatchTickers([symbol], params);
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* @method
|
|
454
|
+
* @name bitmart#unWatchTickers
|
|
455
|
+
* @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
456
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-ticker-channel
|
|
457
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-ticker-channel
|
|
458
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
459
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
460
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
461
|
+
*/
|
|
462
|
+
async unWatchTickers(symbols = undefined, params = {}) {
|
|
463
|
+
await this.loadMarkets();
|
|
464
|
+
const market = this.getMarketFromSymbols(symbols);
|
|
465
|
+
let marketType = undefined;
|
|
466
|
+
[marketType, params] = this.handleMarketTypeAndParams('watchTickers', market, params);
|
|
467
|
+
params = this.extend(params, { 'unsubscribe': true });
|
|
468
|
+
return await this.subscribeMultiple('ticker', marketType, symbols, params);
|
|
469
|
+
}
|
|
374
470
|
/**
|
|
375
471
|
* @method
|
|
376
472
|
* @name bitmart#watchBidsAsks
|
|
@@ -379,7 +475,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
379
475
|
* @description watches best bid & ask for symbols
|
|
380
476
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
381
477
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
382
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com
|
|
478
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/?id=ticker-structure}
|
|
383
479
|
*/
|
|
384
480
|
async watchBidsAsks(symbols = undefined, params = {}) {
|
|
385
481
|
await this.loadMarkets();
|
|
@@ -420,7 +516,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
420
516
|
rawTickers = this.safeList(message, 'data', []);
|
|
421
517
|
}
|
|
422
518
|
else {
|
|
423
|
-
rawTickers = [this.
|
|
519
|
+
rawTickers = [this.safeDict(message, 'data', {})];
|
|
424
520
|
}
|
|
425
521
|
if (!rawTickers.length) {
|
|
426
522
|
return;
|
|
@@ -459,7 +555,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
459
555
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
460
556
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
461
557
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
462
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com
|
|
558
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
463
559
|
*/
|
|
464
560
|
async watchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
465
561
|
await this.loadMarkets();
|
|
@@ -500,6 +596,54 @@ class bitmart extends bitmart$1["default"] {
|
|
|
500
596
|
}
|
|
501
597
|
return this.filterBySymbolSinceLimit(this.orders, symbol, since, limit, true);
|
|
502
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* @method
|
|
601
|
+
* @name bitmart#unWatchOrders
|
|
602
|
+
* @description unWatches information on multiple orders made by the user
|
|
603
|
+
* @see https://developer-pro.bitmart.com/en/spot/#private-order-progress
|
|
604
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#private-order-channel
|
|
605
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
606
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
607
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
608
|
+
*/
|
|
609
|
+
async unWatchOrders(symbol = undefined, params = {}) {
|
|
610
|
+
await this.loadMarkets();
|
|
611
|
+
let market = undefined;
|
|
612
|
+
let messageHash = 'unsubscribe::orders';
|
|
613
|
+
if (symbol !== undefined) {
|
|
614
|
+
symbol = this.symbol(symbol);
|
|
615
|
+
market = this.market(symbol);
|
|
616
|
+
if (market['swap']) {
|
|
617
|
+
throw new errors.NotSupported(this.id + ' unWatchOrders() does not support a symbol for swap markets, unWatch from all markets only');
|
|
618
|
+
}
|
|
619
|
+
messageHash += '::' + symbol;
|
|
620
|
+
}
|
|
621
|
+
let type = 'spot';
|
|
622
|
+
[type, params] = this.handleMarketTypeAndParams('watchOrders', market, params);
|
|
623
|
+
await this.authenticate(type, params);
|
|
624
|
+
let request = undefined;
|
|
625
|
+
if (type === 'spot') {
|
|
626
|
+
let argsRequest = 'spot/user/order:';
|
|
627
|
+
if (symbol !== undefined) {
|
|
628
|
+
argsRequest += market['id'];
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
argsRequest = 'spot/user/orders:ALL_SYMBOLS';
|
|
632
|
+
}
|
|
633
|
+
request = {
|
|
634
|
+
'op': 'unsubscribe',
|
|
635
|
+
'args': [argsRequest],
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
request = {
|
|
640
|
+
'action': 'unsubscribe',
|
|
641
|
+
'args': ['futures/order'],
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
const url = this.implodeHostname(this.urls['api']['ws'][type]['private']);
|
|
645
|
+
return await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
646
|
+
}
|
|
503
647
|
handleOrders(client, message) {
|
|
504
648
|
//
|
|
505
649
|
// spot
|
|
@@ -554,7 +698,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
554
698
|
// ]
|
|
555
699
|
// }
|
|
556
700
|
//
|
|
557
|
-
const orders = this.
|
|
701
|
+
const orders = this.safeList(message, 'data');
|
|
558
702
|
if (orders === undefined) {
|
|
559
703
|
return;
|
|
560
704
|
}
|
|
@@ -670,13 +814,13 @@ class bitmart extends bitmart$1["default"] {
|
|
|
670
814
|
}, market);
|
|
671
815
|
}
|
|
672
816
|
else {
|
|
673
|
-
const orderInfo = this.
|
|
817
|
+
const orderInfo = this.safeDict(order, 'order');
|
|
674
818
|
const marketId = this.safeString(orderInfo, 'symbol');
|
|
675
819
|
const symbol = this.safeSymbol(marketId, market, '', 'swap');
|
|
676
820
|
const orderId = this.safeString(orderInfo, 'order_id');
|
|
677
821
|
const timestamp = this.safeInteger(orderInfo, 'create_time');
|
|
678
822
|
const updatedTimestamp = this.safeInteger(orderInfo, 'update_time');
|
|
679
|
-
const lastTrade = this.
|
|
823
|
+
const lastTrade = this.safeDict(orderInfo, 'last_trade');
|
|
680
824
|
const cachedOrders = this.orders;
|
|
681
825
|
const orders = this.safeValue(cachedOrders.hashmap, symbol, {});
|
|
682
826
|
const cachedOrder = this.safeValue(orders, orderId);
|
|
@@ -771,6 +915,31 @@ class bitmart extends bitmart$1["default"] {
|
|
|
771
915
|
}
|
|
772
916
|
return this.filterBySymbolsSinceLimit(this.positions, symbols, since, limit);
|
|
773
917
|
}
|
|
918
|
+
/**
|
|
919
|
+
* @method
|
|
920
|
+
* @name bitmart#unWatchPositions
|
|
921
|
+
* @description unWatches all open positions
|
|
922
|
+
* @see https://developer-pro.bitmart.com/en/futures/#private-position-channel
|
|
923
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
924
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
925
|
+
* @returns {object} status of the unwatch request
|
|
926
|
+
*/
|
|
927
|
+
async unWatchPositions(symbols = undefined, params = {}) {
|
|
928
|
+
if (symbols !== undefined) {
|
|
929
|
+
const length = symbols.length;
|
|
930
|
+
if (length > 0) {
|
|
931
|
+
throw new errors.NotSupported(this.id + ' unWatchPositions() does not support a list of symbols, unWatch from all markets only');
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
await this.loadMarkets();
|
|
935
|
+
const request = {
|
|
936
|
+
'action': 'unsubscribe',
|
|
937
|
+
'args': ['futures/position'],
|
|
938
|
+
};
|
|
939
|
+
const messageHash = 'unsubscribe::positions';
|
|
940
|
+
const url = this.implodeHostname(this.urls['api']['ws']['swap']['private']);
|
|
941
|
+
return await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
942
|
+
}
|
|
774
943
|
handlePositions(client, message) {
|
|
775
944
|
//
|
|
776
945
|
// {
|
|
@@ -807,7 +976,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
807
976
|
// ]
|
|
808
977
|
// }
|
|
809
978
|
//
|
|
810
|
-
const data = this.
|
|
979
|
+
const data = this.safeList(message, 'data', []);
|
|
811
980
|
if (this.positions === undefined) {
|
|
812
981
|
this.positions = new Cache.ArrayCacheBySymbolBySide();
|
|
813
982
|
}
|
|
@@ -919,7 +1088,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
919
1088
|
// ]
|
|
920
1089
|
// }
|
|
921
1090
|
//
|
|
922
|
-
const data = this.
|
|
1091
|
+
const data = this.safeList(message, 'data');
|
|
923
1092
|
if (data === undefined) {
|
|
924
1093
|
return;
|
|
925
1094
|
}
|
|
@@ -1057,7 +1226,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1057
1226
|
rawTickers = this.safeList(message, 'data', []);
|
|
1058
1227
|
}
|
|
1059
1228
|
else {
|
|
1060
|
-
rawTickers = [this.
|
|
1229
|
+
rawTickers = [this.safeDict(message, 'data', {})];
|
|
1061
1230
|
}
|
|
1062
1231
|
if (!rawTickers.length) {
|
|
1063
1232
|
return;
|
|
@@ -1129,8 +1298,8 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1129
1298
|
symbol = this.symbol(symbol);
|
|
1130
1299
|
const market = this.market(symbol);
|
|
1131
1300
|
let type = 'spot';
|
|
1132
|
-
[type, params] = this.handleMarketTypeAndParams('
|
|
1133
|
-
const timeframes = this.
|
|
1301
|
+
[type, params] = this.handleMarketTypeAndParams('watchOHLCV', market, params);
|
|
1302
|
+
const timeframes = this.safeDict(this.options, 'timeframes', {});
|
|
1134
1303
|
const interval = this.safeString(timeframes, timeframe);
|
|
1135
1304
|
let name = undefined;
|
|
1136
1305
|
if (type === 'spot') {
|
|
@@ -1145,6 +1314,35 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1145
1314
|
}
|
|
1146
1315
|
return this.filterBySinceLimit(ohlcv, since, limit, 0, true);
|
|
1147
1316
|
}
|
|
1317
|
+
/**
|
|
1318
|
+
* @method
|
|
1319
|
+
* @name bitmart#unWatchOHLCV
|
|
1320
|
+
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1321
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-kline-channel
|
|
1322
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-klinebin-channel
|
|
1323
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1324
|
+
* @param {string} timeframe the length of time each candle represents
|
|
1325
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1326
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1327
|
+
*/
|
|
1328
|
+
async unWatchOHLCV(symbol, timeframe = '1m', params = {}) {
|
|
1329
|
+
await this.loadMarkets();
|
|
1330
|
+
symbol = this.symbol(symbol);
|
|
1331
|
+
const market = this.market(symbol);
|
|
1332
|
+
let type = 'spot';
|
|
1333
|
+
[type, params] = this.handleMarketTypeAndParams('unWatchOHLCV', market, params);
|
|
1334
|
+
const timeframes = this.safeDict(this.options, 'timeframes', {});
|
|
1335
|
+
const interval = this.safeString(timeframes, timeframe);
|
|
1336
|
+
let name = undefined;
|
|
1337
|
+
if (type === 'spot') {
|
|
1338
|
+
name = 'kline' + interval;
|
|
1339
|
+
}
|
|
1340
|
+
else {
|
|
1341
|
+
name = 'klineBin' + interval;
|
|
1342
|
+
}
|
|
1343
|
+
params = this.extend(params, { 'unsubscribe': true });
|
|
1344
|
+
return await this.subscribe(name, symbol, type, params);
|
|
1345
|
+
}
|
|
1148
1346
|
handleOHLCV(client, message) {
|
|
1149
1347
|
//
|
|
1150
1348
|
// {
|
|
@@ -1194,7 +1392,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1194
1392
|
const intervalParts = interval.split(':');
|
|
1195
1393
|
interval = this.safeString(intervalParts, 0);
|
|
1196
1394
|
// use a reverse lookup in a static map instead
|
|
1197
|
-
const timeframes = this.
|
|
1395
|
+
const timeframes = this.safeDict(this.options, 'timeframes', {});
|
|
1198
1396
|
const timeframe = this.findTimeframe(interval, timeframes);
|
|
1199
1397
|
const duration = this.parseTimeframe(timeframe);
|
|
1200
1398
|
const durationInMs = duration * 1000;
|
|
@@ -1203,7 +1401,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1203
1401
|
const marketId = this.safeString(data[i], 'symbol');
|
|
1204
1402
|
const market = this.safeMarket(marketId);
|
|
1205
1403
|
const symbol = market['symbol'];
|
|
1206
|
-
const rawOHLCV = this.
|
|
1404
|
+
const rawOHLCV = this.safeList(data[i], 'candle');
|
|
1207
1405
|
const parsed = this.parseOHLCV(rawOHLCV, market);
|
|
1208
1406
|
parsed[0] = this.parseToInt(parsed[0] / durationInMs) * durationInMs;
|
|
1209
1407
|
this.ohlcvs[symbol] = this.safeValue(this.ohlcvs, symbol, {});
|
|
@@ -1222,7 +1420,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1222
1420
|
const marketId = this.safeString(data, 'symbol');
|
|
1223
1421
|
const market = this.safeMarket(marketId, undefined, undefined, 'swap');
|
|
1224
1422
|
const symbol = market['symbol'];
|
|
1225
|
-
const items = this.
|
|
1423
|
+
const items = this.safeList(data, 'items', []);
|
|
1226
1424
|
this.ohlcvs[symbol] = this.safeValue(this.ohlcvs, symbol, {});
|
|
1227
1425
|
let stored = this.safeValue(this.ohlcvs[symbol], timeframe);
|
|
1228
1426
|
if (stored === undefined) {
|
|
@@ -1249,11 +1447,11 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1249
1447
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1250
1448
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1251
1449
|
* @param {string} [params.speed] *futures only* '100ms' or '200ms'
|
|
1252
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com
|
|
1450
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
|
|
1253
1451
|
*/
|
|
1254
1452
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
1255
1453
|
await this.loadMarkets();
|
|
1256
|
-
const options = this.
|
|
1454
|
+
const options = this.safeDict(this.options, 'watchOrderBook', {});
|
|
1257
1455
|
let depth = this.safeString(options, 'depth', 'depth/increase100');
|
|
1258
1456
|
symbol = this.symbol(symbol);
|
|
1259
1457
|
const market = this.market(symbol);
|
|
@@ -1265,6 +1463,31 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1265
1463
|
const orderbook = await this.subscribe(depth, symbol, type, params);
|
|
1266
1464
|
return orderbook.limit();
|
|
1267
1465
|
}
|
|
1466
|
+
/**
|
|
1467
|
+
* @method
|
|
1468
|
+
* @name bitmart#unWatchOrderBook
|
|
1469
|
+
* @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1470
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-depth-all-channel
|
|
1471
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
|
|
1472
|
+
* @see https://developer-pro.bitmart.com/en/futuresv2/#public-depth-channel
|
|
1473
|
+
* @param {string} symbol unified array of symbols
|
|
1474
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1475
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1476
|
+
*/
|
|
1477
|
+
async unWatchOrderBook(symbol, params = {}) {
|
|
1478
|
+
await this.loadMarkets();
|
|
1479
|
+
const options = this.safeDict(this.options, 'watchOrderBook', {});
|
|
1480
|
+
let depth = this.safeString(options, 'depth', 'depth/increase100');
|
|
1481
|
+
symbol = this.symbol(symbol);
|
|
1482
|
+
const market = this.market(symbol);
|
|
1483
|
+
let type = 'spot';
|
|
1484
|
+
[type, params] = this.handleMarketTypeAndParams('unWatchOrderBook', market, params);
|
|
1485
|
+
if (type === 'swap' && depth === 'depth/increase100') {
|
|
1486
|
+
depth = 'depth50';
|
|
1487
|
+
}
|
|
1488
|
+
params = this.extend(params, { 'unsubscribe': true });
|
|
1489
|
+
return await this.subscribe(depth, symbol, type, params);
|
|
1490
|
+
}
|
|
1268
1491
|
handleDelta(bookside, delta) {
|
|
1269
1492
|
const price = this.safeFloat(delta, 0);
|
|
1270
1493
|
const amount = this.safeFloat(delta, 1);
|
|
@@ -1483,7 +1706,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1483
1706
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1484
1707
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1485
1708
|
* @param {string} [params.depth] the type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
|
|
1486
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com
|
|
1709
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
|
|
1487
1710
|
*/
|
|
1488
1711
|
async watchOrderBookForSymbols(symbols, limit = undefined, params = {}) {
|
|
1489
1712
|
await this.loadMarkets();
|
|
@@ -1497,6 +1720,28 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1497
1720
|
const orderbook = await this.subscribeMultiple(channel, type, symbols, params);
|
|
1498
1721
|
return orderbook.limit();
|
|
1499
1722
|
}
|
|
1723
|
+
/**
|
|
1724
|
+
* @method
|
|
1725
|
+
* @name bitmart#unWatchOrderBookForSymbols
|
|
1726
|
+
* @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1727
|
+
* @see https://developer-pro.bitmart.com/en/spot/#public-depth-increase-channel
|
|
1728
|
+
* @param {string[]} symbols unified array of symbols
|
|
1729
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1730
|
+
* @param {string} [params.depth] the type of order book to subscribe to, default is 'depth/increase100', also accepts 'depth5' or 'depth20' or depth50
|
|
1731
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1732
|
+
*/
|
|
1733
|
+
async unWatchOrderBookForSymbols(symbols, params = {}) {
|
|
1734
|
+
await this.loadMarkets();
|
|
1735
|
+
let type = undefined;
|
|
1736
|
+
[symbols, type, params] = this.getParamsForMultipleSub('unWatchOrderBookForSymbols', symbols, undefined, params);
|
|
1737
|
+
let channel = undefined;
|
|
1738
|
+
[channel, params] = this.handleOptionAndParams(params, 'unWatchOrderBookForSymbols', 'depth', 'depth/increase100');
|
|
1739
|
+
if (type === 'swap' && channel === 'depth/increase100') {
|
|
1740
|
+
channel = 'depth50';
|
|
1741
|
+
}
|
|
1742
|
+
params = this.extend(params, { 'unsubscribe': true });
|
|
1743
|
+
return await this.subscribeMultiple(channel, type, symbols, params);
|
|
1744
|
+
}
|
|
1500
1745
|
async authenticate(type, params = {}) {
|
|
1501
1746
|
this.checkRequiredCredentials();
|
|
1502
1747
|
const url = this.implodeHostname(this.urls['api']['ws'][type]['private']);
|
|
@@ -1594,6 +1839,119 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1594
1839
|
return true;
|
|
1595
1840
|
}
|
|
1596
1841
|
}
|
|
1842
|
+
handleUnSubscription(client, message) {
|
|
1843
|
+
//
|
|
1844
|
+
// spot
|
|
1845
|
+
// {
|
|
1846
|
+
// "topic": "spot/ticker:ETH_USDT",
|
|
1847
|
+
// "event": "unsubscribe"
|
|
1848
|
+
// }
|
|
1849
|
+
//
|
|
1850
|
+
// swap
|
|
1851
|
+
// {
|
|
1852
|
+
// "action": "unsubscribe",
|
|
1853
|
+
// "group": "futures/ticker:ETHUSDT",
|
|
1854
|
+
// "success": true,
|
|
1855
|
+
// "request": {
|
|
1856
|
+
// "action": "unsubscribe",
|
|
1857
|
+
// "args": [
|
|
1858
|
+
// "futures/ticker:ETHUSDT"
|
|
1859
|
+
// ]
|
|
1860
|
+
// }
|
|
1861
|
+
// }
|
|
1862
|
+
//
|
|
1863
|
+
const messageTopic = this.safeString2(message, 'topic', 'group');
|
|
1864
|
+
const unSubMessageTopic = 'unsubscribe::' + messageTopic;
|
|
1865
|
+
// one message includes info about one unsubscription only even if we requested multiple
|
|
1866
|
+
// so we can not just create subscription object in unWatch method and use it here
|
|
1867
|
+
// we need to reconstruct subscription params from the messageTopic
|
|
1868
|
+
const subscription = this.getUnSubParams(messageTopic);
|
|
1869
|
+
const subHash = this.safeString(subscription, 'subHash');
|
|
1870
|
+
const unsubHash = 'unsubscribe::' + subHash;
|
|
1871
|
+
const subHashIsPrefix = this.safeBool(subscription, 'subHashIsPrefix', false);
|
|
1872
|
+
// clean up both ways of storing subscription and unsubscription
|
|
1873
|
+
this.cleanUnsubscription(client, subHash, unsubHash, subHashIsPrefix);
|
|
1874
|
+
this.cleanUnsubscription(client, messageTopic, unSubMessageTopic, subHashIsPrefix);
|
|
1875
|
+
this.cleanCache(subscription);
|
|
1876
|
+
}
|
|
1877
|
+
getUnSubParams(messageTopic) {
|
|
1878
|
+
const parts = messageTopic.split(':');
|
|
1879
|
+
const channel = this.safeString(parts, 0);
|
|
1880
|
+
const marketTypeAndTopic = channel.split('/');
|
|
1881
|
+
const rawMarketType = this.safeStringLower(marketTypeAndTopic, 0);
|
|
1882
|
+
const marketType = this.parseMarketType(rawMarketType);
|
|
1883
|
+
let topic = this.safeString(marketTypeAndTopic, 1);
|
|
1884
|
+
const thirdPart = this.safeString(marketTypeAndTopic, 2);
|
|
1885
|
+
if (thirdPart !== undefined) {
|
|
1886
|
+
topic += '/' + thirdPart;
|
|
1887
|
+
}
|
|
1888
|
+
const marketId = this.safeString(parts, 1);
|
|
1889
|
+
const symbols = [];
|
|
1890
|
+
let symbol = undefined;
|
|
1891
|
+
let subHash = topic;
|
|
1892
|
+
let hashDelimiter = ':';
|
|
1893
|
+
let subHashIsPrefix = false;
|
|
1894
|
+
const parsedTopic = this.parseTopic(topic);
|
|
1895
|
+
if ((parsedTopic === 'orders') || (parsedTopic === 'positions')) {
|
|
1896
|
+
subHash = parsedTopic;
|
|
1897
|
+
hashDelimiter = '::';
|
|
1898
|
+
}
|
|
1899
|
+
if ((marketId !== undefined) && (marketId !== 'ALL_SYMBOLS')) {
|
|
1900
|
+
// if marketId is defined, we have a single symbol subscription
|
|
1901
|
+
const delimiter = (marketType === 'spot') ? '_' : '';
|
|
1902
|
+
const market = this.safeMarket(marketId, undefined, delimiter, marketType);
|
|
1903
|
+
symbol = market['symbol'];
|
|
1904
|
+
subHash += hashDelimiter + symbol;
|
|
1905
|
+
symbols.push(symbol);
|
|
1906
|
+
}
|
|
1907
|
+
else {
|
|
1908
|
+
subHashIsPrefix = true; // need to clean all subHashes with this prefix
|
|
1909
|
+
}
|
|
1910
|
+
const symbolsAndTimeframes = [];
|
|
1911
|
+
if (topic.startsWith('kline')) {
|
|
1912
|
+
let interval = topic.replace('kline', '');
|
|
1913
|
+
if (interval.startsWith('Bin')) {
|
|
1914
|
+
// swap market
|
|
1915
|
+
interval = interval.replace('Bin', '');
|
|
1916
|
+
}
|
|
1917
|
+
const timeframes = this.safeDict(this.options, 'timeframes', {});
|
|
1918
|
+
const timeframe = this.findTimeframe(interval, timeframes);
|
|
1919
|
+
const symbolAndTimeframe = [symbol, timeframe];
|
|
1920
|
+
symbolsAndTimeframes.push(symbolAndTimeframe);
|
|
1921
|
+
}
|
|
1922
|
+
const result = {
|
|
1923
|
+
'topic': parsedTopic,
|
|
1924
|
+
'symbols': symbols,
|
|
1925
|
+
'subHash': subHash,
|
|
1926
|
+
'symbolsAndTimeframes': symbolsAndTimeframes,
|
|
1927
|
+
'subHashIsPrefix': subHashIsPrefix,
|
|
1928
|
+
};
|
|
1929
|
+
return result;
|
|
1930
|
+
}
|
|
1931
|
+
parseTopic(topic) {
|
|
1932
|
+
if (topic.startsWith('depth')) {
|
|
1933
|
+
return 'orderbook';
|
|
1934
|
+
}
|
|
1935
|
+
if (topic.startsWith('kline')) {
|
|
1936
|
+
return 'ohlcv';
|
|
1937
|
+
}
|
|
1938
|
+
const topics = {
|
|
1939
|
+
'ticker': 'ticker',
|
|
1940
|
+
'trade': 'trades',
|
|
1941
|
+
'user/order': 'orders',
|
|
1942
|
+
'user/orders': 'orders',
|
|
1943
|
+
'order': 'orders',
|
|
1944
|
+
'position': 'positions',
|
|
1945
|
+
};
|
|
1946
|
+
return this.safeString(topics, topic, topic);
|
|
1947
|
+
}
|
|
1948
|
+
parseMarketType(marketType) {
|
|
1949
|
+
const types = {
|
|
1950
|
+
'spot': 'spot',
|
|
1951
|
+
'futures': 'swap',
|
|
1952
|
+
};
|
|
1953
|
+
return this.safeString(types, marketType, marketType);
|
|
1954
|
+
}
|
|
1597
1955
|
handleMessage(client, message) {
|
|
1598
1956
|
if (this.handleErrorMessage(client, message)) {
|
|
1599
1957
|
return;
|
|
@@ -1653,6 +2011,7 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1653
2011
|
'login': this.handleAuthenticate,
|
|
1654
2012
|
'access': this.handleAuthenticate,
|
|
1655
2013
|
'subscribe': this.handleSubscriptionStatus,
|
|
2014
|
+
'unsubscribe': this.handleUnSubscription,
|
|
1656
2015
|
};
|
|
1657
2016
|
const method = this.safeValue(methods, event);
|
|
1658
2017
|
if (method !== undefined) {
|