ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +2 -2
- ccxt/abstract/binance.py +1 -0
- ccxt/abstract/binancecoinm.py +1 -0
- ccxt/abstract/binanceus.py +1 -0
- ccxt/abstract/binanceusdm.py +1 -0
- ccxt/abstract/bitbank.py +1 -0
- ccxt/abstract/coinbase.py +2 -0
- ccxt/abstract/htx.py +3 -0
- ccxt/abstract/huobi.py +3 -0
- ccxt/abstract/huobipro.py +3 -0
- ccxt/abstract/okex.py +3 -1
- ccxt/abstract/okex5.py +3 -1
- ccxt/abstract/okx.py +3 -1
- ccxt/ace.py +23 -23
- ccxt/alpaca.py +8 -8
- ccxt/ascendex.py +26 -26
- ccxt/async_support/__init__.py +2 -2
- ccxt/async_support/ace.py +23 -23
- ccxt/async_support/alpaca.py +8 -8
- ccxt/async_support/ascendex.py +26 -26
- ccxt/async_support/base/exchange.py +4 -2216
- ccxt/async_support/bigone.py +21 -24
- ccxt/async_support/binance.py +61 -54
- ccxt/async_support/bingx.py +28 -28
- ccxt/async_support/bit2c.py +9 -9
- ccxt/async_support/bitbank.py +11 -10
- ccxt/async_support/bitbns.py +11 -11
- ccxt/async_support/bitfinex.py +15 -15
- ccxt/async_support/bitfinex2.py +22 -22
- ccxt/async_support/bitflyer.py +13 -13
- ccxt/async_support/bitforex.py +10 -10
- ccxt/async_support/bitget.py +44 -44
- ccxt/async_support/bithumb.py +9 -9
- ccxt/async_support/bitmart.py +85 -104
- ccxt/async_support/bitmex.py +27 -27
- ccxt/async_support/bitopro.py +18 -18
- ccxt/async_support/bitpanda.py +18 -18
- ccxt/async_support/bitrue.py +14 -14
- ccxt/async_support/bitso.py +17 -17
- ccxt/async_support/bitstamp.py +17 -17
- ccxt/async_support/bittrex.py +22 -24
- ccxt/async_support/bitvavo.py +15 -15
- ccxt/async_support/bl3p.py +4 -4
- ccxt/async_support/blockchaincom.py +17 -17
- ccxt/async_support/btcalpha.py +14 -14
- ccxt/async_support/btcbox.py +9 -9
- ccxt/async_support/btcmarkets.py +17 -17
- ccxt/async_support/btcturk.py +9 -9
- ccxt/async_support/bybit.py +46 -46
- ccxt/async_support/cex.py +10 -10
- ccxt/async_support/coinbase.py +69 -25
- ccxt/async_support/coinbasepro.py +19 -19
- ccxt/async_support/coincheck.py +10 -10
- ccxt/async_support/coinex.py +57 -66
- ccxt/async_support/coinlist.py +22 -22
- ccxt/async_support/coinmate.py +10 -10
- ccxt/async_support/coinone.py +10 -10
- ccxt/async_support/coinsph.py +17 -17
- ccxt/async_support/coinspot.py +5 -5
- ccxt/async_support/cryptocom.py +27 -27
- ccxt/async_support/currencycom.py +18 -18
- ccxt/async_support/delta.py +21 -21
- ccxt/async_support/deribit.py +24 -24
- ccxt/async_support/digifinex.py +35 -35
- ccxt/async_support/exmo.py +19 -19
- ccxt/async_support/gate.py +38 -38
- ccxt/async_support/gemini.py +11 -11
- ccxt/async_support/hitbtc.py +27 -27
- ccxt/async_support/hollaex.py +19 -19
- ccxt/async_support/htx.py +47 -44
- ccxt/async_support/huobijp.py +22 -22
- ccxt/async_support/idex.py +20 -20
- ccxt/async_support/independentreserve.py +9 -9
- ccxt/async_support/indodax.py +10 -10
- ccxt/async_support/kraken.py +25 -25
- ccxt/async_support/krakenfutures.py +17 -17
- ccxt/async_support/kucoin.py +27 -27
- ccxt/async_support/kucoinfutures.py +20 -20
- ccxt/async_support/kuna.py +19 -19
- ccxt/async_support/latoken.py +14 -14
- ccxt/async_support/lbank.py +18 -18
- ccxt/async_support/luno.py +14 -14
- ccxt/async_support/lykke.py +12 -12
- ccxt/async_support/mercado.py +11 -11
- ccxt/async_support/mexc.py +36 -36
- ccxt/async_support/ndax.py +18 -18
- ccxt/async_support/novadax.py +17 -17
- ccxt/async_support/oceanex.py +12 -12
- ccxt/async_support/okcoin.py +19 -19
- ccxt/async_support/okx.py +48 -45
- ccxt/async_support/p2b.py +6 -6
- ccxt/async_support/paymium.py +6 -6
- ccxt/async_support/phemex.py +57 -57
- ccxt/async_support/poloniex.py +31 -30
- ccxt/async_support/poloniexfutures.py +16 -16
- ccxt/async_support/probit.py +22 -22
- ccxt/async_support/tidex.py +15 -15
- ccxt/async_support/timex.py +20 -20
- ccxt/async_support/tokocrypto.py +16 -16
- ccxt/async_support/upbit.py +15 -15
- ccxt/async_support/wavesexchange.py +12 -12
- ccxt/async_support/wazirx.py +13 -13
- ccxt/async_support/whitebit.py +26 -26
- ccxt/async_support/woo.py +47 -47
- ccxt/async_support/yobit.py +8 -8
- ccxt/async_support/zaif.py +10 -10
- ccxt/async_support/zonda.py +16 -16
- ccxt/base/errors.py +17 -16
- ccxt/base/exchange.py +57 -97
- ccxt/base/types.py +138 -139
- ccxt/bigone.py +21 -24
- ccxt/binance.py +61 -54
- ccxt/bingx.py +28 -28
- ccxt/bit2c.py +9 -9
- ccxt/bitbank.py +11 -10
- ccxt/bitbns.py +11 -11
- ccxt/bitfinex.py +15 -15
- ccxt/bitfinex2.py +22 -22
- ccxt/bitflyer.py +13 -13
- ccxt/bitforex.py +10 -10
- ccxt/bitget.py +44 -44
- ccxt/bithumb.py +9 -9
- ccxt/bitmart.py +85 -104
- ccxt/bitmex.py +27 -27
- ccxt/bitopro.py +18 -18
- ccxt/bitpanda.py +18 -18
- ccxt/bitrue.py +14 -14
- ccxt/bitso.py +17 -17
- ccxt/bitstamp.py +17 -17
- ccxt/bittrex.py +22 -24
- ccxt/bitvavo.py +15 -15
- ccxt/bl3p.py +4 -4
- ccxt/blockchaincom.py +17 -17
- ccxt/btcalpha.py +14 -14
- ccxt/btcbox.py +9 -9
- ccxt/btcmarkets.py +17 -17
- ccxt/btcturk.py +9 -9
- ccxt/bybit.py +46 -46
- ccxt/cex.py +10 -10
- ccxt/coinbase.py +69 -25
- ccxt/coinbasepro.py +19 -19
- ccxt/coincheck.py +10 -10
- ccxt/coinex.py +57 -66
- ccxt/coinlist.py +22 -22
- ccxt/coinmate.py +10 -10
- ccxt/coinone.py +10 -10
- ccxt/coinsph.py +17 -17
- ccxt/coinspot.py +5 -5
- ccxt/cryptocom.py +27 -27
- ccxt/currencycom.py +18 -18
- ccxt/delta.py +21 -21
- ccxt/deribit.py +24 -24
- ccxt/digifinex.py +35 -35
- ccxt/exmo.py +19 -19
- ccxt/gate.py +38 -38
- ccxt/gemini.py +11 -11
- ccxt/hitbtc.py +27 -27
- ccxt/hollaex.py +19 -19
- ccxt/htx.py +47 -44
- ccxt/huobijp.py +22 -22
- ccxt/idex.py +20 -20
- ccxt/independentreserve.py +9 -9
- ccxt/indodax.py +10 -10
- ccxt/kraken.py +25 -25
- ccxt/krakenfutures.py +17 -17
- ccxt/kucoin.py +27 -27
- ccxt/kucoinfutures.py +20 -20
- ccxt/kuna.py +19 -19
- ccxt/latoken.py +14 -14
- ccxt/lbank.py +18 -18
- ccxt/luno.py +14 -14
- ccxt/lykke.py +12 -12
- ccxt/mercado.py +11 -11
- ccxt/mexc.py +36 -36
- ccxt/ndax.py +18 -18
- ccxt/novadax.py +17 -17
- ccxt/oceanex.py +12 -12
- ccxt/okcoin.py +19 -19
- ccxt/okx.py +48 -45
- ccxt/p2b.py +6 -6
- ccxt/paymium.py +6 -6
- ccxt/phemex.py +57 -57
- ccxt/poloniex.py +31 -30
- ccxt/poloniexfutures.py +16 -16
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +3 -3
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/binance.py +9 -9
- ccxt/pro/bingx.py +3 -3
- ccxt/pro/bitfinex.py +3 -3
- ccxt/pro/bitfinex2.py +3 -3
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +3 -3
- ccxt/pro/bitpanda.py +3 -3
- ccxt/pro/bitrue.py +2 -2
- ccxt/pro/bitstamp.py +2 -2
- ccxt/pro/bittrex.py +3 -3
- ccxt/pro/bitvavo.py +3 -3
- ccxt/pro/blockchaincom.py +2 -2
- ccxt/pro/bybit.py +4 -4
- ccxt/pro/cex.py +3 -3
- ccxt/pro/coinbasepro.py +3 -3
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/cryptocom.py +5 -5
- ccxt/pro/deribit.py +3 -3
- ccxt/pro/exmo.py +2 -2
- ccxt/pro/gate.py +3 -3
- ccxt/pro/gemini.py +2 -2
- ccxt/pro/hitbtc.py +4 -4
- ccxt/pro/hollaex.py +3 -3
- ccxt/pro/htx.py +3 -3
- ccxt/pro/idex.py +3 -3
- ccxt/pro/kraken.py +7 -7
- ccxt/pro/krakenfutures.py +4 -4
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/kucoinfutures.py +3 -3
- ccxt/pro/mexc.py +3 -3
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +6 -6
- ccxt/pro/phemex.py +3 -3
- ccxt/pro/poloniex.py +3 -3
- ccxt/pro/poloniexfutures.py +3 -3
- ccxt/pro/probit.py +3 -3
- ccxt/pro/wazirx.py +3 -3
- ccxt/pro/whitebit.py +3 -3
- ccxt/pro/woo.py +2 -2
- ccxt/probit.py +22 -22
- ccxt/test/base/test_shared_methods.py +3 -3
- ccxt/test/test_async.py +543 -535
- ccxt/test/test_sync.py +542 -534
- ccxt/tidex.py +15 -15
- ccxt/timex.py +20 -20
- ccxt/tokocrypto.py +16 -16
- ccxt/upbit.py +15 -15
- ccxt/wavesexchange.py +12 -12
- ccxt/wazirx.py +13 -13
- ccxt/whitebit.py +26 -26
- ccxt/woo.py +47 -47
- ccxt/yobit.py +8 -8
- ccxt/zaif.py +10 -10
- ccxt/zonda.py +16 -16
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
- ccxt-4.1.56.dist-info/RECORD +449 -0
- ccxt/async_support/bitstamp1.py +0 -402
- ccxt/async_support/lbank2.py +0 -2620
- ccxt/bitstamp1.py +0 -402
- ccxt/lbank2.py +0 -2619
- ccxt-4.1.54.dist-info/RECORD +0 -453
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
- {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
ccxt/phemex.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.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, Int, Order, OrderBook, OrderSide, OrderType,
|
10
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Num, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import PermissionDenied
|
@@ -551,9 +551,9 @@ class phemex(Exchange, ImplicitAPI):
|
|
551
551
|
takerFeeRateEr = self.safe_string(market, 'takerFeeRateEr')
|
552
552
|
status = self.safe_string(market, 'status')
|
553
553
|
contractSizeString = self.safe_string(market, 'contractSize', ' ')
|
554
|
-
contractSize = None
|
554
|
+
contractSize: Num = None
|
555
555
|
if settle == 'USDT':
|
556
|
-
contractSize = 1
|
556
|
+
contractSize = self.parse_number('1')
|
557
557
|
elif contractSizeString.find(' '):
|
558
558
|
# "1 USD"
|
559
559
|
# "0.005 ETH"
|
@@ -904,9 +904,9 @@ class phemex(Exchange, ImplicitAPI):
|
|
904
904
|
valueScale = int(valueScaleString)
|
905
905
|
minValueEv = self.safe_string(currency, 'minValueEv')
|
906
906
|
maxValueEv = self.safe_string(currency, 'maxValueEv')
|
907
|
-
minAmount = None
|
908
|
-
maxAmount = None
|
909
|
-
precision = None
|
907
|
+
minAmount: Num = None
|
908
|
+
maxAmount: Num = None
|
909
|
+
precision: Num = None
|
910
910
|
if valueScale is not None:
|
911
911
|
precisionString = self.parse_precision(valueScaleString)
|
912
912
|
precision = self.parse_number(precisionString)
|
@@ -937,7 +937,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
937
937
|
}
|
938
938
|
return result
|
939
939
|
|
940
|
-
def custom_parse_bid_ask(self, bidask, priceKey=0, amountKey=1, market=None):
|
940
|
+
def custom_parse_bid_ask(self, bidask, priceKey=0, amountKey=1, market: Market = None):
|
941
941
|
if market is None:
|
942
942
|
raise ArgumentsRequired(self.id + ' customParseBidAsk() requires a market argument')
|
943
943
|
amount = self.safe_string(bidask, amountKey)
|
@@ -948,7 +948,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
948
948
|
self.parse_number(amount),
|
949
949
|
]
|
950
950
|
|
951
|
-
def custom_parse_order_book(self, orderbook, symbol, timestamp=None, bidsKey='bids', asksKey='asks', priceKey=0, amountKey=1, market=None):
|
951
|
+
def custom_parse_order_book(self, orderbook, symbol, timestamp=None, bidsKey='bids', asksKey='asks', priceKey=0, amountKey=1, market: Market = None):
|
952
952
|
result = {
|
953
953
|
'symbol': symbol,
|
954
954
|
'timestamp': timestamp,
|
@@ -1026,12 +1026,12 @@ class phemex(Exchange, ImplicitAPI):
|
|
1026
1026
|
preciseString = str(precise)
|
1027
1027
|
return self.parse_to_int(preciseString)
|
1028
1028
|
|
1029
|
-
def to_ev(self, amount, market=None):
|
1029
|
+
def to_ev(self, amount, market: Market = None):
|
1030
1030
|
if (amount is None) or (market is None):
|
1031
1031
|
return amount
|
1032
1032
|
return self.to_en(amount, market['valueScale'])
|
1033
1033
|
|
1034
|
-
def to_ep(self, price, market=None):
|
1034
|
+
def to_ep(self, price, market: Market = None):
|
1035
1035
|
if (price is None) or (market is None):
|
1036
1036
|
return price
|
1037
1037
|
return self.to_en(price, market['priceScale'])
|
@@ -1044,22 +1044,22 @@ class phemex(Exchange, ImplicitAPI):
|
|
1044
1044
|
precise.reduce()
|
1045
1045
|
return str(precise)
|
1046
1046
|
|
1047
|
-
def from_ep(self, ep, market=None):
|
1047
|
+
def from_ep(self, ep, market: Market = None):
|
1048
1048
|
if (ep is None) or (market is None):
|
1049
1049
|
return ep
|
1050
1050
|
return self.from_en(ep, self.safe_integer(market, 'priceScale'))
|
1051
1051
|
|
1052
|
-
def from_ev(self, ev, market=None):
|
1052
|
+
def from_ev(self, ev, market: Market = None):
|
1053
1053
|
if (ev is None) or (market is None):
|
1054
1054
|
return ev
|
1055
1055
|
return self.from_en(ev, self.safe_integer(market, 'valueScale'))
|
1056
1056
|
|
1057
|
-
def from_er(self, er, market=None):
|
1057
|
+
def from_er(self, er, market: Market = None):
|
1058
1058
|
if (er is None) or (market is None):
|
1059
1059
|
return er
|
1060
1060
|
return self.from_en(er, self.safe_integer(market, 'ratioScale'))
|
1061
1061
|
|
1062
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
1062
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1063
1063
|
#
|
1064
1064
|
# [
|
1065
1065
|
# 1592467200, # timestamp
|
@@ -1073,7 +1073,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1073
1073
|
# 48759063370, # quote volume
|
1074
1074
|
# ]
|
1075
1075
|
#
|
1076
|
-
baseVolume
|
1076
|
+
baseVolume: Num
|
1077
1077
|
if (market is not None) and market['spot']:
|
1078
1078
|
baseVolume = self.parse_number(self.from_ev(self.safe_string(ohlcv, 7), market))
|
1079
1079
|
else:
|
@@ -1164,7 +1164,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1164
1164
|
rows = self.safe_value(data, 'rows', [])
|
1165
1165
|
return self.parse_ohlcvs(rows, market, timeframe, since, userLimit)
|
1166
1166
|
|
1167
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
1167
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1168
1168
|
#
|
1169
1169
|
# spot
|
1170
1170
|
#
|
@@ -1330,7 +1330,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1330
1330
|
:returns dict: a dictionary of `ticker structures <https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure>`
|
1331
1331
|
"""
|
1332
1332
|
self.load_markets()
|
1333
|
-
market = None
|
1333
|
+
market: Market = None
|
1334
1334
|
if symbols is not None:
|
1335
1335
|
first = self.safe_value(symbols, 0)
|
1336
1336
|
market = self.market(first)
|
@@ -1339,7 +1339,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1339
1339
|
subType = None
|
1340
1340
|
subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
|
1341
1341
|
query = self.omit(params, 'type')
|
1342
|
-
defaultMethod
|
1342
|
+
defaultMethod: str
|
1343
1343
|
if type == 'spot':
|
1344
1344
|
defaultMethod = 'v1GetMdSpotTicker24hrAll'
|
1345
1345
|
elif subType == 'inverse':
|
@@ -1391,7 +1391,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1391
1391
|
trades = self.safe_value_2(result, 'trades', 'trades_p', [])
|
1392
1392
|
return self.parse_trades(trades, market, since, limit)
|
1393
1393
|
|
1394
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
1394
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1395
1395
|
#
|
1396
1396
|
# fetchTrades(public) spot & contract
|
1397
1397
|
#
|
@@ -1553,22 +1553,22 @@ class phemex(Exchange, ImplicitAPI):
|
|
1553
1553
|
# "execStatus": 6
|
1554
1554
|
# }
|
1555
1555
|
#
|
1556
|
-
priceString
|
1557
|
-
amountString
|
1558
|
-
timestamp
|
1559
|
-
id = None
|
1560
|
-
side = None
|
1561
|
-
costString = None
|
1562
|
-
type = None
|
1556
|
+
priceString: Str
|
1557
|
+
amountString: Str
|
1558
|
+
timestamp: Int
|
1559
|
+
id: Str = None
|
1560
|
+
side: Str = None
|
1561
|
+
costString: Str = None
|
1562
|
+
type: Str = None
|
1563
1563
|
fee = None
|
1564
|
-
feeCostString = None
|
1565
|
-
feeRateString = None
|
1566
|
-
feeCurrencyCode = None
|
1564
|
+
feeCostString: Str = None
|
1565
|
+
feeRateString: Str = None
|
1566
|
+
feeCurrencyCode: Str = None
|
1567
1567
|
marketId = self.safe_string(trade, 'symbol')
|
1568
1568
|
market = self.safe_market(marketId, market)
|
1569
1569
|
symbol = market['symbol']
|
1570
|
-
orderId = None
|
1571
|
-
takerOrMaker = None
|
1570
|
+
orderId: Str = None
|
1571
|
+
takerOrMaker: Str = None
|
1572
1572
|
if isinstance(trade, list):
|
1573
1573
|
tradeLength = len(trade)
|
1574
1574
|
timestamp = self.safe_integer_product(trade, 0, 0.000001)
|
@@ -1947,7 +1947,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1947
1947
|
}
|
1948
1948
|
return self.safe_string(timeInForces, timeInForce, timeInForce)
|
1949
1949
|
|
1950
|
-
def parse_spot_order(self, order, market=None):
|
1950
|
+
def parse_spot_order(self, order, market: Market = None):
|
1951
1951
|
#
|
1952
1952
|
# spot
|
1953
1953
|
#
|
@@ -2029,7 +2029,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2029
2029
|
'currency': None,
|
2030
2030
|
}
|
2031
2031
|
timeInForce = self.parse_time_in_force(self.safe_string(order, 'timeInForce'))
|
2032
|
-
stopPrice = self.parse_number(self.omit_zero(self.from_ep(self.safe_string(order, 'stopPxEp'
|
2032
|
+
stopPrice = self.parse_number(self.omit_zero(self.from_ep(self.safe_string(order, 'stopPxEp'))))
|
2033
2033
|
postOnly = (timeInForce == 'PO')
|
2034
2034
|
return self.safe_order({
|
2035
2035
|
'info': order,
|
@@ -2063,7 +2063,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2063
2063
|
}
|
2064
2064
|
return self.safe_string(sides, side, side)
|
2065
2065
|
|
2066
|
-
def parse_swap_order(self, order, market=None):
|
2066
|
+
def parse_swap_order(self, order, market: Market = None):
|
2067
2067
|
#
|
2068
2068
|
# {
|
2069
2069
|
# "bizError":0,
|
@@ -2224,7 +2224,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2224
2224
|
'trades': None,
|
2225
2225
|
})
|
2226
2226
|
|
2227
|
-
def parse_order(self, order, market=None) -> Order:
|
2227
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
2228
2228
|
isSwap = self.safe_value(market, 'swap', False)
|
2229
2229
|
hasPnl = ('closedPnl' in order)
|
2230
2230
|
if isSwap or hasPnl:
|
@@ -2538,7 +2538,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2538
2538
|
data = self.safe_value(response, 'data', {})
|
2539
2539
|
return self.parse_order(data, market)
|
2540
2540
|
|
2541
|
-
def cancel_order(self, id: str, symbol:
|
2541
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2542
2542
|
"""
|
2543
2543
|
cancels an open order
|
2544
2544
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#cancel-single-order-by-orderid
|
@@ -2572,7 +2572,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2572
2572
|
data = self.safe_value(response, 'data', {})
|
2573
2573
|
return self.parse_order(data, market)
|
2574
2574
|
|
2575
|
-
def cancel_all_orders(self, symbol:
|
2575
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
2576
2576
|
"""
|
2577
2577
|
cancel all open orders in a market
|
2578
2578
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#cancelall
|
@@ -2596,7 +2596,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2596
2596
|
request['symbol'] = market['id']
|
2597
2597
|
return getattr(self, method)(self.extend(request, params))
|
2598
2598
|
|
2599
|
-
def fetch_order(self, id: str, symbol:
|
2599
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2600
2600
|
"""
|
2601
2601
|
fetches information on an order made by the user
|
2602
2602
|
:param str symbol: unified symbol of the market the order was made in
|
@@ -2631,7 +2631,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2631
2631
|
order = self.safe_value(data, 0, {})
|
2632
2632
|
return self.parse_order(order, market)
|
2633
2633
|
|
2634
|
-
def fetch_orders(self, symbol:
|
2634
|
+
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2635
2635
|
"""
|
2636
2636
|
fetches information on multiple orders made by the user
|
2637
2637
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
|
@@ -2662,7 +2662,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2662
2662
|
rows = self.safe_value(data, 'rows', data)
|
2663
2663
|
return self.parse_orders(rows, market, since, limit)
|
2664
2664
|
|
2665
|
-
def fetch_open_orders(self, symbol:
|
2665
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2666
2666
|
"""
|
2667
2667
|
fetch all unfilled currently open orders
|
2668
2668
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryopenorder
|
@@ -2698,7 +2698,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2698
2698
|
rows = self.safe_value(data, 'rows', [])
|
2699
2699
|
return self.parse_orders(rows, market, since, limit)
|
2700
2700
|
|
2701
|
-
def fetch_closed_orders(self, symbol:
|
2701
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2702
2702
|
"""
|
2703
2703
|
fetches information on multiple closed orders made by the user
|
2704
2704
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#queryorder
|
@@ -2768,7 +2768,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2768
2768
|
rows = self.safe_value(data, 'rows', [])
|
2769
2769
|
return self.parse_orders(rows, market, since, limit)
|
2770
2770
|
|
2771
|
-
def fetch_my_trades(self, symbol:
|
2771
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2772
2772
|
"""
|
2773
2773
|
fetch all trades made by the user
|
2774
2774
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#query-user-trade
|
@@ -2957,7 +2957,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2957
2957
|
'info': response,
|
2958
2958
|
}
|
2959
2959
|
|
2960
|
-
def fetch_deposits(self, code:
|
2960
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2961
2961
|
"""
|
2962
2962
|
fetch all deposits made to an account
|
2963
2963
|
:param str code: unified currency code
|
@@ -2994,7 +2994,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2994
2994
|
data = self.safe_value(response, 'data', {})
|
2995
2995
|
return self.parse_transactions(data, currency, since, limit)
|
2996
2996
|
|
2997
|
-
def fetch_withdrawals(self, code:
|
2997
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2998
2998
|
"""
|
2999
2999
|
fetch all withdrawals made from an account
|
3000
3000
|
:param str code: unified currency code
|
@@ -3038,7 +3038,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3038
3038
|
}
|
3039
3039
|
return self.safe_string(statuses, status, status)
|
3040
3040
|
|
3041
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
3041
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
3042
3042
|
#
|
3043
3043
|
# withdraw
|
3044
3044
|
#
|
@@ -3236,7 +3236,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3236
3236
|
result.append(self.parse_position(position))
|
3237
3237
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
3238
3238
|
|
3239
|
-
def parse_position(self, position, market=None):
|
3239
|
+
def parse_position(self, position, market: Market = None):
|
3240
3240
|
#
|
3241
3241
|
# {
|
3242
3242
|
# "userID": "811370",
|
@@ -3374,7 +3374,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3374
3374
|
'takeProfitPrice': None,
|
3375
3375
|
})
|
3376
3376
|
|
3377
|
-
def fetch_funding_history(self, symbol:
|
3377
|
+
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3378
3378
|
"""
|
3379
3379
|
fetch the history of funding payments paid and received on self account
|
3380
3380
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#futureDataFundingFeesHist
|
@@ -3485,7 +3485,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3485
3485
|
result = self.safe_value(response, 'result', {})
|
3486
3486
|
return self.parse_funding_rate(result, market)
|
3487
3487
|
|
3488
|
-
def parse_funding_rate(self, contract, market=None):
|
3488
|
+
def parse_funding_rate(self, contract, market: Market = None):
|
3489
3489
|
#
|
3490
3490
|
# {
|
3491
3491
|
# "askEp": 2332500,
|
@@ -3579,7 +3579,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3579
3579
|
}
|
3580
3580
|
return self.safe_string(statuses, status, status)
|
3581
3581
|
|
3582
|
-
def parse_margin_modification(self, data, market=None):
|
3582
|
+
def parse_margin_modification(self, data, market: Market = None):
|
3583
3583
|
#
|
3584
3584
|
# {
|
3585
3585
|
# "code": 0,
|
@@ -3600,7 +3600,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3600
3600
|
'status': self.parse_margin_status(self.safe_string(data, 'code')),
|
3601
3601
|
}
|
3602
3602
|
|
3603
|
-
def set_margin_mode(self, marginMode, symbol:
|
3603
|
+
def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
|
3604
3604
|
"""
|
3605
3605
|
set margin mode to 'cross' or 'isolated'
|
3606
3606
|
:param str marginMode: 'cross' or 'isolated'
|
@@ -3627,7 +3627,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3627
3627
|
}
|
3628
3628
|
return self.privatePutPositionsLeverage(self.extend(request, params))
|
3629
3629
|
|
3630
|
-
def set_position_mode(self, hedged, symbol:
|
3630
|
+
def set_position_mode(self, hedged, symbol: Str = None, params={}):
|
3631
3631
|
"""
|
3632
3632
|
set hedged to True or False for a market
|
3633
3633
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#switch-position-mode-synchronously
|
@@ -3746,7 +3746,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3746
3746
|
riskLimits = self.safe_value(data, 'riskLimits')
|
3747
3747
|
return self.parse_leverage_tiers(riskLimits, symbols, 'symbol')
|
3748
3748
|
|
3749
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
3749
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
3750
3750
|
"""
|
3751
3751
|
:param dict info: Exchange market response for 1 market
|
3752
3752
|
:param dict market: CCXT market
|
@@ -3810,7 +3810,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3810
3810
|
url = self.implode_hostname(self.urls['api'][api]) + url
|
3811
3811
|
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
3812
3812
|
|
3813
|
-
def set_leverage(self, leverage, symbol:
|
3813
|
+
def set_leverage(self, leverage, symbol: Str = None, params={}):
|
3814
3814
|
"""
|
3815
3815
|
set the level of leverage for a market
|
3816
3816
|
:see: https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#set-leverage
|
@@ -3926,7 +3926,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3926
3926
|
transfer['currency'] = code
|
3927
3927
|
return transfer
|
3928
3928
|
|
3929
|
-
def fetch_transfers(self, code:
|
3929
|
+
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3930
3930
|
"""
|
3931
3931
|
fetch a history of internal transfers made on an account
|
3932
3932
|
:param str code: unified currency code of the currency transferred
|
@@ -3971,7 +3971,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3971
3971
|
transfers = self.safe_value(data, 'rows', [])
|
3972
3972
|
return self.parse_transfers(transfers, currency, since, limit)
|
3973
3973
|
|
3974
|
-
def parse_transfer(self, transfer, currency=None):
|
3974
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
3975
3975
|
#
|
3976
3976
|
# transfer
|
3977
3977
|
#
|
@@ -4000,7 +4000,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4000
4000
|
id = self.safe_string(transfer, 'linkKey')
|
4001
4001
|
status = self.safe_string(transfer, 'status')
|
4002
4002
|
amountEv = self.safe_string(transfer, 'amountEv')
|
4003
|
-
amountTransfered = self.from_ev(amountEv
|
4003
|
+
amountTransfered = self.from_ev(amountEv)
|
4004
4004
|
currencyId = self.safe_string(transfer, 'currency')
|
4005
4005
|
code = self.safe_currency_code(currencyId, currency)
|
4006
4006
|
side = self.safe_integer(transfer, 'side')
|
@@ -4034,7 +4034,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4034
4034
|
}
|
4035
4035
|
return self.safe_string(statuses, status, status)
|
4036
4036
|
|
4037
|
-
def fetch_funding_rate_history(self, symbol:
|
4037
|
+
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4038
4038
|
"""
|
4039
4039
|
fetches historical funding rate prices
|
4040
4040
|
:see: https://phemex-docs.github.io/#query-funding-rate-history-2
|
ccxt/poloniex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.poloniex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, Market, Order, OrderBook, OrderSide, OrderType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -386,7 +386,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
386
386
|
},
|
387
387
|
})
|
388
388
|
|
389
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
389
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
390
390
|
#
|
391
391
|
# [
|
392
392
|
# [
|
@@ -574,7 +574,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
574
574
|
response = self.publicGetTimestamp(params)
|
575
575
|
return self.safe_integer(response, 'serverTime')
|
576
576
|
|
577
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
577
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
578
578
|
#
|
579
579
|
# {
|
580
580
|
# "symbol" : "BTC_USDT",
|
@@ -831,7 +831,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
831
831
|
#
|
832
832
|
return self.parse_ticker(response, market)
|
833
833
|
|
834
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
834
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
835
835
|
#
|
836
836
|
# fetchTrades
|
837
837
|
#
|
@@ -954,7 +954,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
954
954
|
#
|
955
955
|
return self.parse_trades(trades, market, since, limit)
|
956
956
|
|
957
|
-
def fetch_my_trades(self, symbol:
|
957
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
958
958
|
"""
|
959
959
|
fetch all trades made by the user
|
960
960
|
:see: https://docs.poloniex.com/#authenticated-endpoints-trades-trade-history
|
@@ -971,7 +971,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
971
971
|
paginate, params = self.handle_option_and_params(params, 'fetchMyTrades', 'paginate')
|
972
972
|
if paginate:
|
973
973
|
return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
|
974
|
-
market = None
|
974
|
+
market: Market = None
|
975
975
|
if symbol is not None:
|
976
976
|
market = self.market(symbol)
|
977
977
|
request = {
|
@@ -1020,7 +1020,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1020
1020
|
}
|
1021
1021
|
return self.safe_string(statuses, status, status)
|
1022
1022
|
|
1023
|
-
def parse_order(self, order, market=None) -> Order:
|
1023
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
1024
1024
|
#
|
1025
1025
|
# fetchOpenOrder
|
1026
1026
|
#
|
@@ -1090,8 +1090,8 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1090
1090
|
id = self.safe_string_n(order, ['orderNumber', 'id', 'orderId'])
|
1091
1091
|
fee = None
|
1092
1092
|
feeCurrency = self.safe_string(order, 'tokenFeeCurrency')
|
1093
|
-
feeCost = None
|
1094
|
-
feeCurrencyCode = None
|
1093
|
+
feeCost: Str = None
|
1094
|
+
feeCurrencyCode: Str = None
|
1095
1095
|
rate = self.safe_string(order, 'fee')
|
1096
1096
|
if feeCurrency is None:
|
1097
1097
|
feeCurrencyCode = market['base'] if (side == 'buy') else market['quote']
|
@@ -1153,7 +1153,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1153
1153
|
result.append(self.parse_order(extended, market))
|
1154
1154
|
return result
|
1155
1155
|
|
1156
|
-
def fetch_open_orders(self, symbol:
|
1156
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1157
1157
|
"""
|
1158
1158
|
fetch all unfilled currently open orders
|
1159
1159
|
:see: https://docs.poloniex.com/#authenticated-endpoints-orders-open-orders
|
@@ -1166,7 +1166,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1166
1166
|
:returns Order[]: a list of `order structures <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
|
1167
1167
|
"""
|
1168
1168
|
self.load_markets()
|
1169
|
-
market = None
|
1169
|
+
market: Market = None
|
1170
1170
|
request = {}
|
1171
1171
|
if symbol is not None:
|
1172
1172
|
market = self.market(symbol)
|
@@ -1318,7 +1318,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1318
1318
|
})
|
1319
1319
|
return self.parse_order(response, market)
|
1320
1320
|
|
1321
|
-
def cancel_order(self, id: str, symbol:
|
1321
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1322
1322
|
#
|
1323
1323
|
# @method
|
1324
1324
|
# @name poloniex#cancelOrder
|
@@ -1355,7 +1355,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1355
1355
|
#
|
1356
1356
|
return self.parse_order(response)
|
1357
1357
|
|
1358
|
-
def cancel_all_orders(self, symbol:
|
1358
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1359
1359
|
"""
|
1360
1360
|
cancel all open orders
|
1361
1361
|
:see: https://docs.poloniex.com/#authenticated-endpoints-orders-cancel-all-orders
|
@@ -1370,7 +1370,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1370
1370
|
# 'accountTypes': 'SPOT',
|
1371
1371
|
'symbols': [],
|
1372
1372
|
}
|
1373
|
-
market = None
|
1373
|
+
market: Market = None
|
1374
1374
|
if symbol is not None:
|
1375
1375
|
market = self.market(symbol)
|
1376
1376
|
request['symbols'] = [
|
@@ -1402,7 +1402,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1402
1402
|
#
|
1403
1403
|
return self.parse_orders(response, market)
|
1404
1404
|
|
1405
|
-
def fetch_order(self, id: str, symbol:
|
1405
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1406
1406
|
"""
|
1407
1407
|
fetch an order by it's id
|
1408
1408
|
:see: https://docs.poloniex.com/#authenticated-endpoints-orders-order-details
|
@@ -1451,13 +1451,13 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1451
1451
|
order['id'] = id
|
1452
1452
|
return order
|
1453
1453
|
|
1454
|
-
def fetch_order_status(self, id: str, symbol:
|
1454
|
+
def fetch_order_status(self, id: str, symbol: Str = None, params={}):
|
1455
1455
|
self.load_markets()
|
1456
1456
|
orders = self.fetch_open_orders(symbol, None, None, params)
|
1457
1457
|
indexed = self.index_by(orders, 'id')
|
1458
1458
|
return 'open' if (id in indexed) else 'closed'
|
1459
1459
|
|
1460
|
-
def fetch_order_trades(self, id: str, symbol:
|
1460
|
+
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1461
1461
|
"""
|
1462
1462
|
fetch all the trades made from a single order
|
1463
1463
|
:see: https://docs.poloniex.com/#authenticated-endpoints-trades-trades-by-order-id
|
@@ -1654,7 +1654,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1654
1654
|
# }
|
1655
1655
|
#
|
1656
1656
|
address = self.safe_string(response, 'address')
|
1657
|
-
tag = None
|
1657
|
+
tag: Str = None
|
1658
1658
|
self.check_address(address)
|
1659
1659
|
if currency is not None:
|
1660
1660
|
depositAddress = self.safe_string(currency['info'], 'depositAddress')
|
@@ -1698,7 +1698,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1698
1698
|
# }
|
1699
1699
|
#
|
1700
1700
|
address = self.safe_string(response, request['currency'])
|
1701
|
-
tag = None
|
1701
|
+
tag: Str = None
|
1702
1702
|
self.check_address(address)
|
1703
1703
|
if currency is not None:
|
1704
1704
|
depositAddress = self.safe_string(currency['info'], 'depositAddress')
|
@@ -1744,7 +1744,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1744
1744
|
#
|
1745
1745
|
return self.parse_transfer(response, currency)
|
1746
1746
|
|
1747
|
-
def parse_transfer(self, transfer, currency=None):
|
1747
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
1748
1748
|
#
|
1749
1749
|
# {
|
1750
1750
|
# "transferId" : "168041074"
|
@@ -1800,7 +1800,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1800
1800
|
#
|
1801
1801
|
return self.parse_transaction(response, currency)
|
1802
1802
|
|
1803
|
-
def fetch_transactions_helper(self, code:
|
1803
|
+
def fetch_transactions_helper(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
1804
1804
|
self.load_markets()
|
1805
1805
|
year = 31104000 # 60 * 60 * 24 * 30 * 12 = one year of history, why not
|
1806
1806
|
now = self.seconds()
|
@@ -1883,7 +1883,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1883
1883
|
#
|
1884
1884
|
return response
|
1885
1885
|
|
1886
|
-
def fetch_deposits_withdrawals(self, code:
|
1886
|
+
def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1887
1887
|
"""
|
1888
1888
|
fetch history of deposits and withdrawals
|
1889
1889
|
:see: https://docs.poloniex.com/#authenticated-endpoints-wallets-wallets-activity-records
|
@@ -1895,7 +1895,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1895
1895
|
"""
|
1896
1896
|
self.load_markets()
|
1897
1897
|
response = self.fetch_transactions_helper(code, since, limit, params)
|
1898
|
-
currency = None
|
1898
|
+
currency: Currency = None
|
1899
1899
|
if code is not None:
|
1900
1900
|
currency = self.currency(code)
|
1901
1901
|
withdrawals = self.safe_value(response, 'withdrawals', [])
|
@@ -1905,7 +1905,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1905
1905
|
transactions = self.array_concat(depositTransactions, withdrawalTransactions)
|
1906
1906
|
return self.filter_by_currency_since_limit(self.sort_by(transactions, 'timestamp'), code, since, limit)
|
1907
1907
|
|
1908
|
-
def fetch_withdrawals(self, code:
|
1908
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1909
1909
|
"""
|
1910
1910
|
fetch all withdrawals made from an account
|
1911
1911
|
:see: https://docs.poloniex.com/#authenticated-endpoints-wallets-wallets-activity-records
|
@@ -1916,7 +1916,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1916
1916
|
:returns dict[]: a list of `transaction structures <https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure>`
|
1917
1917
|
"""
|
1918
1918
|
response = self.fetch_transactions_helper(code, since, limit, params)
|
1919
|
-
currency = None
|
1919
|
+
currency: Currency = None
|
1920
1920
|
if code is not None:
|
1921
1921
|
currency = self.currency(code)
|
1922
1922
|
withdrawals = self.safe_value(response, 'withdrawals', [])
|
@@ -1994,7 +1994,8 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1994
1994
|
code = self.safe_currency_code(currencyId)
|
1995
1995
|
feeInfo = response[currencyId]
|
1996
1996
|
if (codes is None) or (self.in_array(code, codes)):
|
1997
|
-
|
1997
|
+
currency = self.currency(code)
|
1998
|
+
depositWithdrawFees[code] = self.parse_deposit_withdraw_fee(feeInfo, currency)
|
1998
1999
|
childChains = self.safe_value(feeInfo, 'childChains')
|
1999
2000
|
chainsLength = len(childChains)
|
2000
2001
|
if chainsLength > 0:
|
@@ -2018,9 +2019,9 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2018
2019
|
depositWithdrawFees[code]['networks'] = self.extend(depositWithdrawFees[code]['networks'], networkObject)
|
2019
2020
|
return depositWithdrawFees
|
2020
2021
|
|
2021
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
2022
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
2022
2023
|
depositWithdrawFee = self.deposit_withdraw_fee({})
|
2023
|
-
depositWithdrawFee['info'][currency] = fee
|
2024
|
+
depositWithdrawFee['info'][currency['code']] = fee
|
2024
2025
|
networkId = self.safe_string(fee, 'blockchain')
|
2025
2026
|
withdrawFee = self.safe_number(fee, 'withdrawalFee')
|
2026
2027
|
withdrawResult = {
|
@@ -2040,7 +2041,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2040
2041
|
}
|
2041
2042
|
return depositWithdrawFee
|
2042
2043
|
|
2043
|
-
def fetch_deposits(self, code:
|
2044
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2044
2045
|
"""
|
2045
2046
|
fetch all deposits made to an account
|
2046
2047
|
:see: https://docs.poloniex.com/#authenticated-endpoints-wallets-wallets-activity-records
|
@@ -2071,7 +2072,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2071
2072
|
}
|
2072
2073
|
return self.safe_string(statuses, status, status)
|
2073
2074
|
|
2074
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
2075
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2075
2076
|
#
|
2076
2077
|
# deposits
|
2077
2078
|
#
|