ccxt 4.3.33__py2.py3-none-any.whl → 4.3.35__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 +1 -1
- 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/ace.py +2 -2
- ccxt/alpaca.py +2 -2
- ccxt/ascendex.py +2 -2
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +2 -2
- ccxt/async_support/alpaca.py +2 -2
- ccxt/async_support/ascendex.py +2 -2
- ccxt/async_support/base/exchange.py +56 -40
- ccxt/async_support/bigone.py +2 -2
- ccxt/async_support/binance.py +6 -5
- ccxt/async_support/bingx.py +4 -3
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +2 -2
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +4 -4
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +4 -9
- ccxt/async_support/bitmex.py +3 -3
- ccxt/async_support/bitopro.py +3 -3
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +2 -2
- ccxt/async_support/bitstamp.py +2 -2
- ccxt/async_support/bitteam.py +3 -3
- ccxt/async_support/bitvavo.py +2 -2
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +3 -3
- ccxt/async_support/btcalpha.py +3 -3
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +6 -4
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +3 -3
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +156 -58
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +3 -3
- ccxt/async_support/coincheck.py +2 -2
- ccxt/async_support/coinex.py +28 -21
- ccxt/async_support/coinlist.py +2 -2
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +2 -2
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +2 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/deribit.py +2 -2
- ccxt/async_support/digifinex.py +2 -2
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +2 -2
- ccxt/async_support/gemini.py +3 -3
- ccxt/async_support/hitbtc.py +2 -2
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +2 -2
- ccxt/async_support/huobijp.py +2 -2
- ccxt/async_support/hyperliquid.py +2 -2
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +5 -3
- ccxt/async_support/krakenfutures.py +1 -1
- ccxt/async_support/kucoin.py +2 -2
- ccxt/async_support/kuna.py +2 -2
- ccxt/async_support/latoken.py +2 -2
- ccxt/async_support/lbank.py +1 -1
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/novadax.py +3 -3
- ccxt/async_support/oceanex.py +2 -2
- ccxt/async_support/okcoin.py +3 -3
- ccxt/async_support/okx.py +3 -3
- ccxt/async_support/onetrading.py +2 -2
- ccxt/async_support/p2b.py +2 -2
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/phemex.py +4 -4
- ccxt/async_support/poloniex.py +3 -3
- ccxt/async_support/poloniexfutures.py +2 -2
- ccxt/async_support/probit.py +3 -3
- ccxt/async_support/timex.py +2 -2
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/upbit.py +3 -3
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/wazirx.py +3 -3
- ccxt/async_support/whitebit.py +3 -3
- ccxt/async_support/woo.py +3 -3
- ccxt/async_support/woofipro.py +3 -3
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +2 -2
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +107 -76
- ccxt/base/types.py +0 -1
- ccxt/bigone.py +2 -2
- ccxt/binance.py +6 -5
- ccxt/bingx.py +4 -3
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +2 -2
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +4 -4
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +4 -9
- ccxt/bitmex.py +3 -3
- ccxt/bitopro.py +3 -3
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +2 -2
- ccxt/bitstamp.py +2 -2
- ccxt/bitteam.py +3 -3
- ccxt/bitvavo.py +2 -2
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +3 -3
- ccxt/btcalpha.py +3 -3
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +6 -4
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +3 -3
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +156 -58
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +3 -3
- ccxt/coincheck.py +2 -2
- ccxt/coinex.py +28 -21
- ccxt/coinlist.py +2 -2
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +2 -2
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +2 -2
- ccxt/delta.py +1 -1
- ccxt/deribit.py +2 -2
- ccxt/digifinex.py +2 -2
- ccxt/exmo.py +2 -2
- ccxt/gate.py +2 -2
- ccxt/gemini.py +3 -3
- ccxt/hitbtc.py +2 -2
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +2 -2
- ccxt/huobijp.py +2 -2
- ccxt/hyperliquid.py +2 -2
- ccxt/idex.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +5 -3
- ccxt/krakenfutures.py +1 -1
- ccxt/kucoin.py +2 -2
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +2 -2
- ccxt/lbank.py +1 -1
- ccxt/luno.py +1 -1
- ccxt/lykke.py +1 -1
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +2 -2
- ccxt/novadax.py +3 -3
- ccxt/oceanex.py +2 -2
- ccxt/okcoin.py +3 -3
- ccxt/okx.py +3 -3
- ccxt/onetrading.py +2 -2
- ccxt/p2b.py +2 -2
- ccxt/paymium.py +1 -1
- ccxt/phemex.py +4 -4
- ccxt/poloniex.py +3 -3
- ccxt/poloniexfutures.py +2 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +331 -2
- ccxt/pro/bitget.py +24 -1
- ccxt/pro/bitmart.py +1 -1
- ccxt/pro/bitmex.py +98 -1
- ccxt/pro/bybit.py +82 -1
- ccxt/pro/gate.py +173 -1
- ccxt/pro/kraken.py +1 -1
- ccxt/pro/kucoinfutures.py +4 -0
- ccxt/pro/okx.py +244 -1
- ccxt/probit.py +3 -3
- ccxt/test/base/__init__.py +1 -0
- ccxt/test/base/test_crypto.py +1 -1
- ccxt/test/base/test_liquidation.py +50 -0
- ccxt/timex.py +2 -2
- ccxt/tokocrypto.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/upbit.py +3 -3
- ccxt/wavesexchange.py +1 -1
- ccxt/wazirx.py +3 -3
- ccxt/whitebit.py +3 -3
- ccxt/woo.py +3 -3
- ccxt/woofipro.py +3 -3
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +2 -2
- ccxt/zonda.py +1 -1
- {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/METADATA +4 -4
- {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/RECORD +204 -203
- {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/WHEEL +0 -0
- {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/top_level.txt +0 -0
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.35'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -254,9 +254,11 @@ class Exchange(object):
|
|
254
254
|
'511': AuthenticationError,
|
255
255
|
}
|
256
256
|
balance = None
|
257
|
+
liquidations = None
|
257
258
|
orderbooks = None
|
258
259
|
orders = None
|
259
260
|
triggerOrders = None
|
261
|
+
myLiquidations = None
|
260
262
|
myTrades = None
|
261
263
|
trades = None
|
262
264
|
transactions = None
|
@@ -390,6 +392,10 @@ class Exchange(object):
|
|
390
392
|
'watchOrderBookForSymbols': None,
|
391
393
|
'watchOHLCVForSymbols': None,
|
392
394
|
'watchBalance': None,
|
395
|
+
'watchLiquidations': None,
|
396
|
+
'watchLiquidationsForSymbols': None,
|
397
|
+
'watchMyLiquidations': None,
|
398
|
+
'watchMyLiquidationsForSymbols': None,
|
393
399
|
'watchOHLCV': None,
|
394
400
|
}
|
395
401
|
precisionMode = DECIMAL_PLACES
|
@@ -1736,10 +1742,10 @@ class Exchange(object):
|
|
1736
1742
|
def string_to_chars_array(self, value):
|
1737
1743
|
return list(value)
|
1738
1744
|
|
1739
|
-
def
|
1745
|
+
def value_is_defined(self, value):
|
1740
1746
|
return value is not None
|
1741
1747
|
|
1742
|
-
def
|
1748
|
+
def array_slice(self, array, first, second=None):
|
1743
1749
|
return array[first:second] if second else array[first:]
|
1744
1750
|
|
1745
1751
|
def get_property(self, obj, property, defaultValue=None):
|
@@ -1946,10 +1952,10 @@ class Exchange(object):
|
|
1946
1952
|
httpsProxy = None
|
1947
1953
|
socksProxy = None
|
1948
1954
|
# httpProxy
|
1949
|
-
if self.
|
1955
|
+
if self.value_is_defined(self.httpProxy):
|
1950
1956
|
usedProxies.append('httpProxy')
|
1951
1957
|
httpProxy = self.httpProxy
|
1952
|
-
if self.
|
1958
|
+
if self.value_is_defined(self.http_proxy):
|
1953
1959
|
usedProxies.append('http_proxy')
|
1954
1960
|
httpProxy = self.http_proxy
|
1955
1961
|
if self.httpProxyCallback is not None:
|
@@ -1959,10 +1965,10 @@ class Exchange(object):
|
|
1959
1965
|
usedProxies.append('http_proxy_callback')
|
1960
1966
|
httpProxy = self.http_proxy_callback(url, method, headers, body)
|
1961
1967
|
# httpsProxy
|
1962
|
-
if self.
|
1968
|
+
if self.value_is_defined(self.httpsProxy):
|
1963
1969
|
usedProxies.append('httpsProxy')
|
1964
1970
|
httpsProxy = self.httpsProxy
|
1965
|
-
if self.
|
1971
|
+
if self.value_is_defined(self.https_proxy):
|
1966
1972
|
usedProxies.append('https_proxy')
|
1967
1973
|
httpsProxy = self.https_proxy
|
1968
1974
|
if self.httpsProxyCallback is not None:
|
@@ -1972,10 +1978,10 @@ class Exchange(object):
|
|
1972
1978
|
usedProxies.append('https_proxy_callback')
|
1973
1979
|
httpsProxy = self.https_proxy_callback(url, method, headers, body)
|
1974
1980
|
# socksProxy
|
1975
|
-
if self.
|
1981
|
+
if self.value_is_defined(self.socksProxy):
|
1976
1982
|
usedProxies.append('socksProxy')
|
1977
1983
|
socksProxy = self.socksProxy
|
1978
|
-
if self.
|
1984
|
+
if self.value_is_defined(self.socks_proxy):
|
1979
1985
|
usedProxies.append('socks_proxy')
|
1980
1986
|
socksProxy = self.socks_proxy
|
1981
1987
|
if self.socksProxyCallback is not None:
|
@@ -1997,24 +2003,24 @@ class Exchange(object):
|
|
1997
2003
|
wssProxy = None
|
1998
2004
|
wsSocksProxy = None
|
1999
2005
|
# ws proxy
|
2000
|
-
if self.
|
2006
|
+
if self.value_is_defined(self.wsProxy):
|
2001
2007
|
usedProxies.append('wsProxy')
|
2002
2008
|
wsProxy = self.wsProxy
|
2003
|
-
if self.
|
2009
|
+
if self.value_is_defined(self.ws_proxy):
|
2004
2010
|
usedProxies.append('ws_proxy')
|
2005
2011
|
wsProxy = self.ws_proxy
|
2006
2012
|
# wss proxy
|
2007
|
-
if self.
|
2013
|
+
if self.value_is_defined(self.wssProxy):
|
2008
2014
|
usedProxies.append('wssProxy')
|
2009
2015
|
wssProxy = self.wssProxy
|
2010
|
-
if self.
|
2016
|
+
if self.value_is_defined(self.wss_proxy):
|
2011
2017
|
usedProxies.append('wss_proxy')
|
2012
2018
|
wssProxy = self.wss_proxy
|
2013
2019
|
# ws socks proxy
|
2014
|
-
if self.
|
2020
|
+
if self.value_is_defined(self.wsSocksProxy):
|
2015
2021
|
usedProxies.append('wsSocksProxy')
|
2016
2022
|
wsSocksProxy = self.wsSocksProxy
|
2017
|
-
if self.
|
2023
|
+
if self.value_is_defined(self.ws_socks_proxy):
|
2018
2024
|
usedProxies.append('ws_socks_proxy')
|
2019
2025
|
wsSocksProxy = self.ws_socks_proxy
|
2020
2026
|
# check
|
@@ -2038,7 +2044,7 @@ class Exchange(object):
|
|
2038
2044
|
return result
|
2039
2045
|
|
2040
2046
|
def filter_by_limit(self, array: List[object], limit: Int = None, key: IndexType = 'timestamp', fromStart: bool = False):
|
2041
|
-
if self.
|
2047
|
+
if self.value_is_defined(limit):
|
2042
2048
|
arrayLength = len(array)
|
2043
2049
|
if arrayLength > 0:
|
2044
2050
|
ascending = True
|
@@ -2050,13 +2056,13 @@ class Exchange(object):
|
|
2050
2056
|
if fromStart:
|
2051
2057
|
if limit > arrayLength:
|
2052
2058
|
limit = arrayLength
|
2053
|
-
array = self.
|
2059
|
+
array = self.array_slice(array, 0, limit) if ascending else self.array_slice(array, -limit)
|
2054
2060
|
else:
|
2055
|
-
array = self.
|
2061
|
+
array = self.array_slice(array, -limit) if ascending else self.array_slice(array, 0, limit)
|
2056
2062
|
return array
|
2057
2063
|
|
2058
2064
|
def filter_by_since_limit(self, array: List[object], since: Int = None, limit: Int = None, key: IndexType = 'timestamp', tail=False):
|
2059
|
-
sinceIsDefined = self.
|
2065
|
+
sinceIsDefined = self.value_is_defined(since)
|
2060
2066
|
parsedArray = self.to_array(array)
|
2061
2067
|
result = parsedArray
|
2062
2068
|
if sinceIsDefined:
|
@@ -2067,15 +2073,15 @@ class Exchange(object):
|
|
2067
2073
|
if value and (value >= since):
|
2068
2074
|
result.append(entry)
|
2069
2075
|
if tail and limit is not None:
|
2070
|
-
return self.
|
2076
|
+
return self.array_slice(result, -limit)
|
2071
2077
|
# if the user provided a 'since' argument
|
2072
2078
|
# we want to limit the result starting from the 'since'
|
2073
2079
|
shouldFilterFromStart = not tail and sinceIsDefined
|
2074
2080
|
return self.filter_by_limit(result, limit, key, shouldFilterFromStart)
|
2075
2081
|
|
2076
2082
|
def filter_by_value_since_limit(self, array: List[object], field: IndexType, value=None, since: Int = None, limit: Int = None, key='timestamp', tail=False):
|
2077
|
-
valueIsDefined = self.
|
2078
|
-
sinceIsDefined = self.
|
2083
|
+
valueIsDefined = self.value_is_defined(value)
|
2084
|
+
sinceIsDefined = self.value_is_defined(since)
|
2079
2085
|
parsedArray = self.to_array(array)
|
2080
2086
|
result = parsedArray
|
2081
2087
|
# single-pass filter for both symbol and since
|
@@ -2091,7 +2097,7 @@ class Exchange(object):
|
|
2091
2097
|
if firstCondition and secondCondition:
|
2092
2098
|
result.append(entry)
|
2093
2099
|
if tail and limit is not None:
|
2094
|
-
return self.
|
2100
|
+
return self.array_slice(result, -limit)
|
2095
2101
|
return self.filter_by_limit(result, limit, key, sinceIsDefined)
|
2096
2102
|
|
2097
2103
|
def set_sandbox_mode(self, enabled: bool):
|
@@ -2125,6 +2131,22 @@ class Exchange(object):
|
|
2125
2131
|
def fetch_trades_ws(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
2126
2132
|
raise NotSupported(self.id + ' fetchTradesWs() is not supported yet')
|
2127
2133
|
|
2134
|
+
def watch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
2135
|
+
if self.has['watchLiquidationsForSymbols']:
|
2136
|
+
return self.watch_liquidations_for_symbols([symbol], since, limit, params)
|
2137
|
+
raise NotSupported(self.id + ' watchLiquidations() is not supported yet')
|
2138
|
+
|
2139
|
+
def watch_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}):
|
2140
|
+
raise NotSupported(self.id + ' watchLiquidationsForSymbols() is not supported yet')
|
2141
|
+
|
2142
|
+
def watch_my_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
2143
|
+
if self.has['watchMyLiquidationsForSymbols']:
|
2144
|
+
return self.watch_my_liquidations_for_symbols([symbol], since, limit, params)
|
2145
|
+
raise NotSupported(self.id + ' watchMyLiquidations() is not supported yet')
|
2146
|
+
|
2147
|
+
def watch_my_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}):
|
2148
|
+
raise NotSupported(self.id + ' watchMyLiquidationsForSymbols() is not supported yet')
|
2149
|
+
|
2128
2150
|
def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
2129
2151
|
raise NotSupported(self.id + ' watchTrades() is not supported yet')
|
2130
2152
|
|
@@ -2151,7 +2173,7 @@ class Exchange(object):
|
|
2151
2173
|
|
2152
2174
|
def fetch_margin_mode(self, symbol: str, params={}):
|
2153
2175
|
if self.has['fetchMarginModes']:
|
2154
|
-
marginModes = self.
|
2176
|
+
marginModes = self.fetch_margin_modes([symbol], params)
|
2155
2177
|
return self.safe_dict(marginModes, symbol)
|
2156
2178
|
else:
|
2157
2179
|
raise NotSupported(self.id + ' fetchMarginMode() is not supported yet')
|
@@ -2160,7 +2182,7 @@ class Exchange(object):
|
|
2160
2182
|
raise NotSupported(self.id + ' fetchMarginModes() is not supported yet')
|
2161
2183
|
|
2162
2184
|
def fetch_rest_order_book_safe(self, symbol, limit=None, params={}):
|
2163
|
-
fetchSnapshotMaxRetries = self.
|
2185
|
+
fetchSnapshotMaxRetries = self.handle_option('watchOrderBook', 'maxRetries', 3)
|
2164
2186
|
for i in range(0, fetchSnapshotMaxRetries):
|
2165
2187
|
try:
|
2166
2188
|
orderBook = self.fetch_order_book(symbol, limit, params)
|
@@ -2179,7 +2201,7 @@ class Exchange(object):
|
|
2179
2201
|
def fetch_trading_limits(self, symbols: Strings = None, params={}):
|
2180
2202
|
raise NotSupported(self.id + ' fetchTradingLimits() is not supported yet')
|
2181
2203
|
|
2182
|
-
def parse_market(self, market):
|
2204
|
+
def parse_market(self, market: dict):
|
2183
2205
|
raise NotSupported(self.id + ' parseMarket() is not supported yet')
|
2184
2206
|
|
2185
2207
|
def parse_markets(self, markets):
|
@@ -2258,7 +2280,7 @@ class Exchange(object):
|
|
2258
2280
|
raise NotSupported(self.id + ' watchFundingRates() is not supported yet')
|
2259
2281
|
|
2260
2282
|
def watch_funding_rates_for_symbols(self, symbols: List[str], params={}):
|
2261
|
-
return self.
|
2283
|
+
return self.watch_funding_rates(symbols, params)
|
2262
2284
|
|
2263
2285
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
|
2264
2286
|
raise NotSupported(self.id + ' transfer() is not supported yet')
|
@@ -2274,7 +2296,7 @@ class Exchange(object):
|
|
2274
2296
|
|
2275
2297
|
def fetch_leverage(self, symbol: str, params={}):
|
2276
2298
|
if self.has['fetchLeverages']:
|
2277
|
-
leverages = self.
|
2299
|
+
leverages = self.fetch_leverages([symbol], params)
|
2278
2300
|
return self.safe_dict(leverages, symbol)
|
2279
2301
|
else:
|
2280
2302
|
raise NotSupported(self.id + ' fetchLeverage() is not supported yet')
|
@@ -3001,6 +3023,15 @@ class Exchange(object):
|
|
3001
3023
|
trade['cost'] = self.parse_number(cost)
|
3002
3024
|
return trade
|
3003
3025
|
|
3026
|
+
def find_nearest_ceiling(self, arr: List[float], providedValue: float):
|
3027
|
+
# i.e. findNearestCeiling([10, 30, 50], 23) returns 30
|
3028
|
+
length = len(arr)
|
3029
|
+
for i in range(0, length):
|
3030
|
+
current = arr[i]
|
3031
|
+
if providedValue <= current:
|
3032
|
+
return current
|
3033
|
+
return arr[length - 1]
|
3034
|
+
|
3004
3035
|
def invert_flat_string_dictionary(self, dict):
|
3005
3036
|
reversed = {}
|
3006
3037
|
keys = list(dict.keys())
|
@@ -3198,7 +3229,7 @@ class Exchange(object):
|
|
3198
3229
|
result[close] = []
|
3199
3230
|
result[volume] = []
|
3200
3231
|
for i in range(0, len(ohlcvs)):
|
3201
|
-
ts = ohlcvs[i][0] if ms else self.
|
3232
|
+
ts = ohlcvs[i][0] if ms else self.parse_to_int(ohlcvs[i][0] / 1000)
|
3202
3233
|
result[timestamp].append(ts)
|
3203
3234
|
result[open].append(ohlcvs[i][1])
|
3204
3235
|
result[high].append(ohlcvs[i][2])
|
@@ -3777,12 +3808,12 @@ class Exchange(object):
|
|
3777
3808
|
return self.edit_order(id, symbol, 'limit', side, amount, price, params)
|
3778
3809
|
|
3779
3810
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3780
|
-
self.
|
3811
|
+
self.cancel_order(id, symbol)
|
3781
3812
|
return self.create_order(symbol, type, side, amount, price, params)
|
3782
3813
|
|
3783
3814
|
def edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
3784
|
-
self.
|
3785
|
-
return self.
|
3815
|
+
self.cancel_order_ws(id, symbol)
|
3816
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
3786
3817
|
|
3787
3818
|
def fetch_permissions(self, params={}):
|
3788
3819
|
raise NotSupported(self.id + ' fetchPermissions() is not supported yet')
|
@@ -3800,7 +3831,7 @@ class Exchange(object):
|
|
3800
3831
|
raise NotSupported(self.id + ' watchPositions() is not supported yet')
|
3801
3832
|
|
3802
3833
|
def watch_position_for_symbols(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}):
|
3803
|
-
return self.
|
3834
|
+
return self.watch_positions(symbols, since, limit, params)
|
3804
3835
|
|
3805
3836
|
def fetch_positions_for_symbol(self, symbol: str, params={}):
|
3806
3837
|
"""
|
@@ -3965,7 +3996,7 @@ class Exchange(object):
|
|
3965
3996
|
def fetch_deposit_withdraw_fee(self, code: str, params={}):
|
3966
3997
|
if not self.has['fetchDepositWithdrawFees']:
|
3967
3998
|
raise NotSupported(self.id + ' fetchDepositWithdrawFee() is not supported yet')
|
3968
|
-
fees = self.
|
3999
|
+
fees = self.fetch_deposit_withdraw_fees([code], params)
|
3969
4000
|
return self.safe_value(fees, code)
|
3970
4001
|
|
3971
4002
|
def get_supported_mapping(self, key, mapping={}):
|
@@ -3978,7 +4009,7 @@ class Exchange(object):
|
|
3978
4009
|
self.load_markets()
|
3979
4010
|
if not self.has['fetchBorrowRates']:
|
3980
4011
|
raise NotSupported(self.id + ' fetchCrossBorrowRate() is not supported yet')
|
3981
|
-
borrowRates = self.
|
4012
|
+
borrowRates = self.fetch_cross_borrow_rates(params)
|
3982
4013
|
rate = self.safe_value(borrowRates, code)
|
3983
4014
|
if rate is None:
|
3984
4015
|
raise ExchangeError(self.id + ' fetchCrossBorrowRate() could not find the borrow rate for currency code ' + code)
|
@@ -4105,7 +4136,7 @@ class Exchange(object):
|
|
4105
4136
|
return key
|
4106
4137
|
return None
|
4107
4138
|
|
4108
|
-
def handle_errors(self, statusCode, statusText, url, method, responseHeaders, responseBody, response, requestHeaders, requestBody):
|
4139
|
+
def handle_errors(self, statusCode: int, statusText: str, url: str, method: str, responseHeaders: dict, responseBody: str, response, requestHeaders, requestBody):
|
4109
4140
|
# it is a stub method that must be overrided in the derived exchange classes
|
4110
4141
|
# raise NotSupported(self.id + ' handleErrors() not implemented yet')
|
4111
4142
|
return None
|
@@ -4132,7 +4163,7 @@ class Exchange(object):
|
|
4132
4163
|
self.load_markets()
|
4133
4164
|
market = self.market(symbol)
|
4134
4165
|
symbol = market['symbol']
|
4135
|
-
tickers = self.
|
4166
|
+
tickers = self.fetch_ticker_ws(symbol, params)
|
4136
4167
|
ticker = self.safe_dict(tickers, symbol)
|
4137
4168
|
if ticker is None:
|
4138
4169
|
raise NullResponse(self.id + ' fetchTickers() could not find a ticker for ' + symbol)
|
@@ -4218,7 +4249,7 @@ class Exchange(object):
|
|
4218
4249
|
if trailingTriggerPrice is not None:
|
4219
4250
|
params['trailingTriggerPrice'] = trailingTriggerPrice
|
4220
4251
|
if self.has['createTrailingAmountOrderWs']:
|
4221
|
-
return self.
|
4252
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
4222
4253
|
raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
|
4223
4254
|
|
4224
4255
|
def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
@@ -4262,7 +4293,7 @@ class Exchange(object):
|
|
4262
4293
|
if trailingTriggerPrice is not None:
|
4263
4294
|
params['trailingTriggerPrice'] = trailingTriggerPrice
|
4264
4295
|
if self.has['createTrailingPercentOrderWs']:
|
4265
|
-
return self.
|
4296
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
4266
4297
|
raise NotSupported(self.id + ' createTrailingPercentOrderWs() is not supported yet')
|
4267
4298
|
|
4268
4299
|
def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
@@ -4312,7 +4343,7 @@ class Exchange(object):
|
|
4312
4343
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
4313
4344
|
"""
|
4314
4345
|
if self.has['createMarketOrderWithCostWs'] or (self.has['createMarketBuyOrderWithCostWs'] and self.has['createMarketSellOrderWithCostWs']):
|
4315
|
-
return self.
|
4346
|
+
return self.create_order_ws(symbol, 'market', side, cost, 1, params)
|
4316
4347
|
raise NotSupported(self.id + ' createMarketOrderWithCostWs() is not supported yet')
|
4317
4348
|
|
4318
4349
|
def create_trigger_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, triggerPrice: Num = None, params={}):
|
@@ -4350,7 +4381,7 @@ class Exchange(object):
|
|
4350
4381
|
raise ArgumentsRequired(self.id + ' createTriggerOrderWs() requires a triggerPrice argument')
|
4351
4382
|
params['triggerPrice'] = triggerPrice
|
4352
4383
|
if self.has['createTriggerOrderWs']:
|
4353
|
-
return self.
|
4384
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
4354
4385
|
raise NotSupported(self.id + ' createTriggerOrderWs() is not supported yet')
|
4355
4386
|
|
4356
4387
|
def create_stop_loss_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, stopLossPrice: Num = None, params={}):
|
@@ -4388,7 +4419,7 @@ class Exchange(object):
|
|
4388
4419
|
raise ArgumentsRequired(self.id + ' createStopLossOrderWs() requires a stopLossPrice argument')
|
4389
4420
|
params['stopLossPrice'] = stopLossPrice
|
4390
4421
|
if self.has['createStopLossOrderWs']:
|
4391
|
-
return self.
|
4422
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
4392
4423
|
raise NotSupported(self.id + ' createStopLossOrderWs() is not supported yet')
|
4393
4424
|
|
4394
4425
|
def create_take_profit_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, takeProfitPrice: Num = None, params={}):
|
@@ -4426,7 +4457,7 @@ class Exchange(object):
|
|
4426
4457
|
raise ArgumentsRequired(self.id + ' createTakeProfitOrderWs() requires a takeProfitPrice argument')
|
4427
4458
|
params['takeProfitPrice'] = takeProfitPrice
|
4428
4459
|
if self.has['createTakeProfitOrderWs']:
|
4429
|
-
return self.
|
4460
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
4430
4461
|
raise NotSupported(self.id + ' createTakeProfitOrderWs() is not supported yet')
|
4431
4462
|
|
4432
4463
|
def create_order_with_take_profit_and_stop_loss(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, takeProfit: Num = None, stopLoss: Num = None, params={}):
|
@@ -4516,7 +4547,7 @@ class Exchange(object):
|
|
4516
4547
|
"""
|
4517
4548
|
params = self.set_take_profit_and_stop_loss_params(symbol, type, side, amount, price, takeProfit, stopLoss, params)
|
4518
4549
|
if self.has['createOrderWithTakeProfitAndStopLossWs']:
|
4519
|
-
return self.
|
4550
|
+
return self.create_order_ws(symbol, type, side, amount, price, params)
|
4520
4551
|
raise NotSupported(self.id + ' createOrderWithTakeProfitAndStopLossWs() is not supported yet')
|
4521
4552
|
|
4522
4553
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
@@ -4547,7 +4578,7 @@ class Exchange(object):
|
|
4547
4578
|
raise NotSupported(self.id + ' cancelAllOrdersWs() is not supported yet')
|
4548
4579
|
|
4549
4580
|
def cancel_unified_order(self, order, params={}):
|
4550
|
-
return self.
|
4581
|
+
return self.cancel_order(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
|
4551
4582
|
|
4552
4583
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4553
4584
|
if self.has['fetchOpenOrders'] and self.has['fetchClosedOrders']:
|
@@ -4571,7 +4602,7 @@ class Exchange(object):
|
|
4571
4602
|
|
4572
4603
|
def fetch_open_orders_ws(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4573
4604
|
if self.has['fetchOrdersWs']:
|
4574
|
-
orders = self.
|
4605
|
+
orders = self.fetch_orders_ws(symbol, since, limit, params)
|
4575
4606
|
return self.filter_by(orders, 'status', 'open')
|
4576
4607
|
raise NotSupported(self.id + ' fetchOpenOrdersWs() is not supported yet')
|
4577
4608
|
|
@@ -4586,7 +4617,7 @@ class Exchange(object):
|
|
4586
4617
|
|
4587
4618
|
def fetch_closed_orders_ws(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
4588
4619
|
if self.has['fetchOrdersWs']:
|
4589
|
-
orders = self.
|
4620
|
+
orders = self.fetch_orders_ws(symbol, since, limit, params)
|
4590
4621
|
return self.filter_by(orders, 'status', 'closed')
|
4591
4622
|
raise NotSupported(self.id + ' fetchClosedOrdersWs() is not supported yet')
|
4592
4623
|
|
@@ -4660,7 +4691,7 @@ class Exchange(object):
|
|
4660
4691
|
|
4661
4692
|
def fetch_deposit_address(self, code: str, params={}):
|
4662
4693
|
if self.has['fetchDepositAddresses']:
|
4663
|
-
depositAddresses = self.
|
4694
|
+
depositAddresses = self.fetch_deposit_addresses([code], params)
|
4664
4695
|
depositAddress = self.safe_value(depositAddresses, code)
|
4665
4696
|
if depositAddress is None:
|
4666
4697
|
raise InvalidAddress(self.id + ' fetchDepositAddress() could not find a deposit address for ' + code + ', make sure you have created a corresponding deposit address in your wallet on the exchange website')
|
@@ -4669,7 +4700,7 @@ class Exchange(object):
|
|
4669
4700
|
elif self.has['fetchDepositAddressesByNetwork']:
|
4670
4701
|
network = self.safe_string(params, 'network')
|
4671
4702
|
params = self.omit(params, 'network')
|
4672
|
-
addressStructures = self.
|
4703
|
+
addressStructures = self.fetch_deposit_addresses_by_network(code, params)
|
4673
4704
|
if network is not None:
|
4674
4705
|
return self.safe_dict(addressStructures, network)
|
4675
4706
|
else:
|
@@ -4715,7 +4746,7 @@ class Exchange(object):
|
|
4715
4746
|
return market
|
4716
4747
|
return markets[0]
|
4717
4748
|
elif (symbol.endswith('-C')) or (symbol.endswith('-P')) or (symbol.startswith('C-')) or (symbol.startswith('P-')):
|
4718
|
-
return self.
|
4749
|
+
return self.create_expired_option_market(symbol)
|
4719
4750
|
raise BadSymbol(self.id + ' does not have market symbol ' + symbol)
|
4720
4751
|
|
4721
4752
|
def create_expired_option_market(self, symbol: str):
|
@@ -4735,37 +4766,37 @@ class Exchange(object):
|
|
4735
4766
|
return self.create_order(symbol, 'limit', side, amount, price, params)
|
4736
4767
|
|
4737
4768
|
def create_limit_order_ws(self, symbol: str, side: OrderSide, amount: float, price: float, params={}):
|
4738
|
-
return self.
|
4769
|
+
return self.create_order_ws(symbol, 'limit', side, amount, price, params)
|
4739
4770
|
|
4740
4771
|
def create_market_order(self, symbol: str, side: OrderSide, amount: float, price: Num = None, params={}):
|
4741
4772
|
return self.create_order(symbol, 'market', side, amount, price, params)
|
4742
4773
|
|
4743
4774
|
def create_market_order_ws(self, symbol: str, side: OrderSide, amount: float, price: Num = None, params={}):
|
4744
|
-
return self.
|
4775
|
+
return self.create_order_ws(symbol, 'market', side, amount, price, params)
|
4745
4776
|
|
4746
4777
|
def create_limit_buy_order(self, symbol: str, amount: float, price: float, params={}):
|
4747
4778
|
return self.create_order(symbol, 'limit', 'buy', amount, price, params)
|
4748
4779
|
|
4749
4780
|
def create_limit_buy_order_ws(self, symbol: str, amount: float, price: float, params={}):
|
4750
|
-
return self.
|
4781
|
+
return self.create_order_ws(symbol, 'limit', 'buy', amount, price, params)
|
4751
4782
|
|
4752
4783
|
def create_limit_sell_order(self, symbol: str, amount: float, price: float, params={}):
|
4753
4784
|
return self.create_order(symbol, 'limit', 'sell', amount, price, params)
|
4754
4785
|
|
4755
4786
|
def create_limit_sell_order_ws(self, symbol: str, amount: float, price: float, params={}):
|
4756
|
-
return self.
|
4787
|
+
return self.create_order_ws(symbol, 'limit', 'sell', amount, price, params)
|
4757
4788
|
|
4758
4789
|
def create_market_buy_order(self, symbol: str, amount: float, params={}):
|
4759
4790
|
return self.create_order(symbol, 'market', 'buy', amount, None, params)
|
4760
4791
|
|
4761
4792
|
def create_market_buy_order_ws(self, symbol: str, amount: float, params={}):
|
4762
|
-
return self.
|
4793
|
+
return self.create_order_ws(symbol, 'market', 'buy', amount, None, params)
|
4763
4794
|
|
4764
4795
|
def create_market_sell_order(self, symbol: str, amount: float, params={}):
|
4765
4796
|
return self.create_order(symbol, 'market', 'sell', amount, None, params)
|
4766
4797
|
|
4767
4798
|
def create_market_sell_order_ws(self, symbol: str, amount: float, params={}):
|
4768
|
-
return self.
|
4799
|
+
return self.create_order_ws(symbol, 'market', 'sell', amount, None, params)
|
4769
4800
|
|
4770
4801
|
def cost_to_precision(self, symbol: str, cost):
|
4771
4802
|
market = self.market(symbol)
|
@@ -4797,7 +4828,7 @@ class Exchange(object):
|
|
4797
4828
|
networkItem = self.safe_dict(networks, networkCode, {})
|
4798
4829
|
precision = self.safe_value(networkItem, 'precision', precision)
|
4799
4830
|
if precision is None:
|
4800
|
-
return self.
|
4831
|
+
return self.force_string(fee)
|
4801
4832
|
else:
|
4802
4833
|
return self.decimal_to_precision(fee, ROUND, precision, self.precisionMode, self.paddingMode)
|
4803
4834
|
|
@@ -4887,7 +4918,7 @@ class Exchange(object):
|
|
4887
4918
|
if not self.has['createPostOnlyOrderWs']:
|
4888
4919
|
raise NotSupported(self.id + 'createPostOnlyOrderWs() is not supported yet')
|
4889
4920
|
query = self.extend(params, {'postOnly': True})
|
4890
|
-
return self.
|
4921
|
+
return self.create_order_ws(symbol, type, side, amount, price, query)
|
4891
4922
|
|
4892
4923
|
def create_reduce_only_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
4893
4924
|
if not self.has['createReduceOnlyOrder']:
|
@@ -4899,7 +4930,7 @@ class Exchange(object):
|
|
4899
4930
|
if not self.has['createReduceOnlyOrderWs']:
|
4900
4931
|
raise NotSupported(self.id + 'createReduceOnlyOrderWs() is not supported yet')
|
4901
4932
|
query = self.extend(params, {'reduceOnly': True})
|
4902
|
-
return self.
|
4933
|
+
return self.create_order_ws(symbol, type, side, amount, price, query)
|
4903
4934
|
|
4904
4935
|
def create_stop_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, stopPrice: Num = None, params={}):
|
4905
4936
|
if not self.has['createStopOrder']:
|
@@ -4915,7 +4946,7 @@ class Exchange(object):
|
|
4915
4946
|
if stopPrice is None:
|
4916
4947
|
raise ArgumentsRequired(self.id + ' createStopOrderWs() requires a stopPrice argument')
|
4917
4948
|
query = self.extend(params, {'stopPrice': stopPrice})
|
4918
|
-
return self.
|
4949
|
+
return self.create_order_ws(symbol, type, side, amount, price, query)
|
4919
4950
|
|
4920
4951
|
def create_stop_limit_order(self, symbol: str, side: OrderSide, amount: float, price: float, stopPrice: float, params={}):
|
4921
4952
|
if not self.has['createStopLimitOrder']:
|
@@ -4927,7 +4958,7 @@ class Exchange(object):
|
|
4927
4958
|
if not self.has['createStopLimitOrderWs']:
|
4928
4959
|
raise NotSupported(self.id + ' createStopLimitOrderWs() is not supported yet')
|
4929
4960
|
query = self.extend(params, {'stopPrice': stopPrice})
|
4930
|
-
return self.
|
4961
|
+
return self.create_order_ws(symbol, 'limit', side, amount, price, query)
|
4931
4962
|
|
4932
4963
|
def create_stop_market_order(self, symbol: str, side: OrderSide, amount: float, stopPrice: float, params={}):
|
4933
4964
|
if not self.has['createStopMarketOrder']:
|
@@ -4939,7 +4970,7 @@ class Exchange(object):
|
|
4939
4970
|
if not self.has['createStopMarketOrderWs']:
|
4940
4971
|
raise NotSupported(self.id + ' createStopMarketOrderWs() is not supported yet')
|
4941
4972
|
query = self.extend(params, {'stopPrice': stopPrice})
|
4942
|
-
return self.
|
4973
|
+
return self.create_order_ws(symbol, 'market', side, amount, None, query)
|
4943
4974
|
|
4944
4975
|
def safe_currency_code(self, currencyId: Str, currency: Currency = None):
|
4945
4976
|
currency = self.safe_currency(currencyId, currency)
|
@@ -4978,14 +5009,14 @@ class Exchange(object):
|
|
4978
5009
|
results = []
|
4979
5010
|
if isinstance(pricesData, list):
|
4980
5011
|
for i in range(0, len(pricesData)):
|
4981
|
-
priceData = self.extend(self.
|
5012
|
+
priceData = self.extend(self.parse_last_price(pricesData[i]), params)
|
4982
5013
|
results.append(priceData)
|
4983
5014
|
else:
|
4984
5015
|
marketIds = list(pricesData.keys())
|
4985
5016
|
for i in range(0, len(marketIds)):
|
4986
5017
|
marketId = marketIds[i]
|
4987
5018
|
market = self.safe_market(marketId)
|
4988
|
-
priceData = self.extend(self.
|
5019
|
+
priceData = self.extend(self.parse_last_price(pricesData[marketId], market), params)
|
4989
5020
|
results.append(priceData)
|
4990
5021
|
symbols = self.market_symbols(symbols)
|
4991
5022
|
return self.filter_by_array(results, 'symbol', symbols)
|
@@ -5050,7 +5081,7 @@ class Exchange(object):
|
|
5050
5081
|
result = {}
|
5051
5082
|
for i in range(0, len(info)):
|
5052
5083
|
item = info[i]
|
5053
|
-
borrowRate = self.
|
5084
|
+
borrowRate = self.parse_isolated_borrow_rate(item)
|
5054
5085
|
symbol = self.safe_string(borrowRate, 'symbol')
|
5055
5086
|
result[symbol] = borrowRate
|
5056
5087
|
return result
|
@@ -5086,7 +5117,7 @@ class Exchange(object):
|
|
5086
5117
|
|
5087
5118
|
def is_trigger_order(self, params):
|
5088
5119
|
# for backwards compatibility
|
5089
|
-
return self.
|
5120
|
+
return self.handle_trigger_and_params(params)
|
5090
5121
|
|
5091
5122
|
def is_post_only(self, isMarketOrder: bool, exchangeSpecificParam, params={}):
|
5092
5123
|
"""
|
@@ -5177,7 +5208,7 @@ class Exchange(object):
|
|
5177
5208
|
symbol = market['symbol']
|
5178
5209
|
if not market['contract']:
|
5179
5210
|
raise BadSymbol(self.id + ' fetchFundingRate() supports contract markets only')
|
5180
|
-
rates = self.
|
5211
|
+
rates = self.fetch_funding_rates([symbol], params)
|
5181
5212
|
rate = self.safe_value(rates, symbol)
|
5182
5213
|
if rate is None:
|
5183
5214
|
raise NullResponse(self.id + ' fetchFundingRate() returned no data for ' + symbol)
|
@@ -5320,7 +5351,7 @@ class Exchange(object):
|
|
5320
5351
|
currency = self.safe_currency(currencyId)
|
5321
5352
|
code = self.safe_string(currency, 'code')
|
5322
5353
|
if (codes is None) or (self.in_array(code, codes)):
|
5323
|
-
depositWithdrawFees[code] = self.
|
5354
|
+
depositWithdrawFees[code] = self.parse_deposit_withdraw_fee(dictionary, currency)
|
5324
5355
|
return depositWithdrawFees
|
5325
5356
|
|
5326
5357
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
@@ -5407,7 +5438,7 @@ class Exchange(object):
|
|
5407
5438
|
:returns dict: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
5408
5439
|
"""
|
5409
5440
|
if self.has['fetchDepositsWithdrawals']:
|
5410
|
-
return self.
|
5441
|
+
return self.fetch_deposits_withdrawals(code, since, limit, params)
|
5411
5442
|
else:
|
5412
5443
|
raise NotSupported(self.id + ' fetchTransactions() is not supported yet')
|
5413
5444
|
|
@@ -5570,7 +5601,7 @@ class Exchange(object):
|
|
5570
5601
|
try:
|
5571
5602
|
if cursorValue is not None:
|
5572
5603
|
if cursorIncrement is not None:
|
5573
|
-
cursorValue = self.
|
5604
|
+
cursorValue = self.parse_to_int(cursorValue) + cursorIncrement
|
5574
5605
|
params[cursorSent] = cursorValue
|
5575
5606
|
response = None
|
5576
5607
|
if method == 'fetchAccounts':
|
@@ -5601,7 +5632,7 @@ class Exchange(object):
|
|
5601
5632
|
if errors > maxRetries:
|
5602
5633
|
raise e
|
5603
5634
|
i += 1
|
5604
|
-
sorted = self.
|
5635
|
+
sorted = self.sort_cursor_paginated_result(result)
|
5605
5636
|
key = 0 if (method == 'fetchOHLCV') else 'timestamp'
|
5606
5637
|
return self.filter_by_since_limit(sorted, since, limit, key)
|
5607
5638
|
|
@@ -5632,7 +5663,7 @@ class Exchange(object):
|
|
5632
5663
|
if errors > maxRetries:
|
5633
5664
|
raise e
|
5634
5665
|
i += 1
|
5635
|
-
sorted = self.
|
5666
|
+
sorted = self.sort_cursor_paginated_result(result)
|
5636
5667
|
key = 0 if (method == 'fetchOHLCV') else 'timestamp'
|
5637
5668
|
return self.filter_by_since_limit(sorted, since, limit, key)
|
5638
5669
|
|
@@ -5667,7 +5698,7 @@ class Exchange(object):
|
|
5667
5698
|
def handle_until_option(self, key: str, request, params, multiplier=1):
|
5668
5699
|
until = self.safe_integer_2(params, 'until', 'till')
|
5669
5700
|
if until is not None:
|
5670
|
-
request[key] = self.
|
5701
|
+
request[key] = self.parse_to_int(until * multiplier)
|
5671
5702
|
params = self.omit(params, ['until', 'till'])
|
5672
5703
|
return [request, params]
|
5673
5704
|
|
@@ -5699,7 +5730,7 @@ class Exchange(object):
|
|
5699
5730
|
result = []
|
5700
5731
|
for i in range(0, len(liquidations)):
|
5701
5732
|
entry = liquidations[i]
|
5702
|
-
parsed = self.
|
5733
|
+
parsed = self.parse_liquidation(entry, market)
|
5703
5734
|
result.append(parsed)
|
5704
5735
|
sorted = self.sort_by(result, 'timestamp')
|
5705
5736
|
symbol = self.safe_string(market, 'symbol')
|
@@ -5719,7 +5750,7 @@ class Exchange(object):
|
|
5719
5750
|
currency = self.safe_currency(currencyId)
|
5720
5751
|
marketId = self.safe_string(info, symbolKey)
|
5721
5752
|
market = self.safe_market(marketId, None, None, 'option')
|
5722
|
-
optionStructures[market['symbol']] = self.
|
5753
|
+
optionStructures[market['symbol']] = self.parse_option(info, currency, market)
|
5723
5754
|
return optionStructures
|
5724
5755
|
|
5725
5756
|
def parse_margin_modes(self, response: List[object], symbols: List[str] = None, symbolKey: Str = None, marketType: MarketType = None):
|
@@ -5765,7 +5796,7 @@ class Exchange(object):
|
|
5765
5796
|
fromCurrency = self.safe_currency(fromId)
|
5766
5797
|
if toId is not None:
|
5767
5798
|
toCurrency = self.safe_currency(toId)
|
5768
|
-
conversion = self.extend(self.
|
5799
|
+
conversion = self.extend(self.parse_conversion(entry, fromCurrency, toCurrency), params)
|
5769
5800
|
result.append(conversion)
|
5770
5801
|
sorted = self.sort_by(result, 'timestamp')
|
5771
5802
|
currency = None
|