ccxt 4.3.30__py2.py3-none-any.whl → 4.3.32__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 +208 -175
- 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 +48 -36
- 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 +208 -175
- 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 +20 -20
- ccxt/pro/coinbase.py +32 -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/test/test_async.py +1 -1
- ccxt/test/test_sync.py +1 -1
- 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.32.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/RECORD +260 -260
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/top_level.txt +0 -0
ccxt/async_support/phemex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.phemex import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import numbers
|
10
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, TransferEntries
|
10
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, TransferEntries
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import AuthenticationError
|
@@ -995,7 +995,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
995
995
|
# }
|
996
996
|
data = self.safe_value(response, 'data', {})
|
997
997
|
currencies = self.safe_value(data, 'currencies', [])
|
998
|
-
result = {}
|
998
|
+
result: dict = {}
|
999
999
|
for i in range(0, len(currencies)):
|
1000
1000
|
currency = currencies[i]
|
1001
1001
|
id = self.safe_string(currency, 'currency')
|
@@ -1051,7 +1051,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1051
1051
|
]
|
1052
1052
|
|
1053
1053
|
def custom_parse_order_book(self, orderbook, symbol, timestamp=None, bidsKey='bids', asksKey='asks', priceKey=0, amountKey=1, market: Market = None):
|
1054
|
-
result = {
|
1054
|
+
result: dict = {
|
1055
1055
|
'symbol': symbol,
|
1056
1056
|
'timestamp': timestamp,
|
1057
1057
|
'datetime': self.iso8601(timestamp),
|
@@ -1080,7 +1080,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1080
1080
|
"""
|
1081
1081
|
await self.load_markets()
|
1082
1082
|
market = self.market(symbol)
|
1083
|
-
request = {
|
1083
|
+
request: dict = {
|
1084
1084
|
'symbol': market['id'],
|
1085
1085
|
# 'id': 123456789, # optional request id
|
1086
1086
|
}
|
@@ -1209,7 +1209,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1209
1209
|
await self.load_markets()
|
1210
1210
|
market = self.market(symbol)
|
1211
1211
|
userLimit = limit
|
1212
|
-
request = {
|
1212
|
+
request: dict = {
|
1213
1213
|
'symbol': market['id'],
|
1214
1214
|
'resolution': self.safe_string(self.timeframes, timeframe, timeframe),
|
1215
1215
|
}
|
@@ -1367,7 +1367,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1367
1367
|
"""
|
1368
1368
|
await self.load_markets()
|
1369
1369
|
market = self.market(symbol)
|
1370
|
-
request = {
|
1370
|
+
request: dict = {
|
1371
1371
|
'symbol': market['id'],
|
1372
1372
|
# 'id': 123456789, # optional request id
|
1373
1373
|
}
|
@@ -1468,7 +1468,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1468
1468
|
"""
|
1469
1469
|
await self.load_markets()
|
1470
1470
|
market = self.market(symbol)
|
1471
|
-
request = {
|
1471
|
+
request: dict = {
|
1472
1472
|
'symbol': market['id'],
|
1473
1473
|
# 'id': 123456789, # optional request id
|
1474
1474
|
}
|
@@ -1497,7 +1497,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1497
1497
|
trades = self.safe_value_2(result, 'trades', 'trades_p', [])
|
1498
1498
|
return self.parse_trades(trades, market, since, limit)
|
1499
1499
|
|
1500
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1500
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1501
1501
|
#
|
1502
1502
|
# fetchTrades(public) spot & contract
|
1503
1503
|
#
|
@@ -1807,7 +1807,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1807
1807
|
# }
|
1808
1808
|
#
|
1809
1809
|
timestamp = None
|
1810
|
-
result = {'info': response}
|
1810
|
+
result: dict = {'info': response}
|
1811
1811
|
data = self.safe_value(response, 'data', [])
|
1812
1812
|
for i in range(0, len(data)):
|
1813
1813
|
balance = data[i]
|
@@ -1863,7 +1863,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1863
1863
|
# }
|
1864
1864
|
# }
|
1865
1865
|
#
|
1866
|
-
result = {'info': response}
|
1866
|
+
result: dict = {'info': response}
|
1867
1867
|
data = self.safe_value(response, 'data', {})
|
1868
1868
|
balance = self.safe_value(data, 'account', {})
|
1869
1869
|
currencyId = self.safe_string(balance, 'currency')
|
@@ -1896,7 +1896,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1896
1896
|
code = self.safe_string(params, 'code')
|
1897
1897
|
params = self.omit(params, ['code'])
|
1898
1898
|
response = None
|
1899
|
-
request = {}
|
1899
|
+
request: dict = {}
|
1900
1900
|
if (type != 'spot') and (type != 'swap'):
|
1901
1901
|
raise BadRequest(self.id + ' does not support ' + type + ' markets, only spot and swap')
|
1902
1902
|
if type == 'swap':
|
@@ -2041,8 +2041,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
2041
2041
|
result = self.parse_swap_balance(response) if (type == 'swap') else self.parse_spot_balance(response)
|
2042
2042
|
return result
|
2043
2043
|
|
2044
|
-
def parse_order_status(self, status):
|
2045
|
-
statuses = {
|
2044
|
+
def parse_order_status(self, status: Str):
|
2045
|
+
statuses: dict = {
|
2046
2046
|
'Created': 'open',
|
2047
2047
|
'Untriggered': 'open',
|
2048
2048
|
'Deactivated': 'closed',
|
@@ -2063,8 +2063,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
2063
2063
|
}
|
2064
2064
|
return self.safe_string(statuses, status, status)
|
2065
2065
|
|
2066
|
-
def parse_order_type(self, type):
|
2067
|
-
types = {
|
2066
|
+
def parse_order_type(self, type: Str):
|
2067
|
+
types: dict = {
|
2068
2068
|
'1': 'market',
|
2069
2069
|
'2': 'limit',
|
2070
2070
|
'3': 'stop',
|
@@ -2080,8 +2080,8 @@ class phemex(Exchange, ImplicitAPI):
|
|
2080
2080
|
}
|
2081
2081
|
return self.safe_string(types, type, type)
|
2082
2082
|
|
2083
|
-
def parse_time_in_force(self, timeInForce):
|
2084
|
-
timeInForces = {
|
2083
|
+
def parse_time_in_force(self, timeInForce: Str):
|
2084
|
+
timeInForces: dict = {
|
2085
2085
|
'GoodTillCancel': 'GTC',
|
2086
2086
|
'PostOnly': 'PO',
|
2087
2087
|
'ImmediateOrCancel': 'IOC',
|
@@ -2089,7 +2089,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2089
2089
|
}
|
2090
2090
|
return self.safe_string(timeInForces, timeInForce, timeInForce)
|
2091
2091
|
|
2092
|
-
def parse_spot_order(self, order, market: Market = None):
|
2092
|
+
def parse_spot_order(self, order: dict, market: Market = None):
|
2093
2093
|
#
|
2094
2094
|
# spot
|
2095
2095
|
#
|
@@ -2199,7 +2199,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2199
2199
|
}, market)
|
2200
2200
|
|
2201
2201
|
def parse_order_side(self, side):
|
2202
|
-
sides = {
|
2202
|
+
sides: dict = {
|
2203
2203
|
'1': 'buy',
|
2204
2204
|
'2': 'sell',
|
2205
2205
|
}
|
@@ -2380,7 +2380,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2380
2380
|
'trades': None,
|
2381
2381
|
})
|
2382
2382
|
|
2383
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
2383
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
2384
2384
|
isSwap = self.safe_bool(market, 'swap', False)
|
2385
2385
|
hasPnl = ('closedPnl' in order) or ('closedPnlRv' in order) or ('totalPnlRv' in order)
|
2386
2386
|
if isSwap or hasPnl:
|
@@ -2410,7 +2410,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2410
2410
|
requestSide = self.capitalize(side)
|
2411
2411
|
type = self.capitalize(type)
|
2412
2412
|
reduceOnly = self.safe_bool(params, 'reduceOnly')
|
2413
|
-
request = {
|
2413
|
+
request: dict = {
|
2414
2414
|
# common
|
2415
2415
|
'symbol': market['id'],
|
2416
2416
|
'side': requestSide, # Sell, Buy
|
@@ -2659,7 +2659,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2659
2659
|
"""
|
2660
2660
|
await self.load_markets()
|
2661
2661
|
market = self.market(symbol)
|
2662
|
-
request = {
|
2662
|
+
request: dict = {
|
2663
2663
|
'symbol': market['id'],
|
2664
2664
|
}
|
2665
2665
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clOrdID')
|
@@ -2718,7 +2718,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2718
2718
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
2719
2719
|
await self.load_markets()
|
2720
2720
|
market = self.market(symbol)
|
2721
|
-
request = {
|
2721
|
+
request: dict = {
|
2722
2722
|
'symbol': market['id'],
|
2723
2723
|
}
|
2724
2724
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clOrdID')
|
@@ -2754,7 +2754,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2754
2754
|
market = self.market(symbol)
|
2755
2755
|
stop = self.safe_value_2(params, 'stop', 'trigger', False)
|
2756
2756
|
params = self.omit(params, 'stop', 'trigger')
|
2757
|
-
request = {
|
2757
|
+
request: dict = {
|
2758
2758
|
'symbol': market['id'],
|
2759
2759
|
# 'untriggerred': False, # False to cancel non-conditional orders, True to cancel conditional orders
|
2760
2760
|
# 'text': 'up to 40 characters max',
|
@@ -2783,7 +2783,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2783
2783
|
market = self.market(symbol)
|
2784
2784
|
if market['settle'] == 'USDT':
|
2785
2785
|
raise NotSupported(self.id + 'fetchOrder() is not supported yet for USDT settled swap markets') # https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-user-order-by-orderid-or-query-user-order-by-client-order-id
|
2786
|
-
request = {
|
2786
|
+
request: dict = {
|
2787
2787
|
'symbol': market['id'],
|
2788
2788
|
}
|
2789
2789
|
clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clOrdID')
|
@@ -2823,7 +2823,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2823
2823
|
raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')
|
2824
2824
|
await self.load_markets()
|
2825
2825
|
market = self.market(symbol)
|
2826
|
-
request = {
|
2826
|
+
request: dict = {
|
2827
2827
|
'symbol': market['id'],
|
2828
2828
|
}
|
2829
2829
|
if since is not None:
|
@@ -2859,7 +2859,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2859
2859
|
raise ArgumentsRequired(self.id + ' fetchOpenOrders() requires a symbol argument')
|
2860
2860
|
await self.load_markets()
|
2861
2861
|
market = self.market(symbol)
|
2862
|
-
request = {
|
2862
|
+
request: dict = {
|
2863
2863
|
'symbol': market['id'],
|
2864
2864
|
}
|
2865
2865
|
response = None
|
@@ -2899,7 +2899,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2899
2899
|
market = None
|
2900
2900
|
if symbol is not None:
|
2901
2901
|
market = self.market(symbol)
|
2902
|
-
request = {
|
2902
|
+
request: dict = {
|
2903
2903
|
}
|
2904
2904
|
if market is not None:
|
2905
2905
|
request['symbol'] = market['id']
|
@@ -2974,7 +2974,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2974
2974
|
market = None
|
2975
2975
|
if symbol is not None:
|
2976
2976
|
market = self.market(symbol)
|
2977
|
-
request = {}
|
2977
|
+
request: dict = {}
|
2978
2978
|
if limit is not None:
|
2979
2979
|
limit = min(200, limit)
|
2980
2980
|
request['limit'] = limit
|
@@ -3116,7 +3116,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3116
3116
|
"""
|
3117
3117
|
await self.load_markets()
|
3118
3118
|
currency = self.currency(code)
|
3119
|
-
request = {
|
3119
|
+
request: dict = {
|
3120
3120
|
'currency': currency['id'],
|
3121
3121
|
}
|
3122
3122
|
defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
|
@@ -3226,7 +3226,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3226
3226
|
return self.parse_transactions(data, currency, since, limit)
|
3227
3227
|
|
3228
3228
|
def parse_transaction_status(self, status):
|
3229
|
-
statuses = {
|
3229
|
+
statuses: dict = {
|
3230
3230
|
'Success': 'ok',
|
3231
3231
|
'Succeed': 'ok',
|
3232
3232
|
'Rejected': 'failed',
|
@@ -3245,7 +3245,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3245
3245
|
}
|
3246
3246
|
return self.safe_string(statuses, status, status)
|
3247
3247
|
|
3248
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
3248
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
3249
3249
|
#
|
3250
3250
|
# withdraw
|
3251
3251
|
#
|
@@ -3393,7 +3393,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3393
3393
|
else:
|
3394
3394
|
params = self.omit(params, 'code')
|
3395
3395
|
currency = self.currency(code)
|
3396
|
-
request = {
|
3396
|
+
request: dict = {
|
3397
3397
|
'currency': currency['id'],
|
3398
3398
|
}
|
3399
3399
|
response = None
|
@@ -3490,7 +3490,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3490
3490
|
result.append(self.parse_position(position))
|
3491
3491
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
3492
3492
|
|
3493
|
-
def parse_position(self, position, market: Market = None):
|
3493
|
+
def parse_position(self, position: dict, market: Market = None):
|
3494
3494
|
#
|
3495
3495
|
# {
|
3496
3496
|
# "userID": "811370",
|
@@ -3642,7 +3642,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3642
3642
|
raise ArgumentsRequired(self.id + ' fetchFundingHistory() requires a symbol argument')
|
3643
3643
|
await self.load_markets()
|
3644
3644
|
market = self.market(symbol)
|
3645
|
-
request = {
|
3645
|
+
request: dict = {
|
3646
3646
|
'symbol': market['id'],
|
3647
3647
|
# 'limit': 20, # Page size default 20, max 200
|
3648
3648
|
# 'offset': 0, # Page start default 0
|
@@ -3721,10 +3721,10 @@ class phemex(Exchange, ImplicitAPI):
|
|
3721
3721
|
market = self.market(symbol)
|
3722
3722
|
if not market['swap']:
|
3723
3723
|
raise BadSymbol(self.id + ' fetchFundingRate() supports swap contracts only')
|
3724
|
-
request = {
|
3724
|
+
request: dict = {
|
3725
3725
|
'symbol': market['id'],
|
3726
3726
|
}
|
3727
|
-
response = {}
|
3727
|
+
response: dict = {}
|
3728
3728
|
if not market['linear']:
|
3729
3729
|
response = await self.v1GetMdTicker24hr(self.extend(request, params))
|
3730
3730
|
else:
|
@@ -3827,7 +3827,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3827
3827
|
"""
|
3828
3828
|
await self.load_markets()
|
3829
3829
|
market = self.market(symbol)
|
3830
|
-
request = {
|
3830
|
+
request: dict = {
|
3831
3831
|
'symbol': market['id'],
|
3832
3832
|
'posBalanceEv': self.to_ev(amount, market),
|
3833
3833
|
}
|
@@ -3844,7 +3844,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3844
3844
|
})
|
3845
3845
|
|
3846
3846
|
def parse_margin_status(self, status):
|
3847
|
-
statuses = {
|
3847
|
+
statuses: dict = {
|
3848
3848
|
'0': 'ok',
|
3849
3849
|
}
|
3850
3850
|
return self.safe_string(statuses, status, status)
|
@@ -3895,7 +3895,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3895
3895
|
leverage = 0
|
3896
3896
|
if leverage is None:
|
3897
3897
|
raise ArgumentsRequired(self.id + ' setMarginMode() requires a leverage parameter')
|
3898
|
-
request = {
|
3898
|
+
request: dict = {
|
3899
3899
|
'symbol': market['id'],
|
3900
3900
|
'leverage': leverage,
|
3901
3901
|
}
|
@@ -3915,7 +3915,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3915
3915
|
market = self.market(symbol)
|
3916
3916
|
if market['settle'] != 'USDT':
|
3917
3917
|
raise BadSymbol(self.id + ' setPositionMode() supports USDT settled markets only')
|
3918
|
-
request = {
|
3918
|
+
request: dict = {
|
3919
3919
|
'symbol': market['id'],
|
3920
3920
|
}
|
3921
3921
|
if hedged:
|
@@ -3924,7 +3924,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3924
3924
|
request['targetPosMode'] = 'OneWay'
|
3925
3925
|
return await self.privatePutGPositionsSwitchPosModeSync(self.extend(request, params))
|
3926
3926
|
|
3927
|
-
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
3927
|
+
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
3928
3928
|
"""
|
3929
3929
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
3930
3930
|
:param str[]|None symbols: list of unified market symbols
|
@@ -4020,7 +4020,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4020
4020
|
riskLimits = self.safe_list(data, 'riskLimits')
|
4021
4021
|
return self.parse_leverage_tiers(riskLimits, symbols, 'symbol')
|
4022
4022
|
|
4023
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
4023
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
4024
4024
|
"""
|
4025
4025
|
:param dict info: Exchange market response for 1 market
|
4026
4026
|
:param dict market: CCXT market
|
@@ -4112,7 +4112,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4112
4112
|
longLeverageRr = self.safe_integer(params, 'longLeverageRr')
|
4113
4113
|
shortLeverageRr = self.safe_integer(params, 'shortLeverageRr')
|
4114
4114
|
market = self.market(symbol)
|
4115
|
-
request = {
|
4115
|
+
request: dict = {
|
4116
4116
|
'symbol': market['id'],
|
4117
4117
|
}
|
4118
4118
|
response = None
|
@@ -4154,7 +4154,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4154
4154
|
elif fromId == 'future' and toId == 'spot':
|
4155
4155
|
direction = 1
|
4156
4156
|
if direction is not None:
|
4157
|
-
request = {
|
4157
|
+
request: dict = {
|
4158
4158
|
'currency': currency['id'],
|
4159
4159
|
'moveOp': direction,
|
4160
4160
|
'amountEv': scaledAmmount,
|
@@ -4177,7 +4177,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4177
4177
|
data = self.safe_value(response, 'data', {})
|
4178
4178
|
transfer = self.parse_transfer(data, currency)
|
4179
4179
|
else: # sub account transfer
|
4180
|
-
request = {
|
4180
|
+
request: dict = {
|
4181
4181
|
'fromUserId': fromId,
|
4182
4182
|
'toUserId': toId,
|
4183
4183
|
'amountEv': scaledAmmount,
|
@@ -4219,7 +4219,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4219
4219
|
if code is None:
|
4220
4220
|
raise ArgumentsRequired(self.id + ' fetchTransfers() requires a code argument')
|
4221
4221
|
currency = self.currency(code)
|
4222
|
-
request = {
|
4222
|
+
request: dict = {
|
4223
4223
|
'currency': currency['id'],
|
4224
4224
|
}
|
4225
4225
|
if since is not None:
|
@@ -4306,7 +4306,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4306
4306
|
}
|
4307
4307
|
|
4308
4308
|
def parse_transfer_status(self, status: Str) -> Str:
|
4309
|
-
statuses = {
|
4309
|
+
statuses: dict = {
|
4310
4310
|
'3': 'rejected', # 'Rejected',
|
4311
4311
|
'6': 'canceled', # 'Got error and wait for recovery',
|
4312
4312
|
'10': 'ok', # 'Success',
|
@@ -4342,7 +4342,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4342
4342
|
customSymbol = '.' + market['id'] + 'FR8H' # phemex requires a custom symbol for funding rate history
|
4343
4343
|
else:
|
4344
4344
|
customSymbol = '.' + market['baseId'] + 'FR8H'
|
4345
|
-
request = {
|
4345
|
+
request: dict = {
|
4346
4346
|
'symbol': customSymbol,
|
4347
4347
|
}
|
4348
4348
|
if since is not None:
|
@@ -4414,7 +4414,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4414
4414
|
networkId = currency['id']
|
4415
4415
|
else:
|
4416
4416
|
raise ArgumentsRequired(self.id + ' withdraw() requires an extra argument params["network"]')
|
4417
|
-
request = {
|
4417
|
+
request: dict = {
|
4418
4418
|
'currency': currency['id'],
|
4419
4419
|
'address': address,
|
4420
4420
|
'amount': amount,
|