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