ccxt-ir 4.3.46.0.3__py2.py3-none-any.whl → 4.5.1__py2.py3-none-any.whl
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.
- ccxt/__init__.py +39 -35
- ccxt/abantether.py +8 -8
- ccxt/abstract/alpaca.py +4 -0
- ccxt/abstract/apex.py +31 -0
- ccxt/abstract/bigone.py +1 -1
- ccxt/abstract/binance.py +106 -48
- ccxt/abstract/binancecoinm.py +106 -48
- ccxt/abstract/binanceus.py +141 -83
- ccxt/abstract/binanceusdm.py +106 -48
- ccxt/abstract/bingx.py +50 -1
- ccxt/abstract/bitbank.py +5 -0
- ccxt/abstract/bitfinex.py +136 -65
- ccxt/abstract/bitflyer.py +1 -0
- ccxt/abstract/bitget.py +67 -0
- ccxt/abstract/bitmart.py +19 -1
- ccxt/abstract/bitopro.py +1 -0
- ccxt/abstract/bitrue.py +68 -68
- ccxt/abstract/bitstamp.py +1 -0
- ccxt/abstract/blofin.py +30 -0
- ccxt/abstract/btcbox.py +2 -0
- ccxt/abstract/bybit.py +28 -13
- ccxt/abstract/cex.py +28 -29
- ccxt/abstract/coinbaseexchange.py +1 -0
- ccxt/abstract/coinbaseinternational.py +1 -1
- ccxt/abstract/cryptocom.py +16 -0
- ccxt/abstract/cryptomus.py +20 -0
- ccxt/abstract/defx.py +69 -0
- ccxt/abstract/deribit.py +1 -0
- ccxt/abstract/derive.py +117 -0
- ccxt/abstract/digifinex.py +1 -0
- ccxt/abstract/ellipx.py +25 -0
- ccxt/abstract/foxbit.py +26 -0
- ccxt/abstract/gate.py +19 -0
- ccxt/abstract/gateio.py +19 -0
- ccxt/abstract/gemini.py +1 -0
- ccxt/abstract/hibachi.py +26 -0
- ccxt/abstract/hyperliquid.py +1 -1
- ccxt/abstract/independentreserve.py +6 -0
- ccxt/abstract/kraken.py +1 -0
- ccxt/abstract/krakenfutures.py +4 -0
- ccxt/abstract/kucoin.py +10 -0
- ccxt/abstract/kucoinfutures.py +18 -0
- ccxt/abstract/lbank.py +2 -1
- ccxt/abstract/luno.py +1 -0
- ccxt/abstract/mexc.py +2 -0
- ccxt/abstract/modetrade.py +119 -0
- ccxt/abstract/myokx.py +349 -0
- ccxt/abstract/oceanex.py +5 -0
- ccxt/abstract/okx.py +25 -0
- ccxt/abstract/okxus.py +349 -0
- ccxt/abstract/onetrading.py +0 -12
- ccxt/abstract/paradex.py +23 -0
- ccxt/abstract/phemex.py +2 -0
- ccxt/abstract/poloniex.py +36 -0
- ccxt/abstract/tradeogre.py +3 -1
- ccxt/abstract/upbit.py +51 -34
- ccxt/abstract/whitebit.py +16 -0
- ccxt/abstract/woo.py +64 -6
- ccxt/abstract/xt.py +10 -5
- ccxt/afratether.py +8 -8
- ccxt/alpaca.py +828 -51
- ccxt/apex.py +1875 -0
- ccxt/arzinja.py +7 -7
- ccxt/arzplus.py +9 -9
- ccxt/ascendex.py +501 -306
- ccxt/async_support/__init__.py +39 -35
- ccxt/async_support/abantether.py +8 -8
- ccxt/async_support/afratether.py +10 -10
- ccxt/async_support/alpaca.py +828 -51
- ccxt/async_support/apex.py +1875 -0
- ccxt/async_support/arzinja.py +10 -10
- ccxt/async_support/arzplus.py +12 -12
- ccxt/async_support/ascendex.py +502 -306
- ccxt/async_support/base/exchange.py +303 -89
- ccxt/async_support/base/ws/cache.py +9 -3
- ccxt/async_support/base/ws/client.py +173 -38
- ccxt/async_support/base/ws/future.py +25 -37
- ccxt/async_support/bequant.py +5 -3
- ccxt/async_support/bigone.py +279 -144
- ccxt/async_support/binance.py +2347 -1158
- ccxt/async_support/binancecoinm.py +9 -3
- ccxt/async_support/binanceus.py +17 -3
- ccxt/async_support/binanceusdm.py +9 -4
- ccxt/async_support/bingx.py +2962 -920
- ccxt/async_support/bit2c.py +147 -27
- ccxt/async_support/bitbank.py +151 -23
- ccxt/async_support/bitbns.py +104 -30
- ccxt/async_support/bitfinex.py +3291 -1113
- ccxt/async_support/bitflyer.py +202 -27
- ccxt/async_support/bitget.py +3683 -1538
- ccxt/async_support/bithumb.py +195 -38
- ccxt/async_support/bitimen.py +12 -12
- ccxt/async_support/bitir.py +38 -38
- ccxt/async_support/bitmart.py +1288 -350
- ccxt/async_support/bitmex.py +260 -75
- ccxt/async_support/bitopro.py +262 -62
- ccxt/async_support/bitpin.py +17 -16
- ccxt/async_support/bitrue.py +459 -290
- ccxt/async_support/bitso.py +199 -54
- ccxt/async_support/bitstamp.py +230 -96
- ccxt/async_support/bitteam.py +167 -25
- ccxt/async_support/{huobijp.py → bittrade.py} +158 -30
- ccxt/async_support/bitvavo.py +213 -49
- ccxt/async_support/blockchaincom.py +160 -46
- ccxt/async_support/blofin.py +502 -120
- ccxt/async_support/btcalpha.py +169 -31
- ccxt/async_support/btcbox.py +292 -23
- ccxt/async_support/btcmarkets.py +211 -58
- ccxt/async_support/btcturk.py +161 -38
- ccxt/async_support/bybit.py +1775 -1030
- ccxt/async_support/cex.py +1440 -1303
- ccxt/async_support/coinbase.py +724 -212
- ccxt/async_support/coinbaseadvanced.py +2 -1
- ccxt/async_support/coinbaseexchange.py +388 -89
- ccxt/async_support/coinbaseinternational.py +412 -57
- ccxt/async_support/coincatch.py +177 -78
- ccxt/async_support/coincheck.py +135 -19
- ccxt/async_support/coinex.py +606 -232
- ccxt/async_support/coinmate.py +189 -63
- ccxt/async_support/coinmetro.py +195 -54
- ccxt/async_support/coinone.py +158 -51
- ccxt/async_support/coinsph.py +336 -61
- ccxt/async_support/coinspot.py +151 -52
- ccxt/async_support/cryptocom.py +661 -111
- ccxt/async_support/cryptomus.py +1137 -0
- ccxt/async_support/defx.py +2071 -0
- ccxt/async_support/delta.py +299 -99
- ccxt/async_support/deribit.py +348 -126
- ccxt/async_support/derive.py +2572 -0
- ccxt/async_support/digifinex.py +430 -214
- ccxt/async_support/ellipx.py +2029 -0
- ccxt/async_support/eterex.py +10 -10
- ccxt/async_support/excoino.py +31 -31
- ccxt/async_support/exir.py +14 -14
- ccxt/async_support/exmo.py +344 -131
- ccxt/async_support/exnovin.py +10 -10
- ccxt/async_support/farhadexchange.py +12 -12
- ccxt/async_support/fmfwio.py +2 -1
- ccxt/async_support/foxbit.py +1935 -0
- ccxt/async_support/gate.py +1351 -529
- ccxt/async_support/gateio.py +2 -1
- ccxt/async_support/gemini.py +144 -39
- ccxt/async_support/hashkey.py +152 -109
- ccxt/async_support/hibachi.py +2080 -0
- ccxt/async_support/hitbtc.py +395 -167
- ccxt/async_support/hitobit.py +12 -12
- ccxt/async_support/hollaex.py +307 -119
- ccxt/async_support/htx.py +851 -383
- ccxt/async_support/huobi.py +2 -1
- ccxt/async_support/hyperliquid.py +1848 -536
- ccxt/async_support/independentreserve.py +288 -15
- ccxt/async_support/indodax.py +190 -33
- ccxt/async_support/jibitex.py +12 -12
- ccxt/async_support/kraken.py +795 -351
- ccxt/async_support/krakenfutures.py +214 -62
- ccxt/async_support/kucoin.py +715 -396
- ccxt/async_support/kucoinfutures.py +652 -89
- ccxt/async_support/latoken.py +217 -113
- ccxt/async_support/lbank.py +425 -97
- ccxt/async_support/luno.py +382 -35
- ccxt/async_support/mercado.py +113 -6
- ccxt/async_support/mexc.py +874 -437
- ccxt/async_support/modetrade.py +2818 -0
- ccxt/async_support/myokx.py +54 -0
- ccxt/async_support/ndax.py +221 -64
- ccxt/async_support/nobitex.py +32 -38
- ccxt/async_support/novadax.py +190 -34
- ccxt/async_support/oceanex.py +217 -28
- ccxt/async_support/okcoin.py +253 -145
- ccxt/async_support/okexchange.py +11 -11
- ccxt/async_support/okx.py +1088 -351
- ccxt/async_support/okxus.py +54 -0
- ccxt/async_support/ompfinex.py +32 -27
- ccxt/async_support/onetrading.py +213 -392
- ccxt/async_support/oxfun.py +245 -166
- ccxt/async_support/p2b.py +151 -29
- ccxt/async_support/paradex.py +562 -49
- ccxt/async_support/paymium.py +82 -19
- ccxt/async_support/phemex.py +713 -172
- ccxt/async_support/poloniex.py +1602 -283
- ccxt/async_support/probit.py +224 -95
- ccxt/async_support/ramzinex.py +34 -30
- ccxt/async_support/sarmayex.py +9 -9
- ccxt/async_support/sarrafex.py +13 -13
- ccxt/async_support/tabdeal.py +15 -14
- ccxt/async_support/tetherland.py +9 -9
- ccxt/async_support/timex.py +210 -51
- ccxt/async_support/tokocrypto.py +167 -47
- ccxt/async_support/tradeogre.py +266 -31
- ccxt/async_support/twox.py +9 -9
- ccxt/async_support/ubitex.py +12 -12
- ccxt/async_support/upbit.py +568 -165
- ccxt/async_support/vertex.py +160 -32
- ccxt/async_support/wallex.py +12 -12
- ccxt/async_support/wavesexchange.py +165 -30
- ccxt/async_support/whitebit.py +975 -127
- ccxt/async_support/woo.py +1918 -1016
- ccxt/async_support/woofipro.py +433 -141
- ccxt/async_support/xt.py +649 -193
- ccxt/async_support/yobit.py +195 -70
- ccxt/async_support/zaif.py +91 -15
- ccxt/async_support/zonda.py +151 -36
- ccxt/base/decimal_to_precision.py +14 -10
- ccxt/base/errors.py +49 -18
- ccxt/base/exchange.py +1556 -450
- ccxt/base/precise.py +10 -0
- ccxt/base/types.py +114 -6
- ccxt/bequant.py +5 -3
- ccxt/bigone.py +279 -144
- ccxt/binance.py +2347 -1158
- ccxt/binancecoinm.py +9 -3
- ccxt/binanceus.py +17 -3
- ccxt/binanceusdm.py +9 -4
- ccxt/bingx.py +2962 -920
- ccxt/bit2c.py +147 -27
- ccxt/bitbank.py +151 -23
- ccxt/bitbns.py +104 -30
- ccxt/bitfinex.py +3290 -1113
- ccxt/bitflyer.py +202 -27
- ccxt/bitget.py +3683 -1538
- ccxt/bithumb.py +194 -38
- ccxt/bitimen.py +9 -9
- ccxt/bitir.py +35 -35
- ccxt/bitmart.py +1288 -350
- ccxt/bitmex.py +260 -75
- ccxt/bitopro.py +262 -62
- ccxt/bitpin.py +15 -14
- ccxt/bitrue.py +459 -290
- ccxt/bitso.py +199 -54
- ccxt/bitstamp.py +230 -96
- ccxt/bitteam.py +167 -25
- ccxt/{huobijp.py → bittrade.py} +158 -30
- ccxt/bitvavo.py +213 -49
- ccxt/blockchaincom.py +160 -46
- ccxt/blofin.py +502 -120
- ccxt/btcalpha.py +169 -31
- ccxt/btcbox.py +291 -23
- ccxt/btcmarkets.py +211 -58
- ccxt/btcturk.py +161 -38
- ccxt/bybit.py +1775 -1030
- ccxt/cex.py +1439 -1303
- ccxt/coinbase.py +724 -212
- ccxt/coinbaseadvanced.py +2 -1
- ccxt/coinbaseexchange.py +388 -89
- ccxt/coinbaseinternational.py +412 -57
- ccxt/coincatch.py +177 -78
- ccxt/coincheck.py +135 -19
- ccxt/coinex.py +606 -232
- ccxt/coinmate.py +189 -63
- ccxt/coinmetro.py +194 -54
- ccxt/coinone.py +158 -51
- ccxt/coinsph.py +336 -61
- ccxt/coinspot.py +151 -52
- ccxt/cryptocom.py +661 -111
- ccxt/cryptomus.py +1137 -0
- ccxt/defx.py +2070 -0
- ccxt/delta.py +299 -99
- ccxt/deribit.py +348 -126
- ccxt/derive.py +2571 -0
- ccxt/digifinex.py +430 -214
- ccxt/ellipx.py +2029 -0
- ccxt/eterex.py +7 -7
- ccxt/excoino.py +29 -29
- ccxt/exir.py +11 -11
- ccxt/exmo.py +343 -131
- ccxt/exnovin.py +8 -8
- ccxt/farhadexchange.py +10 -10
- ccxt/fmfwio.py +2 -1
- ccxt/foxbit.py +1935 -0
- ccxt/gate.py +1351 -529
- ccxt/gateio.py +2 -1
- ccxt/gemini.py +144 -39
- ccxt/hashkey.py +152 -109
- ccxt/hibachi.py +2079 -0
- ccxt/hitbtc.py +395 -167
- ccxt/hitobit.py +9 -9
- ccxt/hollaex.py +307 -119
- ccxt/htx.py +851 -383
- ccxt/huobi.py +2 -1
- ccxt/hyperliquid.py +1848 -536
- ccxt/independentreserve.py +287 -15
- ccxt/indodax.py +190 -33
- ccxt/jibitex.py +9 -9
- ccxt/kraken.py +794 -351
- ccxt/krakenfutures.py +214 -62
- ccxt/kucoin.py +715 -396
- ccxt/kucoinfutures.py +652 -89
- ccxt/latoken.py +217 -113
- ccxt/lbank.py +425 -97
- ccxt/luno.py +382 -35
- ccxt/mercado.py +113 -6
- ccxt/mexc.py +873 -437
- ccxt/modetrade.py +2818 -0
- ccxt/myokx.py +54 -0
- ccxt/ndax.py +221 -64
- ccxt/nobitex.py +30 -36
- ccxt/novadax.py +190 -34
- ccxt/oceanex.py +217 -28
- ccxt/okcoin.py +253 -145
- ccxt/okexchange.py +9 -9
- ccxt/okx.py +1088 -351
- ccxt/okxus.py +54 -0
- ccxt/ompfinex.py +29 -24
- ccxt/onetrading.py +213 -392
- ccxt/oxfun.py +245 -166
- ccxt/p2b.py +151 -29
- ccxt/paradex.py +562 -49
- ccxt/paymium.py +82 -19
- ccxt/phemex.py +712 -172
- ccxt/poloniex.py +1601 -283
- ccxt/pro/__init__.py +76 -17
- ccxt/pro/alpaca.py +21 -6
- ccxt/pro/apex.py +984 -0
- ccxt/pro/ascendex.py +58 -10
- ccxt/pro/bequant.py +6 -1
- ccxt/pro/binance.py +728 -156
- ccxt/pro/binancecoinm.py +6 -2
- ccxt/pro/binanceus.py +8 -4
- ccxt/pro/binanceusdm.py +7 -2
- ccxt/pro/bingx.py +333 -142
- ccxt/pro/bitfinex.py +727 -262
- ccxt/pro/bitget.py +570 -79
- ccxt/pro/bithumb.py +20 -6
- ccxt/pro/bitmart.py +216 -87
- ccxt/pro/bitmex.py +47 -9
- ccxt/pro/bitopro.py +26 -14
- ccxt/pro/bitrue.py +22 -22
- ccxt/pro/bitstamp.py +54 -21
- ccxt/pro/{huobijp.py → bittrade.py} +7 -6
- ccxt/pro/bitvavo.py +191 -67
- ccxt/pro/blockchaincom.py +21 -8
- ccxt/pro/blofin.py +9 -1
- ccxt/pro/bybit.py +632 -245
- ccxt/pro/cex.py +59 -24
- ccxt/pro/coinbase.py +102 -73
- ccxt/pro/coinbaseadvanced.py +2 -1
- ccxt/pro/coinbaseexchange.py +8 -8
- ccxt/pro/coinbaseinternational.py +181 -25
- ccxt/pro/coincatch.py +6 -7
- ccxt/pro/coincheck.py +11 -6
- ccxt/pro/coinex.py +967 -665
- ccxt/pro/coinone.py +16 -9
- ccxt/pro/cryptocom.py +448 -45
- ccxt/pro/defx.py +831 -0
- ccxt/pro/deribit.py +150 -14
- ccxt/pro/derive.py +704 -0
- ccxt/pro/exmo.py +239 -6
- ccxt/pro/gate.py +623 -65
- ccxt/pro/gateio.py +2 -1
- ccxt/pro/gemini.py +27 -11
- ccxt/pro/hashkey.py +2 -2
- ccxt/pro/hitbtc.py +196 -91
- ccxt/pro/hollaex.py +23 -7
- ccxt/pro/htx.py +51 -14
- ccxt/pro/huobi.py +2 -1
- ccxt/pro/hyperliquid.py +591 -27
- ccxt/pro/independentreserve.py +9 -6
- ccxt/pro/kraken.py +640 -320
- ccxt/pro/krakenfutures.py +62 -35
- ccxt/pro/kucoin.py +267 -46
- ccxt/pro/kucoinfutures.py +165 -21
- ccxt/pro/lbank.py +102 -21
- ccxt/pro/luno.py +12 -8
- ccxt/pro/mexc.py +877 -111
- ccxt/pro/modetrade.py +1271 -0
- ccxt/pro/myokx.py +38 -0
- ccxt/pro/ndax.py +15 -2
- ccxt/pro/okcoin.py +23 -4
- ccxt/pro/okx.py +573 -98
- ccxt/pro/okxus.py +38 -0
- ccxt/pro/onetrading.py +30 -13
- ccxt/pro/oxfun.py +131 -27
- ccxt/pro/p2b.py +88 -22
- ccxt/pro/paradex.py +3 -3
- ccxt/pro/phemex.py +75 -21
- ccxt/pro/poloniex.py +124 -41
- ccxt/pro/probit.py +87 -80
- ccxt/pro/tradeogre.py +272 -0
- ccxt/pro/upbit.py +152 -12
- ccxt/pro/vertex.py +8 -3
- ccxt/pro/whitebit.py +58 -5
- ccxt/pro/woo.py +228 -37
- ccxt/pro/woofipro.py +106 -18
- ccxt/pro/xt.py +111 -5
- ccxt/probit.py +224 -95
- ccxt/protobuf/__init__.py +0 -0
- ccxt/protobuf/mexc/PrivateAccountV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PrivateDealsV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PrivateOrdersV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicAggreBookTickerV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicAggreDealsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicAggreDepthsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicBookTickerBatchV3Api_pb2.py +38 -0
- ccxt/protobuf/mexc/PublicBookTickerV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicDealsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicIncreaseDepthsBatchV3Api_pb2.py +38 -0
- ccxt/protobuf/mexc/PublicIncreaseDepthsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicLimitDepthsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicMiniTickerV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicMiniTickersV3Api_pb2.py +38 -0
- ccxt/protobuf/mexc/PublicSpotKlineV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PushDataV3ApiWrapper_pb2.py +52 -0
- ccxt/protobuf/mexc/__init__.py +0 -0
- ccxt/ramzinex.py +32 -28
- ccxt/sarmayex.py +7 -7
- ccxt/sarrafex.py +10 -10
- ccxt/static_dependencies/__init__.py +1 -1
- ccxt/static_dependencies/lark/py.typed +0 -0
- ccxt/static_dependencies/marshmallow/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- ccxt/tabdeal.py +13 -12
- ccxt/test/tests_async.py +261 -57
- ccxt/test/tests_helpers.py +1 -3
- ccxt/test/tests_init.py +4 -3
- ccxt/test/tests_sync.py +261 -57
- ccxt/tetherland.py +7 -7
- ccxt/timex.py +210 -51
- ccxt/tokocrypto.py +167 -47
- ccxt/tradeogre.py +266 -31
- ccxt/twox.py +7 -7
- ccxt/ubitex.py +9 -9
- ccxt/upbit.py +568 -165
- ccxt/vertex.py +160 -32
- ccxt/wallex.py +9 -9
- ccxt/wavesexchange.py +165 -30
- ccxt/whitebit.py +975 -127
- ccxt/woo.py +1917 -1016
- ccxt/woofipro.py +432 -141
- ccxt/xt.py +649 -193
- ccxt/yobit.py +194 -70
- ccxt/zaif.py +91 -15
- ccxt/zonda.py +151 -36
- {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info}/METADATA +225 -73
- ccxt_ir-4.5.1.dist-info/RECORD +743 -0
- {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info}/WHEEL +1 -1
- ccxt/__test__.py +0 -7
- ccxt/abstract/ace.py +0 -15
- ccxt/abstract/bitbay.py +0 -53
- ccxt/abstract/bitcoincom.py +0 -115
- ccxt/abstract/bitfinex2.py +0 -139
- ccxt/abstract/bitpanda.py +0 -35
- ccxt/abstract/bl3p.py +0 -19
- ccxt/abstract/coinlist.py +0 -54
- ccxt/abstract/currencycom.py +0 -68
- ccxt/abstract/hitbtc3.py +0 -115
- ccxt/abstract/idex.py +0 -26
- ccxt/abstract/kuna.py +0 -182
- ccxt/abstract/lykke.py +0 -29
- ccxt/abstract/poloniexfutures.py +0 -48
- ccxt/abstract/wazirx.py +0 -30
- ccxt/ace.py +0 -1012
- ccxt/async_support/ace.py +0 -1012
- ccxt/async_support/base/ws/aiohttp_client.py +0 -125
- ccxt/async_support/base/ws/fast_client.py +0 -96
- ccxt/async_support/bitbay.py +0 -17
- ccxt/async_support/bitcoincom.py +0 -17
- ccxt/async_support/bitfinex2.py +0 -3552
- ccxt/async_support/bitpanda.py +0 -16
- ccxt/async_support/bl3p.py +0 -485
- ccxt/async_support/coinlist.py +0 -2243
- ccxt/async_support/currencycom.py +0 -1950
- ccxt/async_support/hitbtc3.py +0 -16
- ccxt/async_support/idex.py +0 -1766
- ccxt/async_support/kuna.py +0 -1841
- ccxt/async_support/lykke.py +0 -1270
- ccxt/async_support/poloniexfutures.py +0 -1717
- ccxt/async_support/wazirx.py +0 -1224
- ccxt/bitbay.py +0 -17
- ccxt/bitcoincom.py +0 -17
- ccxt/bitfinex2.py +0 -3552
- ccxt/bitpanda.py +0 -16
- ccxt/bl3p.py +0 -485
- ccxt/coinlist.py +0 -2243
- ccxt/currencycom.py +0 -1950
- ccxt/hitbtc3.py +0 -16
- ccxt/idex.py +0 -1766
- ccxt/kuna.py +0 -1841
- ccxt/lykke.py +0 -1270
- ccxt/poloniexfutures.py +0 -1717
- ccxt/pro/bitcoincom.py +0 -34
- ccxt/pro/bitfinex2.py +0 -1083
- ccxt/pro/bitpanda.py +0 -15
- ccxt/pro/currencycom.py +0 -536
- ccxt/pro/idex.py +0 -672
- ccxt/pro/poloniexfutures.py +0 -990
- ccxt/pro/wazirx.py +0 -749
- ccxt/test/base/__init__.py +0 -29
- ccxt/test/base/test_account.py +0 -26
- ccxt/test/base/test_balance.py +0 -56
- ccxt/test/base/test_borrow_interest.py +0 -35
- ccxt/test/base/test_borrow_rate.py +0 -32
- ccxt/test/base/test_calculate_fee.py +0 -51
- ccxt/test/base/test_crypto.py +0 -127
- ccxt/test/base/test_currency.py +0 -76
- ccxt/test/base/test_datetime.py +0 -109
- ccxt/test/base/test_decimal_to_precision.py +0 -392
- ccxt/test/base/test_deep_extend.py +0 -68
- ccxt/test/base/test_deposit_withdrawal.py +0 -50
- ccxt/test/base/test_exchange_datetime_functions.py +0 -76
- ccxt/test/base/test_funding_rate_history.py +0 -29
- ccxt/test/base/test_last_price.py +0 -31
- ccxt/test/base/test_ledger_entry.py +0 -45
- ccxt/test/base/test_ledger_item.py +0 -48
- ccxt/test/base/test_leverage_tier.py +0 -33
- ccxt/test/base/test_liquidation.py +0 -50
- ccxt/test/base/test_margin_mode.py +0 -24
- ccxt/test/base/test_margin_modification.py +0 -35
- ccxt/test/base/test_market.py +0 -193
- ccxt/test/base/test_number.py +0 -411
- ccxt/test/base/test_ohlcv.py +0 -33
- ccxt/test/base/test_open_interest.py +0 -32
- ccxt/test/base/test_order.py +0 -64
- ccxt/test/base/test_order_book.py +0 -69
- ccxt/test/base/test_position.py +0 -60
- ccxt/test/base/test_shared_methods.py +0 -353
- ccxt/test/base/test_status.py +0 -24
- ccxt/test/base/test_throttle.py +0 -126
- ccxt/test/base/test_ticker.py +0 -92
- ccxt/test/base/test_trade.py +0 -47
- ccxt/test/base/test_trading_fee.py +0 -26
- ccxt/test/base/test_transaction.py +0 -39
- ccxt/test/test_async.py +0 -1649
- ccxt/test/test_sync.py +0 -1648
- ccxt/wazirx.py +0 -1224
- ccxt_ir-4.3.46.0.3.dist-info/RECORD +0 -773
- /ccxt/abstract/{huobijp.py → bittrade.py} +0 -0
- {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info/licenses}/LICENSE.txt +0 -0
- {ccxt_ir-4.3.46.0.3.dist-info → ccxt_ir-4.5.1.dist-info}/top_level.txt +0 -0
ccxt/async_support/ascendex.py
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.ascendex import ImplicitAPI
|
|
8
|
+
import asyncio
|
|
8
9
|
import hashlib
|
|
9
|
-
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
|
|
10
|
+
from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
|
|
10
11
|
from typing import List
|
|
11
12
|
from ccxt.base.errors import ExchangeError
|
|
12
13
|
from ccxt.base.errors import AuthenticationError
|
|
@@ -24,7 +25,7 @@ from ccxt.base.precise import Precise
|
|
|
24
25
|
|
|
25
26
|
class ascendex(Exchange, ImplicitAPI):
|
|
26
27
|
|
|
27
|
-
def describe(self):
|
|
28
|
+
def describe(self) -> Any:
|
|
28
29
|
return self.deep_extend(super(ascendex, self).describe(), {
|
|
29
30
|
'id': 'ascendex',
|
|
30
31
|
'name': 'AscendEX',
|
|
@@ -67,6 +68,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
67
68
|
'fetchFundingRate': 'emulated',
|
|
68
69
|
'fetchFundingRateHistory': False,
|
|
69
70
|
'fetchFundingRates': True,
|
|
71
|
+
'fetchGreeks': False,
|
|
70
72
|
'fetchIndexOHLCV': False,
|
|
71
73
|
'fetchLeverage': 'emulated',
|
|
72
74
|
'fetchLeverages': True,
|
|
@@ -76,10 +78,13 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
76
78
|
'fetchMarketLeverageTiers': 'emulated',
|
|
77
79
|
'fetchMarkets': True,
|
|
78
80
|
'fetchMarkOHLCV': False,
|
|
81
|
+
'fetchMySettlementHistory': False,
|
|
79
82
|
'fetchOHLCV': True,
|
|
80
83
|
'fetchOpenInterest': False,
|
|
81
84
|
'fetchOpenInterestHistory': False,
|
|
82
85
|
'fetchOpenOrders': True,
|
|
86
|
+
'fetchOption': False,
|
|
87
|
+
'fetchOptionChain': False,
|
|
83
88
|
'fetchOrder': True,
|
|
84
89
|
'fetchOrderBook': True,
|
|
85
90
|
'fetchOrders': False,
|
|
@@ -88,6 +93,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
88
93
|
'fetchPositions': True,
|
|
89
94
|
'fetchPositionsRisk': False,
|
|
90
95
|
'fetchPremiumIndexOHLCV': False,
|
|
96
|
+
'fetchSettlementHistory': False,
|
|
91
97
|
'fetchTicker': True,
|
|
92
98
|
'fetchTickers': True,
|
|
93
99
|
'fetchTime': True,
|
|
@@ -99,6 +105,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
99
105
|
'fetchTransactions': 'emulated',
|
|
100
106
|
'fetchTransfer': False,
|
|
101
107
|
'fetchTransfers': False,
|
|
108
|
+
'fetchVolatilityHistory': False,
|
|
102
109
|
'fetchWithdrawal': False,
|
|
103
110
|
'fetchWithdrawals': True,
|
|
104
111
|
'reduceMargin': True,
|
|
@@ -124,7 +131,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
124
131
|
},
|
|
125
132
|
'version': 'v2',
|
|
126
133
|
'urls': {
|
|
127
|
-
'logo': 'https://
|
|
134
|
+
'logo': 'https://github.com/user-attachments/assets/55bab6b9-d4ca-42a8-a0e6-fac81ae557f1',
|
|
128
135
|
'api': {
|
|
129
136
|
'rest': 'https://ascendex.com',
|
|
130
137
|
},
|
|
@@ -293,26 +300,114 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
293
300
|
'SOL': 'Solana',
|
|
294
301
|
'AVAX': 'avalanche C chain',
|
|
295
302
|
'OMNI': 'Omni',
|
|
296
|
-
'TRC': 'TRC20',
|
|
297
|
-
'TRX': 'TRC20',
|
|
298
|
-
'ERC': 'ERC20',
|
|
299
|
-
},
|
|
300
|
-
'networksById': {
|
|
301
|
-
'BEP20(BSC)': 'BSC',
|
|
302
|
-
'arbitrum': 'ARB',
|
|
303
|
-
'Solana': 'SOL',
|
|
304
|
-
'avalanche C chain': 'AVAX',
|
|
305
|
-
'Omni': 'OMNI',
|
|
303
|
+
# 'TRC': 'TRC20',
|
|
306
304
|
'TRC20': 'TRC20',
|
|
307
305
|
'ERC20': 'ERC20',
|
|
308
306
|
'GO20': 'GO20',
|
|
309
307
|
'BEP2': 'BEP2',
|
|
310
|
-
'
|
|
311
|
-
'
|
|
312
|
-
'
|
|
313
|
-
'
|
|
314
|
-
'
|
|
315
|
-
|
|
308
|
+
'BTC': 'Bitcoin',
|
|
309
|
+
'BCH': 'Bitcoin ABC',
|
|
310
|
+
'LTC': 'Litecoin',
|
|
311
|
+
'MATIC': 'Matic Network',
|
|
312
|
+
'AKT': 'Akash',
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
'features': {
|
|
316
|
+
'default': {
|
|
317
|
+
'sandbox': True,
|
|
318
|
+
'createOrder': {
|
|
319
|
+
'marginMode': True,
|
|
320
|
+
'triggerPrice': True,
|
|
321
|
+
'triggerPriceType': None,
|
|
322
|
+
'triggerDirection': False,
|
|
323
|
+
'stopLossPrice': False, # todo with triggerprice
|
|
324
|
+
'takeProfitPrice': False, # todo with triggerprice
|
|
325
|
+
'attachedStopLossTakeProfit': None,
|
|
326
|
+
'timeInForce': {
|
|
327
|
+
'IOC': True,
|
|
328
|
+
'FOK': True,
|
|
329
|
+
'PO': True,
|
|
330
|
+
'GTD': False,
|
|
331
|
+
},
|
|
332
|
+
'hedged': False,
|
|
333
|
+
'trailing': False,
|
|
334
|
+
'leverage': False,
|
|
335
|
+
'marketBuyRequiresPrice': False,
|
|
336
|
+
'marketBuyByCost': False,
|
|
337
|
+
'selfTradePrevention': False,
|
|
338
|
+
'iceberg': False,
|
|
339
|
+
},
|
|
340
|
+
'createOrders': {
|
|
341
|
+
'max': 10,
|
|
342
|
+
},
|
|
343
|
+
'fetchMyTrades': None,
|
|
344
|
+
'fetchOrder': {
|
|
345
|
+
'marginMode': False,
|
|
346
|
+
'trigger': False,
|
|
347
|
+
'trailing': False,
|
|
348
|
+
'marketType': True,
|
|
349
|
+
'symbolRequired': False,
|
|
350
|
+
},
|
|
351
|
+
'fetchOpenOrders': {
|
|
352
|
+
'marginMode': False,
|
|
353
|
+
'limit': None,
|
|
354
|
+
'trigger': False,
|
|
355
|
+
'trailing': False,
|
|
356
|
+
'marketType': True,
|
|
357
|
+
'symbolRequired': False,
|
|
358
|
+
},
|
|
359
|
+
'fetchOrders': None,
|
|
360
|
+
'fetchClosedOrders': None,
|
|
361
|
+
'fetchOHLCV': {
|
|
362
|
+
'limit': 500,
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
'spot': {
|
|
366
|
+
'extends': 'default',
|
|
367
|
+
'fetchClosedOrders': {
|
|
368
|
+
'marginMode': False,
|
|
369
|
+
'limit': 1000,
|
|
370
|
+
'daysBack': 100000,
|
|
371
|
+
'daysBackCanceled': 1,
|
|
372
|
+
'untilDays': 100000,
|
|
373
|
+
'trigger': False,
|
|
374
|
+
'trailing': False,
|
|
375
|
+
'symbolRequired': False,
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
'forDerivatives': {
|
|
379
|
+
'extends': 'default',
|
|
380
|
+
'createOrder': {
|
|
381
|
+
# todo: implementation
|
|
382
|
+
'attachedStopLossTakeProfit': {
|
|
383
|
+
'triggerPriceType': {
|
|
384
|
+
'last': True,
|
|
385
|
+
'mark': False,
|
|
386
|
+
'index': False,
|
|
387
|
+
},
|
|
388
|
+
'price': False,
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
'fetchClosedOrders': {
|
|
392
|
+
'marginMode': False,
|
|
393
|
+
'limit': 1000,
|
|
394
|
+
'daysBack': None,
|
|
395
|
+
'daysBackCanceled': None,
|
|
396
|
+
'untilDays': None,
|
|
397
|
+
'trigger': False,
|
|
398
|
+
'trailing': False,
|
|
399
|
+
'symbolRequired': False,
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
'swap': {
|
|
403
|
+
'linear': {
|
|
404
|
+
'extends': 'forDerivatives',
|
|
405
|
+
},
|
|
406
|
+
'inverse': None,
|
|
407
|
+
},
|
|
408
|
+
'future': {
|
|
409
|
+
'linear': None,
|
|
410
|
+
'inverse': None,
|
|
316
411
|
},
|
|
317
412
|
},
|
|
318
413
|
'exceptions': {
|
|
@@ -383,6 +478,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
383
478
|
'broad': {},
|
|
384
479
|
},
|
|
385
480
|
'commonCurrencies': {
|
|
481
|
+
'XBT': 'XBT', # self is not BTC ! just another token
|
|
386
482
|
'BOND': 'BONDED',
|
|
387
483
|
'BTCBEAR': 'BEAR',
|
|
388
484
|
'BTCBULL': 'BULL',
|
|
@@ -403,94 +499,82 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
403
499
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
404
500
|
:returns dict: an associative dictionary of currencies
|
|
405
501
|
"""
|
|
406
|
-
|
|
407
|
-
#
|
|
408
|
-
# {
|
|
409
|
-
# "code":0,
|
|
410
|
-
# "data":[
|
|
411
|
-
# {
|
|
412
|
-
# "assetCode" : "LTCBULL",
|
|
413
|
-
# "assetName" : "3X Long LTC Token",
|
|
414
|
-
# "precisionScale" : 9,
|
|
415
|
-
# "nativeScale" : 4,
|
|
416
|
-
# "withdrawalFee" : "0.2",
|
|
417
|
-
# "minWithdrawalAmt" : "1.0",
|
|
418
|
-
# "status" : "Normal"
|
|
419
|
-
# },
|
|
420
|
-
# ]
|
|
421
|
-
# }
|
|
422
|
-
#
|
|
423
|
-
margin = await self.v1PublicGetMarginAssets(params)
|
|
424
|
-
#
|
|
425
|
-
# {
|
|
426
|
-
# "code":0,
|
|
427
|
-
# "data":[
|
|
428
|
-
# {
|
|
429
|
-
# "assetCode":"BTT",
|
|
430
|
-
# "borrowAssetCode":"BTT-B",
|
|
431
|
-
# "interestAssetCode":"BTT-I",
|
|
432
|
-
# "nativeScale":0,
|
|
433
|
-
# "numConfirmations":1,
|
|
434
|
-
# "withdrawFee":"100.0",
|
|
435
|
-
# "minWithdrawalAmt":"1000.0",
|
|
436
|
-
# "statusCode":"Normal",
|
|
437
|
-
# "statusMessage":"",
|
|
438
|
-
# "interestRate":"0.001"
|
|
439
|
-
# }
|
|
440
|
-
# ]
|
|
441
|
-
# }
|
|
442
|
-
#
|
|
443
|
-
cash = await self.v1PublicGetCashAssets(params)
|
|
502
|
+
response = await self.v2PublicGetAssets(params)
|
|
444
503
|
#
|
|
445
|
-
#
|
|
446
|
-
#
|
|
447
|
-
#
|
|
448
|
-
#
|
|
449
|
-
#
|
|
450
|
-
#
|
|
451
|
-
#
|
|
452
|
-
#
|
|
453
|
-
#
|
|
454
|
-
#
|
|
455
|
-
#
|
|
456
|
-
#
|
|
504
|
+
# {
|
|
505
|
+
# "code": "0",
|
|
506
|
+
# "data": [
|
|
507
|
+
# {
|
|
508
|
+
# "assetCode": "USDT",
|
|
509
|
+
# "assetName": "Tether",
|
|
510
|
+
# "precisionScale": 9,
|
|
511
|
+
# "nativeScale": 4,
|
|
512
|
+
# "blockChain": [
|
|
513
|
+
# {
|
|
514
|
+
# "chainName": "Solana",
|
|
515
|
+
# "withdrawFee": "2.0",
|
|
516
|
+
# "allowDeposit": True,
|
|
517
|
+
# "allowWithdraw": True,
|
|
518
|
+
# "minDepositAmt": "0.01",
|
|
519
|
+
# "minWithdrawal": "4.0",
|
|
520
|
+
# "numConfirmations": 1
|
|
521
|
+
# },
|
|
522
|
+
# ...
|
|
523
|
+
# ]
|
|
524
|
+
# },
|
|
457
525
|
# ]
|
|
458
|
-
#
|
|
526
|
+
# }
|
|
459
527
|
#
|
|
460
|
-
|
|
461
|
-
marginData = self.safe_value(margin, 'data', [])
|
|
462
|
-
cashData = self.safe_value(cash, 'data', [])
|
|
463
|
-
assetsById = self.index_by(assetsData, 'assetCode')
|
|
464
|
-
marginById = self.index_by(marginData, 'assetCode')
|
|
465
|
-
cashById = self.index_by(cashData, 'assetCode')
|
|
466
|
-
dataById = self.deep_extend(assetsById, marginById, cashById)
|
|
467
|
-
ids = list(dataById.keys())
|
|
528
|
+
data = self.safe_list(response, 'data', [])
|
|
468
529
|
result: dict = {}
|
|
469
|
-
for i in range(0, len(
|
|
470
|
-
|
|
471
|
-
|
|
530
|
+
for i in range(0, len(data)):
|
|
531
|
+
currency = data[i]
|
|
532
|
+
id = self.safe_string(currency, 'assetCode')
|
|
472
533
|
code = self.safe_currency_code(id)
|
|
473
|
-
|
|
474
|
-
precision = self.parse_number(self.parse_precision(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
534
|
+
chains = self.safe_list(currency, 'blockChain', [])
|
|
535
|
+
precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'nativeScale')))
|
|
536
|
+
networks = {}
|
|
537
|
+
for j in range(0, len(chains)):
|
|
538
|
+
networkEtnry = chains[j]
|
|
539
|
+
networkId = self.safe_string(networkEtnry, 'chainName')
|
|
540
|
+
networkCode = self.network_code_to_id(networkId)
|
|
541
|
+
networks[networkCode] = {
|
|
542
|
+
'fee': self.safe_number(networkEtnry, 'withdrawFee'),
|
|
543
|
+
'active': None,
|
|
544
|
+
'withdraw': self.safe_bool(networkEtnry, 'allowWithdraw'),
|
|
545
|
+
'deposit': self.safe_bool(networkEtnry, 'allowDeposit'),
|
|
546
|
+
'precision': precision,
|
|
547
|
+
'limits': {
|
|
548
|
+
'amount': {
|
|
549
|
+
'min': None,
|
|
550
|
+
'max': None,
|
|
551
|
+
},
|
|
552
|
+
'withdraw': {
|
|
553
|
+
'min': self.safe_number(networkEtnry, 'minWithdrawal'),
|
|
554
|
+
'max': None,
|
|
555
|
+
},
|
|
556
|
+
'deposit': {
|
|
557
|
+
'min': self.safe_number(networkEtnry, 'minDepositAmt'),
|
|
558
|
+
'max': None,
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
}
|
|
562
|
+
# todo type: if chainsLength == 0 and (assetName.endswith(' Staking') or assetName.find(' Reward ') >= 0 or assetName.find('Slot Auction') >= 0 or assetName.find(' Freeze Asset') >= 0):
|
|
563
|
+
result[code] = self.safe_currency_structure({
|
|
480
564
|
'id': id,
|
|
481
565
|
'code': code,
|
|
482
566
|
'info': currency,
|
|
483
567
|
'type': None,
|
|
484
|
-
'margin':
|
|
568
|
+
'margin': None,
|
|
485
569
|
'name': self.safe_string(currency, 'assetName'),
|
|
486
|
-
'active':
|
|
570
|
+
'active': None,
|
|
487
571
|
'deposit': None,
|
|
488
572
|
'withdraw': None,
|
|
489
|
-
'fee':
|
|
573
|
+
'fee': None,
|
|
490
574
|
'precision': precision,
|
|
491
575
|
'limits': {
|
|
492
576
|
'amount': {
|
|
493
|
-
'min':
|
|
577
|
+
'min': None,
|
|
494
578
|
'max': None,
|
|
495
579
|
},
|
|
496
580
|
'withdraw': {
|
|
@@ -498,8 +582,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
498
582
|
'max': None,
|
|
499
583
|
},
|
|
500
584
|
},
|
|
501
|
-
'networks':
|
|
502
|
-
}
|
|
585
|
+
'networks': networks,
|
|
586
|
+
})
|
|
503
587
|
return result
|
|
504
588
|
|
|
505
589
|
async def fetch_markets(self, params={}) -> List[Market]:
|
|
@@ -508,7 +592,13 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
508
592
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
509
593
|
:returns dict[]: an array of objects representing market data
|
|
510
594
|
"""
|
|
511
|
-
|
|
595
|
+
spotPromise = self.fetch_spot_markets(params)
|
|
596
|
+
contractPromise = self.fetch_contract_markets(params)
|
|
597
|
+
spotMarkets, contractMarkets = await asyncio.gather(*[spotPromise, contractPromise])
|
|
598
|
+
return self.array_concat(spotMarkets, contractMarkets)
|
|
599
|
+
|
|
600
|
+
async def fetch_spot_markets(self, params={}) -> List[Market]:
|
|
601
|
+
productsPromise = self.v1PublicGetProducts(params)
|
|
512
602
|
#
|
|
513
603
|
# {
|
|
514
604
|
# "code": 0,
|
|
@@ -529,7 +619,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
529
619
|
# ]
|
|
530
620
|
# }
|
|
531
621
|
#
|
|
532
|
-
|
|
622
|
+
cashPromise = self.v1PublicGetCashProducts(params)
|
|
533
623
|
#
|
|
534
624
|
# {
|
|
535
625
|
# "code": 0,
|
|
@@ -559,7 +649,91 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
559
649
|
# ]
|
|
560
650
|
# }
|
|
561
651
|
#
|
|
562
|
-
|
|
652
|
+
products, cash = await asyncio.gather(*[productsPromise, cashPromise])
|
|
653
|
+
productsData = self.safe_list(products, 'data', [])
|
|
654
|
+
productsById = self.index_by(productsData, 'symbol')
|
|
655
|
+
cashData = self.safe_list(cash, 'data', [])
|
|
656
|
+
cashAndPerpetualsById = self.index_by(cashData, 'symbol')
|
|
657
|
+
dataById = self.deep_extend(productsById, cashAndPerpetualsById)
|
|
658
|
+
ids = list(dataById.keys())
|
|
659
|
+
result = []
|
|
660
|
+
for i in range(0, len(ids)):
|
|
661
|
+
id = ids[i]
|
|
662
|
+
if id.find('-PERP') >= 0:
|
|
663
|
+
continue # skip perpetuals, endpoint returns them
|
|
664
|
+
market = dataById[id]
|
|
665
|
+
status = self.safe_string(market, 'status')
|
|
666
|
+
domain = self.safe_string(market, 'domain')
|
|
667
|
+
active = False
|
|
668
|
+
if ((status == 'Normal') or (status == 'InternalTrading')) and (domain != 'LeveragedETF'):
|
|
669
|
+
active = True
|
|
670
|
+
minQty = self.safe_number(market, 'minQty')
|
|
671
|
+
maxQty = self.safe_number(market, 'maxQty')
|
|
672
|
+
minPrice = self.safe_number(market, 'tickSize')
|
|
673
|
+
maxPrice: Num = None
|
|
674
|
+
underlying = self.safe_string_2(market, 'underlying', 'symbol')
|
|
675
|
+
parts = underlying.split('/')
|
|
676
|
+
baseId = self.safe_string(parts, 0)
|
|
677
|
+
quoteId = self.safe_string(parts, 1)
|
|
678
|
+
base = self.safe_currency_code(baseId)
|
|
679
|
+
quote = self.safe_currency_code(quoteId)
|
|
680
|
+
fee = self.safe_number(market, 'commissionReserveRate')
|
|
681
|
+
marginTradable = self.safe_bool(market, 'marginTradable', False)
|
|
682
|
+
result.append({
|
|
683
|
+
'id': id,
|
|
684
|
+
'symbol': base + '/' + quote,
|
|
685
|
+
'base': base,
|
|
686
|
+
'baseId': baseId,
|
|
687
|
+
'quote': quote,
|
|
688
|
+
'quoteId': quoteId,
|
|
689
|
+
'settle': None,
|
|
690
|
+
'settleId': None,
|
|
691
|
+
'type': 'spot',
|
|
692
|
+
'spot': True,
|
|
693
|
+
'margin': marginTradable,
|
|
694
|
+
'swap': False,
|
|
695
|
+
'future': False,
|
|
696
|
+
'option': False,
|
|
697
|
+
'active': active,
|
|
698
|
+
'contract': False,
|
|
699
|
+
'linear': None,
|
|
700
|
+
'inverse': None,
|
|
701
|
+
'taker': fee,
|
|
702
|
+
'maker': fee,
|
|
703
|
+
'contractSize': None,
|
|
704
|
+
'expiry': None,
|
|
705
|
+
'expiryDatetime': None,
|
|
706
|
+
'strike': None,
|
|
707
|
+
'optionType': None,
|
|
708
|
+
'precision': {
|
|
709
|
+
'amount': self.safe_number(market, 'lotSize'),
|
|
710
|
+
'price': self.safe_number(market, 'tickSize'),
|
|
711
|
+
},
|
|
712
|
+
'limits': {
|
|
713
|
+
'leverage': {
|
|
714
|
+
'min': None,
|
|
715
|
+
'max': None,
|
|
716
|
+
},
|
|
717
|
+
'amount': {
|
|
718
|
+
'min': minQty,
|
|
719
|
+
'max': maxQty,
|
|
720
|
+
},
|
|
721
|
+
'price': {
|
|
722
|
+
'min': minPrice,
|
|
723
|
+
'max': maxPrice,
|
|
724
|
+
},
|
|
725
|
+
'cost': {
|
|
726
|
+
'min': self.safe_number(market, 'minNotional'),
|
|
727
|
+
'max': self.safe_number(market, 'maxNotional'),
|
|
728
|
+
},
|
|
729
|
+
},
|
|
730
|
+
'created': self.safe_integer(market, 'tradingStartTime'),
|
|
731
|
+
'info': market,
|
|
732
|
+
})
|
|
733
|
+
return result
|
|
734
|
+
|
|
735
|
+
async def fetch_contract_markets(self, params={}) -> List[Market]:
|
|
736
|
+
contracts = await self.v2PublicGetFuturesContract(params)
|
|
563
737
|
#
|
|
564
738
|
# {
|
|
565
739
|
# "code": 0,
|
|
@@ -572,9 +746,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
572
746
|
# "underlying": "BTC/USDT",
|
|
573
747
|
# "tradingStartTime": 1579701600000,
|
|
574
748
|
# "priceFilter": {
|
|
575
|
-
# "minPrice": "1",
|
|
749
|
+
# "minPrice": "0.1",
|
|
576
750
|
# "maxPrice": "1000000",
|
|
577
|
-
# "tickSize": "1"
|
|
751
|
+
# "tickSize": "0.1"
|
|
578
752
|
# },
|
|
579
753
|
# "lotSizeFilter": {
|
|
580
754
|
# "minQty": "0.0001",
|
|
@@ -597,49 +771,25 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
597
771
|
# ]
|
|
598
772
|
# }
|
|
599
773
|
#
|
|
600
|
-
|
|
601
|
-
productsById = self.index_by(productsData, 'symbol')
|
|
602
|
-
cashData = self.safe_value(cash, 'data', [])
|
|
603
|
-
perpetualsData = self.safe_value(perpetuals, 'data', [])
|
|
604
|
-
cashAndPerpetualsData = self.array_concat(cashData, perpetualsData)
|
|
605
|
-
cashAndPerpetualsById = self.index_by(cashAndPerpetualsData, 'symbol')
|
|
606
|
-
dataById = self.deep_extend(productsById, cashAndPerpetualsById)
|
|
607
|
-
ids = list(dataById.keys())
|
|
774
|
+
data = self.safe_list(contracts, 'data', [])
|
|
608
775
|
result = []
|
|
609
|
-
for i in range(0, len(
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
settle = self.safe_currency_code(settleId)
|
|
614
|
-
status = self.safe_string(market, 'status')
|
|
615
|
-
domain = self.safe_string(market, 'domain')
|
|
616
|
-
active = False
|
|
617
|
-
if ((status == 'Normal') or (status == 'InternalTrading')) and (domain != 'LeveragedETF'):
|
|
618
|
-
active = True
|
|
619
|
-
spot = settle is None
|
|
620
|
-
swap = not spot
|
|
621
|
-
linear = True if swap else None
|
|
622
|
-
minQty = self.safe_number(market, 'minQty')
|
|
623
|
-
maxQty = self.safe_number(market, 'maxQty')
|
|
624
|
-
minPrice = self.safe_number(market, 'tickSize')
|
|
625
|
-
maxPrice: Num = None
|
|
626
|
-
underlying = self.safe_string_2(market, 'underlying', 'symbol')
|
|
776
|
+
for i in range(0, len(data)):
|
|
777
|
+
market = data[i]
|
|
778
|
+
id = self.safe_string(market, 'symbol')
|
|
779
|
+
underlying = self.safe_string(market, 'underlying')
|
|
627
780
|
parts = underlying.split('/')
|
|
628
781
|
baseId = self.safe_string(parts, 0)
|
|
629
|
-
quoteId = self.safe_string(parts, 1)
|
|
630
782
|
base = self.safe_currency_code(baseId)
|
|
783
|
+
quoteId = self.safe_string(parts, 1)
|
|
631
784
|
quote = self.safe_currency_code(quoteId)
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
maxPrice = self.safe_number(priceFilter, 'maxPrice')
|
|
640
|
-
symbol = base + '/' + quote + ':' + settle
|
|
785
|
+
settleId = self.safe_string(market, 'settlementAsset')
|
|
786
|
+
settle = self.safe_currency_code(settleId)
|
|
787
|
+
linear = settle == quote
|
|
788
|
+
inverse = settle == base
|
|
789
|
+
symbol = base + '/' + quote + ':' + settle
|
|
790
|
+
priceFilter = self.safe_dict(market, 'priceFilter')
|
|
791
|
+
lotSizeFilter = self.safe_dict(market, 'lotSizeFilter')
|
|
641
792
|
fee = self.safe_number(market, 'commissionReserveRate')
|
|
642
|
-
marginTradable = self.safe_bool(market, 'marginTradable', False)
|
|
643
793
|
result.append({
|
|
644
794
|
'id': id,
|
|
645
795
|
'symbol': symbol,
|
|
@@ -649,26 +799,26 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
649
799
|
'baseId': baseId,
|
|
650
800
|
'quoteId': quoteId,
|
|
651
801
|
'settleId': settleId,
|
|
652
|
-
'type': 'swap'
|
|
653
|
-
'spot':
|
|
654
|
-
'margin':
|
|
655
|
-
'swap':
|
|
802
|
+
'type': 'swap',
|
|
803
|
+
'spot': False,
|
|
804
|
+
'margin': None,
|
|
805
|
+
'swap': True,
|
|
656
806
|
'future': False,
|
|
657
807
|
'option': False,
|
|
658
|
-
'active':
|
|
659
|
-
'contract':
|
|
808
|
+
'active': self.safe_string(market, 'status') == 'Normal',
|
|
809
|
+
'contract': True,
|
|
660
810
|
'linear': linear,
|
|
661
|
-
'inverse':
|
|
811
|
+
'inverse': inverse,
|
|
662
812
|
'taker': fee,
|
|
663
813
|
'maker': fee,
|
|
664
|
-
'contractSize': self.parse_number('1')
|
|
814
|
+
'contractSize': self.parse_number('1'),
|
|
665
815
|
'expiry': None,
|
|
666
816
|
'expiryDatetime': None,
|
|
667
817
|
'strike': None,
|
|
668
818
|
'optionType': None,
|
|
669
819
|
'precision': {
|
|
670
|
-
'amount': self.safe_number(
|
|
671
|
-
'price': self.safe_number(
|
|
820
|
+
'amount': self.safe_number(lotSizeFilter, 'lotSize'),
|
|
821
|
+
'price': self.safe_number(priceFilter, 'tickSize'),
|
|
672
822
|
},
|
|
673
823
|
'limits': {
|
|
674
824
|
'leverage': {
|
|
@@ -676,12 +826,12 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
676
826
|
'max': None,
|
|
677
827
|
},
|
|
678
828
|
'amount': {
|
|
679
|
-
'min': minQty,
|
|
680
|
-
'max': maxQty,
|
|
829
|
+
'min': self.safe_number(lotSizeFilter, 'minQty'),
|
|
830
|
+
'max': self.safe_number(lotSizeFilter, 'maxQty'),
|
|
681
831
|
},
|
|
682
832
|
'price': {
|
|
683
|
-
'min': minPrice,
|
|
684
|
-
'max': maxPrice,
|
|
833
|
+
'min': self.safe_number(priceFilter, 'minPrice'),
|
|
834
|
+
'max': self.safe_number(priceFilter, 'maxPrice'),
|
|
685
835
|
},
|
|
686
836
|
'cost': {
|
|
687
837
|
'min': self.safe_number(market, 'minNotional'),
|
|
@@ -693,7 +843,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
693
843
|
})
|
|
694
844
|
return result
|
|
695
845
|
|
|
696
|
-
async def fetch_time(self, params={}):
|
|
846
|
+
async def fetch_time(self, params={}) -> Int:
|
|
697
847
|
"""
|
|
698
848
|
fetches the current integer timestamp in milliseconds from the ascendex server
|
|
699
849
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -713,7 +863,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
713
863
|
# }
|
|
714
864
|
# }
|
|
715
865
|
#
|
|
716
|
-
data = self.
|
|
866
|
+
data = self.safe_dict(response, 'data', {})
|
|
717
867
|
return self.safe_integer(data, 'requestReceiveAt')
|
|
718
868
|
|
|
719
869
|
async def fetch_accounts(self, params={}) -> List[Account]:
|
|
@@ -742,7 +892,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
742
892
|
# }
|
|
743
893
|
# }
|
|
744
894
|
#
|
|
745
|
-
data = self.
|
|
895
|
+
data = self.safe_dict(response, 'data', {})
|
|
746
896
|
accountGroup = self.safe_string(data, 'accountGroup')
|
|
747
897
|
self.options['account-group'] = accountGroup
|
|
748
898
|
return [
|
|
@@ -760,7 +910,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
760
910
|
'timestamp': None,
|
|
761
911
|
'datetime': None,
|
|
762
912
|
}
|
|
763
|
-
balances = self.
|
|
913
|
+
balances = self.safe_list(response, 'data', [])
|
|
764
914
|
for i in range(0, len(balances)):
|
|
765
915
|
balance = balances[i]
|
|
766
916
|
code = self.safe_currency_code(self.safe_string(balance, 'asset'))
|
|
@@ -776,7 +926,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
776
926
|
'timestamp': None,
|
|
777
927
|
'datetime': None,
|
|
778
928
|
}
|
|
779
|
-
balances = self.
|
|
929
|
+
balances = self.safe_list(response, 'data', [])
|
|
780
930
|
for i in range(0, len(balances)):
|
|
781
931
|
balance = balances[i]
|
|
782
932
|
code = self.safe_currency_code(self.safe_string(balance, 'asset'))
|
|
@@ -795,8 +945,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
795
945
|
'timestamp': None,
|
|
796
946
|
'datetime': None,
|
|
797
947
|
}
|
|
798
|
-
data = self.
|
|
799
|
-
collaterals = self.
|
|
948
|
+
data = self.safe_dict(response, 'data', {})
|
|
949
|
+
collaterals = self.safe_list(data, 'collaterals', [])
|
|
800
950
|
for i in range(0, len(collaterals)):
|
|
801
951
|
balance = collaterals[i]
|
|
802
952
|
code = self.safe_currency_code(self.safe_string(balance, 'asset'))
|
|
@@ -808,9 +958,11 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
808
958
|
async def fetch_balance(self, params={}) -> Balances:
|
|
809
959
|
"""
|
|
810
960
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
961
|
+
|
|
962
|
+
https://ascendex.github.io/ascendex-pro-api/#cash-account-balance
|
|
963
|
+
https://ascendex.github.io/ascendex-pro-api/#margin-account-balance
|
|
964
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
|
965
|
+
|
|
814
966
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
815
967
|
:param str [params.type]: wallet type, 'spot', 'margin', or 'swap'
|
|
816
968
|
:param str [params.marginMode]: 'cross' or None, for spot margin trading, value of 'isolated' is invalid
|
|
@@ -826,9 +978,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
826
978
|
isCross = marginMode == 'cross'
|
|
827
979
|
marketType = 'margin' if (isMargin or isCross) else marketType
|
|
828
980
|
params = self.omit(params, 'margin')
|
|
829
|
-
accountsByType = self.
|
|
981
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
830
982
|
accountCategory = self.safe_string(accountsByType, marketType, 'cash')
|
|
831
|
-
account = self.
|
|
983
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
832
984
|
accountGroup = self.safe_string(account, 'id')
|
|
833
985
|
request: dict = {
|
|
834
986
|
'account-group': accountGroup,
|
|
@@ -931,8 +1083,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
931
1083
|
# }
|
|
932
1084
|
# }
|
|
933
1085
|
#
|
|
934
|
-
data = self.
|
|
935
|
-
orderbook = self.
|
|
1086
|
+
data = self.safe_dict(response, 'data', {})
|
|
1087
|
+
orderbook = self.safe_dict(data, 'data', {})
|
|
936
1088
|
timestamp = self.safe_integer(orderbook, 'ts')
|
|
937
1089
|
result = self.parse_order_book(orderbook, symbol, timestamp)
|
|
938
1090
|
result['nonce'] = self.safe_integer(orderbook, 'seqnum')
|
|
@@ -958,8 +1110,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
958
1110
|
delimiter = '/' if (type == 'spot') else None
|
|
959
1111
|
symbol = self.safe_symbol(marketId, market, delimiter)
|
|
960
1112
|
close = self.safe_string(ticker, 'close')
|
|
961
|
-
bid = self.
|
|
962
|
-
ask = self.
|
|
1113
|
+
bid = self.safe_list(ticker, 'bid', [])
|
|
1114
|
+
ask = self.safe_list(ticker, 'ask', [])
|
|
963
1115
|
open = self.safe_string(ticker, 'open')
|
|
964
1116
|
return self.safe_ticker({
|
|
965
1117
|
'symbol': symbol,
|
|
@@ -1019,8 +1171,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1019
1171
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
|
1020
1172
|
"""
|
|
1021
1173
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1022
|
-
|
|
1023
|
-
|
|
1174
|
+
|
|
1175
|
+
https://ascendex.github.io/ascendex-pro-api/#ticker
|
|
1176
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#ticker
|
|
1177
|
+
|
|
1024
1178
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1025
1179
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1026
1180
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
@@ -1029,7 +1183,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1029
1183
|
request: dict = {}
|
|
1030
1184
|
market = None
|
|
1031
1185
|
if symbols is not None:
|
|
1032
|
-
symbol = self.
|
|
1186
|
+
symbol = self.safe_string(symbols, 0)
|
|
1033
1187
|
market = self.market(symbol)
|
|
1034
1188
|
marketIds = self.market_ids(symbols)
|
|
1035
1189
|
request['symbol'] = ','.join(marketIds)
|
|
@@ -1043,22 +1197,20 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1043
1197
|
#
|
|
1044
1198
|
# {
|
|
1045
1199
|
# "code":0,
|
|
1046
|
-
# "data":
|
|
1047
|
-
#
|
|
1048
|
-
#
|
|
1049
|
-
#
|
|
1050
|
-
#
|
|
1051
|
-
#
|
|
1052
|
-
#
|
|
1053
|
-
#
|
|
1054
|
-
#
|
|
1055
|
-
#
|
|
1056
|
-
#
|
|
1057
|
-
# }
|
|
1058
|
-
# ]
|
|
1200
|
+
# "data": {
|
|
1201
|
+
# "symbol":"QTUM/BTC",
|
|
1202
|
+
# "open":"0.00016537",
|
|
1203
|
+
# "close":"0.00019077",
|
|
1204
|
+
# "high":"0.000192",
|
|
1205
|
+
# "low":"0.00016537",
|
|
1206
|
+
# "volume":"846.6",
|
|
1207
|
+
# "ask":["0.00018698","26.2"],
|
|
1208
|
+
# "bid":["0.00018408","503.7"],
|
|
1209
|
+
# "type":"spot"
|
|
1210
|
+
# }
|
|
1059
1211
|
# }
|
|
1060
1212
|
#
|
|
1061
|
-
data = self.
|
|
1213
|
+
data = self.safe_list(response, 'data', [])
|
|
1062
1214
|
if not isinstance(data, list):
|
|
1063
1215
|
return self.parse_tickers([data], symbols)
|
|
1064
1216
|
return self.parse_tickers(data, symbols)
|
|
@@ -1079,7 +1231,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1079
1231
|
# }
|
|
1080
1232
|
# }
|
|
1081
1233
|
#
|
|
1082
|
-
data = self.
|
|
1234
|
+
data = self.safe_dict(ohlcv, 'data', {})
|
|
1083
1235
|
return [
|
|
1084
1236
|
self.safe_integer(data, 'ts'),
|
|
1085
1237
|
self.safe_number(data, 'o'),
|
|
@@ -1097,6 +1249,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1097
1249
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
|
1098
1250
|
:param int [limit]: the maximum amount of candles to fetch
|
|
1099
1251
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1252
|
+
:param int [params.until]: timestamp in ms of the latest candle to fetch
|
|
1100
1253
|
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
|
1101
1254
|
"""
|
|
1102
1255
|
await self.load_markets()
|
|
@@ -1108,17 +1261,30 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1108
1261
|
# if since and limit are not specified
|
|
1109
1262
|
# the exchange will return just 1 last candle by default
|
|
1110
1263
|
duration = self.parse_timeframe(timeframe)
|
|
1111
|
-
options = self.
|
|
1264
|
+
options = self.safe_dict(self.options, 'fetchOHLCV', {})
|
|
1112
1265
|
defaultLimit = self.safe_integer(options, 'limit', 500)
|
|
1266
|
+
until = self.safe_integer(params, 'until')
|
|
1113
1267
|
if since is not None:
|
|
1114
1268
|
request['from'] = since
|
|
1115
1269
|
if limit is None:
|
|
1116
1270
|
limit = defaultLimit
|
|
1117
1271
|
else:
|
|
1118
1272
|
limit = min(limit, defaultLimit)
|
|
1119
|
-
|
|
1273
|
+
toWithLimit = self.sum(since, limit * duration * 1000, 1)
|
|
1274
|
+
if until is not None:
|
|
1275
|
+
request['to'] = min(toWithLimit, until + 1)
|
|
1276
|
+
else:
|
|
1277
|
+
request['to'] = toWithLimit
|
|
1278
|
+
elif until is not None:
|
|
1279
|
+
request['to'] = until + 1
|
|
1280
|
+
if limit is None:
|
|
1281
|
+
limit = defaultLimit
|
|
1282
|
+
else:
|
|
1283
|
+
limit = min(limit, defaultLimit)
|
|
1284
|
+
request['from'] = until - (limit * duration * 1000)
|
|
1120
1285
|
elif limit is not None:
|
|
1121
1286
|
request['n'] = limit # max 500
|
|
1287
|
+
params = self.omit(params, 'until')
|
|
1122
1288
|
response = await self.v1PublicGetBarhist(self.extend(request, params))
|
|
1123
1289
|
#
|
|
1124
1290
|
# {
|
|
@@ -1180,7 +1346,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1180
1346
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
|
1181
1347
|
"""
|
|
1182
1348
|
get the list of most recent trades for a particular symbol
|
|
1183
|
-
|
|
1349
|
+
|
|
1350
|
+
https://ascendex.github.io/ascendex-pro-api/#market-trades
|
|
1351
|
+
|
|
1184
1352
|
:param str symbol: unified symbol of the market to fetch trades for
|
|
1185
1353
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
|
1186
1354
|
:param int [limit]: the maximum amount of trades to fetch
|
|
@@ -1209,7 +1377,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1209
1377
|
# }
|
|
1210
1378
|
# }
|
|
1211
1379
|
#
|
|
1212
|
-
records = self.
|
|
1380
|
+
records = self.safe_dict(response, 'data', {})
|
|
1213
1381
|
trades = self.safe_list(records, 'data', [])
|
|
1214
1382
|
return self.parse_trades(trades, market, since, limit)
|
|
1215
1383
|
|
|
@@ -1236,6 +1404,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1236
1404
|
# "timestamp": 1573576916201
|
|
1237
1405
|
# }
|
|
1238
1406
|
#
|
|
1407
|
+
# & linear(fetchClosedOrders)
|
|
1408
|
+
#
|
|
1239
1409
|
# {
|
|
1240
1410
|
# "ac": "FUTURES",
|
|
1241
1411
|
# "accountId": "fut2ODPhGiY71Pl4vtXnOZ00ssgD7QGn",
|
|
@@ -1243,7 +1413,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1243
1413
|
# "orderId": "a17e0874ecbdU0711043490bbtcpDU5X",
|
|
1244
1414
|
# "seqNum": -1,
|
|
1245
1415
|
# "orderType": "Limit",
|
|
1246
|
-
# "execInst": "NULL_VAL",
|
|
1416
|
+
# "execInst": "NULL_VAL", # NULL_VAL, ReduceOnly , ...
|
|
1247
1417
|
# "side": "Buy",
|
|
1248
1418
|
# "symbol": "BTC-PERP",
|
|
1249
1419
|
# "price": "30000",
|
|
@@ -1332,13 +1502,13 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1332
1502
|
status = self.parse_order_status(self.safe_string(order, 'status'))
|
|
1333
1503
|
marketId = self.safe_string(order, 'symbol')
|
|
1334
1504
|
symbol = self.safe_symbol(marketId, market, '/')
|
|
1335
|
-
timestamp = self.
|
|
1505
|
+
timestamp = self.safe_integer_n(order, ['timestamp', 'sendingTime', 'time'])
|
|
1336
1506
|
lastTradeTimestamp = self.safe_integer(order, 'lastExecTime')
|
|
1337
1507
|
if timestamp is None:
|
|
1338
1508
|
timestamp = lastTradeTimestamp
|
|
1339
1509
|
price = self.safe_string(order, 'price')
|
|
1340
1510
|
amount = self.safe_string(order, 'orderQty')
|
|
1341
|
-
average = self.
|
|
1511
|
+
average = self.safe_string_2(order, 'avgPx', 'avgFilledPx')
|
|
1342
1512
|
filled = self.safe_string_n(order, ['cumFilledQty', 'cumQty', 'fillQty'])
|
|
1343
1513
|
id = self.safe_string(order, 'orderId')
|
|
1344
1514
|
clientOrderId = self.safe_string(order, 'id')
|
|
@@ -1362,13 +1532,13 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1362
1532
|
'cost': feeCost,
|
|
1363
1533
|
'currency': feeCurrencyCode,
|
|
1364
1534
|
}
|
|
1365
|
-
|
|
1535
|
+
triggerPrice = self.omit_zero(self.safe_string(order, 'stopPrice'))
|
|
1366
1536
|
reduceOnly = None
|
|
1367
|
-
execInst = self.
|
|
1368
|
-
if execInst == '
|
|
1537
|
+
execInst = self.safe_string_lower(order, 'execInst')
|
|
1538
|
+
if execInst == 'reduceonly':
|
|
1369
1539
|
reduceOnly = True
|
|
1370
1540
|
postOnly = None
|
|
1371
|
-
if execInst == '
|
|
1541
|
+
if execInst == 'post':
|
|
1372
1542
|
postOnly = True
|
|
1373
1543
|
return self.safe_order({
|
|
1374
1544
|
'info': order,
|
|
@@ -1384,8 +1554,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1384
1554
|
'reduceOnly': reduceOnly,
|
|
1385
1555
|
'side': side,
|
|
1386
1556
|
'price': price,
|
|
1387
|
-
'
|
|
1388
|
-
'triggerPrice': stopPrice,
|
|
1557
|
+
'triggerPrice': triggerPrice,
|
|
1389
1558
|
'amount': amount,
|
|
1390
1559
|
'cost': None,
|
|
1391
1560
|
'average': average,
|
|
@@ -1404,7 +1573,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1404
1573
|
"""
|
|
1405
1574
|
await self.load_markets()
|
|
1406
1575
|
await self.load_accounts()
|
|
1407
|
-
account = self.
|
|
1576
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
1408
1577
|
accountGroup = self.safe_string(account, 'id')
|
|
1409
1578
|
request: dict = {
|
|
1410
1579
|
'account-group': accountGroup,
|
|
@@ -1426,14 +1595,14 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1426
1595
|
# }
|
|
1427
1596
|
# }
|
|
1428
1597
|
#
|
|
1429
|
-
data = self.
|
|
1430
|
-
fees = self.
|
|
1598
|
+
data = self.safe_dict(response, 'data', {})
|
|
1599
|
+
fees = self.safe_list(data, 'fees', [])
|
|
1431
1600
|
result: dict = {}
|
|
1432
1601
|
for i in range(0, len(fees)):
|
|
1433
1602
|
fee = fees[i]
|
|
1434
1603
|
marketId = self.safe_string(fee, 'symbol')
|
|
1435
1604
|
symbol = self.safe_symbol(marketId, None, '/')
|
|
1436
|
-
takerMaker = self.
|
|
1605
|
+
takerMaker = self.safe_dict(fee, 'fee', {})
|
|
1437
1606
|
result[symbol] = {
|
|
1438
1607
|
'info': fee,
|
|
1439
1608
|
'symbol': symbol,
|
|
@@ -1446,17 +1615,17 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1446
1615
|
|
|
1447
1616
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
|
1448
1617
|
"""
|
|
1449
|
-
|
|
1618
|
+
@ignore
|
|
1450
1619
|
helper function to build request
|
|
1451
1620
|
:param str symbol: unified symbol of the market to create an order in
|
|
1452
1621
|
:param str type: 'market' or 'limit'
|
|
1453
1622
|
:param str side: 'buy' or 'sell'
|
|
1454
1623
|
:param float amount: how much you want to trade in units of the base currency
|
|
1455
|
-
:param float [price]: the price at which the order is to be
|
|
1624
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1456
1625
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1457
1626
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
|
1458
1627
|
:param bool [params.postOnly]: True or False
|
|
1459
|
-
:param float [params.
|
|
1628
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
|
1460
1629
|
:returns dict: request to be sent to the exchange
|
|
1461
1630
|
"""
|
|
1462
1631
|
market = self.market(symbol)
|
|
@@ -1464,12 +1633,12 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1464
1633
|
marketType = None
|
|
1465
1634
|
marginMode, params = self.handle_margin_mode_and_params('createOrderRequest', params)
|
|
1466
1635
|
marketType, params = self.handle_market_type_and_params('createOrderRequest', market, params)
|
|
1467
|
-
accountsByType = self.
|
|
1636
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
1468
1637
|
accountCategory = self.safe_string(accountsByType, marketType, 'cash')
|
|
1469
1638
|
if marginMode is not None:
|
|
1470
1639
|
accountCategory = 'margin'
|
|
1471
|
-
account = self.
|
|
1472
|
-
accountGroup = self.
|
|
1640
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
1641
|
+
accountGroup = self.safe_string(account, 'id')
|
|
1473
1642
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'id')
|
|
1474
1643
|
request: dict = {
|
|
1475
1644
|
'account-group': accountGroup,
|
|
@@ -1487,7 +1656,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1487
1656
|
timeInForce = self.safe_string(params, 'timeInForce')
|
|
1488
1657
|
postOnly = self.is_post_only(isMarketOrder, False, params)
|
|
1489
1658
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
|
1490
|
-
|
|
1659
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
|
1491
1660
|
if isLimitOrder:
|
|
1492
1661
|
request['orderPrice'] = self.price_to_precision(symbol, price)
|
|
1493
1662
|
if timeInForce == 'IOC':
|
|
@@ -1496,8 +1665,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1496
1665
|
request['timeInForce'] = 'FOK'
|
|
1497
1666
|
if postOnly:
|
|
1498
1667
|
request['postOnly'] = True
|
|
1499
|
-
if
|
|
1500
|
-
request['stopPrice'] = self.price_to_precision(symbol,
|
|
1668
|
+
if triggerPrice is not None:
|
|
1669
|
+
request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
|
|
1501
1670
|
if isLimitOrder:
|
|
1502
1671
|
request['orderType'] = 'stop_limit'
|
|
1503
1672
|
elif isMarketOrder:
|
|
@@ -1519,17 +1688,19 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1519
1688
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
|
1520
1689
|
"""
|
|
1521
1690
|
create a trade order on the exchange
|
|
1522
|
-
|
|
1523
|
-
|
|
1691
|
+
|
|
1692
|
+
https://ascendex.github.io/ascendex-pro-api/#place-order
|
|
1693
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#new-order
|
|
1694
|
+
|
|
1524
1695
|
:param str symbol: unified CCXT market symbol
|
|
1525
1696
|
:param str type: "limit" or "market"
|
|
1526
1697
|
:param str side: "buy" or "sell"
|
|
1527
1698
|
:param float amount: the amount of currency to trade
|
|
1528
|
-
:param float [price]:
|
|
1699
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1529
1700
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1530
1701
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
|
1531
1702
|
:param bool [params.postOnly]: True or False
|
|
1532
|
-
:param float [params.
|
|
1703
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
|
1533
1704
|
:param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered(perpetual swap markets only)
|
|
1534
1705
|
:param float [params.takeProfit.triggerPrice]: *swap only* take profit trigger price
|
|
1535
1706
|
:param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered(perpetual swap markets only)
|
|
@@ -1608,20 +1779,22 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1608
1779
|
# }
|
|
1609
1780
|
# }
|
|
1610
1781
|
#
|
|
1611
|
-
data = self.
|
|
1612
|
-
order = self.
|
|
1782
|
+
data = self.safe_dict(response, 'data', {})
|
|
1783
|
+
order = self.safe_dict_2(data, 'order', 'info', {})
|
|
1613
1784
|
return self.parse_order(order, market)
|
|
1614
1785
|
|
|
1615
1786
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
|
1616
1787
|
"""
|
|
1617
1788
|
create a list of trade orders
|
|
1618
|
-
|
|
1619
|
-
|
|
1789
|
+
|
|
1790
|
+
https://ascendex.github.io/ascendex-pro-api/#place-batch-orders
|
|
1791
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#place-batch-orders
|
|
1792
|
+
|
|
1620
1793
|
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
1621
1794
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1622
1795
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK", or "PO"
|
|
1623
1796
|
:param bool [params.postOnly]: True or False
|
|
1624
|
-
:param float [params.
|
|
1797
|
+
:param float [params.triggerPrice]: the price at which a trigger order is triggered at
|
|
1625
1798
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
1626
1799
|
"""
|
|
1627
1800
|
await self.load_markets()
|
|
@@ -1639,9 +1812,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1639
1812
|
raise BadRequest(self.id + ' createOrders() requires all orders to have the same symbol')
|
|
1640
1813
|
type = self.safe_string(rawOrder, 'type')
|
|
1641
1814
|
side = self.safe_string(rawOrder, 'side')
|
|
1642
|
-
amount = self.
|
|
1643
|
-
price = self.
|
|
1644
|
-
orderParams = self.
|
|
1815
|
+
amount = self.safe_number(rawOrder, 'amount')
|
|
1816
|
+
price = self.safe_number(rawOrder, 'price')
|
|
1817
|
+
orderParams = self.safe_dict(rawOrder, 'params', {})
|
|
1645
1818
|
marginResult = self.handle_margin_mode_and_params('createOrders', orderParams)
|
|
1646
1819
|
currentMarginMode = marginResult[0]
|
|
1647
1820
|
if currentMarginMode is not None:
|
|
@@ -1653,12 +1826,12 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1653
1826
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
|
1654
1827
|
ordersRequests.append(orderRequest)
|
|
1655
1828
|
market = self.market(symbol)
|
|
1656
|
-
accountsByType = self.
|
|
1829
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
1657
1830
|
accountCategory = self.safe_string(accountsByType, market['type'], 'cash')
|
|
1658
1831
|
if marginMode is not None:
|
|
1659
1832
|
accountCategory = 'margin'
|
|
1660
|
-
account = self.
|
|
1661
|
-
accountGroup = self.
|
|
1833
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
1834
|
+
accountGroup = self.safe_string(account, 'id')
|
|
1662
1835
|
request: dict = {}
|
|
1663
1836
|
response = None
|
|
1664
1837
|
if market['swap']:
|
|
@@ -1694,15 +1867,18 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1694
1867
|
# }
|
|
1695
1868
|
# }
|
|
1696
1869
|
#
|
|
1697
|
-
data = self.
|
|
1870
|
+
data = self.safe_dict(response, 'data', {})
|
|
1698
1871
|
info = self.safe_list(data, 'info', [])
|
|
1699
1872
|
return self.parse_orders(info, market)
|
|
1700
1873
|
|
|
1701
1874
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
|
1702
1875
|
"""
|
|
1703
1876
|
fetches information on an order made by the user
|
|
1704
|
-
|
|
1705
|
-
|
|
1877
|
+
|
|
1878
|
+
https://ascendex.github.io/ascendex-pro-api/#query-order
|
|
1879
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#query-order-by-id
|
|
1880
|
+
|
|
1881
|
+
:param str id: the order id
|
|
1706
1882
|
:param str symbol: unified symbol of the market the order was made in
|
|
1707
1883
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1708
1884
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
@@ -1713,10 +1889,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1713
1889
|
if symbol is not None:
|
|
1714
1890
|
market = self.market(symbol)
|
|
1715
1891
|
type, query = self.handle_market_type_and_params('fetchOrder', market, params)
|
|
1716
|
-
accountsByType = self.
|
|
1892
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
1717
1893
|
accountCategory = self.safe_string(accountsByType, type, 'cash')
|
|
1718
|
-
account = self.
|
|
1719
|
-
accountGroup = self.
|
|
1894
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
1895
|
+
accountGroup = self.safe_string(account, 'id')
|
|
1720
1896
|
request: dict = {
|
|
1721
1897
|
'account-group': accountGroup,
|
|
1722
1898
|
'account-category': accountCategory,
|
|
@@ -1803,8 +1979,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1803
1979
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
1804
1980
|
"""
|
|
1805
1981
|
fetch all unfilled currently open orders
|
|
1806
|
-
|
|
1807
|
-
|
|
1982
|
+
|
|
1983
|
+
https://ascendex.github.io/ascendex-pro-api/#list-open-orders
|
|
1984
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#list-open-orders
|
|
1985
|
+
|
|
1808
1986
|
:param str symbol: unified market symbol
|
|
1809
1987
|
:param int [since]: the earliest time in ms to fetch open orders for
|
|
1810
1988
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
|
@@ -1817,10 +1995,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1817
1995
|
if symbol is not None:
|
|
1818
1996
|
market = self.market(symbol)
|
|
1819
1997
|
symbol = market['symbol']
|
|
1820
|
-
account = self.
|
|
1821
|
-
accountGroup = self.
|
|
1998
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
1999
|
+
accountGroup = self.safe_string(account, 'id')
|
|
1822
2000
|
type, query = self.handle_market_type_and_params('fetchOpenOrders', market, params)
|
|
1823
|
-
accountsByType = self.
|
|
2001
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
1824
2002
|
accountCategory = self.safe_string(accountsByType, type, 'cash')
|
|
1825
2003
|
request: dict = {
|
|
1826
2004
|
'account-group': accountGroup,
|
|
@@ -1843,7 +2021,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1843
2021
|
# "code": 0,
|
|
1844
2022
|
# "data": [
|
|
1845
2023
|
# {
|
|
1846
|
-
# "avgPx": "0",
|
|
2024
|
+
# "avgPx": "0", # Average filled price of the order
|
|
1847
2025
|
# "cumFee": "0", # cumulative fee paid for self order
|
|
1848
2026
|
# "cumFilledQty": "0", # cumulative filled quantity
|
|
1849
2027
|
# "errorCode": "", # error code; could be empty
|
|
@@ -1901,7 +2079,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1901
2079
|
# ]
|
|
1902
2080
|
# }
|
|
1903
2081
|
#
|
|
1904
|
-
data = self.
|
|
2082
|
+
data = self.safe_list(response, 'data', [])
|
|
1905
2083
|
if accountCategory == 'futures':
|
|
1906
2084
|
return self.parse_orders(data, market, since, limit)
|
|
1907
2085
|
# a workaround for https://github.com/ccxt/ccxt/issues/7187
|
|
@@ -1914,8 +2092,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1914
2092
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
1915
2093
|
"""
|
|
1916
2094
|
fetches information on multiple closed orders made by the user
|
|
1917
|
-
|
|
1918
|
-
|
|
2095
|
+
|
|
2096
|
+
https://ascendex.github.io/ascendex-pro-api/#list-history-orders-v2
|
|
2097
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#list-current-history-orders
|
|
2098
|
+
|
|
1919
2099
|
:param str symbol: unified market symbol of the market orders were made in
|
|
1920
2100
|
:param int [since]: the earliest time in ms to fetch orders for
|
|
1921
2101
|
:param int [limit]: the maximum number of order structures to retrieve
|
|
@@ -1925,8 +2105,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1925
2105
|
"""
|
|
1926
2106
|
await self.load_markets()
|
|
1927
2107
|
await self.load_accounts()
|
|
1928
|
-
account = self.
|
|
1929
|
-
accountGroup = self.
|
|
2108
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2109
|
+
accountGroup = self.safe_string(account, 'id')
|
|
1930
2110
|
request: dict = {
|
|
1931
2111
|
# 'category': accountCategory,
|
|
1932
2112
|
# 'symbol': market['id'],
|
|
@@ -1943,7 +2123,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1943
2123
|
market = self.market(symbol)
|
|
1944
2124
|
request['symbol'] = market['id']
|
|
1945
2125
|
type, query = self.handle_market_type_and_params('fetchClosedOrders', market, params)
|
|
1946
|
-
options = self.
|
|
2126
|
+
options = self.safe_dict(self.options, 'fetchClosedOrders', {})
|
|
1947
2127
|
defaultMethod = self.safe_string(options, 'method', 'v2PrivateDataGetOrderHist')
|
|
1948
2128
|
method = self.get_supported_mapping(type, {
|
|
1949
2129
|
'spot': defaultMethod,
|
|
@@ -1955,7 +2135,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
1955
2135
|
until = self.safe_string(params, 'until')
|
|
1956
2136
|
if until is not None:
|
|
1957
2137
|
request['endTime'] = until
|
|
1958
|
-
accountsByType = self.
|
|
2138
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
1959
2139
|
accountCategory = self.safe_string(accountsByType, type, 'cash') # margin, futures
|
|
1960
2140
|
response = None
|
|
1961
2141
|
if method == 'v1PrivateAccountCategoryGetOrderHistCurrent':
|
|
@@ -2068,17 +2248,18 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2068
2248
|
# ]
|
|
2069
2249
|
# }
|
|
2070
2250
|
#
|
|
2071
|
-
data = self.
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
data = self.safe_value(data, 'data', [])
|
|
2251
|
+
data = self.safe_list(response, 'data', [])
|
|
2252
|
+
if not isinstance(data, list):
|
|
2253
|
+
data = self.safe_list(data, 'data', [])
|
|
2075
2254
|
return self.parse_orders(data, market, since, limit)
|
|
2076
2255
|
|
|
2077
2256
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
|
2078
2257
|
"""
|
|
2079
2258
|
cancels an open order
|
|
2080
|
-
|
|
2081
|
-
|
|
2259
|
+
|
|
2260
|
+
https://ascendex.github.io/ascendex-pro-api/#cancel-order
|
|
2261
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#cancel-order
|
|
2262
|
+
|
|
2082
2263
|
:param str id: order id
|
|
2083
2264
|
:param str symbol: unified symbol of the market the order was made in
|
|
2084
2265
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -2090,10 +2271,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2090
2271
|
await self.load_accounts()
|
|
2091
2272
|
market = self.market(symbol)
|
|
2092
2273
|
type, query = self.handle_market_type_and_params('cancelOrder', market, params)
|
|
2093
|
-
accountsByType = self.
|
|
2274
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
2094
2275
|
accountCategory = self.safe_string(accountsByType, type, 'cash')
|
|
2095
|
-
account = self.
|
|
2096
|
-
accountGroup = self.
|
|
2276
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2277
|
+
accountGroup = self.safe_string(account, 'id')
|
|
2097
2278
|
request: dict = {
|
|
2098
2279
|
'account-group': accountGroup,
|
|
2099
2280
|
'account-category': accountCategory,
|
|
@@ -2178,18 +2359,20 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2178
2359
|
# }
|
|
2179
2360
|
# }
|
|
2180
2361
|
#
|
|
2181
|
-
data = self.
|
|
2182
|
-
order = self.
|
|
2362
|
+
data = self.safe_dict(response, 'data', {})
|
|
2363
|
+
order = self.safe_dict_2(data, 'order', 'info', {})
|
|
2183
2364
|
return self.parse_order(order, market)
|
|
2184
2365
|
|
|
2185
2366
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
|
2186
2367
|
"""
|
|
2187
2368
|
cancel all open orders
|
|
2188
|
-
|
|
2189
|
-
|
|
2369
|
+
|
|
2370
|
+
https://ascendex.github.io/ascendex-pro-api/#cancel-all-orders
|
|
2371
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#cancel-all-open-orders
|
|
2372
|
+
|
|
2190
2373
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
|
2191
2374
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2192
|
-
:returns dict[]: a list
|
|
2375
|
+
:returns dict[]: a list with a single `order structure <https://docs.ccxt.com/#/?id=order-structure>` with the response assigned to the info property
|
|
2193
2376
|
"""
|
|
2194
2377
|
await self.load_markets()
|
|
2195
2378
|
await self.load_accounts()
|
|
@@ -2197,10 +2380,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2197
2380
|
if symbol is not None:
|
|
2198
2381
|
market = self.market(symbol)
|
|
2199
2382
|
type, query = self.handle_market_type_and_params('cancelAllOrders', market, params)
|
|
2200
|
-
accountsByType = self.
|
|
2383
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
2201
2384
|
accountCategory = self.safe_string(accountsByType, type, 'cash')
|
|
2202
|
-
account = self.
|
|
2203
|
-
accountGroup = self.
|
|
2385
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2386
|
+
accountGroup = self.safe_string(account, 'id')
|
|
2204
2387
|
request: dict = {
|
|
2205
2388
|
'account-group': accountGroup,
|
|
2206
2389
|
'account-category': accountCategory,
|
|
@@ -2250,9 +2433,11 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2250
2433
|
# }
|
|
2251
2434
|
# }
|
|
2252
2435
|
#
|
|
2253
|
-
return
|
|
2436
|
+
return [self.safe_order({
|
|
2437
|
+
'info': response,
|
|
2438
|
+
})]
|
|
2254
2439
|
|
|
2255
|
-
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
|
2440
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
|
|
2256
2441
|
#
|
|
2257
2442
|
# {
|
|
2258
2443
|
# "address": "0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722",
|
|
@@ -2274,21 +2459,19 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2274
2459
|
chainName = self.safe_string(depositAddress, 'blockchain')
|
|
2275
2460
|
network = self.network_id_to_code(chainName, code)
|
|
2276
2461
|
return {
|
|
2462
|
+
'info': depositAddress,
|
|
2277
2463
|
'currency': code,
|
|
2464
|
+
'network': network,
|
|
2278
2465
|
'address': address,
|
|
2279
2466
|
'tag': tag,
|
|
2280
|
-
'network': network,
|
|
2281
|
-
'info': depositAddress,
|
|
2282
2467
|
}
|
|
2283
2468
|
|
|
2284
|
-
def
|
|
2285
|
-
networksById = self.safe_dict(self.options, 'networksById')
|
|
2286
|
-
return self.safe_string(networksById, networkId, networkId)
|
|
2287
|
-
|
|
2288
|
-
async def fetch_deposit_address(self, code: str, params={}):
|
|
2469
|
+
async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
|
2289
2470
|
"""
|
|
2290
2471
|
fetch the deposit address for a currency associated with self account
|
|
2291
|
-
|
|
2472
|
+
|
|
2473
|
+
https://ascendex.github.io/ascendex-pro-api/#query-deposit-addresses
|
|
2474
|
+
|
|
2292
2475
|
:param str code: unified currency code
|
|
2293
2476
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2294
2477
|
:param str [params.network]: unified network code for deposit chain
|
|
@@ -2436,7 +2619,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2436
2619
|
# }
|
|
2437
2620
|
# }
|
|
2438
2621
|
#
|
|
2439
|
-
data = self.
|
|
2622
|
+
data = self.safe_dict(response, 'data', {})
|
|
2440
2623
|
transactions = self.safe_list(data, 'data', [])
|
|
2441
2624
|
return self.parse_transactions(transactions, currency, since, limit)
|
|
2442
2625
|
|
|
@@ -2468,7 +2651,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2468
2651
|
# }
|
|
2469
2652
|
# }
|
|
2470
2653
|
#
|
|
2471
|
-
destAddress = self.
|
|
2654
|
+
destAddress = self.safe_dict(transaction, 'destAddress', {})
|
|
2472
2655
|
address = self.safe_string(destAddress, 'address')
|
|
2473
2656
|
tag = self.safe_string(destAddress, 'destTag')
|
|
2474
2657
|
timestamp = self.safe_integer(transaction, 'time')
|
|
@@ -2504,7 +2687,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2504
2687
|
'internal': False,
|
|
2505
2688
|
}
|
|
2506
2689
|
|
|
2507
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
|
2690
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
|
2508
2691
|
"""
|
|
2509
2692
|
fetch all open positions
|
|
2510
2693
|
:param str[]|None symbols: list of unified market symbols
|
|
@@ -2513,7 +2696,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2513
2696
|
"""
|
|
2514
2697
|
await self.load_markets()
|
|
2515
2698
|
await self.load_accounts()
|
|
2516
|
-
account = self.
|
|
2699
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2517
2700
|
accountGroup = self.safe_string(account, 'id')
|
|
2518
2701
|
request: dict = {
|
|
2519
2702
|
'account-group': accountGroup,
|
|
@@ -2558,8 +2741,8 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2558
2741
|
# }
|
|
2559
2742
|
# }
|
|
2560
2743
|
#
|
|
2561
|
-
data = self.
|
|
2562
|
-
position = self.
|
|
2744
|
+
data = self.safe_dict(response, 'data', {})
|
|
2745
|
+
position = self.safe_list(data, 'contracts', [])
|
|
2563
2746
|
result = []
|
|
2564
2747
|
for i in range(0, len(position)):
|
|
2565
2748
|
result.append(self.parse_position(position[i]))
|
|
@@ -2629,7 +2812,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2629
2812
|
'takeProfitPrice': self.safe_number(position, 'takeProfitPrice'),
|
|
2630
2813
|
})
|
|
2631
2814
|
|
|
2632
|
-
def parse_funding_rate(self, contract, market: Market = None):
|
|
2815
|
+
def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
|
|
2633
2816
|
#
|
|
2634
2817
|
# {
|
|
2635
2818
|
# "time": 1640061364830,
|
|
@@ -2664,14 +2847,15 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2664
2847
|
'fundingRate': nextFundingRate,
|
|
2665
2848
|
'fundingTimestamp': nextFundingRateTimestamp,
|
|
2666
2849
|
'fundingDatetime': self.iso8601(nextFundingRateTimestamp),
|
|
2850
|
+
'interval': None,
|
|
2667
2851
|
}
|
|
2668
2852
|
|
|
2669
|
-
async def fetch_funding_rates(self, symbols: Strings = None, params={}):
|
|
2853
|
+
async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
|
2670
2854
|
"""
|
|
2671
2855
|
fetch the funding rate for multiple markets
|
|
2672
2856
|
:param str[]|None symbols: list of unified market symbols
|
|
2673
2857
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2674
|
-
:returns dict: a
|
|
2858
|
+
:returns dict[]: a list of `funding rates structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexe by market symbols
|
|
2675
2859
|
"""
|
|
2676
2860
|
await self.load_markets()
|
|
2677
2861
|
symbols = self.market_symbols(symbols)
|
|
@@ -2700,16 +2884,15 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2700
2884
|
# }
|
|
2701
2885
|
# }
|
|
2702
2886
|
#
|
|
2703
|
-
data = self.
|
|
2704
|
-
contracts = self.
|
|
2705
|
-
|
|
2706
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
|
2887
|
+
data = self.safe_dict(response, 'data', {})
|
|
2888
|
+
contracts = self.safe_list(data, 'contracts', [])
|
|
2889
|
+
return self.parse_funding_rates(contracts, symbols)
|
|
2707
2890
|
|
|
2708
2891
|
async def modify_margin_helper(self, symbol: str, amount, type, params={}) -> MarginModification:
|
|
2709
2892
|
await self.load_markets()
|
|
2710
2893
|
await self.load_accounts()
|
|
2711
2894
|
market = self.market(symbol)
|
|
2712
|
-
account = self.
|
|
2895
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2713
2896
|
accountGroup = self.safe_string(account, 'id')
|
|
2714
2897
|
amount = self.amount_to_precision(symbol, amount)
|
|
2715
2898
|
request: dict = {
|
|
@@ -2775,10 +2958,12 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2775
2958
|
"""
|
|
2776
2959
|
return await self.modify_margin_helper(symbol, amount, 'add', params)
|
|
2777
2960
|
|
|
2778
|
-
async def set_leverage(self, leverage:
|
|
2961
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
|
2779
2962
|
"""
|
|
2780
2963
|
set the level of leverage for a market
|
|
2781
|
-
|
|
2964
|
+
|
|
2965
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#change-contract-leverage
|
|
2966
|
+
|
|
2782
2967
|
:param float leverage: the rate of leverage
|
|
2783
2968
|
:param str symbol: unified market symbol
|
|
2784
2969
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -2793,7 +2978,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2793
2978
|
market = self.market(symbol)
|
|
2794
2979
|
if not market['swap']:
|
|
2795
2980
|
raise BadSymbol(self.id + ' setLeverage() supports swap contracts only')
|
|
2796
|
-
account = self.
|
|
2981
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2797
2982
|
accountGroup = self.safe_string(account, 'id')
|
|
2798
2983
|
request: dict = {
|
|
2799
2984
|
'account-group': accountGroup,
|
|
@@ -2805,7 +2990,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2805
2990
|
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
|
2806
2991
|
"""
|
|
2807
2992
|
set margin mode to 'cross' or 'isolated'
|
|
2808
|
-
|
|
2993
|
+
|
|
2994
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#change-margin-type
|
|
2995
|
+
|
|
2809
2996
|
:param str marginMode: 'cross' or 'isolated'
|
|
2810
2997
|
:param str symbol: unified market symbol
|
|
2811
2998
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -2821,7 +3008,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2821
3008
|
await self.load_markets()
|
|
2822
3009
|
await self.load_accounts()
|
|
2823
3010
|
market = self.market(symbol)
|
|
2824
|
-
account = self.
|
|
3011
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2825
3012
|
accountGroup = self.safe_string(account, 'id')
|
|
2826
3013
|
request: dict = {
|
|
2827
3014
|
'account-group': accountGroup,
|
|
@@ -2869,7 +3056,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2869
3056
|
# ]
|
|
2870
3057
|
# }
|
|
2871
3058
|
#
|
|
2872
|
-
data = self.
|
|
3059
|
+
data = self.safe_list(response, 'data', [])
|
|
2873
3060
|
symbols = self.market_symbols(symbols)
|
|
2874
3061
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
|
2875
3062
|
|
|
@@ -2901,15 +3088,16 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2901
3088
|
# ]
|
|
2902
3089
|
# }
|
|
2903
3090
|
#
|
|
2904
|
-
marginRequirements = self.
|
|
2905
|
-
|
|
2906
|
-
market = self.safe_market(
|
|
3091
|
+
marginRequirements = self.safe_list(info, 'marginRequirements', [])
|
|
3092
|
+
marketId = self.safe_string(info, 'symbol')
|
|
3093
|
+
market = self.safe_market(marketId, market)
|
|
2907
3094
|
tiers = []
|
|
2908
3095
|
for i in range(0, len(marginRequirements)):
|
|
2909
3096
|
tier = marginRequirements[i]
|
|
2910
3097
|
initialMarginRate = self.safe_string(tier, 'initialMarginRate')
|
|
2911
3098
|
tiers.append({
|
|
2912
3099
|
'tier': self.sum(i, 1),
|
|
3100
|
+
'symbol': self.safe_symbol(marketId, market, None, 'contract'),
|
|
2913
3101
|
'currency': market['quote'],
|
|
2914
3102
|
'minNotional': self.safe_number(tier, 'positionNotionalLowerBound'),
|
|
2915
3103
|
'maxNotional': self.safe_number(tier, 'positionNotionalUpperBound'),
|
|
@@ -2939,7 +3127,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2939
3127
|
# ]
|
|
2940
3128
|
# }
|
|
2941
3129
|
#
|
|
2942
|
-
blockChains = self.
|
|
3130
|
+
blockChains = self.safe_list(fee, 'blockChain', [])
|
|
2943
3131
|
blockChainsLength = len(blockChains)
|
|
2944
3132
|
result: dict = {
|
|
2945
3133
|
'info': fee,
|
|
@@ -2970,7 +3158,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2970
3158
|
async def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
|
2971
3159
|
"""
|
|
2972
3160
|
fetch deposit and withdraw fees
|
|
2973
|
-
|
|
3161
|
+
|
|
3162
|
+
https://ascendex.github.io/ascendex-pro-api/#list-all-assets
|
|
3163
|
+
|
|
2974
3164
|
:param str[]|None codes: list of unified currency codes
|
|
2975
3165
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2976
3166
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
|
@@ -2992,10 +3182,10 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
2992
3182
|
"""
|
|
2993
3183
|
await self.load_markets()
|
|
2994
3184
|
await self.load_accounts()
|
|
2995
|
-
account = self.
|
|
3185
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
2996
3186
|
accountGroup = self.safe_string(account, 'id')
|
|
2997
3187
|
currency = self.currency(code)
|
|
2998
|
-
accountsByType = self.
|
|
3188
|
+
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
|
2999
3189
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
|
3000
3190
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
|
3001
3191
|
if fromId != 'cash' and toId != 'cash':
|
|
@@ -3011,7 +3201,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
3011
3201
|
#
|
|
3012
3202
|
# {"code": "0"}
|
|
3013
3203
|
#
|
|
3014
|
-
transferOptions = self.
|
|
3204
|
+
transferOptions = self.safe_dict(self.options, 'transfer', {})
|
|
3015
3205
|
fillResponseFromRequest = self.safe_bool(transferOptions, 'fillResponseFromRequest', True)
|
|
3016
3206
|
transfer = self.parse_transfer(response, currency)
|
|
3017
3207
|
if fillResponseFromRequest:
|
|
@@ -3047,7 +3237,9 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
3047
3237
|
async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
3048
3238
|
"""
|
|
3049
3239
|
fetch the history of funding payments paid and received on self account
|
|
3050
|
-
|
|
3240
|
+
|
|
3241
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#funding-payment-history
|
|
3242
|
+
|
|
3051
3243
|
:param str [symbol]: unified market symbol
|
|
3052
3244
|
:param int [since]: the earliest time in ms to fetch funding history for
|
|
3053
3245
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
|
@@ -3061,7 +3253,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
3061
3253
|
paginate, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'paginate')
|
|
3062
3254
|
if paginate:
|
|
3063
3255
|
return await self.fetch_paginated_call_incremental('fetchFundingHistory', symbol, since, limit, params, 'page', 25)
|
|
3064
|
-
account = self.
|
|
3256
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
3065
3257
|
accountGroup = self.safe_string(account, 'id')
|
|
3066
3258
|
request: dict = {
|
|
3067
3259
|
'account-group': accountGroup,
|
|
@@ -3091,7 +3283,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
3091
3283
|
# }
|
|
3092
3284
|
# }
|
|
3093
3285
|
#
|
|
3094
|
-
data = self.
|
|
3286
|
+
data = self.safe_dict(response, 'data', {})
|
|
3095
3287
|
rows = self.safe_list(data, 'data', [])
|
|
3096
3288
|
return self.parse_incomes(rows, market, since, limit)
|
|
3097
3289
|
|
|
@@ -3119,14 +3311,16 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
3119
3311
|
async def fetch_margin_modes(self, symbols: Strings = None, params={}) -> MarginModes:
|
|
3120
3312
|
"""
|
|
3121
3313
|
fetches the set margin mode of the user
|
|
3122
|
-
|
|
3314
|
+
|
|
3315
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
|
3316
|
+
|
|
3123
3317
|
:param str[] [symbols]: a list of unified market symbols
|
|
3124
3318
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
3125
3319
|
:returns dict: a list of `margin mode structures <https://docs.ccxt.com/#/?id=margin-mode-structure>`
|
|
3126
3320
|
"""
|
|
3127
3321
|
await self.load_markets()
|
|
3128
3322
|
await self.load_accounts()
|
|
3129
|
-
account = self.
|
|
3323
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
3130
3324
|
accountGroup = self.safe_string(account, 'id')
|
|
3131
3325
|
request: dict = {
|
|
3132
3326
|
'account-group': accountGroup,
|
|
@@ -3188,14 +3382,16 @@ class ascendex(Exchange, ImplicitAPI):
|
|
|
3188
3382
|
async def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
|
3189
3383
|
"""
|
|
3190
3384
|
fetch the set leverage for all contract markets
|
|
3191
|
-
|
|
3385
|
+
|
|
3386
|
+
https://ascendex.github.io/ascendex-futures-pro-api-v2/#position
|
|
3387
|
+
|
|
3192
3388
|
:param str[] [symbols]: a list of unified market symbols
|
|
3193
3389
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
3194
3390
|
:returns dict: a list of `leverage structures <https://docs.ccxt.com/#/?id=leverage-structure>`
|
|
3195
3391
|
"""
|
|
3196
3392
|
await self.load_markets()
|
|
3197
3393
|
await self.load_accounts()
|
|
3198
|
-
account = self.
|
|
3394
|
+
account = self.safe_dict(self.accounts, 0, {})
|
|
3199
3395
|
accountGroup = self.safe_string(account, 'id')
|
|
3200
3396
|
request: dict = {
|
|
3201
3397
|
'account-group': accountGroup,
|