gate-io-api 0.0.65__py3-none-any.whl → 0.0.100__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.
Potentially problematic release.
This version of gate-io-api might be problematic. Click here for more details.
- gate/ccxt/__init__.py +2 -1
- gate/ccxt/abstract/gate.py +62 -18
- gate/ccxt/async_support/__init__.py +2 -1
- gate/ccxt/async_support/base/exchange.py +165 -27
- gate/ccxt/async_support/base/throttler.py +1 -1
- gate/ccxt/async_support/base/ws/client.py +194 -64
- gate/ccxt/async_support/base/ws/future.py +27 -50
- gate/ccxt/async_support/gate.py +356 -253
- gate/ccxt/base/decimal_to_precision.py +14 -10
- gate/ccxt/base/errors.py +6 -0
- gate/ccxt/base/exchange.py +606 -119
- gate/ccxt/base/types.py +4 -0
- gate/ccxt/gate.py +356 -253
- gate/ccxt/pro/__init__.py +2 -89
- gate/ccxt/pro/gate.py +14 -7
- {gate_io_api-0.0.65.dist-info → gate_io_api-0.0.100.dist-info}/METADATA +70 -25
- {gate_io_api-0.0.65.dist-info → gate_io_api-0.0.100.dist-info}/RECORD +18 -19
- gate/ccxt/async_support/base/ws/aiohttp_client.py +0 -147
- {gate_io_api-0.0.65.dist-info → gate_io_api-0.0.100.dist-info}/WHEEL +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# -----------------------------------------------------------------------------
|
|
4
4
|
|
|
5
|
-
__version__ = '4.
|
|
5
|
+
__version__ = '4.5.15'
|
|
6
6
|
|
|
7
7
|
# -----------------------------------------------------------------------------
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ from ccxt.async_support.base.throttler import Throttler
|
|
|
25
25
|
# -----------------------------------------------------------------------------
|
|
26
26
|
|
|
27
27
|
from ccxt.base.errors import BaseError, BadSymbol, BadRequest, BadResponse, ExchangeError, ExchangeNotAvailable, RequestTimeout, NotSupported, NullResponse, InvalidAddress, RateLimitExceeded, OperationFailed
|
|
28
|
-
from ccxt.base.types import ConstructorArgs, OrderType, OrderSide, OrderRequest, CancellationRequest
|
|
28
|
+
from ccxt.base.types import ConstructorArgs, OrderType, OrderSide, OrderRequest, CancellationRequest, Order
|
|
29
29
|
|
|
30
30
|
# -----------------------------------------------------------------------------
|
|
31
31
|
|
|
@@ -34,7 +34,7 @@ from ccxt.base.exchange import Exchange as BaseExchange, ArgumentsRequired
|
|
|
34
34
|
# -----------------------------------------------------------------------------
|
|
35
35
|
|
|
36
36
|
from ccxt.async_support.base.ws.functions import inflate, inflate64, gunzip
|
|
37
|
-
from ccxt.async_support.base.ws.
|
|
37
|
+
from ccxt.async_support.base.ws.client import Client
|
|
38
38
|
from ccxt.async_support.base.ws.future import Future
|
|
39
39
|
from ccxt.async_support.base.ws.order_book import OrderBook, IndexedOrderBook, CountedOrderBook
|
|
40
40
|
|
|
@@ -54,6 +54,15 @@ __all__ = [
|
|
|
54
54
|
]
|
|
55
55
|
|
|
56
56
|
# -----------------------------------------------------------------------------
|
|
57
|
+
# --- PROTO BUF IMPORTS
|
|
58
|
+
try:
|
|
59
|
+
from ccxt.protobuf.mexc import PushDataV3ApiWrapper_pb2
|
|
60
|
+
from google.protobuf.json_format import MessageToDict
|
|
61
|
+
except ImportError:
|
|
62
|
+
PushDataV3ApiWrapper_pb2 = None
|
|
63
|
+
MessageToDict = None
|
|
64
|
+
|
|
65
|
+
# -----------------------------------------------------------------------------
|
|
57
66
|
|
|
58
67
|
|
|
59
68
|
class Exchange(BaseExchange):
|
|
@@ -176,7 +185,7 @@ class Exchange(BaseExchange):
|
|
|
176
185
|
if (socksProxy not in self.socks_proxy_sessions):
|
|
177
186
|
# Create our SSL context object with our CA cert file
|
|
178
187
|
self.open() # ensure `asyncio_loop` is set
|
|
179
|
-
|
|
188
|
+
proxy_session = self.get_socks_proxy_session(socksProxy)
|
|
180
189
|
# add aiohttp_proxy for python as exclusion
|
|
181
190
|
elif self.aiohttp_proxy:
|
|
182
191
|
final_proxy = self.aiohttp_proxy
|
|
@@ -231,6 +240,8 @@ class Exchange(BaseExchange):
|
|
|
231
240
|
self.last_json_response = json_response
|
|
232
241
|
if self.verbose:
|
|
233
242
|
self.log("\nfetch Response:", self.id, method, url, http_status_code, "ResponseHeaders:", headers, "ResponseBody:", http_response)
|
|
243
|
+
if json_response and not isinstance(json_response, list) and self.returnResponseHeaders:
|
|
244
|
+
json_response['responseHeaders'] = headers
|
|
234
245
|
self.logger.debug("%s %s, Response: %s %s %s", method, url, http_status_code, headers, http_response)
|
|
235
246
|
|
|
236
247
|
except socket.gaierror as e:
|
|
@@ -282,7 +293,10 @@ class Exchange(BaseExchange):
|
|
|
282
293
|
currencies = None
|
|
283
294
|
if self.has['fetchCurrencies'] is True:
|
|
284
295
|
currencies = await self.fetch_currencies()
|
|
296
|
+
self.options['cachedCurrencies'] = currencies
|
|
285
297
|
markets = await self.fetch_markets(params)
|
|
298
|
+
if 'cachedCurrencies' in self.options:
|
|
299
|
+
del self.options['cachedCurrencies']
|
|
286
300
|
return self.set_markets(markets, currencies)
|
|
287
301
|
|
|
288
302
|
|
|
@@ -413,10 +427,11 @@ class Exchange(BaseExchange):
|
|
|
413
427
|
'verbose': self.verbose,
|
|
414
428
|
'throttle': Throttler(self.tokenBucket, self.asyncio_loop),
|
|
415
429
|
'asyncio_loop': self.asyncio_loop,
|
|
430
|
+
'decompressBinary': self.safe_bool(self.options, 'decompressBinary', True),
|
|
416
431
|
}, ws_options)
|
|
417
432
|
# we use aiohttp instead of fastClient now because of this
|
|
418
433
|
# https://github.com/ccxt/ccxt/pull/25995
|
|
419
|
-
self.clients[url] =
|
|
434
|
+
self.clients[url] = Client(url, on_message, on_error, on_close, on_connected, options)
|
|
420
435
|
# set http/s proxy (socks proxy should be set in other place)
|
|
421
436
|
httpProxy, httpsProxy, socksProxy = self.check_ws_proxy_settings()
|
|
422
437
|
if (httpProxy or httpsProxy):
|
|
@@ -568,6 +583,31 @@ class Exchange(BaseExchange):
|
|
|
568
583
|
return '0e-00'
|
|
569
584
|
return format(n, 'g')
|
|
570
585
|
|
|
586
|
+
def decode_proto_msg(self, data):
|
|
587
|
+
if not MessageToDict:
|
|
588
|
+
raise NotSupported(self.id + ' requires protobuf to decode messages, please install it with `pip install "protobuf==5.29.5"`')
|
|
589
|
+
message = PushDataV3ApiWrapper_pb2.PushDataV3ApiWrapper()
|
|
590
|
+
message.ParseFromString(data)
|
|
591
|
+
dict_msg = MessageToDict(message)
|
|
592
|
+
# {
|
|
593
|
+
# "channel":"spot@public.kline.v3.api.pb@BTCUSDT@Min1",
|
|
594
|
+
# "symbol":"BTCUSDT",
|
|
595
|
+
# "symbolId":"2fb942154ef44a4ab2ef98c8afb6a4a7",
|
|
596
|
+
# "createTime":"1754735110559",
|
|
597
|
+
# "publicSpotKline":{
|
|
598
|
+
# "interval":"Min1",
|
|
599
|
+
# "windowStart":"1754735100",
|
|
600
|
+
# "openingPrice":"117792.45",
|
|
601
|
+
# "closingPrice":"117805.32",
|
|
602
|
+
# "highestPrice":"117814.63",
|
|
603
|
+
# "lowestPrice":"117792.45",
|
|
604
|
+
# "volume":"0.13425465",
|
|
605
|
+
# "amount":"15815.77",
|
|
606
|
+
# "windowEnd":"1754735160"
|
|
607
|
+
# }
|
|
608
|
+
# }
|
|
609
|
+
return dict_msg
|
|
610
|
+
|
|
571
611
|
# ########################################################################
|
|
572
612
|
# ########################################################################
|
|
573
613
|
# ########################################################################
|
|
@@ -605,7 +645,7 @@ class Exchange(BaseExchange):
|
|
|
605
645
|
# ########################################################################
|
|
606
646
|
# ########################################################################
|
|
607
647
|
|
|
608
|
-
# METHODS BELOW THIS LINE ARE TRANSPILED FROM
|
|
648
|
+
# METHODS BELOW THIS LINE ARE TRANSPILED FROM TYPESCRIPT
|
|
609
649
|
|
|
610
650
|
async def fetch_accounts(self, params={}):
|
|
611
651
|
raise NotSupported(self.id + ' fetchAccounts() is not supported yet')
|
|
@@ -635,6 +675,9 @@ class Exchange(BaseExchange):
|
|
|
635
675
|
async def watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}):
|
|
636
676
|
raise NotSupported(self.id + ' watchTrades() is not supported yet')
|
|
637
677
|
|
|
678
|
+
async def un_watch_orders(self, symbol: Str = None, params={}):
|
|
679
|
+
raise NotSupported(self.id + ' unWatchOrders() is not supported yet')
|
|
680
|
+
|
|
638
681
|
async def un_watch_trades(self, symbol: str, params={}):
|
|
639
682
|
raise NotSupported(self.id + ' unWatchTrades() is not supported yet')
|
|
640
683
|
|
|
@@ -662,6 +705,18 @@ class Exchange(BaseExchange):
|
|
|
662
705
|
async def un_watch_order_book_for_symbols(self, symbols: List[str], params={}):
|
|
663
706
|
raise NotSupported(self.id + ' unWatchOrderBookForSymbols() is not supported yet')
|
|
664
707
|
|
|
708
|
+
async def un_watch_positions(self, symbols: Strings = None, params={}):
|
|
709
|
+
raise NotSupported(self.id + ' unWatchPositions() is not supported yet')
|
|
710
|
+
|
|
711
|
+
async def un_watch_ticker(self, symbol: str, params={}):
|
|
712
|
+
raise NotSupported(self.id + ' unWatchTicker() is not supported yet')
|
|
713
|
+
|
|
714
|
+
async def un_watch_mark_price(self, symbol: str, params={}):
|
|
715
|
+
raise NotSupported(self.id + ' unWatchMarkPrice() is not supported yet')
|
|
716
|
+
|
|
717
|
+
async def un_watch_mark_prices(self, symbols: Strings = None, params={}):
|
|
718
|
+
raise NotSupported(self.id + ' unWatchMarkPrices() is not supported yet')
|
|
719
|
+
|
|
665
720
|
async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
|
|
666
721
|
raise NotSupported(self.id + ' fetchDepositAddresses() is not supported yet')
|
|
667
722
|
|
|
@@ -731,13 +786,13 @@ class Exchange(BaseExchange):
|
|
|
731
786
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
|
|
732
787
|
raise NotSupported(self.id + ' transfer() is not supported yet')
|
|
733
788
|
|
|
734
|
-
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
|
789
|
+
async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}):
|
|
735
790
|
raise NotSupported(self.id + ' withdraw() is not supported yet')
|
|
736
791
|
|
|
737
792
|
async def create_deposit_address(self, code: str, params={}):
|
|
738
793
|
raise NotSupported(self.id + ' createDepositAddress() is not supported yet')
|
|
739
794
|
|
|
740
|
-
async def set_leverage(self, leverage:
|
|
795
|
+
async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
|
741
796
|
raise NotSupported(self.id + ' setLeverage() is not supported yet')
|
|
742
797
|
|
|
743
798
|
async def fetch_leverage(self, symbol: str, params={}):
|
|
@@ -786,7 +841,7 @@ class Exchange(BaseExchange):
|
|
|
786
841
|
async def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
|
787
842
|
raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
|
|
788
843
|
|
|
789
|
-
async def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
|
|
844
|
+
async def fetch_open_interest_history(self, symbol: str, timeframe: str = '1h', since: Int = None, limit: Int = None, params={}):
|
|
790
845
|
raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
|
|
791
846
|
|
|
792
847
|
async def fetch_open_interest(self, symbol: str, params={}):
|
|
@@ -822,19 +877,19 @@ class Exchange(BaseExchange):
|
|
|
822
877
|
async def repay_margin(self, code: str, amount: float, symbol: Str = None, params={}):
|
|
823
878
|
raise NotSupported(self.id + ' repayMargin is deprecated, please use repayCrossMargin or repayIsolatedMargin instead')
|
|
824
879
|
|
|
825
|
-
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
|
880
|
+
async def fetch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}):
|
|
826
881
|
message = ''
|
|
827
882
|
if self.has['fetchTrades']:
|
|
828
883
|
message = '. If you want to build OHLCV candles from trade executions data, visit https://github.com/ccxt/ccxt/tree/master/examples/ and see "build-ohlcv-bars" file'
|
|
829
884
|
raise NotSupported(self.id + ' fetchOHLCV() is not supported yet' + message)
|
|
830
885
|
|
|
831
|
-
async def fetch_ohlcv_ws(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
|
886
|
+
async def fetch_ohlcv_ws(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}):
|
|
832
887
|
message = ''
|
|
833
888
|
if self.has['fetchTradesWs']:
|
|
834
889
|
message = '. If you want to build OHLCV candles from trade executions data, visit https://github.com/ccxt/ccxt/tree/master/examples/ and see "build-ohlcv-bars" file'
|
|
835
890
|
raise NotSupported(self.id + ' fetchOHLCVWs() is not supported yet. Try using fetchOHLCV instead.' + message)
|
|
836
891
|
|
|
837
|
-
async def watch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
|
892
|
+
async def watch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}):
|
|
838
893
|
raise NotSupported(self.id + ' watchOHLCV() is not supported yet')
|
|
839
894
|
|
|
840
895
|
async def fetch_web_endpoint(self, method, endpointMethod, returnAsJson, startRegex=None, endRegex=None):
|
|
@@ -903,15 +958,15 @@ class Exchange(BaseExchange):
|
|
|
903
958
|
if self.enableRateLimit:
|
|
904
959
|
cost = self.calculate_rate_limiter_cost(api, method, path, params, config)
|
|
905
960
|
await self.throttle(cost)
|
|
961
|
+
retries = None
|
|
962
|
+
retries, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailure', 0)
|
|
963
|
+
retryDelay = None
|
|
964
|
+
retryDelay, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailureDelay', 0)
|
|
906
965
|
self.lastRestRequestTimestamp = self.milliseconds()
|
|
907
966
|
request = self.sign(path, api, method, params, headers, body)
|
|
908
967
|
self.last_request_headers = request['headers']
|
|
909
968
|
self.last_request_body = request['body']
|
|
910
969
|
self.last_request_url = request['url']
|
|
911
|
-
retries = None
|
|
912
|
-
retries, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailure', 0)
|
|
913
|
-
retryDelay = None
|
|
914
|
-
retryDelay, params = self.handle_option_and_params(params, path, 'maxRetriesOnFailureDelay', 0)
|
|
915
970
|
for i in range(0, retries + 1):
|
|
916
971
|
try:
|
|
917
972
|
return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
|
|
@@ -1171,7 +1226,7 @@ class Exchange(BaseExchange):
|
|
|
1171
1226
|
async def fetch_position_mode(self, symbol: Str = None, params={}):
|
|
1172
1227
|
raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
|
|
1173
1228
|
|
|
1174
|
-
async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
|
1229
|
+
async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
|
1175
1230
|
"""
|
|
1176
1231
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
|
1177
1232
|
:param str symbol: unified symbol of the market to create an order in
|
|
@@ -1193,7 +1248,7 @@ class Exchange(BaseExchange):
|
|
|
1193
1248
|
return await self.create_order(symbol, type, side, amount, price, params)
|
|
1194
1249
|
raise NotSupported(self.id + ' createTrailingAmountOrder() is not supported yet')
|
|
1195
1250
|
|
|
1196
|
-
async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
|
|
1251
|
+
async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
|
|
1197
1252
|
"""
|
|
1198
1253
|
create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
|
1199
1254
|
:param str symbol: unified symbol of the market to create an order in
|
|
@@ -1215,7 +1270,7 @@ class Exchange(BaseExchange):
|
|
|
1215
1270
|
return await self.create_order_ws(symbol, type, side, amount, price, params)
|
|
1216
1271
|
raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
|
|
1217
1272
|
|
|
1218
|
-
async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
|
1273
|
+
async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
|
1219
1274
|
"""
|
|
1220
1275
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
1221
1276
|
:param str symbol: unified symbol of the market to create an order in
|
|
@@ -1237,7 +1292,7 @@ class Exchange(BaseExchange):
|
|
|
1237
1292
|
return await self.create_order(symbol, type, side, amount, price, params)
|
|
1238
1293
|
raise NotSupported(self.id + ' createTrailingPercentOrder() is not supported yet')
|
|
1239
1294
|
|
|
1240
|
-
async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
|
|
1295
|
+
async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
|
|
1241
1296
|
"""
|
|
1242
1297
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
1243
1298
|
:param str symbol: unified symbol of the market to create an order in
|
|
@@ -1490,6 +1545,9 @@ class Exchange(BaseExchange):
|
|
|
1490
1545
|
async def cancel_order_ws(self, id: str, symbol: Str = None, params={}):
|
|
1491
1546
|
raise NotSupported(self.id + ' cancelOrderWs() is not supported yet')
|
|
1492
1547
|
|
|
1548
|
+
async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
|
1549
|
+
raise NotSupported(self.id + ' cancelOrders() is not supported yet')
|
|
1550
|
+
|
|
1493
1551
|
async def cancel_orders_ws(self, ids: List[str], symbol: Str = None, params={}):
|
|
1494
1552
|
raise NotSupported(self.id + ' cancelOrdersWs() is not supported yet')
|
|
1495
1553
|
|
|
@@ -1505,7 +1563,7 @@ class Exchange(BaseExchange):
|
|
|
1505
1563
|
async def cancel_all_orders_ws(self, symbol: Str = None, params={}):
|
|
1506
1564
|
raise NotSupported(self.id + ' cancelAllOrdersWs() is not supported yet')
|
|
1507
1565
|
|
|
1508
|
-
async def cancel_unified_order(self, order, params={}):
|
|
1566
|
+
async def cancel_unified_order(self, order: Order, params={}):
|
|
1509
1567
|
return self.cancel_order(self.safe_string(order, 'id'), self.safe_string(order, 'symbol'), params)
|
|
1510
1568
|
|
|
1511
1569
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
@@ -1567,6 +1625,9 @@ class Exchange(BaseExchange):
|
|
|
1567
1625
|
async def fetch_greeks(self, symbol: str, params={}):
|
|
1568
1626
|
raise NotSupported(self.id + ' fetchGreeks() is not supported yet')
|
|
1569
1627
|
|
|
1628
|
+
async def fetch_all_greeks(self, symbols: Strings = None, params={}):
|
|
1629
|
+
raise NotSupported(self.id + ' fetchAllGreeks() is not supported yet')
|
|
1630
|
+
|
|
1570
1631
|
async def fetch_option_chain(self, code: str, params={}):
|
|
1571
1632
|
raise NotSupported(self.id + ' fetchOptionChain() is not supported yet')
|
|
1572
1633
|
|
|
@@ -1587,10 +1648,10 @@ class Exchange(BaseExchange):
|
|
|
1587
1648
|
"""
|
|
1588
1649
|
raise NotSupported(self.id + ' fetchDepositsWithdrawals() is not supported yet')
|
|
1589
1650
|
|
|
1590
|
-
async def fetch_deposits(self,
|
|
1651
|
+
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1591
1652
|
raise NotSupported(self.id + ' fetchDeposits() is not supported yet')
|
|
1592
1653
|
|
|
1593
|
-
async def fetch_withdrawals(self,
|
|
1654
|
+
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1594
1655
|
raise NotSupported(self.id + ' fetchWithdrawals() is not supported yet')
|
|
1595
1656
|
|
|
1596
1657
|
async def fetch_deposits_ws(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
@@ -1801,7 +1862,7 @@ class Exchange(BaseExchange):
|
|
|
1801
1862
|
else:
|
|
1802
1863
|
raise NotSupported(self.id + ' fetchFundingInterval() is not supported yet')
|
|
1803
1864
|
|
|
1804
|
-
async def fetch_mark_ohlcv(self, symbol, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
|
1865
|
+
async def fetch_mark_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}):
|
|
1805
1866
|
"""
|
|
1806
1867
|
fetches historical mark price candlestick data containing the open, high, low, and close price of a market
|
|
1807
1868
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
@@ -1819,7 +1880,7 @@ class Exchange(BaseExchange):
|
|
|
1819
1880
|
else:
|
|
1820
1881
|
raise NotSupported(self.id + ' fetchMarkOHLCV() is not supported yet')
|
|
1821
1882
|
|
|
1822
|
-
async def fetch_index_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
|
1883
|
+
async def fetch_index_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}):
|
|
1823
1884
|
"""
|
|
1824
1885
|
fetches historical index price candlestick data containing the open, high, low, and close price of a market
|
|
1825
1886
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
@@ -1837,7 +1898,7 @@ class Exchange(BaseExchange):
|
|
|
1837
1898
|
else:
|
|
1838
1899
|
raise NotSupported(self.id + ' fetchIndexOHLCV() is not supported yet')
|
|
1839
1900
|
|
|
1840
|
-
async def fetch_premium_index_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
|
1901
|
+
async def fetch_premium_index_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params={}):
|
|
1841
1902
|
"""
|
|
1842
1903
|
fetches historical premium index price candlestick data containing the open, high, low, and close price of a market
|
|
1843
1904
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
@@ -1883,7 +1944,7 @@ class Exchange(BaseExchange):
|
|
|
1883
1944
|
calls = 0
|
|
1884
1945
|
result = []
|
|
1885
1946
|
errors = 0
|
|
1886
|
-
until = self.
|
|
1947
|
+
until = self.safe_integer_n(params, ['until', 'untill', 'till']) # do not omit it from params here
|
|
1887
1948
|
maxEntriesPerRequest, params = self.handle_max_entries_per_request_and_params(method, maxEntriesPerRequest, params)
|
|
1888
1949
|
if (paginationDirection == 'forward'):
|
|
1889
1950
|
if since is None:
|
|
@@ -2129,3 +2190,80 @@ class Exchange(BaseExchange):
|
|
|
2129
2190
|
:returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
|
|
2130
2191
|
"""
|
|
2131
2192
|
raise NotSupported(self.id + ' fetchTransfers() is not supported yet')
|
|
2193
|
+
|
|
2194
|
+
async def un_watch_ohlcv(self, symbol: str, timeframe: str = '1m', params={}):
|
|
2195
|
+
"""
|
|
2196
|
+
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
2197
|
+
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
2198
|
+
:param str timeframe: the length of time each candle represents
|
|
2199
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2200
|
+
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
|
2201
|
+
"""
|
|
2202
|
+
raise NotSupported(self.id + ' unWatchOHLCV() is not supported yet')
|
|
2203
|
+
|
|
2204
|
+
async def watch_mark_price(self, symbol: str, params={}):
|
|
2205
|
+
"""
|
|
2206
|
+
watches a mark price for a specific market
|
|
2207
|
+
:param str symbol: unified symbol of the market to fetch the ticker for
|
|
2208
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2209
|
+
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
2210
|
+
"""
|
|
2211
|
+
raise NotSupported(self.id + ' watchMarkPrice() is not supported yet')
|
|
2212
|
+
|
|
2213
|
+
async def watch_mark_prices(self, symbols: Strings = None, params={}):
|
|
2214
|
+
"""
|
|
2215
|
+
watches the mark price for all markets
|
|
2216
|
+
:param str[] symbols: unified symbol of the market to fetch the ticker for
|
|
2217
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2218
|
+
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
2219
|
+
"""
|
|
2220
|
+
raise NotSupported(self.id + ' watchMarkPrices() is not supported yet')
|
|
2221
|
+
|
|
2222
|
+
async def withdraw_ws(self, code: str, amount: float, address: str, tag: Str = None, params={}):
|
|
2223
|
+
"""
|
|
2224
|
+
make a withdrawal
|
|
2225
|
+
:param str code: unified currency code
|
|
2226
|
+
:param float amount: the amount to withdraw
|
|
2227
|
+
:param str address: the address to withdraw to
|
|
2228
|
+
:param str tag:
|
|
2229
|
+
:param dict [params]: extra parameters specific to the bitvavo api endpoint
|
|
2230
|
+
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
|
2231
|
+
"""
|
|
2232
|
+
raise NotSupported(self.id + ' withdrawWs() is not supported yet')
|
|
2233
|
+
|
|
2234
|
+
async def un_watch_my_trades(self, symbol: Str = None, params={}):
|
|
2235
|
+
"""
|
|
2236
|
+
unWatches information on multiple trades made by the user
|
|
2237
|
+
:param str symbol: unified market symbol of the market orders were made in
|
|
2238
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2239
|
+
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
|
2240
|
+
"""
|
|
2241
|
+
raise NotSupported(self.id + ' unWatchMyTrades() is not supported yet')
|
|
2242
|
+
|
|
2243
|
+
async def create_orders_ws(self, orders: List[OrderRequest], params={}):
|
|
2244
|
+
"""
|
|
2245
|
+
create a list of trade orders
|
|
2246
|
+
: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
|
|
2247
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2248
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
2249
|
+
"""
|
|
2250
|
+
raise NotSupported(self.id + ' createOrdersWs() is not supported yet')
|
|
2251
|
+
|
|
2252
|
+
async def fetch_orders_by_status_ws(self, status: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
2253
|
+
"""
|
|
2254
|
+
watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
|
2255
|
+
:param str symbol: unified symbol of the market to fetch the order book for
|
|
2256
|
+
:param int [limit]: the maximum amount of order book entries to return
|
|
2257
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2258
|
+
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
|
|
2259
|
+
"""
|
|
2260
|
+
raise NotSupported(self.id + ' fetchOrdersByStatusWs() is not supported yet')
|
|
2261
|
+
|
|
2262
|
+
async def un_watch_bids_asks(self, symbols: Strings = None, params={}):
|
|
2263
|
+
"""
|
|
2264
|
+
unWatches best bid & ask for symbols
|
|
2265
|
+
:param str[] symbols: unified symbol of the market to fetch the ticker for
|
|
2266
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
2267
|
+
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
2268
|
+
"""
|
|
2269
|
+
raise NotSupported(self.id + ' unWatchBidsAsks() is not supported yet')
|
|
@@ -42,7 +42,7 @@ class Throttler:
|
|
|
42
42
|
def __call__(self, cost=None):
|
|
43
43
|
future = asyncio.Future()
|
|
44
44
|
if len(self.queue) > self.config['maxCapacity']:
|
|
45
|
-
raise RuntimeError('throttle queue is over maxCapacity (' + str(int(self.config['maxCapacity'])) + '), see https://
|
|
45
|
+
raise RuntimeError('throttle queue is over maxCapacity (' + str(int(self.config['maxCapacity'])) + '), see https://docs.ccxt.com/#/README?id=maximum-requests-capacity')
|
|
46
46
|
self.queue.append((future, cost))
|
|
47
47
|
if not self.running:
|
|
48
48
|
self.running = True
|