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/gate.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.gate import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -1100,7 +1100,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1100
1100
|
futureSettlementCurrencies = self.get_settlement_currencies('future', 'fetchMarkets')
|
1101
1101
|
for c in range(0, len(swapSettlementCurrencies)):
|
1102
1102
|
settleId = swapSettlementCurrencies[c]
|
1103
|
-
request = {
|
1103
|
+
request: dict = {
|
1104
1104
|
'settle': settleId,
|
1105
1105
|
}
|
1106
1106
|
response = self.publicFuturesGetSettleContracts(self.extend(request, params))
|
@@ -1109,7 +1109,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1109
1109
|
result.append(parsedMarket)
|
1110
1110
|
for c in range(0, len(futureSettlementCurrencies)):
|
1111
1111
|
settleId = futureSettlementCurrencies[c]
|
1112
|
-
request = {
|
1112
|
+
request: dict = {
|
1113
1113
|
'settle': settleId,
|
1114
1114
|
}
|
1115
1115
|
response = self.publicDeliveryGetSettleContracts(self.extend(request, params))
|
@@ -1435,7 +1435,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1435
1435
|
:returns: the api request object, and the new params object with non-needed parameters removed
|
1436
1436
|
"""
|
1437
1437
|
# * Do not call for multi spot order methods like cancelAllOrders and fetchOpenOrders. Use multiOrderSpotPrepareRequest instead
|
1438
|
-
request = {}
|
1438
|
+
request: dict = {}
|
1439
1439
|
if market is not None:
|
1440
1440
|
if market['contract']:
|
1441
1441
|
request['contract'] = market['id']
|
@@ -1463,7 +1463,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1463
1463
|
:returns: the api request object, and the new params object with non-needed parameters removed
|
1464
1464
|
"""
|
1465
1465
|
marginMode, query = self.get_margin_mode(stop, params)
|
1466
|
-
request = {}
|
1466
|
+
request: dict = {}
|
1467
1467
|
if not stop:
|
1468
1468
|
if market is None:
|
1469
1469
|
raise ArgumentsRequired(self.id + ' spotOrderPrepareRequest() requires a market argument for non-stop orders')
|
@@ -1481,7 +1481,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1481
1481
|
:returns: the api request object, and the new params object with non-needed parameters removed
|
1482
1482
|
"""
|
1483
1483
|
marginMode, query = self.get_margin_mode(stop, params)
|
1484
|
-
request = {
|
1484
|
+
request: dict = {
|
1485
1485
|
'account': marginMode,
|
1486
1486
|
}
|
1487
1487
|
if market is not None:
|
@@ -1555,7 +1555,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1555
1555
|
# "chain":"ETH"
|
1556
1556
|
# }
|
1557
1557
|
#
|
1558
|
-
result = {}
|
1558
|
+
result: dict = {}
|
1559
1559
|
for i in range(0, len(response)):
|
1560
1560
|
entry = response[i]
|
1561
1561
|
currencyId = self.safe_string(entry, 'currency')
|
@@ -1825,14 +1825,14 @@ class gate(Exchange, ImplicitAPI):
|
|
1825
1825
|
def fetch_network_deposit_address(self, code: str, params={}):
|
1826
1826
|
self.load_markets()
|
1827
1827
|
currency = self.currency(code)
|
1828
|
-
request = {
|
1828
|
+
request: dict = {
|
1829
1829
|
'currency': currency['id'], # todo: currencies have network-junctions
|
1830
1830
|
}
|
1831
1831
|
response = self.privateWalletGetDepositAddress(self.extend(request, params))
|
1832
1832
|
addresses = self.safe_value(response, 'multichain_addresses')
|
1833
1833
|
currencyId = self.safe_string(response, 'currency')
|
1834
1834
|
code = self.safe_currency_code(currencyId)
|
1835
|
-
result = {}
|
1835
|
+
result: dict = {}
|
1836
1836
|
for i in range(0, len(addresses)):
|
1837
1837
|
entry = addresses[i]
|
1838
1838
|
#
|
@@ -1872,7 +1872,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1872
1872
|
currency = self.currency(code)
|
1873
1873
|
rawNetwork = self.safe_string_upper(params, 'network')
|
1874
1874
|
params = self.omit(params, 'network')
|
1875
|
-
request = {
|
1875
|
+
request: dict = {
|
1876
1876
|
'currency': currency['id'], # todo: currencies have network-junctions
|
1877
1877
|
}
|
1878
1878
|
response = self.privateWalletGetDepositAddress(self.extend(request, params))
|
@@ -1941,7 +1941,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1941
1941
|
"""
|
1942
1942
|
self.load_markets()
|
1943
1943
|
market = self.market(symbol)
|
1944
|
-
request = {
|
1944
|
+
request: dict = {
|
1945
1945
|
'currency_pair': market['id'],
|
1946
1946
|
}
|
1947
1947
|
response = self.privateWalletGetFee(self.extend(request, params))
|
@@ -1987,7 +1987,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1987
1987
|
return self.parse_trading_fees(response)
|
1988
1988
|
|
1989
1989
|
def parse_trading_fees(self, response):
|
1990
|
-
result = {}
|
1990
|
+
result: dict = {}
|
1991
1991
|
for i in range(0, len(self.symbols)):
|
1992
1992
|
symbol = self.symbols[i]
|
1993
1993
|
market = self.market(symbol)
|
@@ -2024,7 +2024,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2024
2024
|
'tierBased': None,
|
2025
2025
|
}
|
2026
2026
|
|
2027
|
-
def fetch_transaction_fees(self, codes:
|
2027
|
+
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
2028
2028
|
"""
|
2029
2029
|
* @deprecated
|
2030
2030
|
please use fetchDepositWithdrawFees instead
|
@@ -2052,7 +2052,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2052
2052
|
# }
|
2053
2053
|
# }
|
2054
2054
|
#
|
2055
|
-
result = {}
|
2055
|
+
result: dict = {}
|
2056
2056
|
withdrawFees = {}
|
2057
2057
|
for i in range(0, len(response)):
|
2058
2058
|
withdrawFees = {}
|
@@ -2126,7 +2126,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2126
2126
|
# }
|
2127
2127
|
#
|
2128
2128
|
withdrawFixOnChains = self.safe_value(fee, 'withdraw_fix_on_chains')
|
2129
|
-
result = {
|
2129
|
+
result: dict = {
|
2130
2130
|
'info': fee,
|
2131
2131
|
'withdraw': {
|
2132
2132
|
'fee': self.safe_number(fee, 'withdraw_fix'),
|
@@ -2247,7 +2247,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2247
2247
|
self.load_markets()
|
2248
2248
|
market = self.market(symbol)
|
2249
2249
|
#
|
2250
|
-
# request = {
|
2250
|
+
# request: Dict = {
|
2251
2251
|
# 'currency_pair': market['id'],
|
2252
2252
|
# 'interval': '0', # depth, 0 means no aggregation is applied, default to 0
|
2253
2253
|
# 'limit': limit, # maximum number of order depth data in asks or bids
|
@@ -2719,7 +2719,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2719
2719
|
# "orders_limit": 10
|
2720
2720
|
# }
|
2721
2721
|
#
|
2722
|
-
result = {
|
2722
|
+
result: dict = {
|
2723
2723
|
'info': response,
|
2724
2724
|
}
|
2725
2725
|
isolated = marginMode == 'margin'
|
@@ -2745,7 +2745,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2745
2745
|
quote = self.safe_value(entry, 'quote', {})
|
2746
2746
|
baseCode = self.safe_currency_code(self.safe_string(base, 'currency'))
|
2747
2747
|
quoteCode = self.safe_currency_code(self.safe_string(quote, 'currency'))
|
2748
|
-
subResult = {}
|
2748
|
+
subResult: dict = {}
|
2749
2749
|
subResult[baseCode] = self.parse_balance_helper(base)
|
2750
2750
|
subResult[quoteCode] = self.parse_balance_helper(quote)
|
2751
2751
|
result[symbolInner] = self.safe_balance(subResult)
|
@@ -2781,7 +2781,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2781
2781
|
if market['option']:
|
2782
2782
|
return self.fetch_option_ohlcv(symbol, timeframe, since, limit, params)
|
2783
2783
|
price = self.safe_string(params, 'price')
|
2784
|
-
request = {}
|
2784
|
+
request: dict = {}
|
2785
2785
|
request, params = self.prepare_request(market, None, params)
|
2786
2786
|
request['interval'] = self.safe_string(self.timeframes, timeframe, timeframe)
|
2787
2787
|
maxLimit = 1999 if market['contract'] else 1000
|
@@ -2825,7 +2825,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2825
2825
|
# separated option logic because the from, to and limit parameters weren't functioning
|
2826
2826
|
self.load_markets()
|
2827
2827
|
market = self.market(symbol)
|
2828
|
-
request = {}
|
2828
|
+
request: dict = {}
|
2829
2829
|
request, params = self.prepare_request(market, None, params)
|
2830
2830
|
request['interval'] = self.safe_string(self.timeframes, timeframe, timeframe)
|
2831
2831
|
response = self.publicOptionsGetCandlesticks(self.extend(request, params))
|
@@ -2940,7 +2940,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2940
2940
|
#
|
2941
2941
|
# spot
|
2942
2942
|
#
|
2943
|
-
# request = {
|
2943
|
+
# request: Dict = {
|
2944
2944
|
# 'currency_pair': market['id'],
|
2945
2945
|
# 'limit': limit, # maximum number of records to be returned in a single list
|
2946
2946
|
# 'last_id': 'id', # specify list staring point using the id of last record in previous list-query results
|
@@ -2949,7 +2949,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2949
2949
|
#
|
2950
2950
|
# swap, future
|
2951
2951
|
#
|
2952
|
-
# request = {
|
2952
|
+
# request: Dict = {
|
2953
2953
|
# 'settle': market['settleId'],
|
2954
2954
|
# 'contract': market['id'],
|
2955
2955
|
# 'limit': limit, # maximum number of records to be returned in a single list
|
@@ -3089,7 +3089,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3089
3089
|
return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
|
3090
3090
|
type = None
|
3091
3091
|
marginMode = None
|
3092
|
-
request = {}
|
3092
|
+
request: dict = {}
|
3093
3093
|
market = self.market(symbol) if (symbol is not None) else None
|
3094
3094
|
until = self.safe_integer(params, 'until')
|
3095
3095
|
params = self.omit(params, ['until'])
|
@@ -3187,7 +3187,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3187
3187
|
#
|
3188
3188
|
return self.parse_trades(response, market, since, limit)
|
3189
3189
|
|
3190
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
3190
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
3191
3191
|
#
|
3192
3192
|
# public
|
3193
3193
|
#
|
@@ -3346,7 +3346,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3346
3346
|
paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
|
3347
3347
|
if paginate:
|
3348
3348
|
return self.fetch_paginated_call_dynamic('fetchDeposits', code, since, limit, params)
|
3349
|
-
request = {}
|
3349
|
+
request: dict = {}
|
3350
3350
|
currency = None
|
3351
3351
|
if code is not None:
|
3352
3352
|
currency = self.currency(code)
|
@@ -3378,7 +3378,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3378
3378
|
paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
|
3379
3379
|
if paginate:
|
3380
3380
|
return self.fetch_paginated_call_dynamic('fetchWithdrawals', code, since, limit, params)
|
3381
|
-
request = {}
|
3381
|
+
request: dict = {}
|
3382
3382
|
currency = None
|
3383
3383
|
if code is not None:
|
3384
3384
|
currency = self.currency(code)
|
@@ -3408,7 +3408,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3408
3408
|
self.check_address(address)
|
3409
3409
|
self.load_markets()
|
3410
3410
|
currency = self.currency(code)
|
3411
|
-
request = {
|
3411
|
+
request: dict = {
|
3412
3412
|
'currency': currency['id'], # todo: currencies have network-junctions
|
3413
3413
|
'address': address,
|
3414
3414
|
'amount': self.currency_to_precision(code, amount),
|
@@ -3436,7 +3436,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3436
3436
|
return self.parse_transaction(response, currency)
|
3437
3437
|
|
3438
3438
|
def parse_transaction_status(self, status):
|
3439
|
-
statuses = {
|
3439
|
+
statuses: dict = {
|
3440
3440
|
'PEND': 'pending',
|
3441
3441
|
'REQUEST': 'pending',
|
3442
3442
|
'DMOVE': 'pending',
|
@@ -3454,13 +3454,13 @@ class gate(Exchange, ImplicitAPI):
|
|
3454
3454
|
return self.safe_string(statuses, status, status)
|
3455
3455
|
|
3456
3456
|
def parse_transaction_type(self, type):
|
3457
|
-
types = {
|
3457
|
+
types: dict = {
|
3458
3458
|
'd': 'deposit',
|
3459
3459
|
'w': 'withdrawal',
|
3460
3460
|
}
|
3461
3461
|
return self.safe_string(types, type, type)
|
3462
3462
|
|
3463
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
3463
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
3464
3464
|
#
|
3465
3465
|
# deposits
|
3466
3466
|
#
|
@@ -3952,7 +3952,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3952
3952
|
if not isLimitOrder:
|
3953
3953
|
# exchange doesn't have market orders for spot
|
3954
3954
|
raise InvalidOrder(self.id + ' editOrder() does not support ' + type + ' orders for ' + marketType + ' markets')
|
3955
|
-
request = {
|
3955
|
+
request: dict = {
|
3956
3956
|
'order_id': id,
|
3957
3957
|
'currency_pair': market['id'],
|
3958
3958
|
'account': account,
|
@@ -4006,8 +4006,8 @@ class gate(Exchange, ImplicitAPI):
|
|
4006
4006
|
#
|
4007
4007
|
return self.parse_order(response, market)
|
4008
4008
|
|
4009
|
-
def parse_order_status(self, status):
|
4010
|
-
statuses = {
|
4009
|
+
def parse_order_status(self, status: Str):
|
4010
|
+
statuses: dict = {
|
4011
4011
|
'open': 'open',
|
4012
4012
|
'_new': 'open',
|
4013
4013
|
'filled': 'closed',
|
@@ -4022,7 +4022,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4022
4022
|
}
|
4023
4023
|
return self.safe_string(statuses, status, status)
|
4024
4024
|
|
4025
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
4025
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
4026
4026
|
#
|
4027
4027
|
# SPOT
|
4028
4028
|
# createOrder/cancelOrder/fetchOrder/editOrder
|
@@ -4765,7 +4765,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4765
4765
|
fromId = self.convert_type_to_account(fromAccount)
|
4766
4766
|
toId = self.convert_type_to_account(toAccount)
|
4767
4767
|
truncated = self.currency_to_precision(code, amount)
|
4768
|
-
request = {
|
4768
|
+
request: dict = {
|
4769
4769
|
'currency': currency['id'], # todo: currencies have network-junctions
|
4770
4770
|
'amount': truncated,
|
4771
4771
|
}
|
@@ -4891,7 +4891,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4891
4891
|
#
|
4892
4892
|
return response
|
4893
4893
|
|
4894
|
-
def parse_position(self, position, market: Market = None):
|
4894
|
+
def parse_position(self, position: dict, market: Market = None):
|
4895
4895
|
#
|
4896
4896
|
# swap and future
|
4897
4897
|
#
|
@@ -5040,7 +5040,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5040
5040
|
market = self.market(symbol)
|
5041
5041
|
if not market['contract']:
|
5042
5042
|
raise BadRequest(self.id + ' fetchPosition() supports contract markets only')
|
5043
|
-
request = {}
|
5043
|
+
request: dict = {}
|
5044
5044
|
request, params = self.prepare_request(market, market['type'], params)
|
5045
5045
|
extendedRequest = self.extend(request, params)
|
5046
5046
|
response = None
|
@@ -5128,7 +5128,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5128
5128
|
if symbolsLength > 0:
|
5129
5129
|
market = self.market(symbols[0])
|
5130
5130
|
type = None
|
5131
|
-
request = {}
|
5131
|
+
request: dict = {}
|
5132
5132
|
type, params = self.handle_market_type_and_params('fetchPositions', market, params)
|
5133
5133
|
if (type is None) or (type == 'spot'):
|
5134
5134
|
type = 'swap' # default to swap
|
@@ -5208,7 +5208,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5208
5208
|
#
|
5209
5209
|
return self.parse_positions(response, symbols)
|
5210
5210
|
|
5211
|
-
def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
5211
|
+
def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
5212
5212
|
"""
|
5213
5213
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
5214
5214
|
:see: https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
@@ -5323,7 +5323,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5323
5323
|
#
|
5324
5324
|
return self.parse_leverage_tiers(response, symbols, 'name')
|
5325
5325
|
|
5326
|
-
def fetch_market_leverage_tiers(self, symbol: str, params={}):
|
5326
|
+
def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
5327
5327
|
"""
|
5328
5328
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
5329
5329
|
:see: https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
|
@@ -5377,7 +5377,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5377
5377
|
floor = cap
|
5378
5378
|
return tiers
|
5379
5379
|
|
5380
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
5380
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
5381
5381
|
#
|
5382
5382
|
# [
|
5383
5383
|
# {
|
@@ -5422,7 +5422,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5422
5422
|
"""
|
5423
5423
|
self.load_markets()
|
5424
5424
|
currency = self.currency(code)
|
5425
|
-
request = {
|
5425
|
+
request: dict = {
|
5426
5426
|
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5427
5427
|
'amount': self.currency_to_precision(code, amount),
|
5428
5428
|
}
|
@@ -5449,7 +5449,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5449
5449
|
"""
|
5450
5450
|
self.load_markets()
|
5451
5451
|
currency = self.currency(code)
|
5452
|
-
request = {
|
5452
|
+
request: dict = {
|
5453
5453
|
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5454
5454
|
'amount': self.currency_to_precision(code, amount),
|
5455
5455
|
}
|
@@ -5486,7 +5486,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5486
5486
|
"""
|
5487
5487
|
self.load_markets()
|
5488
5488
|
currency = self.currency(code)
|
5489
|
-
request = {
|
5489
|
+
request: dict = {
|
5490
5490
|
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5491
5491
|
'amount': self.currency_to_precision(code, amount),
|
5492
5492
|
}
|
@@ -5529,7 +5529,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5529
5529
|
"""
|
5530
5530
|
self.load_markets()
|
5531
5531
|
currency = self.currency(code)
|
5532
|
-
request = {
|
5532
|
+
request: dict = {
|
5533
5533
|
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5534
5534
|
'amount': self.currency_to_precision(code, amount),
|
5535
5535
|
}
|
@@ -5766,7 +5766,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5766
5766
|
market = self.market(symbol)
|
5767
5767
|
if not market['swap']:
|
5768
5768
|
raise BadRequest(self.id + ' fetchOpenInterest() supports swap markets only')
|
5769
|
-
request = {
|
5769
|
+
request: dict = {
|
5770
5770
|
'contract': market['id'],
|
5771
5771
|
'settle': market['settleId'],
|
5772
5772
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
@@ -5848,7 +5848,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5848
5848
|
raise NotSupported(self.id + ' fetchSettlementHistory() supports option markets only')
|
5849
5849
|
marketId = market['id']
|
5850
5850
|
optionParts = marketId.split('-')
|
5851
|
-
request = {
|
5851
|
+
request: dict = {
|
5852
5852
|
'underlying': self.safe_string(optionParts, 0),
|
5853
5853
|
}
|
5854
5854
|
if since is not None:
|
@@ -5892,7 +5892,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5892
5892
|
raise NotSupported(self.id + ' fetchMySettlementHistory() supports option markets only')
|
5893
5893
|
marketId = market['id']
|
5894
5894
|
optionParts = marketId.split('-')
|
5895
|
-
request = {
|
5895
|
+
request: dict = {
|
5896
5896
|
'underlying': self.safe_string(optionParts, 0),
|
5897
5897
|
'contract': marketId,
|
5898
5898
|
}
|
@@ -6019,7 +6019,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6019
6019
|
type = None
|
6020
6020
|
currency = None
|
6021
6021
|
response = None
|
6022
|
-
request = {}
|
6022
|
+
request: dict = {}
|
6023
6023
|
type, params = self.handle_market_type_and_params('fetchLedger', None, params)
|
6024
6024
|
if (type == 'spot') or (type == 'margin'):
|
6025
6025
|
if code is not None:
|
@@ -6099,7 +6099,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6099
6099
|
#
|
6100
6100
|
return self.parse_ledger(response, currency, since, limit)
|
6101
6101
|
|
6102
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
6102
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
6103
6103
|
#
|
6104
6104
|
# spot
|
6105
6105
|
#
|
@@ -6181,7 +6181,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6181
6181
|
}
|
6182
6182
|
|
6183
6183
|
def parse_ledger_entry_type(self, type):
|
6184
|
-
ledgerType = {
|
6184
|
+
ledgerType: dict = {
|
6185
6185
|
'deposit': 'deposit',
|
6186
6186
|
'withdraw': 'withdrawal',
|
6187
6187
|
'sub_account_transfer': 'transfer',
|
@@ -6286,7 +6286,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6286
6286
|
market = self.market(symbol)
|
6287
6287
|
if not market['swap']:
|
6288
6288
|
raise NotSupported(self.id + ' fetchLiquidations() supports swap markets only')
|
6289
|
-
request = {
|
6289
|
+
request: dict = {
|
6290
6290
|
'settle': market['settleId'],
|
6291
6291
|
'contract': market['id'],
|
6292
6292
|
}
|
@@ -6326,7 +6326,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6326
6326
|
raise ArgumentsRequired(self.id + ' fetchMyLiquidations() requires a symbol argument')
|
6327
6327
|
self.load_markets()
|
6328
6328
|
market = self.market(symbol)
|
6329
|
-
request = {
|
6329
|
+
request: dict = {
|
6330
6330
|
'contract': market['id'],
|
6331
6331
|
}
|
6332
6332
|
response = None
|
@@ -6455,7 +6455,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6455
6455
|
"""
|
6456
6456
|
self.load_markets()
|
6457
6457
|
market = self.market(symbol)
|
6458
|
-
request = {
|
6458
|
+
request: dict = {
|
6459
6459
|
'underlying': market['info']['underlying'],
|
6460
6460
|
}
|
6461
6461
|
response = self.publicOptionsGetTickers(self.extend(request, params))
|
@@ -6545,7 +6545,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6545
6545
|
:param dict [params]: extra parameters specific to the okx api endpoint
|
6546
6546
|
:returns dict[]: `A list of position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
6547
6547
|
"""
|
6548
|
-
request = {
|
6548
|
+
request: dict = {
|
6549
6549
|
'close': True,
|
6550
6550
|
}
|
6551
6551
|
params = self.extend(request, params)
|
@@ -6569,7 +6569,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6569
6569
|
if symbol is not None:
|
6570
6570
|
# unified account does not require a symbol
|
6571
6571
|
market = self.market(symbol)
|
6572
|
-
request = {}
|
6572
|
+
request: dict = {}
|
6573
6573
|
response = None
|
6574
6574
|
isUnified = self.safe_bool(params, 'unified')
|
6575
6575
|
params = self.omit(params, 'unified')
|
@@ -6655,7 +6655,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6655
6655
|
raise NotSupported(self.id + ' fetchLeverage() does not support ' + market['type'] + ' markets')
|
6656
6656
|
return self.parse_leverage(response, market)
|
6657
6657
|
|
6658
|
-
def fetch_leverages(self, symbols:
|
6658
|
+
def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
6659
6659
|
"""
|
6660
6660
|
fetch the set leverage for all leverage markets, only spot margin is supported on gate
|
6661
6661
|
:see: https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
|
@@ -6723,7 +6723,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6723
6723
|
"""
|
6724
6724
|
self.load_markets()
|
6725
6725
|
market = self.market(symbol)
|
6726
|
-
request = {
|
6726
|
+
request: dict = {
|
6727
6727
|
'contract': market['id'],
|
6728
6728
|
}
|
6729
6729
|
response = self.publicOptionsGetContractsContract(self.extend(request, params))
|
@@ -6781,7 +6781,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6781
6781
|
"""
|
6782
6782
|
self.load_markets()
|
6783
6783
|
currency = self.currency(code)
|
6784
|
-
request = {
|
6784
|
+
request: dict = {
|
6785
6785
|
'underlying': currency['code'] + '_USDT', # todo: currency['id'].upper() & network junctions
|
6786
6786
|
}
|
6787
6787
|
response = self.publicOptionsGetContracts(self.extend(request, params))
|
@@ -6920,7 +6920,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6920
6920
|
marketType, params = self.handle_market_type_and_params('fetchPositionsHistory', market, params, 'swap')
|
6921
6921
|
until = self.safe_integer(params, 'until')
|
6922
6922
|
params = self.omit(params, 'until')
|
6923
|
-
request = {}
|
6923
|
+
request: dict = {}
|
6924
6924
|
request, params = self.prepare_request(market, marketType, params)
|
6925
6925
|
if limit is not None:
|
6926
6926
|
request['limit'] = limit
|