ccxt 4.3.30__py2.py3-none-any.whl → 4.3.31__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 +1 -1
- ccxt/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +21 -21
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +168 -139
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +37 -37
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +35 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +21 -21
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +168 -139
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +19 -19
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +37 -37
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/RECORD +258 -258
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/bitmex.py
CHANGED
@@ -337,7 +337,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
337
337
|
# },
|
338
338
|
# }
|
339
339
|
#
|
340
|
-
result = {}
|
340
|
+
result: dict = {}
|
341
341
|
for i in range(0, len(response)):
|
342
342
|
currency = response[i]
|
343
343
|
asset = self.safe_string(currency, 'asset')
|
@@ -347,7 +347,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
347
347
|
chains = self.safe_value(currency, 'networks', [])
|
348
348
|
depositEnabled = False
|
349
349
|
withdrawEnabled = False
|
350
|
-
networks = {}
|
350
|
+
networks: dict = {}
|
351
351
|
scale = self.safe_string(currency, 'scale')
|
352
352
|
precisionString = self.parse_precision(scale)
|
353
353
|
precision = self.parse_number(precisionString)
|
@@ -744,7 +744,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
744
744
|
# }
|
745
745
|
# ]
|
746
746
|
#
|
747
|
-
result = {'info': response}
|
747
|
+
result: dict = {'info': response}
|
748
748
|
for i in range(0, len(response)):
|
749
749
|
balance = response[i]
|
750
750
|
currencyId = self.safe_string(balance, 'currency')
|
@@ -765,7 +765,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
765
765
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
766
766
|
"""
|
767
767
|
self.load_markets()
|
768
|
-
request = {
|
768
|
+
request: dict = {
|
769
769
|
'currency': 'all',
|
770
770
|
}
|
771
771
|
response = self.privateGetUserMargin(self.extend(request, params))
|
@@ -829,13 +829,13 @@ class bitmex(Exchange, ImplicitAPI):
|
|
829
829
|
"""
|
830
830
|
self.load_markets()
|
831
831
|
market = self.market(symbol)
|
832
|
-
request = {
|
832
|
+
request: dict = {
|
833
833
|
'symbol': market['id'],
|
834
834
|
}
|
835
835
|
if limit is not None:
|
836
836
|
request['depth'] = limit
|
837
837
|
response = self.publicGetOrderBookL2(self.extend(request, params))
|
838
|
-
result = {
|
838
|
+
result: dict = {
|
839
839
|
'symbol': symbol,
|
840
840
|
'bids': [],
|
841
841
|
'asks': [],
|
@@ -865,7 +865,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
865
865
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
866
866
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
867
867
|
"""
|
868
|
-
filter = {
|
868
|
+
filter: dict = {
|
869
869
|
'filter': {
|
870
870
|
'orderID': id,
|
871
871
|
},
|
@@ -894,7 +894,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
894
894
|
if paginate:
|
895
895
|
return self.fetch_paginated_call_dynamic('fetchOrders', symbol, since, limit, params, 100)
|
896
896
|
market = None
|
897
|
-
request = {}
|
897
|
+
request: dict = {}
|
898
898
|
if symbol is not None:
|
899
899
|
market = self.market(symbol)
|
900
900
|
request['symbol'] = market['id']
|
@@ -925,7 +925,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
925
925
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
926
926
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
927
927
|
"""
|
928
|
-
request = {
|
928
|
+
request: dict = {
|
929
929
|
'filter': {
|
930
930
|
'open': True,
|
931
931
|
},
|
@@ -963,7 +963,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
963
963
|
if paginate:
|
964
964
|
return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params, 100)
|
965
965
|
market = None
|
966
|
-
request = {}
|
966
|
+
request: dict = {}
|
967
967
|
if symbol is not None:
|
968
968
|
market = self.market(symbol)
|
969
969
|
request['symbol'] = market['id']
|
@@ -1038,7 +1038,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1038
1038
|
return self.parse_trades(response, market, since, limit)
|
1039
1039
|
|
1040
1040
|
def parse_ledger_entry_type(self, type):
|
1041
|
-
types = {
|
1041
|
+
types: dict = {
|
1042
1042
|
'Withdrawal': 'transaction',
|
1043
1043
|
'RealisedPNL': 'margin',
|
1044
1044
|
'UnrealisedPNL': 'margin',
|
@@ -1049,7 +1049,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1049
1049
|
}
|
1050
1050
|
return self.safe_string(types, type, type)
|
1051
1051
|
|
1052
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
1052
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
1053
1053
|
#
|
1054
1054
|
# {
|
1055
1055
|
# "transactID": "69573da3-7744-5467-3207-89fd6efe7a47",
|
@@ -1153,7 +1153,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1153
1153
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
1154
1154
|
"""
|
1155
1155
|
self.load_markets()
|
1156
|
-
request = {
|
1156
|
+
request: dict = {
|
1157
1157
|
# 'start': 123,
|
1158
1158
|
}
|
1159
1159
|
#
|
@@ -1201,7 +1201,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1201
1201
|
:returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1202
1202
|
"""
|
1203
1203
|
self.load_markets()
|
1204
|
-
request = {
|
1204
|
+
request: dict = {
|
1205
1205
|
'currency': 'all',
|
1206
1206
|
# 'start': 123,
|
1207
1207
|
}
|
@@ -1221,7 +1221,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1221
1221
|
return self.parse_transactions(transactions, currency, since, limit)
|
1222
1222
|
|
1223
1223
|
def parse_transaction_status(self, status):
|
1224
|
-
statuses = {
|
1224
|
+
statuses: dict = {
|
1225
1225
|
'Confirmed': 'pending',
|
1226
1226
|
'Canceled': 'canceled',
|
1227
1227
|
'Completed': 'ok',
|
@@ -1229,7 +1229,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1229
1229
|
}
|
1230
1230
|
return self.safe_string(statuses, status, status)
|
1231
1231
|
|
1232
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1232
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1233
1233
|
#
|
1234
1234
|
# {
|
1235
1235
|
# "transactID": "ffe699c2-95ee-4c13-91f9-0faf41daec25",
|
@@ -1312,7 +1312,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1312
1312
|
"""
|
1313
1313
|
self.load_markets()
|
1314
1314
|
market = self.market(symbol)
|
1315
|
-
request = {
|
1315
|
+
request: dict = {
|
1316
1316
|
'symbol': market['id'],
|
1317
1317
|
}
|
1318
1318
|
response = self.publicGetInstrument(self.extend(request, params))
|
@@ -1333,7 +1333,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1333
1333
|
symbols = self.market_symbols(symbols)
|
1334
1334
|
response = self.publicGetInstrumentActiveAndIndices(params)
|
1335
1335
|
# same response "fetchMarkets"
|
1336
|
-
result = {}
|
1336
|
+
result: dict = {}
|
1337
1337
|
for i in range(0, len(response)):
|
1338
1338
|
ticker = self.parse_ticker(response[i])
|
1339
1339
|
symbol = self.safe_string(ticker, 'symbol')
|
@@ -1420,12 +1420,12 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1420
1420
|
return self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params)
|
1421
1421
|
# send JSON key/value pairs, such as {"key": "value"}
|
1422
1422
|
# filter by individual fields and do advanced queries on timestamps
|
1423
|
-
# filter = {'key': 'value'}
|
1423
|
+
# filter: Dict = {'key': 'value'}
|
1424
1424
|
# send a bare series(e.g. XBU) to nearest expiring contract in that series
|
1425
1425
|
# you can also send a timeframe, e.g. XBU:monthly
|
1426
1426
|
# timeframes: daily, weekly, monthly, quarterly, and biquarterly
|
1427
1427
|
market = self.market(symbol)
|
1428
|
-
request = {
|
1428
|
+
request: dict = {
|
1429
1429
|
'symbol': market['id'],
|
1430
1430
|
'binSize': self.safe_string(self.timeframes, timeframe, timeframe),
|
1431
1431
|
'partial': True, # True == include yet-incomplete current bins
|
@@ -1469,7 +1469,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1469
1469
|
result[i][0] = result[i][0] - duration
|
1470
1470
|
return result
|
1471
1471
|
|
1472
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1472
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1473
1473
|
#
|
1474
1474
|
# fetchTrades(public)
|
1475
1475
|
#
|
@@ -1579,8 +1579,8 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1579
1579
|
'fee': fee,
|
1580
1580
|
}, market)
|
1581
1581
|
|
1582
|
-
def parse_order_status(self, status):
|
1583
|
-
statuses = {
|
1582
|
+
def parse_order_status(self, status: Str):
|
1583
|
+
statuses: dict = {
|
1584
1584
|
'New': 'open',
|
1585
1585
|
'PartiallyFilled': 'open',
|
1586
1586
|
'Filled': 'closed',
|
@@ -1596,8 +1596,8 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1596
1596
|
}
|
1597
1597
|
return self.safe_string(statuses, status, status)
|
1598
1598
|
|
1599
|
-
def parse_time_in_force(self, timeInForce):
|
1600
|
-
timeInForces = {
|
1599
|
+
def parse_time_in_force(self, timeInForce: Str):
|
1600
|
+
timeInForces: dict = {
|
1601
1601
|
'Day': 'Day',
|
1602
1602
|
'GoodTillCancel': 'GTC',
|
1603
1603
|
'ImmediateOrCancel': 'IOC',
|
@@ -1605,7 +1605,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1605
1605
|
}
|
1606
1606
|
return self.safe_string(timeInForces, timeInForce, timeInForce)
|
1607
1607
|
|
1608
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1608
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1609
1609
|
#
|
1610
1610
|
# {
|
1611
1611
|
# "orderID":"56222c7a-9956-413a-82cf-99f4812c214b",
|
@@ -1715,7 +1715,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1715
1715
|
if paginate:
|
1716
1716
|
return self.fetch_paginated_call_dynamic('fetchTrades', symbol, since, limit, params)
|
1717
1717
|
market = self.market(symbol)
|
1718
|
-
request = {
|
1718
|
+
request: dict = {
|
1719
1719
|
'symbol': market['id'],
|
1720
1720
|
}
|
1721
1721
|
if since is not None:
|
@@ -1784,7 +1784,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1784
1784
|
raise InvalidOrder(self.id + ' createOrder() does not support reduceOnly for ' + market['type'] + ' orders, reduceOnly orders are supported for swap and future markets only')
|
1785
1785
|
brokerId = self.safe_string(self.options, 'brokerId', 'CCXT')
|
1786
1786
|
qty = self.parse_to_int(self.amount_to_precision(symbol, amount))
|
1787
|
-
request = {
|
1787
|
+
request: dict = {
|
1788
1788
|
'symbol': market['id'],
|
1789
1789
|
'side': self.capitalize(side),
|
1790
1790
|
'orderQty': qty, # lot size multiplied by the number of contracts
|
@@ -1836,7 +1836,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1836
1836
|
|
1837
1837
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
1838
1838
|
self.load_markets()
|
1839
|
-
request = {}
|
1839
|
+
request: dict = {}
|
1840
1840
|
trailingAmount = self.safe_string_2(params, 'trailingAmount', 'pegOffsetValue')
|
1841
1841
|
isTrailingAmountOrder = trailingAmount is not None
|
1842
1842
|
if isTrailingAmountOrder:
|
@@ -1892,7 +1892,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1892
1892
|
self.load_markets()
|
1893
1893
|
# https://github.com/ccxt/ccxt/issues/6507
|
1894
1894
|
clientOrderId = self.safe_value_2(params, 'clOrdID', 'clientOrderId')
|
1895
|
-
request = {}
|
1895
|
+
request: dict = {}
|
1896
1896
|
if clientOrderId is None:
|
1897
1897
|
request['orderID'] = id
|
1898
1898
|
else:
|
@@ -1919,7 +1919,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1919
1919
|
self.load_markets()
|
1920
1920
|
# https://github.com/ccxt/ccxt/issues/6507
|
1921
1921
|
clientOrderId = self.safe_value_2(params, 'clOrdID', 'clientOrderId')
|
1922
|
-
request = {}
|
1922
|
+
request: dict = {}
|
1923
1923
|
if clientOrderId is None:
|
1924
1924
|
request['orderID'] = ids
|
1925
1925
|
else:
|
@@ -1937,7 +1937,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1937
1937
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1938
1938
|
"""
|
1939
1939
|
self.load_markets()
|
1940
|
-
request = {}
|
1940
|
+
request: dict = {}
|
1941
1941
|
market = None
|
1942
1942
|
if symbol is not None:
|
1943
1943
|
market = self.market(symbol)
|
@@ -2005,7 +2005,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2005
2005
|
#
|
2006
2006
|
return response
|
2007
2007
|
|
2008
|
-
def fetch_leverages(self, symbols:
|
2008
|
+
def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
2009
2009
|
"""
|
2010
2010
|
fetch the set leverage for all contract markets
|
2011
2011
|
:see: https://www.bitmex.com/api/explorer/#not /Position/Position_get
|
@@ -2137,7 +2137,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2137
2137
|
results = self.parse_positions(response, symbols)
|
2138
2138
|
return self.filter_by_array_positions(results, 'symbol', symbols, False)
|
2139
2139
|
|
2140
|
-
def parse_position(self, position, market: Market = None):
|
2140
|
+
def parse_position(self, position: dict, market: Market = None):
|
2141
2141
|
#
|
2142
2142
|
# {
|
2143
2143
|
# "account": 9371654,
|
@@ -2299,7 +2299,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2299
2299
|
qty = self.convert_from_real_amount(code, amount)
|
2300
2300
|
networkCode = None
|
2301
2301
|
networkCode, params = self.handle_network_code_and_params(params)
|
2302
|
-
request = {
|
2302
|
+
request: dict = {
|
2303
2303
|
'currency': currency['id'],
|
2304
2304
|
'amount': qty,
|
2305
2305
|
'address': address,
|
@@ -2391,7 +2391,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2391
2391
|
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
|
2392
2392
|
"""
|
2393
2393
|
self.load_markets()
|
2394
|
-
request = {}
|
2394
|
+
request: dict = {}
|
2395
2395
|
market = None
|
2396
2396
|
if symbol in self.currencies:
|
2397
2397
|
code = self.currency(symbol)
|
@@ -2468,7 +2468,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2468
2468
|
market = self.market(symbol)
|
2469
2469
|
if market['type'] != 'swap' and market['type'] != 'future':
|
2470
2470
|
raise BadSymbol(self.id + ' setLeverage() supports future and swap contracts only')
|
2471
|
-
request = {
|
2471
|
+
request: dict = {
|
2472
2472
|
'symbol': market['id'],
|
2473
2473
|
'leverage': leverage,
|
2474
2474
|
}
|
@@ -2493,7 +2493,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2493
2493
|
if (market['type'] != 'swap') and (market['type'] != 'future'):
|
2494
2494
|
raise BadSymbol(self.id + ' setMarginMode() supports swap and future contracts only')
|
2495
2495
|
enabled = False if (marginMode == 'cross') else True
|
2496
|
-
request = {
|
2496
|
+
request: dict = {
|
2497
2497
|
'symbol': market['id'],
|
2498
2498
|
'enabled': enabled,
|
2499
2499
|
}
|
@@ -2515,7 +2515,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2515
2515
|
raise ArgumentsRequired(self.id + ' fetchDepositAddress requires params["network"]')
|
2516
2516
|
currency = self.currency(code)
|
2517
2517
|
params = self.omit(params, 'network')
|
2518
|
-
request = {
|
2518
|
+
request: dict = {
|
2519
2519
|
'currency': currency['id'],
|
2520
2520
|
'network': self.network_code_to_id(networkCode, currency['code']),
|
2521
2521
|
}
|
@@ -2560,7 +2560,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2560
2560
|
#
|
2561
2561
|
networks = self.safe_value(fee, 'networks', [])
|
2562
2562
|
networksLength = len(networks)
|
2563
|
-
result = {
|
2563
|
+
result: dict = {
|
2564
2564
|
'info': fee,
|
2565
2565
|
'withdraw': {
|
2566
2566
|
'fee': None,
|
@@ -2660,7 +2660,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
2660
2660
|
if paginate:
|
2661
2661
|
return self.fetch_paginated_call_dynamic('fetchLiquidations', symbol, since, limit, params)
|
2662
2662
|
market = self.market(symbol)
|
2663
|
-
request = {
|
2663
|
+
request: dict = {
|
2664
2664
|
'symbol': market['id'],
|
2665
2665
|
}
|
2666
2666
|
if since is not None:
|
ccxt/bitopro.py
CHANGED
@@ -250,7 +250,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
250
250
|
# ]
|
251
251
|
# }
|
252
252
|
#
|
253
|
-
result = {}
|
253
|
+
result: dict = {}
|
254
254
|
for i in range(0, len(currencies)):
|
255
255
|
currency = currencies[i]
|
256
256
|
currencyId = self.safe_string(currency, 'currency')
|
@@ -260,7 +260,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
260
260
|
fee = self.safe_number(currency, 'withdrawFee')
|
261
261
|
withdrawMin = self.safe_number(currency, 'minWithdraw')
|
262
262
|
withdrawMax = self.safe_number(currency, 'maxWithdraw')
|
263
|
-
limits = {
|
263
|
+
limits: dict = {
|
264
264
|
'withdraw': {
|
265
265
|
'min': withdrawMin,
|
266
266
|
'max': withdrawMax,
|
@@ -325,7 +325,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
325
325
|
base = self.safe_currency_code(baseId)
|
326
326
|
quote = self.safe_currency_code(quoteId)
|
327
327
|
symbol = base + '/' + quote
|
328
|
-
limits = {
|
328
|
+
limits: dict = {
|
329
329
|
'amount': {
|
330
330
|
'min': self.safe_number(market, 'minLimitBaseAmount'),
|
331
331
|
'max': self.safe_number(market, 'maxLimitBaseAmount'),
|
@@ -425,7 +425,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
425
425
|
"""
|
426
426
|
self.load_markets()
|
427
427
|
market = self.market(symbol)
|
428
|
-
request = {
|
428
|
+
request: dict = {
|
429
429
|
'pair': market['id'],
|
430
430
|
}
|
431
431
|
response = self.publicGetTickersPair(self.extend(request, params))
|
@@ -484,7 +484,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
484
484
|
"""
|
485
485
|
self.load_markets()
|
486
486
|
market = self.market(symbol)
|
487
|
-
request = {
|
487
|
+
request: dict = {
|
488
488
|
'pair': market['id'],
|
489
489
|
}
|
490
490
|
if limit is not None:
|
@@ -512,7 +512,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
512
512
|
#
|
513
513
|
return self.parse_order_book(response, market['symbol'], None, 'bids', 'asks', 'price', 'amount')
|
514
514
|
|
515
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
515
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
516
516
|
#
|
517
517
|
# fetchTrades
|
518
518
|
# {
|
@@ -603,7 +603,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
603
603
|
"""
|
604
604
|
self.load_markets()
|
605
605
|
market = self.market(symbol)
|
606
|
-
request = {
|
606
|
+
request: dict = {
|
607
607
|
'pair': market['id'],
|
608
608
|
}
|
609
609
|
response = self.publicGetTradesPair(self.extend(request, params))
|
@@ -694,7 +694,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
694
694
|
# ]
|
695
695
|
# }
|
696
696
|
#
|
697
|
-
result = {}
|
697
|
+
result: dict = {}
|
698
698
|
maker = self.safe_number(first, 'makerFee')
|
699
699
|
taker = self.safe_number(first, 'takerFee')
|
700
700
|
for i in range(0, len(self.symbols)):
|
@@ -733,7 +733,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
733
733
|
self.load_markets()
|
734
734
|
market = self.market(symbol)
|
735
735
|
resolution = self.safe_string(self.timeframes, timeframe, timeframe)
|
736
|
-
request = {
|
736
|
+
request: dict = {
|
737
737
|
'pair': market['id'],
|
738
738
|
'resolution': resolution,
|
739
739
|
}
|
@@ -816,7 +816,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
816
816
|
# "tradable":true
|
817
817
|
# }]
|
818
818
|
#
|
819
|
-
result = {
|
819
|
+
result: dict = {
|
820
820
|
'info': response,
|
821
821
|
}
|
822
822
|
for i in range(0, len(response)):
|
@@ -825,7 +825,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
825
825
|
code = self.safe_currency_code(currencyId)
|
826
826
|
amount = self.safe_string(balance, 'amount')
|
827
827
|
available = self.safe_string(balance, 'available')
|
828
|
-
account = {
|
828
|
+
account: dict = {
|
829
829
|
'free': available,
|
830
830
|
'total': amount,
|
831
831
|
}
|
@@ -857,8 +857,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
857
857
|
#
|
858
858
|
return self.parse_balance(balances)
|
859
859
|
|
860
|
-
def parse_order_status(self, status):
|
861
|
-
statuses = {
|
860
|
+
def parse_order_status(self, status: Str):
|
861
|
+
statuses: dict = {
|
862
862
|
'-1': 'open',
|
863
863
|
'0': 'open',
|
864
864
|
'1': 'open',
|
@@ -869,7 +869,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
869
869
|
}
|
870
870
|
return self.safe_string(statuses, status, None)
|
871
871
|
|
872
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
872
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
873
873
|
#
|
874
874
|
# createOrder
|
875
875
|
# {
|
@@ -970,7 +970,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
970
970
|
"""
|
971
971
|
self.load_markets()
|
972
972
|
market = self.market(symbol)
|
973
|
-
request = {
|
973
|
+
request: dict = {
|
974
974
|
'type': type,
|
975
975
|
'pair': market['id'],
|
976
976
|
'action': side,
|
@@ -1022,7 +1022,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1022
1022
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1023
1023
|
self.load_markets()
|
1024
1024
|
market = self.market(symbol)
|
1025
|
-
request = {
|
1025
|
+
request: dict = {
|
1026
1026
|
'id': id,
|
1027
1027
|
'pair': market['id'],
|
1028
1028
|
}
|
@@ -1052,7 +1052,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1052
1052
|
self.load_markets()
|
1053
1053
|
market = self.market(symbol)
|
1054
1054
|
id = market['uppercaseId']
|
1055
|
-
request = {}
|
1055
|
+
request: dict = {}
|
1056
1056
|
request[id] = ids
|
1057
1057
|
response = self.privatePutOrders(self.extend(request, params))
|
1058
1058
|
#
|
@@ -1076,7 +1076,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1076
1076
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1077
1077
|
"""
|
1078
1078
|
self.load_markets()
|
1079
|
-
request = {
|
1079
|
+
request: dict = {
|
1080
1080
|
# 'pair': market['id'], # optional
|
1081
1081
|
}
|
1082
1082
|
response = None
|
@@ -1111,7 +1111,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1111
1111
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
1112
1112
|
self.load_markets()
|
1113
1113
|
market = self.market(symbol)
|
1114
|
-
request = {
|
1114
|
+
request: dict = {
|
1115
1115
|
'orderId': id,
|
1116
1116
|
'pair': market['id'],
|
1117
1117
|
}
|
@@ -1155,7 +1155,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1155
1155
|
raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')
|
1156
1156
|
self.load_markets()
|
1157
1157
|
market = self.market(symbol)
|
1158
|
-
request = {
|
1158
|
+
request: dict = {
|
1159
1159
|
'pair': market['id'],
|
1160
1160
|
# 'startTimestamp': 0,
|
1161
1161
|
# 'endTimestamp': 0,
|
@@ -1199,7 +1199,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1199
1199
|
return self.parse_orders(orders, market, since, limit)
|
1200
1200
|
|
1201
1201
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1202
|
-
request = {
|
1202
|
+
request: dict = {
|
1203
1203
|
'statusKind': 'OPEN',
|
1204
1204
|
}
|
1205
1205
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1214,7 +1214,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1214
1214
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1215
1215
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1216
1216
|
"""
|
1217
|
-
request = {
|
1217
|
+
request: dict = {
|
1218
1218
|
'statusKind': 'DONE',
|
1219
1219
|
}
|
1220
1220
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -1233,7 +1233,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1233
1233
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
1234
1234
|
self.load_markets()
|
1235
1235
|
market = self.market(symbol)
|
1236
|
-
request = {
|
1236
|
+
request: dict = {
|
1237
1237
|
'pair': market['id'],
|
1238
1238
|
}
|
1239
1239
|
response = self.privateGetOrdersTradesPair(self.extend(request, params))
|
@@ -1260,7 +1260,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1260
1260
|
return self.parse_trades(trades, market, since, limit)
|
1261
1261
|
|
1262
1262
|
def parse_transaction_status(self, status):
|
1263
|
-
states = {
|
1263
|
+
states: dict = {
|
1264
1264
|
'COMPLETE': 'ok',
|
1265
1265
|
'INVALID': 'failed',
|
1266
1266
|
'PROCESSING': 'pending',
|
@@ -1273,7 +1273,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1273
1273
|
}
|
1274
1274
|
return self.safe_string(states, status, status)
|
1275
1275
|
|
1276
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1276
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1277
1277
|
#
|
1278
1278
|
# fetchDeposits
|
1279
1279
|
#
|
@@ -1368,7 +1368,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1368
1368
|
raise ArgumentsRequired(self.id + ' fetchDeposits() requires the code argument')
|
1369
1369
|
self.load_markets()
|
1370
1370
|
currency = self.safe_currency(code)
|
1371
|
-
request = {
|
1371
|
+
request: dict = {
|
1372
1372
|
'currency': currency['id'],
|
1373
1373
|
# 'endTimestamp': 0,
|
1374
1374
|
# 'id': '',
|
@@ -1415,7 +1415,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1415
1415
|
raise ArgumentsRequired(self.id + ' fetchWithdrawals() requires the code argument')
|
1416
1416
|
self.load_markets()
|
1417
1417
|
currency = self.safe_currency(code)
|
1418
|
-
request = {
|
1418
|
+
request: dict = {
|
1419
1419
|
'currency': currency['id'],
|
1420
1420
|
# 'endTimestamp': 0,
|
1421
1421
|
# 'id': '',
|
@@ -1460,7 +1460,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1460
1460
|
raise ArgumentsRequired(self.id + ' fetchWithdrawal() requires the code argument')
|
1461
1461
|
self.load_markets()
|
1462
1462
|
currency = self.safe_currency(code)
|
1463
|
-
request = {
|
1463
|
+
request: dict = {
|
1464
1464
|
'serial': id,
|
1465
1465
|
'currency': currency['id'],
|
1466
1466
|
}
|
@@ -1499,7 +1499,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1499
1499
|
self.load_markets()
|
1500
1500
|
self.check_address(address)
|
1501
1501
|
currency = self.currency(code)
|
1502
|
-
request = {
|
1502
|
+
request: dict = {
|
1503
1503
|
'currency': currency['id'],
|
1504
1504
|
'amount': self.number_to_string(amount),
|
1505
1505
|
'address': address,
|
@@ -1603,7 +1603,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1603
1603
|
if query:
|
1604
1604
|
url += '?' + self.urlencode(query)
|
1605
1605
|
nonce = self.milliseconds()
|
1606
|
-
rawData = {
|
1606
|
+
rawData: dict = {
|
1607
1607
|
'nonce': nonce,
|
1608
1608
|
}
|
1609
1609
|
data = self.json(rawData)
|