ccxt 4.4.30__py2.py3-none-any.whl → 4.4.32__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/ace.py +36 -12
- ccxt/alpaca.py +62 -22
- ccxt/ascendex.py +65 -30
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +36 -12
- ccxt/async_support/alpaca.py +62 -22
- ccxt/async_support/ascendex.py +65 -30
- ccxt/async_support/base/exchange.py +3 -3
- ccxt/async_support/base/ws/aiohttp_client.py +25 -3
- ccxt/async_support/bigone.py +71 -27
- ccxt/async_support/binance.py +555 -323
- ccxt/async_support/bingx.py +208 -108
- ccxt/async_support/bit2c.py +34 -12
- ccxt/async_support/bitbank.py +42 -14
- ccxt/async_support/bitbns.py +17 -9
- ccxt/async_support/bitfinex.py +68 -24
- ccxt/async_support/bitfinex2.py +116 -44
- ccxt/async_support/bitflyer.py +54 -18
- ccxt/async_support/bitget.py +277 -145
- ccxt/async_support/bithumb.py +39 -14
- ccxt/async_support/bitmart.py +145 -79
- ccxt/async_support/bitmex.py +90 -30
- ccxt/async_support/bitopro.py +66 -22
- ccxt/async_support/bitrue.py +109 -57
- ccxt/async_support/bitso.py +55 -19
- ccxt/async_support/bitstamp.py +84 -36
- ccxt/async_support/bitteam.py +51 -17
- ccxt/async_support/bitvavo.py +57 -22
- ccxt/async_support/bl3p.py +26 -10
- ccxt/async_support/blockchaincom.py +63 -21
- ccxt/async_support/blofin.py +95 -38
- ccxt/async_support/btcalpha.py +48 -16
- ccxt/async_support/btcbox.py +27 -9
- ccxt/async_support/btcmarkets.py +57 -19
- ccxt/async_support/btcturk.py +36 -12
- ccxt/async_support/bybit.py +251 -95
- ccxt/async_support/cex.py +65 -22
- ccxt/async_support/coinbase.py +138 -56
- ccxt/async_support/coinbaseexchange.py +76 -28
- ccxt/async_support/coinbaseinternational.py +75 -27
- ccxt/async_support/coincatch.py +191 -97
- ccxt/async_support/coincheck.py +33 -11
- ccxt/async_support/coinex.py +212 -101
- ccxt/async_support/coinlist.py +87 -30
- ccxt/async_support/coinmate.py +55 -24
- ccxt/async_support/coinmetro.py +52 -18
- ccxt/async_support/coinone.py +27 -10
- ccxt/async_support/coinsph.py +73 -27
- ccxt/async_support/coinspot.py +25 -9
- ccxt/async_support/cryptocom.py +103 -38
- ccxt/async_support/currencycom.py +70 -23
- ccxt/async_support/delta.py +90 -30
- ccxt/async_support/deribit.py +131 -50
- ccxt/async_support/digifinex.py +114 -51
- ccxt/async_support/exmo.py +104 -45
- ccxt/async_support/gate.py +313 -157
- ccxt/async_support/gemini.py +57 -20
- ccxt/async_support/hashkey.py +151 -66
- ccxt/async_support/hitbtc.py +157 -74
- ccxt/async_support/hollaex.py +76 -25
- ccxt/async_support/htx.py +297 -240
- ccxt/async_support/huobijp.py +1 -0
- ccxt/async_support/hyperliquid.py +94 -38
- ccxt/async_support/idex.py +73 -24
- ccxt/async_support/independentreserve.py +12 -5
- ccxt/async_support/indodax.py +54 -17
- ccxt/async_support/kraken.py +108 -36
- ccxt/async_support/krakenfutures.py +88 -34
- ccxt/async_support/kucoin.py +214 -110
- ccxt/async_support/kucoinfutures.py +209 -64
- ccxt/async_support/kuna.py +80 -39
- ccxt/async_support/latoken.py +70 -33
- ccxt/async_support/lbank.py +89 -38
- ccxt/async_support/luno.py +54 -19
- ccxt/async_support/lykke.py +54 -19
- ccxt/async_support/mercado.py +1 -0
- ccxt/async_support/mexc.py +226 -108
- ccxt/async_support/ndax.py +58 -19
- ccxt/async_support/novadax.py +67 -22
- ccxt/async_support/oceanex.py +58 -19
- ccxt/async_support/okcoin.py +81 -38
- ccxt/async_support/okx.py +270 -109
- ccxt/async_support/onetrading.py +3 -1
- ccxt/async_support/oxfun.py +95 -36
- ccxt/async_support/p2b.py +49 -23
- ccxt/async_support/paradex.py +75 -27
- ccxt/async_support/paymium.py +31 -11
- ccxt/async_support/phemex.py +108 -56
- ccxt/async_support/poloniex.py +80 -30
- ccxt/async_support/poloniexfutures.py +72 -30
- ccxt/async_support/probit.py +64 -22
- ccxt/async_support/timex.py +58 -19
- ccxt/async_support/tokocrypto.py +63 -22
- ccxt/async_support/tradeogre.py +7 -2
- ccxt/async_support/upbit.py +72 -25
- ccxt/async_support/vertex.py +74 -28
- ccxt/async_support/wavesexchange.py +32 -8
- ccxt/async_support/wazirx.py +51 -17
- ccxt/async_support/whitebit.py +105 -41
- ccxt/async_support/woo.py +162 -65
- ccxt/async_support/woofipro.py +119 -50
- ccxt/async_support/xt.py +150 -73
- ccxt/async_support/yobit.py +49 -16
- ccxt/async_support/zaif.py +30 -10
- ccxt/async_support/zonda.py +46 -16
- ccxt/base/exchange.py +47 -35
- ccxt/base/types.py +1 -0
- ccxt/bigone.py +71 -27
- ccxt/binance.py +555 -323
- ccxt/bingx.py +208 -108
- ccxt/bit2c.py +34 -12
- ccxt/bitbank.py +42 -14
- ccxt/bitbns.py +17 -9
- ccxt/bitfinex.py +68 -24
- ccxt/bitfinex2.py +116 -44
- ccxt/bitflyer.py +54 -18
- ccxt/bitget.py +277 -145
- ccxt/bithumb.py +39 -14
- ccxt/bitmart.py +145 -79
- ccxt/bitmex.py +90 -30
- ccxt/bitopro.py +66 -22
- ccxt/bitrue.py +109 -57
- ccxt/bitso.py +55 -19
- ccxt/bitstamp.py +84 -36
- ccxt/bitteam.py +51 -17
- ccxt/bitvavo.py +57 -22
- ccxt/bl3p.py +26 -10
- ccxt/blockchaincom.py +63 -21
- ccxt/blofin.py +95 -38
- ccxt/btcalpha.py +48 -16
- ccxt/btcbox.py +27 -9
- ccxt/btcmarkets.py +57 -19
- ccxt/btcturk.py +36 -12
- ccxt/bybit.py +251 -95
- ccxt/cex.py +65 -22
- ccxt/coinbase.py +138 -56
- ccxt/coinbaseexchange.py +76 -28
- ccxt/coinbaseinternational.py +75 -27
- ccxt/coincatch.py +191 -97
- ccxt/coincheck.py +33 -11
- ccxt/coinex.py +212 -101
- ccxt/coinlist.py +87 -30
- ccxt/coinmate.py +55 -24
- ccxt/coinmetro.py +52 -18
- ccxt/coinone.py +27 -10
- ccxt/coinsph.py +73 -27
- ccxt/coinspot.py +25 -9
- ccxt/cryptocom.py +103 -38
- ccxt/currencycom.py +70 -23
- ccxt/delta.py +90 -30
- ccxt/deribit.py +131 -50
- ccxt/digifinex.py +114 -51
- ccxt/exmo.py +104 -45
- ccxt/gate.py +313 -157
- ccxt/gemini.py +57 -20
- ccxt/hashkey.py +151 -66
- ccxt/hitbtc.py +157 -74
- ccxt/hollaex.py +76 -25
- ccxt/htx.py +297 -240
- ccxt/huobijp.py +1 -0
- ccxt/hyperliquid.py +94 -38
- ccxt/idex.py +73 -24
- ccxt/independentreserve.py +12 -5
- ccxt/indodax.py +54 -17
- ccxt/kraken.py +108 -36
- ccxt/krakenfutures.py +88 -34
- ccxt/kucoin.py +214 -110
- ccxt/kucoinfutures.py +209 -64
- ccxt/kuna.py +80 -39
- ccxt/latoken.py +70 -33
- ccxt/lbank.py +89 -38
- ccxt/luno.py +54 -19
- ccxt/lykke.py +54 -19
- ccxt/mercado.py +1 -0
- ccxt/mexc.py +226 -108
- ccxt/ndax.py +58 -19
- ccxt/novadax.py +67 -22
- ccxt/oceanex.py +58 -19
- ccxt/okcoin.py +81 -38
- ccxt/okx.py +270 -109
- ccxt/onetrading.py +3 -1
- ccxt/oxfun.py +95 -36
- ccxt/p2b.py +49 -23
- ccxt/paradex.py +75 -27
- ccxt/paymium.py +31 -11
- ccxt/phemex.py +108 -56
- ccxt/poloniex.py +80 -30
- ccxt/poloniexfutures.py +72 -30
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +15 -5
- ccxt/pro/ascendex.py +18 -6
- ccxt/pro/binance.py +204 -123
- ccxt/pro/bingx.py +44 -24
- ccxt/pro/bitfinex.py +13 -5
- ccxt/pro/bitget.py +76 -37
- ccxt/pro/bithumb.py +12 -4
- ccxt/pro/bitmart.py +44 -20
- ccxt/pro/bitmex.py +42 -14
- ccxt/pro/bitopro.py +15 -5
- ccxt/pro/bitrue.py +7 -3
- ccxt/pro/bitvavo.py +97 -62
- ccxt/pro/blockchaincom.py +18 -6
- ccxt/pro/blofin.py +36 -12
- ccxt/pro/bybit.py +100 -42
- ccxt/pro/cex.py +48 -16
- ccxt/pro/coinbase.py +32 -12
- ccxt/pro/coinbaseexchange.py +1 -1
- ccxt/pro/coinbaseinternational.py +34 -14
- ccxt/pro/coincatch.py +54 -19
- ccxt/pro/coincheck.py +6 -2
- ccxt/pro/coinex.py +40 -20
- ccxt/pro/coinone.py +9 -3
- ccxt/pro/cryptocom.py +71 -27
- ccxt/pro/deribit.py +36 -12
- ccxt/pro/exmo.py +10 -4
- ccxt/pro/gate.py +65 -31
- ccxt/pro/gemini.py +21 -7
- ccxt/pro/hashkey.py +27 -9
- ccxt/pro/hitbtc.py +61 -37
- ccxt/pro/hollaex.py +15 -5
- ccxt/pro/htx.py +39 -21
- ccxt/pro/hyperliquid.py +41 -14
- ccxt/pro/kraken.py +49 -17
- ccxt/pro/krakenfutures.py +47 -24
- ccxt/pro/kucoin.py +60 -31
- ccxt/pro/kucoinfutures.py +41 -19
- ccxt/pro/lbank.py +27 -9
- ccxt/pro/luno.py +3 -1
- ccxt/pro/mexc.py +36 -19
- ccxt/pro/ndax.py +12 -4
- ccxt/pro/okcoin.py +18 -6
- ccxt/pro/okx.py +76 -28
- ccxt/pro/onetrading.py +21 -7
- ccxt/pro/oxfun.py +54 -20
- ccxt/pro/p2b.py +23 -11
- ccxt/pro/paradex.py +12 -4
- ccxt/pro/phemex.py +31 -19
- ccxt/pro/poloniex.py +50 -22
- ccxt/pro/poloniexfutures.py +17 -7
- ccxt/pro/probit.py +18 -6
- ccxt/pro/upbit.py +25 -9
- ccxt/pro/vertex.py +20 -6
- ccxt/pro/wazirx.py +21 -7
- ccxt/pro/whitebit.py +25 -9
- ccxt/pro/woo.py +32 -12
- ccxt/pro/woofipro.py +35 -13
- ccxt/pro/xt.py +46 -26
- ccxt/probit.py +64 -22
- ccxt/timex.py +58 -19
- ccxt/tokocrypto.py +63 -22
- ccxt/tradeogre.py +7 -2
- ccxt/upbit.py +72 -25
- ccxt/vertex.py +74 -28
- ccxt/wavesexchange.py +32 -8
- ccxt/wazirx.py +51 -17
- ccxt/whitebit.py +105 -41
- ccxt/woo.py +162 -65
- ccxt/woofipro.py +119 -50
- ccxt/xt.py +150 -73
- ccxt/yobit.py +49 -16
- ccxt/zaif.py +30 -10
- ccxt/zonda.py +46 -16
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/METADATA +11 -5
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/RECORD +268 -268
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/WHEEL +0 -0
- {ccxt-4.4.30.dist-info → ccxt-4.4.32.dist-info}/top_level.txt +0 -0
ccxt/gate.py
CHANGED
@@ -169,7 +169,7 @@ class gate(Exchange, ImplicitAPI):
|
|
169
169
|
'fetchSettlementHistory': True,
|
170
170
|
'fetchTicker': True,
|
171
171
|
'fetchTickers': True,
|
172
|
-
'fetchTime':
|
172
|
+
'fetchTime': True,
|
173
173
|
'fetchTrades': True,
|
174
174
|
'fetchTradingFee': True,
|
175
175
|
'fetchTradingFees': True,
|
@@ -916,8 +916,11 @@ class gate(Exchange, ImplicitAPI):
|
|
916
916
|
|
917
917
|
def load_unified_status(self, params={}):
|
918
918
|
"""
|
919
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
919
920
|
returns unifiedAccount so the user can check if the unified account is enabled
|
920
|
-
|
921
|
+
|
922
|
+
https://www.gate.io/docs/developers/apiv4/#get-account-detail
|
923
|
+
|
921
924
|
:returns boolean: True or False if the enabled unified account is enabled or not and sets the unifiedAccount option if it is None
|
922
925
|
"""
|
923
926
|
unifiedAccount = self.safe_bool(self.options, 'unifiedAccount')
|
@@ -946,6 +949,23 @@ class gate(Exchange, ImplicitAPI):
|
|
946
949
|
def upgrade_unified_trade_account(self, params={}):
|
947
950
|
return self.privateUnifiedPutUnifiedMode(params)
|
948
951
|
|
952
|
+
def fetch_time(self, params={}):
|
953
|
+
"""
|
954
|
+
fetches the current integer timestamp in milliseconds from the exchange server
|
955
|
+
|
956
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-server-current-time
|
957
|
+
|
958
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
959
|
+
:returns int: the current integer timestamp in milliseconds from the exchange server
|
960
|
+
"""
|
961
|
+
response = self.publicSpotGetTime(params)
|
962
|
+
#
|
963
|
+
# {
|
964
|
+
# "server_time": 1731447921098
|
965
|
+
# }
|
966
|
+
#
|
967
|
+
return self.safe_integer(response, 'server_time')
|
968
|
+
|
949
969
|
def create_expired_option_market(self, symbol: str):
|
950
970
|
# support expired option contracts
|
951
971
|
quote = 'USDT'
|
@@ -1019,11 +1039,13 @@ class gate(Exchange, ImplicitAPI):
|
|
1019
1039
|
def fetch_markets(self, params={}) -> List[Market]:
|
1020
1040
|
"""
|
1021
1041
|
retrieves data on all markets for gate
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1042
|
+
|
1043
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported # spot
|
1044
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading # margin
|
1045
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts # swap
|
1046
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 # future
|
1047
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time # option
|
1048
|
+
|
1027
1049
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1028
1050
|
:returns dict[]: an array of objects representing market data
|
1029
1051
|
"""
|
@@ -1483,7 +1505,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1483
1505
|
|
1484
1506
|
def prepare_request(self, market=None, type=None, params={}):
|
1485
1507
|
"""
|
1486
|
-
|
1508
|
+
@ignore
|
1487
1509
|
Fills request params contract, settle, currency_pair, market and account where applicable
|
1488
1510
|
:param dict market: CCXT market, required when type is None
|
1489
1511
|
:param str type: 'spot', 'swap', or 'future', required when market is None
|
@@ -1511,7 +1533,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1511
1533
|
|
1512
1534
|
def spot_order_prepare_request(self, market=None, stop=False, params={}):
|
1513
1535
|
"""
|
1514
|
-
|
1536
|
+
@ignore
|
1515
1537
|
Fills request params currency_pair, market and account where applicable for spot order methods like fetchOpenOrders, cancelAllOrders
|
1516
1538
|
:param dict market: CCXT market
|
1517
1539
|
:param bool stop: True if for a stop order
|
@@ -1529,7 +1551,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1529
1551
|
|
1530
1552
|
def multi_order_spot_prepare_request(self, market=None, trigger=False, params={}):
|
1531
1553
|
"""
|
1532
|
-
|
1554
|
+
@ignore
|
1533
1555
|
Fills request params currency_pair, market and account where applicable for spot order methods like fetchOpenOrders, cancelAllOrders
|
1534
1556
|
:param dict market: CCXT market
|
1535
1557
|
:param bool stop: True if for a stop order
|
@@ -1550,7 +1572,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1550
1572
|
|
1551
1573
|
def get_margin_mode(self, stop, params):
|
1552
1574
|
"""
|
1553
|
-
|
1575
|
+
@ignore
|
1554
1576
|
Gets the margin type for self api call
|
1555
1577
|
:param bool stop: True if for a stop order
|
1556
1578
|
:param dict [params]: Request params
|
@@ -1586,7 +1608,9 @@ class gate(Exchange, ImplicitAPI):
|
|
1586
1608
|
def fetch_currencies(self, params={}) -> Currencies:
|
1587
1609
|
"""
|
1588
1610
|
fetches all available currencies on an exchange
|
1589
|
-
|
1611
|
+
|
1612
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
|
1613
|
+
|
1590
1614
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1591
1615
|
:returns dict: an associative dictionary of currencies
|
1592
1616
|
"""
|
@@ -1697,7 +1721,9 @@ class gate(Exchange, ImplicitAPI):
|
|
1697
1721
|
def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
1698
1722
|
"""
|
1699
1723
|
fetch the current funding rate
|
1700
|
-
|
1724
|
+
|
1725
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
|
1726
|
+
|
1701
1727
|
:param str symbol: unified market symbol
|
1702
1728
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1703
1729
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -1757,7 +1783,9 @@ class gate(Exchange, ImplicitAPI):
|
|
1757
1783
|
def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
1758
1784
|
"""
|
1759
1785
|
fetch the funding rate for multiple markets
|
1760
|
-
|
1786
|
+
|
1787
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
1788
|
+
|
1761
1789
|
:param str[]|None symbols: list of unified market symbols
|
1762
1790
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1763
1791
|
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
|
@@ -1936,7 +1964,9 @@ class gate(Exchange, ImplicitAPI):
|
|
1936
1964
|
def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
|
1937
1965
|
"""
|
1938
1966
|
fetch the deposit address for a currency associated with self account
|
1939
|
-
|
1967
|
+
|
1968
|
+
https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
|
1969
|
+
|
1940
1970
|
:param str code: unified currency code
|
1941
1971
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1942
1972
|
:param str [params.network]: unified network code(not used directly by gate.io but used by ccxt to filter the response)
|
@@ -2007,7 +2037,9 @@ class gate(Exchange, ImplicitAPI):
|
|
2007
2037
|
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
2008
2038
|
"""
|
2009
2039
|
fetch the trading fees for a market
|
2010
|
-
|
2040
|
+
|
2041
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
2042
|
+
|
2011
2043
|
:param str symbol: unified market symbol
|
2012
2044
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2013
2045
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -2037,7 +2069,9 @@ class gate(Exchange, ImplicitAPI):
|
|
2037
2069
|
def fetch_trading_fees(self, params={}) -> TradingFees:
|
2038
2070
|
"""
|
2039
2071
|
fetch the trading fees for multiple markets
|
2040
|
-
|
2072
|
+
|
2073
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
2074
|
+
|
2041
2075
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2042
2076
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
2043
2077
|
"""
|
@@ -2099,9 +2133,11 @@ class gate(Exchange, ImplicitAPI):
|
|
2099
2133
|
|
2100
2134
|
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
2101
2135
|
"""
|
2102
|
-
|
2136
|
+
@deprecated
|
2103
2137
|
please use fetchDepositWithdrawFees instead
|
2104
|
-
|
2138
|
+
|
2139
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
|
2140
|
+
|
2105
2141
|
:param str[]|None codes: list of unified currency codes
|
2106
2142
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2107
2143
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -2152,7 +2188,9 @@ class gate(Exchange, ImplicitAPI):
|
|
2152
2188
|
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
2153
2189
|
"""
|
2154
2190
|
fetch deposit and withdraw fees
|
2155
|
-
|
2191
|
+
|
2192
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
|
2193
|
+
|
2156
2194
|
:param str[]|None codes: list of unified currency codes
|
2157
2195
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2158
2196
|
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -2230,8 +2268,10 @@ class gate(Exchange, ImplicitAPI):
|
|
2230
2268
|
def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2231
2269
|
"""
|
2232
2270
|
fetch the history of funding payments paid and received on self account
|
2233
|
-
|
2234
|
-
|
2271
|
+
|
2272
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
2273
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
2274
|
+
|
2235
2275
|
:param str symbol: unified market symbol
|
2236
2276
|
:param int [since]: the earliest time in ms to fetch funding history for
|
2237
2277
|
:param int [limit]: the maximum number of funding history structures to retrieve
|
@@ -2308,10 +2348,12 @@ class gate(Exchange, ImplicitAPI):
|
|
2308
2348
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
2309
2349
|
"""
|
2310
2350
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
2311
|
-
|
2312
|
-
|
2313
|
-
|
2314
|
-
|
2351
|
+
|
2352
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
|
2353
|
+
https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
|
2354
|
+
https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
|
2355
|
+
https://www.gate.io/docs/developers/apiv4/en/#options-order-book
|
2356
|
+
|
2315
2357
|
:param str symbol: unified symbol of the market to fetch the order book for
|
2316
2358
|
:param int [limit]: the maximum amount of order book entries to return
|
2317
2359
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2419,10 +2461,12 @@ class gate(Exchange, ImplicitAPI):
|
|
2419
2461
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
2420
2462
|
"""
|
2421
2463
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2464
|
+
|
2465
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
|
2466
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
|
2467
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
|
2468
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
2469
|
+
|
2426
2470
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
2427
2471
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2428
2472
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -2570,10 +2614,12 @@ class gate(Exchange, ImplicitAPI):
|
|
2570
2614
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
2571
2615
|
"""
|
2572
2616
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2617
|
+
|
2618
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
|
2619
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
|
2620
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
|
2621
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
2622
|
+
|
2577
2623
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
2578
2624
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2579
2625
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -2621,6 +2667,7 @@ class gate(Exchange, ImplicitAPI):
|
|
2621
2667
|
:param str [params.marginMode]: 'cross' or 'isolated' - marginMode for margin trading if not provided self.options['defaultMarginMode'] is used
|
2622
2668
|
:param str [params.symbol]: margin only - unified ccxt symbol
|
2623
2669
|
:param boolean [params.unifiedAccount]: default False, set to True for fetching the unified account balance
|
2670
|
+
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
2624
2671
|
"""
|
2625
2672
|
self.load_markets()
|
2626
2673
|
self.load_unified_status()
|
@@ -2890,10 +2937,12 @@ class gate(Exchange, ImplicitAPI):
|
|
2890
2937
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
2891
2938
|
"""
|
2892
2939
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
2893
|
-
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2940
|
+
|
2941
|
+
https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks # spot
|
2942
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks # swap
|
2943
|
+
https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks # future
|
2944
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks # option
|
2945
|
+
|
2897
2946
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
2898
2947
|
:param str timeframe: the length of time each candle represents
|
2899
2948
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -2966,23 +3015,38 @@ class gate(Exchange, ImplicitAPI):
|
|
2966
3015
|
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2967
3016
|
"""
|
2968
3017
|
fetches historical funding rate prices
|
2969
|
-
|
3018
|
+
|
3019
|
+
https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
|
3020
|
+
|
2970
3021
|
:param str symbol: unified symbol of the market to fetch the funding rate history for
|
2971
3022
|
:param int [since]: timestamp in ms of the earliest funding rate to fetch
|
2972
3023
|
:param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
|
2973
3024
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3025
|
+
:param int [params.until]: timestamp in ms of the latest funding rate to fetch
|
3026
|
+
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
2974
3027
|
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
|
2975
3028
|
"""
|
2976
3029
|
if symbol is None:
|
2977
3030
|
raise ArgumentsRequired(self.id + ' fetchFundingRateHistory() requires a symbol argument')
|
2978
3031
|
self.load_markets()
|
3032
|
+
paginate = False
|
3033
|
+
paginate, params = self.handle_option_and_params(params, 'fetchFundingRateHistory', 'paginate')
|
3034
|
+
if paginate:
|
3035
|
+
return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params)
|
2979
3036
|
market = self.market(symbol)
|
2980
3037
|
if not market['swap']:
|
2981
3038
|
raise BadSymbol(self.id + ' fetchFundingRateHistory() supports swap contracts only')
|
2982
|
-
request
|
3039
|
+
request: dict = {}
|
3040
|
+
request, params = self.prepare_request(market, None, params)
|
2983
3041
|
if limit is not None:
|
2984
3042
|
request['limit'] = limit
|
2985
|
-
|
3043
|
+
if since is not None:
|
3044
|
+
request['from'] = self.parse_to_int(since / 1000)
|
3045
|
+
until = self.safe_integer(params, 'until')
|
3046
|
+
if until is not None:
|
3047
|
+
params = self.omit(params, 'until')
|
3048
|
+
request['to'] = self.parse_to_int(until / 1000)
|
3049
|
+
response = self.publicFuturesGetSettleFundingRate(self.extend(request, params))
|
2986
3050
|
#
|
2987
3051
|
# {
|
2988
3052
|
# "r": "0.00063521",
|
@@ -3051,10 +3115,12 @@ class gate(Exchange, ImplicitAPI):
|
|
3051
3115
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
3052
3116
|
"""
|
3053
3117
|
get the list of most recent trades for a particular symbol
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3057
|
-
|
3118
|
+
|
3119
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
|
3120
|
+
https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
|
3121
|
+
https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
|
3122
|
+
https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
|
3123
|
+
|
3058
3124
|
:param str symbol: unified symbol of the market to fetch trades for
|
3059
3125
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
3060
3126
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -3155,10 +3221,12 @@ class gate(Exchange, ImplicitAPI):
|
|
3155
3221
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3156
3222
|
"""
|
3157
3223
|
fetch all the trades made from a single order
|
3158
|
-
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3224
|
+
|
3225
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
|
3226
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
|
3227
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
|
3228
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
|
3229
|
+
|
3162
3230
|
:param str id: order id
|
3163
3231
|
:param str symbol: unified market symbol
|
3164
3232
|
:param int [since]: the earliest time in ms to fetch trades for
|
@@ -3194,10 +3262,12 @@ class gate(Exchange, ImplicitAPI):
|
|
3194
3262
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
3195
3263
|
"""
|
3196
3264
|
Fetch personal trading history
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3265
|
+
|
3266
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
|
3267
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
|
3268
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
|
3269
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
|
3270
|
+
|
3201
3271
|
:param str symbol: unified market symbol
|
3202
3272
|
:param int [since]: the earliest time in ms to fetch trades for
|
3203
3273
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -3466,12 +3536,14 @@ class gate(Exchange, ImplicitAPI):
|
|
3466
3536
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3467
3537
|
"""
|
3468
3538
|
fetch all deposits made to an account
|
3469
|
-
|
3539
|
+
|
3540
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
|
3541
|
+
|
3470
3542
|
:param str code: unified currency code
|
3471
3543
|
:param int [since]: the earliest time in ms to fetch deposits for
|
3472
3544
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
3473
|
-
:param int [params.until]: end time in ms
|
3474
3545
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3546
|
+
:param int [params.until]: end time in ms
|
3475
3547
|
: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)
|
3476
3548
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
3477
3549
|
"""
|
@@ -3498,7 +3570,9 @@ class gate(Exchange, ImplicitAPI):
|
|
3498
3570
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
3499
3571
|
"""
|
3500
3572
|
fetch all withdrawals made from an account
|
3501
|
-
|
3573
|
+
|
3574
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
|
3575
|
+
|
3502
3576
|
:param str code: unified currency code
|
3503
3577
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
3504
3578
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -3530,7 +3604,9 @@ class gate(Exchange, ImplicitAPI):
|
|
3530
3604
|
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
3531
3605
|
"""
|
3532
3606
|
make a withdrawal
|
3533
|
-
|
3607
|
+
|
3608
|
+
https://www.gate.io/docs/developers/apiv4/en/#withdraw
|
3609
|
+
|
3534
3610
|
:param str code: unified currency code
|
3535
3611
|
:param float amount: the amount to withdraw
|
3536
3612
|
:param str address: the address to withdraw to
|
@@ -3706,13 +3782,15 @@ class gate(Exchange, ImplicitAPI):
|
|
3706
3782
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
3707
3783
|
"""
|
3708
3784
|
Create an order on the exchange
|
3709
|
-
|
3710
|
-
|
3711
|
-
|
3712
|
-
|
3713
|
-
|
3714
|
-
|
3715
|
-
|
3785
|
+
|
3786
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
3787
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
|
3788
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
|
3789
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
|
3790
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
|
3791
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
|
3792
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
|
3793
|
+
|
3716
3794
|
:param str symbol: Unified CCXT market symbol
|
3717
3795
|
:param str type: 'limit' or 'market' *"market" is contract only*
|
3718
3796
|
:param str side: 'buy' or 'sell'
|
@@ -3866,10 +3944,13 @@ class gate(Exchange, ImplicitAPI):
|
|
3866
3944
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
3867
3945
|
"""
|
3868
3946
|
create a list of trade orders
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3947
|
+
|
3948
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
|
3949
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
|
3950
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
|
3951
|
+
|
3872
3952
|
: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
|
3953
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3873
3954
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
3874
3955
|
"""
|
3875
3956
|
self.load_markets()
|
@@ -4098,7 +4179,9 @@ class gate(Exchange, ImplicitAPI):
|
|
4098
4179
|
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
|
4099
4180
|
"""
|
4100
4181
|
create a market buy order by providing the symbol and cost
|
4101
|
-
|
4182
|
+
|
4183
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
4184
|
+
|
4102
4185
|
:param str symbol: unified symbol of the market to create an order in
|
4103
4186
|
:param float cost: how much you want to trade in units of the quote currency
|
4104
4187
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4149,8 +4232,10 @@ class gate(Exchange, ImplicitAPI):
|
|
4149
4232
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
4150
4233
|
"""
|
4151
4234
|
edit a trade order, gate currently only supports the modification of the price or amount fields
|
4152
|
-
|
4153
|
-
|
4235
|
+
|
4236
|
+
https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
|
4237
|
+
https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
|
4238
|
+
|
4154
4239
|
:param str id: order id
|
4155
4240
|
:param str symbol: unified symbol of the market to create an order in
|
4156
4241
|
:param str type: 'market' or 'limit'
|
@@ -4493,10 +4578,12 @@ class gate(Exchange, ImplicitAPI):
|
|
4493
4578
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
4494
4579
|
"""
|
4495
4580
|
Retrieves information on an order
|
4496
|
-
|
4497
|
-
|
4498
|
-
|
4499
|
-
|
4581
|
+
|
4582
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
|
4583
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
|
4584
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
|
4585
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
|
4586
|
+
|
4500
4587
|
:param str id: Order id
|
4501
4588
|
:param str symbol: Unified market symbol, *required for spot and margin*
|
4502
4589
|
:param dict [params]: Parameters specified by the exchange api
|
@@ -4539,8 +4626,10 @@ class gate(Exchange, ImplicitAPI):
|
|
4539
4626
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4540
4627
|
"""
|
4541
4628
|
fetch all unfilled currently open orders
|
4542
|
-
|
4543
|
-
|
4629
|
+
|
4630
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
|
4631
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
4632
|
+
|
4544
4633
|
:param str symbol: unified market symbol
|
4545
4634
|
:param int [since]: the earliest time in ms to fetch open orders for
|
4546
4635
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -4556,14 +4645,16 @@ class gate(Exchange, ImplicitAPI):
|
|
4556
4645
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4557
4646
|
"""
|
4558
4647
|
fetches information on multiple closed orders made by the user
|
4559
|
-
|
4560
|
-
|
4561
|
-
|
4562
|
-
|
4563
|
-
|
4564
|
-
|
4565
|
-
|
4566
|
-
|
4648
|
+
|
4649
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-orders
|
4650
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
4651
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
|
4652
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
|
4653
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
|
4654
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
|
4655
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
|
4656
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
|
4657
|
+
|
4567
4658
|
:param str symbol: unified market symbol of the market orders were made in
|
4568
4659
|
:param int [since]: the earliest time in ms to fetch orders for
|
4569
4660
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -4828,10 +4919,12 @@ class gate(Exchange, ImplicitAPI):
|
|
4828
4919
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
4829
4920
|
"""
|
4830
4921
|
Cancels an open order
|
4831
|
-
|
4832
|
-
|
4833
|
-
|
4834
|
-
|
4922
|
+
|
4923
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
|
4924
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
|
4925
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
|
4926
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
|
4927
|
+
|
4835
4928
|
:param str id: Order id
|
4836
4929
|
:param str symbol: Unified market symbol
|
4837
4930
|
:param dict [params]: Parameters specified by the exchange api
|
@@ -4953,8 +5046,10 @@ class gate(Exchange, ImplicitAPI):
|
|
4953
5046
|
def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
4954
5047
|
"""
|
4955
5048
|
cancel multiple orders
|
4956
|
-
|
4957
|
-
|
5049
|
+
|
5050
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
5051
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
|
5052
|
+
|
4958
5053
|
:param str[] ids: order ids
|
4959
5054
|
:param str symbol: unified symbol of the market the order was made in
|
4960
5055
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -4995,7 +5090,9 @@ class gate(Exchange, ImplicitAPI):
|
|
4995
5090
|
def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
|
4996
5091
|
"""
|
4997
5092
|
cancel multiple orders for multiple symbols
|
4998
|
-
|
5093
|
+
|
5094
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
5095
|
+
|
4999
5096
|
:param CancellationRequest[] orders: list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
5000
5097
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5001
5098
|
:param str[] [params.clientOrderIds]: client order ids
|
@@ -5031,10 +5128,12 @@ class gate(Exchange, ImplicitAPI):
|
|
5031
5128
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
5032
5129
|
"""
|
5033
5130
|
cancel all open orders
|
5034
|
-
|
5035
|
-
|
5036
|
-
|
5037
|
-
|
5131
|
+
|
5132
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
|
5133
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
|
5134
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
|
5135
|
+
https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
|
5136
|
+
|
5038
5137
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
5039
5138
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5040
5139
|
:param bool [params.unifiedAccount]: set to True for canceling unified account orders
|
@@ -5100,7 +5199,9 @@ class gate(Exchange, ImplicitAPI):
|
|
5100
5199
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
5101
5200
|
"""
|
5102
5201
|
transfer currency internally between wallets on the same account
|
5103
|
-
|
5202
|
+
|
5203
|
+
https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
|
5204
|
+
|
5104
5205
|
:param str code: unified currency code for currency being transferred
|
5105
5206
|
:param float amount: the amount of currency to transfer
|
5106
5207
|
:param str fromAccount: the account to transfer currency from
|
@@ -5176,8 +5277,10 @@ class gate(Exchange, ImplicitAPI):
|
|
5176
5277
|
def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
5177
5278
|
"""
|
5178
5279
|
set the level of leverage for a market
|
5179
|
-
|
5180
|
-
|
5280
|
+
|
5281
|
+
https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
|
5282
|
+
https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
|
5283
|
+
|
5181
5284
|
:param float leverage: the rate of leverage
|
5182
5285
|
:param str symbol: unified market symbol
|
5183
5286
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -5378,9 +5481,11 @@ class gate(Exchange, ImplicitAPI):
|
|
5378
5481
|
def fetch_position(self, symbol: str, params={}):
|
5379
5482
|
"""
|
5380
5483
|
fetch data on an open contract position
|
5381
|
-
|
5382
|
-
|
5383
|
-
|
5484
|
+
|
5485
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-single-position
|
5486
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
|
5487
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
|
5488
|
+
|
5384
5489
|
:param str symbol: unified market symbol of the market the position is held in
|
5385
5490
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5386
5491
|
:returns dict: a `position structure <https://docs.ccxt.com/#/?id=position-structure>`
|
@@ -5460,9 +5565,11 @@ class gate(Exchange, ImplicitAPI):
|
|
5460
5565
|
def fetch_positions(self, symbols: Strings = None, params={}):
|
5461
5566
|
"""
|
5462
5567
|
fetch all open positions
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5568
|
+
|
5569
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
|
5570
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
|
5571
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
|
5572
|
+
|
5466
5573
|
:param str[]|None symbols: Not used by gate, but parsed internally by CCXT
|
5467
5574
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5468
5575
|
:param str [params.settle]: 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
|
@@ -5560,8 +5667,10 @@ class gate(Exchange, ImplicitAPI):
|
|
5560
5667
|
def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
5561
5668
|
"""
|
5562
5669
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
5563
|
-
|
5564
|
-
|
5670
|
+
|
5671
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
5672
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
|
5673
|
+
|
5565
5674
|
:param str[] [symbols]: list of unified market symbols
|
5566
5675
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5567
5676
|
:returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
|
@@ -5675,7 +5784,9 @@ class gate(Exchange, ImplicitAPI):
|
|
5675
5784
|
def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
5676
5785
|
"""
|
5677
5786
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
5678
|
-
|
5787
|
+
|
5788
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
|
5789
|
+
|
5679
5790
|
:param str symbol: unified market symbol
|
5680
5791
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5681
5792
|
:returns dict: a `leverage tiers structure <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`
|
@@ -5700,7 +5811,8 @@ class gate(Exchange, ImplicitAPI):
|
|
5700
5811
|
#
|
5701
5812
|
return self.parse_market_leverage_tiers(response, market)
|
5702
5813
|
|
5703
|
-
def parse_emulated_leverage_tiers(self, info, market=None):
|
5814
|
+
def parse_emulated_leverage_tiers(self, info, market=None) -> List[LeverageTier]:
|
5815
|
+
marketId = self.safe_string(info, 'name')
|
5704
5816
|
maintenanceMarginUnit = self.safe_string(info, 'maintenance_rate') # '0.005',
|
5705
5817
|
leverageMax = self.safe_string(info, 'leverage_max') # '100',
|
5706
5818
|
riskLimitStep = self.safe_string(info, 'risk_limit_step') # '1000000',
|
@@ -5714,6 +5826,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5714
5826
|
cap = Precise.string_add(floor, riskLimitStep)
|
5715
5827
|
tiers.append({
|
5716
5828
|
'tier': self.parse_number(Precise.string_div(cap, riskLimitStep)),
|
5829
|
+
'symbol': self.safe_symbol(marketId, market, None, 'contract'),
|
5717
5830
|
'currency': self.safe_string(market, 'settle'),
|
5718
5831
|
'minNotional': self.parse_number(floor),
|
5719
5832
|
'maxNotional': self.parse_number(cap),
|
@@ -5747,6 +5860,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5747
5860
|
maxNotional = self.safe_number(item, 'risk_limit')
|
5748
5861
|
tiers.append({
|
5749
5862
|
'tier': self.sum(i, 1),
|
5863
|
+
'symbol': market['symbol'],
|
5750
5864
|
'currency': market['base'],
|
5751
5865
|
'minNotional': minNotional,
|
5752
5866
|
'maxNotional': maxNotional,
|
@@ -5760,7 +5874,9 @@ class gate(Exchange, ImplicitAPI):
|
|
5760
5874
|
def repay_isolated_margin(self, symbol: str, code: str, amount, params={}):
|
5761
5875
|
"""
|
5762
5876
|
repay borrowed margin and interest
|
5763
|
-
|
5877
|
+
|
5878
|
+
https://www.gate.io/docs/apiv4/en/#repay-a-loan
|
5879
|
+
|
5764
5880
|
:param str symbol: unified market symbol
|
5765
5881
|
:param str code: unified currency code of the currency to repay
|
5766
5882
|
:param float amount: the amount to repay
|
@@ -5787,11 +5903,12 @@ class gate(Exchange, ImplicitAPI):
|
|
5787
5903
|
def repay_cross_margin(self, code: str, amount, params={}):
|
5788
5904
|
"""
|
5789
5905
|
repay cross margin borrowed margin and interest
|
5790
|
-
|
5791
|
-
|
5906
|
+
|
5907
|
+
https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
|
5908
|
+
https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
|
5909
|
+
|
5792
5910
|
:param str code: unified currency code of the currency to repay
|
5793
5911
|
:param float amount: the amount to repay
|
5794
|
-
:param str symbol: unified market symbol, required for isolated margin
|
5795
5912
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5796
5913
|
:param str [params.mode]: 'all' or 'partial' payment mode, extra parameter required for isolated margin
|
5797
5914
|
:param str [params.id]: '34267567' loan id, extra parameter required for isolated margin
|
@@ -5835,10 +5952,12 @@ class gate(Exchange, ImplicitAPI):
|
|
5835
5952
|
def borrow_isolated_margin(self, symbol: str, code: str, amount: float, params={}):
|
5836
5953
|
"""
|
5837
5954
|
create a loan to borrow margin
|
5838
|
-
|
5955
|
+
|
5956
|
+
https://www.gate.io/docs/developers/apiv4/en/#marginuni
|
5957
|
+
|
5958
|
+
:param str symbol: unified market symbol, required for isolated margin
|
5839
5959
|
:param str code: unified currency code of the currency to borrow
|
5840
5960
|
:param float amount: the amount to borrow
|
5841
|
-
:param str symbol: unified market symbol, required for isolated margin
|
5842
5961
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5843
5962
|
:param str [params.rate]: '0.0002' or '0.002' extra parameter required for isolated margin
|
5844
5963
|
:returns dict: a `margin loan structure <https://docs.ccxt.com/#/?id=margin-loan-structure>`
|
@@ -5878,11 +5997,12 @@ class gate(Exchange, ImplicitAPI):
|
|
5878
5997
|
def borrow_cross_margin(self, code: str, amount: float, params={}):
|
5879
5998
|
"""
|
5880
5999
|
create a loan to borrow margin
|
5881
|
-
|
5882
|
-
|
6000
|
+
|
6001
|
+
https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
|
6002
|
+
https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
|
6003
|
+
|
5883
6004
|
:param str code: unified currency code of the currency to borrow
|
5884
6005
|
:param float amount: the amount to borrow
|
5885
|
-
:param str symbol: unified market symbol, required for isolated margin
|
5886
6006
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5887
6007
|
:param str [params.rate]: '0.0002' or '0.002' extra parameter required for isolated margin
|
5888
6008
|
:param boolean [params.unifiedAccount]: set to True for borrowing in the unified account
|
@@ -5975,9 +6095,11 @@ class gate(Exchange, ImplicitAPI):
|
|
5975
6095
|
def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
|
5976
6096
|
"""
|
5977
6097
|
fetch the interest owed by the user for borrowing currency for margin trading
|
5978
|
-
|
5979
|
-
|
5980
|
-
|
6098
|
+
|
6099
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
|
6100
|
+
https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
|
6101
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
|
6102
|
+
|
5981
6103
|
:param str [code]: unified currency code
|
5982
6104
|
:param str [symbol]: unified market symbol when fetching interest in isolated markets
|
5983
6105
|
:param int [since]: the earliest time in ms to fetch borrow interest for
|
@@ -6169,8 +6291,10 @@ class gate(Exchange, ImplicitAPI):
|
|
6169
6291
|
def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
6170
6292
|
"""
|
6171
6293
|
remove margin from a position
|
6172
|
-
|
6173
|
-
|
6294
|
+
|
6295
|
+
https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
6296
|
+
https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
|
6297
|
+
|
6174
6298
|
:param str symbol: unified market symbol
|
6175
6299
|
:param float amount: the amount of margin to remove
|
6176
6300
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6181,8 +6305,10 @@ class gate(Exchange, ImplicitAPI):
|
|
6181
6305
|
def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
6182
6306
|
"""
|
6183
6307
|
add margin
|
6184
|
-
|
6185
|
-
|
6308
|
+
|
6309
|
+
https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
6310
|
+
https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
|
6311
|
+
|
6186
6312
|
:param str symbol: unified market symbol
|
6187
6313
|
:param float amount: amount of margin to add
|
6188
6314
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -6193,7 +6319,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6193
6319
|
def fetch_open_interest_history(self, symbol: str, timeframe='5m', since: Int = None, limit: Int = None, params={}):
|
6194
6320
|
"""
|
6195
6321
|
Retrieves the open interest of a currency
|
6196
|
-
|
6322
|
+
|
6323
|
+
https://www.gate.io/docs/developers/apiv4/en/#futures-stats
|
6324
|
+
|
6197
6325
|
:param str symbol: Unified CCXT market symbol
|
6198
6326
|
:param str timeframe: "5m", "15m", "30m", "1h", "4h", "1d"
|
6199
6327
|
:param int [since]: the time(ms) of the earliest record to retrieve unix timestamp
|
@@ -6275,7 +6403,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6275
6403
|
def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6276
6404
|
"""
|
6277
6405
|
fetches historical settlement records
|
6278
|
-
|
6406
|
+
|
6407
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
|
6408
|
+
|
6279
6409
|
:param str symbol: unified market symbol of the settlement history, required on gate
|
6280
6410
|
:param int [since]: timestamp in ms
|
6281
6411
|
:param int [limit]: number of records
|
@@ -6319,7 +6449,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6319
6449
|
def fetch_my_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6320
6450
|
"""
|
6321
6451
|
fetches historical settlement records of the user
|
6322
|
-
|
6452
|
+
|
6453
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
|
6454
|
+
|
6323
6455
|
:param str symbol: unified market symbol of the settlement history
|
6324
6456
|
:param int [since]: timestamp in ms
|
6325
6457
|
:param int [limit]: number of records
|
@@ -6442,11 +6574,13 @@ class gate(Exchange, ImplicitAPI):
|
|
6442
6574
|
def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
|
6443
6575
|
"""
|
6444
6576
|
fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
6445
|
-
|
6446
|
-
|
6447
|
-
|
6448
|
-
|
6449
|
-
|
6577
|
+
|
6578
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-account-book
|
6579
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
|
6580
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
6581
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
6582
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
|
6583
|
+
|
6450
6584
|
:param str [code]: unified currency code
|
6451
6585
|
:param int [since]: timestamp in ms of the earliest ledger entry
|
6452
6586
|
:param int [limit]: max number of ledger entries to return
|
@@ -6671,7 +6805,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6671
6805
|
def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
6672
6806
|
"""
|
6673
6807
|
set dual/hedged mode to True or False for a swap market, make sure all positions are closed and no orders are open before setting dual mode
|
6674
|
-
|
6808
|
+
|
6809
|
+
https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
|
6810
|
+
|
6675
6811
|
:param bool hedged: set to True to enable dual mode
|
6676
6812
|
:param str|None symbol: if passed, dual mode is set for all markets with the same settle currency
|
6677
6813
|
:param dict params: extra parameters specific to the exchange API endpoint
|
@@ -6686,7 +6822,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6686
6822
|
def fetch_underlying_assets(self, params={}):
|
6687
6823
|
"""
|
6688
6824
|
fetches the market ids of underlying assets for a specific contract market type
|
6689
|
-
|
6825
|
+
|
6826
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
|
6827
|
+
|
6690
6828
|
:param dict [params]: exchange specific params
|
6691
6829
|
:param str [params.type]: the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
6692
6830
|
:returns dict[]: a list of `underlying assets <https://docs.ccxt.com/#/?id=underlying-assets-structure>`
|
@@ -6719,7 +6857,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6719
6857
|
def fetch_liquidations(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
6720
6858
|
"""
|
6721
6859
|
retrieves the public liquidations of a trading pair
|
6722
|
-
|
6860
|
+
|
6861
|
+
https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
|
6862
|
+
|
6723
6863
|
:param str symbol: unified CCXT market symbol
|
6724
6864
|
:param int [since]: the earliest time in ms to fetch liquidations for
|
6725
6865
|
:param int [limit]: the maximum number of liquidation structures to retrieve
|
@@ -6758,9 +6898,11 @@ class gate(Exchange, ImplicitAPI):
|
|
6758
6898
|
def fetch_my_liquidations(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
6759
6899
|
"""
|
6760
6900
|
retrieves the users liquidated positions
|
6761
|
-
|
6762
|
-
|
6763
|
-
|
6901
|
+
|
6902
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
|
6903
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
|
6904
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
|
6905
|
+
|
6764
6906
|
:param str symbol: unified CCXT market symbol
|
6765
6907
|
:param int [since]: the earliest time in ms to fetch liquidations for
|
6766
6908
|
:param int [limit]: the maximum number of liquidation structures to retrieve
|
@@ -6893,7 +7035,9 @@ class gate(Exchange, ImplicitAPI):
|
|
6893
7035
|
def fetch_greeks(self, symbol: str, params={}) -> Greeks:
|
6894
7036
|
"""
|
6895
7037
|
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
6896
|
-
|
7038
|
+
|
7039
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
7040
|
+
|
6897
7041
|
:param str symbol: unified symbol of the market to fetch greeks for
|
6898
7042
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6899
7043
|
:returns dict: a `greeks structure <https://docs.ccxt.com/#/?id=greeks-structure>`
|
@@ -6982,9 +7126,11 @@ class gate(Exchange, ImplicitAPI):
|
|
6982
7126
|
def close_position(self, symbol: str, side: OrderSide = None, params={}) -> Order:
|
6983
7127
|
"""
|
6984
7128
|
closes open positions for a market
|
6985
|
-
|
6986
|
-
|
6987
|
-
|
7129
|
+
|
7130
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
|
7131
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
|
7132
|
+
https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
|
7133
|
+
|
6988
7134
|
:param str symbol: Unified CCXT market symbol
|
6989
7135
|
:param str side: 'buy' or 'sell'
|
6990
7136
|
:param dict [params]: extra parameters specific to the okx api endpoint
|
@@ -7001,9 +7147,11 @@ class gate(Exchange, ImplicitAPI):
|
|
7001
7147
|
def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
7002
7148
|
"""
|
7003
7149
|
fetch the set leverage for a market
|
7004
|
-
|
7005
|
-
|
7006
|
-
|
7150
|
+
|
7151
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
|
7152
|
+
https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
|
7153
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
|
7154
|
+
|
7007
7155
|
:param str symbol: unified market symbol
|
7008
7156
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7009
7157
|
:param boolean [params.unified]: default False, set to True for fetching the unified accounts leverage
|
@@ -7103,8 +7251,10 @@ class gate(Exchange, ImplicitAPI):
|
|
7103
7251
|
def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
7104
7252
|
"""
|
7105
7253
|
fetch the set leverage for all leverage markets, only spot margin is supported on gate
|
7106
|
-
|
7107
|
-
|
7254
|
+
|
7255
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
|
7256
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
|
7257
|
+
|
7108
7258
|
:param str[] symbols: a list of unified market symbols
|
7109
7259
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7110
7260
|
:param boolean [params.unified]: default False, set to True for fetching unified account leverages
|
@@ -7161,7 +7311,9 @@ class gate(Exchange, ImplicitAPI):
|
|
7161
7311
|
def fetch_option(self, symbol: str, params={}) -> Option:
|
7162
7312
|
"""
|
7163
7313
|
fetches option data that is commonly found in an option chain
|
7164
|
-
|
7314
|
+
|
7315
|
+
https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
|
7316
|
+
|
7165
7317
|
:param str symbol: unified market symbol
|
7166
7318
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7167
7319
|
:returns dict: an `option chain structure <https://docs.ccxt.com/#/?id=option-chain-structure>`
|
@@ -7217,8 +7369,10 @@ class gate(Exchange, ImplicitAPI):
|
|
7217
7369
|
def fetch_option_chain(self, code: str, params={}) -> OptionChain:
|
7218
7370
|
"""
|
7219
7371
|
fetches data for an underlying asset that is commonly found in an option chain
|
7220
|
-
|
7221
|
-
|
7372
|
+
|
7373
|
+
https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
|
7374
|
+
|
7375
|
+
:param str code: base currency to fetch an option chain for
|
7222
7376
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
7223
7377
|
:param str [params.underlying]: the underlying asset, can be obtained from fetchUnderlyingAssets()
|
7224
7378
|
:param int [params.expiration]: unix timestamp of the expiration time
|
@@ -7341,18 +7495,20 @@ class gate(Exchange, ImplicitAPI):
|
|
7341
7495
|
def fetch_positions_history(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}) -> List[Position]:
|
7342
7496
|
"""
|
7343
7497
|
fetches historical positions
|
7344
|
-
|
7345
|
-
|
7498
|
+
|
7499
|
+
https://www.gate.io/docs/developers/apiv4/#list-position-close-history
|
7500
|
+
https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
|
7501
|
+
|
7346
7502
|
:param str[] symbols: unified conract symbols, must all have the same settle currency and the same market type
|
7347
7503
|
:param int [since]: the earliest time in ms to fetch positions for
|
7348
7504
|
:param int [limit]: the maximum amount of records to fetch, default=1000
|
7349
7505
|
:param dict params: extra parameters specific to the exchange api endpoint
|
7350
7506
|
:param int [params.until]: the latest time in ms to fetch positions for
|
7351
|
-
|
7352
|
-
|
7353
|
-
:param int offset: list offset, starting from 0
|
7354
|
-
:param str side: long or short
|
7355
|
-
:param str pnl: query profit or loss
|
7507
|
+
|
7508
|
+
EXCHANGE SPECIFIC PARAMETERS
|
7509
|
+
:param int [params.offset]: list offset, starting from 0
|
7510
|
+
:param str [params.side]: long or short
|
7511
|
+
:param str [params.pnl]: query profit or loss
|
7356
7512
|
:returns dict[]: a list of `position structures <https://docs.ccxt.com/#/?id=position-structure>`
|
7357
7513
|
"""
|
7358
7514
|
self.load_markets()
|