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/kraken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.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
|
-
def fetch_ledger(self, code:
|
952
|
+
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
|
-
def fetch_ledger_entries_by_ids(self, ids, code:
|
994
|
+
def fetch_ledger_entries_by_ids(self, ids, code: Str = None, params={}):
|
995
995
|
# https://www.kraken.com/features/api#query-ledgers
|
996
996
|
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
|
-
def fetch_ledger_entry(self, id: str, code:
|
1021
|
+
def fetch_ledger_entry(self, id: str, code: Str = None, params={}):
|
1022
1022
|
items = 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
|
-
def fetch_order(self, id: str, symbol:
|
1559
|
+
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
|
-
def fetch_order_trades(self, id: str, symbol:
|
1623
|
+
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
|
-
def fetch_orders_by_ids(self, ids, symbol:
|
1694
|
+
def fetch_orders_by_ids(self, ids, symbol: Str = None, params={}):
|
1695
1695
|
self.load_markets()
|
1696
1696
|
response = 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
|
-
def fetch_my_trades(self, symbol:
|
1710
|
+
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
|
-
def cancel_order(self, id: str, symbol:
|
1765
|
+
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
|
-
def cancel_orders(self, ids, symbol:
|
1790
|
+
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
|
-
def cancel_all_orders(self, symbol:
|
1813
|
+
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
|
self.load_markets()
|
1822
1822
|
return self.privatePostCancelAll(params)
|
1823
1823
|
|
1824
|
-
def fetch_open_orders(self, symbol:
|
1824
|
+
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
|
-
def fetch_closed_orders(self, symbol:
|
1851
|
+
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
|
-
def fetch_deposits(self, code:
|
2044
|
+
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
|
-
def fetch_withdrawals(self, code:
|
2101
|
+
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
|
#
|
ccxt/krakenfutures.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.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
|
-
def cancel_order(self, id: str, symbol:
|
976
|
+
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
|
-
def cancel_orders(self, ids: List[str], symbol:
|
994
|
+
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
|
-
def cancel_all_orders(self, symbol:
|
1052
|
+
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 = self.privatePostCancelallorders(self.extend(request, params))
|
1064
1064
|
return response
|
1065
1065
|
|
1066
|
-
def fetch_open_orders(self, symbol:
|
1066
|
+
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
|
-
def fetch_my_trades(self, symbol:
|
1447
|
+
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
|
-
def fetch_funding_rate_history(self, symbol:
|
1777
|
+
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
|
-
def set_leverage(self, leverage, symbol:
|
2133
|
+
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 self.privatePutLeveragepreferences(self.extend(request, params))
|
2152
2152
|
|
2153
|
-
def fetch_leverage(self, symbol:
|
2153
|
+
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/kucoin.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.kucoin import ImplicitAPI
|
|
8
8
|
import hashlib
|
9
9
|
import math
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType,
|
11
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import PermissionDenied
|
@@ -1288,7 +1288,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1288
1288
|
data = self.safe_value(response, 'data')
|
1289
1289
|
return self.parse_deposit_withdraw_fee(data, currency)
|
1290
1290
|
|
1291
|
-
def parse_deposit_withdraw_fee(self, fee, currency=None):
|
1291
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
1292
1292
|
#
|
1293
1293
|
# {
|
1294
1294
|
# "currency": "USDT",
|
@@ -1349,7 +1349,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1349
1349
|
params = self.omit(params, 'type')
|
1350
1350
|
return(type == 'contract') or (type == 'future') or (type == 'futures') # * (type == 'futures') deprecated, use(type == 'future')
|
1351
1351
|
|
1352
|
-
def parse_ticker(self, ticker, market=None) -> Ticker:
|
1352
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
1353
1353
|
#
|
1354
1354
|
# {
|
1355
1355
|
# "symbol": "BTC-USDT", # symbol
|
@@ -1529,7 +1529,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1529
1529
|
#
|
1530
1530
|
return self.parse_ticker(response['data'], market)
|
1531
1531
|
|
1532
|
-
def parse_ohlcv(self, ohlcv, market=None) -> list:
|
1532
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
1533
1533
|
#
|
1534
1534
|
# [
|
1535
1535
|
# "1545904980", # Start time of the candle cycle
|
@@ -1659,7 +1659,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1659
1659
|
raise ExchangeError(self.id + ' fetchDepositAddress() returned an empty response, you might try to run createDepositAddress() first and try again')
|
1660
1660
|
return self.parse_deposit_address(data, currency)
|
1661
1661
|
|
1662
|
-
def parse_deposit_address(self, depositAddress, currency=None):
|
1662
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
1663
1663
|
address = self.safe_string(depositAddress, 'address')
|
1664
1664
|
# BCH/BSV is returned with a "bitcoincash:" prefix, which we cut off here and only keep the address
|
1665
1665
|
if address is not None:
|
@@ -2043,7 +2043,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2043
2043
|
data = self.safe_value(response, 'data', {})
|
2044
2044
|
return self.parse_order(data, market)
|
2045
2045
|
|
2046
|
-
def cancel_order(self, id: str, symbol:
|
2046
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2047
2047
|
"""
|
2048
2048
|
cancels an open order
|
2049
2049
|
:see: https://docs.kucoin.com/spot#cancel-an-order
|
@@ -2087,7 +2087,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2087
2087
|
params = self.omit(params, ['clientOid', 'clientOrderId', 'stop', 'hf'])
|
2088
2088
|
return getattr(self, method)(self.extend(request, params))
|
2089
2089
|
|
2090
|
-
def cancel_all_orders(self, symbol:
|
2090
|
+
def cancel_all_orders(self, symbol: Str = None, params={}):
|
2091
2091
|
"""
|
2092
2092
|
cancel all open orders
|
2093
2093
|
:see: https://docs.kucoin.com/spot#cancel-all-orders
|
@@ -2123,7 +2123,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2123
2123
|
method = 'privateDeleteHfOrders'
|
2124
2124
|
return getattr(self, method)(self.extend(request, query))
|
2125
2125
|
|
2126
|
-
def fetch_orders_by_status(self, status, symbol:
|
2126
|
+
def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2127
2127
|
"""
|
2128
2128
|
fetch a list of orders
|
2129
2129
|
:see: https://docs.kucoin.com/spot#list-orders
|
@@ -2227,7 +2227,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2227
2227
|
orders = self.safe_value(responseData, 'items', [])
|
2228
2228
|
return self.parse_orders(orders, market, since, limit)
|
2229
2229
|
|
2230
|
-
def fetch_closed_orders(self, symbol:
|
2230
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2231
2231
|
"""
|
2232
2232
|
fetches information on multiple closed orders made by the user
|
2233
2233
|
:see: https://docs.kucoin.com/spot#list-orders
|
@@ -2254,7 +2254,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2254
2254
|
return self.fetch_paginated_call_dynamic('fetchClosedOrders', symbol, since, limit, params)
|
2255
2255
|
return self.fetch_orders_by_status('done', symbol, since, limit, params)
|
2256
2256
|
|
2257
|
-
def fetch_open_orders(self, symbol:
|
2257
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2258
2258
|
"""
|
2259
2259
|
fetch all unfilled currently open orders
|
2260
2260
|
:see: https://docs.kucoin.com/spot#list-orders
|
@@ -2284,7 +2284,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2284
2284
|
return self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
|
2285
2285
|
return self.fetch_orders_by_status('active', symbol, since, limit, params)
|
2286
2286
|
|
2287
|
-
def fetch_order(self, id: str, symbol:
|
2287
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2288
2288
|
"""
|
2289
2289
|
fetch an order
|
2290
2290
|
:see: https://docs.kucoin.com/spot#get-an-order
|
@@ -2343,7 +2343,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2343
2343
|
responseData = self.safe_value(responseData, 0)
|
2344
2344
|
return self.parse_order(responseData, market)
|
2345
2345
|
|
2346
|
-
def parse_order(self, order, market=None) -> Order:
|
2346
|
+
def parse_order(self, order, market: Market = None) -> Order:
|
2347
2347
|
#
|
2348
2348
|
# createOrder
|
2349
2349
|
#
|
@@ -2518,7 +2518,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2518
2518
|
'trades': None,
|
2519
2519
|
}, market)
|
2520
2520
|
|
2521
|
-
def fetch_order_trades(self, id: str, symbol:
|
2521
|
+
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2522
2522
|
"""
|
2523
2523
|
fetch all the trades made from a single order
|
2524
2524
|
:see: https://docs.kucoin.com/#list-fills
|
@@ -2535,7 +2535,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2535
2535
|
}
|
2536
2536
|
return self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
|
2537
2537
|
|
2538
|
-
def fetch_my_trades(self, symbol:
|
2538
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2539
2539
|
"""
|
2540
2540
|
:see: https://docs.kucoin.com/#list-fills
|
2541
2541
|
:see: https://docs.kucoin.com/spot-hf/#transaction-details
|
@@ -2676,7 +2676,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2676
2676
|
trades = self.safe_value(response, 'data', [])
|
2677
2677
|
return self.parse_trades(trades, market, since, limit)
|
2678
2678
|
|
2679
|
-
def parse_trade(self, trade, market=None) -> Trade:
|
2679
|
+
def parse_trade(self, trade, market: Market = None) -> Trade:
|
2680
2680
|
#
|
2681
2681
|
# fetchTrades(public)
|
2682
2682
|
#
|
@@ -2896,7 +2896,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2896
2896
|
}
|
2897
2897
|
return self.safe_string(statuses, status, status)
|
2898
2898
|
|
2899
|
-
def parse_transaction(self, transaction, currency=None) -> Transaction:
|
2899
|
+
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2900
2900
|
#
|
2901
2901
|
# fetchDeposits
|
2902
2902
|
#
|
@@ -3000,7 +3000,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3000
3000
|
'updated': updated,
|
3001
3001
|
}
|
3002
3002
|
|
3003
|
-
def fetch_deposits(self, code:
|
3003
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3004
3004
|
"""
|
3005
3005
|
:see: https://docs.kucoin.com/#get-deposit-list
|
3006
3006
|
:see: https://docs.kucoin.com/#get-v1-historical-deposits-list
|
@@ -3078,7 +3078,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3078
3078
|
responseData = response['data']['items']
|
3079
3079
|
return self.parse_transactions(responseData, currency, since, limit, {'type': 'deposit'})
|
3080
3080
|
|
3081
|
-
def fetch_withdrawals(self, code:
|
3081
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3082
3082
|
"""
|
3083
3083
|
fetch all withdrawals made from an account
|
3084
3084
|
:see: https://docs.kucoin.com/#get-withdrawals-list
|
@@ -3381,7 +3381,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3381
3381
|
data = self.safe_value(response, 'data')
|
3382
3382
|
return self.parse_transfer(data, currency)
|
3383
3383
|
|
3384
|
-
def parse_transfer(self, transfer, currency=None):
|
3384
|
+
def parse_transfer(self, transfer, currency: Currency = None):
|
3385
3385
|
#
|
3386
3386
|
# transfer(spot)
|
3387
3387
|
#
|
@@ -3486,7 +3486,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3486
3486
|
}
|
3487
3487
|
return self.safe_string(types, type, type)
|
3488
3488
|
|
3489
|
-
def parse_ledger_entry(self, item, currency=None):
|
3489
|
+
def parse_ledger_entry(self, item, currency: Currency = None):
|
3490
3490
|
#
|
3491
3491
|
# {
|
3492
3492
|
# "id": "611a1e7c6a053300067a88d9", #unique key for each ledger entry
|
@@ -3564,7 +3564,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3564
3564
|
'info': item,
|
3565
3565
|
}
|
3566
3566
|
|
3567
|
-
def fetch_ledger(self, code:
|
3567
|
+
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
3568
3568
|
"""
|
3569
3569
|
:see: https://docs.kucoin.com/#get-account-ledgers
|
3570
3570
|
fetch the history of changes, actions done by the user or operations that altered balance of the user
|
@@ -3663,7 +3663,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3663
3663
|
sorted = self.sort_by(result, 'timestamp')
|
3664
3664
|
return self.filter_by_currency_since_limit(sorted, code, since, limit)
|
3665
3665
|
|
3666
|
-
def parse_borrow_rate(self, info, currency=None):
|
3666
|
+
def parse_borrow_rate(self, info, currency: Currency = None):
|
3667
3667
|
#
|
3668
3668
|
# {
|
3669
3669
|
# "tradeId": "62db2dcaff219600012b56cd",
|
@@ -3686,7 +3686,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3686
3686
|
'info': info,
|
3687
3687
|
}
|
3688
3688
|
|
3689
|
-
def fetch_borrow_interest(self, code:
|
3689
|
+
def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3690
3690
|
"""
|
3691
3691
|
fetch the interest owed by the user for borrowing currency for margin trading
|
3692
3692
|
:see: https://docs.kucoin.com/#get-repay-record
|
@@ -3782,7 +3782,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3782
3782
|
assets = self.safe_value(data, 'assets', []) if (marginMode == 'isolated') else self.safe_value(data, 'items', [])
|
3783
3783
|
return self.parse_borrow_interests(assets, None)
|
3784
3784
|
|
3785
|
-
def parse_borrow_interest(self, info, market=None):
|
3785
|
+
def parse_borrow_interest(self, info, market: Market = None):
|
3786
3786
|
#
|
3787
3787
|
# Cross
|
3788
3788
|
#
|
@@ -3854,7 +3854,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3854
3854
|
'info': info,
|
3855
3855
|
}
|
3856
3856
|
|
3857
|
-
def borrow_margin(self, code: str, amount, symbol:
|
3857
|
+
def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
|
3858
3858
|
"""
|
3859
3859
|
create a loan to borrow margin
|
3860
3860
|
:see: https://docs.kucoin.com/#1-margin-borrowing
|
@@ -3901,7 +3901,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3901
3901
|
data = self.safe_value(response, 'data', {})
|
3902
3902
|
return self.parse_margin_loan(data, currency)
|
3903
3903
|
|
3904
|
-
def repay_margin(self, code: str, amount, symbol:
|
3904
|
+
def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
|
3905
3905
|
"""
|
3906
3906
|
repay borrowed margin and interest
|
3907
3907
|
:see: https://docs.kucoin.com/#2-repayment
|
@@ -3944,7 +3944,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3944
3944
|
data = self.safe_value(response, 'data', {})
|
3945
3945
|
return self.parse_margin_loan(data, currency)
|
3946
3946
|
|
3947
|
-
def parse_margin_loan(self, info, currency=None):
|
3947
|
+
def parse_margin_loan(self, info, currency: Currency = None):
|
3948
3948
|
#
|
3949
3949
|
# {
|
3950
3950
|
# "orderNo": "5da6dba0f943c0c81f5d5db5",
|