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