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/async_support/kraken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.kraken import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, 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
|
@@ -512,7 +512,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
512
512
|
self.options['marketsByAltname'] = self.index_by(result, 'altname')
|
513
513
|
return result
|
514
514
|
|
515
|
-
def safe_currency(self, currencyId, currency=None):
|
515
|
+
def safe_currency(self, currencyId, currency: Currency = None):
|
516
516
|
if currencyId is not None:
|
517
517
|
if len(currencyId) > 3:
|
518
518
|
if (currencyId.find('X') == 0) or (currencyId.find('Z') == 0):
|
@@ -719,7 +719,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
719
719
|
orderbook = self.safe_value(result, wsName, orderbook)
|
720
720
|
return self.parse_order_book(orderbook, symbol)
|
721
721
|
|
722
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
722
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
723
723
|
#
|
724
724
|
# {
|
725
725
|
# "a":["2432.77000","1","1.000"],
|
@@ -820,7 +820,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
820
820
|
ticker = response['result'][market['id']]
|
821
821
|
return self.parse_ticker(ticker, market)
|
822
822
|
|
823
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
823
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
824
824
|
#
|
825
825
|
# [
|
826
826
|
# 1591475640,
|
@@ -898,7 +898,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
898
898
|
}
|
899
899
|
return self.safe_string(types, type, type)
|
900
900
|
|
901
|
-
def parse_ledger_entry(self, item, currency=None):
|
901
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
902
902
|
#
|
903
903
|
# {
|
904
904
|
# 'LTFK7F-N2CUX-PNY4SX': {
|
@@ -949,7 +949,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
949
949
|
},
|
950
950
|
}
|
951
951
|
|
952
|
-
async def fetch_ledger(self, code:
|
952
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
953
953
|
"""
|
954
954
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
955
955
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getLedgers
|
@@ -991,7 +991,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
991
991
|
items.append(value)
|
992
992
|
return self.parse_ledger(items, currency, since, limit)
|
993
993
|
|
994
|
-
async def fetch_ledger_entries_by_ids(self, ids, code:
|
994
|
+
async def fetch_ledger_entries_by_ids(self, ids, code: Str = None, params={}):
|
995
995
|
# https://www.kraken.com/features/api#query-ledgers
|
996
996
|
await self.load_markets()
|
997
997
|
ids = ','.join(ids)
|
@@ -1018,11 +1018,11 @@ class kraken(Exchange, ImplicitAPI):
|
|
1018
1018
|
items.append(value)
|
1019
1019
|
return self.parse_ledger(items)
|
1020
1020
|
|
1021
|
-
async def fetch_ledger_entry(self, id: str, code:
|
1021
|
+
async def fetch_ledger_entry(self, id: str, code: Str = None, params={}):
|
1022
1022
|
items = await self.fetch_ledger_entries_by_ids([id], code, params)
|
1023
1023
|
return items[0]
|
1024
1024
|
|
1025
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
1025
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1026
1026
|
#
|
1027
1027
|
# fetchTrades(public)
|
1028
1028
|
#
|
@@ -1296,7 +1296,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1296
1296
|
}
|
1297
1297
|
return self.safe_string(statuses, status, status)
|
1298
1298
|
|
1299
|
-
def parse_order(self, order, market=None) -> Order:
|
1299
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
1300
1300
|
#
|
1301
1301
|
# createOrder for regular orders
|
1302
1302
|
#
|
@@ -1556,7 +1556,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1556
1556
|
data = self.safe_value(response, 'result', {})
|
1557
1557
|
return self.parse_order(data, market)
|
1558
1558
|
|
1559
|
-
async def fetch_order(self, id: str, symbol:
|
1559
|
+
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1560
1560
|
"""
|
1561
1561
|
fetches information on an order made by the user
|
1562
1562
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getOrdersInfo
|
@@ -1620,7 +1620,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1620
1620
|
raise OrderNotFound(self.id + ' fetchOrder() could not find order id ' + id)
|
1621
1621
|
return self.parse_order(self.extend({'id': id}, result[id]))
|
1622
1622
|
|
1623
|
-
async def fetch_order_trades(self, id: str, symbol:
|
1623
|
+
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1624
1624
|
"""
|
1625
1625
|
fetch all the trades made from a single order
|
1626
1626
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradesInfo
|
@@ -1691,7 +1691,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1691
1691
|
result = self.array_concat(result, tradesFilteredBySymbol)
|
1692
1692
|
return result
|
1693
1693
|
|
1694
|
-
async def fetch_orders_by_ids(self, ids, symbol:
|
1694
|
+
async def fetch_orders_by_ids(self, ids, symbol: Str = None, params={}):
|
1695
1695
|
await self.load_markets()
|
1696
1696
|
response = await self.privatePostQueryOrders(self.extend({
|
1697
1697
|
'trades': True, # whether or not to include trades in output(optional, default False)
|
@@ -1707,7 +1707,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1707
1707
|
orders.append(order)
|
1708
1708
|
return orders
|
1709
1709
|
|
1710
|
-
async def fetch_my_trades(self, symbol:
|
1710
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1711
1711
|
"""
|
1712
1712
|
fetch all trades made by the user
|
1713
1713
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeHistory
|
@@ -1762,7 +1762,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1762
1762
|
market = self.market(symbol)
|
1763
1763
|
return self.parse_trades(trades, market, since, limit)
|
1764
1764
|
|
1765
|
-
async def cancel_order(self, id: str, symbol:
|
1765
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1766
1766
|
"""
|
1767
1767
|
cancels an open order
|
1768
1768
|
:see: https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
|
@@ -1787,7 +1787,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1787
1787
|
raise e
|
1788
1788
|
return response
|
1789
1789
|
|
1790
|
-
async def cancel_orders(self, ids, symbol:
|
1790
|
+
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1791
1791
|
"""
|
1792
1792
|
cancel multiple orders
|
1793
1793
|
:see: https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
|
@@ -1810,7 +1810,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1810
1810
|
#
|
1811
1811
|
return response
|
1812
1812
|
|
1813
|
-
async def cancel_all_orders(self, symbol:
|
1813
|
+
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
1814
1814
|
"""
|
1815
1815
|
cancel all open orders
|
1816
1816
|
:see: https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
|
@@ -1821,7 +1821,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1821
1821
|
await self.load_markets()
|
1822
1822
|
return await self.privatePostCancelAll(params)
|
1823
1823
|
|
1824
|
-
async def fetch_open_orders(self, symbol:
|
1824
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1825
1825
|
"""
|
1826
1826
|
fetch all unfilled currently open orders
|
1827
1827
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getOpenOrders
|
@@ -1848,7 +1848,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1848
1848
|
orders = self.safe_value(result, 'open', [])
|
1849
1849
|
return self.parse_orders(orders, market, since, limit)
|
1850
1850
|
|
1851
|
-
async def fetch_closed_orders(self, symbol:
|
1851
|
+
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1852
1852
|
"""
|
1853
1853
|
fetches information on multiple closed orders made by the user
|
1854
1854
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getClosedOrders
|
@@ -1928,7 +1928,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
1928
1928
|
}
|
1929
1929
|
return self.safe_string(statuses, status, status)
|
1930
1930
|
|
1931
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
1931
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1932
1932
|
#
|
1933
1933
|
# fetchDeposits
|
1934
1934
|
#
|
@@ -2032,7 +2032,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2032
2032
|
},
|
2033
2033
|
}
|
2034
2034
|
|
2035
|
-
def parse_transactions_by_type(self, type, transactions, code:
|
2035
|
+
def parse_transactions_by_type(self, type, transactions, code: Str = None, since: Int = None, limit: Int = None):
|
2036
2036
|
result = []
|
2037
2037
|
for i in range(0, len(transactions)):
|
2038
2038
|
transaction = self.parse_transaction(self.extend({
|
@@ -2041,7 +2041,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2041
2041
|
result.append(transaction)
|
2042
2042
|
return self.filter_by_currency_since_limit(result, code, since, limit)
|
2043
2043
|
|
2044
|
-
async def fetch_deposits(self, code:
|
2044
|
+
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2045
2045
|
"""
|
2046
2046
|
fetch all deposits made to an account
|
2047
2047
|
:see: https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentDeposits
|
@@ -2098,7 +2098,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2098
2098
|
result = self.safe_value(response, 'result', {})
|
2099
2099
|
return self.safe_timestamp(result, 'unixtime')
|
2100
2100
|
|
2101
|
-
async def fetch_withdrawals(self, code:
|
2101
|
+
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
2102
2102
|
"""
|
2103
2103
|
fetch all withdrawals made from an account
|
2104
2104
|
:see: https://docs.kraken.com/rest/#tag/Funding/operation/getStatusRecentWithdrawals
|
@@ -2230,7 +2230,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2230
2230
|
raise InvalidAddress(self.id + ' privatePostDepositAddresses() returned no addresses for ' + code)
|
2231
2231
|
return self.parse_deposit_address(firstResult, currency)
|
2232
2232
|
|
2233
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
2233
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
2234
2234
|
#
|
2235
2235
|
# {
|
2236
2236
|
# "address":"0x77b5051f97efa9cc52c9ad5b023a53fc15c200d3",
|
@@ -2407,7 +2407,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
2407
2407
|
'toAccount': toAccount,
|
2408
2408
|
})
|
2409
2409
|
|
2410
|
-
def parse_transfer(self, transfer, currency=None):
|
2410
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
2411
2411
|
#
|
2412
2412
|
# transfer
|
2413
2413
|
#
|
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.krakenfutures import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType,
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -506,7 +506,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
506
506
|
tickers = self.safe_value(response, 'tickers')
|
507
507
|
return self.parse_tickers(tickers, symbols)
|
508
508
|
|
509
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
509
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
510
510
|
#
|
511
511
|
# {
|
512
512
|
# "tag": 'semiannual', # 'month', 'quarter', "perpetual", "semiannual",
|
@@ -633,7 +633,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
633
633
|
candles = self.safe_value(response, 'candles')
|
634
634
|
return self.parse_ohlcvs(candles, market, timeframe, since, limit)
|
635
635
|
|
636
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
636
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
637
637
|
#
|
638
638
|
# {
|
639
639
|
# "time": 1645198500000,
|
@@ -699,7 +699,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
699
699
|
history = self.safe_value(response, 'history')
|
700
700
|
return self.parse_trades(history, market, since, limit)
|
701
701
|
|
702
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
702
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
703
703
|
#
|
704
704
|
# fetchTrades(public)
|
705
705
|
#
|
@@ -973,7 +973,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
973
973
|
order['info'] = response
|
974
974
|
return order
|
975
975
|
|
976
|
-
async def cancel_order(self, id: str, symbol:
|
976
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
977
977
|
"""
|
978
978
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-cancel-order
|
979
979
|
Cancel an open order on the exchange
|
@@ -991,7 +991,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
991
991
|
order = self.parse_order(response['cancelStatus'])
|
992
992
|
return self.extend({'info': response}, order)
|
993
993
|
|
994
|
-
async def cancel_orders(self, ids: List[str], symbol:
|
994
|
+
async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
995
995
|
"""
|
996
996
|
cancel multiple orders
|
997
997
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-batch-order-management
|
@@ -1049,7 +1049,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1049
1049
|
batchStatus = self.safe_value(response, 'batchStatus', [])
|
1050
1050
|
return self.parse_orders(batchStatus)
|
1051
1051
|
|
1052
|
-
async def cancel_all_orders(self, symbol:
|
1052
|
+
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
1053
1053
|
"""
|
1054
1054
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-cancel-all-orders
|
1055
1055
|
Cancels all orders on the exchange, including trigger orders
|
@@ -1063,7 +1063,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1063
1063
|
response = await self.privatePostCancelallorders(self.extend(request, params))
|
1064
1064
|
return response
|
1065
1065
|
|
1066
|
-
async def fetch_open_orders(self, symbol:
|
1066
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
1067
1067
|
"""
|
1068
1068
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-get-open-orders
|
1069
1069
|
Gets all open orders, including trigger orders, for an account from the exchange api
|
@@ -1147,7 +1147,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1147
1147
|
}
|
1148
1148
|
return self.safe_string(statuses, status, status)
|
1149
1149
|
|
1150
|
-
def parse_order(self, order, market=None) -> Order:
|
1150
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
1151
1151
|
#
|
1152
1152
|
# LIMIT
|
1153
1153
|
#
|
@@ -1444,7 +1444,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1444
1444
|
'trades': trades,
|
1445
1445
|
})
|
1446
1446
|
|
1447
|
-
async def fetch_my_trades(self, symbol:
|
1447
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1448
1448
|
"""
|
1449
1449
|
fetch all trades made by the user
|
1450
1450
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-historical-data-get-your-fills
|
@@ -1718,7 +1718,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1718
1718
|
fundingRates.append(parsed)
|
1719
1719
|
return self.index_by(fundingRates, 'symbol')
|
1720
1720
|
|
1721
|
-
def parse_funding_rate(self, ticker, market=None):
|
1721
|
+
def parse_funding_rate(self, ticker, market: Market = None):
|
1722
1722
|
#
|
1723
1723
|
# {"ask": 26.283,
|
1724
1724
|
# "askSize": 4.6,
|
@@ -1774,7 +1774,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1774
1774
|
'previousFundingDatetime': None,
|
1775
1775
|
}
|
1776
1776
|
|
1777
|
-
async def fetch_funding_rate_history(self, symbol:
|
1777
|
+
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
1778
1778
|
"""
|
1779
1779
|
fetches historical funding rate prices
|
1780
1780
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-historical-funding-rates-historical-funding-rates
|
@@ -1858,7 +1858,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1858
1858
|
result.append(position)
|
1859
1859
|
return result
|
1860
1860
|
|
1861
|
-
def parse_position(self, position, market=None):
|
1861
|
+
def parse_position(self, position, market: Market = None):
|
1862
1862
|
# cross
|
1863
1863
|
# {
|
1864
1864
|
# "side": "long",
|
@@ -1969,7 +1969,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1969
1969
|
data = self.safe_value(response, 'instruments')
|
1970
1970
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
1971
1971
|
|
1972
|
-
def parse_market_leverage_tiers(self, info, market=None):
|
1972
|
+
def parse_market_leverage_tiers(self, info, market: Market = None):
|
1973
1973
|
"""
|
1974
1974
|
* @ignore
|
1975
1975
|
* @param info Exchange market response for 1 market
|
@@ -2031,7 +2031,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2031
2031
|
})
|
2032
2032
|
return tiers
|
2033
2033
|
|
2034
|
-
def parse_transfer(self, transfer, currency=None):
|
2034
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
2035
2035
|
#
|
2036
2036
|
# transfer
|
2037
2037
|
#
|
@@ -2130,7 +2130,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2130
2130
|
'toAccount': toAccount,
|
2131
2131
|
})
|
2132
2132
|
|
2133
|
-
async def set_leverage(self, leverage, symbol:
|
2133
|
+
async def set_leverage(self, leverage, symbol: Str = None, params={}):
|
2134
2134
|
"""
|
2135
2135
|
set the level of leverage for a market
|
2136
2136
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-set-the-leverage-setting-for-a-market
|
@@ -2150,7 +2150,7 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
2150
2150
|
#
|
2151
2151
|
return await self.privatePutLeveragepreferences(self.extend(request, params))
|
2152
2152
|
|
2153
|
-
async def fetch_leverage(self, symbol:
|
2153
|
+
async def fetch_leverage(self, symbol: Str = None, params={}):
|
2154
2154
|
"""
|
2155
2155
|
fetch the set leverage for a market
|
2156
2156
|
:see: https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-get-the-leverage-setting-for-a-market
|
ccxt/async_support/kucoin.py
CHANGED
@@ -9,7 +9,7 @@ import asyncio
|
|
9
9
|
import hashlib
|
10
10
|
import math
|
11
11
|
import json
|
12
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType,
|
12
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
13
13
|
from typing import List
|
14
14
|
from ccxt.base.errors import ExchangeError
|
15
15
|
from ccxt.base.errors import PermissionDenied
|
@@ -1289,7 +1289,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1289
1289
|
data = self.safe_value(response, 'data')
|
1290
1290
|
return self.parse_deposit_withdraw_fee(data, currency)
|
1291
1291
|
|
1292
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
1292
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
1293
1293
|
#
|
1294
1294
|
# {
|
1295
1295
|
# "currency": "USDT",
|
@@ -1350,7 +1350,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1350
1350
|
params = self.omit(params, 'type')
|
1351
1351
|
return(type == 'contract') or (type == 'future') or (type == 'futures') # * (type == 'futures') deprecated, use(type == 'future')
|
1352
1352
|
|
1353
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
1353
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1354
1354
|
#
|
1355
1355
|
# {
|
1356
1356
|
# "symbol": "BTC-USDT", # symbol
|
@@ -1530,7 +1530,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1530
1530
|
#
|
1531
1531
|
return self.parse_ticker(response['data'], market)
|
1532
1532
|
|
1533
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
1533
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1534
1534
|
#
|
1535
1535
|
# [
|
1536
1536
|
# "1545904980", # Start time of the candle cycle
|
@@ -1660,7 +1660,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1660
1660
|
raise ExchangeError(self.id + ' fetchDepositAddress() returned an empty response, you might try to run createDepositAddress() first and try again')
|
1661
1661
|
return self.parse_deposit_address(data, currency)
|
1662
1662
|
|
1663
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
1663
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
1664
1664
|
address = self.safe_string(depositAddress, 'address')
|
1665
1665
|
# BCH/BSV is returned with a "bitcoincash:" prefix, which we cut off here and only keep the address
|
1666
1666
|
if address is not None:
|
@@ -2044,7 +2044,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2044
2044
|
data = self.safe_value(response, 'data', {})
|
2045
2045
|
return self.parse_order(data, market)
|
2046
2046
|
|
2047
|
-
async def cancel_order(self, id: str, symbol:
|
2047
|
+
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2048
2048
|
"""
|
2049
2049
|
cancels an open order
|
2050
2050
|
:see: https://docs.kucoin.com/spot#cancel-an-order
|
@@ -2088,7 +2088,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2088
2088
|
params = self.omit(params, ['clientOid', 'clientOrderId', 'stop', 'hf'])
|
2089
2089
|
return await getattr(self, method)(self.extend(request, params))
|
2090
2090
|
|
2091
|
-
async def cancel_all_orders(self, symbol:
|
2091
|
+
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
2092
2092
|
"""
|
2093
2093
|
cancel all open orders
|
2094
2094
|
:see: https://docs.kucoin.com/spot#cancel-all-orders
|
@@ -2124,7 +2124,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2124
2124
|
method = 'privateDeleteHfOrders'
|
2125
2125
|
return await getattr(self, method)(self.extend(request, query))
|
2126
2126
|
|
2127
|
-
async def fetch_orders_by_status(self, status, symbol:
|
2127
|
+
async def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2128
2128
|
"""
|
2129
2129
|
fetch a list of orders
|
2130
2130
|
:see: https://docs.kucoin.com/spot#list-orders
|
@@ -2228,7 +2228,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2228
2228
|
orders = self.safe_value(responseData, 'items', [])
|
2229
2229
|
return self.parse_orders(orders, market, since, limit)
|
2230
2230
|
|
2231
|
-
async def fetch_closed_orders(self, symbol:
|
2231
|
+
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2232
2232
|
"""
|
2233
2233
|
fetches information on multiple closed orders made by the user
|
2234
2234
|
:see: https://docs.kucoin.com/spot#list-orders
|
@@ -2255,7 +2255,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2255
2255
|
return await self.fetch_paginated_call_dynamic('fetchClosedOrders', symbol, since, limit, params)
|
2256
2256
|
return await self.fetch_orders_by_status('done', symbol, since, limit, params)
|
2257
2257
|
|
2258
|
-
async def fetch_open_orders(self, symbol:
|
2258
|
+
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2259
2259
|
"""
|
2260
2260
|
fetch all unfilled currently open orders
|
2261
2261
|
:see: https://docs.kucoin.com/spot#list-orders
|
@@ -2285,7 +2285,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2285
2285
|
return await self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
|
2286
2286
|
return await self.fetch_orders_by_status('active', symbol, since, limit, params)
|
2287
2287
|
|
2288
|
-
async def fetch_order(self, id: str, symbol:
|
2288
|
+
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2289
2289
|
"""
|
2290
2290
|
fetch an order
|
2291
2291
|
:see: https://docs.kucoin.com/spot#get-an-order
|
@@ -2344,7 +2344,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2344
2344
|
responseData = self.safe_value(responseData, 0)
|
2345
2345
|
return self.parse_order(responseData, market)
|
2346
2346
|
|
2347
|
-
def parse_order(self, order, market=None) -> Order:
|
2347
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
2348
2348
|
#
|
2349
2349
|
# createOrder
|
2350
2350
|
#
|
@@ -2519,7 +2519,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2519
2519
|
'trades': None,
|
2520
2520
|
}, market)
|
2521
2521
|
|
2522
|
-
async def fetch_order_trades(self, id: str, symbol:
|
2522
|
+
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2523
2523
|
"""
|
2524
2524
|
fetch all the trades made from a single order
|
2525
2525
|
:see: https://docs.kucoin.com/#list-fills
|
@@ -2536,7 +2536,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2536
2536
|
}
|
2537
2537
|
return await self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
2538
2538
|
|
2539
|
-
async def fetch_my_trades(self, symbol:
|
2539
|
+
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2540
2540
|
"""
|
2541
2541
|
:see: https://docs.kucoin.com/#list-fills
|
2542
2542
|
:see: https://docs.kucoin.com/spot-hf/#transaction-details
|
@@ -2677,7 +2677,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2677
2677
|
trades = self.safe_value(response, 'data', [])
|
2678
2678
|
return self.parse_trades(trades, market, since, limit)
|
2679
2679
|
|
2680
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
2680
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
2681
2681
|
#
|
2682
2682
|
# fetchTrades(public)
|
2683
2683
|
#
|
@@ -2897,7 +2897,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2897
2897
|
}
|
2898
2898
|
return self.safe_string(statuses, status, status)
|
2899
2899
|
|
2900
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
2900
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2901
2901
|
#
|
2902
2902
|
# fetchDeposits
|
2903
2903
|
#
|
@@ -3001,7 +3001,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3001
3001
|
'updated': updated,
|
3002
3002
|
}
|
3003
3003
|
|
3004
|
-
async def fetch_deposits(self, code:
|
3004
|
+
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3005
3005
|
"""
|
3006
3006
|
:see: https://docs.kucoin.com/#get-deposit-list
|
3007
3007
|
:see: https://docs.kucoin.com/#get-v1-historical-deposits-list
|
@@ -3079,7 +3079,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3079
3079
|
responseData = response['data']['items']
|
3080
3080
|
return self.parse_transactions(responseData, currency, since, limit, {'type': 'deposit'})
|
3081
3081
|
|
3082
|
-
async def fetch_withdrawals(self, code:
|
3082
|
+
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3083
3083
|
"""
|
3084
3084
|
fetch all withdrawals made from an account
|
3085
3085
|
:see: https://docs.kucoin.com/#get-withdrawals-list
|
@@ -3382,7 +3382,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3382
3382
|
data = self.safe_value(response, 'data')
|
3383
3383
|
return self.parse_transfer(data, currency)
|
3384
3384
|
|
3385
|
-
def parse_transfer(self, transfer, currency=None):
|
3385
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
3386
3386
|
#
|
3387
3387
|
# transfer(spot)
|
3388
3388
|
#
|
@@ -3487,7 +3487,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3487
3487
|
}
|
3488
3488
|
return self.safe_string(types, type, type)
|
3489
3489
|
|
3490
|
-
def parse_ledger_entry(self, item, currency=None):
|
3490
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
3491
3491
|
#
|
3492
3492
|
# {
|
3493
3493
|
# "id": "611a1e7c6a053300067a88d9", #unique key for each ledger entry
|
@@ -3565,7 +3565,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3565
3565
|
'info': item,
|
3566
3566
|
}
|
3567
3567
|
|
3568
|
-
async def fetch_ledger(self, code:
|
3568
|
+
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3569
3569
|
"""
|
3570
3570
|
:see: https://docs.kucoin.com/#get-account-ledgers
|
3571
3571
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
@@ -3664,7 +3664,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3664
3664
|
sorted = self.sort_by(result, 'timestamp')
|
3665
3665
|
return self.filter_by_currency_since_limit(sorted, code, since, limit)
|
3666
3666
|
|
3667
|
-
def parse_borrow_rate(self, info, currency=None):
|
3667
|
+
def parse_borrow_rate(self, info, currency: Currency = None):
|
3668
3668
|
#
|
3669
3669
|
# {
|
3670
3670
|
# "tradeId": "62db2dcaff219600012b56cd",
|
@@ -3687,7 +3687,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3687
3687
|
'info': info,
|
3688
3688
|
}
|
3689
3689
|
|
3690
|
-
async def fetch_borrow_interest(self, code:
|
3690
|
+
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3691
3691
|
"""
|
3692
3692
|
fetch the interest owed by the user for borrowing currency for margin trading
|
3693
3693
|
:see: https://docs.kucoin.com/#get-repay-record
|
@@ -3783,7 +3783,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3783
3783
|
assets = self.safe_value(data, 'assets', []) if (marginMode == 'isolated') else self.safe_value(data, 'items', [])
|
3784
3784
|
return self.parse_borrow_interests(assets, None)
|
3785
3785
|
|
3786
|
-
def parse_borrow_interest(self, info, market=None):
|
3786
|
+
def parse_borrow_interest(self, info, market: Market = None):
|
3787
3787
|
#
|
3788
3788
|
# Cross
|
3789
3789
|
#
|
@@ -3855,7 +3855,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3855
3855
|
'info': info,
|
3856
3856
|
}
|
3857
3857
|
|
3858
|
-
async def borrow_margin(self, code: str, amount, symbol:
|
3858
|
+
async def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
|
3859
3859
|
"""
|
3860
3860
|
create a loan to borrow margin
|
3861
3861
|
:see: https://docs.kucoin.com/#1-margin-borrowing
|
@@ -3902,7 +3902,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3902
3902
|
data = self.safe_value(response, 'data', {})
|
3903
3903
|
return self.parse_margin_loan(data, currency)
|
3904
3904
|
|
3905
|
-
async def repay_margin(self, code: str, amount, symbol:
|
3905
|
+
async def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
|
3906
3906
|
"""
|
3907
3907
|
repay borrowed margin and interest
|
3908
3908
|
:see: https://docs.kucoin.com/#2-repayment
|
@@ -3945,7 +3945,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3945
3945
|
data = self.safe_value(response, 'data', {})
|
3946
3946
|
return self.parse_margin_loan(data, currency)
|
3947
3947
|
|
3948
|
-
def parse_margin_loan(self, info, currency=None):
|
3948
|
+
def parse_margin_loan(self, info, currency: Currency = None):
|
3949
3949
|
#
|
3950
3950
|
# {
|
3951
3951
|
# "orderNo": "5da6dba0f943c0c81f5d5db5",
|