ccxt 4.3.29__py2.py3-none-any.whl → 4.3.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/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/base/ws/aiohttp_client.py +1 -0
- ccxt/async_support/base/ws/future.py +27 -29
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +22 -22
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +424 -448
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +80 -40
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +39 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +22 -22
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +424 -448
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +19 -19
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +80 -40
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/RECORD +260 -260
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/kucoinfutures.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.kucoin import kucoin
|
7
7
|
from ccxt.abstract.kucoinfutures import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Currency, Int, LeverageTier, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import AuthenticationError
|
11
11
|
from ccxt.base.errors import PermissionDenied
|
@@ -568,7 +568,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
568
568
|
market = self.market(symbol)
|
569
569
|
marketId = market['id']
|
570
570
|
parsedTimeframe = self.safe_integer(self.timeframes, timeframe)
|
571
|
-
request = {
|
571
|
+
request: dict = {
|
572
572
|
'symbol': marketId,
|
573
573
|
}
|
574
574
|
if parsedTimeframe is not None:
|
@@ -632,7 +632,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
632
632
|
self.load_markets()
|
633
633
|
currency = self.currency(code)
|
634
634
|
currencyId = currency['id']
|
635
|
-
request = {
|
635
|
+
request: dict = {
|
636
636
|
'currency': currencyId, # Currency,including XBT,USDT
|
637
637
|
}
|
638
638
|
response = self.futuresPrivateGetDepositAddress(self.extend(request, params))
|
@@ -672,7 +672,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
672
672
|
if level != 2 and level is not None:
|
673
673
|
raise BadRequest(self.id + ' fetchOrderBook() can only return level 2')
|
674
674
|
market = self.market(symbol)
|
675
|
-
request = {
|
675
|
+
request: dict = {
|
676
676
|
'symbol': market['id'],
|
677
677
|
}
|
678
678
|
if limit is not None:
|
@@ -717,7 +717,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
717
717
|
"""
|
718
718
|
self.load_markets()
|
719
719
|
market = self.market(symbol)
|
720
|
-
request = {
|
720
|
+
request: dict = {
|
721
721
|
'symbol': market['id'],
|
722
722
|
}
|
723
723
|
response = self.futuresPublicGetTicker(self.extend(request, params))
|
@@ -938,7 +938,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
938
938
|
raise ArgumentsRequired(self.id + ' fetchFundingHistory() requires a symbol argument')
|
939
939
|
self.load_markets()
|
940
940
|
market = self.market(symbol)
|
941
|
-
request = {
|
941
|
+
request: dict = {
|
942
942
|
'symbol': market['id'],
|
943
943
|
}
|
944
944
|
if since is not None:
|
@@ -1000,7 +1000,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1000
1000
|
"""
|
1001
1001
|
self.load_markets()
|
1002
1002
|
market = self.market(symbol)
|
1003
|
-
request = {
|
1003
|
+
request: dict = {
|
1004
1004
|
'symbol': market['id'],
|
1005
1005
|
}
|
1006
1006
|
response = self.futuresPrivateGetPosition(self.extend(request, params))
|
@@ -1123,7 +1123,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1123
1123
|
self.load_markets()
|
1124
1124
|
if limit is None:
|
1125
1125
|
limit = 200
|
1126
|
-
request = {
|
1126
|
+
request: dict = {
|
1127
1127
|
'limit': limit,
|
1128
1128
|
}
|
1129
1129
|
if since is not None:
|
@@ -1175,7 +1175,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1175
1175
|
items = self.safe_list(data, 'items', [])
|
1176
1176
|
return self.parse_positions(items, symbols)
|
1177
1177
|
|
1178
|
-
def parse_position(self, position, market: Market = None):
|
1178
|
+
def parse_position(self, position: dict, market: Market = None):
|
1179
1179
|
#
|
1180
1180
|
# {
|
1181
1181
|
# "code": "200000",
|
@@ -1403,7 +1403,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1403
1403
|
if amount < 1:
|
1404
1404
|
raise InvalidOrder(self.id + ' createOrder() minimum contract order amount is 1')
|
1405
1405
|
preciseAmount = int(self.amount_to_precision(symbol, amount))
|
1406
|
-
request = {
|
1406
|
+
request: dict = {
|
1407
1407
|
'clientOid': clientOrderId,
|
1408
1408
|
'side': side,
|
1409
1409
|
'symbol': market['id'],
|
@@ -1412,7 +1412,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1412
1412
|
'leverage': 1,
|
1413
1413
|
}
|
1414
1414
|
triggerPrice, stopLossPrice, takeProfitPrice = self.handle_trigger_prices(params)
|
1415
|
-
triggerPriceTypes = {
|
1415
|
+
triggerPriceTypes: dict = {
|
1416
1416
|
'mark': 'MP',
|
1417
1417
|
'last': 'TP',
|
1418
1418
|
'index': 'IP',
|
@@ -1470,7 +1470,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1470
1470
|
self.load_markets()
|
1471
1471
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
1472
1472
|
params = self.omit(params, ['clientOrderId'])
|
1473
|
-
request = {}
|
1473
|
+
request: dict = {}
|
1474
1474
|
response = None
|
1475
1475
|
if clientOrderId is not None:
|
1476
1476
|
if symbol is None:
|
@@ -1505,7 +1505,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1505
1505
|
:returns: Response from the exchange
|
1506
1506
|
"""
|
1507
1507
|
self.load_markets()
|
1508
|
-
request = {}
|
1508
|
+
request: dict = {}
|
1509
1509
|
if symbol is not None:
|
1510
1510
|
request['symbol'] = self.market_id(symbol)
|
1511
1511
|
stop = self.safe_value_2(params, 'stop', 'trigger')
|
@@ -1539,7 +1539,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1539
1539
|
self.load_markets()
|
1540
1540
|
market = self.market(symbol)
|
1541
1541
|
uuid = self.uuid()
|
1542
|
-
request = {
|
1542
|
+
request: dict = {
|
1543
1543
|
'symbol': market['id'],
|
1544
1544
|
'margin': self.amount_to_precision(symbol, amount),
|
1545
1545
|
'bizNo': uuid,
|
@@ -1695,7 +1695,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1695
1695
|
status = 'done'
|
1696
1696
|
elif status == 'open':
|
1697
1697
|
status = 'active'
|
1698
|
-
request = {}
|
1698
|
+
request: dict = {}
|
1699
1699
|
if not stop:
|
1700
1700
|
request['status'] = status
|
1701
1701
|
elif status != 'active':
|
@@ -1821,7 +1821,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1821
1821
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1822
1822
|
"""
|
1823
1823
|
self.load_markets()
|
1824
|
-
request = {}
|
1824
|
+
request: dict = {}
|
1825
1825
|
response = None
|
1826
1826
|
if id is None:
|
1827
1827
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
@@ -1880,7 +1880,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
1880
1880
|
responseData = self.safe_dict(response, 'data')
|
1881
1881
|
return self.parse_order(responseData, market)
|
1882
1882
|
|
1883
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1883
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1884
1884
|
#
|
1885
1885
|
# fetchOrder, fetchOrdersByStatus
|
1886
1886
|
#
|
@@ -2021,7 +2021,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2021
2021
|
"""
|
2022
2022
|
self.load_markets()
|
2023
2023
|
market = self.market(symbol)
|
2024
|
-
request = {
|
2024
|
+
request: dict = {
|
2025
2025
|
'symbol': market['id'],
|
2026
2026
|
}
|
2027
2027
|
response = self.futuresPublicGetFundingRateSymbolCurrent(self.extend(request, params))
|
@@ -2061,7 +2061,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2061
2061
|
}
|
2062
2062
|
|
2063
2063
|
def parse_balance(self, response) -> Balances:
|
2064
|
-
result = {
|
2064
|
+
result: dict = {
|
2065
2065
|
'info': response,
|
2066
2066
|
'timestamp': None,
|
2067
2067
|
'datetime': None,
|
@@ -2089,7 +2089,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2089
2089
|
defaultCode = self.safe_string(fetchBalanceOptions, 'code', defaultCode)
|
2090
2090
|
code = self.safe_string(params, 'code', defaultCode)
|
2091
2091
|
currency = self.currency(code)
|
2092
|
-
request = {
|
2092
|
+
request: dict = {
|
2093
2093
|
'currency': currency['id'],
|
2094
2094
|
}
|
2095
2095
|
response = self.futuresPrivateGetAccountOverview(self.extend(request, params))
|
@@ -2125,7 +2125,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2125
2125
|
self.load_markets()
|
2126
2126
|
currency = self.currency(code)
|
2127
2127
|
amountToPrecision = self.currency_to_precision(code, amount)
|
2128
|
-
request = {
|
2128
|
+
request: dict = {
|
2129
2129
|
'currency': self.safe_string(currency, 'id'), # Currency,including XBT,USDT
|
2130
2130
|
'amount': amountToPrecision,
|
2131
2131
|
}
|
@@ -2168,7 +2168,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2168
2168
|
}
|
2169
2169
|
|
2170
2170
|
def parse_transfer_status(self, status: Str) -> Str:
|
2171
|
-
statuses = {
|
2171
|
+
statuses: dict = {
|
2172
2172
|
'PROCESSING': 'pending',
|
2173
2173
|
}
|
2174
2174
|
return self.safe_string(statuses, status, status)
|
@@ -2190,7 +2190,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2190
2190
|
paginate, params = self.handle_option_and_params(params, 'fetchMyTrades', 'paginate')
|
2191
2191
|
if paginate:
|
2192
2192
|
return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
|
2193
|
-
request = {
|
2193
|
+
request: dict = {
|
2194
2194
|
# orderId(str) [optional] Fills for a specific order(other parameters can be ignored if specified)
|
2195
2195
|
# symbol(str) [optional] Symbol of the contract
|
2196
2196
|
# side(str) [optional] buy or sell
|
@@ -2255,7 +2255,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2255
2255
|
"""
|
2256
2256
|
self.load_markets()
|
2257
2257
|
market = self.market(symbol)
|
2258
|
-
request = {
|
2258
|
+
request: dict = {
|
2259
2259
|
'symbol': market['id'],
|
2260
2260
|
}
|
2261
2261
|
response = self.futuresPublicGetTradeHistory(self.extend(request, params))
|
@@ -2279,7 +2279,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2279
2279
|
trades = self.safe_list(response, 'data', [])
|
2280
2280
|
return self.parse_trades(trades, market, since, limit)
|
2281
2281
|
|
2282
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
2282
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
2283
2283
|
#
|
2284
2284
|
# fetchTrades(public)
|
2285
2285
|
#
|
@@ -2417,7 +2417,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2417
2417
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2418
2418
|
"""
|
2419
2419
|
self.load_markets()
|
2420
|
-
request = {}
|
2420
|
+
request: dict = {}
|
2421
2421
|
currency = None
|
2422
2422
|
if code is not None:
|
2423
2423
|
currency = self.currency(code)
|
@@ -2467,7 +2467,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2467
2467
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2468
2468
|
"""
|
2469
2469
|
self.load_markets()
|
2470
|
-
request = {}
|
2470
|
+
request: dict = {}
|
2471
2471
|
currency = None
|
2472
2472
|
if code is not None:
|
2473
2473
|
currency = self.currency(code)
|
@@ -2507,7 +2507,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2507
2507
|
responseData = response['data']['items']
|
2508
2508
|
return self.parse_transactions(responseData, currency, since, limit, {'type': 'withdrawal'})
|
2509
2509
|
|
2510
|
-
def fetch_market_leverage_tiers(self, symbol: str, params={}):
|
2510
|
+
def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
2511
2511
|
"""
|
2512
2512
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
2513
2513
|
:see: https://www.kucoin.com/docs/rest/futures-trading/risk-limit/get-futures-risk-limit-level
|
@@ -2519,7 +2519,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2519
2519
|
market = self.market(symbol)
|
2520
2520
|
if not market['contract']:
|
2521
2521
|
raise BadRequest(self.id + ' fetchMarketLeverageTiers() supports contract markets only')
|
2522
|
-
request = {
|
2522
|
+
request: dict = {
|
2523
2523
|
'symbol': market['id'],
|
2524
2524
|
}
|
2525
2525
|
response = self.futuresPublicGetContractsRiskLimitSymbol(self.extend(request, params))
|
@@ -2543,7 +2543,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2543
2543
|
data = self.safe_value(response, 'data')
|
2544
2544
|
return self.parse_market_leverage_tiers(data, market)
|
2545
2545
|
|
2546
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
2546
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
2547
2547
|
"""
|
2548
2548
|
* @ignore
|
2549
2549
|
:param dict info: Exchange market response for 1 market
|
@@ -2589,7 +2589,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2589
2589
|
raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
|
2590
2590
|
self.load_markets()
|
2591
2591
|
market = self.market(symbol)
|
2592
|
-
request = {
|
2592
|
+
request: dict = {
|
2593
2593
|
'symbol': market['id'],
|
2594
2594
|
'from': 0,
|
2595
2595
|
'to': self.milliseconds(),
|
@@ -2648,7 +2648,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2648
2648
|
params = self.omit(params, ['test', 'clientOrderId'])
|
2649
2649
|
if clientOrderId is None:
|
2650
2650
|
clientOrderId = self.number_to_string(self.nonce())
|
2651
|
-
request = {
|
2651
|
+
request: dict = {
|
2652
2652
|
'symbol': market['id'],
|
2653
2653
|
'closeOrder': True,
|
2654
2654
|
'clientOid': clientOrderId,
|
@@ -2671,7 +2671,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
2671
2671
|
"""
|
2672
2672
|
self.load_markets()
|
2673
2673
|
market = self.market(symbol)
|
2674
|
-
request = {
|
2674
|
+
request: dict = {
|
2675
2675
|
'symbols': market['id'],
|
2676
2676
|
}
|
2677
2677
|
response = self.privateGetTradeFees(self.extend(request, params))
|
ccxt/kuna.py
CHANGED
@@ -462,13 +462,13 @@ class kuna(Exchange, ImplicitAPI):
|
|
462
462
|
|
463
463
|
def parse_currencies(self, currencies, params={}):
|
464
464
|
currencies = self.to_array(currencies)
|
465
|
-
result = {}
|
465
|
+
result: dict = {}
|
466
466
|
for i in range(0, len(currencies)):
|
467
467
|
currency = self.parse_currency(currencies[i])
|
468
468
|
result[currency['code']] = currency
|
469
469
|
return result
|
470
470
|
|
471
|
-
def parse_currency(self, currency):
|
471
|
+
def parse_currency(self, currency: dict):
|
472
472
|
#
|
473
473
|
# {
|
474
474
|
# "code": "BTC",
|
@@ -618,7 +618,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
618
618
|
"""
|
619
619
|
self.load_markets()
|
620
620
|
market = self.market(symbol)
|
621
|
-
request = {
|
621
|
+
request: dict = {
|
622
622
|
'pairs': market['id'],
|
623
623
|
}
|
624
624
|
if limit is not None:
|
@@ -704,7 +704,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
704
704
|
raise ArgumentsRequired(self.id + ' fetchTickers() requires a symbols argument')
|
705
705
|
symbols = self.market_symbols(symbols)
|
706
706
|
marketIds = self.market_ids(symbols)
|
707
|
-
request = {
|
707
|
+
request: dict = {
|
708
708
|
'pairs': ','.join(marketIds),
|
709
709
|
}
|
710
710
|
response = self.v4PublicGetMarketsPublicTickersPairsPairs(self.extend(request, params))
|
@@ -741,7 +741,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
741
741
|
"""
|
742
742
|
self.load_markets()
|
743
743
|
market = self.market(symbol)
|
744
|
-
request = {
|
744
|
+
request: dict = {
|
745
745
|
'pairs': market['id'],
|
746
746
|
}
|
747
747
|
response = self.v4PublicGetMarketsPublicTickersPairsPairs(self.extend(request, params))
|
@@ -792,7 +792,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
792
792
|
"""
|
793
793
|
self.load_markets()
|
794
794
|
market = self.market(symbol)
|
795
|
-
request = {
|
795
|
+
request: dict = {
|
796
796
|
'pairs': market['id'],
|
797
797
|
}
|
798
798
|
if limit is not None:
|
@@ -817,7 +817,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
817
817
|
data = self.safe_list(response, 'data', [])
|
818
818
|
return self.parse_trades(data, market, since, limit)
|
819
819
|
|
820
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
820
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
821
821
|
#
|
822
822
|
# fetchTrades(public)
|
823
823
|
#
|
@@ -885,7 +885,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
885
885
|
# ...
|
886
886
|
# ]
|
887
887
|
#
|
888
|
-
result = {'info': response}
|
888
|
+
result: dict = {'info': response}
|
889
889
|
for i in range(0, len(response)):
|
890
890
|
balance = response[i]
|
891
891
|
currencyId = self.safe_string(balance, 'currency')
|
@@ -938,7 +938,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
938
938
|
triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
|
939
939
|
params = self.omit(params, ['triggerPrice', 'stopPrice'])
|
940
940
|
capitalizedType = self.capitalize(type)
|
941
|
-
request = {
|
941
|
+
request: dict = {
|
942
942
|
'pair': market['id'],
|
943
943
|
'orderSide': 'Bid' if (side == 'buy') else 'Ask',
|
944
944
|
'quantity': self.number_to_string(amount),
|
@@ -980,7 +980,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
980
980
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
981
981
|
"""
|
982
982
|
self.load_markets()
|
983
|
-
request = {
|
983
|
+
request: dict = {
|
984
984
|
'orderId': id,
|
985
985
|
}
|
986
986
|
response = self.v4PrivatePostOrderPrivateCancel(self.extend(request, params))
|
@@ -1008,7 +1008,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1008
1008
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1009
1009
|
"""
|
1010
1010
|
self.load_markets()
|
1011
|
-
request = {
|
1011
|
+
request: dict = {
|
1012
1012
|
'orderIds': ids,
|
1013
1013
|
}
|
1014
1014
|
response = self.v4PrivatePostOrderPrivateCancelMulti(self.extend(request, params))
|
@@ -1026,8 +1026,8 @@ class kuna(Exchange, ImplicitAPI):
|
|
1026
1026
|
data = self.safe_list(response, 'data', [])
|
1027
1027
|
return self.parse_orders(data)
|
1028
1028
|
|
1029
|
-
def parse_order_status(self, status):
|
1030
|
-
statuses = {
|
1029
|
+
def parse_order_status(self, status: Str):
|
1030
|
+
statuses: dict = {
|
1031
1031
|
'Canceled': 'canceled',
|
1032
1032
|
'Closed': 'filled',
|
1033
1033
|
'Pending': 'open',
|
@@ -1038,7 +1038,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1038
1038
|
}
|
1039
1039
|
return self.safe_string(statuses, status, status)
|
1040
1040
|
|
1041
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1041
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1042
1042
|
#
|
1043
1043
|
# createOrder, fetchOrder, fetchOpenOrders, fetchOrdersByStatus
|
1044
1044
|
#
|
@@ -1126,7 +1126,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1126
1126
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1127
1127
|
"""
|
1128
1128
|
self.load_markets()
|
1129
|
-
request = {
|
1129
|
+
request: dict = {
|
1130
1130
|
'id': id,
|
1131
1131
|
'withTrades': True,
|
1132
1132
|
}
|
@@ -1186,7 +1186,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1186
1186
|
until = self.safe_integer(params, 'until')
|
1187
1187
|
params = self.omit(params, ['until'])
|
1188
1188
|
market = None
|
1189
|
-
request = {
|
1189
|
+
request: dict = {
|
1190
1190
|
}
|
1191
1191
|
if symbol is not None:
|
1192
1192
|
market = self.market(symbol)
|
@@ -1259,7 +1259,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1259
1259
|
until = self.safe_integer(params, 'until')
|
1260
1260
|
params = self.omit(params, ['until'])
|
1261
1261
|
market = None
|
1262
|
-
request = {
|
1262
|
+
request: dict = {
|
1263
1263
|
'status': self.capitalize(status),
|
1264
1264
|
}
|
1265
1265
|
if symbol is not None:
|
@@ -1313,7 +1313,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1313
1313
|
"""
|
1314
1314
|
self.load_markets()
|
1315
1315
|
market = None
|
1316
|
-
request = {}
|
1316
|
+
request: dict = {}
|
1317
1317
|
if symbol is not None:
|
1318
1318
|
market = self.market(symbol)
|
1319
1319
|
request['pair'] = market['id']
|
@@ -1367,7 +1367,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1367
1367
|
else:
|
1368
1368
|
chain = currency['id'].upper()
|
1369
1369
|
networkId = self.network_code_to_id(chain)
|
1370
|
-
request = {
|
1370
|
+
request: dict = {
|
1371
1371
|
'currency': networkId,
|
1372
1372
|
'amount': amount,
|
1373
1373
|
'address': address,
|
@@ -1411,7 +1411,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1411
1411
|
currency = None
|
1412
1412
|
if code is not None:
|
1413
1413
|
currency = self.currency(code)
|
1414
|
-
request = {}
|
1414
|
+
request: dict = {}
|
1415
1415
|
if code is not None:
|
1416
1416
|
request['currency'] = code
|
1417
1417
|
if since is not None:
|
@@ -1458,7 +1458,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1458
1458
|
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
1459
1459
|
"""
|
1460
1460
|
self.load_markets()
|
1461
|
-
request = {
|
1461
|
+
request: dict = {
|
1462
1462
|
'withdrawId': id,
|
1463
1463
|
}
|
1464
1464
|
response = self.v4PrivateGetWithdrawPrivateDetailsWithdrawId(self.extend(request, params))
|
@@ -1496,7 +1496,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1496
1496
|
"""
|
1497
1497
|
self.load_markets()
|
1498
1498
|
currency = self.currency(code)
|
1499
|
-
request = {
|
1499
|
+
request: dict = {
|
1500
1500
|
'source': currency['id'],
|
1501
1501
|
}
|
1502
1502
|
response = self.v4PrivatePostDepositPrivateCryptoGenerateAddress(self.extend(request, params))
|
@@ -1522,7 +1522,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1522
1522
|
"""
|
1523
1523
|
self.load_markets()
|
1524
1524
|
currency = self.currency(code)
|
1525
|
-
request = {
|
1525
|
+
request: dict = {
|
1526
1526
|
'source': currency['id'].upper(),
|
1527
1527
|
}
|
1528
1528
|
response = self.v4PrivateGetDepositPrivateCryptoAddress(self.extend(request, params))
|
@@ -1556,7 +1556,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1556
1556
|
}
|
1557
1557
|
|
1558
1558
|
def parse_transaction_status(self, status):
|
1559
|
-
statuses = {
|
1559
|
+
statuses: dict = {
|
1560
1560
|
'Created': 'pending',
|
1561
1561
|
'Canceled': 'canceled',
|
1562
1562
|
'PartiallyProcessed': 'pending',
|
@@ -1592,7 +1592,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1592
1592
|
currency = None
|
1593
1593
|
if code is not None:
|
1594
1594
|
currency = self.currency(code)
|
1595
|
-
request = {}
|
1595
|
+
request: dict = {}
|
1596
1596
|
if code is not None:
|
1597
1597
|
request['currency'] = code
|
1598
1598
|
if since is not None:
|
@@ -1642,7 +1642,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1642
1642
|
currency = None
|
1643
1643
|
if code is not None:
|
1644
1644
|
currency = self.currency(code)
|
1645
|
-
request = {
|
1645
|
+
request: dict = {
|
1646
1646
|
'depositId': id,
|
1647
1647
|
}
|
1648
1648
|
response = self.v4PrivateGetDepositPrivateDetailsDepositId(self.extend(request, params))
|
@@ -1670,7 +1670,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
1670
1670
|
data = self.safe_dict(response, 'data', {})
|
1671
1671
|
return self.parse_transaction(data, currency)
|
1672
1672
|
|
1673
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1673
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1674
1674
|
#
|
1675
1675
|
# {
|
1676
1676
|
# "id": "a201cb3c-5830-57ac-ad2c-f6a588dd55eb", # Unique ID of deposit
|