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/async_support/bitmex.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.bitmex import ImplicitAPI
|
|
8
8
|
import hashlib
|
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, Leverages, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
|
9
|
+
from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Leverage, Leverages, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction
|
|
10
10
|
from typing import List
|
|
11
11
|
from ccxt.base.errors import ExchangeError
|
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
|
@@ -25,7 +25,7 @@ from ccxt.base.precise import Precise
|
|
|
25
25
|
|
|
26
26
|
class bitmex(Exchange, ImplicitAPI):
|
|
27
27
|
|
|
28
|
-
def describe(self):
|
|
28
|
+
def describe(self) -> Any:
|
|
29
29
|
return self.deep_extend(super(bitmex, self).describe(), {
|
|
30
30
|
'id': 'bitmex',
|
|
31
31
|
'name': 'BitMEX',
|
|
@@ -55,7 +55,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
55
55
|
'closePosition': True,
|
|
56
56
|
'createOrder': True,
|
|
57
57
|
'createReduceOnlyOrder': True,
|
|
58
|
+
'createStopOrder': True,
|
|
58
59
|
'createTrailingAmountOrder': True,
|
|
60
|
+
'createTriggerOrder': True,
|
|
59
61
|
'editOrder': True,
|
|
60
62
|
'fetchBalance': True,
|
|
61
63
|
'fetchClosedOrders': True,
|
|
@@ -67,7 +69,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
67
69
|
'fetchDepositWithdrawFee': 'emulated',
|
|
68
70
|
'fetchDepositWithdrawFees': True,
|
|
69
71
|
'fetchFundingHistory': False,
|
|
70
|
-
'fetchFundingRate':
|
|
72
|
+
'fetchFundingRate': 'emulated', # emulated in exchange
|
|
71
73
|
'fetchFundingRateHistory': True,
|
|
72
74
|
'fetchFundingRates': True,
|
|
73
75
|
'fetchIndexOHLCV': False,
|
|
@@ -99,6 +101,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
99
101
|
'fetchTransactions': 'emulated',
|
|
100
102
|
'fetchTransfer': False,
|
|
101
103
|
'fetchTransfers': False,
|
|
104
|
+
'index': True,
|
|
102
105
|
'reduceMargin': None,
|
|
103
106
|
'sandbox': True,
|
|
104
107
|
'setLeverage': True,
|
|
@@ -119,7 +122,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
119
122
|
'public': 'https://testnet.bitmex.com',
|
|
120
123
|
'private': 'https://testnet.bitmex.com',
|
|
121
124
|
},
|
|
122
|
-
'logo': 'https://github.com/
|
|
125
|
+
'logo': 'https://github.com/user-attachments/assets/c78425ab-78d5-49d6-bd14-db7734798f04',
|
|
123
126
|
'api': {
|
|
124
127
|
'public': 'https://www.bitmex.com',
|
|
125
128
|
'private': 'https://www.bitmex.com',
|
|
@@ -285,6 +288,113 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
285
288
|
'ADA': 'ada',
|
|
286
289
|
},
|
|
287
290
|
},
|
|
291
|
+
'features': {
|
|
292
|
+
'default': {
|
|
293
|
+
'sandbox': True,
|
|
294
|
+
'createOrder': {
|
|
295
|
+
'marginMode': True,
|
|
296
|
+
'triggerPrice': True,
|
|
297
|
+
'triggerPriceType': {
|
|
298
|
+
'last': True,
|
|
299
|
+
'mark': True,
|
|
300
|
+
},
|
|
301
|
+
'triggerDirection': True,
|
|
302
|
+
'stopLossPrice': False,
|
|
303
|
+
'takeProfitPrice': False,
|
|
304
|
+
'attachedStopLossTakeProfit': None,
|
|
305
|
+
'timeInForce': {
|
|
306
|
+
'IOC': True,
|
|
307
|
+
'FOK': True,
|
|
308
|
+
'PO': True,
|
|
309
|
+
'GTD': False,
|
|
310
|
+
},
|
|
311
|
+
'hedged': False,
|
|
312
|
+
'trailing': True,
|
|
313
|
+
'marketBuyRequiresPrice': False,
|
|
314
|
+
'marketBuyByCost': False,
|
|
315
|
+
# exchange-supported features
|
|
316
|
+
# 'selfTradePrevention': True,
|
|
317
|
+
# 'twap': False,
|
|
318
|
+
# 'iceberg': False,
|
|
319
|
+
# 'oco': False,
|
|
320
|
+
},
|
|
321
|
+
'createOrders': None,
|
|
322
|
+
'fetchMyTrades': {
|
|
323
|
+
'marginMode': False,
|
|
324
|
+
'limit': 500,
|
|
325
|
+
'daysBack': None,
|
|
326
|
+
'untilDays': 1000000,
|
|
327
|
+
'symbolRequired': False,
|
|
328
|
+
},
|
|
329
|
+
'fetchOrder': {
|
|
330
|
+
'marginMode': False,
|
|
331
|
+
'trigger': False,
|
|
332
|
+
'trailing': False,
|
|
333
|
+
'symbolRequired': False,
|
|
334
|
+
},
|
|
335
|
+
'fetchOpenOrders': {
|
|
336
|
+
'marginMode': False,
|
|
337
|
+
'limit': 500,
|
|
338
|
+
'trigger': False,
|
|
339
|
+
'trailing': False,
|
|
340
|
+
'symbolRequired': False,
|
|
341
|
+
},
|
|
342
|
+
'fetchOrders': {
|
|
343
|
+
'marginMode': False,
|
|
344
|
+
'limit': 500,
|
|
345
|
+
'daysBack': None,
|
|
346
|
+
'untilDays': 1000000,
|
|
347
|
+
'trigger': False,
|
|
348
|
+
'trailing': False,
|
|
349
|
+
'symbolRequired': False,
|
|
350
|
+
},
|
|
351
|
+
'fetchClosedOrders': {
|
|
352
|
+
'marginMode': False,
|
|
353
|
+
'limit': 500,
|
|
354
|
+
'daysBack': None,
|
|
355
|
+
'daysBackCanceled': None,
|
|
356
|
+
'untilDays': 1000000,
|
|
357
|
+
'trigger': False,
|
|
358
|
+
'trailing': False,
|
|
359
|
+
'symbolRequired': False,
|
|
360
|
+
},
|
|
361
|
+
'fetchOHLCV': {
|
|
362
|
+
'limit': 10000,
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
'spot': {
|
|
366
|
+
'extends': 'default',
|
|
367
|
+
'createOrder': {
|
|
368
|
+
'triggerPriceType': {
|
|
369
|
+
'index': False,
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
'derivatives': {
|
|
374
|
+
'extends': 'default',
|
|
375
|
+
'createOrder': {
|
|
376
|
+
'triggerPriceType': {
|
|
377
|
+
'index': True,
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
'swap': {
|
|
382
|
+
'linear': {
|
|
383
|
+
'extends': 'derivatives',
|
|
384
|
+
},
|
|
385
|
+
'inverse': {
|
|
386
|
+
'extends': 'derivatives',
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
'future': {
|
|
390
|
+
'linear': {
|
|
391
|
+
'extends': 'derivatives',
|
|
392
|
+
},
|
|
393
|
+
'inverse': {
|
|
394
|
+
'extends': 'derivatives',
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
288
398
|
'commonCurrencies': {
|
|
289
399
|
'USDt': 'USDT',
|
|
290
400
|
'XBt': 'BTC',
|
|
@@ -299,7 +409,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
299
409
|
async def fetch_currencies(self, params={}) -> Currencies:
|
|
300
410
|
"""
|
|
301
411
|
fetches all available currencies on an exchange
|
|
302
|
-
|
|
412
|
+
|
|
413
|
+
https://www.bitmex.com/api/explorer/#not /Wallet/Wallet_getAssetsConfig
|
|
414
|
+
|
|
303
415
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
304
416
|
:returns dict: an associative dictionary of currencies
|
|
305
417
|
"""
|
|
@@ -316,8 +428,8 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
316
428
|
# # "mediumPrecision": "8",
|
|
317
429
|
# # "shorterPrecision": "4",
|
|
318
430
|
# # "symbol": "₿",
|
|
319
|
-
# # "weight": "1",
|
|
320
431
|
# # "tickLog": "0",
|
|
432
|
+
# # "weight": "1",
|
|
321
433
|
# "enabled": True,
|
|
322
434
|
# "isMarginCurrency": True,
|
|
323
435
|
# "minDepositAmount": "10000",
|
|
@@ -392,6 +504,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
392
504
|
maxWithdrawal = self.parse_number(Precise.string_mul(maxWithdrawalString, precisionString))
|
|
393
505
|
minDepositString = self.safe_string(currency, 'minDepositAmount')
|
|
394
506
|
minDeposit = self.parse_number(Precise.string_mul(minDepositString, precisionString))
|
|
507
|
+
isCrypto = self.safe_string(currency, 'currencyType') == 'Crypto'
|
|
395
508
|
result[code] = {
|
|
396
509
|
'id': id,
|
|
397
510
|
'code': code,
|
|
@@ -417,6 +530,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
417
530
|
},
|
|
418
531
|
},
|
|
419
532
|
'networks': networks,
|
|
533
|
+
'type': 'crypto' if isCrypto else 'other',
|
|
420
534
|
}
|
|
421
535
|
return result
|
|
422
536
|
|
|
@@ -462,7 +576,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
462
576
|
async def fetch_markets(self, params={}) -> List[Market]:
|
|
463
577
|
"""
|
|
464
578
|
retrieves data on all markets for bitmex
|
|
465
|
-
|
|
579
|
+
|
|
580
|
+
https://www.bitmex.com/api/explorer/#not /Instrument/Instrument_getActive
|
|
581
|
+
|
|
466
582
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
467
583
|
:returns dict[]: an array of objects representing market data
|
|
468
584
|
"""
|
|
@@ -616,7 +732,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
616
732
|
isQuanto = self.safe_value(market, 'isQuanto') # self is True when BASE and SETTLE are different, i.e. AXS/XXX:BTC
|
|
617
733
|
linear = (not isInverse and not isQuanto) if contract else None
|
|
618
734
|
status = self.safe_string(market, 'state')
|
|
619
|
-
active = status
|
|
735
|
+
active = status == 'Open' # Open, Settled, Unlisted
|
|
620
736
|
expiry = None
|
|
621
737
|
expiryDatetime = None
|
|
622
738
|
symbol = None
|
|
@@ -630,9 +746,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
630
746
|
else:
|
|
631
747
|
multiplierString = Precise.string_abs(self.safe_string(market, 'multiplier'))
|
|
632
748
|
contractSize = self.parse_number(multiplierString)
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
749
|
+
expiryDatetime = self.safe_string(market, 'expiry')
|
|
750
|
+
expiry = self.parse8601(expiryDatetime)
|
|
751
|
+
if expiry is not None:
|
|
636
752
|
symbol = symbol + '-' + self.yymmdd(expiry)
|
|
637
753
|
else:
|
|
638
754
|
# for index/exotic markets, default to id
|
|
@@ -643,6 +759,11 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
643
759
|
maxOrderQty = self.safe_number(market, 'maxOrderQty')
|
|
644
760
|
initMargin = self.safe_string(market, 'initMargin', '1')
|
|
645
761
|
maxLeverage = self.parse_number(Precise.string_div('1', initMargin))
|
|
762
|
+
# subtype should be None for spot markets
|
|
763
|
+
if spot:
|
|
764
|
+
isInverse = None
|
|
765
|
+
isQuanto = None
|
|
766
|
+
linear = None
|
|
646
767
|
return {
|
|
647
768
|
'id': id,
|
|
648
769
|
'symbol': symbol,
|
|
@@ -692,7 +813,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
692
813
|
'max': maxOrderQty if positionIsQuote else None,
|
|
693
814
|
},
|
|
694
815
|
},
|
|
695
|
-
'created':
|
|
816
|
+
'created': None, # 'listing' field is buggy, e.g. 2200-02-01T00:00:00.000Z
|
|
696
817
|
'info': market,
|
|
697
818
|
}
|
|
698
819
|
|
|
@@ -760,7 +881,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
760
881
|
async def fetch_balance(self, params={}) -> Balances:
|
|
761
882
|
"""
|
|
762
883
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
|
763
|
-
|
|
884
|
+
|
|
885
|
+
https://www.bitmex.com/api/explorer/#not /User/User_getMargin
|
|
886
|
+
|
|
764
887
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
765
888
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
|
766
889
|
"""
|
|
@@ -821,7 +944,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
821
944
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
|
822
945
|
"""
|
|
823
946
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
|
824
|
-
|
|
947
|
+
|
|
948
|
+
https://www.bitmex.com/api/explorer/#not /OrderBook/OrderBook_getL2
|
|
949
|
+
|
|
825
950
|
:param str symbol: unified symbol of the market to fetch the order book for
|
|
826
951
|
:param int [limit]: the maximum amount of order book entries to return
|
|
827
952
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -852,7 +977,8 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
852
977
|
# https://github.com/ccxt/ccxt/issues/4927
|
|
853
978
|
# the exchange sometimes returns null price in the orderbook
|
|
854
979
|
if price is not None:
|
|
855
|
-
result[side]
|
|
980
|
+
resultSide = result[side]
|
|
981
|
+
resultSide.append([price, amount])
|
|
856
982
|
result['bids'] = self.sort_by(result['bids'], 0, True)
|
|
857
983
|
result['asks'] = self.sort_by(result['asks'], 0)
|
|
858
984
|
return result
|
|
@@ -860,7 +986,10 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
860
986
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
|
861
987
|
"""
|
|
862
988
|
fetches information on an order made by the user
|
|
863
|
-
|
|
989
|
+
|
|
990
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_getOrders
|
|
991
|
+
|
|
992
|
+
:param str id: the order id
|
|
864
993
|
:param str symbol: unified symbol of the market the order was made in
|
|
865
994
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
866
995
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
@@ -878,7 +1007,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
878
1007
|
|
|
879
1008
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
880
1009
|
"""
|
|
881
|
-
|
|
1010
|
+
|
|
1011
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_getOrders
|
|
1012
|
+
|
|
882
1013
|
fetches information on multiple orders made by the user
|
|
883
1014
|
:param str symbol: unified market symbol of the market orders were made in
|
|
884
1015
|
:param int [since]: the earliest time in ms to fetch orders for
|
|
@@ -918,7 +1049,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
918
1049
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
919
1050
|
"""
|
|
920
1051
|
fetch all unfilled currently open orders
|
|
921
|
-
|
|
1052
|
+
|
|
1053
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_getOrders
|
|
1054
|
+
|
|
922
1055
|
:param str symbol: unified market symbol
|
|
923
1056
|
:param int [since]: the earliest time in ms to fetch open orders for
|
|
924
1057
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
|
@@ -935,7 +1068,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
935
1068
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
936
1069
|
"""
|
|
937
1070
|
fetches information on multiple closed orders made by the user
|
|
938
|
-
|
|
1071
|
+
|
|
1072
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_getOrders
|
|
1073
|
+
|
|
939
1074
|
:param str symbol: unified market symbol of the market orders were made in
|
|
940
1075
|
:param int [since]: the earliest time in ms to fetch orders for
|
|
941
1076
|
:param int [limit]: the maximum number of order structures to retrieve
|
|
@@ -949,7 +1084,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
949
1084
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
950
1085
|
"""
|
|
951
1086
|
fetch all trades made by the user
|
|
952
|
-
|
|
1087
|
+
|
|
1088
|
+
https://www.bitmex.com/api/explorer/#not /Execution/Execution_getTradeHistory
|
|
1089
|
+
|
|
953
1090
|
:param str symbol: unified market symbol
|
|
954
1091
|
:param int [since]: the earliest time in ms to fetch trades for
|
|
955
1092
|
:param int [limit]: the maximum number of trades structures to retrieve
|
|
@@ -970,7 +1107,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
970
1107
|
if since is not None:
|
|
971
1108
|
request['startTime'] = self.iso8601(since)
|
|
972
1109
|
if limit is not None:
|
|
973
|
-
request['count'] = limit
|
|
1110
|
+
request['count'] = min(500, limit)
|
|
974
1111
|
until = self.safe_integer_2(params, 'until', 'endTime')
|
|
975
1112
|
if until is not None:
|
|
976
1113
|
params = self.omit(params, ['until'])
|
|
@@ -1049,7 +1186,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1049
1186
|
}
|
|
1050
1187
|
return self.safe_string(types, type, type)
|
|
1051
1188
|
|
|
1052
|
-
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
|
1189
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
|
|
1053
1190
|
#
|
|
1054
1191
|
# {
|
|
1055
1192
|
# "transactID": "69573da3-7744-5467-3207-89fd6efe7a47",
|
|
@@ -1098,6 +1235,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1098
1235
|
type = self.parse_ledger_entry_type(self.safe_string(item, 'transactType'))
|
|
1099
1236
|
currencyId = self.safe_string(item, 'currency')
|
|
1100
1237
|
code = self.safe_currency_code(currencyId, currency)
|
|
1238
|
+
currency = self.safe_currency(currencyId, currency)
|
|
1101
1239
|
amountString = self.safe_string(item, 'amount')
|
|
1102
1240
|
amount = self.convert_to_real_amount(code, amountString)
|
|
1103
1241
|
timestamp = self.parse8601(self.safe_string(item, 'transactTime'))
|
|
@@ -1106,13 +1244,14 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1106
1244
|
# set the timestamp to zero, 1970 Jan 1 00:00:00
|
|
1107
1245
|
# for unrealized pnl and other transactions without a timestamp
|
|
1108
1246
|
timestamp = 0 # see comments above
|
|
1247
|
+
fee = None
|
|
1109
1248
|
feeCost = self.safe_string(item, 'fee')
|
|
1110
1249
|
if feeCost is not None:
|
|
1111
1250
|
feeCost = self.convert_to_real_amount(code, feeCost)
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1251
|
+
fee = {
|
|
1252
|
+
'cost': self.parse_number(feeCost),
|
|
1253
|
+
'currency': code,
|
|
1254
|
+
}
|
|
1116
1255
|
after = self.safe_string(item, 'walletBalance')
|
|
1117
1256
|
if after is not None:
|
|
1118
1257
|
after = self.convert_to_real_amount(code, after)
|
|
@@ -1124,9 +1263,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1124
1263
|
else:
|
|
1125
1264
|
direction = 'in'
|
|
1126
1265
|
status = self.parse_transaction_status(self.safe_string(item, 'transactStatus'))
|
|
1127
|
-
return {
|
|
1128
|
-
'id': id,
|
|
1266
|
+
return self.safe_ledger_entry({
|
|
1129
1267
|
'info': item,
|
|
1268
|
+
'id': id,
|
|
1130
1269
|
'timestamp': timestamp,
|
|
1131
1270
|
'datetime': self.iso8601(timestamp),
|
|
1132
1271
|
'direction': direction,
|
|
@@ -1135,22 +1274,24 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1135
1274
|
'referenceAccount': referenceAccount,
|
|
1136
1275
|
'type': type,
|
|
1137
1276
|
'currency': code,
|
|
1138
|
-
'amount': amount,
|
|
1277
|
+
'amount': self.parse_number(amount),
|
|
1139
1278
|
'before': before,
|
|
1140
1279
|
'after': self.parse_number(after),
|
|
1141
1280
|
'status': status,
|
|
1142
1281
|
'fee': fee,
|
|
1143
|
-
}
|
|
1282
|
+
}, currency)
|
|
1144
1283
|
|
|
1145
|
-
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1284
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
|
1146
1285
|
"""
|
|
1147
|
-
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
1148
|
-
|
|
1149
|
-
|
|
1286
|
+
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
1287
|
+
|
|
1288
|
+
https://www.bitmex.com/api/explorer/#not /User/User_getWalletHistory
|
|
1289
|
+
|
|
1290
|
+
:param str [code]: unified currency code, default is None
|
|
1150
1291
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
|
1151
|
-
:param int [limit]: max number of ledger
|
|
1292
|
+
:param int [limit]: max number of ledger entries to return, default is None
|
|
1152
1293
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1153
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
|
1294
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
|
1154
1295
|
"""
|
|
1155
1296
|
await self.load_markets()
|
|
1156
1297
|
request: dict = {
|
|
@@ -1193,7 +1334,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1193
1334
|
async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
|
1194
1335
|
"""
|
|
1195
1336
|
fetch history of deposits and withdrawals
|
|
1196
|
-
|
|
1337
|
+
|
|
1338
|
+
https://www.bitmex.com/api/explorer/#not /User/User_getWalletHistory
|
|
1339
|
+
|
|
1197
1340
|
:param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
|
|
1198
1341
|
:param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
|
|
1199
1342
|
:param int [limit]: max number of deposit/withdrawals to return, default is None
|
|
@@ -1305,7 +1448,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1305
1448
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
|
1306
1449
|
"""
|
|
1307
1450
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1308
|
-
|
|
1451
|
+
|
|
1452
|
+
https://www.bitmex.com/api/explorer/#not /Instrument/Instrument_get
|
|
1453
|
+
|
|
1309
1454
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
|
1310
1455
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1311
1456
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
@@ -1324,7 +1469,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1324
1469
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
|
1325
1470
|
"""
|
|
1326
1471
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1327
|
-
|
|
1472
|
+
|
|
1473
|
+
https://www.bitmex.com/api/explorer/#not /Instrument/Instrument_getActiveAndIndices
|
|
1474
|
+
|
|
1328
1475
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1329
1476
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1330
1477
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
@@ -1368,6 +1515,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1368
1515
|
'average': None,
|
|
1369
1516
|
'baseVolume': self.safe_string(ticker, 'homeNotional24h'),
|
|
1370
1517
|
'quoteVolume': self.safe_string(ticker, 'foreignNotional24h'),
|
|
1518
|
+
'markPrice': self.safe_string(ticker, 'markPrice'),
|
|
1371
1519
|
'info': ticker,
|
|
1372
1520
|
}, market)
|
|
1373
1521
|
|
|
@@ -1404,7 +1552,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1404
1552
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
|
1405
1553
|
"""
|
|
1406
1554
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1407
|
-
|
|
1555
|
+
|
|
1556
|
+
https://www.bitmex.com/api/explorer/#not /Trade/Trade_getBucketed
|
|
1557
|
+
|
|
1408
1558
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
1409
1559
|
:param str timeframe: the length of time each candle represents
|
|
1410
1560
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
|
@@ -1437,7 +1587,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1437
1587
|
}
|
|
1438
1588
|
if limit is not None:
|
|
1439
1589
|
request['count'] = limit # default 100, max 500
|
|
1440
|
-
until = self.
|
|
1590
|
+
until = self.safe_integer(params, 'until')
|
|
1441
1591
|
if until is not None:
|
|
1442
1592
|
params = self.omit(params, ['until'])
|
|
1443
1593
|
request['endTime'] = self.iso8601(until)
|
|
@@ -1671,7 +1821,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1671
1821
|
if execInst is not None:
|
|
1672
1822
|
postOnly = (execInst == 'ParticipateDoNotInitiate')
|
|
1673
1823
|
timestamp = self.parse8601(self.safe_string(order, 'timestamp'))
|
|
1674
|
-
|
|
1824
|
+
triggerPrice = self.safe_number(order, 'stopPx')
|
|
1675
1825
|
remaining = self.safe_string(order, 'leavesQty')
|
|
1676
1826
|
return self.safe_order({
|
|
1677
1827
|
'info': order,
|
|
@@ -1686,8 +1836,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1686
1836
|
'postOnly': postOnly,
|
|
1687
1837
|
'side': self.safe_string_lower(order, 'side'),
|
|
1688
1838
|
'price': self.safe_string(order, 'price'),
|
|
1689
|
-
'
|
|
1690
|
-
'triggerPrice': stopPrice,
|
|
1839
|
+
'triggerPrice': triggerPrice,
|
|
1691
1840
|
'amount': amount,
|
|
1692
1841
|
'cost': cost,
|
|
1693
1842
|
'average': average,
|
|
@@ -1701,7 +1850,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1701
1850
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
|
1702
1851
|
"""
|
|
1703
1852
|
get the list of most recent trades for a particular symbol
|
|
1704
|
-
|
|
1853
|
+
|
|
1854
|
+
https://www.bitmex.com/api/explorer/#not /Trade/Trade_get
|
|
1855
|
+
|
|
1705
1856
|
:param str symbol: unified symbol of the market to fetch trades for
|
|
1706
1857
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
|
1707
1858
|
:param int [limit]: the maximum amount of trades to fetch
|
|
@@ -1763,15 +1914,17 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1763
1914
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
|
1764
1915
|
"""
|
|
1765
1916
|
create a trade order
|
|
1766
|
-
|
|
1917
|
+
|
|
1918
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_new
|
|
1919
|
+
|
|
1767
1920
|
:param str symbol: unified symbol of the market to create an order in
|
|
1768
1921
|
:param str type: 'market' or 'limit'
|
|
1769
1922
|
:param str side: 'buy' or 'sell'
|
|
1770
1923
|
:param float amount: how much of currency you want to trade in units of base currency
|
|
1771
|
-
:param float [price]: the price at which the order is to be
|
|
1924
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1772
1925
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1773
1926
|
:param dict [params.triggerPrice]: the price at which a trigger order is triggered at
|
|
1774
|
-
:param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - '
|
|
1927
|
+
:param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - 'ascending' or 'descending'
|
|
1775
1928
|
:param float [params.trailingAmount]: the quote amount to trail away from the current market price
|
|
1776
1929
|
:returns dict: an `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
|
|
1777
1930
|
"""
|
|
@@ -1798,7 +1951,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1798
1951
|
isTrailingAmountOrder = trailingAmount is not None
|
|
1799
1952
|
if isTriggerOrder or isTrailingAmountOrder:
|
|
1800
1953
|
triggerDirection = self.safe_string(params, 'triggerDirection')
|
|
1801
|
-
triggerAbove = (triggerDirection == 'above')
|
|
1954
|
+
triggerAbove = ((triggerDirection == 'ascending') or (triggerDirection == 'above'))
|
|
1802
1955
|
if (type == 'limit') or (type == 'market'):
|
|
1803
1956
|
self.check_required_argument('createOrder', triggerDirection, 'triggerDirection', ['above', 'below'])
|
|
1804
1957
|
if type == 'limit':
|
|
@@ -1821,7 +1974,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1821
1974
|
else:
|
|
1822
1975
|
if triggerPrice is None:
|
|
1823
1976
|
# if exchange specific trigger types were provided
|
|
1824
|
-
raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice
|
|
1977
|
+
raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice parameter for the ' + orderType + ' order type')
|
|
1825
1978
|
request['stopPx'] = self.parse_to_numeric(self.price_to_precision(symbol, triggerPrice))
|
|
1826
1979
|
request['ordType'] = orderType
|
|
1827
1980
|
params = self.omit(params, ['triggerPrice', 'stopPrice', 'stopPx', 'triggerDirection', 'trailingAmount'])
|
|
@@ -1841,7 +1994,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1841
1994
|
isTrailingAmountOrder = trailingAmount is not None
|
|
1842
1995
|
if isTrailingAmountOrder:
|
|
1843
1996
|
triggerDirection = self.safe_string(params, 'triggerDirection')
|
|
1844
|
-
triggerAbove = (triggerDirection == 'above')
|
|
1997
|
+
triggerAbove = ((triggerDirection == 'ascending') or (triggerDirection == 'above'))
|
|
1845
1998
|
if (type == 'limit') or (type == 'market'):
|
|
1846
1999
|
self.check_required_argument('createOrder', triggerDirection, 'triggerDirection', ['above', 'below'])
|
|
1847
2000
|
orderType = None
|
|
@@ -1883,7 +2036,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1883
2036
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
|
1884
2037
|
"""
|
|
1885
2038
|
cancels an open order
|
|
1886
|
-
|
|
2039
|
+
|
|
2040
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_cancel
|
|
2041
|
+
|
|
1887
2042
|
:param str id: order id
|
|
1888
2043
|
:param str symbol: not used by bitmex cancelOrder()
|
|
1889
2044
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -1909,7 +2064,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1909
2064
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
|
1910
2065
|
"""
|
|
1911
2066
|
cancel multiple orders
|
|
1912
|
-
|
|
2067
|
+
|
|
2068
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_cancel
|
|
2069
|
+
|
|
1913
2070
|
:param str[] ids: order ids
|
|
1914
2071
|
:param str symbol: not used by bitmex cancelOrders()
|
|
1915
2072
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -1931,7 +2088,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1931
2088
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
|
1932
2089
|
"""
|
|
1933
2090
|
cancel all open orders
|
|
1934
|
-
|
|
2091
|
+
|
|
2092
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_cancelAll
|
|
2093
|
+
|
|
1935
2094
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
|
1936
2095
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1937
2096
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
|
@@ -1987,7 +2146,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
1987
2146
|
async def cancel_all_orders_after(self, timeout: Int, params={}):
|
|
1988
2147
|
"""
|
|
1989
2148
|
dead man's switch, cancel all orders after the given timeout
|
|
1990
|
-
|
|
2149
|
+
|
|
2150
|
+
https://www.bitmex.com/api/explorer/#not /Order/Order_cancelAllAfter
|
|
2151
|
+
|
|
1991
2152
|
:param number timeout: time in milliseconds, 0 represents cancel the timer
|
|
1992
2153
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1993
2154
|
:returns dict: the api result
|
|
@@ -2008,7 +2169,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2008
2169
|
async def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
|
2009
2170
|
"""
|
|
2010
2171
|
fetch the set leverage for all contract markets
|
|
2011
|
-
|
|
2172
|
+
|
|
2173
|
+
https://www.bitmex.com/api/explorer/#not /Position/Position_get
|
|
2174
|
+
|
|
2012
2175
|
:param str[] [symbols]: a list of unified market symbols
|
|
2013
2176
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2014
2177
|
:returns dict: a list of `leverage structures <https://docs.ccxt.com/#/?id=leverage-structure>`
|
|
@@ -2027,10 +2190,12 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2027
2190
|
'shortLeverage': self.safe_integer(leverage, 'leverage'),
|
|
2028
2191
|
}
|
|
2029
2192
|
|
|
2030
|
-
async def fetch_positions(self, symbols: Strings = None, params={}):
|
|
2193
|
+
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
|
2031
2194
|
"""
|
|
2032
2195
|
fetch all open positions
|
|
2033
|
-
|
|
2196
|
+
|
|
2197
|
+
https://www.bitmex.com/api/explorer/#not /Position/Position_get
|
|
2198
|
+
|
|
2034
2199
|
:param str[]|None symbols: list of unified market symbols
|
|
2035
2200
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2036
2201
|
:returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
|
@@ -2281,10 +2446,12 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2281
2446
|
'takeProfitPrice': None,
|
|
2282
2447
|
})
|
|
2283
2448
|
|
|
2284
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
|
2449
|
+
async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
|
2285
2450
|
"""
|
|
2286
2451
|
make a withdrawal
|
|
2287
|
-
|
|
2452
|
+
|
|
2453
|
+
https://www.bitmex.com/api/explorer/#not /User/User_requestWithdrawal
|
|
2454
|
+
|
|
2288
2455
|
:param str code: unified currency code
|
|
2289
2456
|
:param float amount: the amount to withdraw
|
|
2290
2457
|
:param str address: the address to withdraw to
|
|
@@ -2307,6 +2474,8 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2307
2474
|
# 'otpToken': '123456', # requires if two-factor auth(OTP) is enabled
|
|
2308
2475
|
# 'fee': 0.001, # bitcoin network fee
|
|
2309
2476
|
}
|
|
2477
|
+
if self.twofa is not None:
|
|
2478
|
+
request['otpToken'] = self.totp(self.twofa)
|
|
2310
2479
|
response = await self.privatePostUserRequestWithdrawal(self.extend(request, params))
|
|
2311
2480
|
#
|
|
2312
2481
|
# {
|
|
@@ -2327,13 +2496,15 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2327
2496
|
#
|
|
2328
2497
|
return self.parse_transaction(response, currency)
|
|
2329
2498
|
|
|
2330
|
-
async def fetch_funding_rates(self, symbols: Strings = None, params={}):
|
|
2499
|
+
async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
|
2331
2500
|
"""
|
|
2332
2501
|
fetch the funding rate for multiple markets
|
|
2333
|
-
|
|
2502
|
+
|
|
2503
|
+
https://www.bitmex.com/api/explorer/#not /Instrument/Instrument_getActiveAndIndices
|
|
2504
|
+
|
|
2334
2505
|
:param str[]|None symbols: list of unified market symbols
|
|
2335
2506
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2336
|
-
:returns dict: a
|
|
2507
|
+
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
|
|
2337
2508
|
"""
|
|
2338
2509
|
await self.load_markets()
|
|
2339
2510
|
response = await self.publicGetInstrumentActiveAndIndices(params)
|
|
@@ -2350,7 +2521,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2350
2521
|
result = self.parse_funding_rates(filteredResponse)
|
|
2351
2522
|
return self.filter_by_array(result, 'symbol', symbols)
|
|
2352
2523
|
|
|
2353
|
-
def parse_funding_rate(self, contract, market: Market = None):
|
|
2524
|
+
def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
|
|
2354
2525
|
# see response sample under "fetchMarkets" because same endpoint is being used here
|
|
2355
2526
|
datetime = self.safe_string(contract, 'timestamp')
|
|
2356
2527
|
marketId = self.safe_string(contract, 'symbol')
|
|
@@ -2365,7 +2536,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2365
2536
|
'timestamp': self.parse8601(datetime),
|
|
2366
2537
|
'datetime': datetime,
|
|
2367
2538
|
'fundingRate': self.safe_number(contract, 'fundingRate'),
|
|
2368
|
-
'fundingTimestamp': self.
|
|
2539
|
+
'fundingTimestamp': self.parse8601(fundingDatetime),
|
|
2369
2540
|
'fundingDatetime': fundingDatetime,
|
|
2370
2541
|
'nextFundingRate': self.safe_number(contract, 'indicativeFundingRate'),
|
|
2371
2542
|
'nextFundingTimestamp': None,
|
|
@@ -2373,12 +2544,15 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2373
2544
|
'previousFundingRate': None,
|
|
2374
2545
|
'previousFundingTimestamp': None,
|
|
2375
2546
|
'previousFundingDatetime': None,
|
|
2547
|
+
'interval': None,
|
|
2376
2548
|
}
|
|
2377
2549
|
|
|
2378
2550
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
2379
2551
|
"""
|
|
2380
2552
|
Fetches the history of funding rates
|
|
2381
|
-
|
|
2553
|
+
|
|
2554
|
+
https://www.bitmex.com/api/explorer/#not /Funding/Funding_get
|
|
2555
|
+
|
|
2382
2556
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
|
2383
2557
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
|
2384
2558
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
|
@@ -2451,10 +2625,12 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2451
2625
|
'datetime': datetime,
|
|
2452
2626
|
}
|
|
2453
2627
|
|
|
2454
|
-
async def set_leverage(self, leverage:
|
|
2628
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
|
2455
2629
|
"""
|
|
2456
2630
|
set the level of leverage for a market
|
|
2457
|
-
|
|
2631
|
+
|
|
2632
|
+
https://www.bitmex.com/api/explorer/#not /Position/Position_updateLeverage
|
|
2633
|
+
|
|
2458
2634
|
:param float leverage: the rate of leverage
|
|
2459
2635
|
:param str symbol: unified market symbol
|
|
2460
2636
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -2477,7 +2653,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2477
2653
|
async def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|
|
2478
2654
|
"""
|
|
2479
2655
|
set margin mode to 'cross' or 'isolated'
|
|
2480
|
-
|
|
2656
|
+
|
|
2657
|
+
https://www.bitmex.com/api/explorer/#not /Position/Position_isolateMargin
|
|
2658
|
+
|
|
2481
2659
|
:param str marginMode: 'cross' or 'isolated'
|
|
2482
2660
|
:param str symbol: unified market symbol
|
|
2483
2661
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
@@ -2499,10 +2677,12 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2499
2677
|
}
|
|
2500
2678
|
return await self.privatePostPositionIsolate(self.extend(request, params))
|
|
2501
2679
|
|
|
2502
|
-
async def fetch_deposit_address(self, code: str, params={}):
|
|
2680
|
+
async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
|
2503
2681
|
"""
|
|
2504
2682
|
fetch the deposit address for a currency associated with self account
|
|
2505
|
-
|
|
2683
|
+
|
|
2684
|
+
https://www.bitmex.com/api/explorer/#not /User/User_getDepositAddress
|
|
2685
|
+
|
|
2506
2686
|
:param str code: unified currency code
|
|
2507
2687
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2508
2688
|
:param str [params.network]: deposit chain, can view all chains via self.publicGetWalletAssets, default is eth, unless the currency has a default chain within self.options['networks']
|
|
@@ -2524,11 +2704,11 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2524
2704
|
# '"bc1qmex3puyrzn2gduqcnlu70c2uscpyaa9nm2l2j9le2lt2wkgmw33sy7ndjg"'
|
|
2525
2705
|
#
|
|
2526
2706
|
return {
|
|
2707
|
+
'info': response,
|
|
2527
2708
|
'currency': code,
|
|
2709
|
+
'network': networkCode,
|
|
2528
2710
|
'address': response.replace('"', '').replace('"', ''), # Done twice because some languages only replace the first instance
|
|
2529
2711
|
'tag': None,
|
|
2530
|
-
'network': networkCode,
|
|
2531
|
-
'info': response,
|
|
2532
2712
|
}
|
|
2533
2713
|
|
|
2534
2714
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
|
@@ -2594,7 +2774,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2594
2774
|
async def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
|
2595
2775
|
"""
|
|
2596
2776
|
fetch deposit and withdraw fees
|
|
2597
|
-
|
|
2777
|
+
|
|
2778
|
+
https://www.bitmex.com/api/explorer/#not /Wallet/Wallet_getAssetsConfig
|
|
2779
|
+
|
|
2598
2780
|
:param str[]|None codes: list of unified currency codes
|
|
2599
2781
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2600
2782
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
|
@@ -2645,7 +2827,9 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2645
2827
|
async def fetch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
|
2646
2828
|
"""
|
|
2647
2829
|
retrieves the public liquidations of a trading pair
|
|
2648
|
-
|
|
2830
|
+
|
|
2831
|
+
https://www.bitmex.com/api/explorer/#not /Liquidation/Liquidation_get
|
|
2832
|
+
|
|
2649
2833
|
:param str symbol: unified CCXT market symbol
|
|
2650
2834
|
:param int [since]: the earliest time in ms to fetch liquidations for
|
|
2651
2835
|
:param int [limit]: the maximum number of liquidation structures to retrieve
|
|
@@ -2699,6 +2883,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
|
2699
2883
|
'contracts': None,
|
|
2700
2884
|
'contractSize': self.safe_number(market, 'contractSize'),
|
|
2701
2885
|
'price': self.safe_number(liquidation, 'price'),
|
|
2886
|
+
'side': self.safe_string_lower(liquidation, 'side'),
|
|
2702
2887
|
'baseValue': None,
|
|
2703
2888
|
'quoteValue': None,
|
|
2704
2889
|
'timestamp': None,
|