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/woofipro.py
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.woofipro import ImplicitAPI
|
|
8
|
-
|
|
8
|
+
import asyncio
|
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, FundingRate, FundingRates, Trade, TradingFees, Transaction
|
|
9
10
|
from typing import List
|
|
10
|
-
from typing import Any
|
|
11
11
|
from ccxt.base.errors import ExchangeError
|
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
|
13
13
|
from ccxt.base.errors import ArgumentsRequired
|
|
@@ -23,7 +23,7 @@ from ccxt.base.precise import Precise
|
|
|
23
23
|
|
|
24
24
|
class woofipro(Exchange, ImplicitAPI):
|
|
25
25
|
|
|
26
|
-
def describe(self):
|
|
26
|
+
def describe(self) -> Any:
|
|
27
27
|
return self.deep_extend(super(woofipro, self).describe(), {
|
|
28
28
|
'id': 'woofipro',
|
|
29
29
|
'name': 'WOOFI PRO',
|
|
@@ -77,6 +77,8 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
77
77
|
'fetchDeposits': True,
|
|
78
78
|
'fetchDepositsWithdrawals': True,
|
|
79
79
|
'fetchFundingHistory': True,
|
|
80
|
+
'fetchFundingInterval': True,
|
|
81
|
+
'fetchFundingIntervals': False,
|
|
80
82
|
'fetchFundingRate': True,
|
|
81
83
|
'fetchFundingRateHistory': True,
|
|
82
84
|
'fetchFundingRates': True,
|
|
@@ -131,7 +133,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
131
133
|
'1y': '1y',
|
|
132
134
|
},
|
|
133
135
|
'urls': {
|
|
134
|
-
'logo': 'https://github.com/
|
|
136
|
+
'logo': 'https://github.com/user-attachments/assets/9ba21b8a-a9c7-4770-b7f1-ce3bcbde68c1',
|
|
135
137
|
'api': {
|
|
136
138
|
'public': 'https://api-evm.orderly.org',
|
|
137
139
|
'private': 'https://api-evm.orderly.org',
|
|
@@ -306,6 +308,95 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
306
308
|
'brokerId': 'CCXT',
|
|
307
309
|
'verifyingContractAddress': '0x6F7a338F2aA472838dEFD3283eB360d4Dff5D203',
|
|
308
310
|
},
|
|
311
|
+
'features': {
|
|
312
|
+
'default': {
|
|
313
|
+
'sandbox': True,
|
|
314
|
+
'createOrder': {
|
|
315
|
+
'marginMode': False,
|
|
316
|
+
'triggerPrice': True,
|
|
317
|
+
'triggerPriceType': None,
|
|
318
|
+
'triggerDirection': False,
|
|
319
|
+
'stopLossPrice': False, # todo by triggerPrice
|
|
320
|
+
'takeProfitPrice': False, # todo by triggerPrice
|
|
321
|
+
'attachedStopLossTakeProfit': None,
|
|
322
|
+
'timeInForce': {
|
|
323
|
+
'IOC': True,
|
|
324
|
+
'FOK': True,
|
|
325
|
+
'PO': True,
|
|
326
|
+
'GTD': False,
|
|
327
|
+
},
|
|
328
|
+
'hedged': False,
|
|
329
|
+
'trailing': True,
|
|
330
|
+
'leverage': True, # todo implement
|
|
331
|
+
'marketBuyByCost': False,
|
|
332
|
+
'marketBuyRequiresPrice': False,
|
|
333
|
+
'selfTradePrevention': False,
|
|
334
|
+
'iceberg': True, # todo implement
|
|
335
|
+
},
|
|
336
|
+
'createOrders': {
|
|
337
|
+
'max': 10,
|
|
338
|
+
},
|
|
339
|
+
'fetchMyTrades': {
|
|
340
|
+
'marginMode': False,
|
|
341
|
+
'limit': 500,
|
|
342
|
+
'daysBack': None,
|
|
343
|
+
'untilDays': 100000,
|
|
344
|
+
'symbolRequired': False,
|
|
345
|
+
},
|
|
346
|
+
'fetchOrder': {
|
|
347
|
+
'marginMode': False,
|
|
348
|
+
'trigger': True,
|
|
349
|
+
'trailing': False,
|
|
350
|
+
'symbolRequired': False,
|
|
351
|
+
},
|
|
352
|
+
'fetchOpenOrders': {
|
|
353
|
+
'marginMode': False,
|
|
354
|
+
'limit': 500,
|
|
355
|
+
'trigger': True,
|
|
356
|
+
'trailing': False,
|
|
357
|
+
'symbolRequired': False,
|
|
358
|
+
},
|
|
359
|
+
'fetchOrders': None,
|
|
360
|
+
'fetchClosedOrders': {
|
|
361
|
+
'marginMode': False,
|
|
362
|
+
'limit': 500,
|
|
363
|
+
'daysBack': None,
|
|
364
|
+
'daysBackCanceled': None,
|
|
365
|
+
'untilDays': 100000,
|
|
366
|
+
'trigger': True,
|
|
367
|
+
'trailing': False,
|
|
368
|
+
'symbolRequired': False,
|
|
369
|
+
},
|
|
370
|
+
'fetchOHLCV': {
|
|
371
|
+
'limit': 1000,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
'spot': {
|
|
375
|
+
'extends': 'default',
|
|
376
|
+
},
|
|
377
|
+
'forDerivatives': {
|
|
378
|
+
'extends': 'default',
|
|
379
|
+
'createOrder': {
|
|
380
|
+
# todo: implementation needs unification
|
|
381
|
+
'triggerPriceType': None,
|
|
382
|
+
'attachedStopLossTakeProfit': {
|
|
383
|
+
# todo: implementation needs unification
|
|
384
|
+
'triggerPriceType': None,
|
|
385
|
+
'price': False,
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
'swap': {
|
|
390
|
+
'linear': {
|
|
391
|
+
'extends': 'forDerivatives',
|
|
392
|
+
},
|
|
393
|
+
'inverse': None,
|
|
394
|
+
},
|
|
395
|
+
'future': {
|
|
396
|
+
'linear': None,
|
|
397
|
+
'inverse': None,
|
|
398
|
+
},
|
|
399
|
+
},
|
|
309
400
|
'commonCurrencies': {},
|
|
310
401
|
'exceptions': {
|
|
311
402
|
'exact': {
|
|
@@ -347,7 +438,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
347
438
|
async def fetch_status(self, params={}):
|
|
348
439
|
"""
|
|
349
440
|
the latest known information on the availability of the exchange API
|
|
350
|
-
|
|
441
|
+
|
|
442
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-system-maintenance-status
|
|
443
|
+
|
|
351
444
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
352
445
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
|
353
446
|
"""
|
|
@@ -378,10 +471,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
378
471
|
'info': response,
|
|
379
472
|
}
|
|
380
473
|
|
|
381
|
-
async def fetch_time(self, params={}):
|
|
474
|
+
async def fetch_time(self, params={}) -> Int:
|
|
382
475
|
"""
|
|
383
476
|
fetches the current integer timestamp in milliseconds from the exchange server
|
|
384
|
-
|
|
477
|
+
|
|
478
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-system-maintenance-status
|
|
479
|
+
|
|
385
480
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
386
481
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
|
387
482
|
"""
|
|
@@ -454,7 +549,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
454
549
|
'active': None,
|
|
455
550
|
'contract': True,
|
|
456
551
|
'linear': True,
|
|
457
|
-
'inverse':
|
|
552
|
+
'inverse': False,
|
|
458
553
|
'contractSize': self.parse_number('1'),
|
|
459
554
|
'expiry': None,
|
|
460
555
|
'expiryDatetime': None,
|
|
@@ -489,7 +584,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
489
584
|
async def fetch_markets(self, params={}) -> List[Market]:
|
|
490
585
|
"""
|
|
491
586
|
retrieves data on all markets for woofipro
|
|
492
|
-
|
|
587
|
+
|
|
588
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-available-symbols
|
|
589
|
+
|
|
493
590
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
494
591
|
:returns dict[]: an array of objects representing market data
|
|
495
592
|
"""
|
|
@@ -536,12 +633,15 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
536
633
|
async def fetch_currencies(self, params={}) -> Currencies:
|
|
537
634
|
"""
|
|
538
635
|
fetches all available currencies on an exchange
|
|
539
|
-
|
|
636
|
+
|
|
637
|
+
https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/public/get-supported-collateral-info#get-supported-collateral-info
|
|
638
|
+
https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/public/get-supported-chains-per-builder#get-supported-chains-per-builder
|
|
639
|
+
|
|
540
640
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
541
641
|
:returns dict: an associative dictionary of currencies
|
|
542
642
|
"""
|
|
543
643
|
result: dict = {}
|
|
544
|
-
|
|
644
|
+
tokenPromise = self.v1PublicGetPublicToken(params)
|
|
545
645
|
#
|
|
546
646
|
# {
|
|
547
647
|
# "success": True,
|
|
@@ -564,25 +664,28 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
564
664
|
# }
|
|
565
665
|
# }
|
|
566
666
|
#
|
|
567
|
-
|
|
568
|
-
|
|
667
|
+
chainPromise = self.v1PublicGetPublicChainInfo(params)
|
|
668
|
+
tokenResponse, chainResponse = await asyncio.gather(*[tokenPromise, chainPromise])
|
|
669
|
+
tokenData = self.safe_dict(tokenResponse, 'data', {})
|
|
670
|
+
tokenRows = self.safe_list(tokenData, 'rows', [])
|
|
671
|
+
chainData = self.safe_dict(chainResponse, 'data', {})
|
|
672
|
+
chainRows = self.safe_list(chainData, 'rows', [])
|
|
673
|
+
indexedChains = self.index_by(chainRows, 'chain_id')
|
|
569
674
|
for i in range(0, len(tokenRows)):
|
|
570
675
|
token = tokenRows[i]
|
|
571
676
|
currencyId = self.safe_string(token, 'token')
|
|
572
677
|
networks = self.safe_list(token, 'chain_details')
|
|
573
678
|
code = self.safe_currency_code(currencyId)
|
|
574
|
-
minPrecision = None
|
|
575
679
|
resultingNetworks: dict = {}
|
|
576
680
|
for j in range(0, len(networks)):
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
resultingNetworks[networkId] = {
|
|
681
|
+
networkEntry = networks[j]
|
|
682
|
+
networkId = self.safe_string(networkEntry, 'chain_id')
|
|
683
|
+
networkRow = self.safe_dict(indexedChains, networkId)
|
|
684
|
+
networkName = self.safe_string(networkRow, 'name')
|
|
685
|
+
networkCode = self.network_id_to_code(networkName, code)
|
|
686
|
+
resultingNetworks[networkCode] = {
|
|
584
687
|
'id': networkId,
|
|
585
|
-
'network':
|
|
688
|
+
'network': networkCode,
|
|
586
689
|
'limits': {
|
|
587
690
|
'withdraw': {
|
|
588
691
|
'min': None,
|
|
@@ -596,15 +699,15 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
596
699
|
'active': None,
|
|
597
700
|
'deposit': None,
|
|
598
701
|
'withdraw': None,
|
|
599
|
-
'fee': self.safe_number(
|
|
600
|
-
'precision': self.parse_number(
|
|
601
|
-
'info':
|
|
702
|
+
'fee': self.safe_number(networkEntry, 'withdrawal_fee'),
|
|
703
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(networkEntry, 'decimals'))),
|
|
704
|
+
'info': [networkEntry, networkRow],
|
|
602
705
|
}
|
|
603
|
-
result[code] = {
|
|
706
|
+
result[code] = self.safe_currency_structure({
|
|
604
707
|
'id': currencyId,
|
|
605
|
-
'name':
|
|
708
|
+
'name': None,
|
|
606
709
|
'code': code,
|
|
607
|
-
'precision':
|
|
710
|
+
'precision': None,
|
|
608
711
|
'active': None,
|
|
609
712
|
'fee': None,
|
|
610
713
|
'networks': resultingNetworks,
|
|
@@ -621,7 +724,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
621
724
|
},
|
|
622
725
|
},
|
|
623
726
|
'info': token,
|
|
624
|
-
}
|
|
727
|
+
})
|
|
625
728
|
return result
|
|
626
729
|
|
|
627
730
|
def parse_token_and_fee_temp(self, item, feeTokenKey, feeAmountKey):
|
|
@@ -673,6 +776,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
673
776
|
amount = self.safe_string(trade, 'executed_quantity')
|
|
674
777
|
order_id = self.safe_string(trade, 'order_id')
|
|
675
778
|
fee = self.parse_token_and_fee_temp(trade, 'fee_asset', 'fee')
|
|
779
|
+
feeCost = self.safe_string(fee, 'cost')
|
|
780
|
+
if feeCost is not None:
|
|
781
|
+
fee['cost'] = feeCost
|
|
676
782
|
cost = Precise.string_mul(price, amount)
|
|
677
783
|
side = self.safe_string_lower(trade, 'side')
|
|
678
784
|
id = self.safe_string(trade, 'id')
|
|
@@ -699,7 +805,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
699
805
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
|
700
806
|
"""
|
|
701
807
|
get the list of most recent trades for a particular symbol
|
|
702
|
-
|
|
808
|
+
|
|
809
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-market-trades
|
|
810
|
+
|
|
703
811
|
:param str symbol: unified symbol of the market to fetch trades for
|
|
704
812
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
|
705
813
|
:param int [limit]: the maximum amount of trades to fetch
|
|
@@ -733,7 +841,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
733
841
|
rows = self.safe_list(data, 'rows', [])
|
|
734
842
|
return self.parse_trades(rows, market, since, limit)
|
|
735
843
|
|
|
736
|
-
def parse_funding_rate(self, fundingRate, market: Market = None):
|
|
844
|
+
def parse_funding_rate(self, fundingRate, market: Market = None) -> FundingRate:
|
|
737
845
|
#
|
|
738
846
|
# {
|
|
739
847
|
# "symbol":"PERP_AAVE_USDT",
|
|
@@ -745,12 +853,14 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
745
853
|
# "sum_unitary_funding": 521.367
|
|
746
854
|
# }
|
|
747
855
|
#
|
|
748
|
-
#
|
|
749
856
|
symbol = self.safe_string(fundingRate, 'symbol')
|
|
750
857
|
market = self.market(symbol)
|
|
751
858
|
nextFundingTimestamp = self.safe_integer(fundingRate, 'next_funding_time')
|
|
752
859
|
estFundingRateTimestamp = self.safe_integer(fundingRate, 'est_funding_rate_timestamp')
|
|
753
860
|
lastFundingRateTimestamp = self.safe_integer(fundingRate, 'last_funding_rate_timestamp')
|
|
861
|
+
fundingTimeString = self.safe_string(fundingRate, 'last_funding_rate_timestamp')
|
|
862
|
+
nextFundingTimeString = self.safe_string(fundingRate, 'next_funding_time')
|
|
863
|
+
millisecondsInterval = Precise.string_sub(nextFundingTimeString, fundingTimeString)
|
|
754
864
|
return {
|
|
755
865
|
'info': fundingRate,
|
|
756
866
|
'symbol': market['symbol'],
|
|
@@ -769,12 +879,37 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
769
879
|
'previousFundingRate': self.safe_number(fundingRate, 'last_funding_rate'),
|
|
770
880
|
'previousFundingTimestamp': lastFundingRateTimestamp,
|
|
771
881
|
'previousFundingDatetime': self.iso8601(lastFundingRateTimestamp),
|
|
882
|
+
'interval': self.parse_funding_interval(millisecondsInterval),
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
def parse_funding_interval(self, interval):
|
|
886
|
+
intervals: dict = {
|
|
887
|
+
'3600000': '1h',
|
|
888
|
+
'14400000': '4h',
|
|
889
|
+
'28800000': '8h',
|
|
890
|
+
'57600000': '16h',
|
|
891
|
+
'86400000': '24h',
|
|
772
892
|
}
|
|
893
|
+
return self.safe_string(intervals, interval, interval)
|
|
773
894
|
|
|
774
|
-
async def
|
|
895
|
+
async def fetch_funding_interval(self, symbol: str, params={}) -> FundingRate:
|
|
896
|
+
"""
|
|
897
|
+
fetch the current funding rate interval
|
|
898
|
+
|
|
899
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rate-for-one-market
|
|
900
|
+
|
|
901
|
+
:param str symbol: unified market symbol
|
|
902
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
903
|
+
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
|
904
|
+
"""
|
|
905
|
+
return await self.fetch_funding_rate(symbol, params)
|
|
906
|
+
|
|
907
|
+
async def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
|
775
908
|
"""
|
|
776
909
|
fetch the current funding rate
|
|
777
|
-
|
|
910
|
+
|
|
911
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rate-for-one-market
|
|
912
|
+
|
|
778
913
|
:param str symbol: unified market symbol
|
|
779
914
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
780
915
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
|
@@ -803,10 +938,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
803
938
|
data = self.safe_dict(response, 'data', {})
|
|
804
939
|
return self.parse_funding_rate(data, market)
|
|
805
940
|
|
|
806
|
-
async def fetch_funding_rates(self, symbols: Strings = None, params={}):
|
|
941
|
+
async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
|
807
942
|
"""
|
|
808
|
-
fetch the current funding
|
|
809
|
-
|
|
943
|
+
fetch the current funding rate for multiple markets
|
|
944
|
+
|
|
945
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-predicted-funding-rates-for-all-markets
|
|
946
|
+
|
|
810
947
|
:param str[] symbols: unified market symbols
|
|
811
948
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
812
949
|
:returns dict[]: an array of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
|
@@ -833,13 +970,14 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
833
970
|
#
|
|
834
971
|
data = self.safe_dict(response, 'data', {})
|
|
835
972
|
rows = self.safe_list(data, 'rows', [])
|
|
836
|
-
|
|
837
|
-
return self.filter_by_array(result, 'symbol', symbols)
|
|
973
|
+
return self.parse_funding_rates(rows, symbols)
|
|
838
974
|
|
|
839
975
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
840
976
|
"""
|
|
841
977
|
fetches historical funding rate prices
|
|
842
|
-
|
|
978
|
+
|
|
979
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/public/get-funding-rate-history-for-one-market
|
|
980
|
+
|
|
843
981
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
|
844
982
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
|
845
983
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
|
@@ -898,10 +1036,103 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
898
1036
|
sorted = self.sort_by(rates, 'timestamp')
|
|
899
1037
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
|
900
1038
|
|
|
1039
|
+
def parse_income(self, income, market: Market = None):
|
|
1040
|
+
#
|
|
1041
|
+
# {
|
|
1042
|
+
# "symbol": "PERP_ETH_USDC",
|
|
1043
|
+
# "funding_rate": 0.00046875,
|
|
1044
|
+
# "mark_price": 2100,
|
|
1045
|
+
# "funding_fee": 0.000016,
|
|
1046
|
+
# "payment_type": "Pay",
|
|
1047
|
+
# "status": "Accrued",
|
|
1048
|
+
# "created_time": 1682235722003,
|
|
1049
|
+
# "updated_time": 1682235722003
|
|
1050
|
+
# }
|
|
1051
|
+
#
|
|
1052
|
+
marketId = self.safe_string(income, 'symbol')
|
|
1053
|
+
symbol = self.safe_symbol(marketId, market)
|
|
1054
|
+
amount = self.safe_string(income, 'funding_fee')
|
|
1055
|
+
code = self.safe_currency_code('USDC')
|
|
1056
|
+
timestamp = self.safe_integer(income, 'updated_time')
|
|
1057
|
+
rate = self.safe_number(income, 'funding_rate')
|
|
1058
|
+
paymentType = self.safe_string(income, 'payment_type')
|
|
1059
|
+
amount = Precise.string_neg(amount) if (paymentType == 'Pay') else amount
|
|
1060
|
+
return {
|
|
1061
|
+
'info': income,
|
|
1062
|
+
'symbol': symbol,
|
|
1063
|
+
'code': code,
|
|
1064
|
+
'timestamp': timestamp,
|
|
1065
|
+
'datetime': self.iso8601(timestamp),
|
|
1066
|
+
'id': None,
|
|
1067
|
+
'amount': self.parse_number(amount),
|
|
1068
|
+
'rate': rate,
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1072
|
+
"""
|
|
1073
|
+
fetch the history of funding payments paid and received on self account
|
|
1074
|
+
|
|
1075
|
+
https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/private/get-funding-fee-history
|
|
1076
|
+
|
|
1077
|
+
:param str [symbol]: unified market symbol
|
|
1078
|
+
:param int [since]: the earliest time in ms to fetch funding history for
|
|
1079
|
+
:param int [limit]: the maximum number of funding history structures to retrieve
|
|
1080
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1081
|
+
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1082
|
+
:returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
|
|
1083
|
+
"""
|
|
1084
|
+
await self.load_markets()
|
|
1085
|
+
paginate = False
|
|
1086
|
+
paginate, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'paginate')
|
|
1087
|
+
if paginate:
|
|
1088
|
+
return await self.fetch_paginated_call_incremental('fetchFundingHistory', symbol, since, limit, params, 'page', 500)
|
|
1089
|
+
request: dict = {}
|
|
1090
|
+
market: Market = None
|
|
1091
|
+
if symbol is not None:
|
|
1092
|
+
market = self.market(symbol)
|
|
1093
|
+
request['symbol'] = market['id']
|
|
1094
|
+
if since is not None:
|
|
1095
|
+
request['start_t'] = since
|
|
1096
|
+
until = self.safe_integer(params, 'until') # unified in milliseconds
|
|
1097
|
+
params = self.omit(params, ['until'])
|
|
1098
|
+
if until is not None:
|
|
1099
|
+
request['end_t'] = until
|
|
1100
|
+
if limit is not None:
|
|
1101
|
+
request['size'] = min(limit, 500)
|
|
1102
|
+
response = await self.v1PrivateGetFundingFeeHistory(self.extend(request, params))
|
|
1103
|
+
#
|
|
1104
|
+
# {
|
|
1105
|
+
# "success": True,
|
|
1106
|
+
# "timestamp": 1702989203989,
|
|
1107
|
+
# "data": {
|
|
1108
|
+
# "meta": {
|
|
1109
|
+
# "total": 9,
|
|
1110
|
+
# "records_per_page": 25,
|
|
1111
|
+
# "current_page": 1
|
|
1112
|
+
# },
|
|
1113
|
+
# "rows": [{
|
|
1114
|
+
# "symbol": "PERP_ETH_USDC",
|
|
1115
|
+
# "funding_rate": 0.00046875,
|
|
1116
|
+
# "mark_price": 2100,
|
|
1117
|
+
# "funding_fee": 0.000016,
|
|
1118
|
+
# "payment_type": "Pay",
|
|
1119
|
+
# "status": "Accrued",
|
|
1120
|
+
# "created_time": 1682235722003,
|
|
1121
|
+
# "updated_time": 1682235722003
|
|
1122
|
+
# }]
|
|
1123
|
+
# }
|
|
1124
|
+
# }
|
|
1125
|
+
#
|
|
1126
|
+
data = self.safe_dict(response, 'data', {})
|
|
1127
|
+
rows = self.safe_list(data, 'rows', [])
|
|
1128
|
+
return self.parse_incomes(rows, market, since, limit)
|
|
1129
|
+
|
|
901
1130
|
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
|
902
1131
|
"""
|
|
903
1132
|
fetch the trading fees for multiple markets
|
|
904
|
-
|
|
1133
|
+
|
|
1134
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-account-information
|
|
1135
|
+
|
|
905
1136
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
906
1137
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
|
907
1138
|
"""
|
|
@@ -953,7 +1184,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
953
1184
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
|
954
1185
|
"""
|
|
955
1186
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
|
956
|
-
|
|
1187
|
+
|
|
1188
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/orderbook-snapshot
|
|
1189
|
+
|
|
957
1190
|
:param str symbol: unified symbol of the market to fetch the order book for
|
|
958
1191
|
:param int [limit]: the maximum amount of order book entries to return
|
|
959
1192
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -1001,7 +1234,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1001
1234
|
|
|
1002
1235
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
|
1003
1236
|
"""
|
|
1004
|
-
|
|
1237
|
+
|
|
1238
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-kline
|
|
1239
|
+
|
|
1005
1240
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1006
1241
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
1007
1242
|
:param str timeframe: the length of time each candle represents
|
|
@@ -1110,7 +1345,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1110
1345
|
fee = self.safe_value_2(order, 'total_fee', 'totalFee')
|
|
1111
1346
|
feeCurrency = self.safe_string_2(order, 'fee_asset', 'feeAsset')
|
|
1112
1347
|
transactions = self.safe_value(order, 'Transactions')
|
|
1113
|
-
|
|
1348
|
+
triggerPrice = self.safe_number(order, 'triggerPrice')
|
|
1114
1349
|
takeProfitPrice: Num = None
|
|
1115
1350
|
stopLossPrice: Num = None
|
|
1116
1351
|
childOrders = self.safe_value(order, 'childOrders')
|
|
@@ -1139,8 +1374,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1139
1374
|
'reduceOnly': self.safe_bool(order, 'reduce_only'),
|
|
1140
1375
|
'side': side,
|
|
1141
1376
|
'price': price,
|
|
1142
|
-
'
|
|
1143
|
-
'triggerPrice': stopPrice,
|
|
1377
|
+
'triggerPrice': triggerPrice,
|
|
1144
1378
|
'takeProfitPrice': takeProfitPrice,
|
|
1145
1379
|
'stopLossPrice': stopLossPrice,
|
|
1146
1380
|
'average': average,
|
|
@@ -1190,13 +1424,13 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1190
1424
|
|
|
1191
1425
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
|
1192
1426
|
"""
|
|
1193
|
-
|
|
1427
|
+
@ignore
|
|
1194
1428
|
helper function to build the request
|
|
1195
1429
|
:param str symbol: unified symbol of the market to create an order in
|
|
1196
1430
|
:param str type: 'market' or 'limit'
|
|
1197
1431
|
:param str side: 'buy' or 'sell'
|
|
1198
1432
|
:param float amount: how much you want to trade in units of the base currency
|
|
1199
|
-
:param float [price]: the price that the order is to be
|
|
1433
|
+
:param float [price]: the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1200
1434
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1201
1435
|
:returns dict: request to be sent to the exchange
|
|
1202
1436
|
"""
|
|
@@ -1208,19 +1442,19 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1208
1442
|
'symbol': market['id'],
|
|
1209
1443
|
'side': orderSide,
|
|
1210
1444
|
}
|
|
1211
|
-
|
|
1445
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
|
1212
1446
|
stopLoss = self.safe_value(params, 'stopLoss')
|
|
1213
1447
|
takeProfit = self.safe_value(params, 'takeProfit')
|
|
1214
1448
|
algoType = self.safe_string(params, 'algoType')
|
|
1215
|
-
|
|
1449
|
+
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
|
1216
1450
|
isMarket = orderType == 'MARKET'
|
|
1217
1451
|
timeInForce = self.safe_string_lower(params, 'timeInForce')
|
|
1218
1452
|
postOnly = self.is_post_only(isMarket, None, params)
|
|
1219
|
-
orderQtyKey = 'quantity' if
|
|
1220
|
-
priceKey = 'price' if
|
|
1221
|
-
typeKey = 'type' if
|
|
1453
|
+
orderQtyKey = 'quantity' if isConditional else 'order_quantity'
|
|
1454
|
+
priceKey = 'price' if isConditional else 'order_price'
|
|
1455
|
+
typeKey = 'type' if isConditional else 'order_type'
|
|
1222
1456
|
request[typeKey] = orderType # LIMIT/MARKET/IOC/FOK/POST_ONLY/ASK/BID
|
|
1223
|
-
if not
|
|
1457
|
+
if not isConditional:
|
|
1224
1458
|
if postOnly:
|
|
1225
1459
|
request['order_type'] = 'POST_ONLY'
|
|
1226
1460
|
elif timeInForce == 'fok':
|
|
@@ -1231,15 +1465,15 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1231
1465
|
request['reduce_only'] = reduceOnly
|
|
1232
1466
|
if price is not None:
|
|
1233
1467
|
request[priceKey] = self.price_to_precision(symbol, price)
|
|
1234
|
-
if isMarket and not
|
|
1468
|
+
if isMarket and not isConditional:
|
|
1235
1469
|
request[orderQtyKey] = self.amount_to_precision(symbol, amount)
|
|
1236
1470
|
elif algoType != 'POSITIONAL_TP_SL':
|
|
1237
1471
|
request[orderQtyKey] = self.amount_to_precision(symbol, amount)
|
|
1238
1472
|
clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
|
1239
1473
|
if clientOrderId is not None:
|
|
1240
1474
|
request['client_order_id'] = clientOrderId
|
|
1241
|
-
if
|
|
1242
|
-
request['trigger_price'] = self.price_to_precision(symbol,
|
|
1475
|
+
if triggerPrice is not None:
|
|
1476
|
+
request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
|
|
1243
1477
|
request['algo_type'] = 'STOP'
|
|
1244
1478
|
elif (stopLoss is not None) or (takeProfit is not None):
|
|
1245
1479
|
request['algo_type'] = 'TP_SL'
|
|
@@ -1249,6 +1483,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1249
1483
|
'algo_type': 'POSITIONAL_TP_SL',
|
|
1250
1484
|
'child_orders': [],
|
|
1251
1485
|
}
|
|
1486
|
+
childOrders = outterOrder['child_orders']
|
|
1252
1487
|
closeSide = 'SELL' if (orderSide == 'BUY') else 'BUY'
|
|
1253
1488
|
if stopLoss is not None:
|
|
1254
1489
|
stopLossPrice = self.safe_number_2(stopLoss, 'triggerPrice', 'price', stopLoss)
|
|
@@ -1259,7 +1494,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1259
1494
|
'type': 'LIMIT',
|
|
1260
1495
|
'reduce_only': True,
|
|
1261
1496
|
}
|
|
1262
|
-
|
|
1497
|
+
childOrders.append(stopLossOrder)
|
|
1263
1498
|
if takeProfit is not None:
|
|
1264
1499
|
takeProfitPrice = self.safe_number_2(takeProfit, 'triggerPrice', 'price', takeProfit)
|
|
1265
1500
|
takeProfitOrder: dict = {
|
|
@@ -1269,7 +1504,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1269
1504
|
'type': 'LIMIT',
|
|
1270
1505
|
'reduce_only': True,
|
|
1271
1506
|
}
|
|
1272
|
-
outterOrder
|
|
1507
|
+
outterOrder.append(takeProfitOrder)
|
|
1273
1508
|
request['child_orders'] = [outterOrder]
|
|
1274
1509
|
params = self.omit(params, ['reduceOnly', 'reduce_only', 'clOrdID', 'clientOrderId', 'client_order_id', 'postOnly', 'timeInForce', 'stopPrice', 'triggerPrice', 'stopLoss', 'takeProfit'])
|
|
1275
1510
|
return self.extend(request, params)
|
|
@@ -1277,13 +1512,15 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1277
1512
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
|
1278
1513
|
"""
|
|
1279
1514
|
create a trade order
|
|
1280
|
-
|
|
1281
|
-
|
|
1515
|
+
|
|
1516
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-order
|
|
1517
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-algo-order
|
|
1518
|
+
|
|
1282
1519
|
:param str symbol: unified symbol of the market to create an order in
|
|
1283
1520
|
:param str type: 'market' or 'limit'
|
|
1284
1521
|
:param str side: 'buy' or 'sell'
|
|
1285
1522
|
:param float amount: how much of currency you want to trade in units of base currency
|
|
1286
|
-
:param float [price]: the price at which the order is to be
|
|
1523
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1287
1524
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1288
1525
|
:param float [params.triggerPrice]: The price a trigger order is triggered at
|
|
1289
1526
|
:param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered(perpetual swap markets only)
|
|
@@ -1298,12 +1535,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1298
1535
|
await self.load_markets()
|
|
1299
1536
|
market = self.market(symbol)
|
|
1300
1537
|
request = self.create_order_request(symbol, type, side, amount, price, params)
|
|
1301
|
-
|
|
1538
|
+
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
|
1302
1539
|
stopLoss = self.safe_value(params, 'stopLoss')
|
|
1303
1540
|
takeProfit = self.safe_value(params, 'takeProfit')
|
|
1304
|
-
|
|
1541
|
+
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
|
|
1305
1542
|
response = None
|
|
1306
|
-
if
|
|
1543
|
+
if isConditional:
|
|
1307
1544
|
response = await self.v1PrivatePostAlgoOrder(request)
|
|
1308
1545
|
#
|
|
1309
1546
|
# {
|
|
@@ -1343,8 +1580,11 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1343
1580
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
|
1344
1581
|
"""
|
|
1345
1582
|
*contract only* create a list of trade orders
|
|
1346
|
-
|
|
1583
|
+
|
|
1584
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-create-order
|
|
1585
|
+
|
|
1347
1586
|
: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
|
|
1587
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1348
1588
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
1349
1589
|
"""
|
|
1350
1590
|
await self.load_markets()
|
|
@@ -1357,12 +1597,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1357
1597
|
amount = self.safe_value(rawOrder, 'amount')
|
|
1358
1598
|
price = self.safe_value(rawOrder, 'price')
|
|
1359
1599
|
orderParams = self.safe_dict(rawOrder, 'params', {})
|
|
1360
|
-
|
|
1600
|
+
triggerPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
|
|
1361
1601
|
stopLoss = self.safe_value(orderParams, 'stopLoss')
|
|
1362
1602
|
takeProfit = self.safe_value(orderParams, 'takeProfit')
|
|
1363
|
-
|
|
1364
|
-
if
|
|
1365
|
-
raise NotSupported(self.id + 'createOrders() only support non-stop order')
|
|
1603
|
+
isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
|
|
1604
|
+
if isConditional:
|
|
1605
|
+
raise NotSupported(self.id + ' createOrders() only support non-stop order')
|
|
1366
1606
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
|
1367
1607
|
ordersRequests.append(orderRequest)
|
|
1368
1608
|
request: dict = {
|
|
@@ -1393,14 +1633,16 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1393
1633
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
|
1394
1634
|
"""
|
|
1395
1635
|
edit a trade order
|
|
1396
|
-
|
|
1397
|
-
|
|
1636
|
+
|
|
1637
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/edit-order
|
|
1638
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/edit-algo-order
|
|
1639
|
+
|
|
1398
1640
|
:param str id: order id
|
|
1399
1641
|
:param str symbol: unified symbol of the market to create an order in
|
|
1400
1642
|
:param str type: 'market' or 'limit'
|
|
1401
1643
|
:param str side: 'buy' or 'sell'
|
|
1402
1644
|
:param float amount: how much of currency you want to trade in units of base currency
|
|
1403
|
-
:param float [price]: the price at which the order is to be
|
|
1645
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1404
1646
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1405
1647
|
:param float [params.triggerPrice]: The price a trigger order is triggered at
|
|
1406
1648
|
:param float [params.stopLossPrice]: price to trigger stop-loss orders
|
|
@@ -1412,19 +1654,19 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1412
1654
|
request: dict = {
|
|
1413
1655
|
'order_id': id,
|
|
1414
1656
|
}
|
|
1415
|
-
|
|
1416
|
-
if
|
|
1417
|
-
request['triggerPrice'] = self.price_to_precision(symbol,
|
|
1418
|
-
|
|
1419
|
-
orderQtyKey = 'quantity' if
|
|
1420
|
-
priceKey = 'price' if
|
|
1657
|
+
triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
|
|
1658
|
+
if triggerPrice is not None:
|
|
1659
|
+
request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
|
|
1660
|
+
isConditional = (triggerPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
|
|
1661
|
+
orderQtyKey = 'quantity' if isConditional else 'order_quantity'
|
|
1662
|
+
priceKey = 'price' if isConditional else 'order_price'
|
|
1421
1663
|
if price is not None:
|
|
1422
1664
|
request[priceKey] = self.price_to_precision(symbol, price)
|
|
1423
1665
|
if amount is not None:
|
|
1424
1666
|
request[orderQtyKey] = self.amount_to_precision(symbol, amount)
|
|
1425
1667
|
params = self.omit(params, ['stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent'])
|
|
1426
1668
|
response = None
|
|
1427
|
-
if
|
|
1669
|
+
if isConditional:
|
|
1428
1670
|
response = await self.v1PrivatePutAlgoOrder(self.extend(request, params))
|
|
1429
1671
|
else:
|
|
1430
1672
|
request['symbol'] = market['id']
|
|
@@ -1463,10 +1705,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1463
1705
|
|
|
1464
1706
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
|
1465
1707
|
"""
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1708
|
+
|
|
1709
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-order
|
|
1710
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-order-by-client_order_id
|
|
1711
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-algo-order
|
|
1712
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-algo-order-by-client_order_id
|
|
1713
|
+
|
|
1470
1714
|
cancels an open order
|
|
1471
1715
|
:param str id: order id
|
|
1472
1716
|
:param str symbol: unified symbol of the market the order was made in
|
|
@@ -1475,9 +1719,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1475
1719
|
:param str [params.clientOrderId]: a unique id for the order
|
|
1476
1720
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
1477
1721
|
"""
|
|
1478
|
-
|
|
1722
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
|
1479
1723
|
params = self.omit(params, ['stop', 'trigger'])
|
|
1480
|
-
if not
|
|
1724
|
+
if not trigger and (symbol is None):
|
|
1481
1725
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
|
1482
1726
|
await self.load_markets()
|
|
1483
1727
|
market: Market = None
|
|
@@ -1490,7 +1734,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1490
1734
|
clientOrderIdExchangeSpecific = self.safe_string(params, 'client_order_id', clientOrderIdUnified)
|
|
1491
1735
|
isByClientOrder = clientOrderIdExchangeSpecific is not None
|
|
1492
1736
|
response = None
|
|
1493
|
-
if
|
|
1737
|
+
if trigger:
|
|
1494
1738
|
if isByClientOrder:
|
|
1495
1739
|
request['client_order_id'] = clientOrderIdExchangeSpecific
|
|
1496
1740
|
params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
|
@@ -1526,7 +1770,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1526
1770
|
extendParams['client_order_id'] = clientOrderIdExchangeSpecific
|
|
1527
1771
|
else:
|
|
1528
1772
|
extendParams['id'] = id
|
|
1529
|
-
if
|
|
1773
|
+
if trigger:
|
|
1530
1774
|
return self.extend(self.parse_order(response), extendParams)
|
|
1531
1775
|
data = self.safe_dict(response, 'data', {})
|
|
1532
1776
|
return self.extend(self.parse_order(data), extendParams)
|
|
@@ -1534,8 +1778,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1534
1778
|
async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
|
1535
1779
|
"""
|
|
1536
1780
|
cancel multiple orders
|
|
1537
|
-
|
|
1538
|
-
|
|
1781
|
+
|
|
1782
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-cancel-orders
|
|
1783
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/batch-cancel-orders-by-client_order_id
|
|
1784
|
+
|
|
1539
1785
|
:param str[] ids: order ids
|
|
1540
1786
|
:param str [symbol]: unified market symbol
|
|
1541
1787
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -1568,8 +1814,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1568
1814
|
|
|
1569
1815
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
|
1570
1816
|
"""
|
|
1571
|
-
|
|
1572
|
-
|
|
1817
|
+
|
|
1818
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-all-pending-algo-orders
|
|
1819
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/cancel-orders-in-bulk
|
|
1820
|
+
|
|
1573
1821
|
cancel all open orders in a market
|
|
1574
1822
|
:param str symbol: unified market symbol
|
|
1575
1823
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -1577,18 +1825,18 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1577
1825
|
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
|
1578
1826
|
"""
|
|
1579
1827
|
await self.load_markets()
|
|
1580
|
-
|
|
1828
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
|
1581
1829
|
params = self.omit(params, ['stop', 'trigger'])
|
|
1582
1830
|
request: dict = {}
|
|
1583
1831
|
if symbol is not None:
|
|
1584
1832
|
market = self.market(symbol)
|
|
1585
1833
|
request['symbol'] = market['id']
|
|
1586
1834
|
response = None
|
|
1587
|
-
if
|
|
1835
|
+
if trigger:
|
|
1588
1836
|
response = await self.v1PrivateDeleteAlgoOrders(self.extend(request, params))
|
|
1589
1837
|
else:
|
|
1590
1838
|
response = await self.v1PrivateDeleteOrders(self.extend(request, params))
|
|
1591
|
-
#
|
|
1839
|
+
# trigger
|
|
1592
1840
|
# {
|
|
1593
1841
|
# "success": True,
|
|
1594
1842
|
# "timestamp": 1702989203989,
|
|
@@ -1604,18 +1852,21 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1604
1852
|
# }
|
|
1605
1853
|
#
|
|
1606
1854
|
return [
|
|
1607
|
-
{
|
|
1855
|
+
self.safe_order({
|
|
1608
1856
|
'info': response,
|
|
1609
|
-
},
|
|
1857
|
+
}),
|
|
1610
1858
|
]
|
|
1611
1859
|
|
|
1612
1860
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
|
1613
1861
|
"""
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1862
|
+
|
|
1863
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-order-by-order_id
|
|
1864
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-order-by-client_order_id
|
|
1865
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-order-by-order_id
|
|
1866
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-order-by-client_order_id
|
|
1867
|
+
|
|
1618
1868
|
fetches information on an order made by the user
|
|
1869
|
+
:param str id: the order id
|
|
1619
1870
|
:param str symbol: unified symbol of the market the order was made in
|
|
1620
1871
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1621
1872
|
:param boolean [params.trigger]: whether the order is a stop/algo order
|
|
@@ -1623,13 +1874,15 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1623
1874
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
1624
1875
|
"""
|
|
1625
1876
|
await self.load_markets()
|
|
1626
|
-
market =
|
|
1627
|
-
|
|
1877
|
+
market = None
|
|
1878
|
+
if symbol is not None:
|
|
1879
|
+
market = self.market(symbol)
|
|
1880
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger', False)
|
|
1628
1881
|
request: dict = {}
|
|
1629
1882
|
clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
|
|
1630
1883
|
params = self.omit(params, ['stop', 'trigger', 'clOrdID', 'clientOrderId', 'client_order_id'])
|
|
1631
1884
|
response = None
|
|
1632
|
-
if
|
|
1885
|
+
if trigger:
|
|
1633
1886
|
if clientOrderId:
|
|
1634
1887
|
request['client_order_id'] = clientOrderId
|
|
1635
1888
|
response = await self.v1PrivateGetAlgoClientOrderClientOrderId(self.extend(request, params))
|
|
@@ -1676,8 +1929,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1676
1929
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
1677
1930
|
"""
|
|
1678
1931
|
fetches information on multiple orders made by the user
|
|
1679
|
-
|
|
1680
|
-
|
|
1932
|
+
|
|
1933
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
|
|
1934
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
|
|
1935
|
+
|
|
1681
1936
|
:param str symbol: unified market symbol of the market orders were made in
|
|
1682
1937
|
:param int [since]: the earliest time in ms to fetch orders for
|
|
1683
1938
|
:param int [limit]: the maximum number of order structures to retrieve
|
|
@@ -1757,8 +2012,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1757
2012
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
1758
2013
|
"""
|
|
1759
2014
|
fetches information on multiple orders made by the user
|
|
1760
|
-
|
|
1761
|
-
|
|
2015
|
+
|
|
2016
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
|
|
2017
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
|
|
2018
|
+
|
|
1762
2019
|
:param str symbol: unified market symbol of the market orders were made in
|
|
1763
2020
|
:param int [since]: the earliest time in ms to fetch orders for
|
|
1764
2021
|
:param int [limit]: the maximum number of order structures to retrieve
|
|
@@ -1777,8 +2034,10 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1777
2034
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
1778
2035
|
"""
|
|
1779
2036
|
fetches information on multiple orders made by the user
|
|
1780
|
-
|
|
1781
|
-
|
|
2037
|
+
|
|
2038
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-orders
|
|
2039
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-algo-orders
|
|
2040
|
+
|
|
1782
2041
|
:param str symbol: unified market symbol of the market orders were made in
|
|
1783
2042
|
:param int [since]: the earliest time in ms to fetch orders for
|
|
1784
2043
|
:param int [limit]: the maximum number of order structures to retrieve
|
|
@@ -1797,7 +2056,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1797
2056
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1798
2057
|
"""
|
|
1799
2058
|
fetch all the trades made from a single order
|
|
1800
|
-
|
|
2059
|
+
|
|
2060
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-all-trades-of-specific-order
|
|
2061
|
+
|
|
1801
2062
|
:param str id: order id
|
|
1802
2063
|
:param str symbol: unified market symbol
|
|
1803
2064
|
:param int [since]: the earliest time in ms to fetch trades for
|
|
@@ -1840,7 +2101,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1840
2101
|
|
|
1841
2102
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1842
2103
|
"""
|
|
1843
|
-
|
|
2104
|
+
|
|
2105
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-trades
|
|
2106
|
+
|
|
1844
2107
|
fetch all trades made by the user
|
|
1845
2108
|
:param str symbol: unified market symbol
|
|
1846
2109
|
:param int [since]: the earliest time in ms to fetch trades for
|
|
@@ -1915,7 +2178,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1915
2178
|
async def fetch_balance(self, params={}) -> Balances:
|
|
1916
2179
|
"""
|
|
1917
2180
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1918
|
-
|
|
2181
|
+
|
|
2182
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-current-holding
|
|
2183
|
+
|
|
1919
2184
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1920
2185
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
|
1921
2186
|
"""
|
|
@@ -1983,14 +2248,16 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
1983
2248
|
data = self.safe_dict(response, 'data', {})
|
|
1984
2249
|
return [currency, self.safe_list(data, 'rows', [])]
|
|
1985
2250
|
|
|
1986
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
|
1987
|
-
|
|
2251
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
|
2252
|
+
currencyId = self.safe_string(item, 'token')
|
|
2253
|
+
code = self.safe_currency_code(currencyId, currency)
|
|
2254
|
+
currency = self.safe_currency(currencyId, currency)
|
|
1988
2255
|
amount = self.safe_number(item, 'amount')
|
|
1989
2256
|
side = self.safe_string(item, 'token_side')
|
|
1990
2257
|
direction = 'in' if (side == 'DEPOSIT') else 'out'
|
|
1991
2258
|
timestamp = self.safe_integer(item, 'created_time')
|
|
1992
2259
|
fee = self.parse_token_and_fee_temp(item, 'fee_token', 'fee_amount')
|
|
1993
|
-
return {
|
|
2260
|
+
return self.safe_ledger_entry({
|
|
1994
2261
|
'id': self.safe_string(item, 'id'),
|
|
1995
2262
|
'currency': code,
|
|
1996
2263
|
'account': self.safe_string(item, 'account'),
|
|
@@ -2006,7 +2273,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2006
2273
|
'datetime': self.iso8601(timestamp),
|
|
2007
2274
|
'type': self.parse_ledger_entry_type(self.safe_string(item, 'type')),
|
|
2008
2275
|
'info': item,
|
|
2009
|
-
}
|
|
2276
|
+
}, currency)
|
|
2010
2277
|
|
|
2011
2278
|
def parse_ledger_entry_type(self, type):
|
|
2012
2279
|
types: dict = {
|
|
@@ -2015,17 +2282,21 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2015
2282
|
}
|
|
2016
2283
|
return self.safe_string(types, type, type)
|
|
2017
2284
|
|
|
2018
|
-
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
2285
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
|
2019
2286
|
"""
|
|
2020
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
2021
|
-
|
|
2022
|
-
|
|
2287
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2288
|
+
|
|
2289
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
|
|
2290
|
+
|
|
2291
|
+
:param str [code]: unified currency code, default is None
|
|
2023
2292
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
|
2024
|
-
:param int [limit]: max number of ledger
|
|
2293
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
|
2025
2294
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2026
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
|
2295
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
|
2027
2296
|
"""
|
|
2028
|
-
|
|
2297
|
+
currencyRows = await self.get_asset_history_rows(code, since, limit, params)
|
|
2298
|
+
currency = self.safe_value(currencyRows, 0)
|
|
2299
|
+
rows = self.safe_list(currencyRows, 1)
|
|
2029
2300
|
return self.parse_ledger(rows, currency, since, limit, params)
|
|
2030
2301
|
|
|
2031
2302
|
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
|
@@ -2074,7 +2345,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2074
2345
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
|
2075
2346
|
"""
|
|
2076
2347
|
fetch all deposits made to an account
|
|
2077
|
-
|
|
2348
|
+
|
|
2349
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
|
|
2350
|
+
|
|
2078
2351
|
:param str code: unified currency code
|
|
2079
2352
|
:param int [since]: the earliest time in ms to fetch deposits for
|
|
2080
2353
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
|
@@ -2089,7 +2362,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2089
2362
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
|
2090
2363
|
"""
|
|
2091
2364
|
fetch all withdrawals made from an account
|
|
2092
|
-
|
|
2365
|
+
|
|
2366
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
|
|
2367
|
+
|
|
2093
2368
|
:param str code: unified currency code
|
|
2094
2369
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
|
2095
2370
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
|
@@ -2104,7 +2379,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2104
2379
|
async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
|
2105
2380
|
"""
|
|
2106
2381
|
fetch history of deposits and withdrawals
|
|
2107
|
-
|
|
2382
|
+
|
|
2383
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-asset-history
|
|
2384
|
+
|
|
2108
2385
|
:param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
|
|
2109
2386
|
:param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
|
|
2110
2387
|
:param int [limit]: max number of deposit/withdrawals to return, default is None
|
|
@@ -2112,7 +2389,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2112
2389
|
:returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
|
2113
2390
|
"""
|
|
2114
2391
|
request: dict = {}
|
|
2115
|
-
|
|
2392
|
+
currencyRows = await self.get_asset_history_rows(code, since, limit, self.extend(request, params))
|
|
2393
|
+
currency = self.safe_value(currencyRows, 0)
|
|
2394
|
+
rows = self.safe_list(currencyRows, 1)
|
|
2116
2395
|
#
|
|
2117
2396
|
# {
|
|
2118
2397
|
# "rows":[],
|
|
@@ -2153,10 +2432,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2153
2432
|
def sign_message(self, message, privateKey):
|
|
2154
2433
|
return self.sign_hash(self.hash_message(message), privateKey[-64:])
|
|
2155
2434
|
|
|
2156
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
|
2435
|
+
async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
|
2157
2436
|
"""
|
|
2158
2437
|
make a withdrawal
|
|
2159
|
-
|
|
2438
|
+
|
|
2439
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/create-withdraw-request
|
|
2440
|
+
|
|
2160
2441
|
:param str code: unified currency code
|
|
2161
2442
|
:param float amount: the amount to withdraw
|
|
2162
2443
|
:param str address: the address to withdraw to
|
|
@@ -2169,7 +2450,7 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2169
2450
|
if code is not None:
|
|
2170
2451
|
code = code.upper()
|
|
2171
2452
|
if code != 'USDC':
|
|
2172
|
-
raise NotSupported(self.id + 'withdraw() only support USDC')
|
|
2453
|
+
raise NotSupported(self.id + ' withdraw() only support USDC')
|
|
2173
2454
|
currency = self.currency(code)
|
|
2174
2455
|
verifyingContractAddress = self.safe_string(self.options, 'verifyingContractAddress')
|
|
2175
2456
|
chainId = self.safe_string(params, 'chainId')
|
|
@@ -2241,7 +2522,9 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2241
2522
|
async def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
|
2242
2523
|
"""
|
|
2243
2524
|
fetch the set leverage for a market
|
|
2244
|
-
|
|
2525
|
+
|
|
2526
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-account-information
|
|
2527
|
+
|
|
2245
2528
|
:param str symbol: unified market symbol
|
|
2246
2529
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2247
2530
|
:returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
|
|
@@ -2279,11 +2562,14 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2279
2562
|
data = self.safe_dict(response, 'data', {})
|
|
2280
2563
|
return self.parse_leverage(data, market)
|
|
2281
2564
|
|
|
2282
|
-
async def set_leverage(self, leverage:
|
|
2565
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
|
2283
2566
|
"""
|
|
2284
2567
|
set the level of leverage for a market
|
|
2285
|
-
|
|
2286
|
-
|
|
2568
|
+
|
|
2569
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/update-leverage-setting
|
|
2570
|
+
|
|
2571
|
+
:param int [leverage]: the rate of leverage
|
|
2572
|
+
:param str [symbol]: unified market symbol
|
|
2287
2573
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2288
2574
|
:returns dict: response from the exchange
|
|
2289
2575
|
"""
|
|
@@ -2364,9 +2650,11 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2364
2650
|
'takeProfitPrice': None,
|
|
2365
2651
|
})
|
|
2366
2652
|
|
|
2367
|
-
async def fetch_position(self, symbol: Str
|
|
2653
|
+
async def fetch_position(self, symbol: Str, params={}):
|
|
2368
2654
|
"""
|
|
2369
|
-
|
|
2655
|
+
|
|
2656
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-one-position-info
|
|
2657
|
+
|
|
2370
2658
|
fetch data on an open position
|
|
2371
2659
|
:param str symbol: unified market symbol of the market the position is held in
|
|
2372
2660
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -2407,13 +2695,14 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2407
2695
|
data = self.safe_dict(response, 'data')
|
|
2408
2696
|
return self.parse_position(data, market)
|
|
2409
2697
|
|
|
2410
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
|
2698
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
|
2411
2699
|
"""
|
|
2412
2700
|
fetch all open positions
|
|
2413
|
-
|
|
2701
|
+
|
|
2702
|
+
https://orderly.network/docs/build-on-evm/evm-api/restful-api/private/get-all-positions-info
|
|
2703
|
+
|
|
2414
2704
|
:param str[] [symbols]: list of unified market symbols
|
|
2415
2705
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2416
|
-
:param str [method]: method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
|
2417
2706
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
|
2418
2707
|
"""
|
|
2419
2708
|
await self.load_markets()
|
|
@@ -2491,9 +2780,12 @@ class woofipro(Exchange, ImplicitAPI):
|
|
|
2491
2780
|
auth = ''
|
|
2492
2781
|
ts = str(self.nonce())
|
|
2493
2782
|
url += pathWithParams
|
|
2783
|
+
apiKey = self.apiKey
|
|
2784
|
+
if apiKey.find('ed25519:') < 0:
|
|
2785
|
+
apiKey = 'ed25519:' + apiKey
|
|
2494
2786
|
headers = {
|
|
2495
2787
|
'orderly-account-id': self.accountId,
|
|
2496
|
-
'orderly-key':
|
|
2788
|
+
'orderly-key': apiKey,
|
|
2497
2789
|
'orderly-timestamp': ts,
|
|
2498
2790
|
}
|
|
2499
2791
|
auth = ts + method + '/' + version + '/' + pathWithParams
|