ccxt 4.5.55 → 4.5.57
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 +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +3 -3
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +72 -76
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2924
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
package/dist/cjs/src/binance.js
CHANGED
|
@@ -1647,7 +1647,7 @@ class binance extends binance$1["default"] {
|
|
|
1647
1647
|
'symbolRequired': true,
|
|
1648
1648
|
},
|
|
1649
1649
|
'fetchOHLCV': {
|
|
1650
|
-
'limit':
|
|
1650
|
+
'limit': 500,
|
|
1651
1651
|
},
|
|
1652
1652
|
},
|
|
1653
1653
|
'swap': {
|
|
@@ -2963,202 +2963,200 @@ class binance extends binance$1["default"] {
|
|
|
2963
2963
|
const responseMarginables = results[1];
|
|
2964
2964
|
marginablesById = this.indexBy(responseMarginables, 'assetName');
|
|
2965
2965
|
}
|
|
2966
|
+
return this.parseCurrenciesCustom(responseCurrencies, marginablesById);
|
|
2967
|
+
}
|
|
2968
|
+
parseCurrenciesCustom(responseCurrencies, marginablesById) {
|
|
2966
2969
|
const result = {};
|
|
2967
2970
|
for (let i = 0; i < responseCurrencies.length; i++) {
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
// "name": "ChainLink",
|
|
2974
|
-
// "free": "0",
|
|
2975
|
-
// "locked": "0",
|
|
2976
|
-
// "freeze": "0",
|
|
2977
|
-
// "withdrawing": "0",
|
|
2978
|
-
// "ipoing": "0",
|
|
2979
|
-
// "ipoable": "0",
|
|
2980
|
-
// "storage": "0",
|
|
2981
|
-
// "isLegalMoney": false,
|
|
2982
|
-
// "trading": true,
|
|
2983
|
-
// "networkList": [
|
|
2984
|
-
// {
|
|
2985
|
-
// "network": "BSC",
|
|
2986
|
-
// "coin": "LINK",
|
|
2987
|
-
// "withdrawIntegerMultiple": "0.00000001",
|
|
2988
|
-
// "isDefault": false,
|
|
2989
|
-
// "depositEnable": true,
|
|
2990
|
-
// "withdrawEnable": true,
|
|
2991
|
-
// "depositDesc": "",
|
|
2992
|
-
// "withdrawDesc": "",
|
|
2993
|
-
// "specialTips": "",
|
|
2994
|
-
// "specialWithdrawTips": "The network you have selected is BSC. Please ensure that the withdrawal address supports the Binance Smart Chain network. You will lose your assets if the chosen platform does not support retrievals.",
|
|
2995
|
-
// "name": "BNB Smart Chain (BEP20)",
|
|
2996
|
-
// "resetAddressStatus": false,
|
|
2997
|
-
// "addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
|
|
2998
|
-
// "addressRule": "",
|
|
2999
|
-
// "memoRegex": "",
|
|
3000
|
-
// "withdrawFee": "0.012",
|
|
3001
|
-
// "withdrawMin": "0.024",
|
|
3002
|
-
// "withdrawMax": "9999999999.99999999",
|
|
3003
|
-
// "minConfirm": "15",
|
|
3004
|
-
// "unLockConfirm": "0",
|
|
3005
|
-
// "sameAddress": false,
|
|
3006
|
-
// "estimatedArrivalTime": "5",
|
|
3007
|
-
// "busy": false,
|
|
3008
|
-
// "country": "AE,BINANCE_BAHRAIN_BSC"
|
|
3009
|
-
// },
|
|
3010
|
-
// {
|
|
3011
|
-
// "network": "BNB",
|
|
3012
|
-
// "coin": "LINK",
|
|
3013
|
-
// "withdrawIntegerMultiple": "0.00000001",
|
|
3014
|
-
// "isDefault": false,
|
|
3015
|
-
// "depositEnable": true,
|
|
3016
|
-
// "withdrawEnable": true,
|
|
3017
|
-
// "depositDesc": "",
|
|
3018
|
-
// "withdrawDesc": "",
|
|
3019
|
-
// "specialTips": "Both a MEMO and an Address are required to successfully deposit your LINK BEP2 tokens to Binance.",
|
|
3020
|
-
// "specialWithdrawTips": "",
|
|
3021
|
-
// "name": "BNB Beacon Chain (BEP2)",
|
|
3022
|
-
// "resetAddressStatus": false,
|
|
3023
|
-
// "addressRegex": "^(bnb1)[0-9a-z]{38}$",
|
|
3024
|
-
// "addressRule": "",
|
|
3025
|
-
// "memoRegex": "^[0-9A-Za-z\\-_]{1,120}$",
|
|
3026
|
-
// "withdrawFee": "0.003",
|
|
3027
|
-
// "withdrawMin": "0.01",
|
|
3028
|
-
// "withdrawMax": "10000000000",
|
|
3029
|
-
// "minConfirm": "1",
|
|
3030
|
-
// "unLockConfirm": "0",
|
|
3031
|
-
// "sameAddress": true,
|
|
3032
|
-
// "estimatedArrivalTime": "5",
|
|
3033
|
-
// "busy": false,
|
|
3034
|
-
// "country": "AE,BINANCE_BAHRAIN_BSC"
|
|
3035
|
-
// },
|
|
3036
|
-
// {
|
|
3037
|
-
// "network": "ETH",
|
|
3038
|
-
// "coin": "LINK",
|
|
3039
|
-
// "withdrawIntegerMultiple": "0.00000001",
|
|
3040
|
-
// "isDefault": true,
|
|
3041
|
-
// "depositEnable": true,
|
|
3042
|
-
// "withdrawEnable": true,
|
|
3043
|
-
// "depositDesc": "",
|
|
3044
|
-
// "withdrawDesc": "",
|
|
3045
|
-
// "name": "Ethereum (ERC20)",
|
|
3046
|
-
// "resetAddressStatus": false,
|
|
3047
|
-
// "addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
|
|
3048
|
-
// "addressRule": "",
|
|
3049
|
-
// "memoRegex": "",
|
|
3050
|
-
// "withdrawFee": "0.55",
|
|
3051
|
-
// "withdrawMin": "1.1",
|
|
3052
|
-
// "withdrawMax": "10000000000",
|
|
3053
|
-
// "minConfirm": "12",
|
|
3054
|
-
// "unLockConfirm": "0",
|
|
3055
|
-
// "sameAddress": false,
|
|
3056
|
-
// "estimatedArrivalTime": "5",
|
|
3057
|
-
// "busy": false,
|
|
3058
|
-
// "country": "AE,BINANCE_BAHRAIN_BSC"
|
|
3059
|
-
// }
|
|
3060
|
-
// ]
|
|
3061
|
-
// }
|
|
3062
|
-
//
|
|
3063
|
-
// some coins (e.g. ETH, BIGTIME, SONIC, etc) return extra fields under network entry
|
|
3064
|
-
//
|
|
3065
|
-
// "specialTips": "",
|
|
3066
|
-
// "specialWithdrawTips": "",
|
|
3067
|
-
// "withdrawInternalMin": "0",
|
|
3068
|
-
// "contractAddressUrl": "https://etherscan.io/address/",
|
|
3069
|
-
// "contractAddress": "0x64bc2ca1be492be7185faa2c8835d9b824c8a194"
|
|
3070
|
-
//
|
|
3071
|
-
const entry = responseCurrencies[i];
|
|
3072
|
-
const id = this.safeString(entry, 'coin');
|
|
3073
|
-
const name = this.safeString(entry, 'name');
|
|
3074
|
-
const code = this.safeCurrencyCode(id);
|
|
3075
|
-
const isFiat = this.safeBool(entry, 'isLegalMoney');
|
|
3076
|
-
const networkList = this.safeList(entry, 'networkList', []);
|
|
3077
|
-
const fees = {};
|
|
3078
|
-
const networks = {};
|
|
3079
|
-
let isETF = false;
|
|
3080
|
-
for (let j = 0; j < networkList.length; j++) {
|
|
3081
|
-
const networkItem = networkList[j];
|
|
3082
|
-
const network = this.safeString(networkItem, 'network');
|
|
3083
|
-
const networkCode = this.networkIdToCode(network, code);
|
|
3084
|
-
isETF = (network === 'ETF'); // ETF currencies (e.g. BTCUP, ETHDOWN) have only 1 "network" entry and are deterministic to set
|
|
3085
|
-
// const name = this.safeString (networkItem, 'name');
|
|
3086
|
-
const withdrawFee = this.safeNumber(networkItem, 'withdrawFee');
|
|
3087
|
-
const depositEnable = this.safeBool(networkItem, 'depositEnable');
|
|
3088
|
-
const withdrawEnable = this.safeBool(networkItem, 'withdrawEnable');
|
|
3089
|
-
fees[network] = withdrawFee;
|
|
3090
|
-
this.safeBool(networkItem, 'isDefault');
|
|
3091
|
-
// todo: default networks in "setMarkets" overload
|
|
3092
|
-
// if (isDefault) {
|
|
3093
|
-
// this.options['defaultNetworkCodesForCurrencies'][code] = networkCode;
|
|
3094
|
-
// }
|
|
3095
|
-
let withdrawPrecision = this.omitZero(this.safeString2(networkItem, 'withdrawIntegerMultiple', 'withdrawInternalMin'));
|
|
3096
|
-
// zero values happen only on fiat or leveraged(ETF) tokens: https://t.me/binance_api_english/393075
|
|
3097
|
-
if (withdrawPrecision === undefined && isFiat) {
|
|
3098
|
-
withdrawPrecision = this.safeString(this.options, 'defaultFiatWithdrawPrecision');
|
|
3099
|
-
}
|
|
3100
|
-
networks[networkCode] = {
|
|
3101
|
-
'info': networkItem,
|
|
3102
|
-
'id': network,
|
|
3103
|
-
'network': networkCode,
|
|
3104
|
-
'active': undefined,
|
|
3105
|
-
'deposit': depositEnable,
|
|
3106
|
-
'withdraw': withdrawEnable,
|
|
3107
|
-
'fee': withdrawFee,
|
|
3108
|
-
'precision': this.parseNumber(withdrawPrecision),
|
|
3109
|
-
'limits': {
|
|
3110
|
-
'withdraw': {
|
|
3111
|
-
'min': this.safeNumber(networkItem, 'withdrawMin'),
|
|
3112
|
-
'max': this.safeNumber(networkItem, 'withdrawMax'),
|
|
3113
|
-
},
|
|
3114
|
-
'deposit': {
|
|
3115
|
-
'min': this.safeNumber(networkItem, 'depositDust'),
|
|
3116
|
-
'max': undefined,
|
|
3117
|
-
},
|
|
3118
|
-
},
|
|
3119
|
-
};
|
|
3120
|
-
}
|
|
3121
|
-
let type = undefined;
|
|
3122
|
-
if (isETF) {
|
|
3123
|
-
type = 'other';
|
|
3124
|
-
}
|
|
3125
|
-
else if (isFiat) {
|
|
3126
|
-
type = 'fiat';
|
|
3127
|
-
}
|
|
3128
|
-
else {
|
|
3129
|
-
type = 'crypto';
|
|
3130
|
-
}
|
|
3131
|
-
const trading = this.safeBool(entry, 'trading');
|
|
3132
|
-
const marginEntry = this.safeDict(marginablesById, id, {});
|
|
3133
|
-
//
|
|
3134
|
-
// {
|
|
3135
|
-
// assetName: "BTC",
|
|
3136
|
-
// assetFullName: "Bitcoin",
|
|
3137
|
-
// isBorrowable: true,
|
|
3138
|
-
// isMortgageable: true,
|
|
3139
|
-
// userMinBorrow: "0",
|
|
3140
|
-
// userMinRepay: "0",
|
|
3141
|
-
// }
|
|
3142
|
-
//
|
|
3143
|
-
result[code] = this.safeCurrencyStructure({
|
|
3144
|
-
'id': id,
|
|
3145
|
-
'name': name,
|
|
3146
|
-
'code': code,
|
|
3147
|
-
'type': type,
|
|
3148
|
-
'precision': undefined,
|
|
3149
|
-
'info': entry,
|
|
3150
|
-
'active': trading,
|
|
3151
|
-
'deposit': undefined,
|
|
3152
|
-
'withdraw': undefined,
|
|
3153
|
-
'networks': networks,
|
|
3154
|
-
'fee': undefined,
|
|
3155
|
-
'fees': fees,
|
|
3156
|
-
'limits': undefined,
|
|
3157
|
-
'margin': this.safeBool(marginEntry, 'isBorrowable'),
|
|
3158
|
-
});
|
|
2971
|
+
const parsed = this.parseCurrency(responseCurrencies[i]);
|
|
2972
|
+
const code = parsed['code'];
|
|
2973
|
+
const marginEntry = this.safeDict(marginablesById, parsed['id']);
|
|
2974
|
+
parsed['margin'] = this.safeBool(marginEntry, 'isBorrowable');
|
|
2975
|
+
result[code] = parsed;
|
|
3159
2976
|
}
|
|
3160
2977
|
return result;
|
|
3161
2978
|
}
|
|
2979
|
+
parseCurrency(rawCurrency) {
|
|
2980
|
+
//
|
|
2981
|
+
// {
|
|
2982
|
+
// "coin": "LINK",
|
|
2983
|
+
// "depositAllEnable": true,
|
|
2984
|
+
// "withdrawAllEnable": true,
|
|
2985
|
+
// "name": "ChainLink",
|
|
2986
|
+
// "free": "0",
|
|
2987
|
+
// "locked": "0",
|
|
2988
|
+
// "freeze": "0",
|
|
2989
|
+
// "withdrawing": "0",
|
|
2990
|
+
// "ipoing": "0",
|
|
2991
|
+
// "ipoable": "0",
|
|
2992
|
+
// "storage": "0",
|
|
2993
|
+
// "isLegalMoney": false,
|
|
2994
|
+
// "trading": true,
|
|
2995
|
+
// "networkList": [
|
|
2996
|
+
// {
|
|
2997
|
+
// "network": "BSC",
|
|
2998
|
+
// "coin": "LINK",
|
|
2999
|
+
// "withdrawIntegerMultiple": "0.00000001",
|
|
3000
|
+
// "isDefault": false,
|
|
3001
|
+
// "depositEnable": true,
|
|
3002
|
+
// "withdrawEnable": true,
|
|
3003
|
+
// "depositDesc": "",
|
|
3004
|
+
// "withdrawDesc": "",
|
|
3005
|
+
// "specialTips": "",
|
|
3006
|
+
// "specialWithdrawTips": "The network you have selected is BSC. Please ensure that the withdrawal address supports the Binance Smart Chain network. You will lose your assets if the chosen platform does not support retrievals.",
|
|
3007
|
+
// "name": "BNB Smart Chain (BEP20)",
|
|
3008
|
+
// "resetAddressStatus": false,
|
|
3009
|
+
// "addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
|
|
3010
|
+
// "addressRule": "",
|
|
3011
|
+
// "memoRegex": "",
|
|
3012
|
+
// "withdrawFee": "0.012",
|
|
3013
|
+
// "withdrawMin": "0.024",
|
|
3014
|
+
// "withdrawMax": "9999999999.99999999",
|
|
3015
|
+
// "minConfirm": "15",
|
|
3016
|
+
// "unLockConfirm": "0",
|
|
3017
|
+
// "sameAddress": false,
|
|
3018
|
+
// "estimatedArrivalTime": "5",
|
|
3019
|
+
// "busy": false,
|
|
3020
|
+
// "country": "AE,BINANCE_BAHRAIN_BSC"
|
|
3021
|
+
// },
|
|
3022
|
+
// {
|
|
3023
|
+
// "network": "BNB",
|
|
3024
|
+
// "coin": "LINK",
|
|
3025
|
+
// "withdrawIntegerMultiple": "0.00000001",
|
|
3026
|
+
// "isDefault": false,
|
|
3027
|
+
// "depositEnable": true,
|
|
3028
|
+
// "withdrawEnable": true,
|
|
3029
|
+
// "depositDesc": "",
|
|
3030
|
+
// "withdrawDesc": "",
|
|
3031
|
+
// "specialTips": "Both a MEMO and an Address are required to successfully deposit your LINK BEP2 tokens to Binance.",
|
|
3032
|
+
// "specialWithdrawTips": "",
|
|
3033
|
+
// "name": "BNB Beacon Chain (BEP2)",
|
|
3034
|
+
// "resetAddressStatus": false,
|
|
3035
|
+
// "addressRegex": "^(bnb1)[0-9a-z]{38}$",
|
|
3036
|
+
// "addressRule": "",
|
|
3037
|
+
// "memoRegex": "^[0-9A-Za-z\\-_]{1,120}$",
|
|
3038
|
+
// "withdrawFee": "0.003",
|
|
3039
|
+
// "withdrawMin": "0.01",
|
|
3040
|
+
// "withdrawMax": "10000000000",
|
|
3041
|
+
// "minConfirm": "1",
|
|
3042
|
+
// "unLockConfirm": "0",
|
|
3043
|
+
// "sameAddress": true,
|
|
3044
|
+
// "estimatedArrivalTime": "5",
|
|
3045
|
+
// "busy": false,
|
|
3046
|
+
// "country": "AE,BINANCE_BAHRAIN_BSC"
|
|
3047
|
+
// },
|
|
3048
|
+
// {
|
|
3049
|
+
// "network": "ETH",
|
|
3050
|
+
// "coin": "LINK",
|
|
3051
|
+
// "withdrawIntegerMultiple": "0.00000001",
|
|
3052
|
+
// "isDefault": true,
|
|
3053
|
+
// "depositEnable": true,
|
|
3054
|
+
// "withdrawEnable": true,
|
|
3055
|
+
// "depositDesc": "",
|
|
3056
|
+
// "withdrawDesc": "",
|
|
3057
|
+
// "name": "Ethereum (ERC20)",
|
|
3058
|
+
// "resetAddressStatus": false,
|
|
3059
|
+
// "addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
|
|
3060
|
+
// "addressRule": "",
|
|
3061
|
+
// "memoRegex": "",
|
|
3062
|
+
// "withdrawFee": "0.55",
|
|
3063
|
+
// "withdrawMin": "1.1",
|
|
3064
|
+
// "withdrawMax": "10000000000",
|
|
3065
|
+
// "minConfirm": "12",
|
|
3066
|
+
// "unLockConfirm": "0",
|
|
3067
|
+
// "sameAddress": false,
|
|
3068
|
+
// "estimatedArrivalTime": "5",
|
|
3069
|
+
// "busy": false,
|
|
3070
|
+
// "country": "AE,BINANCE_BAHRAIN_BSC"
|
|
3071
|
+
// }
|
|
3072
|
+
// ]
|
|
3073
|
+
// }
|
|
3074
|
+
//
|
|
3075
|
+
// some coins (e.g. ETH, BIGTIME, SONIC, etc) return extra fields under network entry
|
|
3076
|
+
//
|
|
3077
|
+
// "specialTips": "",
|
|
3078
|
+
// "specialWithdrawTips": "",
|
|
3079
|
+
// "withdrawInternalMin": "0",
|
|
3080
|
+
// "contractAddressUrl": "https://etherscan.io/address/",
|
|
3081
|
+
// "contractAddress": "0x64bc2ca1be492be7185faa2c8835d9b824c8a194"
|
|
3082
|
+
//
|
|
3083
|
+
const entry = rawCurrency;
|
|
3084
|
+
const id = this.safeString(entry, 'coin');
|
|
3085
|
+
const name = this.safeString(entry, 'name');
|
|
3086
|
+
const code = this.safeCurrencyCode(id);
|
|
3087
|
+
const isFiat = this.safeBool(entry, 'isLegalMoney');
|
|
3088
|
+
const networkList = this.safeList(entry, 'networkList', []);
|
|
3089
|
+
const fees = {};
|
|
3090
|
+
const networks = {};
|
|
3091
|
+
let isETF = false;
|
|
3092
|
+
for (let j = 0; j < networkList.length; j++) {
|
|
3093
|
+
const networkItem = networkList[j];
|
|
3094
|
+
const network = this.safeString(networkItem, 'network');
|
|
3095
|
+
const networkCode = this.networkIdToCode(network, code);
|
|
3096
|
+
isETF = (network === 'ETF'); // ETF currencies (e.g. BTCUP, ETHDOWN) have only 1 "network" entry and are deterministic to set
|
|
3097
|
+
// const name = this.safeString (networkItem, 'name');
|
|
3098
|
+
const withdrawFee = this.safeNumber(networkItem, 'withdrawFee');
|
|
3099
|
+
const depositEnable = this.safeBool(networkItem, 'depositEnable');
|
|
3100
|
+
const withdrawEnable = this.safeBool(networkItem, 'withdrawEnable');
|
|
3101
|
+
fees[network] = withdrawFee;
|
|
3102
|
+
this.safeBool(networkItem, 'isDefault');
|
|
3103
|
+
// todo: default networks in "setMarkets" overload
|
|
3104
|
+
// if (isDefault) {
|
|
3105
|
+
// this.options['defaultNetworkCodesForCurrencies'][code] = networkCode;
|
|
3106
|
+
// }
|
|
3107
|
+
let withdrawPrecision = this.omitZero(this.safeString2(networkItem, 'withdrawIntegerMultiple', 'withdrawInternalMin'));
|
|
3108
|
+
// zero values happen only on fiat or leveraged(ETF) tokens: https://t.me/binance_api_english/393075
|
|
3109
|
+
if (withdrawPrecision === undefined && isFiat) {
|
|
3110
|
+
withdrawPrecision = this.safeString(this.options, 'defaultFiatWithdrawPrecision');
|
|
3111
|
+
}
|
|
3112
|
+
networks[networkCode] = {
|
|
3113
|
+
'info': networkItem,
|
|
3114
|
+
'id': network,
|
|
3115
|
+
'network': networkCode,
|
|
3116
|
+
'active': undefined,
|
|
3117
|
+
'deposit': depositEnable,
|
|
3118
|
+
'withdraw': withdrawEnable,
|
|
3119
|
+
'fee': withdrawFee,
|
|
3120
|
+
'precision': this.parseNumber(withdrawPrecision),
|
|
3121
|
+
'limits': {
|
|
3122
|
+
'withdraw': {
|
|
3123
|
+
'min': this.safeNumber(networkItem, 'withdrawMin'),
|
|
3124
|
+
'max': this.safeNumber(networkItem, 'withdrawMax'),
|
|
3125
|
+
},
|
|
3126
|
+
'deposit': {
|
|
3127
|
+
'min': this.safeNumber(networkItem, 'depositDust'),
|
|
3128
|
+
'max': undefined,
|
|
3129
|
+
},
|
|
3130
|
+
},
|
|
3131
|
+
};
|
|
3132
|
+
}
|
|
3133
|
+
let type = undefined;
|
|
3134
|
+
if (isETF) {
|
|
3135
|
+
type = 'other';
|
|
3136
|
+
}
|
|
3137
|
+
else if (isFiat) {
|
|
3138
|
+
type = 'fiat';
|
|
3139
|
+
}
|
|
3140
|
+
else {
|
|
3141
|
+
type = 'crypto';
|
|
3142
|
+
}
|
|
3143
|
+
const trading = this.safeBool(entry, 'trading');
|
|
3144
|
+
return this.safeCurrencyStructure({
|
|
3145
|
+
'id': id,
|
|
3146
|
+
'name': name,
|
|
3147
|
+
'code': code,
|
|
3148
|
+
'type': type,
|
|
3149
|
+
'precision': undefined,
|
|
3150
|
+
'info': entry,
|
|
3151
|
+
'active': trading,
|
|
3152
|
+
'deposit': undefined,
|
|
3153
|
+
'withdraw': undefined,
|
|
3154
|
+
'networks': networks,
|
|
3155
|
+
'fee': undefined,
|
|
3156
|
+
'fees': fees,
|
|
3157
|
+
'limits': undefined,
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3162
3160
|
/**
|
|
3163
3161
|
* @method
|
|
3164
3162
|
* @name binance#fetchMarkets
|
|
@@ -4157,7 +4155,7 @@ class binance extends binance$1["default"] {
|
|
|
4157
4155
|
//
|
|
4158
4156
|
// {
|
|
4159
4157
|
// "symbol": "BTCUSDT",
|
|
4160
|
-
// "markPrice": "11793.
|
|
4158
|
+
// "markPrice": "11793.63104563", // mark price
|
|
4161
4159
|
// "indexPrice": "11781.80495970", // index price
|
|
4162
4160
|
// "estimatedSettlePrice": "11781.16138815", // Estimated Settle Price, only useful in the last hour before the settlement starts
|
|
4163
4161
|
// "lastFundingRate": "0.00038246", // This is the lastest estimated funding rate
|
|
@@ -6591,9 +6589,10 @@ class binance extends binance$1["default"] {
|
|
|
6591
6589
|
const initialUppercaseType = type.toUpperCase();
|
|
6592
6590
|
const isMarketOrder = initialUppercaseType === 'MARKET';
|
|
6593
6591
|
const isLimitOrder = initialUppercaseType === 'LIMIT';
|
|
6592
|
+
const upperCaseSide = side.toUpperCase();
|
|
6594
6593
|
const request = {
|
|
6595
6594
|
'symbol': market['id'],
|
|
6596
|
-
'side':
|
|
6595
|
+
'side': upperCaseSide,
|
|
6597
6596
|
};
|
|
6598
6597
|
let isPortfolioMargin = undefined;
|
|
6599
6598
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'createOrder', 'papi', 'portfolioMargin', false);
|
|
@@ -8091,10 +8090,9 @@ class binance extends binance$1["default"] {
|
|
|
8091
8090
|
return this.parseOrders(response, market);
|
|
8092
8091
|
}
|
|
8093
8092
|
else {
|
|
8093
|
+
const order = this.safeOrder({ 'info': response });
|
|
8094
8094
|
return [
|
|
8095
|
-
|
|
8096
|
-
'info': response,
|
|
8097
|
-
}),
|
|
8095
|
+
order,
|
|
8098
8096
|
];
|
|
8099
8097
|
}
|
|
8100
8098
|
}
|
|
@@ -10523,7 +10521,7 @@ class binance extends binance$1["default"] {
|
|
|
10523
10521
|
const rounderString = rounder.toString();
|
|
10524
10522
|
const liquidationPriceRoundedString = Precise["default"].stringAdd(rounderString, liquidationPriceStringRaw);
|
|
10525
10523
|
let truncatedLiquidationPrice = Precise["default"].stringDiv(liquidationPriceRoundedString, '1', pricePrecision);
|
|
10526
|
-
if (truncatedLiquidationPrice[0] === '-') {
|
|
10524
|
+
if (truncatedLiquidationPrice !== undefined && truncatedLiquidationPrice[0] === '-') {
|
|
10527
10525
|
// user cannot be liquidated
|
|
10528
10526
|
// since he has more collateral than the size of the position
|
|
10529
10527
|
truncatedLiquidationPrice = undefined;
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -880,7 +880,7 @@ class bingx extends bingx$1["default"] {
|
|
|
880
880
|
for (let j = 0; j < networkList.length; j++) {
|
|
881
881
|
const rawNetwork = networkList[j];
|
|
882
882
|
const network = this.safeString(rawNetwork, 'network');
|
|
883
|
-
const networkCode = this.networkIdToCode(network);
|
|
883
|
+
const networkCode = this.networkIdToCode(network, code);
|
|
884
884
|
const limits = {
|
|
885
885
|
'withdraw': {
|
|
886
886
|
'min': this.safeNumber(rawNetwork, 'withdrawMin'),
|
|
@@ -1704,10 +1704,10 @@ class bingx extends bingx$1["default"] {
|
|
|
1704
1704
|
[subType, params] = this.handleSubTypeAndParams('fetchFundingRates', firstMarket, params, subType);
|
|
1705
1705
|
let response = undefined;
|
|
1706
1706
|
if (subType === 'inverse') {
|
|
1707
|
-
response = await this.cswapV1PublicGetMarketPremiumIndex(
|
|
1707
|
+
response = await this.cswapV1PublicGetMarketPremiumIndex(params);
|
|
1708
1708
|
}
|
|
1709
1709
|
else {
|
|
1710
|
-
response = await this.swapV2PublicGetQuotePremiumIndex(
|
|
1710
|
+
response = await this.swapV2PublicGetQuotePremiumIndex(params);
|
|
1711
1711
|
}
|
|
1712
1712
|
const data = this.safeList(response, 'data', []);
|
|
1713
1713
|
return this.parseFundingRates(data, symbols);
|
|
@@ -5254,7 +5254,7 @@ class bingx extends bingx$1["default"] {
|
|
|
5254
5254
|
await this.loadMarkets();
|
|
5255
5255
|
const currency = this.currency(code);
|
|
5256
5256
|
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
5257
|
-
const recvWindow = this.safeInteger(
|
|
5257
|
+
const recvWindow = this.safeInteger(params, 'recvWindow', defaultRecvWindow);
|
|
5258
5258
|
const request = {
|
|
5259
5259
|
'coin': currency['id'],
|
|
5260
5260
|
'offset': 0,
|
|
@@ -5507,7 +5507,7 @@ class bingx extends bingx$1["default"] {
|
|
|
5507
5507
|
'txid': this.safeString(transaction, 'txId'),
|
|
5508
5508
|
'type': type,
|
|
5509
5509
|
'currency': code,
|
|
5510
|
-
'network': this.networkIdToCode(network),
|
|
5510
|
+
'network': this.networkIdToCode(network, code),
|
|
5511
5511
|
'amount': this.safeNumber(transaction, 'amount'),
|
|
5512
5512
|
'status': this.parseTransactionStatus(this.safeString(transaction, 'status')),
|
|
5513
5513
|
'timestamp': timestamp,
|
|
@@ -6058,7 +6058,7 @@ class bingx extends bingx$1["default"] {
|
|
|
6058
6058
|
};
|
|
6059
6059
|
const network = this.safeStringUpper(params, 'network');
|
|
6060
6060
|
if (network !== undefined) {
|
|
6061
|
-
request['network'] = this.networkCodeToId(network);
|
|
6061
|
+
request['network'] = this.networkCodeToId(network, currency['code']);
|
|
6062
6062
|
}
|
|
6063
6063
|
if (tag !== undefined) {
|
|
6064
6064
|
request['addressTag'] = tag;
|
|
@@ -6325,7 +6325,7 @@ class bingx extends bingx$1["default"] {
|
|
|
6325
6325
|
async closeAllPositions(params = {}) {
|
|
6326
6326
|
await this.loadMarkets();
|
|
6327
6327
|
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
6328
|
-
const recvWindow = this.safeInteger(
|
|
6328
|
+
const recvWindow = this.safeInteger(params, 'recvWindow', defaultRecvWindow);
|
|
6329
6329
|
let marketType = undefined;
|
|
6330
6330
|
[marketType, params] = this.handleMarketTypeAndParams('closeAllPositions', undefined, params);
|
|
6331
6331
|
let subType = undefined;
|