ccxt 4.5.82 → 4.5.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/abstract/prediction/sxbet.js +11 -0
- package/dist/cjs/src/apex.js +1 -0
- package/dist/cjs/src/aster.js +2 -2
- package/dist/cjs/src/base/Exchange.js +1 -1
- package/dist/cjs/src/bigone.js +2 -2
- package/dist/cjs/src/binance.js +10 -10
- package/dist/cjs/src/bingx.js +3 -3
- package/dist/cjs/src/bit2c.js +4 -4
- package/dist/cjs/src/bitbank.js +15 -15
- package/dist/cjs/src/bitfinex.js +15 -15
- package/dist/cjs/src/bitget.js +109 -73
- package/dist/cjs/src/bitmex.js +7 -7
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +6 -6
- package/dist/cjs/src/bitso.js +18 -18
- package/dist/cjs/src/bitstamp.js +5 -5
- package/dist/cjs/src/bitteam.js +32 -32
- package/dist/cjs/src/bittrade.js +10 -10
- package/dist/cjs/src/bitvavo.js +9 -9
- package/dist/cjs/src/blockchaincom.js +2 -2
- package/dist/cjs/src/btcbox.js +2 -2
- package/dist/cjs/src/btcmarkets.js +2 -2
- package/dist/cjs/src/btcturk.js +2 -2
- package/dist/cjs/src/btse.js +2 -2
- package/dist/cjs/src/bybitid.js +4 -0
- package/dist/cjs/src/coinbase.js +1 -1
- package/dist/cjs/src/coinbaseexchange.js +13 -13
- package/dist/cjs/src/coincheck.js +4 -4
- package/dist/cjs/src/coinex.js +10 -10
- package/dist/cjs/src/coinmate.js +4 -4
- package/dist/cjs/src/coinone.js +4 -4
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +5 -5
- package/dist/cjs/src/deribit.js +31 -31
- package/dist/cjs/src/derive.js +1 -1
- package/dist/cjs/src/digifinex.js +31 -31
- package/dist/cjs/src/gate.js +25 -25
- package/dist/cjs/src/gemini.js +5 -5
- package/dist/cjs/src/grvt.js +1 -1
- package/dist/cjs/src/hibachi.js +5 -5
- package/dist/cjs/src/hitbtc.js +15 -15
- package/dist/cjs/src/hollaex.js +15 -15
- package/dist/cjs/src/htx.js +52 -52
- package/dist/cjs/src/hyperliquid.js +2 -2
- package/dist/cjs/src/independentreserve.js +2 -2
- package/dist/cjs/src/indodax.js +8 -8
- package/dist/cjs/src/kraken.js +29 -29
- package/dist/cjs/src/krakenfutures.js +16 -16
- package/dist/cjs/src/kucoin.js +15 -15
- package/dist/cjs/src/latoken.js +8 -8
- package/dist/cjs/src/lbank.js +31 -31
- package/dist/cjs/src/lighter.js +2 -2
- package/dist/cjs/src/luno.js +2 -2
- package/dist/cjs/src/mercado.js +12 -12
- package/dist/cjs/src/mexc.js +27 -27
- package/dist/cjs/src/modetrade.js +10 -10
- package/dist/cjs/src/ndax.js +4 -4
- package/dist/cjs/src/okx.js +19 -20
- package/dist/cjs/src/onetrading.js +7 -7
- package/dist/cjs/src/p2b.js +8 -8
- package/dist/cjs/src/pacifica.js +9 -3
- package/dist/cjs/src/paymium.js +2 -2
- package/dist/cjs/src/phemex.js +37 -37
- package/dist/cjs/src/poloniex.js +14 -14
- package/dist/cjs/src/prediction/sxbet.js +2710 -0
- package/dist/cjs/src/pro/alpaca.js +5 -5
- package/dist/cjs/src/pro/apex.js +6 -6
- package/dist/cjs/src/pro/aster.js +8 -8
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +26 -26
- package/dist/cjs/src/pro/bingx.js +11 -11
- package/dist/cjs/src/pro/bitfinex.js +11 -11
- package/dist/cjs/src/pro/bitget.js +20 -20
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +12 -12
- package/dist/cjs/src/pro/bitopro.js +5 -5
- package/dist/cjs/src/pro/bitrue.js +7 -7
- package/dist/cjs/src/pro/bitstamp.js +5 -5
- package/dist/cjs/src/pro/bittrade.js +11 -11
- package/dist/cjs/src/pro/bitvavo.js +16 -16
- package/dist/cjs/src/pro/blockchaincom.js +5 -5
- package/dist/cjs/src/pro/blofin.js +2 -2
- package/dist/cjs/src/pro/bybit.js +21 -21
- package/dist/cjs/src/pro/bydfi.js +2 -2
- package/dist/cjs/src/pro/cex.js +19 -19
- package/dist/cjs/src/pro/coinbase.js +2 -2
- package/dist/cjs/src/pro/coinbaseexchange.js +9 -9
- package/dist/cjs/src/pro/coinbaseinternational.js +2 -2
- package/dist/cjs/src/pro/coincheck.js +2 -2
- package/dist/cjs/src/pro/coinex.js +3 -3
- package/dist/cjs/src/pro/coinone.js +6 -6
- package/dist/cjs/src/pro/cryptocom.js +10 -10
- package/dist/cjs/src/pro/deribit.js +13 -13
- package/dist/cjs/src/pro/derive.js +4 -4
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/extended.js +16 -10
- package/dist/cjs/src/pro/gate.js +10 -10
- package/dist/cjs/src/pro/gemini.js +3 -3
- package/dist/cjs/src/pro/grvt.js +2 -2
- package/dist/cjs/src/pro/hashkey.js +2 -2
- package/dist/cjs/src/pro/hitbtc.js +6 -6
- package/dist/cjs/src/pro/hollaex.js +3 -3
- package/dist/cjs/src/pro/htx.js +28 -28
- package/dist/cjs/src/pro/hyperliquid.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +2 -2
- package/dist/cjs/src/pro/kraken.js +7 -7
- package/dist/cjs/src/pro/krakenfutures.js +12 -12
- package/dist/cjs/src/pro/kucoin.js +12 -12
- package/dist/cjs/src/pro/lbank.js +16 -16
- package/dist/cjs/src/pro/luno.js +2 -2
- package/dist/cjs/src/pro/mexc.js +8 -8
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/mudrex.js +2 -2
- package/dist/cjs/src/pro/nado.js +3 -3
- package/dist/cjs/src/pro/ndax.js +6 -6
- package/dist/cjs/src/pro/okx.js +20 -20
- package/dist/cjs/src/pro/onetrading.js +14 -14
- package/dist/cjs/src/pro/p2b.js +5 -5
- package/dist/cjs/src/pro/pacifica.js +1 -1
- package/dist/cjs/src/pro/paradex.js +1 -1
- package/dist/cjs/src/pro/phemex.js +13 -13
- package/dist/cjs/src/pro/poloniex.js +17 -17
- package/dist/cjs/src/pro/toobit.js +2 -2
- package/dist/cjs/src/pro/upbit.js +4 -4
- package/dist/cjs/src/pro/weex.js +2 -2
- package/dist/cjs/src/pro/whitebit.js +12 -12
- package/dist/cjs/src/pro/woo.js +13 -13
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +3 -3
- package/dist/cjs/src/tokocrypto.js +20 -20
- package/dist/cjs/src/upbit.js +12 -12
- package/dist/cjs/src/whitebit.js +15 -15
- package/dist/cjs/src/woo.js +3 -3
- package/dist/cjs/src/woofipro.js +14 -14
- package/dist/cjs/src/zaif.js +9 -3
- package/dist/cjs/src/zebpay.js +1 -1
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/prediction/sxbet.d.ts +41 -0
- package/js/src/abstract/prediction/sxbet.js +11 -0
- package/js/src/alpaca.d.ts +28 -33
- package/js/src/apex.d.ts +28 -42
- package/js/src/apex.js +1 -0
- package/js/src/aster.d.ts +58 -108
- package/js/src/aster.js +2 -2
- package/js/src/backpack.d.ts +34 -48
- package/js/src/base/Exchange.d.ts +304 -320
- package/js/src/base/Exchange.js +1 -1
- package/js/src/bigone.d.ts +24 -29
- package/js/src/bigone.js +2 -2
- package/js/src/binance.d.ts +112 -138
- package/js/src/binance.js +10 -10
- package/js/src/binancecoinm.d.ts +3 -2
- package/js/src/binanceusdm.d.ts +3 -2
- package/js/src/bingx.d.ts +65 -84
- package/js/src/bingx.js +3 -3
- package/js/src/bit2c.d.ts +13 -18
- package/js/src/bit2c.js +4 -4
- package/js/src/bitbank.d.ts +16 -21
- package/js/src/bitbank.js +15 -15
- package/js/src/bitbns.d.ts +15 -20
- package/js/src/bitfinex.d.ts +46 -51
- package/js/src/bitfinex.js +15 -15
- package/js/src/bitflyer.d.ts +20 -25
- package/js/src/bitget.d.ts +105 -93
- package/js/src/bitget.js +109 -73
- package/js/src/bithumb.d.ts +26 -31
- package/js/src/bitmex.d.ts +48 -65
- package/js/src/bitmex.js +7 -7
- package/js/src/bitopro.d.ts +25 -41
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.d.ts +30 -45
- package/js/src/bitrue.js +6 -6
- package/js/src/bitso.d.ts +24 -29
- package/js/src/bitso.js +18 -18
- package/js/src/bitstamp.d.ts +36 -47
- package/js/src/bitstamp.js +5 -5
- package/js/src/bitteam.d.ts +22 -27
- package/js/src/bitteam.js +32 -32
- package/js/src/bittrade.d.ts +35 -46
- package/js/src/bittrade.js +10 -10
- package/js/src/bitvavo.d.ts +43 -48
- package/js/src/bitvavo.js +9 -9
- package/js/src/blockchaincom.d.ts +26 -31
- package/js/src/blockchaincom.js +2 -2
- package/js/src/blofin.d.ts +38 -43
- package/js/src/btcbox.d.ts +14 -19
- package/js/src/btcbox.js +2 -2
- package/js/src/btcmarkets.d.ts +25 -30
- package/js/src/btcmarkets.js +2 -2
- package/js/src/btcturk.d.ts +13 -18
- package/js/src/btcturk.js +2 -2
- package/js/src/btse.d.ts +44 -50
- package/js/src/btse.js +2 -2
- package/js/src/bullish.d.ts +35 -57
- package/js/src/bybit.d.ts +95 -106
- package/js/src/bybitid.js +4 -0
- package/js/src/bydfi.d.ts +37 -48
- package/js/src/cex.d.ts +29 -34
- package/js/src/coinbase.d.ts +66 -82
- package/js/src/coinbase.js +1 -1
- package/js/src/coinbaseexchange.d.ts +33 -43
- package/js/src/coinbaseexchange.js +13 -13
- package/js/src/coinbaseinternational.d.ts +34 -73
- package/js/src/coincheck.d.ts +13 -18
- package/js/src/coincheck.js +4 -4
- package/js/src/coinex.d.ts +63 -68
- package/js/src/coinex.js +10 -10
- package/js/src/coinmate.d.ts +15 -20
- package/js/src/coinmate.js +4 -4
- package/js/src/coinone.d.ts +14 -19
- package/js/src/coinone.js +4 -4
- package/js/src/coinsph.d.ts +32 -37
- package/js/src/coinsph.js +5 -5
- package/js/src/coinspot.d.ts +10 -15
- package/js/src/cryptocom.d.ts +48 -64
- package/js/src/cryptocom.js +5 -5
- package/js/src/cryptomus.d.ts +15 -23
- package/js/src/deepcoin.d.ts +43 -48
- package/js/src/delta.d.ts +43 -54
- package/js/src/deribit.d.ts +48 -69
- package/js/src/deribit.js +31 -31
- package/js/src/derive.d.ts +28 -42
- package/js/src/derive.js +1 -1
- package/js/src/digifinex.d.ts +54 -67
- package/js/src/digifinex.js +31 -31
- package/js/src/dydx.d.ts +26 -31
- package/js/src/extended.d.ts +51 -56
- package/js/src/foxbit.d.ts +34 -64
- package/js/src/gate.d.ts +94 -162
- package/js/src/gate.js +25 -25
- package/js/src/gemini.d.ts +33 -43
- package/js/src/gemini.js +5 -5
- package/js/src/grvt.d.ts +36 -47
- package/js/src/grvt.js +1 -1
- package/js/src/hashkey.d.ts +58 -78
- package/js/src/hibachi.d.ts +42 -52
- package/js/src/hibachi.js +5 -5
- package/js/src/hitbtc.d.ts +49 -56
- package/js/src/hitbtc.js +15 -15
- package/js/src/hollaex.d.ts +26 -31
- package/js/src/hollaex.js +15 -15
- package/js/src/htx.d.ts +80 -121
- package/js/src/htx.js +52 -52
- package/js/src/hyperliquid.d.ts +77 -127
- package/js/src/hyperliquid.js +2 -2
- package/js/src/independentreserve.d.ts +15 -20
- package/js/src/independentreserve.js +2 -2
- package/js/src/indodax.d.ts +19 -24
- package/js/src/indodax.js +8 -8
- package/js/src/kraken.d.ts +43 -55
- package/js/src/kraken.js +29 -29
- package/js/src/krakenfutures.d.ts +34 -39
- package/js/src/krakenfutures.js +16 -16
- package/js/src/kucoin.d.ts +121 -132
- package/js/src/kucoin.js +15 -15
- package/js/src/kucoinfutures.d.ts +4 -4
- package/js/src/latoken.d.ts +24 -29
- package/js/src/latoken.js +8 -8
- package/js/src/lbank.d.ts +40 -53
- package/js/src/lbank.js +31 -31
- package/js/src/lighter.d.ts +40 -45
- package/js/src/lighter.js +2 -2
- package/js/src/luno.d.ts +25 -30
- package/js/src/luno.js +2 -2
- package/js/src/mercado.d.ts +15 -20
- package/js/src/mercado.js +12 -12
- package/js/src/mexc.d.ts +70 -83
- package/js/src/mexc.js +27 -27
- package/js/src/modetrade.d.ts +43 -57
- package/js/src/modetrade.js +10 -10
- package/js/src/mudrex.d.ts +25 -35
- package/js/src/nado.d.ts +45 -50
- package/js/src/ndax.d.ts +27 -32
- package/js/src/ndax.js +4 -4
- package/js/src/okx.d.ts +97 -108
- package/js/src/okx.js +19 -20
- package/js/src/onetrading.d.ts +23 -31
- package/js/src/onetrading.js +7 -7
- package/js/src/p2b.d.ts +17 -22
- package/js/src/p2b.js +8 -8
- package/js/src/pacifica.d.ts +55 -73
- package/js/src/pacifica.js +9 -3
- package/js/src/paradex.d.ts +47 -68
- package/js/src/paymium.d.ts +12 -17
- package/js/src/paymium.js +2 -2
- package/js/src/phemex.d.ts +47 -52
- package/js/src/phemex.js +37 -37
- package/js/src/poloniex.d.ts +45 -50
- package/js/src/poloniex.js +14 -14
- package/js/src/prediction/sxbet.d.ts +595 -0
- package/js/src/prediction/sxbet.js +2708 -0
- package/js/src/pro/alpaca.d.ts +23 -23
- package/js/src/pro/alpaca.js +5 -5
- package/js/src/pro/apex.d.ts +28 -28
- package/js/src/pro/apex.js +6 -6
- package/js/src/pro/aster.d.ts +33 -33
- package/js/src/pro/aster.js +8 -8
- package/js/src/pro/backpack.d.ts +28 -28
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +57 -57
- package/js/src/pro/binance.js +26 -26
- package/js/src/pro/bingx.d.ts +26 -26
- package/js/src/pro/bingx.js +11 -11
- package/js/src/pro/bitfinex.d.ts +25 -25
- package/js/src/pro/bitfinex.js +11 -11
- package/js/src/pro/bitget.d.ts +41 -41
- package/js/src/pro/bitget.js +20 -20
- package/js/src/pro/bithumb.d.ts +15 -15
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmex.d.ts +29 -29
- package/js/src/pro/bitmex.js +12 -12
- package/js/src/pro/bitopro.d.ts +13 -13
- package/js/src/pro/bitopro.js +5 -5
- package/js/src/pro/bitrue.d.ts +25 -25
- package/js/src/pro/bitrue.js +7 -7
- package/js/src/pro/bitstamp.d.ts +21 -21
- package/js/src/pro/bitstamp.js +5 -5
- package/js/src/pro/bittrade.d.ts +19 -19
- package/js/src/pro/bittrade.js +11 -11
- package/js/src/pro/bitvavo.d.ts +62 -62
- package/js/src/pro/bitvavo.js +16 -16
- package/js/src/pro/blockchaincom.d.ts +19 -19
- package/js/src/pro/blockchaincom.js +5 -5
- package/js/src/pro/blofin.d.ts +23 -23
- package/js/src/pro/blofin.js +2 -2
- package/js/src/pro/bullish.d.ts +19 -25
- package/js/src/pro/bybit.d.ts +42 -45
- package/js/src/pro/bybit.js +21 -21
- package/js/src/pro/bydfi.d.ts +24 -24
- package/js/src/pro/bydfi.js +2 -2
- package/js/src/pro/cex.d.ts +37 -37
- package/js/src/pro/cex.js +19 -19
- package/js/src/pro/coinbase.d.ts +19 -19
- package/js/src/pro/coinbase.js +2 -2
- package/js/src/pro/coinbaseexchange.d.ts +25 -25
- package/js/src/pro/coinbaseexchange.js +9 -9
- package/js/src/pro/coinbaseinternational.d.ts +20 -20
- package/js/src/pro/coinbaseinternational.js +2 -2
- package/js/src/pro/coincheck.d.ts +5 -5
- package/js/src/pro/coincheck.js +2 -2
- package/js/src/pro/coinex.d.ts +24 -24
- package/js/src/pro/coinex.js +3 -3
- package/js/src/pro/coinone.d.ts +9 -11
- package/js/src/pro/coinone.js +6 -6
- package/js/src/pro/cryptocom.d.ts +40 -40
- package/js/src/pro/cryptocom.js +10 -10
- package/js/src/pro/deepcoin.d.ts +24 -32
- package/js/src/pro/deribit.d.ts +24 -24
- package/js/src/pro/deribit.js +13 -13
- package/js/src/pro/derive.d.ts +22 -22
- package/js/src/pro/derive.js +4 -4
- package/js/src/pro/dydx.d.ts +9 -9
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/extended.d.ts +22 -22
- package/js/src/pro/extended.js +16 -10
- package/js/src/pro/gate.d.ts +50 -50
- package/js/src/pro/gate.js +10 -10
- package/js/src/pro/gemini.d.ts +26 -26
- package/js/src/pro/gemini.js +3 -3
- package/js/src/pro/grvt.d.ts +22 -22
- package/js/src/pro/grvt.js +2 -2
- package/js/src/pro/hashkey.d.ts +19 -19
- package/js/src/pro/hashkey.js +2 -2
- package/js/src/pro/hitbtc.d.ts +32 -32
- package/js/src/pro/hitbtc.js +6 -6
- package/js/src/pro/hollaex.d.ts +15 -17
- package/js/src/pro/hollaex.js +3 -3
- package/js/src/pro/htx.d.ts +36 -36
- package/js/src/pro/htx.js +28 -28
- package/js/src/pro/hyperliquid.d.ts +29 -31
- package/js/src/pro/hyperliquid.js +1 -1
- package/js/src/pro/independentreserve.d.ts +10 -10
- package/js/src/pro/independentreserve.js +2 -2
- package/js/src/pro/kraken.d.ts +41 -55
- package/js/src/pro/kraken.js +7 -7
- package/js/src/pro/krakenfutures.d.ts +32 -32
- package/js/src/pro/krakenfutures.js +12 -12
- package/js/src/pro/kucoin.d.ts +69 -72
- package/js/src/pro/kucoin.js +12 -12
- package/js/src/pro/kucoinfutures.d.ts +4 -4
- package/js/src/pro/lbank.d.ts +22 -22
- package/js/src/pro/lbank.js +16 -16
- package/js/src/pro/lighter.d.ts +27 -27
- package/js/src/pro/luno.d.ts +8 -8
- package/js/src/pro/luno.js +2 -2
- package/js/src/pro/mexc.d.ts +33 -33
- package/js/src/pro/mexc.js +8 -8
- package/js/src/pro/modetrade.d.ts +37 -39
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/mudrex.d.ts +8 -8
- package/js/src/pro/mudrex.js +2 -2
- package/js/src/pro/nado.d.ts +42 -46
- package/js/src/pro/nado.js +3 -3
- package/js/src/pro/ndax.d.ts +12 -12
- package/js/src/pro/ndax.js +6 -6
- package/js/src/pro/okx.d.ts +49 -49
- package/js/src/pro/okx.js +20 -20
- package/js/src/pro/onetrading.d.ts +28 -28
- package/js/src/pro/onetrading.js +14 -14
- package/js/src/pro/p2b.d.ts +15 -19
- package/js/src/pro/p2b.js +5 -5
- package/js/src/pro/pacifica.d.ts +22 -22
- package/js/src/pro/pacifica.js +1 -1
- package/js/src/pro/paradex.d.ts +18 -18
- package/js/src/pro/paradex.js +1 -1
- package/js/src/pro/phemex.d.ts +25 -25
- package/js/src/pro/phemex.js +13 -13
- package/js/src/pro/poloniex.d.ts +30 -32
- package/js/src/pro/poloniex.js +17 -17
- package/js/src/pro/toobit.d.ts +31 -31
- package/js/src/pro/toobit.js +2 -2
- package/js/src/pro/upbit.d.ts +24 -24
- package/js/src/pro/upbit.js +4 -4
- package/js/src/pro/weex.d.ts +39 -39
- package/js/src/pro/weex.js +2 -2
- package/js/src/pro/whitebit.d.ts +26 -30
- package/js/src/pro/whitebit.js +12 -12
- package/js/src/pro/woo.d.ts +44 -46
- package/js/src/pro/woo.js +13 -13
- package/js/src/pro/woofipro.d.ts +39 -41
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.d.ts +20 -20
- package/js/src/pro/xt.js +3 -3
- package/js/src/revolutx.d.ts +17 -17
- package/js/src/tokocrypto.d.ts +25 -30
- package/js/src/tokocrypto.js +20 -20
- package/js/src/toobit.d.ts +45 -79
- package/js/src/upbit.d.ts +28 -61
- package/js/src/upbit.js +12 -12
- package/js/src/weex.d.ts +57 -68
- package/js/src/whitebit.d.ts +53 -64
- package/js/src/whitebit.js +15 -15
- package/js/src/woo.d.ts +61 -75
- package/js/src/woo.js +3 -3
- package/js/src/woofipro.d.ts +53 -67
- package/js/src/woofipro.js +14 -14
- package/js/src/xt.d.ts +57 -67
- package/js/src/zaif.d.ts +11 -16
- package/js/src/zaif.js +9 -3
- package/js/src/zebpay.d.ts +32 -37
- package/js/src/zebpay.js +1 -1
- package/package.json +2 -2
package/dist/cjs/src/ndax.js
CHANGED
|
@@ -622,7 +622,7 @@ class ndax extends ndax$1["default"] {
|
|
|
622
622
|
const base = this.safeCurrencyCode(this.safeString(market, 'Product1Symbol'));
|
|
623
623
|
const quote = this.safeCurrencyCode(this.safeString(market, 'Product2Symbol'));
|
|
624
624
|
const sessionStatus = this.safeString(market, 'SessionStatus');
|
|
625
|
-
const isDisable = this.
|
|
625
|
+
const isDisable = this.safeBool(market, 'IsDisable');
|
|
626
626
|
const sessionRunning = (sessionStatus === 'Running');
|
|
627
627
|
return this.safeMarketStructure({
|
|
628
628
|
'id': id,
|
|
@@ -2478,7 +2478,7 @@ class ndax extends ndax$1["default"] {
|
|
|
2478
2478
|
'Confirmed2Fa': 'pending', // user has confirmed withdraw via 2-factor authentication.
|
|
2479
2479
|
},
|
|
2480
2480
|
};
|
|
2481
|
-
const statuses = (type === undefined) ? {} : this.
|
|
2481
|
+
const statuses = (type === undefined) ? {} : this.safeDict(statusesByType, type, {});
|
|
2482
2482
|
if (status === undefined) {
|
|
2483
2483
|
return undefined;
|
|
2484
2484
|
}
|
|
@@ -2632,8 +2632,8 @@ class ndax extends ndax$1["default"] {
|
|
|
2632
2632
|
// ]
|
|
2633
2633
|
// }
|
|
2634
2634
|
//
|
|
2635
|
-
const templateTypes = this.
|
|
2636
|
-
const firstTemplateType = this.
|
|
2635
|
+
const templateTypes = this.safeList(withdrawTemplateTypesResponse, 'TemplateTypes', []);
|
|
2636
|
+
const firstTemplateType = this.safeDict(templateTypes, 0);
|
|
2637
2637
|
if (firstTemplateType === undefined) {
|
|
2638
2638
|
throw new errors.ExchangeError(this.id + ' withdraw() could not find a withdraw template type for ' + currency['code']);
|
|
2639
2639
|
}
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -3237,8 +3237,8 @@ class okx extends okx$1["default"] {
|
|
|
3237
3237
|
const slOrdPx = this.safeNumber(params, 'slOrdPx', price);
|
|
3238
3238
|
const slTriggerPxType = this.safeString(params, 'slTriggerPxType', 'last');
|
|
3239
3239
|
const clientOrderId = this.safeString2(params, 'clOrdId', 'clientOrderId');
|
|
3240
|
-
const stopLoss = this.
|
|
3241
|
-
const takeProfit = this.
|
|
3240
|
+
const stopLoss = this.safeDict(params, 'stopLoss');
|
|
3241
|
+
const takeProfit = this.safeDict(params, 'takeProfit');
|
|
3242
3242
|
const hasStopLoss = (stopLoss !== undefined);
|
|
3243
3243
|
const hasTakeProfit = (takeProfit !== undefined);
|
|
3244
3244
|
const trailingPercent = this.safeString2(params, 'trailingPercent', 'callbackRatio');
|
|
@@ -3606,8 +3606,8 @@ class okx extends okx$1["default"] {
|
|
|
3606
3606
|
}
|
|
3607
3607
|
const type = this.safeString(rawOrder, 'type', '');
|
|
3608
3608
|
const side = this.safeString(rawOrder, 'side');
|
|
3609
|
-
const amount = this.
|
|
3610
|
-
const price = this.
|
|
3609
|
+
const amount = this.safeNumber(rawOrder, 'amount');
|
|
3610
|
+
const price = this.safeNumber(rawOrder, 'price');
|
|
3611
3611
|
const orderParams = this.safeDict(rawOrder, 'params', {});
|
|
3612
3612
|
const extendedParams = this.extend(orderParams, params); // the request does not accept extra params since it's a list, so we're extending each order with the common params
|
|
3613
3613
|
const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, extendedParams);
|
|
@@ -3671,8 +3671,8 @@ class okx extends okx$1["default"] {
|
|
|
3671
3671
|
let takeProfitTriggerPrice = this.safeNumber2(params, 'takeProfitPrice', 'newTpTriggerPx');
|
|
3672
3672
|
let takeProfitPrice = this.safeNumber(params, 'newTpOrdPx');
|
|
3673
3673
|
const takeProfitTriggerPriceType = this.safeString(params, 'newTpTriggerPxType', 'last');
|
|
3674
|
-
const stopLoss = this.
|
|
3675
|
-
const takeProfit = this.
|
|
3674
|
+
const stopLoss = this.safeDict(params, 'stopLoss');
|
|
3675
|
+
const takeProfit = this.safeDict(params, 'takeProfit');
|
|
3676
3676
|
const hasStopLoss = (stopLoss !== undefined);
|
|
3677
3677
|
const hasTakeProfit = (takeProfit !== undefined);
|
|
3678
3678
|
if (isAlgoOrder) {
|
|
@@ -3823,9 +3823,9 @@ class okx extends okx$1["default"] {
|
|
|
3823
3823
|
if (symbol === undefined) {
|
|
3824
3824
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
3825
3825
|
}
|
|
3826
|
-
const trigger = this.
|
|
3826
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3827
3827
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3828
|
-
const isTrigger = (trigger
|
|
3828
|
+
const isTrigger = (trigger === true);
|
|
3829
3829
|
if (isTrigger || (trailing === true)) {
|
|
3830
3830
|
const orderInner = await this.cancelOrders([id], symbol, params);
|
|
3831
3831
|
return this.safeDict(orderInner, 0);
|
|
@@ -3882,7 +3882,6 @@ class okx extends okx$1["default"] {
|
|
|
3882
3882
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
3883
3883
|
*/
|
|
3884
3884
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
3885
|
-
// TODO : the original endpoint signature differs, according to that you can skip individual symbol and assign ids in batch. At this moment, `params` is not being used too.
|
|
3886
3885
|
if (symbol === undefined) {
|
|
3887
3886
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
3888
3887
|
}
|
|
@@ -3896,9 +3895,9 @@ class okx extends okx$1["default"] {
|
|
|
3896
3895
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
3897
3896
|
const clientOrderIds = this.parseIds(this.safeValue2(params, 'clOrdId', 'clientOrderId'));
|
|
3898
3897
|
const algoIds = this.parseIds(this.safeValue(params, 'algoId'));
|
|
3899
|
-
const trigger = this.
|
|
3898
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
3900
3899
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
3901
|
-
const isTrigger = (trigger
|
|
3900
|
+
const isTrigger = (trigger === true);
|
|
3902
3901
|
if (isTrigger || (trailing === true)) {
|
|
3903
3902
|
method = 'privatePostTradeCancelAlgos';
|
|
3904
3903
|
}
|
|
@@ -3913,7 +3912,7 @@ class okx extends okx$1["default"] {
|
|
|
3913
3912
|
}
|
|
3914
3913
|
}
|
|
3915
3914
|
for (let i = 0; i < ids.length; i++) {
|
|
3916
|
-
if ((trailing === true) ||
|
|
3915
|
+
if ((trailing === true) || isTrigger) {
|
|
3917
3916
|
request.push({
|
|
3918
3917
|
'algoId': ids[i],
|
|
3919
3918
|
'instId': market['id'],
|
|
@@ -3929,7 +3928,7 @@ class okx extends okx$1["default"] {
|
|
|
3929
3928
|
}
|
|
3930
3929
|
else {
|
|
3931
3930
|
for (let i = 0; i < clientOrderIds.length; i++) {
|
|
3932
|
-
if ((trailing === true) ||
|
|
3931
|
+
if ((trailing === true) || isTrigger) {
|
|
3933
3932
|
request.push({
|
|
3934
3933
|
'instId': market['id'],
|
|
3935
3934
|
'algoClOrdId': clientOrderIds[i],
|
|
@@ -4443,8 +4442,8 @@ class okx extends okx$1["default"] {
|
|
|
4443
4442
|
const options = this.safeDict(this.options, 'fetchOrder', {});
|
|
4444
4443
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrder');
|
|
4445
4444
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4446
|
-
const trigger = this.
|
|
4447
|
-
const isTrigger = (trigger
|
|
4445
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4446
|
+
const isTrigger = (trigger === true);
|
|
4448
4447
|
if (isTrigger) {
|
|
4449
4448
|
method = 'privateGetTradeOrderAlgo';
|
|
4450
4449
|
if (clientOrderId !== undefined) {
|
|
@@ -4620,16 +4619,16 @@ class okx extends okx$1["default"] {
|
|
|
4620
4619
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersPending');
|
|
4621
4620
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4622
4621
|
const ordType = this.safeString(params, 'ordType');
|
|
4623
|
-
const trigger = this.
|
|
4622
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4624
4623
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4625
|
-
const isTrigger = (trigger
|
|
4624
|
+
const isTrigger = (trigger === true);
|
|
4626
4625
|
if ((trailing === true) || isTrigger || ((ordType !== undefined) && (ordType in algoOrderTypes))) {
|
|
4627
4626
|
method = 'privateGetTradeOrdersAlgoPending';
|
|
4628
4627
|
}
|
|
4629
4628
|
if (trailing === true) {
|
|
4630
4629
|
request['ordType'] = 'move_order_stop';
|
|
4631
4630
|
}
|
|
4632
|
-
else if (
|
|
4631
|
+
else if (isTrigger && (ordType === undefined)) {
|
|
4633
4632
|
request['ordType'] = 'trigger';
|
|
4634
4633
|
}
|
|
4635
4634
|
const query = this.omit(params, ['method', 'stop', 'trigger', 'trailing']);
|
|
@@ -4788,9 +4787,9 @@ class okx extends okx$1["default"] {
|
|
|
4788
4787
|
const defaultMethod = this.safeString(options, 'method', 'privateGetTradeOrdersHistory');
|
|
4789
4788
|
let method = this.safeString(params, 'method', defaultMethod);
|
|
4790
4789
|
const ordType = this.safeString(params, 'ordType');
|
|
4791
|
-
const trigger = this.
|
|
4790
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4792
4791
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4793
|
-
const isTrigger = (trigger
|
|
4792
|
+
const isTrigger = (trigger === true);
|
|
4794
4793
|
if (trailing === true) {
|
|
4795
4794
|
method = 'privateGetTradeOrdersAlgoHistory';
|
|
4796
4795
|
request['ordType'] = 'move_order_stop';
|
|
@@ -613,7 +613,7 @@ class onetrading extends onetrading$1["default"] {
|
|
|
613
613
|
let method = this.safeString(params, 'method');
|
|
614
614
|
params = this.omit(params, 'method');
|
|
615
615
|
if (method === undefined) {
|
|
616
|
-
const options = this.
|
|
616
|
+
const options = this.safeDict(this.options, 'fetchTradingFees', {});
|
|
617
617
|
method = this.safeString(options, 'method', 'fetchPrivateTradingFees');
|
|
618
618
|
}
|
|
619
619
|
if (method === 'fetchPrivateTradingFees') {
|
|
@@ -1022,7 +1022,7 @@ class onetrading extends onetrading$1["default"] {
|
|
|
1022
1022
|
// "last_sequence":461123
|
|
1023
1023
|
// }
|
|
1024
1024
|
//
|
|
1025
|
-
const granularity = this.
|
|
1025
|
+
const granularity = this.safeDict(ohlcv, 'granularity');
|
|
1026
1026
|
const unit = this.safeString(granularity, 'unit');
|
|
1027
1027
|
const period = this.safeString(granularity, 'period');
|
|
1028
1028
|
const units = {
|
|
@@ -1044,7 +1044,7 @@ class onetrading extends onetrading$1["default"] {
|
|
|
1044
1044
|
throw new errors.ExchangeError(this.id + ' parseOHLCV() missing timestamp');
|
|
1045
1045
|
}
|
|
1046
1046
|
const alignedTimestamp = duration * this.parseToInt(timestamp / duration);
|
|
1047
|
-
const options = this.
|
|
1047
|
+
const options = this.safeDict(this.options, 'fetchOHLCV', {});
|
|
1048
1048
|
const volumeField = this.safeString(options, 'volume', 'total_amount');
|
|
1049
1049
|
return [
|
|
1050
1050
|
alignedTimestamp,
|
|
@@ -1148,7 +1148,7 @@ class onetrading extends onetrading$1["default"] {
|
|
|
1148
1148
|
// }
|
|
1149
1149
|
// }
|
|
1150
1150
|
//
|
|
1151
|
-
const feeInfo = this.
|
|
1151
|
+
const feeInfo = this.safeDict(trade, 'fee', {});
|
|
1152
1152
|
trade = this.safeValue(trade, 'trade', trade);
|
|
1153
1153
|
let timestamp = this.safeInteger(trade, 'trade_timestamp');
|
|
1154
1154
|
if (timestamp === undefined) {
|
|
@@ -1333,8 +1333,8 @@ class onetrading extends onetrading$1["default"] {
|
|
|
1333
1333
|
const side = this.safeStringLower(rawOrder, 'side');
|
|
1334
1334
|
const type = this.safeStringLower(rawOrder, 'type');
|
|
1335
1335
|
const timeInForce = this.parseTimeInForce(this.safeString(rawOrder, 'time_in_force'));
|
|
1336
|
-
const postOnly = this.
|
|
1337
|
-
const rawTrades = this.
|
|
1336
|
+
const postOnly = this.safeBool(rawOrder, 'is_post_only');
|
|
1337
|
+
const rawTrades = this.safeList(order, 'trades', []);
|
|
1338
1338
|
return this.safeOrder({
|
|
1339
1339
|
'id': id,
|
|
1340
1340
|
'clientOrderId': clientOrderId,
|
|
@@ -1798,7 +1798,7 @@ class onetrading extends onetrading$1["default"] {
|
|
|
1798
1798
|
// "cursor": "string"
|
|
1799
1799
|
// }
|
|
1800
1800
|
//
|
|
1801
|
-
const tradeHistory = this.
|
|
1801
|
+
const tradeHistory = this.safeList(response, 'trade_history', []);
|
|
1802
1802
|
let market = undefined;
|
|
1803
1803
|
if (symbol !== undefined) {
|
|
1804
1804
|
market = this.market(symbol);
|
package/dist/cjs/src/p2b.js
CHANGED
|
@@ -470,7 +470,7 @@ class p2b extends p2b$1["default"] {
|
|
|
470
470
|
// current_time: '1699252644.487566'
|
|
471
471
|
// }
|
|
472
472
|
//
|
|
473
|
-
const result = this.
|
|
473
|
+
const result = this.safeDict(response, 'result', {});
|
|
474
474
|
return this.parseTickers(result, symbols);
|
|
475
475
|
}
|
|
476
476
|
/**
|
|
@@ -511,7 +511,7 @@ class p2b extends p2b$1["default"] {
|
|
|
511
511
|
// current_time: '1699252958.859391'
|
|
512
512
|
// }
|
|
513
513
|
//
|
|
514
|
-
const result = this.
|
|
514
|
+
const result = this.safeDict(response, 'result', {});
|
|
515
515
|
const timestamp = this.safeIntegerProduct(response, 'cache_time', 1000);
|
|
516
516
|
return this.extend({ 'timestamp': timestamp, 'datetime': this.iso8601(timestamp) }, this.parseTicker(result, market));
|
|
517
517
|
}
|
|
@@ -549,7 +549,7 @@ class p2b extends p2b$1["default"] {
|
|
|
549
549
|
//
|
|
550
550
|
const timestamp = this.safeIntegerProduct(ticker, 'at', 1000);
|
|
551
551
|
if ('ticker' in ticker) {
|
|
552
|
-
ticker = this.
|
|
552
|
+
ticker = this.safeDict(ticker, 'ticker');
|
|
553
553
|
}
|
|
554
554
|
const last = this.safeString(ticker, 'last');
|
|
555
555
|
return this.safeTicker({
|
|
@@ -625,7 +625,7 @@ class p2b extends p2b$1["default"] {
|
|
|
625
625
|
// "current_time": 1698733470.469274
|
|
626
626
|
// }
|
|
627
627
|
//
|
|
628
|
-
const result = this.
|
|
628
|
+
const result = this.safeDict(response, 'result', {});
|
|
629
629
|
const timestamp = this.safeIntegerProduct(response, 'current_time', 1000);
|
|
630
630
|
return this.parseOrderBook(result, market['symbol'], timestamp, 'bids', 'asks', 0, 1);
|
|
631
631
|
}
|
|
@@ -851,7 +851,7 @@ class p2b extends p2b$1["default"] {
|
|
|
851
851
|
// }
|
|
852
852
|
// }
|
|
853
853
|
//
|
|
854
|
-
const result = this.
|
|
854
|
+
const result = this.safeDict(response, 'result', {});
|
|
855
855
|
return this.parseBalance(result);
|
|
856
856
|
}
|
|
857
857
|
parseBalance(response) {
|
|
@@ -1093,7 +1093,7 @@ class p2b extends p2b$1["default"] {
|
|
|
1093
1093
|
// }
|
|
1094
1094
|
// }
|
|
1095
1095
|
//
|
|
1096
|
-
const result = this.
|
|
1096
|
+
const result = this.safeDict(response, 'result', {});
|
|
1097
1097
|
const records = this.safeList(result, 'records', []);
|
|
1098
1098
|
return this.parseTrades(records, market, since, limit);
|
|
1099
1099
|
}
|
|
@@ -1173,7 +1173,7 @@ class p2b extends p2b$1["default"] {
|
|
|
1173
1173
|
// }
|
|
1174
1174
|
// }
|
|
1175
1175
|
//
|
|
1176
|
-
const result = this.
|
|
1176
|
+
const result = this.safeDict(response, 'result', {});
|
|
1177
1177
|
const deals = this.safeList(result, 'deals', []);
|
|
1178
1178
|
return this.parseTrades(deals, market, since, limit);
|
|
1179
1179
|
}
|
|
@@ -1255,7 +1255,7 @@ class p2b extends p2b$1["default"] {
|
|
|
1255
1255
|
// }
|
|
1256
1256
|
// }
|
|
1257
1257
|
//
|
|
1258
|
-
const result = this.
|
|
1258
|
+
const result = this.safeDict(response, 'result', {});
|
|
1259
1259
|
let orders = [];
|
|
1260
1260
|
const keys = Object.keys(result);
|
|
1261
1261
|
for (let i = 0; i < keys.length; i++) {
|
package/dist/cjs/src/pacifica.js
CHANGED
|
@@ -2496,8 +2496,8 @@ class pacifica extends pacifica$1["default"] {
|
|
|
2496
2496
|
// }
|
|
2497
2497
|
//
|
|
2498
2498
|
const data = this.safeList(response, 'data', []);
|
|
2499
|
-
// return last state
|
|
2500
|
-
const sorted = this.sortBy(data, '
|
|
2499
|
+
// return last state, history_id is the per-event sequence, created_at can tie within a millisecond
|
|
2500
|
+
const sorted = this.sortBy(data, 'history_id', true);
|
|
2501
2501
|
const lastIdx = sorted.length;
|
|
2502
2502
|
let lastInfo = {};
|
|
2503
2503
|
if (lastIdx > 0) {
|
|
@@ -2648,6 +2648,12 @@ class pacifica extends pacifica$1["default"] {
|
|
|
2648
2648
|
const totalAmount = this.safeString2(order, 'initial_amount', 'a');
|
|
2649
2649
|
const filledAmount = this.safeString2(order, 'filled_amount', 'f');
|
|
2650
2650
|
const remaining = Precise["default"].stringSub(totalAmount, filledAmount);
|
|
2651
|
+
let average = this.safeString2(order, 'average_filled_price', 'p');
|
|
2652
|
+
const eventType = this.safeString(order, 'event_type');
|
|
2653
|
+
const isFillEvent = this.inArray(eventType, ['fulfill_market', 'fulfill_limit']);
|
|
2654
|
+
if ((average === undefined) && isFillEvent) {
|
|
2655
|
+
average = this.safeString(order, 'price'); // on a matching event price is the fill price
|
|
2656
|
+
}
|
|
2651
2657
|
return this.safeOrder({
|
|
2652
2658
|
'info': order,
|
|
2653
2659
|
'id': this.safeString2(order, 'order_id', 'i'),
|
|
@@ -2666,7 +2672,7 @@ class pacifica extends pacifica$1["default"] {
|
|
|
2666
2672
|
'triggerPrice': this.safeNumber2(order, 'stop_price', 'sp'),
|
|
2667
2673
|
'amount': totalAmount,
|
|
2668
2674
|
'cost': undefined,
|
|
2669
|
-
'average':
|
|
2675
|
+
'average': average,
|
|
2670
2676
|
'filled': filledAmount,
|
|
2671
2677
|
'remaining': remaining,
|
|
2672
2678
|
'status': this.parseOrderStatus(status),
|
package/dist/cjs/src/paymium.js
CHANGED
|
@@ -592,8 +592,8 @@ class paymium extends paymium$1["default"] {
|
|
|
592
592
|
const currencyId = this.safeString(transfer, 'currency');
|
|
593
593
|
const updatedAt = this.safeString(transfer, 'updated_at');
|
|
594
594
|
const timetstamp = this.parseDate(updatedAt);
|
|
595
|
-
const accountOperations = this.
|
|
596
|
-
const firstOperation = this.
|
|
595
|
+
const accountOperations = this.safeList(transfer, 'account_operations');
|
|
596
|
+
const firstOperation = this.safeDict(accountOperations, 0, {});
|
|
597
597
|
const status = this.safeString(transfer, 'state');
|
|
598
598
|
return {
|
|
599
599
|
'info': transfer,
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -1064,7 +1064,7 @@ class phemex extends phemex$1["default"] {
|
|
|
1064
1064
|
//
|
|
1065
1065
|
const v1ProductsPromise = this.v1GetExchangePublicProducts(params);
|
|
1066
1066
|
const [v2Products, v1Products] = await Promise.all([v2ProductsPromise, v1ProductsPromise]);
|
|
1067
|
-
const v1ProductsData = this.
|
|
1067
|
+
const v1ProductsData = this.safeList(v1Products, 'data', []);
|
|
1068
1068
|
//
|
|
1069
1069
|
// {
|
|
1070
1070
|
// "code":0,
|
|
@@ -1157,8 +1157,8 @@ class phemex extends phemex$1["default"] {
|
|
|
1157
1157
|
// ...
|
|
1158
1158
|
// }
|
|
1159
1159
|
// }
|
|
1160
|
-
const data = this.
|
|
1161
|
-
const currencies = this.
|
|
1160
|
+
const data = this.safeDict(response, 'data', {});
|
|
1161
|
+
const currencies = this.safeList(data, 'currencies', []);
|
|
1162
1162
|
return this.parseCurrencies(currencies);
|
|
1163
1163
|
}
|
|
1164
1164
|
parseCurrency(rawCurrency) {
|
|
@@ -1293,8 +1293,8 @@ class phemex extends phemex$1["default"] {
|
|
|
1293
1293
|
// }
|
|
1294
1294
|
// }
|
|
1295
1295
|
//
|
|
1296
|
-
const result = this.
|
|
1297
|
-
const book = this.
|
|
1296
|
+
const result = this.safeDict(response, 'result', {});
|
|
1297
|
+
const book = this.safeDict2(result, 'book', 'orderbook_p', {});
|
|
1298
1298
|
const timestamp = this.safeIntegerProduct(result, 'timestamp', 0.000001);
|
|
1299
1299
|
const orderbook = this.customParseOrderBook(book, symbol, timestamp, 'bids', 'asks', 0, 1, market);
|
|
1300
1300
|
orderbook['nonce'] = this.safeInteger(result, 'sequence');
|
|
@@ -1471,7 +1471,7 @@ class phemex extends phemex$1["default"] {
|
|
|
1471
1471
|
// }
|
|
1472
1472
|
// }
|
|
1473
1473
|
//
|
|
1474
|
-
const data = this.
|
|
1474
|
+
const data = this.safeDict(response, 'data', {});
|
|
1475
1475
|
const rows = this.safeList(data, 'rows', []);
|
|
1476
1476
|
return this.parseOHLCVs(rows, market, timeframe, since, userLimit);
|
|
1477
1477
|
}
|
|
@@ -1657,7 +1657,7 @@ class phemex extends phemex$1["default"] {
|
|
|
1657
1657
|
}
|
|
1658
1658
|
let market = undefined;
|
|
1659
1659
|
if (symbols !== undefined) {
|
|
1660
|
-
const first = this.
|
|
1660
|
+
const first = this.safeString(symbols, 0);
|
|
1661
1661
|
market = this.market(first);
|
|
1662
1662
|
}
|
|
1663
1663
|
let type = undefined;
|
|
@@ -1722,8 +1722,8 @@ class phemex extends phemex$1["default"] {
|
|
|
1722
1722
|
// }
|
|
1723
1723
|
// }
|
|
1724
1724
|
//
|
|
1725
|
-
const result = this.
|
|
1726
|
-
const trades = this.
|
|
1725
|
+
const result = this.safeDict(response, 'result', {});
|
|
1726
|
+
const trades = this.safeList2(result, 'trades', 'trades_p', []);
|
|
1727
1727
|
return this.parseTrades(trades, market, since, limit);
|
|
1728
1728
|
}
|
|
1729
1729
|
parseTrade(trade, market = undefined) {
|
|
@@ -1995,7 +1995,7 @@ class phemex extends phemex$1["default"] {
|
|
|
1995
1995
|
feeCurrencyCode = this.safeCurrencyCode(this.safeString(trade, 'feeCurrency'));
|
|
1996
1996
|
}
|
|
1997
1997
|
else {
|
|
1998
|
-
const info = this.
|
|
1998
|
+
const info = this.safeDict(market, 'info');
|
|
1999
1999
|
if (info !== undefined) {
|
|
2000
2000
|
const settlementCurrencyId = this.safeString(info, 'settlementCurrency');
|
|
2001
2001
|
feeCurrencyCode = this.safeCurrencyCode(settlementCurrencyId);
|
|
@@ -2063,7 +2063,7 @@ class phemex extends phemex$1["default"] {
|
|
|
2063
2063
|
const balance = data[i];
|
|
2064
2064
|
const currencyId = this.safeString(balance, 'currency');
|
|
2065
2065
|
const code = this.safeCurrencyCode(currencyId);
|
|
2066
|
-
const currency = this.
|
|
2066
|
+
const currency = this.safeDict(this.currencies, code, {});
|
|
2067
2067
|
const scale = this.safeInteger(currency, 'valueScale', 8);
|
|
2068
2068
|
const account = this.account();
|
|
2069
2069
|
const balanceEv = this.safeString(balance, 'balanceEv');
|
|
@@ -2115,8 +2115,8 @@ class phemex extends phemex$1["default"] {
|
|
|
2115
2115
|
// }
|
|
2116
2116
|
//
|
|
2117
2117
|
const result = { 'info': response };
|
|
2118
|
-
const data = this.
|
|
2119
|
-
const balance = this.
|
|
2118
|
+
const data = this.safeDict(response, 'data', {});
|
|
2119
|
+
const balance = this.safeDict(data, 'account', {});
|
|
2120
2120
|
const currencyId = this.safeString(balance, 'currency');
|
|
2121
2121
|
const code = this.safeCurrencyCode(currencyId);
|
|
2122
2122
|
const currency = this.currency(code);
|
|
@@ -2720,8 +2720,8 @@ class phemex extends phemex$1["default"] {
|
|
|
2720
2720
|
// 'posSide': Position direction - "Merged" for oneway mode , "Long" / "Short" for hedge mode
|
|
2721
2721
|
};
|
|
2722
2722
|
const clientOrderId = this.safeString2(params, 'clOrdID', 'clientOrderId');
|
|
2723
|
-
const stopLoss = this.
|
|
2724
|
-
const takeProfit = this.
|
|
2723
|
+
const stopLoss = this.safeDict(params, 'stopLoss');
|
|
2724
|
+
const takeProfit = this.safeDict(params, 'takeProfit');
|
|
2725
2725
|
const hasStopLoss = (stopLoss !== undefined);
|
|
2726
2726
|
const hasTakeProfit = (takeProfit !== undefined);
|
|
2727
2727
|
const isStableSettled = (market['settle'] === 'USDT') || (market['settle'] === 'USDC');
|
|
@@ -2746,7 +2746,7 @@ class phemex extends phemex$1["default"] {
|
|
|
2746
2746
|
}
|
|
2747
2747
|
params = this.omit(params, ['stopPx', 'stopPrice', 'stopLoss', 'takeProfit', 'triggerPrice']);
|
|
2748
2748
|
if (market['spot'] === true) {
|
|
2749
|
-
let qtyType = this.
|
|
2749
|
+
let qtyType = this.safeString(params, 'qtyType', 'ByBase');
|
|
2750
2750
|
if ((type === 'Market') || (type === 'Stop') || (type === 'MarketIfTouched')) {
|
|
2751
2751
|
if (price !== undefined) {
|
|
2752
2752
|
qtyType = 'ByQuote';
|
|
@@ -2839,7 +2839,7 @@ class phemex extends phemex$1["default"] {
|
|
|
2839
2839
|
}
|
|
2840
2840
|
if (hasStopLoss || hasTakeProfit) {
|
|
2841
2841
|
if (hasStopLoss) {
|
|
2842
|
-
const stopLossTriggerPrice = this.
|
|
2842
|
+
const stopLossTriggerPrice = this.safeNumber2(stopLoss, 'triggerPrice', 'stopPrice');
|
|
2843
2843
|
if (stopLossTriggerPrice === undefined) {
|
|
2844
2844
|
throw new errors.InvalidOrder(this.id + ' createOrder() requires a trigger price in params["stopLoss"]["triggerPrice"] for a stop loss order');
|
|
2845
2845
|
}
|
|
@@ -2859,7 +2859,7 @@ class phemex extends phemex$1["default"] {
|
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
if (hasTakeProfit) {
|
|
2862
|
-
const takeProfitTriggerPrice = this.
|
|
2862
|
+
const takeProfitTriggerPrice = this.safeNumber2(takeProfit, 'triggerPrice', 'stopPrice');
|
|
2863
2863
|
if (takeProfitTriggerPrice === undefined) {
|
|
2864
2864
|
throw new errors.InvalidOrder(this.id + ' createOrder() requires a trigger price in params["takeProfit"]["triggerPrice"] for a take profit order');
|
|
2865
2865
|
}
|
|
@@ -3143,7 +3143,7 @@ class phemex extends phemex$1["default"] {
|
|
|
3143
3143
|
await this.loadMarkets();
|
|
3144
3144
|
}
|
|
3145
3145
|
const market = this.market(symbol);
|
|
3146
|
-
const trigger = this.
|
|
3146
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger', false);
|
|
3147
3147
|
params = this.omit(params, ['stop', 'trigger']);
|
|
3148
3148
|
const request = {
|
|
3149
3149
|
'symbol': market['id'],
|
|
@@ -3658,7 +3658,7 @@ class phemex extends phemex$1["default"] {
|
|
|
3658
3658
|
// }
|
|
3659
3659
|
// }
|
|
3660
3660
|
//
|
|
3661
|
-
const data = this.
|
|
3661
|
+
const data = this.safeDict(response, 'data', {});
|
|
3662
3662
|
const address = this.safeString(data, 'address');
|
|
3663
3663
|
const tag = this.safeString(data, 'tag');
|
|
3664
3664
|
this.checkAddress(address);
|
|
@@ -3852,7 +3852,7 @@ class phemex extends phemex$1["default"] {
|
|
|
3852
3852
|
const networkId = this.safeString(transaction, 'chainName');
|
|
3853
3853
|
const timestamp = this.safeIntegerN(transaction, ['createdAt', 'submitedAt', 'submittedAt']);
|
|
3854
3854
|
let type = this.safeStringLower(transaction, 'type');
|
|
3855
|
-
let feeCost = this.parseNumber(this.fromEn(this.safeString(transaction, 'feeEv'), this.
|
|
3855
|
+
let feeCost = this.parseNumber(this.fromEn(this.safeString(transaction, 'feeEv'), this.safeInteger(currency, 'valueScale')));
|
|
3856
3856
|
if (feeCost === undefined) {
|
|
3857
3857
|
feeCost = this.safeNumber(transaction, 'feeRv');
|
|
3858
3858
|
}
|
|
@@ -3865,7 +3865,7 @@ class phemex extends phemex$1["default"] {
|
|
|
3865
3865
|
};
|
|
3866
3866
|
}
|
|
3867
3867
|
const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
3868
|
-
let amount = this.parseNumber(this.fromEn(this.safeString(transaction, 'amountEv'), this.
|
|
3868
|
+
let amount = this.parseNumber(this.fromEn(this.safeString(transaction, 'amountEv'), this.safeInteger(currency, 'valueScale')));
|
|
3869
3869
|
if (amount === undefined) {
|
|
3870
3870
|
amount = this.safeNumber(transaction, 'amountRv');
|
|
3871
3871
|
}
|
|
@@ -4029,7 +4029,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4029
4029
|
// }
|
|
4030
4030
|
// }
|
|
4031
4031
|
//
|
|
4032
|
-
const data = this.
|
|
4032
|
+
const data = this.safeDict(response, 'data', {});
|
|
4033
4033
|
const positions = this.safeList(data, 'positions', []);
|
|
4034
4034
|
const result = [];
|
|
4035
4035
|
for (let i = 0; i < positions.length; i++) {
|
|
@@ -4201,7 +4201,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4201
4201
|
const liquidationPrice = this.safeNumber2(position, 'liquidationPrice', 'liquidationPriceRp');
|
|
4202
4202
|
const markPriceString = this.safeString2(position, 'markPrice', 'markPriceRp');
|
|
4203
4203
|
const contracts = this.safeStringN(position, ['size', 'sizeRq', 'closedSizeRq']);
|
|
4204
|
-
const contractSize = this.
|
|
4204
|
+
const contractSize = this.safeNumber(market, 'contractSize');
|
|
4205
4205
|
const contractSizeString = this.numberToString(contractSize);
|
|
4206
4206
|
const leverage = this.parseNumber(Precise["default"].stringAbs((this.safeString2(position, 'leverage', 'leverageRr'))));
|
|
4207
4207
|
const entryPriceString = this.safeStringN(position, ['avgEntryPrice', 'avgEntryPriceRp', 'openPrice']);
|
|
@@ -4237,7 +4237,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4237
4237
|
// the unrealizedPnl is only available in a specific endpoint which much higher RL limits
|
|
4238
4238
|
const apiUnrealizedPnl = this.safeString(position, 'unRealisedPnlRv', unrealizedPnl);
|
|
4239
4239
|
const marginRatio = Precise["default"].stringDiv(maintenanceMarginString, collateral);
|
|
4240
|
-
const isCross = this.
|
|
4240
|
+
const isCross = this.safeBool(position, 'crossMargin');
|
|
4241
4241
|
const timestamp = this.safeInteger(position, 'openedTimeNs');
|
|
4242
4242
|
const lastUpdateTimestamp = this.safeInteger(position, 'updatedTimeNs', this.safeIntegerProduct(position, 'transactTimeNs', 0.000001));
|
|
4243
4243
|
return this.safePosition({
|
|
@@ -4332,7 +4332,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4332
4332
|
// }
|
|
4333
4333
|
// }
|
|
4334
4334
|
//
|
|
4335
|
-
const data = this.
|
|
4335
|
+
const data = this.safeDict(response, 'data', {});
|
|
4336
4336
|
const rows = this.safeList(data, 'rows', []);
|
|
4337
4337
|
const result = [];
|
|
4338
4338
|
for (let i = 0; i < rows.length; i++) {
|
|
@@ -4415,7 +4415,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4415
4415
|
// }
|
|
4416
4416
|
// }
|
|
4417
4417
|
//
|
|
4418
|
-
const result = this.
|
|
4418
|
+
const result = this.safeDict(response, 'result', {});
|
|
4419
4419
|
return this.parseFundingRate(result, market);
|
|
4420
4420
|
}
|
|
4421
4421
|
parseFundingRate(contract, market = undefined) {
|
|
@@ -4530,7 +4530,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4530
4530
|
// }
|
|
4531
4531
|
//
|
|
4532
4532
|
market = this.safeMarket(undefined, market);
|
|
4533
|
-
const inverse = this.
|
|
4533
|
+
const inverse = this.safeBool(market, 'inverse');
|
|
4534
4534
|
const codeCurrency = (inverse === true) ? 'base' : 'quote';
|
|
4535
4535
|
return {
|
|
4536
4536
|
'info': data,
|
|
@@ -4635,7 +4635,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4635
4635
|
await this.loadMarkets();
|
|
4636
4636
|
}
|
|
4637
4637
|
if (symbols !== undefined) {
|
|
4638
|
-
const first = this.
|
|
4638
|
+
const first = this.safeString(symbols, 0);
|
|
4639
4639
|
const market = this.market(first);
|
|
4640
4640
|
if (market['settle'] !== 'USD') {
|
|
4641
4641
|
throw new errors.BadSymbol(this.id + ' fetchLeverageTiers() supports USD settled markets only');
|
|
@@ -4720,7 +4720,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4720
4720
|
// }
|
|
4721
4721
|
//
|
|
4722
4722
|
//
|
|
4723
|
-
const data = this.
|
|
4723
|
+
const data = this.safeDict(response, 'data', {});
|
|
4724
4724
|
const riskLimits = this.safeList(data, 'riskLimits');
|
|
4725
4725
|
return this.parseLeverageTiers(riskLimits, symbols, 'symbol');
|
|
4726
4726
|
}
|
|
@@ -4873,7 +4873,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4873
4873
|
await this.loadMarkets();
|
|
4874
4874
|
}
|
|
4875
4875
|
const currency = this.currency(code);
|
|
4876
|
-
const accountsByType = this.
|
|
4876
|
+
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
4877
4877
|
const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
|
|
4878
4878
|
const toId = this.safeString(accountsByType, toAccount, toAccount);
|
|
4879
4879
|
const scaledAmmount = this.toEv(amount, currency);
|
|
@@ -4906,7 +4906,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4906
4906
|
// }
|
|
4907
4907
|
// }
|
|
4908
4908
|
//
|
|
4909
|
-
const data = this.
|
|
4909
|
+
const data = this.safeDict(response, 'data', {});
|
|
4910
4910
|
transfer = this.parseTransfer(data, currency);
|
|
4911
4911
|
}
|
|
4912
4912
|
else { // sub account transfer
|
|
@@ -4927,7 +4927,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4927
4927
|
//
|
|
4928
4928
|
transfer = this.parseTransfer(response);
|
|
4929
4929
|
}
|
|
4930
|
-
const transferOptions = this.
|
|
4930
|
+
const transferOptions = this.safeDict(this.options, 'transfer', {});
|
|
4931
4931
|
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
4932
4932
|
if (fillResponseFromRequest === true) {
|
|
4933
4933
|
if (transfer['fromAccount'] === undefined) {
|
|
@@ -4994,7 +4994,7 @@ class phemex extends phemex$1["default"] {
|
|
|
4994
4994
|
// }
|
|
4995
4995
|
// }
|
|
4996
4996
|
//
|
|
4997
|
-
const data = this.
|
|
4997
|
+
const data = this.safeDict(response, 'data', {});
|
|
4998
4998
|
const transfers = this.safeList(data, 'rows', []);
|
|
4999
4999
|
return this.parseTransfers(transfers, currency, since, limit);
|
|
5000
5000
|
}
|
|
@@ -5133,7 +5133,7 @@ class phemex extends phemex$1["default"] {
|
|
|
5133
5133
|
// }
|
|
5134
5134
|
// }
|
|
5135
5135
|
//
|
|
5136
|
-
const data = this.
|
|
5136
|
+
const data = this.safeDict(response, 'data', {});
|
|
5137
5137
|
const rates = this.safeValue(data, 'rows');
|
|
5138
5138
|
const result = [];
|
|
5139
5139
|
for (let i = 0; i < rates.length; i++) {
|
|
@@ -5733,7 +5733,7 @@ class phemex extends phemex$1["default"] {
|
|
|
5733
5733
|
// }
|
|
5734
5734
|
//
|
|
5735
5735
|
}
|
|
5736
|
-
const data = this.
|
|
5736
|
+
const data = this.safeDict(response, 'data', {});
|
|
5737
5737
|
const ranks = this.safeList(data, 'positions', []);
|
|
5738
5738
|
const result = [];
|
|
5739
5739
|
for (let i = 0; i < ranks.length; i++) {
|
|
@@ -5880,7 +5880,7 @@ class phemex extends phemex$1["default"] {
|
|
|
5880
5880
|
// {"code":412,"msg":"Missing parameter - to","data":null}
|
|
5881
5881
|
// {"error":{"code":6001,"message":"invalid argument"},"id":null,"result":null}
|
|
5882
5882
|
//
|
|
5883
|
-
const error = this.
|
|
5883
|
+
const error = this.safeDict(response, 'error', response);
|
|
5884
5884
|
const errorCode = this.safeString(error, 'code');
|
|
5885
5885
|
const message = this.safeString(error, 'msg');
|
|
5886
5886
|
if ((errorCode !== undefined) && (errorCode !== '0')) {
|