ccxt 4.4.30__py2.py3-none-any.whl → 4.4.32__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/ace.py +36 -12
- ccxt/alpaca.py +62 -22
- ccxt/ascendex.py +65 -30
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +36 -12
- ccxt/async_support/alpaca.py +62 -22
- ccxt/async_support/ascendex.py +65 -30
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/base/ws/aiohttp_client.py +25 -3
- ccxt/async_support/bigone.py +71 -27
- ccxt/async_support/binance.py +555 -323
- ccxt/async_support/bingx.py +208 -108
- ccxt/async_support/bit2c.py +34 -12
- ccxt/async_support/bitbank.py +42 -14
- ccxt/async_support/bitbns.py +17 -9
- ccxt/async_support/bitfinex.py +68 -24
- ccxt/async_support/bitfinex2.py +116 -44
- ccxt/async_support/bitflyer.py +54 -18
- ccxt/async_support/bitget.py +277 -145
- ccxt/async_support/bithumb.py +39 -14
- ccxt/async_support/bitmart.py +145 -79
- ccxt/async_support/bitmex.py +90 -30
- ccxt/async_support/bitopro.py +66 -22
- ccxt/async_support/bitrue.py +109 -57
- ccxt/async_support/bitso.py +55 -19
- ccxt/async_support/bitstamp.py +84 -36
- ccxt/async_support/bitteam.py +51 -17
- ccxt/async_support/bitvavo.py +57 -22
- ccxt/async_support/bl3p.py +26 -10
- ccxt/async_support/blockchaincom.py +63 -21
- ccxt/async_support/blofin.py +95 -38
- ccxt/async_support/btcalpha.py +48 -16
- ccxt/async_support/btcbox.py +27 -9
- ccxt/async_support/btcmarkets.py +57 -19
- ccxt/async_support/btcturk.py +36 -12
- ccxt/async_support/bybit.py +251 -95
- ccxt/async_support/cex.py +65 -22
- ccxt/async_support/coinbase.py +138 -56
- ccxt/async_support/coinbaseexchange.py +76 -28
- ccxt/async_support/coinbaseinternational.py +75 -27
- ccxt/async_support/coincatch.py +191 -97
- ccxt/async_support/coincheck.py +33 -11
- ccxt/async_support/coinex.py +212 -101
- ccxt/async_support/coinlist.py +87 -30
- ccxt/async_support/coinmate.py +55 -24
- ccxt/async_support/coinmetro.py +52 -18
- ccxt/async_support/coinone.py +27 -10
- ccxt/async_support/coinsph.py +73 -27
- ccxt/async_support/coinspot.py +25 -9
- ccxt/async_support/cryptocom.py +103 -38
- ccxt/async_support/currencycom.py +70 -23
- ccxt/async_support/delta.py +90 -30
- ccxt/async_support/deribit.py +131 -50
- ccxt/async_support/digifinex.py +114 -51
- ccxt/async_support/exmo.py +104 -45
- ccxt/async_support/gate.py +313 -157
- ccxt/async_support/gemini.py +57 -20
- ccxt/async_support/hashkey.py +151 -66
- ccxt/async_support/hitbtc.py +157 -74
- ccxt/async_support/hollaex.py +76 -25
- ccxt/async_support/htx.py +297 -240
- ccxt/async_support/huobijp.py +1 -0
- ccxt/async_support/hyperliquid.py +94 -38
- ccxt/async_support/idex.py +73 -24
- ccxt/async_support/independentreserve.py +12 -5
- ccxt/async_support/indodax.py +54 -17
- ccxt/async_support/kraken.py +108 -36
- ccxt/async_support/krakenfutures.py +88 -34
- ccxt/async_support/kucoin.py +214 -110
- ccxt/async_support/kucoinfutures.py +209 -64
- ccxt/async_support/kuna.py +80 -39
- ccxt/async_support/latoken.py +70 -33
- ccxt/async_support/lbank.py +89 -38
- ccxt/async_support/luno.py +54 -19
- ccxt/async_support/lykke.py +54 -19
- ccxt/async_support/mercado.py +1 -0
- ccxt/async_support/mexc.py +226 -108
- ccxt/async_support/ndax.py +58 -19
- ccxt/async_support/novadax.py +67 -22
- ccxt/async_support/oceanex.py +58 -19
- ccxt/async_support/okcoin.py +81 -38
- ccxt/async_support/okx.py +270 -109
- ccxt/async_support/onetrading.py +3 -1
- ccxt/async_support/oxfun.py +95 -36
- ccxt/async_support/p2b.py +49 -23
- ccxt/async_support/paradex.py +75 -27
- ccxt/async_support/paymium.py +31 -11
- ccxt/async_support/phemex.py +108 -56
- ccxt/async_support/poloniex.py +80 -30
- ccxt/async_support/poloniexfutures.py +72 -30
- ccxt/async_support/probit.py +64 -22
- ccxt/async_support/timex.py +58 -19
- ccxt/async_support/tokocrypto.py +63 -22
- ccxt/async_support/tradeogre.py +7 -2
- ccxt/async_support/upbit.py +72 -25
- ccxt/async_support/vertex.py +74 -28
- ccxt/async_support/wavesexchange.py +32 -8
- ccxt/async_support/wazirx.py +51 -17
- ccxt/async_support/whitebit.py +105 -41
- ccxt/async_support/woo.py +162 -65
- ccxt/async_support/woofipro.py +119 -50
- ccxt/async_support/xt.py +150 -73
- ccxt/async_support/yobit.py +49 -16
- ccxt/async_support/zaif.py +30 -10
- ccxt/async_support/zonda.py +46 -16
- ccxt/base/exchange.py +47 -35
- ccxt/base/types.py +1 -0
- ccxt/bigone.py +71 -27
- ccxt/binance.py +555 -323
- ccxt/bingx.py +208 -108
- ccxt/bit2c.py +34 -12
- ccxt/bitbank.py +42 -14
- ccxt/bitbns.py +17 -9
- ccxt/bitfinex.py +68 -24
- ccxt/bitfinex2.py +116 -44
- ccxt/bitflyer.py +54 -18
- ccxt/bitget.py +277 -145
- ccxt/bithumb.py +39 -14
- ccxt/bitmart.py +145 -79
- ccxt/bitmex.py +90 -30
- ccxt/bitopro.py +66 -22
- ccxt/bitrue.py +109 -57
- ccxt/bitso.py +55 -19
- ccxt/bitstamp.py +84 -36
- ccxt/bitteam.py +51 -17
- ccxt/bitvavo.py +57 -22
- ccxt/bl3p.py +26 -10
- ccxt/blockchaincom.py +63 -21
- ccxt/blofin.py +95 -38
- ccxt/btcalpha.py +48 -16
- ccxt/btcbox.py +27 -9
- ccxt/btcmarkets.py +57 -19
- ccxt/btcturk.py +36 -12
- ccxt/bybit.py +251 -95
- ccxt/cex.py +65 -22
- ccxt/coinbase.py +138 -56
- ccxt/coinbaseexchange.py +76 -28
- ccxt/coinbaseinternational.py +75 -27
- ccxt/coincatch.py +191 -97
- ccxt/coincheck.py +33 -11
- ccxt/coinex.py +212 -101
- ccxt/coinlist.py +87 -30
- ccxt/coinmate.py +55 -24
- ccxt/coinmetro.py +52 -18
- ccxt/coinone.py +27 -10
- ccxt/coinsph.py +73 -27
- ccxt/coinspot.py +25 -9
- ccxt/cryptocom.py +103 -38
- ccxt/currencycom.py +70 -23
- ccxt/delta.py +90 -30
- ccxt/deribit.py +131 -50
- ccxt/digifinex.py +114 -51
- ccxt/exmo.py +104 -45
- ccxt/gate.py +313 -157
- ccxt/gemini.py +57 -20
- ccxt/hashkey.py +151 -66
- ccxt/hitbtc.py +157 -74
- ccxt/hollaex.py +76 -25
- ccxt/htx.py +297 -240
- ccxt/huobijp.py +1 -0
- ccxt/hyperliquid.py +94 -38
- ccxt/idex.py +73 -24
- ccxt/independentreserve.py +12 -5
- ccxt/indodax.py +54 -17
- ccxt/kraken.py +108 -36
- ccxt/krakenfutures.py +88 -34
- ccxt/kucoin.py +214 -110
- ccxt/kucoinfutures.py +209 -64
- ccxt/kuna.py +80 -39
- ccxt/latoken.py +70 -33
- ccxt/lbank.py +89 -38
- ccxt/luno.py +54 -19
- ccxt/lykke.py +54 -19
- ccxt/mercado.py +1 -0
- ccxt/mexc.py +226 -108
- ccxt/ndax.py +58 -19
- ccxt/novadax.py +67 -22
- ccxt/oceanex.py +58 -19
- ccxt/okcoin.py +81 -38
- ccxt/okx.py +270 -109
- ccxt/onetrading.py +3 -1
- ccxt/oxfun.py +95 -36
- ccxt/p2b.py +49 -23
- ccxt/paradex.py +75 -27
- ccxt/paymium.py +31 -11
- ccxt/phemex.py +108 -56
- ccxt/poloniex.py +80 -30
- ccxt/poloniexfutures.py +72 -30
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +15 -5
- ccxt/pro/ascendex.py +18 -6
- ccxt/pro/binance.py +204 -123
- ccxt/pro/bingx.py +44 -24
- ccxt/pro/bitfinex.py +13 -5
- ccxt/pro/bitget.py +76 -37
- ccxt/pro/bithumb.py +12 -4
- ccxt/pro/bitmart.py +44 -20
- ccxt/pro/bitmex.py +42 -14
- ccxt/pro/bitopro.py +15 -5
- ccxt/pro/bitrue.py +7 -3
- ccxt/pro/bitvavo.py +97 -62
- ccxt/pro/blockchaincom.py +18 -6
- ccxt/pro/blofin.py +36 -12
- ccxt/pro/bybit.py +100 -42
- ccxt/pro/cex.py +48 -16
- ccxt/pro/coinbase.py +32 -12
- ccxt/pro/coinbaseexchange.py +1 -1
- ccxt/pro/coinbaseinternational.py +34 -14
- ccxt/pro/coincatch.py +54 -19
- ccxt/pro/coincheck.py +6 -2
- ccxt/pro/coinex.py +40 -20
- ccxt/pro/coinone.py +9 -3
- ccxt/pro/cryptocom.py +71 -27
- ccxt/pro/deribit.py +36 -12
- ccxt/pro/exmo.py +10 -4
- ccxt/pro/gate.py +65 -31
- ccxt/pro/gemini.py +21 -7
- ccxt/pro/hashkey.py +27 -9
- ccxt/pro/hitbtc.py +61 -37
- ccxt/pro/hollaex.py +15 -5
- ccxt/pro/htx.py +39 -21
- ccxt/pro/hyperliquid.py +41 -14
- ccxt/pro/kraken.py +49 -17
- ccxt/pro/krakenfutures.py +47 -24
- ccxt/pro/kucoin.py +60 -31
- ccxt/pro/kucoinfutures.py +41 -19
- ccxt/pro/lbank.py +27 -9
- ccxt/pro/luno.py +3 -1
- ccxt/pro/mexc.py +36 -19
- ccxt/pro/ndax.py +12 -4
- ccxt/pro/okcoin.py +18 -6
- ccxt/pro/okx.py +76 -28
- ccxt/pro/onetrading.py +21 -7
- ccxt/pro/oxfun.py +54 -20
- ccxt/pro/p2b.py +23 -11
- ccxt/pro/paradex.py +12 -4
- ccxt/pro/phemex.py +31 -19
- ccxt/pro/poloniex.py +50 -22
- ccxt/pro/poloniexfutures.py +17 -7
- ccxt/pro/probit.py +18 -6
- ccxt/pro/upbit.py +25 -9
- ccxt/pro/vertex.py +20 -6
- ccxt/pro/wazirx.py +21 -7
- ccxt/pro/whitebit.py +25 -9
- ccxt/pro/woo.py +32 -12
- ccxt/pro/woofipro.py +35 -13
- ccxt/pro/xt.py +46 -26
- ccxt/probit.py +64 -22
- ccxt/timex.py +58 -19
- ccxt/tokocrypto.py +63 -22
- ccxt/tradeogre.py +7 -2
- ccxt/upbit.py +72 -25
- ccxt/vertex.py +74 -28
- ccxt/wavesexchange.py +32 -8
- ccxt/wazirx.py +51 -17
- ccxt/whitebit.py +105 -41
- ccxt/woo.py +162 -65
- ccxt/woofipro.py +119 -50
- ccxt/xt.py +150 -73
- ccxt/yobit.py +49 -16
- ccxt/zaif.py +30 -10
- ccxt/zonda.py +46 -16
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/METADATA +11 -5
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/RECORD +268 -268
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/WHEEL +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/top_level.txt +0 -0
ccxt/kucoin.py
CHANGED
@@ -590,6 +590,8 @@ class kucoin(Exchange, ImplicitAPI):
|
|
590
590
|
'400303': PermissionDenied, # {"msg":"To enjoy the full range of our products and services, we kindly request you complete the identity verification process.","code":"400303"}
|
591
591
|
'500000': ExchangeNotAvailable, # {"code":"500000","msg":"Internal Server Error"}
|
592
592
|
'260220': InvalidAddress, # {"code": "260220", "msg": "deposit.address.not.exists"}
|
593
|
+
'600100': InsufficientFunds, # {"msg":"Funds below the minimum requirement.","code":"600100"}
|
594
|
+
'600101': InvalidOrder, # {"msg":"The order funds should more then 0.1 USDT.","code":"600101"}
|
593
595
|
'900014': BadRequest, # {"code":"900014","msg":"Invalid chainId"}
|
594
596
|
},
|
595
597
|
'broad': {
|
@@ -1008,7 +1010,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1008
1010
|
def fetch_time(self, params={}):
|
1009
1011
|
"""
|
1010
1012
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1011
|
-
|
1013
|
+
|
1014
|
+
https://docs.kucoin.com/#server-time
|
1015
|
+
|
1012
1016
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1013
1017
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
1014
1018
|
"""
|
@@ -1025,7 +1029,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1025
1029
|
def fetch_status(self, params={}):
|
1026
1030
|
"""
|
1027
1031
|
the latest known information on the availability of the exchange API
|
1028
|
-
|
1032
|
+
|
1033
|
+
https://docs.kucoin.com/#service-status
|
1034
|
+
|
1029
1035
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1030
1036
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
1031
1037
|
"""
|
@@ -1052,8 +1058,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1052
1058
|
def fetch_markets(self, params={}) -> List[Market]:
|
1053
1059
|
"""
|
1054
1060
|
retrieves data on all markets for kucoin
|
1055
|
-
|
1056
|
-
|
1061
|
+
|
1062
|
+
https://docs.kucoin.com/#get-symbols-list-deprecated
|
1063
|
+
https://docs.kucoin.com/#get-all-tickers
|
1064
|
+
|
1057
1065
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1058
1066
|
:returns dict[]: an array of objects representing market data
|
1059
1067
|
"""
|
@@ -1238,8 +1246,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1238
1246
|
|
1239
1247
|
def load_migration_status(self, force: bool = False):
|
1240
1248
|
"""
|
1249
|
+
:param boolean force: load account state for non hf
|
1241
1250
|
loads the migration status for the account(hf or not)
|
1242
|
-
|
1251
|
+
|
1252
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
|
1253
|
+
|
1243
1254
|
"""
|
1244
1255
|
if not ('hf' in self.options) or (self.options['hf'] is None) or force:
|
1245
1256
|
result: dict = self.privateGetHfAccountsOpened()
|
@@ -1260,7 +1271,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1260
1271
|
def fetch_currencies(self, params={}) -> Currencies:
|
1261
1272
|
"""
|
1262
1273
|
fetches all available currencies on an exchange
|
1263
|
-
|
1274
|
+
|
1275
|
+
https://docs.kucoin.com/#get-currencies
|
1276
|
+
|
1264
1277
|
:param dict params: extra parameters specific to the exchange API endpoint
|
1265
1278
|
:returns dict: an associative dictionary of currencies
|
1266
1279
|
"""
|
@@ -1414,7 +1427,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1414
1427
|
def fetch_accounts(self, params={}) -> List[Account]:
|
1415
1428
|
"""
|
1416
1429
|
fetch all the accounts associated with a profile
|
1417
|
-
|
1430
|
+
|
1431
|
+
https://docs.kucoin.com/#list-accounts
|
1432
|
+
|
1418
1433
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1419
1434
|
:returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
|
1420
1435
|
"""
|
@@ -1462,7 +1477,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1462
1477
|
def fetch_transaction_fee(self, code: str, params={}):
|
1463
1478
|
"""
|
1464
1479
|
*DEPRECATED* please use fetchDepositWithdrawFee instead
|
1465
|
-
|
1480
|
+
|
1481
|
+
https://docs.kucoin.com/#get-withdrawal-quotas
|
1482
|
+
|
1466
1483
|
:param str code: unified currency code
|
1467
1484
|
:param dict params: extra parameters specific to the exchange API endpoint
|
1468
1485
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -1489,7 +1506,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1489
1506
|
def fetch_deposit_withdraw_fee(self, code: str, params={}):
|
1490
1507
|
"""
|
1491
1508
|
fetch the fee for deposits and withdrawals
|
1492
|
-
|
1509
|
+
|
1510
|
+
https://docs.kucoin.com/#get-withdrawal-quotas
|
1511
|
+
|
1493
1512
|
:param str code: unified currency code
|
1494
1513
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1495
1514
|
:param str [params.network]: The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency; you can query the chain through the response of the GET /api/v2/currencies/{currency} interface
|
@@ -1677,7 +1696,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1677
1696
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1678
1697
|
"""
|
1679
1698
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
1680
|
-
|
1699
|
+
|
1700
|
+
https://docs.kucoin.com/#get-all-tickers
|
1701
|
+
|
1681
1702
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1682
1703
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1683
1704
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1728,7 +1749,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1728
1749
|
def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
|
1729
1750
|
"""
|
1730
1751
|
fetches the mark price for multiple markets
|
1731
|
-
|
1752
|
+
|
1753
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-all-margin-trading-pairs-mark-prices
|
1754
|
+
|
1732
1755
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1733
1756
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1734
1757
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1742,7 +1765,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1742
1765
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1743
1766
|
"""
|
1744
1767
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
1745
|
-
|
1768
|
+
|
1769
|
+
https://docs.kucoin.com/#get-24hr-stats
|
1770
|
+
|
1746
1771
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1747
1772
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1748
1773
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1782,7 +1807,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1782
1807
|
def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
|
1783
1808
|
"""
|
1784
1809
|
fetches the mark price for a specific market
|
1785
|
-
|
1810
|
+
|
1811
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-mark-price
|
1812
|
+
|
1786
1813
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1787
1814
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1788
1815
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1821,7 +1848,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1821
1848
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
1822
1849
|
"""
|
1823
1850
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1824
|
-
|
1851
|
+
|
1852
|
+
https://docs.kucoin.com/#get-klines
|
1853
|
+
|
1825
1854
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1826
1855
|
:param str timeframe: the length of time each candle represents
|
1827
1856
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -1872,7 +1901,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1872
1901
|
|
1873
1902
|
def create_deposit_address(self, code: str, params={}):
|
1874
1903
|
"""
|
1875
|
-
|
1904
|
+
|
1905
|
+
https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
|
1906
|
+
|
1876
1907
|
create a currency deposit address
|
1877
1908
|
:param str code: unified currency code of the currency for the deposit address
|
1878
1909
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1910,7 +1941,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1910
1941
|
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1911
1942
|
"""
|
1912
1943
|
fetch the deposit address for a currency associated with self account
|
1913
|
-
|
1944
|
+
|
1945
|
+
https://docs.kucoin.com/#get-deposit-addresses-v2
|
1946
|
+
|
1914
1947
|
:param str code: unified currency code
|
1915
1948
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1916
1949
|
:param str [params.network]: the blockchain network name
|
@@ -1960,7 +1993,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1960
1993
|
|
1961
1994
|
def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
|
1962
1995
|
"""
|
1963
|
-
|
1996
|
+
|
1997
|
+
https://docs.kucoin.com/#get-deposit-addresses-v2
|
1998
|
+
|
1964
1999
|
fetch the deposit address for a currency associated with self account
|
1965
2000
|
:param str code: unified currency code
|
1966
2001
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1999,8 +2034,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1999
2034
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
2000
2035
|
"""
|
2001
2036
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
2002
|
-
|
2003
|
-
|
2037
|
+
|
2038
|
+
https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
|
2039
|
+
https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
|
2040
|
+
|
2004
2041
|
:param str symbol: unified symbol of the market to fetch the order book for
|
2005
2042
|
:param int [limit]: the maximum amount of order book entries to return
|
2006
2043
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2074,13 +2111,15 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2074
2111
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2075
2112
|
"""
|
2076
2113
|
Create an order on the exchange
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2114
|
+
|
2115
|
+
https://docs.kucoin.com/spot#place-a-new-order
|
2116
|
+
https://docs.kucoin.com/spot#place-a-new-order-2
|
2117
|
+
https://docs.kucoin.com/spot#place-a-margin-order
|
2118
|
+
https://docs.kucoin.com/spot-hf/#place-hf-order
|
2119
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
|
2120
|
+
https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
|
2121
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-hf-order
|
2122
|
+
|
2084
2123
|
:param str symbol: Unified CCXT market symbol
|
2085
2124
|
:param str type: 'limit' or 'market'
|
2086
2125
|
:param str side: 'buy' or 'sell'
|
@@ -2091,21 +2130,21 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2091
2130
|
:param str [params.marginMode]: 'cross', # cross(cross mode) and isolated(isolated mode), set to cross by default, the isolated mode will be released soon, stay tuned
|
2092
2131
|
:param str [params.timeInForce]: GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
2093
2132
|
:param str [params.postOnly]: Post only flag, invalid when timeInForce is IOC or FOK
|
2094
|
-
|
2095
|
-
|
2133
|
+
|
2134
|
+
EXCHANGE SPECIFIC PARAMETERS
|
2096
2135
|
:param str [params.clientOid]: client order id, defaults to uuid if not passed
|
2097
2136
|
:param str [params.remark]: remark for the order, length cannot exceed 100 utf8 characters
|
2098
2137
|
:param str [params.tradeType]: 'TRADE', # TRADE, MARGIN_TRADE # not used with margin orders
|
2099
|
-
|
2138
|
+
limit orders ---------------------------------------------------
|
2100
2139
|
:param float [params.cancelAfter]: long, # cancel after n seconds, requires timeInForce to be GTT
|
2101
2140
|
:param bool [params.hidden]: False, # Order will not be displayed in the order book
|
2102
2141
|
:param bool [params.iceberg]: False, # Only a portion of the order is displayed in the order book
|
2103
2142
|
:param str [params.visibleSize]: self.amount_to_precision(symbol, visibleSize), # The maximum visible size of an iceberg order
|
2104
|
-
|
2143
|
+
market orders --------------------------------------------------
|
2105
2144
|
:param str [params.funds]: # Amount of quote currency to use
|
2106
|
-
|
2145
|
+
stop orders ----------------------------------------------------
|
2107
2146
|
:param str [params.stop]: Either loss or entry, the default is loss. Requires stopPrice to be defined
|
2108
|
-
|
2147
|
+
margin orders --------------------------------------------------
|
2109
2148
|
:param float [params.leverage]: Leverage size of the order
|
2110
2149
|
:param str [params.stp]: '', # self trade prevention, CN, CO, CB or DC
|
2111
2150
|
:param bool [params.autoBorrow]: False, # The system will first borrow you funds at the optimal interest rate and then place an order for you
|
@@ -2162,7 +2201,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2162
2201
|
def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
2163
2202
|
"""
|
2164
2203
|
create a market order by providing the symbol, side and cost
|
2165
|
-
|
2204
|
+
|
2205
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
|
2206
|
+
|
2166
2207
|
:param str symbol: unified symbol of the market to create an order in
|
2167
2208
|
:param str side: 'buy' or 'sell'
|
2168
2209
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -2176,7 +2217,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2176
2217
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2177
2218
|
"""
|
2178
2219
|
create a market buy order by providing the symbol and cost
|
2179
|
-
|
2220
|
+
|
2221
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
|
2222
|
+
|
2180
2223
|
:param str symbol: unified symbol of the market to create an order in
|
2181
2224
|
:param float cost: how much you want to trade in units of the quote currency
|
2182
2225
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2188,7 +2231,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2188
2231
|
def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2189
2232
|
"""
|
2190
2233
|
create a market sell order by providing the symbol and cost
|
2191
|
-
|
2234
|
+
|
2235
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
|
2236
|
+
|
2192
2237
|
:param str symbol: unified symbol of the market to create an order in
|
2193
2238
|
:param float cost: how much you want to trade in units of the quote currency
|
2194
2239
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2200,9 +2245,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2200
2245
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
2201
2246
|
"""
|
2202
2247
|
create a list of trade orders
|
2203
|
-
|
2204
|
-
|
2205
|
-
|
2248
|
+
|
2249
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
|
2250
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
|
2251
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-multiple-hf-orders
|
2252
|
+
|
2206
2253
|
:param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
2207
2254
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2208
2255
|
:param bool [params.hf]: False, # True for hf orders
|
@@ -2346,7 +2393,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2346
2393
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
2347
2394
|
"""
|
2348
2395
|
edit an order, kucoin currently only supports the modification of HF orders
|
2349
|
-
|
2396
|
+
|
2397
|
+
https://docs.kucoin.com/spot-hf/#modify-order
|
2398
|
+
|
2350
2399
|
:param str id: order id
|
2351
2400
|
:param str symbol: unified symbol of the market to create an order in
|
2352
2401
|
:param str type: not used
|
@@ -2386,14 +2435,16 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2386
2435
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2387
2436
|
"""
|
2388
2437
|
cancels an open order
|
2389
|
-
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2438
|
+
|
2439
|
+
https://docs.kucoin.com/spot#cancel-an-order
|
2440
|
+
https://docs.kucoin.com/spot#cancel-an-order-2
|
2441
|
+
https://docs.kucoin.com/spot#cancel-single-order-by-clientoid
|
2442
|
+
https://docs.kucoin.com/spot#cancel-single-order-by-clientoid-2
|
2443
|
+
https://docs.kucoin.com/spot-hf/#cancel-orders-by-orderid
|
2444
|
+
https://docs.kucoin.com/spot-hf/#cancel-order-by-clientoid
|
2445
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-orderid
|
2446
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-clientoid
|
2447
|
+
|
2397
2448
|
:param str id: order id
|
2398
2449
|
:param str symbol: unified symbol of the market the order was made in
|
2399
2450
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2499,15 +2550,16 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2499
2550
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
2500
2551
|
"""
|
2501
2552
|
cancel all open orders
|
2502
|
-
|
2503
|
-
|
2504
|
-
|
2553
|
+
|
2554
|
+
https://docs.kucoin.com/spot#cancel-all-orders
|
2555
|
+
https://docs.kucoin.com/spot#cancel-orders
|
2556
|
+
https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
|
2557
|
+
|
2505
2558
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
2506
2559
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2507
2560
|
:param bool [params.stop]: *invalid for isolated margin* True if cancelling all stop orders
|
2508
2561
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
2509
2562
|
:param str [params.orderIds]: *stop orders only* Comma seperated order IDs
|
2510
|
-
:param bool [params.stop]: True if cancelling a stop order
|
2511
2563
|
:param bool [params.hf]: False, # True for hf order
|
2512
2564
|
:returns: Response from the exchange
|
2513
2565
|
"""
|
@@ -2539,17 +2591,18 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2539
2591
|
def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2540
2592
|
"""
|
2541
2593
|
fetch a list of orders
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2594
|
+
|
2595
|
+
https://docs.kucoin.com/spot#list-orders
|
2596
|
+
https://docs.kucoin.com/spot#list-stop-orders
|
2597
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
2598
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
2599
|
+
|
2546
2600
|
:param str status: *not used for stop orders* 'open' or 'closed'
|
2547
2601
|
:param str symbol: unified market symbol
|
2548
2602
|
:param int [since]: timestamp in ms of the earliest order
|
2549
2603
|
:param int [limit]: max number of orders to return
|
2550
2604
|
:param dict [params]: exchange specific params
|
2551
2605
|
:param int [params.until]: end time in ms
|
2552
|
-
:param bool [params.stop]: True if fetching stop orders
|
2553
2606
|
:param str [params.side]: buy or sell
|
2554
2607
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2555
2608
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
@@ -2650,10 +2703,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2650
2703
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2651
2704
|
"""
|
2652
2705
|
fetches information on multiple closed orders made by the user
|
2653
|
-
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2706
|
+
|
2707
|
+
https://docs.kucoin.com/spot#list-orders
|
2708
|
+
https://docs.kucoin.com/spot#list-stop-orders
|
2709
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
2710
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
2711
|
+
|
2657
2712
|
:param str symbol: unified market symbol of the market orders were made in
|
2658
2713
|
:param int [since]: the earliest time in ms to fetch orders for
|
2659
2714
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -2677,10 +2732,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2677
2732
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2678
2733
|
"""
|
2679
2734
|
fetch all unfilled currently open orders
|
2680
|
-
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2735
|
+
|
2736
|
+
https://docs.kucoin.com/spot#list-orders
|
2737
|
+
https://docs.kucoin.com/spot#list-stop-orders
|
2738
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
2739
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
2740
|
+
|
2684
2741
|
:param str symbol: unified market symbol
|
2685
2742
|
:param int [since]: the earliest time in ms to fetch open orders for
|
2686
2743
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -2692,7 +2749,6 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2692
2749
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2693
2750
|
:param int [params.currentPage]: *stop orders only* current page
|
2694
2751
|
:param str [params.orderIds]: *stop orders only* comma seperated order ID list
|
2695
|
-
:param bool [params.stop]: True if fetching a stop order
|
2696
2752
|
:param bool [params.hf]: False, # True for hf order
|
2697
2753
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2698
2754
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2707,12 +2763,14 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2707
2763
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2708
2764
|
"""
|
2709
2765
|
fetch an order
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2766
|
+
|
2767
|
+
https://docs.kucoin.com/spot#get-an-order
|
2768
|
+
https://docs.kucoin.com/spot#get-single-active-order-by-clientoid
|
2769
|
+
https://docs.kucoin.com/spot#get-single-order-info
|
2770
|
+
https://docs.kucoin.com/spot#get-single-order-by-clientoid
|
2771
|
+
https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
|
2772
|
+
https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
2773
|
+
|
2716
2774
|
:param str id: Order id
|
2717
2775
|
:param str symbol: not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
|
2718
2776
|
:param dict [params]: exchange specific parameters
|
@@ -2942,8 +3000,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2942
3000
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2943
3001
|
"""
|
2944
3002
|
fetch all the trades made from a single order
|
2945
|
-
|
2946
|
-
|
3003
|
+
|
3004
|
+
https://docs.kucoin.com/#list-fills
|
3005
|
+
https://docs.kucoin.com/spot-hf/#transaction-details
|
3006
|
+
|
2947
3007
|
:param str id: order id
|
2948
3008
|
:param str symbol: unified market symbol
|
2949
3009
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -2958,8 +3018,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2958
3018
|
|
2959
3019
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2960
3020
|
"""
|
2961
|
-
|
2962
|
-
|
3021
|
+
|
3022
|
+
https://docs.kucoin.com/#list-fills
|
3023
|
+
https://docs.kucoin.com/spot-hf/#transaction-details
|
3024
|
+
|
2963
3025
|
fetch all trades made by the user
|
2964
3026
|
:param str symbol: unified market symbol
|
2965
3027
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -3057,7 +3119,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3057
3119
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
3058
3120
|
"""
|
3059
3121
|
get the list of most recent trades for a particular symbol
|
3060
|
-
|
3122
|
+
|
3123
|
+
https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
|
3124
|
+
|
3061
3125
|
:param str symbol: unified symbol of the market to fetch trades for
|
3062
3126
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
3063
3127
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -3222,7 +3286,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3222
3286
|
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
3223
3287
|
"""
|
3224
3288
|
fetch the trading fees for a market
|
3225
|
-
|
3289
|
+
|
3290
|
+
https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
|
3291
|
+
|
3226
3292
|
:param str symbol: unified market symbol
|
3227
3293
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3228
3294
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -3260,7 +3326,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3260
3326
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
3261
3327
|
"""
|
3262
3328
|
make a withdrawal
|
3263
|
-
|
3329
|
+
|
3330
|
+
https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw-v3-
|
3331
|
+
|
3264
3332
|
:param str code: unified currency code
|
3265
3333
|
:param float amount: the amount to withdraw
|
3266
3334
|
:param str address: the address to withdraw to
|
@@ -3422,8 +3490,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3422
3490
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3423
3491
|
"""
|
3424
3492
|
fetch all deposits made to an account
|
3425
|
-
|
3426
|
-
|
3493
|
+
|
3494
|
+
https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
|
3495
|
+
https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
|
3496
|
+
|
3427
3497
|
:param str code: unified currency code
|
3428
3498
|
:param int [since]: the earliest time in ms to fetch deposits for
|
3429
3499
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -3499,8 +3569,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3499
3569
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3500
3570
|
"""
|
3501
3571
|
fetch all withdrawals made from an account
|
3502
|
-
|
3503
|
-
|
3572
|
+
|
3573
|
+
https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
|
3574
|
+
https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
|
3575
|
+
|
3504
3576
|
:param str code: unified currency code
|
3505
3577
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
3506
3578
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -3587,9 +3659,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3587
3659
|
def fetch_balance(self, params={}) -> Balances:
|
3588
3660
|
"""
|
3589
3661
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3590
|
-
|
3591
|
-
|
3592
|
-
|
3662
|
+
|
3663
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
|
3664
|
+
https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
|
3665
|
+
https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
|
3666
|
+
|
3593
3667
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3594
3668
|
:param dict [params.marginMode]: 'cross' or 'isolated', margin type for fetching margin balance
|
3595
3669
|
:param dict [params.type]: extra parameters specific to the exchange API endpoint
|
@@ -3751,9 +3825,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3751
3825
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
3752
3826
|
"""
|
3753
3827
|
transfer currency internally between wallets on the same account
|
3754
|
-
|
3755
|
-
|
3756
|
-
|
3828
|
+
|
3829
|
+
https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
|
3830
|
+
https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
|
3831
|
+
https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
|
3832
|
+
|
3757
3833
|
:param str code: unified currency code
|
3758
3834
|
:param float amount: amount to transfer
|
3759
3835
|
:param str fromAccount: account to transfer from
|
@@ -4020,9 +4096,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4020
4096
|
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
4021
4097
|
"""
|
4022
4098
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4099
|
+
|
4100
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
|
4101
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
|
4102
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
|
4103
|
+
|
4026
4104
|
:param str [code]: unified currency code, default is None
|
4027
4105
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
4028
4106
|
:param int [limit]: max number of ledger entries to return, default is None
|
@@ -4156,10 +4234,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4156
4234
|
def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
4157
4235
|
"""
|
4158
4236
|
fetch the interest owed by the user for borrowing currency for margin trading
|
4159
|
-
|
4160
|
-
|
4161
|
-
|
4162
|
-
|
4237
|
+
|
4238
|
+
https://docs.kucoin.com/#get-repay-record
|
4239
|
+
https://docs.kucoin.com/#query-isolated-margin-account-info
|
4240
|
+
|
4241
|
+
:param str [code]: unified currency code
|
4242
|
+
:param str [symbol]: unified market symbol, required for isolated margin
|
4163
4243
|
:param int [since]: the earliest time in ms to fetch borrrow interest for
|
4164
4244
|
:param int [limit]: the maximum number of structures to retrieve
|
4165
4245
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4168,14 +4248,19 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4168
4248
|
"""
|
4169
4249
|
self.load_markets()
|
4170
4250
|
marginMode = None
|
4171
|
-
marginMode, params = self.handle_margin_mode_and_params('fetchBorrowInterest', params)
|
4172
|
-
if marginMode is None:
|
4173
|
-
marginMode = 'cross' # cross marginMode
|
4251
|
+
marginMode, params = self.handle_margin_mode_and_params('fetchBorrowInterest', params, 'cross')
|
4174
4252
|
request: dict = {}
|
4175
|
-
|
4253
|
+
currency = None
|
4176
4254
|
if code is not None:
|
4177
4255
|
currency = self.currency(code)
|
4178
|
-
|
4256
|
+
if marginMode == 'isolated':
|
4257
|
+
request['balanceCurrency'] = currency['id']
|
4258
|
+
else:
|
4259
|
+
request['quoteCurrency'] = currency['id']
|
4260
|
+
market = None
|
4261
|
+
if symbol is not None:
|
4262
|
+
market = self.market(symbol)
|
4263
|
+
response = None
|
4179
4264
|
if marginMode == 'isolated':
|
4180
4265
|
response = self.privateGetIsolatedAccounts(self.extend(request, params))
|
4181
4266
|
else:
|
@@ -4246,7 +4331,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4246
4331
|
#
|
4247
4332
|
data = self.safe_dict(response, 'data', {})
|
4248
4333
|
assets = self.safe_list(data, 'assets', []) if (marginMode == 'isolated') else self.safe_list(data, 'accounts', [])
|
4249
|
-
|
4334
|
+
interest = self.parse_borrow_interests(assets, market)
|
4335
|
+
filteredByCurrency = self.filter_by_currency_since_limit(interest, code, since, limit)
|
4336
|
+
return self.filter_by_symbol_since_limit(filteredByCurrency, symbol, since, limit)
|
4250
4337
|
|
4251
4338
|
def parse_borrow_interest(self, info: dict, market: Market = None) -> BorrowInterest:
|
4252
4339
|
#
|
@@ -4325,7 +4412,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4325
4412
|
def fetch_borrow_rate_histories(self, codes=None, since: Int = None, limit: Int = None, params={}):
|
4326
4413
|
"""
|
4327
4414
|
retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is None
|
4328
|
-
|
4415
|
+
|
4416
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
|
4417
|
+
|
4329
4418
|
:param str[]|None codes: list of unified currency codes, default is None
|
4330
4419
|
:param int [since]: timestamp in ms of the earliest borrowRate, default is None
|
4331
4420
|
:param int [limit]: max number of borrow rate prices to return, default is None
|
@@ -4374,7 +4463,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4374
4463
|
def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
4375
4464
|
"""
|
4376
4465
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
4377
|
-
|
4466
|
+
|
4467
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
|
4468
|
+
|
4378
4469
|
:param str code: unified currency code
|
4379
4470
|
:param int [since]: timestamp for the earliest borrow rate
|
4380
4471
|
:param int [limit]: the maximum number of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>` to retrieve
|
@@ -4451,7 +4542,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4451
4542
|
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
4452
4543
|
"""
|
4453
4544
|
create a loan to borrow margin
|
4454
|
-
|
4545
|
+
|
4546
|
+
https://docs.kucoin.com/#1-margin-borrowing
|
4547
|
+
|
4455
4548
|
:param str code: unified currency code of the currency to borrow
|
4456
4549
|
:param float amount: the amount to borrow
|
4457
4550
|
:param dict [params]: extra parameters specific to the exchange API endpoints
|
@@ -4484,7 +4577,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4484
4577
|
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
4485
4578
|
"""
|
4486
4579
|
create a loan to borrow margin
|
4487
|
-
|
4580
|
+
|
4581
|
+
https://docs.kucoin.com/#1-margin-borrowing
|
4582
|
+
|
4488
4583
|
:param str symbol: unified market symbol, required for isolated margin
|
4489
4584
|
:param str code: unified currency code of the currency to borrow
|
4490
4585
|
:param float amount: the amount to borrow
|
@@ -4521,7 +4616,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4521
4616
|
def repay_cross_margin(self, code: str, amount, params={}):
|
4522
4617
|
"""
|
4523
4618
|
repay borrowed margin and interest
|
4524
|
-
|
4619
|
+
|
4620
|
+
https://docs.kucoin.com/#2-repayment
|
4621
|
+
|
4525
4622
|
:param str code: unified currency code of the currency to repay
|
4526
4623
|
:param float amount: the amount to repay
|
4527
4624
|
:param dict [params]: extra parameters specific to the exchange API endpoints
|
@@ -4552,7 +4649,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4552
4649
|
def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
4553
4650
|
"""
|
4554
4651
|
repay borrowed margin and interest
|
4555
|
-
|
4652
|
+
|
4653
|
+
https://docs.kucoin.com/#2-repayment
|
4654
|
+
|
4556
4655
|
:param str symbol: unified market symbol
|
4557
4656
|
:param str code: unified currency code of the currency to repay
|
4558
4657
|
:param float amount: the amount to repay
|
@@ -4606,7 +4705,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4606
4705
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
4607
4706
|
"""
|
4608
4707
|
fetch deposit and withdraw fees - *IMPORTANT* use fetchDepositWithdrawFee to get more in-depth info
|
4609
|
-
|
4708
|
+
|
4709
|
+
https://docs.kucoin.com/#get-currencies
|
4710
|
+
|
4610
4711
|
:param str[]|None codes: list of unified currency codes
|
4611
4712
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4612
4713
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -4637,8 +4738,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4637
4738
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
4638
4739
|
"""
|
4639
4740
|
set the level of leverage for a market
|
4640
|
-
|
4641
|
-
|
4741
|
+
|
4742
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
|
4743
|
+
|
4744
|
+
:param int [leverage]: New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage
|
4745
|
+
:param str [symbol]: unified market symbol
|
4642
4746
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4643
4747
|
:returns dict: response from the exchange
|
4644
4748
|
"""
|