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