ccxt 4.4.30__py2.py3-none-any.whl → 4.4.31__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/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 -19
- 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 +298 -155
- ccxt/async_support/gemini.py +57 -20
- ccxt/async_support/hashkey.py +151 -66
- ccxt/async_support/hitbtc.py +156 -73
- 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 +53 -16
- ccxt/async_support/kraken.py +107 -35
- ccxt/async_support/krakenfutures.py +88 -34
- ccxt/async_support/kucoin.py +211 -109
- ccxt/async_support/kucoinfutures.py +119 -42
- 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 +91 -41
- 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 +29 -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 +118 -49
- 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 +34 -34
- 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 -19
- 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 +298 -155
- ccxt/gemini.py +57 -20
- ccxt/hashkey.py +151 -66
- ccxt/hitbtc.py +156 -73
- 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 +53 -16
- ccxt/kraken.py +107 -35
- ccxt/krakenfutures.py +88 -34
- ccxt/kucoin.py +211 -109
- ccxt/kucoinfutures.py +119 -42
- 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 +91 -41
- 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 +200 -119
- ccxt/pro/bingx.py +44 -24
- ccxt/pro/bitfinex.py +13 -5
- ccxt/pro/bitget.py +75 -36
- 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 +51 -17
- 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 +70 -26
- ccxt/pro/deribit.py +36 -12
- ccxt/pro/exmo.py +10 -4
- ccxt/pro/gate.py +64 -30
- ccxt/pro/gemini.py +21 -7
- ccxt/pro/hashkey.py +26 -8
- 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 +35 -17
- 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 +29 -8
- ccxt/wazirx.py +51 -17
- ccxt/whitebit.py +105 -41
- ccxt/woo.py +162 -65
- ccxt/woofipro.py +118 -49
- 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.31.dist-info}/METADATA +5 -5
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/RECORD +267 -267
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/WHEEL +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.31.dist-info}/top_level.txt +0 -0
ccxt/async_support/kucoin.py
CHANGED
@@ -1009,7 +1009,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1009
1009
|
async def fetch_time(self, params={}):
|
1010
1010
|
"""
|
1011
1011
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1012
|
-
|
1012
|
+
|
1013
|
+
https://docs.kucoin.com/#server-time
|
1014
|
+
|
1013
1015
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1014
1016
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
1015
1017
|
"""
|
@@ -1026,7 +1028,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1026
1028
|
async def fetch_status(self, params={}):
|
1027
1029
|
"""
|
1028
1030
|
the latest known information on the availability of the exchange API
|
1029
|
-
|
1031
|
+
|
1032
|
+
https://docs.kucoin.com/#service-status
|
1033
|
+
|
1030
1034
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1031
1035
|
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
1032
1036
|
"""
|
@@ -1053,8 +1057,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1053
1057
|
async def fetch_markets(self, params={}) -> List[Market]:
|
1054
1058
|
"""
|
1055
1059
|
retrieves data on all markets for kucoin
|
1056
|
-
|
1057
|
-
|
1060
|
+
|
1061
|
+
https://docs.kucoin.com/#get-symbols-list-deprecated
|
1062
|
+
https://docs.kucoin.com/#get-all-tickers
|
1063
|
+
|
1058
1064
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1059
1065
|
:returns dict[]: an array of objects representing market data
|
1060
1066
|
"""
|
@@ -1239,8 +1245,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1239
1245
|
|
1240
1246
|
async def load_migration_status(self, force: bool = False):
|
1241
1247
|
"""
|
1248
|
+
@param force
|
1242
1249
|
loads the migration status for the account(hf or not)
|
1243
|
-
|
1250
|
+
|
1251
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/get-user-type
|
1252
|
+
|
1244
1253
|
"""
|
1245
1254
|
if not ('hf' in self.options) or (self.options['hf'] is None) or force:
|
1246
1255
|
result: dict = await self.privateGetHfAccountsOpened()
|
@@ -1261,7 +1270,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1261
1270
|
async def fetch_currencies(self, params={}) -> Currencies:
|
1262
1271
|
"""
|
1263
1272
|
fetches all available currencies on an exchange
|
1264
|
-
|
1273
|
+
|
1274
|
+
https://docs.kucoin.com/#get-currencies
|
1275
|
+
|
1265
1276
|
:param dict params: extra parameters specific to the exchange API endpoint
|
1266
1277
|
:returns dict: an associative dictionary of currencies
|
1267
1278
|
"""
|
@@ -1415,7 +1426,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1415
1426
|
async def fetch_accounts(self, params={}) -> List[Account]:
|
1416
1427
|
"""
|
1417
1428
|
fetch all the accounts associated with a profile
|
1418
|
-
|
1429
|
+
|
1430
|
+
https://docs.kucoin.com/#list-accounts
|
1431
|
+
|
1419
1432
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1420
1433
|
:returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
|
1421
1434
|
"""
|
@@ -1463,7 +1476,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1463
1476
|
async def fetch_transaction_fee(self, code: str, params={}):
|
1464
1477
|
"""
|
1465
1478
|
*DEPRECATED* please use fetchDepositWithdrawFee instead
|
1466
|
-
|
1479
|
+
|
1480
|
+
https://docs.kucoin.com/#get-withdrawal-quotas
|
1481
|
+
|
1467
1482
|
:param str code: unified currency code
|
1468
1483
|
:param dict params: extra parameters specific to the exchange API endpoint
|
1469
1484
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -1490,7 +1505,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1490
1505
|
async def fetch_deposit_withdraw_fee(self, code: str, params={}):
|
1491
1506
|
"""
|
1492
1507
|
fetch the fee for deposits and withdrawals
|
1493
|
-
|
1508
|
+
|
1509
|
+
https://docs.kucoin.com/#get-withdrawal-quotas
|
1510
|
+
|
1494
1511
|
:param str code: unified currency code
|
1495
1512
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1496
1513
|
: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
|
@@ -1678,7 +1695,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1678
1695
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1679
1696
|
"""
|
1680
1697
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
1681
|
-
|
1698
|
+
|
1699
|
+
https://docs.kucoin.com/#get-all-tickers
|
1700
|
+
|
1682
1701
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1683
1702
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1684
1703
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1729,7 +1748,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1729
1748
|
async def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
|
1730
1749
|
"""
|
1731
1750
|
fetches the mark price for multiple markets
|
1732
|
-
|
1751
|
+
|
1752
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-all-margin-trading-pairs-mark-prices
|
1753
|
+
|
1733
1754
|
:param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
1734
1755
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1735
1756
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1743,7 +1764,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1743
1764
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
1744
1765
|
"""
|
1745
1766
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
1746
|
-
|
1767
|
+
|
1768
|
+
https://docs.kucoin.com/#get-24hr-stats
|
1769
|
+
|
1747
1770
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1748
1771
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1749
1772
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1783,7 +1806,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1783
1806
|
async def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
|
1784
1807
|
"""
|
1785
1808
|
fetches the mark price for a specific market
|
1786
|
-
|
1809
|
+
|
1810
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-info/get-mark-price
|
1811
|
+
|
1787
1812
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
1788
1813
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1789
1814
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -1822,7 +1847,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1822
1847
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
1823
1848
|
"""
|
1824
1849
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
1825
|
-
|
1850
|
+
|
1851
|
+
https://docs.kucoin.com/#get-klines
|
1852
|
+
|
1826
1853
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
1827
1854
|
:param str timeframe: the length of time each candle represents
|
1828
1855
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -1873,7 +1900,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1873
1900
|
|
1874
1901
|
async def create_deposit_address(self, code: str, params={}):
|
1875
1902
|
"""
|
1876
|
-
|
1903
|
+
|
1904
|
+
https://www.kucoin.com/docs/rest/funding/deposit/create-deposit-address-v3-
|
1905
|
+
|
1877
1906
|
create a currency deposit address
|
1878
1907
|
:param str code: unified currency code of the currency for the deposit address
|
1879
1908
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1911,7 +1940,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1911
1940
|
async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1912
1941
|
"""
|
1913
1942
|
fetch the deposit address for a currency associated with self account
|
1914
|
-
|
1943
|
+
|
1944
|
+
https://docs.kucoin.com/#get-deposit-addresses-v2
|
1945
|
+
|
1915
1946
|
:param str code: unified currency code
|
1916
1947
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1917
1948
|
:param str [params.network]: the blockchain network name
|
@@ -1961,7 +1992,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1961
1992
|
|
1962
1993
|
async def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
|
1963
1994
|
"""
|
1964
|
-
|
1995
|
+
|
1996
|
+
https://docs.kucoin.com/#get-deposit-addresses-v2
|
1997
|
+
|
1965
1998
|
fetch the deposit address for a currency associated with self account
|
1966
1999
|
:param str code: unified currency code
|
1967
2000
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2000,8 +2033,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2000
2033
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
2001
2034
|
"""
|
2002
2035
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
2003
|
-
|
2004
|
-
|
2036
|
+
|
2037
|
+
https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
|
2038
|
+
https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
|
2039
|
+
|
2005
2040
|
:param str symbol: unified symbol of the market to fetch the order book for
|
2006
2041
|
:param int [limit]: the maximum amount of order book entries to return
|
2007
2042
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2075,13 +2110,15 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2075
2110
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
2076
2111
|
"""
|
2077
2112
|
Create an order on the exchange
|
2078
|
-
|
2079
|
-
|
2080
|
-
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2113
|
+
|
2114
|
+
https://docs.kucoin.com/spot#place-a-new-order
|
2115
|
+
https://docs.kucoin.com/spot#place-a-new-order-2
|
2116
|
+
https://docs.kucoin.com/spot#place-a-margin-order
|
2117
|
+
https://docs.kucoin.com/spot-hf/#place-hf-order
|
2118
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order-test
|
2119
|
+
https://www.kucoin.com/docs/rest/margin-trading/orders/place-margin-order-test
|
2120
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-hf-order
|
2121
|
+
|
2085
2122
|
:param str symbol: Unified CCXT market symbol
|
2086
2123
|
:param str type: 'limit' or 'market'
|
2087
2124
|
:param str side: 'buy' or 'sell'
|
@@ -2092,21 +2129,21 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2092
2129
|
: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
|
2093
2130
|
:param str [params.timeInForce]: GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
2094
2131
|
:param str [params.postOnly]: Post only flag, invalid when timeInForce is IOC or FOK
|
2095
|
-
|
2096
|
-
|
2132
|
+
|
2133
|
+
EXCHANGE SPECIFIC PARAMETERS
|
2097
2134
|
:param str [params.clientOid]: client order id, defaults to uuid if not passed
|
2098
2135
|
:param str [params.remark]: remark for the order, length cannot exceed 100 utf8 characters
|
2099
2136
|
:param str [params.tradeType]: 'TRADE', # TRADE, MARGIN_TRADE # not used with margin orders
|
2100
|
-
|
2137
|
+
limit orders ---------------------------------------------------
|
2101
2138
|
:param float [params.cancelAfter]: long, # cancel after n seconds, requires timeInForce to be GTT
|
2102
2139
|
:param bool [params.hidden]: False, # Order will not be displayed in the order book
|
2103
2140
|
:param bool [params.iceberg]: False, # Only a portion of the order is displayed in the order book
|
2104
2141
|
:param str [params.visibleSize]: self.amount_to_precision(symbol, visibleSize), # The maximum visible size of an iceberg order
|
2105
|
-
|
2142
|
+
market orders --------------------------------------------------
|
2106
2143
|
:param str [params.funds]: # Amount of quote currency to use
|
2107
|
-
|
2144
|
+
stop orders ----------------------------------------------------
|
2108
2145
|
:param str [params.stop]: Either loss or entry, the default is loss. Requires stopPrice to be defined
|
2109
|
-
|
2146
|
+
margin orders --------------------------------------------------
|
2110
2147
|
:param float [params.leverage]: Leverage size of the order
|
2111
2148
|
:param str [params.stp]: '', # self trade prevention, CN, CO, CB or DC
|
2112
2149
|
:param bool [params.autoBorrow]: False, # The system will first borrow you funds at the optimal interest rate and then place an order for you
|
@@ -2163,7 +2200,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2163
2200
|
async def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
2164
2201
|
"""
|
2165
2202
|
create a market order by providing the symbol, side and cost
|
2166
|
-
|
2203
|
+
|
2204
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
|
2205
|
+
|
2167
2206
|
:param str symbol: unified symbol of the market to create an order in
|
2168
2207
|
:param str side: 'buy' or 'sell'
|
2169
2208
|
:param float cost: how much you want to trade in units of the quote currency
|
@@ -2177,7 +2216,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2177
2216
|
async def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
2178
2217
|
"""
|
2179
2218
|
create a market buy order by providing the symbol and cost
|
2180
|
-
|
2219
|
+
|
2220
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
|
2221
|
+
|
2181
2222
|
:param str symbol: unified symbol of the market to create an order in
|
2182
2223
|
:param float cost: how much you want to trade in units of the quote currency
|
2183
2224
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2189,7 +2230,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2189
2230
|
async def create_market_sell_order_with_cost(self, symbol: str, cost: float, params={}):
|
2190
2231
|
"""
|
2191
2232
|
create a market sell order by providing the symbol and cost
|
2192
|
-
|
2233
|
+
|
2234
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-order
|
2235
|
+
|
2193
2236
|
:param str symbol: unified symbol of the market to create an order in
|
2194
2237
|
:param float cost: how much you want to trade in units of the quote currency
|
2195
2238
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2201,9 +2244,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2201
2244
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
2202
2245
|
"""
|
2203
2246
|
create a list of trade orders
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2247
|
+
|
2248
|
+
https://www.kucoin.com/docs/rest/spot-trading/orders/place-multiple-orders
|
2249
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/place-multiple-hf-orders
|
2250
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-place-multiple-hf-orders
|
2251
|
+
|
2207
2252
|
: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
|
2208
2253
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2209
2254
|
:param bool [params.hf]: False, # True for hf orders
|
@@ -2347,7 +2392,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2347
2392
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
2348
2393
|
"""
|
2349
2394
|
edit an order, kucoin currently only supports the modification of HF orders
|
2350
|
-
|
2395
|
+
|
2396
|
+
https://docs.kucoin.com/spot-hf/#modify-order
|
2397
|
+
|
2351
2398
|
:param str id: order id
|
2352
2399
|
:param str symbol: unified symbol of the market to create an order in
|
2353
2400
|
:param str type: not used
|
@@ -2387,14 +2434,16 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2387
2434
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
2388
2435
|
"""
|
2389
2436
|
cancels an open order
|
2390
|
-
|
2391
|
-
|
2392
|
-
|
2393
|
-
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2437
|
+
|
2438
|
+
https://docs.kucoin.com/spot#cancel-an-order
|
2439
|
+
https://docs.kucoin.com/spot#cancel-an-order-2
|
2440
|
+
https://docs.kucoin.com/spot#cancel-single-order-by-clientoid
|
2441
|
+
https://docs.kucoin.com/spot#cancel-single-order-by-clientoid-2
|
2442
|
+
https://docs.kucoin.com/spot-hf/#cancel-orders-by-orderid
|
2443
|
+
https://docs.kucoin.com/spot-hf/#cancel-order-by-clientoid
|
2444
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-orderid
|
2445
|
+
https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/sync-cancel-hf-order-by-clientoid
|
2446
|
+
|
2398
2447
|
:param str id: order id
|
2399
2448
|
:param str symbol: unified symbol of the market the order was made in
|
2400
2449
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2500,15 +2549,16 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2500
2549
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
2501
2550
|
"""
|
2502
2551
|
cancel all open orders
|
2503
|
-
|
2504
|
-
|
2505
|
-
|
2552
|
+
|
2553
|
+
https://docs.kucoin.com/spot#cancel-all-orders
|
2554
|
+
https://docs.kucoin.com/spot#cancel-orders
|
2555
|
+
https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
|
2556
|
+
|
2506
2557
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
2507
2558
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2508
2559
|
:param bool [params.stop]: *invalid for isolated margin* True if cancelling all stop orders
|
2509
2560
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
2510
2561
|
:param str [params.orderIds]: *stop orders only* Comma seperated order IDs
|
2511
|
-
:param bool [params.stop]: True if cancelling a stop order
|
2512
2562
|
:param bool [params.hf]: False, # True for hf order
|
2513
2563
|
:returns: Response from the exchange
|
2514
2564
|
"""
|
@@ -2540,17 +2590,18 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2540
2590
|
async def fetch_orders_by_status(self, status, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2541
2591
|
"""
|
2542
2592
|
fetch a list of orders
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2593
|
+
|
2594
|
+
https://docs.kucoin.com/spot#list-orders
|
2595
|
+
https://docs.kucoin.com/spot#list-stop-orders
|
2596
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
2597
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
2598
|
+
|
2547
2599
|
:param str status: *not used for stop orders* 'open' or 'closed'
|
2548
2600
|
:param str symbol: unified market symbol
|
2549
2601
|
:param int [since]: timestamp in ms of the earliest order
|
2550
2602
|
:param int [limit]: max number of orders to return
|
2551
2603
|
:param dict [params]: exchange specific params
|
2552
2604
|
:param int [params.until]: end time in ms
|
2553
|
-
:param bool [params.stop]: True if fetching stop orders
|
2554
2605
|
:param str [params.side]: buy or sell
|
2555
2606
|
:param str [params.type]: limit, market, limit_stop or market_stop
|
2556
2607
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
@@ -2651,10 +2702,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2651
2702
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2652
2703
|
"""
|
2653
2704
|
fetches information on multiple closed orders made by the user
|
2654
|
-
|
2655
|
-
|
2656
|
-
|
2657
|
-
|
2705
|
+
|
2706
|
+
https://docs.kucoin.com/spot#list-orders
|
2707
|
+
https://docs.kucoin.com/spot#list-stop-orders
|
2708
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
2709
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
2710
|
+
|
2658
2711
|
:param str symbol: unified market symbol of the market orders were made in
|
2659
2712
|
:param int [since]: the earliest time in ms to fetch orders for
|
2660
2713
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -2678,10 +2731,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2678
2731
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
2679
2732
|
"""
|
2680
2733
|
fetch all unfilled currently open orders
|
2681
|
-
|
2682
|
-
|
2683
|
-
|
2684
|
-
|
2734
|
+
|
2735
|
+
https://docs.kucoin.com/spot#list-orders
|
2736
|
+
https://docs.kucoin.com/spot#list-stop-orders
|
2737
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-active-hf-orders
|
2738
|
+
https://docs.kucoin.com/spot-hf/#obtain-list-of-filled-hf-orders
|
2739
|
+
|
2685
2740
|
:param str symbol: unified market symbol
|
2686
2741
|
:param int [since]: the earliest time in ms to fetch open orders for
|
2687
2742
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -2693,7 +2748,6 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2693
2748
|
:param str [params.tradeType]: TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
2694
2749
|
:param int [params.currentPage]: *stop orders only* current page
|
2695
2750
|
:param str [params.orderIds]: *stop orders only* comma seperated order ID list
|
2696
|
-
:param bool [params.stop]: True if fetching a stop order
|
2697
2751
|
:param bool [params.hf]: False, # True for hf order
|
2698
2752
|
: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)
|
2699
2753
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -2708,12 +2762,14 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2708
2762
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2709
2763
|
"""
|
2710
2764
|
fetch an order
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
|
2765
|
+
|
2766
|
+
https://docs.kucoin.com/spot#get-an-order
|
2767
|
+
https://docs.kucoin.com/spot#get-single-active-order-by-clientoid
|
2768
|
+
https://docs.kucoin.com/spot#get-single-order-info
|
2769
|
+
https://docs.kucoin.com/spot#get-single-order-by-clientoid
|
2770
|
+
https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
|
2771
|
+
https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
2772
|
+
|
2717
2773
|
:param str id: Order id
|
2718
2774
|
:param str symbol: not sent to exchange except for stop orders with clientOid, but used internally by CCXT to filter
|
2719
2775
|
:param dict [params]: exchange specific parameters
|
@@ -2943,8 +2999,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2943
2999
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2944
3000
|
"""
|
2945
3001
|
fetch all the trades made from a single order
|
2946
|
-
|
2947
|
-
|
3002
|
+
|
3003
|
+
https://docs.kucoin.com/#list-fills
|
3004
|
+
https://docs.kucoin.com/spot-hf/#transaction-details
|
3005
|
+
|
2948
3006
|
:param str id: order id
|
2949
3007
|
:param str symbol: unified market symbol
|
2950
3008
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -2959,8 +3017,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2959
3017
|
|
2960
3018
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2961
3019
|
"""
|
2962
|
-
|
2963
|
-
|
3020
|
+
|
3021
|
+
https://docs.kucoin.com/#list-fills
|
3022
|
+
https://docs.kucoin.com/spot-hf/#transaction-details
|
3023
|
+
|
2964
3024
|
fetch all trades made by the user
|
2965
3025
|
:param str symbol: unified market symbol
|
2966
3026
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -3058,7 +3118,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3058
3118
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
3059
3119
|
"""
|
3060
3120
|
get the list of most recent trades for a particular symbol
|
3061
|
-
|
3121
|
+
|
3122
|
+
https://www.kucoin.com/docs/rest/spot-trading/market-data/get-trade-histories
|
3123
|
+
|
3062
3124
|
:param str symbol: unified symbol of the market to fetch trades for
|
3063
3125
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
3064
3126
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -3223,7 +3285,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3223
3285
|
async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
3224
3286
|
"""
|
3225
3287
|
fetch the trading fees for a market
|
3226
|
-
|
3288
|
+
|
3289
|
+
https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-spot-margin-trade_hf
|
3290
|
+
|
3227
3291
|
:param str symbol: unified market symbol
|
3228
3292
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3229
3293
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -3261,7 +3325,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3261
3325
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
3262
3326
|
"""
|
3263
3327
|
make a withdrawal
|
3264
|
-
|
3328
|
+
|
3329
|
+
https://www.kucoin.com/docs/rest/funding/withdrawals/apply-withdraw-v3-
|
3330
|
+
|
3265
3331
|
:param str code: unified currency code
|
3266
3332
|
:param float amount: the amount to withdraw
|
3267
3333
|
:param str address: the address to withdraw to
|
@@ -3423,8 +3489,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3423
3489
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3424
3490
|
"""
|
3425
3491
|
fetch all deposits made to an account
|
3426
|
-
|
3427
|
-
|
3492
|
+
|
3493
|
+
https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-list
|
3494
|
+
https://www.kucoin.com/docs/rest/funding/deposit/get-v1-historical-deposits-list
|
3495
|
+
|
3428
3496
|
:param str code: unified currency code
|
3429
3497
|
:param int [since]: the earliest time in ms to fetch deposits for
|
3430
3498
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -3500,8 +3568,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3500
3568
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3501
3569
|
"""
|
3502
3570
|
fetch all withdrawals made from an account
|
3503
|
-
|
3504
|
-
|
3571
|
+
|
3572
|
+
https://www.kucoin.com/docs/rest/funding/withdrawals/get-withdrawals-list
|
3573
|
+
https://www.kucoin.com/docs/rest/funding/withdrawals/get-v1-historical-withdrawals-list
|
3574
|
+
|
3505
3575
|
:param str code: unified currency code
|
3506
3576
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
3507
3577
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -3588,9 +3658,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3588
3658
|
async def fetch_balance(self, params={}) -> Balances:
|
3589
3659
|
"""
|
3590
3660
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3591
|
-
|
3592
|
-
|
3593
|
-
|
3661
|
+
|
3662
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
|
3663
|
+
https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
|
3664
|
+
https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
|
3665
|
+
|
3594
3666
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3595
3667
|
:param dict [params.marginMode]: 'cross' or 'isolated', margin type for fetching margin balance
|
3596
3668
|
:param dict [params.type]: extra parameters specific to the exchange API endpoint
|
@@ -3752,9 +3824,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3752
3824
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
3753
3825
|
"""
|
3754
3826
|
transfer currency internally between wallets on the same account
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3827
|
+
|
3828
|
+
https://www.kucoin.com/docs/rest/funding/transfer/inner-transfer
|
3829
|
+
https://docs.kucoin.com/futures/#transfer-funds-to-kucoin-main-account-2
|
3830
|
+
https://docs.kucoin.com/spot-hf/#internal-funds-transfers-in-high-frequency-trading-accounts
|
3831
|
+
|
3758
3832
|
:param str code: unified currency code
|
3759
3833
|
:param float amount: amount to transfer
|
3760
3834
|
:param str fromAccount: account to transfer from
|
@@ -4021,9 +4095,11 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4021
4095
|
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
4022
4096
|
"""
|
4023
4097
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4098
|
+
|
4099
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-spot-margin
|
4100
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-trade_hf
|
4101
|
+
https://www.kucoin.com/docs/rest/account/basic-info/get-account-ledgers-margin_hf
|
4102
|
+
|
4027
4103
|
:param str [code]: unified currency code, default is None
|
4028
4104
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
4029
4105
|
:param int [limit]: max number of ledger entries to return, default is None
|
@@ -4157,10 +4233,12 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4157
4233
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
4158
4234
|
"""
|
4159
4235
|
fetch the interest owed by the user for borrowing currency for margin trading
|
4160
|
-
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4236
|
+
|
4237
|
+
https://docs.kucoin.com/#get-repay-record
|
4238
|
+
https://docs.kucoin.com/#query-isolated-margin-account-info
|
4239
|
+
|
4240
|
+
:param str [code]: unified currency code
|
4241
|
+
:param str [symbol]: unified market symbol, required for isolated margin
|
4164
4242
|
:param int [since]: the earliest time in ms to fetch borrrow interest for
|
4165
4243
|
:param int [limit]: the maximum number of structures to retrieve
|
4166
4244
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4169,14 +4247,19 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4169
4247
|
"""
|
4170
4248
|
await self.load_markets()
|
4171
4249
|
marginMode = None
|
4172
|
-
marginMode, params = self.handle_margin_mode_and_params('fetchBorrowInterest', params)
|
4173
|
-
if marginMode is None:
|
4174
|
-
marginMode = 'cross' # cross marginMode
|
4250
|
+
marginMode, params = self.handle_margin_mode_and_params('fetchBorrowInterest', params, 'cross')
|
4175
4251
|
request: dict = {}
|
4176
|
-
|
4252
|
+
currency = None
|
4177
4253
|
if code is not None:
|
4178
4254
|
currency = self.currency(code)
|
4179
|
-
|
4255
|
+
if marginMode == 'isolated':
|
4256
|
+
request['balanceCurrency'] = currency['id']
|
4257
|
+
else:
|
4258
|
+
request['quoteCurrency'] = currency['id']
|
4259
|
+
market = None
|
4260
|
+
if symbol is not None:
|
4261
|
+
market = self.market(symbol)
|
4262
|
+
response = None
|
4180
4263
|
if marginMode == 'isolated':
|
4181
4264
|
response = await self.privateGetIsolatedAccounts(self.extend(request, params))
|
4182
4265
|
else:
|
@@ -4247,7 +4330,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4247
4330
|
#
|
4248
4331
|
data = self.safe_dict(response, 'data', {})
|
4249
4332
|
assets = self.safe_list(data, 'assets', []) if (marginMode == 'isolated') else self.safe_list(data, 'accounts', [])
|
4250
|
-
|
4333
|
+
interest = self.parse_borrow_interests(assets, market)
|
4334
|
+
filteredByCurrency = self.filter_by_currency_since_limit(interest, code, since, limit)
|
4335
|
+
return self.filter_by_symbol_since_limit(filteredByCurrency, symbol, since, limit)
|
4251
4336
|
|
4252
4337
|
def parse_borrow_interest(self, info: dict, market: Market = None) -> BorrowInterest:
|
4253
4338
|
#
|
@@ -4326,7 +4411,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4326
4411
|
async def fetch_borrow_rate_histories(self, codes=None, since: Int = None, limit: Int = None, params={}):
|
4327
4412
|
"""
|
4328
4413
|
retrieves a history of a multiple currencies borrow interest rate at specific time slots, returns all currencies if no symbols passed, default is None
|
4329
|
-
|
4414
|
+
|
4415
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
|
4416
|
+
|
4330
4417
|
:param str[]|None codes: list of unified currency codes, default is None
|
4331
4418
|
:param int [since]: timestamp in ms of the earliest borrowRate, default is None
|
4332
4419
|
:param int [limit]: max number of borrow rate prices to return, default is None
|
@@ -4375,7 +4462,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4375
4462
|
async def fetch_borrow_rate_history(self, code: str, since: Int = None, limit: Int = None, params={}):
|
4376
4463
|
"""
|
4377
4464
|
retrieves a history of a currencies borrow interest rate at specific time slots
|
4378
|
-
|
4465
|
+
|
4466
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/get-cross-isolated-margin-interest-records
|
4467
|
+
|
4379
4468
|
:param str code: unified currency code
|
4380
4469
|
:param int [since]: timestamp for the earliest borrow rate
|
4381
4470
|
:param int [limit]: the maximum number of `borrow rate structures <https://docs.ccxt.com/#/?id=borrow-rate-structure>` to retrieve
|
@@ -4452,7 +4541,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4452
4541
|
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
4453
4542
|
"""
|
4454
4543
|
create a loan to borrow margin
|
4455
|
-
|
4544
|
+
|
4545
|
+
https://docs.kucoin.com/#1-margin-borrowing
|
4546
|
+
|
4456
4547
|
:param str code: unified currency code of the currency to borrow
|
4457
4548
|
:param float amount: the amount to borrow
|
4458
4549
|
:param dict [params]: extra parameters specific to the exchange API endpoints
|
@@ -4485,7 +4576,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4485
4576
|
async def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
4486
4577
|
"""
|
4487
4578
|
create a loan to borrow margin
|
4488
|
-
|
4579
|
+
|
4580
|
+
https://docs.kucoin.com/#1-margin-borrowing
|
4581
|
+
|
4489
4582
|
:param str symbol: unified market symbol, required for isolated margin
|
4490
4583
|
:param str code: unified currency code of the currency to borrow
|
4491
4584
|
:param float amount: the amount to borrow
|
@@ -4522,7 +4615,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4522
4615
|
async def repay_cross_margin(self, code: str, amount, params={}):
|
4523
4616
|
"""
|
4524
4617
|
repay borrowed margin and interest
|
4525
|
-
|
4618
|
+
|
4619
|
+
https://docs.kucoin.com/#2-repayment
|
4620
|
+
|
4526
4621
|
:param str code: unified currency code of the currency to repay
|
4527
4622
|
:param float amount: the amount to repay
|
4528
4623
|
:param dict [params]: extra parameters specific to the exchange API endpoints
|
@@ -4553,7 +4648,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4553
4648
|
async def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
4554
4649
|
"""
|
4555
4650
|
repay borrowed margin and interest
|
4556
|
-
|
4651
|
+
|
4652
|
+
https://docs.kucoin.com/#2-repayment
|
4653
|
+
|
4557
4654
|
:param str symbol: unified market symbol
|
4558
4655
|
:param str code: unified currency code of the currency to repay
|
4559
4656
|
:param float amount: the amount to repay
|
@@ -4607,7 +4704,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4607
4704
|
async def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
4608
4705
|
"""
|
4609
4706
|
fetch deposit and withdraw fees - *IMPORTANT* use fetchDepositWithdrawFee to get more in-depth info
|
4610
|
-
|
4707
|
+
|
4708
|
+
https://docs.kucoin.com/#get-currencies
|
4709
|
+
|
4611
4710
|
:param str[]|None codes: list of unified currency codes
|
4612
4711
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4613
4712
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -4638,7 +4737,10 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4638
4737
|
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
4639
4738
|
"""
|
4640
4739
|
set the level of leverage for a market
|
4641
|
-
|
4740
|
+
|
4741
|
+
https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/modify-leverage-multiplier
|
4742
|
+
|
4743
|
+
@param leverage
|
4642
4744
|
:param str symbol: unified market symbol
|
4643
4745
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4644
4746
|
:returns dict: response from the exchange
|