exchanges-wrapper 1.2.9.post2__tar.gz → 1.2.10__tar.gz
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.
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/CHANGELOG.md +14 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/PKG-INFO +5 -3
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/README.md +1 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/example/exch_client.py +46 -1
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/example/ms_cfg.toml +0 -3
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/__init__.py +1 -1
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/api_pb2.py +74 -74
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/api_pb2_grpc.py +33 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/client.py +90 -36
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/exch_srv.py +50 -18
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/exch_srv_cfg.toml.template +26 -9
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/http_client.py +12 -16
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/okx_parser.py +0 -3
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/proto/exchanges_wrapper/api.proto +3 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/web_sockets.py +20 -78
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/pyproject.toml +3 -2
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/requirements.txt +3 -2
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/.deepsource.toml +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/.dockerignore +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/.github/FUNDING.yml +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/.github/dependabot.yml +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/Dockerfile +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/LICENSE.md +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/bitfinex_parser.py +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/c_structures.py +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/definitions.py +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/errors.py +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/events.py +0 -0
- {exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/huobi_parser.py +0 -0
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## v1.2.10 - 2023-02-22
|
|
2
|
+
### Added for new features
|
|
3
|
+
* Add method TransferToMaster():
|
|
4
|
+
|
|
5
|
+
>Send request to transfer asset from subaccount to main account
|
|
6
|
+
Binance, OKX: not additional settings needed
|
|
7
|
+
Bitfinex: for subaccount setting 2FA method, set WITHDRAWAL permission for API key,
|
|
8
|
+
in config for subaccount set 2FA key and master account EMail
|
|
9
|
+
Huobi: in config for subaccount set master_name for Main account
|
|
10
|
+
|
|
11
|
+
### Update
|
|
12
|
+
* Up requirements aiohttp to 3.8.4
|
|
13
|
+
* Some minor improvements
|
|
14
|
+
|
|
1
15
|
## v1.2.9-2 - 2023-02-04
|
|
2
16
|
### Fixed
|
|
3
17
|
* Fix DogsTailFarmer/martin-binance#50
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: exchanges-wrapper
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.10
|
|
4
4
|
Summary: REST API and WebSocket asyncio wrapper with grpc powered multiplexer server
|
|
5
5
|
Author-email: Thomas Marchand <thomas.marchand@tuta.io>, Jerry Fedorenko <jerry.fedorenko@yahoo.com>
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -11,11 +11,12 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
11
11
|
Classifier: Operating System :: Unix
|
|
12
12
|
Classifier: Operating System :: Microsoft :: Windows
|
|
13
13
|
Classifier: Operating System :: MacOS
|
|
14
|
-
Requires-Dist: aiohttp==3.8.
|
|
14
|
+
Requires-Dist: aiohttp==3.8.4
|
|
15
15
|
Requires-Dist: grpcio==1.48.1
|
|
16
16
|
Requires-Dist: grpcio-tools==1.48.1
|
|
17
17
|
Requires-Dist: toml==0.10.2
|
|
18
|
-
Requires-Dist: idna==3.
|
|
18
|
+
Requires-Dist: idna==3.4
|
|
19
|
+
Requires-Dist: pyotp~=2.8.0
|
|
19
20
|
Project-URL: Source, https://github.com/DogsTailFarmer/exchanges-wrapper
|
|
20
21
|
|
|
21
22
|
|
|
@@ -36,6 +37,7 @@ Project-URL: Source, https://github.com/DogsTailFarmer/exchanges-wrapper
|
|
|
36
37
|
<a href="https://sonarcloud.io/summary/new_code?id=DogsTailFarmer_exchanges-wrapper" target="_blank"><img alt="sonarcloud" title="sonarcloud" src="https://sonarcloud.io/api/project_badges/measure?project=DogsTailFarmer_exchanges-wrapper&metric=alert_status"/></a>
|
|
37
38
|
<a href="https://pepy.tech/project/exchanges-wrapper" target="_blank"><img alt="Downloads" title="Downloads" src="https://pepy.tech/badge/exchanges-wrapper/month"/></a>
|
|
38
39
|
***
|
|
40
|
+
From 1.2.10 update exch_srv_cfg.toml (see CHANGELOG for details)
|
|
39
41
|
***
|
|
40
42
|
|
|
41
43
|
## exchanges-wrapper vs binance.py
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
<a href="https://sonarcloud.io/summary/new_code?id=DogsTailFarmer_exchanges-wrapper" target="_blank"><img alt="sonarcloud" title="sonarcloud" src="https://sonarcloud.io/api/project_badges/measure?project=DogsTailFarmer_exchanges-wrapper&metric=alert_status"/></a>
|
|
17
17
|
<a href="https://pepy.tech/project/exchanges-wrapper" target="_blank"><img alt="Downloads" title="Downloads" src="https://pepy.tech/badge/exchanges-wrapper/month"/></a>
|
|
18
18
|
***
|
|
19
|
+
From 1.2.10 update exch_srv_cfg.toml (see CHANGELOG for details)
|
|
19
20
|
***
|
|
20
21
|
|
|
21
22
|
## exchanges-wrapper vs binance.py
|
|
@@ -127,6 +127,22 @@ async def on_order_update(_stub, _client_id, _symbol, trade_id):
|
|
|
127
127
|
f"client_order_id: {event.client_order_id}")
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
async def on_balance_update(_stub, _client_id, _symbol, trade_id):
|
|
131
|
+
"""
|
|
132
|
+
Get data when asset transferred or withdrawal from account
|
|
133
|
+
:param _stub:
|
|
134
|
+
:param _client_id:
|
|
135
|
+
:param _symbol:
|
|
136
|
+
:param trade_id:
|
|
137
|
+
:return:
|
|
138
|
+
"""
|
|
139
|
+
async for res in _stub.OnBalanceUpdate(api_pb2.MarketRequest(
|
|
140
|
+
trade_id=trade_id,
|
|
141
|
+
client_id=_client_id,
|
|
142
|
+
symbol=_symbol)):
|
|
143
|
+
print(res.balance)
|
|
144
|
+
|
|
145
|
+
|
|
130
146
|
async def fetch_open_orders(_stub, _client_id, _symbol):
|
|
131
147
|
"""
|
|
132
148
|
Get all open orders on a symbol.
|
|
@@ -306,6 +322,35 @@ async def fetch_account_trade_list(_stub, _client_id, _symbol, _limit, _start_ti
|
|
|
306
322
|
print(f"fetch_account_trade_list.trades: {trades}")
|
|
307
323
|
|
|
308
324
|
|
|
325
|
+
# noinspection PyUnresolvedReferences
|
|
326
|
+
async def transfer2master(_stub, symbol: str, amount: str):
|
|
327
|
+
"""
|
|
328
|
+
Send request to transfer asset from subaccount to main account
|
|
329
|
+
Binance, OKX: not additional settings needed
|
|
330
|
+
Bitfinex: for subaccount setting 2FA method, set WITHDRAWAL permission for API key,
|
|
331
|
+
in config for subaccount set 2FA key and master account EMail
|
|
332
|
+
Huobi: in config for subaccount set master_name for Main account
|
|
333
|
+
:param _stub:
|
|
334
|
+
:param symbol:
|
|
335
|
+
:param amount:
|
|
336
|
+
:return:
|
|
337
|
+
"""
|
|
338
|
+
try:
|
|
339
|
+
res = await _stub.TransferToMaster(api_pb2.MarketRequest, symbol=symbol, amount=amount)
|
|
340
|
+
except asyncio.CancelledError:
|
|
341
|
+
pass # Task cancellation should not be logged as an error
|
|
342
|
+
except grpc.RpcError as ex:
|
|
343
|
+
status_code = ex.code()
|
|
344
|
+
print(f"Exception transfer {symbol} to main account: {status_code.name}, {ex.details()}")
|
|
345
|
+
except Exception as _ex:
|
|
346
|
+
print(f"Exception transfer {symbol} to main account: {_ex}")
|
|
347
|
+
else:
|
|
348
|
+
if res.success:
|
|
349
|
+
print(f"Sent {amount} {symbol} to main account")
|
|
350
|
+
else:
|
|
351
|
+
print(f"Not sent {amount} {symbol} to main account\n,{res.result}")
|
|
352
|
+
|
|
353
|
+
|
|
309
354
|
# Server exception handling example for methods where it's realized
|
|
310
355
|
# noinspection PyUnresolvedReferences
|
|
311
356
|
async def create_limit_order(_stub, _client_id, _symbol, _id: int, buy: bool, amount: str, price: str):
|
|
@@ -314,7 +359,7 @@ async def create_limit_order(_stub, _client_id, _symbol, _id: int, buy: bool, am
|
|
|
314
359
|
:param _stub:
|
|
315
360
|
:param _client_id:
|
|
316
361
|
:param _symbol:
|
|
317
|
-
:param _id: A unique id among open orders. Automatically generated if not sent
|
|
362
|
+
:param _id: A unique id among open orders. Automatically generated if not sent
|
|
318
363
|
:param buy: True id BUY_side else False
|
|
319
364
|
:param amount: Base asset quantity
|
|
320
365
|
:param price:
|
|
@@ -12,7 +12,7 @@ __maintainer__ = "Jerry Fedorenko"
|
|
|
12
12
|
__contact__ = "https://github.com/DogsTailFarmer"
|
|
13
13
|
__email__ = "jerry.fedorenko@yahoo.com"
|
|
14
14
|
__credits__ = ["https://github.com/DanyaSWorlD"]
|
|
15
|
-
__version__ = "1.2.
|
|
15
|
+
__version__ = "1.2.10"
|
|
16
16
|
|
|
17
17
|
from pathlib import Path
|
|
18
18
|
import shutil
|
|
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x65xchanges_wrapper/api.proto\x12\x06martin\"*\n\x17OnBalanceUpdateResponse\x12\x0f\n\x07\x62\x61lance\x18\x01 \x01(\t\"\x83\x01\n\x19\x46\x65tchFundingWalletRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\r\n\x05\x61sset\x18\x03 \x01(\t\x12\x1a\n\x12need_btc_valuation\x18\x04 \x01(\x08\x12\x16\n\x0ereceive_window\x18\x05 \x01(\x03\"\xd0\x01\n\x1a\x46\x65tchFundingWalletResponse\x12=\n\x08\x62\x61lances\x18\x01 \x03(\x0b\x32+.martin.FetchFundingWalletResponse.Balances\x1as\n\x08\x42\x61lances\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12\x0c\n\x04\x66ree\x18\x02 \x01(\t\x12\x0e\n\x06locked\x18\x03 \x01(\t\x12\x0e\n\x06\x66reeze\x18\x04 \x01(\t\x12\x13\n\x0bwithdrawing\x18\x05 \x01(\t\x12\x15\n\rbtc_valuation\x18\x06 \x01(\t\"\xc7\x02\n\x13\x43\x61ncelOrderResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x19\n\x11origClientOrderId\x18\x02 \x01(\t\x12\x0f\n\x07orderId\x18\x03 \x01(\x04\x12\x13\n\x0borderListId\x18\x04 \x01(\x05\x12\x15\n\rclientOrderId\x18\x05 \x01(\t\x12\x14\n\x0ctransactTime\x18\x06 \x01(\x04\x12\r\n\x05price\x18\x07 \x01(\t\x12\x0f\n\x07origQty\x18\x08 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\t \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\n \x01(\t\x12\x0e\n\x06status\x18\x0b \x01(\t\x12\x13\n\x0btimeInForce\x18\x0c \x01(\t\x12\x0c\n\x04type\x18\r \x01(\t\x12\x0c\n\x04side\x18\x0e \x01(\t\x12\x1f\n\x17selfTradePreventionMode\x18\x0f \x01(\t\"[\n\x12\x43\x61ncelOrderRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08order_id\x18\x04 \x01(\x03\"\xf0\x02\n\x18\x43reateLimitOrderResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0f\n\x07orderId\x18\x02 \x01(\x04\x12\x13\n\x0borderListId\x18\x03 \x01(\x11\x12\x15\n\rclientOrderId\x18\x04 \x01(\t\x12\x14\n\x0ctransactTime\x18\x05 \x01(\x04\x12\r\n\x05price\x18\x06 \x01(\t\x12\x0f\n\x07origQty\x18\x07 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\x08 \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\t \x01(\t\x12\x0e\n\x06status\x18\n \x01(\t\x12\x13\n\x0btimeInForce\x18\x0b \x01(\t\x12\x0c\n\x04type\x18\x0c \x01(\t\x12\x0c\n\x04side\x18\r \x01(\t\x12\x12\n\nstrategyId\x18\x0e \x01(\x04\x12\x14\n\x0cstrategyType\x18\x0f \x01(\x04\x12\x13\n\x0bworkingTime\x18\x10 \x01(\x12\x12\x1f\n\x17selfTradePreventionMode\x18\x11 \x01(\t\"\x9e\x01\n\x17\x43reateLimitOrderRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08\x62uy_side\x18\x04 \x01(\x08\x12\x10\n\x08quantity\x18\x05 \x01(\t\x12\r\n\x05price\x18\x06 \x01(\t\x12\x1b\n\x13new_client_order_id\x18\x07 \x01(\x03\"\xf8\x05\n\x15OnOrderUpdateResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x17\n\x0f\x63lient_order_id\x18\x02 \x01(\t\x12\x0c\n\x04side\x18\x03 \x01(\t\x12\x12\n\norder_type\x18\x04 \x01(\t\x12\x15\n\rtime_in_force\x18\x05 \x01(\t\x12\x16\n\x0eorder_quantity\x18\x06 \x01(\t\x12\x13\n\x0border_price\x18\x07 \x01(\t\x12\x12\n\nstop_price\x18\x08 \x01(\t\x12\x18\n\x10iceberg_quantity\x18\t \x01(\t\x12\x15\n\rorder_list_id\x18\n \x01(\x11\x12\x1a\n\x12original_client_id\x18\x0b \x01(\t\x12\x16\n\x0e\x65xecution_type\x18\x0c \x01(\t\x12\x14\n\x0corder_status\x18\r \x01(\t\x12\x1b\n\x13order_reject_reason\x18\x0e \x01(\t\x12\x10\n\x08order_id\x18\x0f \x01(\x04\x12\x1e\n\x16last_executed_quantity\x18\x10 \x01(\t\x12\"\n\x1a\x63umulative_filled_quantity\x18\x11 \x01(\t\x12\x1b\n\x13last_executed_price\x18\x12 \x01(\t\x12\x19\n\x11\x63ommission_amount\x18\x13 \x01(\t\x12\x18\n\x10\x63ommission_asset\x18\x14 \x01(\t\x12\x18\n\x10transaction_time\x18\x15 \x01(\x04\x12\x10\n\x08trade_id\x18\x16 \x01(\x12\x12\x10\n\x08ignore_a\x18\x17 \x01(\x04\x12\x15\n\rin_order_book\x18\x18 \x01(\x08\x12\x15\n\ris_maker_side\x18\x19 \x01(\x08\x12\x10\n\x08ignore_b\x18\x1a \x01(\x08\x12\x1b\n\x13order_creation_time\x18\x1b \x01(\x04\x12\x1e\n\x16quote_asset_transacted\x18\x1c \x01(\t\x12#\n\x1blast_quote_asset_transacted\x18\x1d \x01(\t\x12\x1c\n\x14quote_order_quantity\x18\x1e \x01(\t\"&\n\x15OnFundsUpdateResponse\x12\r\n\x05\x66unds\x18\x01 \x01(\t\"t\n\x14OnFundsUpdateRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x12\n\nbase_asset\x18\x04 \x01(\t\x12\x13\n\x0bquote_asset\x18\x05 \x01(\t\"!\n\x0eSimpleResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"e\n\x16OnTickerUpdateResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x12\n\nopen_price\x18\x02 \x01(\t\x12\x13\n\x0b\x63lose_price\x18\x03 \x01(\t\x12\x12\n\nevent_time\x18\x04 \x01(\x04\"\xbd\x02\n\x18\x41\x63\x63ountTradeListResponse\x12\x35\n\x05items\x18\x01 \x03(\x0b\x32&.martin.AccountTradeListResponse.Trade\x1a\xe9\x01\n\x05Trade\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0f\n\x07orderId\x18\x03 \x01(\x04\x12\x13\n\x0borderListId\x18\x04 \x01(\x11\x12\r\n\x05price\x18\x05 \x01(\t\x12\x0b\n\x03qty\x18\x06 \x01(\t\x12\x10\n\x08quoteQty\x18\x07 \x01(\t\x12\x12\n\ncommission\x18\x08 \x01(\t\x12\x17\n\x0f\x63ommissionAsset\x18\t \x01(\t\x12\x0c\n\x04time\x18\n \x01(\x04\x12\x0f\n\x07isBuyer\x18\x0b \x01(\x08\x12\x0f\n\x07isMaker\x18\x0c \x01(\x08\x12\x13\n\x0bisBestMatch\x18\r \x01(\x08\"q\n\x17\x41\x63\x63ountTradeListRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\r\n\x05limit\x18\x04 \x01(\r\x12\x12\n\nstart_time\x18\x05 \x01(\x03\"%\n\x13\x46\x65tchKlinesResponse\x12\x0e\n\x06klines\x18\x01 \x03(\t\"J\n\x16OnKlinesUpdateResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x10\n\x08interval\x18\x02 \x01(\t\x12\x0e\n\x06\x63\x61ndle\x18\x03 \x01(\t\"j\n\x12\x46\x65tchKlinesRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08interval\x18\x04 \x01(\t\x12\r\n\x05limit\x18\x05 \x01(\r\"\xb7\x03\n(FetchTickerPriceChangeStatisticsResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x13\n\x0bpriceChange\x18\x02 \x01(\t\x12\x1a\n\x12priceChangePercent\x18\x03 \x01(\t\x12\x18\n\x10weightedAvgPrice\x18\x04 \x01(\t\x12\x16\n\x0eprevClosePrice\x18\x05 \x01(\t\x12\x11\n\tlastPrice\x18\x06 \x01(\t\x12\x0f\n\x07lastQty\x18\x07 \x01(\t\x12\x10\n\x08\x62idPrice\x18\x08 \x01(\t\x12\x0e\n\x06\x62idQty\x18\t \x01(\t\x12\x10\n\x08\x61skPrice\x18\n \x01(\t\x12\x0e\n\x06\x61skQty\x18\x0b \x01(\t\x12\x11\n\topenPrice\x18\x0c \x01(\t\x12\x11\n\thighPrice\x18\r \x01(\t\x12\x10\n\x08lowPrice\x18\x0e \x01(\t\x12\x0e\n\x06volume\x18\x0f \x01(\t\x12\x13\n\x0bquoteVolume\x18\x10 \x01(\t\x12\x10\n\x08openTime\x18\x11 \x01(\x04\x12\x11\n\tcloseTime\x18\x12 \x01(\x04\x12\x0f\n\x07\x66irstId\x18\x13 \x01(\x04\x12\x0e\n\x06lastId\x18\x14 \x01(\x04\x12\r\n\x05\x63ount\x18\x15 \x01(\x04\"?\n\x1e\x46\x65tchSymbolPriceTickerResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\r\n\x05price\x18\x02 \x01(\t\"J\n\x16\x46\x65tchOrderBookResponse\x12\x14\n\x0clastUpdateId\x18\x01 \x01(\x04\x12\x0c\n\x04\x62ids\x18\x02 \x03(\t\x12\x0c\n\x04\x61sks\x18\x03 \x03(\t\"\x96\x01\n\x1b\x46\x65tchAccountBalanceResponse\x12>\n\x08\x62\x61lances\x18\x01 \x03(\x0b\x32,.martin.FetchAccountBalanceResponse.Balances\x1a\x37\n\x08\x42\x61lances\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12\x0c\n\x04\x66ree\x18\x02 \x01(\t\x12\x0e\n\x06locked\x18\x03 \x01(\t\"\xd8\x13\n\x1f\x46\x65tchExchangeInfoSymbolResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x11\n\tbaseAsset\x18\x03 \x01(\t\x12\x1a\n\x12\x62\x61seAssetPrecision\x18\x04 \x01(\r\x12\x12\n\nquoteAsset\x18\x05 \x01(\t\x12\x16\n\x0equotePrecision\x18\x06 \x01(\r\x12\x1b\n\x13quoteAssetPrecision\x18\x07 \x01(\r\x12\x1f\n\x17\x62\x61seCommissionPrecision\x18\x08 \x01(\r\x12 \n\x18quoteCommissionPrecision\x18\t \x01(\r\x12\x12\n\norderTypes\x18\n \x03(\t\x12\x16\n\x0eicebergAllowed\x18\x0b \x01(\x08\x12\x12\n\nocoAllowed\x18\x0c \x01(\x08\x12\"\n\x1aquoteOrderQtyMarketAllowed\x18\r \x01(\x08\x12\x19\n\x11\x61llowTrailingStop\x18\x0e \x01(\x08\x12\x1c\n\x14\x63\x61ncelReplaceAllowed\x18\x0f \x01(\x08\x12\x1c\n\x14isSpotTradingAllowed\x18\x10 \x01(\x08\x12\x1e\n\x16isMarginTradingAllowed\x18\x11 \x01(\x08\x12@\n\x07\x66ilters\x18\x12 \x01(\x0b\x32/.martin.FetchExchangeInfoSymbolResponse.Filters\x12\x13\n\x0bpermissions\x18\x13 \x03(\t\x12&\n\x1e\x64\x65\x66\x61ultSelfTradePreventionMode\x18\x14 \x01(\t\x12\'\n\x1f\x61llowedSelfTradePreventionModes\x18\x15 \x03(\t\x1a\xd6\x0e\n\x07\x46ilters\x12V\n\x0cprice_filter\x18\x01 \x01(\x0b\x32;.martin.FetchExchangeInfoSymbolResponse.Filters.PriceFilterH\x00\x88\x01\x01\x12X\n\rpercent_price\x18\x02 \x01(\x0b\x32<.martin.FetchExchangeInfoSymbolResponse.Filters.PercentPriceH\x01\x88\x01\x01\x12N\n\x08lot_size\x18\x03 \x01(\x0b\x32\x37.martin.FetchExchangeInfoSymbolResponse.Filters.LotSizeH\x02\x88\x01\x01\x12V\n\x0cmin_notional\x18\x04 \x01(\x0b\x32;.martin.FetchExchangeInfoSymbolResponse.Filters.MinNotionalH\x03\x88\x01\x01\x12X\n\riceberg_parts\x18\x05 \x01(\x0b\x32<.martin.FetchExchangeInfoSymbolResponse.Filters.IcebergPartsH\x04\x88\x01\x01\x12[\n\x0fmarket_lot_size\x18\x06 \x01(\x0b\x32=.martin.FetchExchangeInfoSymbolResponse.Filters.MarketLotSizeH\x05\x88\x01\x01\x12Y\n\x0emax_num_orders\x18\x07 \x01(\x0b\x32<.martin.FetchExchangeInfoSymbolResponse.Filters.MaxNumOrdersH\x06\x88\x01\x01\x12\x62\n\x13max_num_algo_orders\x18\x08 \x01(\x0b\x32@.martin.FetchExchangeInfoSymbolResponse.Filters.MaxNumAlgoOrdersH\x07\x88\x01\x01\x12h\n\x16max_num_iceberg_orders\x18\t \x01(\x0b\x32\x43.martin.FetchExchangeInfoSymbolResponse.Filters.MaxNumIcebergOrdersH\x08\x88\x01\x01\x12V\n\x0cmax_position\x18\n \x01(\x0b\x32;.martin.FetchExchangeInfoSymbolResponse.Filters.MaxPositionH\t\x88\x01\x01\x1aW\n\x0bPriceFilter\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x10\n\x08minPrice\x18\x02 \x01(\t\x12\x10\n\x08maxPrice\x18\x03 \x01(\t\x12\x10\n\x08tickSize\x18\x04 \x01(\t\x1a\x66\n\x0cPercentPrice\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x14\n\x0cmultiplierUp\x18\x02 \x01(\t\x12\x16\n\x0emultiplierDown\x18\x03 \x01(\t\x12\x14\n\x0c\x61vgPriceMins\x18\x04 \x01(\r\x1aO\n\x07LotSize\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x0e\n\x06minQty\x18\x02 \x01(\t\x12\x0e\n\x06maxQty\x18\x03 \x01(\t\x12\x10\n\x08stepSize\x18\x04 \x01(\t\x1a\x63\n\x0bMinNotional\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x13\n\x0bminNotional\x18\x02 \x01(\t\x12\x15\n\rapplyToMarket\x18\x03 \x01(\x08\x12\x14\n\x0c\x61vgPriceMins\x18\x04 \x01(\r\x1a\x31\n\x0cIcebergParts\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\r\x1aU\n\rMarketLotSize\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x0e\n\x06minQty\x18\x02 \x01(\t\x12\x0e\n\x06maxQty\x18\x03 \x01(\t\x12\x10\n\x08stepSize\x18\x04 \x01(\t\x1a\x38\n\x0cMaxNumOrders\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x14\n\x0cmaxNumOrders\x18\x02 \x01(\r\x1a@\n\x10MaxNumAlgoOrders\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x18\n\x10maxNumAlgoOrders\x18\x02 \x01(\r\x1a\x46\n\x13MaxNumIcebergOrders\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x1b\n\x13maxNumIcebergOrders\x18\x02 \x01(\r\x1a\x36\n\x0bMaxPosition\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x13\n\x0bmaxPosition\x18\x02 \x01(\tB\x0f\n\r_price_filterB\x10\n\x0e_percent_priceB\x0b\n\t_lot_sizeB\x0f\n\r_min_notionalB\x10\n\x0e_iceberg_partsB\x12\n\x10_market_lot_sizeB\x11\n\x0f_max_num_ordersB\x16\n\x14_max_num_algo_ordersB\x19\n\x17_max_num_iceberg_ordersB\x0f\n\r_max_position\"\x97\x03\n\x17\x43\x61ncelAllOrdersResponse\x12:\n\x05items\x18\x01 \x03(\x0b\x32+.martin.CancelAllOrdersResponse.CancelOrder\x1a\xbf\x02\n\x0b\x43\x61ncelOrder\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x19\n\x11origClientOrderId\x18\x02 \x01(\t\x12\x0f\n\x07orderId\x18\x03 \x01(\x04\x12\x13\n\x0borderListId\x18\x04 \x01(\x05\x12\x15\n\rclientOrderId\x18\x05 \x01(\t\x12\x14\n\x0ctransactTime\x18\x06 \x01(\x04\x12\r\n\x05price\x18\x07 \x01(\t\x12\x0f\n\x07origQty\x18\x08 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\t \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\n \x01(\t\x12\x0e\n\x06status\x18\x0b \x01(\t\x12\x13\n\x0btimeInForce\x18\x0c \x01(\t\x12\x0c\n\x04type\x18\r \x01(\t\x12\x0c\n\x04side\x18\x0e \x01(\t\x12\x1f\n\x17selfTradePreventionMode\x18\x0f \x01(\t\"v\n\x11\x46\x65tchOrderRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08order_id\x18\x04 \x01(\x03\x12\x1a\n\x12\x66illed_update_call\x18\x05 \x01(\x08\"\xa1\x03\n\x12\x46\x65tchOrderResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0f\n\x07orderId\x18\x02 \x01(\x04\x12\x13\n\x0borderListId\x18\x03 \x01(\x11\x12\x15\n\rclientOrderId\x18\x04 \x01(\t\x12\r\n\x05price\x18\x05 \x01(\t\x12\x0f\n\x07origQty\x18\x06 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\x07 \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\x08 \x01(\t\x12\x0e\n\x06status\x18\t \x01(\t\x12\x13\n\x0btimeInForce\x18\n \x01(\t\x12\x0c\n\x04type\x18\x0b \x01(\t\x12\x0c\n\x04side\x18\x0c \x01(\t\x12\x11\n\tstopPrice\x18\r \x01(\t\x12\x12\n\nicebergQty\x18\x0e \x01(\t\x12\x0c\n\x04time\x18\x0f \x01(\x04\x12\x12\n\nupdateTime\x18\x10 \x01(\x04\x12\x11\n\tisWorking\x18\x11 \x01(\x08\x12\x13\n\x0bworkingTime\x18\x12 \x01(\x12\x12\x19\n\x11origQuoteOrderQty\x18\x13 \x01(\t\x12\x1f\n\x17selfTradePreventionMode\x18\x14 \x01(\t\"\xfc\x03\n\x17\x46\x65tchOpenOrdersResponse\x12\x14\n\x0crate_limiter\x18\x01 \x01(\x05\x12\x34\n\x05items\x18\x02 \x03(\x0b\x32%.martin.FetchOpenOrdersResponse.Order\x1a\x94\x03\n\x05Order\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0f\n\x07orderId\x18\x02 \x01(\x04\x12\x13\n\x0borderListId\x18\x03 \x01(\x11\x12\x15\n\rclientOrderId\x18\x04 \x01(\t\x12\r\n\x05price\x18\x05 \x01(\t\x12\x0f\n\x07origQty\x18\x06 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\x07 \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\x08 \x01(\t\x12\x0e\n\x06status\x18\t \x01(\t\x12\x13\n\x0btimeInForce\x18\n \x01(\t\x12\x0c\n\x04type\x18\x0b \x01(\t\x12\x0c\n\x04side\x18\x0c \x01(\t\x12\x11\n\tstopPrice\x18\r \x01(\t\x12\x12\n\nicebergQty\x18\x0e \x01(\t\x12\x0c\n\x04time\x18\x0f \x01(\x04\x12\x12\n\nupdateTime\x18\x10 \x01(\x04\x12\x11\n\tisWorking\x18\x11 \x01(\x08\x12\x19\n\x11origQuoteOrderQty\x18\x12 \x01(\t\x12\x13\n\x0bworkingTime\x18\x13 \x01(\x12\x12\x1f\n\x17selfTradePreventionMode\x18\x14 \x01(\t\"D\n\rMarketRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\"\x81\x01\n\x12StartStreamRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x1b\n\x13market_stream_count\x18\x04 \x01(\x05\x12\x19\n\x11user_stream_count\x18\x05 \x01(\x05\"[\n\x1bOpenClientConnectionRequest\x12\x10\n\x08trade_id\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63\x63ount_name\x18\x02 \x01(\t\x12\x14\n\x0crate_limiter\x18\x03 \x01(\x05\"z\n\x16OpenClientConnectionId\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x13\n\x0bsrv_version\x18\x03 \x01(\t\x12\x14\n\x0crate_limiter\x18\x04 \x01(\x05\x12\x10\n\x08\x65xchange\x18\x05 \x01(\t\"=\n\x16\x46\x65tchServerTimeRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\".\n\x17\x46\x65tchServerTimeResponse\x12\x13\n\x0bserver_time\x18\x01 \x01(\x04\x32\xc7\x0f\n\x06Martin\x12]\n\x14OpenClientConnection\x12#.martin.OpenClientConnectionRequest\x1a\x1e.martin.OpenClientConnectionId\"\x00\x12T\n\x0f\x46\x65tchServerTime\x12\x1e.martin.OpenClientConnectionId\x1a\x1f.martin.FetchServerTimeResponse\"\x00\x12K\n\x0f\x46\x65tchOpenOrders\x12\x15.martin.MarketRequest\x1a\x1f.martin.FetchOpenOrdersResponse\"\x00\x12K\n\x0f\x43\x61ncelAllOrders\x12\x15.martin.MarketRequest\x1a\x1f.martin.FetchOpenOrdersResponse\"\x00\x12[\n\x17\x46\x65tchExchangeInfoSymbol\x12\x15.martin.MarketRequest\x1a\'.martin.FetchExchangeInfoSymbolResponse\"\x00\x12`\n\x17\x46\x65tchAccountInformation\x12\x1e.martin.OpenClientConnectionId\x1a#.martin.FetchAccountBalanceResponse\"\x00\x12I\n\x0e\x46\x65tchOrderBook\x12\x15.martin.MarketRequest\x1a\x1e.martin.FetchOrderBookResponse\"\x00\x12Y\n\x16\x46\x65tchSymbolPriceTicker\x12\x15.martin.MarketRequest\x1a&.martin.FetchSymbolPriceTickerResponse\"\x00\x12m\n FetchTickerPriceChangeStatistics\x12\x15.martin.MarketRequest\x1a\x30.martin.FetchTickerPriceChangeStatisticsResponse\"\x00\x12H\n\x0b\x46\x65tchKlines\x12\x1a.martin.FetchKlinesRequest\x1a\x1b.martin.FetchKlinesResponse\"\x00\x12\\\n\x15\x46\x65tchAccountTradeList\x12\x1f.martin.AccountTradeListRequest\x1a .martin.AccountTradeListResponse\"\x00\x12K\n\x0eOnTickerUpdate\x12\x15.martin.MarketRequest\x1a\x1e.martin.OnTickerUpdateResponse\"\x00\x30\x01\x12N\n\x11OnOrderBookUpdate\x12\x15.martin.MarketRequest\x1a\x1e.martin.FetchOrderBookResponse\"\x00\x30\x01\x12=\n\nStopStream\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\x00\x12\x43\n\x0bStartStream\x12\x1a.martin.StartStreamRequest\x1a\x16.martin.SimpleResponse\"\x00\x12P\n\rOnFundsUpdate\x12\x1c.martin.OnFundsUpdateRequest\x1a\x1d.martin.OnFundsUpdateResponse\"\x00\x30\x01\x12M\n\x0fOnBalanceUpdate\x12\x15.martin.MarketRequest\x1a\x1f.martin.OnBalanceUpdateResponse\"\x00\x30\x01\x12I\n\rOnOrderUpdate\x12\x15.martin.MarketRequest\x1a\x1d.martin.OnOrderUpdateResponse\"\x00\x30\x01\x12W\n\x10\x43reateLimitOrder\x12\x1f.martin.CreateLimitOrderRequest\x1a .martin.CreateLimitOrderResponse\"\x00\x12H\n\x0b\x43\x61ncelOrder\x12\x1a.martin.CancelOrderRequest\x1a\x1b.martin.CancelOrderResponse\"\x00\x12\x45\n\nFetchOrder\x12\x19.martin.FetchOrderRequest\x1a\x1a.martin.FetchOrderResponse\"\x00\x12J\n\x0eResetRateLimit\x12\x1e.martin.OpenClientConnectionId\x1a\x16.martin.SimpleResponse\"\x00\x12P\n\x0eOnKlinesUpdate\x12\x1a.martin.FetchKlinesRequest\x1a\x1e.martin.OnKlinesUpdateResponse\"\x00\x30\x01\x12]\n\x12\x46\x65tchFundingWallet\x12!.martin.FetchFundingWalletRequest\x1a\".martin.FetchFundingWalletResponse\"\x00\x62\x06proto3')
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x65xchanges_wrapper/api.proto\x12\x06martin\"*\n\x17OnBalanceUpdateResponse\x12\x0f\n\x07\x62\x61lance\x18\x01 \x01(\t\"\x83\x01\n\x19\x46\x65tchFundingWalletRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\r\n\x05\x61sset\x18\x03 \x01(\t\x12\x1a\n\x12need_btc_valuation\x18\x04 \x01(\x08\x12\x16\n\x0ereceive_window\x18\x05 \x01(\x03\"\xd0\x01\n\x1a\x46\x65tchFundingWalletResponse\x12=\n\x08\x62\x61lances\x18\x01 \x03(\x0b\x32+.martin.FetchFundingWalletResponse.Balances\x1as\n\x08\x42\x61lances\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12\x0c\n\x04\x66ree\x18\x02 \x01(\t\x12\x0e\n\x06locked\x18\x03 \x01(\t\x12\x0e\n\x06\x66reeze\x18\x04 \x01(\t\x12\x13\n\x0bwithdrawing\x18\x05 \x01(\t\x12\x15\n\rbtc_valuation\x18\x06 \x01(\t\"\xc7\x02\n\x13\x43\x61ncelOrderResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x19\n\x11origClientOrderId\x18\x02 \x01(\t\x12\x0f\n\x07orderId\x18\x03 \x01(\x04\x12\x13\n\x0borderListId\x18\x04 \x01(\x05\x12\x15\n\rclientOrderId\x18\x05 \x01(\t\x12\x14\n\x0ctransactTime\x18\x06 \x01(\x04\x12\r\n\x05price\x18\x07 \x01(\t\x12\x0f\n\x07origQty\x18\x08 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\t \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\n \x01(\t\x12\x0e\n\x06status\x18\x0b \x01(\t\x12\x13\n\x0btimeInForce\x18\x0c \x01(\t\x12\x0c\n\x04type\x18\r \x01(\t\x12\x0c\n\x04side\x18\x0e \x01(\t\x12\x1f\n\x17selfTradePreventionMode\x18\x0f \x01(\t\"[\n\x12\x43\x61ncelOrderRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08order_id\x18\x04 \x01(\x03\"\xf0\x02\n\x18\x43reateLimitOrderResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0f\n\x07orderId\x18\x02 \x01(\x04\x12\x13\n\x0borderListId\x18\x03 \x01(\x11\x12\x15\n\rclientOrderId\x18\x04 \x01(\t\x12\x14\n\x0ctransactTime\x18\x05 \x01(\x04\x12\r\n\x05price\x18\x06 \x01(\t\x12\x0f\n\x07origQty\x18\x07 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\x08 \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\t \x01(\t\x12\x0e\n\x06status\x18\n \x01(\t\x12\x13\n\x0btimeInForce\x18\x0b \x01(\t\x12\x0c\n\x04type\x18\x0c \x01(\t\x12\x0c\n\x04side\x18\r \x01(\t\x12\x12\n\nstrategyId\x18\x0e \x01(\x04\x12\x14\n\x0cstrategyType\x18\x0f \x01(\x04\x12\x13\n\x0bworkingTime\x18\x10 \x01(\x12\x12\x1f\n\x17selfTradePreventionMode\x18\x11 \x01(\t\"\x9e\x01\n\x17\x43reateLimitOrderRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08\x62uy_side\x18\x04 \x01(\x08\x12\x10\n\x08quantity\x18\x05 \x01(\t\x12\r\n\x05price\x18\x06 \x01(\t\x12\x1b\n\x13new_client_order_id\x18\x07 \x01(\x03\"\xf8\x05\n\x15OnOrderUpdateResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x17\n\x0f\x63lient_order_id\x18\x02 \x01(\t\x12\x0c\n\x04side\x18\x03 \x01(\t\x12\x12\n\norder_type\x18\x04 \x01(\t\x12\x15\n\rtime_in_force\x18\x05 \x01(\t\x12\x16\n\x0eorder_quantity\x18\x06 \x01(\t\x12\x13\n\x0border_price\x18\x07 \x01(\t\x12\x12\n\nstop_price\x18\x08 \x01(\t\x12\x18\n\x10iceberg_quantity\x18\t \x01(\t\x12\x15\n\rorder_list_id\x18\n \x01(\x11\x12\x1a\n\x12original_client_id\x18\x0b \x01(\t\x12\x16\n\x0e\x65xecution_type\x18\x0c \x01(\t\x12\x14\n\x0corder_status\x18\r \x01(\t\x12\x1b\n\x13order_reject_reason\x18\x0e \x01(\t\x12\x10\n\x08order_id\x18\x0f \x01(\x04\x12\x1e\n\x16last_executed_quantity\x18\x10 \x01(\t\x12\"\n\x1a\x63umulative_filled_quantity\x18\x11 \x01(\t\x12\x1b\n\x13last_executed_price\x18\x12 \x01(\t\x12\x19\n\x11\x63ommission_amount\x18\x13 \x01(\t\x12\x18\n\x10\x63ommission_asset\x18\x14 \x01(\t\x12\x18\n\x10transaction_time\x18\x15 \x01(\x04\x12\x10\n\x08trade_id\x18\x16 \x01(\x12\x12\x10\n\x08ignore_a\x18\x17 \x01(\x04\x12\x15\n\rin_order_book\x18\x18 \x01(\x08\x12\x15\n\ris_maker_side\x18\x19 \x01(\x08\x12\x10\n\x08ignore_b\x18\x1a \x01(\x08\x12\x1b\n\x13order_creation_time\x18\x1b \x01(\x04\x12\x1e\n\x16quote_asset_transacted\x18\x1c \x01(\t\x12#\n\x1blast_quote_asset_transacted\x18\x1d \x01(\t\x12\x1c\n\x14quote_order_quantity\x18\x1e \x01(\t\"&\n\x15OnFundsUpdateResponse\x12\r\n\x05\x66unds\x18\x01 \x01(\t\"t\n\x14OnFundsUpdateRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x12\n\nbase_asset\x18\x04 \x01(\t\x12\x13\n\x0bquote_asset\x18\x05 \x01(\t\"1\n\x0eSimpleResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0e\n\x06result\x18\x02 \x01(\t\"e\n\x16OnTickerUpdateResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x12\n\nopen_price\x18\x02 \x01(\t\x12\x13\n\x0b\x63lose_price\x18\x03 \x01(\t\x12\x12\n\nevent_time\x18\x04 \x01(\x04\"\xbd\x02\n\x18\x41\x63\x63ountTradeListResponse\x12\x35\n\x05items\x18\x01 \x03(\x0b\x32&.martin.AccountTradeListResponse.Trade\x1a\xe9\x01\n\x05Trade\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0f\n\x07orderId\x18\x03 \x01(\x04\x12\x13\n\x0borderListId\x18\x04 \x01(\x11\x12\r\n\x05price\x18\x05 \x01(\t\x12\x0b\n\x03qty\x18\x06 \x01(\t\x12\x10\n\x08quoteQty\x18\x07 \x01(\t\x12\x12\n\ncommission\x18\x08 \x01(\t\x12\x17\n\x0f\x63ommissionAsset\x18\t \x01(\t\x12\x0c\n\x04time\x18\n \x01(\x04\x12\x0f\n\x07isBuyer\x18\x0b \x01(\x08\x12\x0f\n\x07isMaker\x18\x0c \x01(\x08\x12\x13\n\x0bisBestMatch\x18\r \x01(\x08\"q\n\x17\x41\x63\x63ountTradeListRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\r\n\x05limit\x18\x04 \x01(\r\x12\x12\n\nstart_time\x18\x05 \x01(\x03\"%\n\x13\x46\x65tchKlinesResponse\x12\x0e\n\x06klines\x18\x01 \x03(\t\"J\n\x16OnKlinesUpdateResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x10\n\x08interval\x18\x02 \x01(\t\x12\x0e\n\x06\x63\x61ndle\x18\x03 \x01(\t\"j\n\x12\x46\x65tchKlinesRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08interval\x18\x04 \x01(\t\x12\r\n\x05limit\x18\x05 \x01(\r\"\xb7\x03\n(FetchTickerPriceChangeStatisticsResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x13\n\x0bpriceChange\x18\x02 \x01(\t\x12\x1a\n\x12priceChangePercent\x18\x03 \x01(\t\x12\x18\n\x10weightedAvgPrice\x18\x04 \x01(\t\x12\x16\n\x0eprevClosePrice\x18\x05 \x01(\t\x12\x11\n\tlastPrice\x18\x06 \x01(\t\x12\x0f\n\x07lastQty\x18\x07 \x01(\t\x12\x10\n\x08\x62idPrice\x18\x08 \x01(\t\x12\x0e\n\x06\x62idQty\x18\t \x01(\t\x12\x10\n\x08\x61skPrice\x18\n \x01(\t\x12\x0e\n\x06\x61skQty\x18\x0b \x01(\t\x12\x11\n\topenPrice\x18\x0c \x01(\t\x12\x11\n\thighPrice\x18\r \x01(\t\x12\x10\n\x08lowPrice\x18\x0e \x01(\t\x12\x0e\n\x06volume\x18\x0f \x01(\t\x12\x13\n\x0bquoteVolume\x18\x10 \x01(\t\x12\x10\n\x08openTime\x18\x11 \x01(\x04\x12\x11\n\tcloseTime\x18\x12 \x01(\x04\x12\x0f\n\x07\x66irstId\x18\x13 \x01(\x04\x12\x0e\n\x06lastId\x18\x14 \x01(\x04\x12\r\n\x05\x63ount\x18\x15 \x01(\x04\"?\n\x1e\x46\x65tchSymbolPriceTickerResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\r\n\x05price\x18\x02 \x01(\t\"J\n\x16\x46\x65tchOrderBookResponse\x12\x14\n\x0clastUpdateId\x18\x01 \x01(\x04\x12\x0c\n\x04\x62ids\x18\x02 \x03(\t\x12\x0c\n\x04\x61sks\x18\x03 \x03(\t\"\x96\x01\n\x1b\x46\x65tchAccountBalanceResponse\x12>\n\x08\x62\x61lances\x18\x01 \x03(\x0b\x32,.martin.FetchAccountBalanceResponse.Balances\x1a\x37\n\x08\x42\x61lances\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12\x0c\n\x04\x66ree\x18\x02 \x01(\t\x12\x0e\n\x06locked\x18\x03 \x01(\t\"\xd8\x13\n\x1f\x46\x65tchExchangeInfoSymbolResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0e\n\x06status\x18\x02 \x01(\t\x12\x11\n\tbaseAsset\x18\x03 \x01(\t\x12\x1a\n\x12\x62\x61seAssetPrecision\x18\x04 \x01(\r\x12\x12\n\nquoteAsset\x18\x05 \x01(\t\x12\x16\n\x0equotePrecision\x18\x06 \x01(\r\x12\x1b\n\x13quoteAssetPrecision\x18\x07 \x01(\r\x12\x1f\n\x17\x62\x61seCommissionPrecision\x18\x08 \x01(\r\x12 \n\x18quoteCommissionPrecision\x18\t \x01(\r\x12\x12\n\norderTypes\x18\n \x03(\t\x12\x16\n\x0eicebergAllowed\x18\x0b \x01(\x08\x12\x12\n\nocoAllowed\x18\x0c \x01(\x08\x12\"\n\x1aquoteOrderQtyMarketAllowed\x18\r \x01(\x08\x12\x19\n\x11\x61llowTrailingStop\x18\x0e \x01(\x08\x12\x1c\n\x14\x63\x61ncelReplaceAllowed\x18\x0f \x01(\x08\x12\x1c\n\x14isSpotTradingAllowed\x18\x10 \x01(\x08\x12\x1e\n\x16isMarginTradingAllowed\x18\x11 \x01(\x08\x12@\n\x07\x66ilters\x18\x12 \x01(\x0b\x32/.martin.FetchExchangeInfoSymbolResponse.Filters\x12\x13\n\x0bpermissions\x18\x13 \x03(\t\x12&\n\x1e\x64\x65\x66\x61ultSelfTradePreventionMode\x18\x14 \x01(\t\x12\'\n\x1f\x61llowedSelfTradePreventionModes\x18\x15 \x03(\t\x1a\xd6\x0e\n\x07\x46ilters\x12V\n\x0cprice_filter\x18\x01 \x01(\x0b\x32;.martin.FetchExchangeInfoSymbolResponse.Filters.PriceFilterH\x00\x88\x01\x01\x12X\n\rpercent_price\x18\x02 \x01(\x0b\x32<.martin.FetchExchangeInfoSymbolResponse.Filters.PercentPriceH\x01\x88\x01\x01\x12N\n\x08lot_size\x18\x03 \x01(\x0b\x32\x37.martin.FetchExchangeInfoSymbolResponse.Filters.LotSizeH\x02\x88\x01\x01\x12V\n\x0cmin_notional\x18\x04 \x01(\x0b\x32;.martin.FetchExchangeInfoSymbolResponse.Filters.MinNotionalH\x03\x88\x01\x01\x12X\n\riceberg_parts\x18\x05 \x01(\x0b\x32<.martin.FetchExchangeInfoSymbolResponse.Filters.IcebergPartsH\x04\x88\x01\x01\x12[\n\x0fmarket_lot_size\x18\x06 \x01(\x0b\x32=.martin.FetchExchangeInfoSymbolResponse.Filters.MarketLotSizeH\x05\x88\x01\x01\x12Y\n\x0emax_num_orders\x18\x07 \x01(\x0b\x32<.martin.FetchExchangeInfoSymbolResponse.Filters.MaxNumOrdersH\x06\x88\x01\x01\x12\x62\n\x13max_num_algo_orders\x18\x08 \x01(\x0b\x32@.martin.FetchExchangeInfoSymbolResponse.Filters.MaxNumAlgoOrdersH\x07\x88\x01\x01\x12h\n\x16max_num_iceberg_orders\x18\t \x01(\x0b\x32\x43.martin.FetchExchangeInfoSymbolResponse.Filters.MaxNumIcebergOrdersH\x08\x88\x01\x01\x12V\n\x0cmax_position\x18\n \x01(\x0b\x32;.martin.FetchExchangeInfoSymbolResponse.Filters.MaxPositionH\t\x88\x01\x01\x1aW\n\x0bPriceFilter\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x10\n\x08minPrice\x18\x02 \x01(\t\x12\x10\n\x08maxPrice\x18\x03 \x01(\t\x12\x10\n\x08tickSize\x18\x04 \x01(\t\x1a\x66\n\x0cPercentPrice\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x14\n\x0cmultiplierUp\x18\x02 \x01(\t\x12\x16\n\x0emultiplierDown\x18\x03 \x01(\t\x12\x14\n\x0c\x61vgPriceMins\x18\x04 \x01(\r\x1aO\n\x07LotSize\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x0e\n\x06minQty\x18\x02 \x01(\t\x12\x0e\n\x06maxQty\x18\x03 \x01(\t\x12\x10\n\x08stepSize\x18\x04 \x01(\t\x1a\x63\n\x0bMinNotional\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x13\n\x0bminNotional\x18\x02 \x01(\t\x12\x15\n\rapplyToMarket\x18\x03 \x01(\x08\x12\x14\n\x0c\x61vgPriceMins\x18\x04 \x01(\r\x1a\x31\n\x0cIcebergParts\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\r\x1aU\n\rMarketLotSize\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x0e\n\x06minQty\x18\x02 \x01(\t\x12\x0e\n\x06maxQty\x18\x03 \x01(\t\x12\x10\n\x08stepSize\x18\x04 \x01(\t\x1a\x38\n\x0cMaxNumOrders\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x14\n\x0cmaxNumOrders\x18\x02 \x01(\r\x1a@\n\x10MaxNumAlgoOrders\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x18\n\x10maxNumAlgoOrders\x18\x02 \x01(\r\x1a\x46\n\x13MaxNumIcebergOrders\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x1b\n\x13maxNumIcebergOrders\x18\x02 \x01(\r\x1a\x36\n\x0bMaxPosition\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x13\n\x0bmaxPosition\x18\x02 \x01(\tB\x0f\n\r_price_filterB\x10\n\x0e_percent_priceB\x0b\n\t_lot_sizeB\x0f\n\r_min_notionalB\x10\n\x0e_iceberg_partsB\x12\n\x10_market_lot_sizeB\x11\n\x0f_max_num_ordersB\x16\n\x14_max_num_algo_ordersB\x19\n\x17_max_num_iceberg_ordersB\x0f\n\r_max_position\"\x97\x03\n\x17\x43\x61ncelAllOrdersResponse\x12:\n\x05items\x18\x01 \x03(\x0b\x32+.martin.CancelAllOrdersResponse.CancelOrder\x1a\xbf\x02\n\x0b\x43\x61ncelOrder\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x19\n\x11origClientOrderId\x18\x02 \x01(\t\x12\x0f\n\x07orderId\x18\x03 \x01(\x04\x12\x13\n\x0borderListId\x18\x04 \x01(\x05\x12\x15\n\rclientOrderId\x18\x05 \x01(\t\x12\x14\n\x0ctransactTime\x18\x06 \x01(\x04\x12\r\n\x05price\x18\x07 \x01(\t\x12\x0f\n\x07origQty\x18\x08 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\t \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\n \x01(\t\x12\x0e\n\x06status\x18\x0b \x01(\t\x12\x13\n\x0btimeInForce\x18\x0c \x01(\t\x12\x0c\n\x04type\x18\r \x01(\t\x12\x0c\n\x04side\x18\x0e \x01(\t\x12\x1f\n\x17selfTradePreventionMode\x18\x0f \x01(\t\"v\n\x11\x46\x65tchOrderRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x10\n\x08order_id\x18\x04 \x01(\x03\x12\x1a\n\x12\x66illed_update_call\x18\x05 \x01(\x08\"\xa1\x03\n\x12\x46\x65tchOrderResponse\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0f\n\x07orderId\x18\x02 \x01(\x04\x12\x13\n\x0borderListId\x18\x03 \x01(\x11\x12\x15\n\rclientOrderId\x18\x04 \x01(\t\x12\r\n\x05price\x18\x05 \x01(\t\x12\x0f\n\x07origQty\x18\x06 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\x07 \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\x08 \x01(\t\x12\x0e\n\x06status\x18\t \x01(\t\x12\x13\n\x0btimeInForce\x18\n \x01(\t\x12\x0c\n\x04type\x18\x0b \x01(\t\x12\x0c\n\x04side\x18\x0c \x01(\t\x12\x11\n\tstopPrice\x18\r \x01(\t\x12\x12\n\nicebergQty\x18\x0e \x01(\t\x12\x0c\n\x04time\x18\x0f \x01(\x04\x12\x12\n\nupdateTime\x18\x10 \x01(\x04\x12\x11\n\tisWorking\x18\x11 \x01(\x08\x12\x13\n\x0bworkingTime\x18\x12 \x01(\x12\x12\x19\n\x11origQuoteOrderQty\x18\x13 \x01(\t\x12\x1f\n\x17selfTradePreventionMode\x18\x14 \x01(\t\"\xfc\x03\n\x17\x46\x65tchOpenOrdersResponse\x12\x14\n\x0crate_limiter\x18\x01 \x01(\x05\x12\x34\n\x05items\x18\x02 \x03(\x0b\x32%.martin.FetchOpenOrdersResponse.Order\x1a\x94\x03\n\x05Order\x12\x0e\n\x06symbol\x18\x01 \x01(\t\x12\x0f\n\x07orderId\x18\x02 \x01(\x04\x12\x13\n\x0borderListId\x18\x03 \x01(\x11\x12\x15\n\rclientOrderId\x18\x04 \x01(\t\x12\r\n\x05price\x18\x05 \x01(\t\x12\x0f\n\x07origQty\x18\x06 \x01(\t\x12\x13\n\x0b\x65xecutedQty\x18\x07 \x01(\t\x12\x1b\n\x13\x63ummulativeQuoteQty\x18\x08 \x01(\t\x12\x0e\n\x06status\x18\t \x01(\t\x12\x13\n\x0btimeInForce\x18\n \x01(\t\x12\x0c\n\x04type\x18\x0b \x01(\t\x12\x0c\n\x04side\x18\x0c \x01(\t\x12\x11\n\tstopPrice\x18\r \x01(\t\x12\x12\n\nicebergQty\x18\x0e \x01(\t\x12\x0c\n\x04time\x18\x0f \x01(\x04\x12\x12\n\nupdateTime\x18\x10 \x01(\x04\x12\x11\n\tisWorking\x18\x11 \x01(\x08\x12\x19\n\x11origQuoteOrderQty\x18\x12 \x01(\t\x12\x13\n\x0bworkingTime\x18\x13 \x01(\x12\x12\x1f\n\x17selfTradePreventionMode\x18\x14 \x01(\t\"T\n\rMarketRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x0e\n\x06\x61mount\x18\x04 \x01(\t\"\x81\x01\n\x12StartStreamRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x0e\n\x06symbol\x18\x03 \x01(\t\x12\x1b\n\x13market_stream_count\x18\x04 \x01(\x05\x12\x19\n\x11user_stream_count\x18\x05 \x01(\x05\"[\n\x1bOpenClientConnectionRequest\x12\x10\n\x08trade_id\x18\x01 \x01(\t\x12\x14\n\x0c\x61\x63\x63ount_name\x18\x02 \x01(\t\x12\x14\n\x0crate_limiter\x18\x03 \x01(\x05\"z\n\x16OpenClientConnectionId\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\x12\x13\n\x0bsrv_version\x18\x03 \x01(\t\x12\x14\n\x0crate_limiter\x18\x04 \x01(\x05\x12\x10\n\x08\x65xchange\x18\x05 \x01(\t\"=\n\x16\x46\x65tchServerTimeRequest\x12\x11\n\tclient_id\x18\x01 \x01(\x03\x12\x10\n\x08trade_id\x18\x02 \x01(\t\".\n\x17\x46\x65tchServerTimeResponse\x12\x13\n\x0bserver_time\x18\x01 \x01(\x04\x32\x8c\x10\n\x06Martin\x12]\n\x14OpenClientConnection\x12#.martin.OpenClientConnectionRequest\x1a\x1e.martin.OpenClientConnectionId\"\x00\x12T\n\x0f\x46\x65tchServerTime\x12\x1e.martin.OpenClientConnectionId\x1a\x1f.martin.FetchServerTimeResponse\"\x00\x12K\n\x0f\x46\x65tchOpenOrders\x12\x15.martin.MarketRequest\x1a\x1f.martin.FetchOpenOrdersResponse\"\x00\x12K\n\x0f\x43\x61ncelAllOrders\x12\x15.martin.MarketRequest\x1a\x1f.martin.FetchOpenOrdersResponse\"\x00\x12[\n\x17\x46\x65tchExchangeInfoSymbol\x12\x15.martin.MarketRequest\x1a\'.martin.FetchExchangeInfoSymbolResponse\"\x00\x12`\n\x17\x46\x65tchAccountInformation\x12\x1e.martin.OpenClientConnectionId\x1a#.martin.FetchAccountBalanceResponse\"\x00\x12I\n\x0e\x46\x65tchOrderBook\x12\x15.martin.MarketRequest\x1a\x1e.martin.FetchOrderBookResponse\"\x00\x12Y\n\x16\x46\x65tchSymbolPriceTicker\x12\x15.martin.MarketRequest\x1a&.martin.FetchSymbolPriceTickerResponse\"\x00\x12m\n FetchTickerPriceChangeStatistics\x12\x15.martin.MarketRequest\x1a\x30.martin.FetchTickerPriceChangeStatisticsResponse\"\x00\x12H\n\x0b\x46\x65tchKlines\x12\x1a.martin.FetchKlinesRequest\x1a\x1b.martin.FetchKlinesResponse\"\x00\x12\\\n\x15\x46\x65tchAccountTradeList\x12\x1f.martin.AccountTradeListRequest\x1a .martin.AccountTradeListResponse\"\x00\x12K\n\x0eOnTickerUpdate\x12\x15.martin.MarketRequest\x1a\x1e.martin.OnTickerUpdateResponse\"\x00\x30\x01\x12N\n\x11OnOrderBookUpdate\x12\x15.martin.MarketRequest\x1a\x1e.martin.FetchOrderBookResponse\"\x00\x30\x01\x12=\n\nStopStream\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\x00\x12\x43\n\x0bStartStream\x12\x1a.martin.StartStreamRequest\x1a\x16.martin.SimpleResponse\"\x00\x12P\n\rOnFundsUpdate\x12\x1c.martin.OnFundsUpdateRequest\x1a\x1d.martin.OnFundsUpdateResponse\"\x00\x30\x01\x12M\n\x0fOnBalanceUpdate\x12\x15.martin.MarketRequest\x1a\x1f.martin.OnBalanceUpdateResponse\"\x00\x30\x01\x12I\n\rOnOrderUpdate\x12\x15.martin.MarketRequest\x1a\x1d.martin.OnOrderUpdateResponse\"\x00\x30\x01\x12W\n\x10\x43reateLimitOrder\x12\x1f.martin.CreateLimitOrderRequest\x1a .martin.CreateLimitOrderResponse\"\x00\x12H\n\x0b\x43\x61ncelOrder\x12\x1a.martin.CancelOrderRequest\x1a\x1b.martin.CancelOrderResponse\"\x00\x12\x45\n\nFetchOrder\x12\x19.martin.FetchOrderRequest\x1a\x1a.martin.FetchOrderResponse\"\x00\x12J\n\x0eResetRateLimit\x12\x1e.martin.OpenClientConnectionId\x1a\x16.martin.SimpleResponse\"\x00\x12P\n\x0eOnKlinesUpdate\x12\x1a.martin.FetchKlinesRequest\x1a\x1e.martin.OnKlinesUpdateResponse\"\x00\x30\x01\x12]\n\x12\x46\x65tchFundingWallet\x12!.martin.FetchFundingWalletRequest\x1a\".martin.FetchFundingWalletResponse\"\x00\x12\x43\n\x10TransferToMaster\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\x00\x62\x06proto3')
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -445,79 +445,79 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
|
445
445
|
_ONFUNDSUPDATEREQUEST._serialized_start=2186
|
|
446
446
|
_ONFUNDSUPDATEREQUEST._serialized_end=2302
|
|
447
447
|
_SIMPLERESPONSE._serialized_start=2304
|
|
448
|
-
_SIMPLERESPONSE._serialized_end=
|
|
449
|
-
_ONTICKERUPDATERESPONSE._serialized_start=
|
|
450
|
-
_ONTICKERUPDATERESPONSE._serialized_end=
|
|
451
|
-
_ACCOUNTTRADELISTRESPONSE._serialized_start=
|
|
452
|
-
_ACCOUNTTRADELISTRESPONSE._serialized_end=
|
|
453
|
-
_ACCOUNTTRADELISTRESPONSE_TRADE._serialized_start=
|
|
454
|
-
_ACCOUNTTRADELISTRESPONSE_TRADE._serialized_end=
|
|
455
|
-
_ACCOUNTTRADELISTREQUEST._serialized_start=
|
|
456
|
-
_ACCOUNTTRADELISTREQUEST._serialized_end=
|
|
457
|
-
_FETCHKLINESRESPONSE._serialized_start=
|
|
458
|
-
_FETCHKLINESRESPONSE._serialized_end=
|
|
459
|
-
_ONKLINESUPDATERESPONSE._serialized_start=
|
|
460
|
-
_ONKLINESUPDATERESPONSE._serialized_end=
|
|
461
|
-
_FETCHKLINESREQUEST._serialized_start=
|
|
462
|
-
_FETCHKLINESREQUEST._serialized_end=
|
|
463
|
-
_FETCHTICKERPRICECHANGESTATISTICSRESPONSE._serialized_start=
|
|
464
|
-
_FETCHTICKERPRICECHANGESTATISTICSRESPONSE._serialized_end=
|
|
465
|
-
_FETCHSYMBOLPRICETICKERRESPONSE._serialized_start=
|
|
466
|
-
_FETCHSYMBOLPRICETICKERRESPONSE._serialized_end=
|
|
467
|
-
_FETCHORDERBOOKRESPONSE._serialized_start=
|
|
468
|
-
_FETCHORDERBOOKRESPONSE._serialized_end=
|
|
469
|
-
_FETCHACCOUNTBALANCERESPONSE._serialized_start=
|
|
470
|
-
_FETCHACCOUNTBALANCERESPONSE._serialized_end=
|
|
448
|
+
_SIMPLERESPONSE._serialized_end=2353
|
|
449
|
+
_ONTICKERUPDATERESPONSE._serialized_start=2355
|
|
450
|
+
_ONTICKERUPDATERESPONSE._serialized_end=2456
|
|
451
|
+
_ACCOUNTTRADELISTRESPONSE._serialized_start=2459
|
|
452
|
+
_ACCOUNTTRADELISTRESPONSE._serialized_end=2776
|
|
453
|
+
_ACCOUNTTRADELISTRESPONSE_TRADE._serialized_start=2543
|
|
454
|
+
_ACCOUNTTRADELISTRESPONSE_TRADE._serialized_end=2776
|
|
455
|
+
_ACCOUNTTRADELISTREQUEST._serialized_start=2778
|
|
456
|
+
_ACCOUNTTRADELISTREQUEST._serialized_end=2891
|
|
457
|
+
_FETCHKLINESRESPONSE._serialized_start=2893
|
|
458
|
+
_FETCHKLINESRESPONSE._serialized_end=2930
|
|
459
|
+
_ONKLINESUPDATERESPONSE._serialized_start=2932
|
|
460
|
+
_ONKLINESUPDATERESPONSE._serialized_end=3006
|
|
461
|
+
_FETCHKLINESREQUEST._serialized_start=3008
|
|
462
|
+
_FETCHKLINESREQUEST._serialized_end=3114
|
|
463
|
+
_FETCHTICKERPRICECHANGESTATISTICSRESPONSE._serialized_start=3117
|
|
464
|
+
_FETCHTICKERPRICECHANGESTATISTICSRESPONSE._serialized_end=3556
|
|
465
|
+
_FETCHSYMBOLPRICETICKERRESPONSE._serialized_start=3558
|
|
466
|
+
_FETCHSYMBOLPRICETICKERRESPONSE._serialized_end=3621
|
|
467
|
+
_FETCHORDERBOOKRESPONSE._serialized_start=3623
|
|
468
|
+
_FETCHORDERBOOKRESPONSE._serialized_end=3697
|
|
469
|
+
_FETCHACCOUNTBALANCERESPONSE._serialized_start=3700
|
|
470
|
+
_FETCHACCOUNTBALANCERESPONSE._serialized_end=3850
|
|
471
471
|
_FETCHACCOUNTBALANCERESPONSE_BALANCES._serialized_start=311
|
|
472
472
|
_FETCHACCOUNTBALANCERESPONSE_BALANCES._serialized_end=366
|
|
473
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE._serialized_start=
|
|
474
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE._serialized_end=
|
|
475
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS._serialized_start=
|
|
476
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS._serialized_end=
|
|
477
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PRICEFILTER._serialized_start=
|
|
478
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PRICEFILTER._serialized_end=
|
|
479
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PERCENTPRICE._serialized_start=
|
|
480
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PERCENTPRICE._serialized_end=
|
|
481
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_LOTSIZE._serialized_start=
|
|
482
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_LOTSIZE._serialized_end=
|
|
483
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MINNOTIONAL._serialized_start=
|
|
484
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MINNOTIONAL._serialized_end=
|
|
485
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_ICEBERGPARTS._serialized_start=
|
|
486
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_ICEBERGPARTS._serialized_end=
|
|
487
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MARKETLOTSIZE._serialized_start=
|
|
488
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MARKETLOTSIZE._serialized_end=
|
|
489
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMORDERS._serialized_start=
|
|
490
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMORDERS._serialized_end=
|
|
491
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMALGOORDERS._serialized_start=
|
|
492
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMALGOORDERS._serialized_end=
|
|
493
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMICEBERGORDERS._serialized_start=
|
|
494
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMICEBERGORDERS._serialized_end=
|
|
495
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXPOSITION._serialized_start=
|
|
496
|
-
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXPOSITION._serialized_end=
|
|
497
|
-
_CANCELALLORDERSRESPONSE._serialized_start=
|
|
498
|
-
_CANCELALLORDERSRESPONSE._serialized_end=
|
|
499
|
-
_CANCELALLORDERSRESPONSE_CANCELORDER._serialized_start=
|
|
500
|
-
_CANCELALLORDERSRESPONSE_CANCELORDER._serialized_end=
|
|
501
|
-
_FETCHORDERREQUEST._serialized_start=
|
|
502
|
-
_FETCHORDERREQUEST._serialized_end=
|
|
503
|
-
_FETCHORDERRESPONSE._serialized_start=
|
|
504
|
-
_FETCHORDERRESPONSE._serialized_end=
|
|
505
|
-
_FETCHOPENORDERSRESPONSE._serialized_start=
|
|
506
|
-
_FETCHOPENORDERSRESPONSE._serialized_end=
|
|
507
|
-
_FETCHOPENORDERSRESPONSE_ORDER._serialized_start=
|
|
508
|
-
_FETCHOPENORDERSRESPONSE_ORDER._serialized_end=
|
|
509
|
-
_MARKETREQUEST._serialized_start=
|
|
510
|
-
_MARKETREQUEST._serialized_end=
|
|
511
|
-
_STARTSTREAMREQUEST._serialized_start=
|
|
512
|
-
_STARTSTREAMREQUEST._serialized_end=
|
|
513
|
-
_OPENCLIENTCONNECTIONREQUEST._serialized_start=
|
|
514
|
-
_OPENCLIENTCONNECTIONREQUEST._serialized_end=
|
|
515
|
-
_OPENCLIENTCONNECTIONID._serialized_start=
|
|
516
|
-
_OPENCLIENTCONNECTIONID._serialized_end=
|
|
517
|
-
_FETCHSERVERTIMEREQUEST._serialized_start=
|
|
518
|
-
_FETCHSERVERTIMEREQUEST._serialized_end=
|
|
519
|
-
_FETCHSERVERTIMERESPONSE._serialized_start=
|
|
520
|
-
_FETCHSERVERTIMERESPONSE._serialized_end=
|
|
521
|
-
_MARTIN._serialized_start=
|
|
522
|
-
_MARTIN._serialized_end=
|
|
473
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE._serialized_start=3853
|
|
474
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE._serialized_end=6373
|
|
475
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS._serialized_start=4495
|
|
476
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS._serialized_end=6373
|
|
477
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PRICEFILTER._serialized_start=5420
|
|
478
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PRICEFILTER._serialized_end=5507
|
|
479
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PERCENTPRICE._serialized_start=5509
|
|
480
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PERCENTPRICE._serialized_end=5611
|
|
481
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_LOTSIZE._serialized_start=5613
|
|
482
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_LOTSIZE._serialized_end=5692
|
|
483
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MINNOTIONAL._serialized_start=5694
|
|
484
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MINNOTIONAL._serialized_end=5793
|
|
485
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_ICEBERGPARTS._serialized_start=5795
|
|
486
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_ICEBERGPARTS._serialized_end=5844
|
|
487
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MARKETLOTSIZE._serialized_start=5846
|
|
488
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MARKETLOTSIZE._serialized_end=5931
|
|
489
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMORDERS._serialized_start=5933
|
|
490
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMORDERS._serialized_end=5989
|
|
491
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMALGOORDERS._serialized_start=5991
|
|
492
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMALGOORDERS._serialized_end=6055
|
|
493
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMICEBERGORDERS._serialized_start=6057
|
|
494
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMICEBERGORDERS._serialized_end=6127
|
|
495
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXPOSITION._serialized_start=6129
|
|
496
|
+
_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXPOSITION._serialized_end=6183
|
|
497
|
+
_CANCELALLORDERSRESPONSE._serialized_start=6376
|
|
498
|
+
_CANCELALLORDERSRESPONSE._serialized_end=6783
|
|
499
|
+
_CANCELALLORDERSRESPONSE_CANCELORDER._serialized_start=6464
|
|
500
|
+
_CANCELALLORDERSRESPONSE_CANCELORDER._serialized_end=6783
|
|
501
|
+
_FETCHORDERREQUEST._serialized_start=6785
|
|
502
|
+
_FETCHORDERREQUEST._serialized_end=6903
|
|
503
|
+
_FETCHORDERRESPONSE._serialized_start=6906
|
|
504
|
+
_FETCHORDERRESPONSE._serialized_end=7323
|
|
505
|
+
_FETCHOPENORDERSRESPONSE._serialized_start=7326
|
|
506
|
+
_FETCHOPENORDERSRESPONSE._serialized_end=7834
|
|
507
|
+
_FETCHOPENORDERSRESPONSE_ORDER._serialized_start=7430
|
|
508
|
+
_FETCHOPENORDERSRESPONSE_ORDER._serialized_end=7834
|
|
509
|
+
_MARKETREQUEST._serialized_start=7836
|
|
510
|
+
_MARKETREQUEST._serialized_end=7920
|
|
511
|
+
_STARTSTREAMREQUEST._serialized_start=7923
|
|
512
|
+
_STARTSTREAMREQUEST._serialized_end=8052
|
|
513
|
+
_OPENCLIENTCONNECTIONREQUEST._serialized_start=8054
|
|
514
|
+
_OPENCLIENTCONNECTIONREQUEST._serialized_end=8145
|
|
515
|
+
_OPENCLIENTCONNECTIONID._serialized_start=8147
|
|
516
|
+
_OPENCLIENTCONNECTIONID._serialized_end=8269
|
|
517
|
+
_FETCHSERVERTIMEREQUEST._serialized_start=8271
|
|
518
|
+
_FETCHSERVERTIMEREQUEST._serialized_end=8332
|
|
519
|
+
_FETCHSERVERTIMERESPONSE._serialized_start=8334
|
|
520
|
+
_FETCHSERVERTIMERESPONSE._serialized_end=8380
|
|
521
|
+
_MARTIN._serialized_start=8383
|
|
522
|
+
_MARTIN._serialized_end=10443
|
|
523
523
|
# @@protoc_insertion_point(module_scope)
|
{exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/api_pb2_grpc.py
RENAMED
|
@@ -134,6 +134,11 @@ class MartinStub(object):
|
|
|
134
134
|
request_serializer=exchanges__wrapper_dot_api__pb2.FetchFundingWalletRequest.SerializeToString,
|
|
135
135
|
response_deserializer=exchanges__wrapper_dot_api__pb2.FetchFundingWalletResponse.FromString,
|
|
136
136
|
)
|
|
137
|
+
self.TransferToMaster = channel.unary_unary(
|
|
138
|
+
'/martin.Martin/TransferToMaster',
|
|
139
|
+
request_serializer=exchanges__wrapper_dot_api__pb2.MarketRequest.SerializeToString,
|
|
140
|
+
response_deserializer=exchanges__wrapper_dot_api__pb2.SimpleResponse.FromString,
|
|
141
|
+
)
|
|
137
142
|
|
|
138
143
|
|
|
139
144
|
class MartinServicer(object):
|
|
@@ -283,6 +288,12 @@ class MartinServicer(object):
|
|
|
283
288
|
context.set_details('Method not implemented!')
|
|
284
289
|
raise NotImplementedError('Method not implemented!')
|
|
285
290
|
|
|
291
|
+
def TransferToMaster(self, request, context):
|
|
292
|
+
"""Missing associated documentation comment in .proto file."""
|
|
293
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
294
|
+
context.set_details('Method not implemented!')
|
|
295
|
+
raise NotImplementedError('Method not implemented!')
|
|
296
|
+
|
|
286
297
|
|
|
287
298
|
def add_MartinServicer_to_server(servicer, server):
|
|
288
299
|
rpc_method_handlers = {
|
|
@@ -406,6 +417,11 @@ def add_MartinServicer_to_server(servicer, server):
|
|
|
406
417
|
request_deserializer=exchanges__wrapper_dot_api__pb2.FetchFundingWalletRequest.FromString,
|
|
407
418
|
response_serializer=exchanges__wrapper_dot_api__pb2.FetchFundingWalletResponse.SerializeToString,
|
|
408
419
|
),
|
|
420
|
+
'TransferToMaster': grpc.unary_unary_rpc_method_handler(
|
|
421
|
+
servicer.TransferToMaster,
|
|
422
|
+
request_deserializer=exchanges__wrapper_dot_api__pb2.MarketRequest.FromString,
|
|
423
|
+
response_serializer=exchanges__wrapper_dot_api__pb2.SimpleResponse.SerializeToString,
|
|
424
|
+
),
|
|
409
425
|
}
|
|
410
426
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
411
427
|
'martin.Martin', rpc_method_handlers)
|
|
@@ -823,3 +839,20 @@ class Martin(object):
|
|
|
823
839
|
exchanges__wrapper_dot_api__pb2.FetchFundingWalletResponse.FromString,
|
|
824
840
|
options, channel_credentials,
|
|
825
841
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
842
|
+
|
|
843
|
+
@staticmethod
|
|
844
|
+
def TransferToMaster(request,
|
|
845
|
+
target,
|
|
846
|
+
options=(),
|
|
847
|
+
channel_credentials=None,
|
|
848
|
+
call_credentials=None,
|
|
849
|
+
insecure=False,
|
|
850
|
+
compression=None,
|
|
851
|
+
wait_for_ready=None,
|
|
852
|
+
timeout=None,
|
|
853
|
+
metadata=None):
|
|
854
|
+
return grpc.experimental.unary_unary(request, target, '/martin.Martin/TransferToMaster',
|
|
855
|
+
exchanges__wrapper_dot_api__pb2.MarketRequest.SerializeToString,
|
|
856
|
+
exchanges__wrapper_dot_api__pb2.SimpleResponse.FromString,
|
|
857
|
+
options, channel_credentials,
|
|
858
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@@ -7,6 +7,7 @@ import asyncio
|
|
|
7
7
|
import logging
|
|
8
8
|
import time
|
|
9
9
|
from collections import defaultdict
|
|
10
|
+
import pyotp
|
|
10
11
|
|
|
11
12
|
from exchanges_wrapper.http_client import ClientBinance, ClientBFX, ClientHBP, ClientOKX
|
|
12
13
|
from exchanges_wrapper.errors import ExchangePyError
|
|
@@ -42,10 +43,11 @@ class Client:
|
|
|
42
43
|
endpoint_ws_public,
|
|
43
44
|
endpoint_api_auth,
|
|
44
45
|
endpoint_ws_auth,
|
|
45
|
-
ws_public_mbr
|
|
46
|
-
passphrase
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
ws_public_mbr,
|
|
47
|
+
passphrase,
|
|
48
|
+
master_email,
|
|
49
|
+
master_name,
|
|
50
|
+
two_fa
|
|
49
51
|
):
|
|
50
52
|
self.exchange = exchange
|
|
51
53
|
self.sub_account = sub_account
|
|
@@ -58,6 +60,9 @@ class Client:
|
|
|
58
60
|
self.endpoint_api_auth = endpoint_api_auth
|
|
59
61
|
self.endpoint_ws_auth = endpoint_ws_auth
|
|
60
62
|
self.ws_public_mbr = ws_public_mbr
|
|
63
|
+
self.master_email = master_email
|
|
64
|
+
self.master_name = master_name
|
|
65
|
+
self.two_fa = two_fa
|
|
61
66
|
#
|
|
62
67
|
self.session = aiohttp.ClientSession()
|
|
63
68
|
client_init_params = {
|
|
@@ -65,8 +70,6 @@ class Client:
|
|
|
65
70
|
'api_secret': api_secret,
|
|
66
71
|
'passphrase': passphrase,
|
|
67
72
|
'endpoint': endpoint_api_auth,
|
|
68
|
-
'user_agent': user_agent,
|
|
69
|
-
'proxy': proxy,
|
|
70
73
|
'session': self.session,
|
|
71
74
|
'exchange': exchange,
|
|
72
75
|
'sub_account': sub_account,
|
|
@@ -83,9 +86,7 @@ class Client:
|
|
|
83
86
|
self.http = ClientOKX(**client_init_params)
|
|
84
87
|
else:
|
|
85
88
|
raise UserWarning(f"Exchange {exchange} not yet connected")
|
|
86
|
-
|
|
87
|
-
self.user_agent = user_agent
|
|
88
|
-
self.proxy = proxy
|
|
89
|
+
#
|
|
89
90
|
self.loaded = False
|
|
90
91
|
self.symbols = {}
|
|
91
92
|
self.highest_precision = None
|
|
@@ -95,6 +96,9 @@ class Client:
|
|
|
95
96
|
self.wss_buffer = {}
|
|
96
97
|
self.stream_queue = defaultdict(set)
|
|
97
98
|
self.hbp_account_id = None
|
|
99
|
+
self.hbp_uid = None
|
|
100
|
+
self.hbp_main_account_id = None
|
|
101
|
+
self.hbp_main_uid = None
|
|
98
102
|
self.ledgers_id = []
|
|
99
103
|
|
|
100
104
|
async def load(self):
|
|
@@ -136,28 +140,14 @@ class Client:
|
|
|
136
140
|
|
|
137
141
|
user_data_stream = None
|
|
138
142
|
if self.exchange == 'binance':
|
|
139
|
-
user_data_stream = UserEventsDataStream(self,
|
|
140
|
-
self.endpoint_ws_auth,
|
|
141
|
-
self.user_agent,
|
|
142
|
-
self.exchange,
|
|
143
|
-
_trade_id)
|
|
143
|
+
user_data_stream = UserEventsDataStream(self, self.endpoint_ws_auth, self.exchange, _trade_id)
|
|
144
144
|
elif self.exchange == 'bitfinex':
|
|
145
|
-
user_data_stream = BfxPrivateEventsDataStream(self,
|
|
146
|
-
self.endpoint_ws_auth,
|
|
147
|
-
self.user_agent,
|
|
148
|
-
self.exchange,
|
|
149
|
-
_trade_id)
|
|
145
|
+
user_data_stream = BfxPrivateEventsDataStream(self, self.endpoint_ws_auth, self.exchange, _trade_id)
|
|
150
146
|
elif self.exchange == 'huobi':
|
|
151
|
-
user_data_stream = HbpPrivateEventsDataStream(self,
|
|
152
|
-
self.endpoint_ws_auth,
|
|
153
|
-
self.user_agent,
|
|
154
|
-
self.exchange,
|
|
155
|
-
_trade_id,
|
|
156
|
-
symbol)
|
|
147
|
+
user_data_stream = HbpPrivateEventsDataStream(self, self.endpoint_ws_auth, self.exchange, _trade_id, symbol)
|
|
157
148
|
elif self.exchange == 'okx':
|
|
158
149
|
user_data_stream = OkxPrivateEventsDataStream(self,
|
|
159
150
|
self.endpoint_ws_auth,
|
|
160
|
-
self.user_agent,
|
|
161
151
|
self.exchange,
|
|
162
152
|
_trade_id,
|
|
163
153
|
self.symbol_to_okx(symbol))
|
|
@@ -169,20 +159,14 @@ class Client:
|
|
|
169
159
|
_events = self.events.registered_streams.get(self.exchange, {}).get(_trade_id, set())
|
|
170
160
|
start_list = []
|
|
171
161
|
if self.exchange == 'binance':
|
|
172
|
-
market_data_stream = MarketEventsDataStream(self,
|
|
173
|
-
self.endpoint_ws_public,
|
|
174
|
-
self.user_agent,
|
|
175
|
-
self.exchange,
|
|
176
|
-
_trade_id)
|
|
162
|
+
market_data_stream = MarketEventsDataStream(self, self.endpoint_ws_public, self.exchange, _trade_id)
|
|
177
163
|
self.data_streams[_trade_id] |= {market_data_stream}
|
|
178
164
|
start_list.append(market_data_stream.start())
|
|
179
165
|
else:
|
|
180
166
|
for channel in _events:
|
|
181
167
|
market_data_stream = MarketEventsDataStream(self,
|
|
182
168
|
self.endpoint_ws_public,
|
|
183
|
-
self.
|
|
184
|
-
self.exchange,
|
|
185
|
-
_trade_id,
|
|
169
|
+
self.exchange, _trade_id,
|
|
186
170
|
channel)
|
|
187
171
|
self.data_streams[_trade_id] |= {market_data_stream}
|
|
188
172
|
start_list.append(market_data_stream.start())
|
|
@@ -196,7 +180,7 @@ class Client:
|
|
|
196
180
|
|
|
197
181
|
def assert_symbol_exists(self, symbol):
|
|
198
182
|
if self.loaded and symbol not in self.symbols:
|
|
199
|
-
raise ExchangePyError(f"Symbol {symbol} is not valid according to the loaded exchange infos
|
|
183
|
+
raise ExchangePyError(f"Symbol {symbol} is not valid according to the loaded exchange infos")
|
|
200
184
|
|
|
201
185
|
def symbol_to_bfx(self, symbol) -> str:
|
|
202
186
|
symbol_info = self.symbols.get(symbol)
|
|
@@ -311,6 +295,7 @@ class Client:
|
|
|
311
295
|
if account.get('type') == 'spot':
|
|
312
296
|
self.hbp_account_id = account.get('id')
|
|
313
297
|
break
|
|
298
|
+
self.hbp_uid = await self.http.send_api_call("v2/user/uid", signed=True)
|
|
314
299
|
binance_res = hbp.exchange_info(server_time.get('serverTime'), trading_symbols)
|
|
315
300
|
elif self.exchange == 'okx':
|
|
316
301
|
params = {'instType': 'SPOT'}
|
|
@@ -780,7 +765,7 @@ class Client:
|
|
|
780
765
|
if res[0].get('sCode') == '0':
|
|
781
766
|
binance_res = await self.fetch_order(symbol, order_id=res[0].get('ordId'), response_type=False)
|
|
782
767
|
else:
|
|
783
|
-
raise UserWarning(res[0].get('sMsg'))
|
|
768
|
+
raise UserWarning(f"Code: {res[0].get('sCode')}: {res[0].get('sMsg')}")
|
|
784
769
|
return binance_res
|
|
785
770
|
|
|
786
771
|
# https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#query-order-user_data
|
|
@@ -1314,6 +1299,75 @@ class Client:
|
|
|
1314
1299
|
binance_res = okx.funding_wallet(res)
|
|
1315
1300
|
return binance_res
|
|
1316
1301
|
|
|
1302
|
+
# https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account
|
|
1303
|
+
async def transfer_to_master(self, symbol, quantity, receive_window=None):
|
|
1304
|
+
binance_res = {}
|
|
1305
|
+
if self.exchange == 'binance':
|
|
1306
|
+
params = {"asset": symbol, "amount": quantity}
|
|
1307
|
+
if receive_window:
|
|
1308
|
+
params["recvWindow"] = receive_window
|
|
1309
|
+
binance_res = await self.http.send_api_call(
|
|
1310
|
+
"/sapi/v1/sub-account/transfer/subToMaster",
|
|
1311
|
+
"POST",
|
|
1312
|
+
params=params,
|
|
1313
|
+
signed=True
|
|
1314
|
+
)
|
|
1315
|
+
elif self.exchange == 'bitfinex':
|
|
1316
|
+
if self.master_email is None or self.two_fa is None:
|
|
1317
|
+
raise ValueError("This query requires master_email and 2FA")
|
|
1318
|
+
totp = pyotp.TOTP(self.two_fa)
|
|
1319
|
+
params = {
|
|
1320
|
+
"from": "exchange",
|
|
1321
|
+
"to": "exchange",
|
|
1322
|
+
"currency": symbol,
|
|
1323
|
+
"amount": quantity,
|
|
1324
|
+
"email_dst": self.master_email,
|
|
1325
|
+
"tfaToken": {"method": "otp", "token": totp.now()}
|
|
1326
|
+
}
|
|
1327
|
+
res = await self.http.send_api_call(
|
|
1328
|
+
"v2/auth/w/transfer",
|
|
1329
|
+
method="POST",
|
|
1330
|
+
signed=True,
|
|
1331
|
+
**params,
|
|
1332
|
+
)
|
|
1333
|
+
logger.debug(f"transfer_to_master.res: {res}")
|
|
1334
|
+
if res and isinstance(res, list) and res[6] == 'SUCCESS':
|
|
1335
|
+
binance_res = {"txnId": res[0]}
|
|
1336
|
+
elif self.exchange == 'huobi':
|
|
1337
|
+
params = {
|
|
1338
|
+
'from-user': self.hbp_uid,
|
|
1339
|
+
'from-account-type': "spot",
|
|
1340
|
+
'from-account': self.hbp_account_id,
|
|
1341
|
+
'to-user': self.hbp_main_uid,
|
|
1342
|
+
'to-account-type': "spot",
|
|
1343
|
+
'to-account': self.hbp_main_account_id,
|
|
1344
|
+
'currency': symbol.lower(),
|
|
1345
|
+
'amount': quantity
|
|
1346
|
+
}
|
|
1347
|
+
res = await self.http.send_api_call(
|
|
1348
|
+
"v1/account/transfer",
|
|
1349
|
+
method="POST",
|
|
1350
|
+
signed=True,
|
|
1351
|
+
**params,
|
|
1352
|
+
)
|
|
1353
|
+
binance_res = {"txnId": res.get("transact-id")}
|
|
1354
|
+
elif self.exchange == 'okx':
|
|
1355
|
+
params = {
|
|
1356
|
+
"ccy": symbol,
|
|
1357
|
+
"amt": quantity,
|
|
1358
|
+
"from": '18',
|
|
1359
|
+
"to": '18',
|
|
1360
|
+
"type": '3'
|
|
1361
|
+
}
|
|
1362
|
+
res = await self.http.send_api_call(
|
|
1363
|
+
"/api/v5/asset/transfer",
|
|
1364
|
+
method="POST",
|
|
1365
|
+
signed=True,
|
|
1366
|
+
**params,
|
|
1367
|
+
)
|
|
1368
|
+
binance_res = {"txnId": res[0].get("transId")}
|
|
1369
|
+
return binance_res
|
|
1370
|
+
|
|
1317
1371
|
# https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#account-trade-list-user_data
|
|
1318
1372
|
async def fetch_account_trade_list(
|
|
1319
1373
|
self,
|
|
@@ -36,10 +36,13 @@ def get_account(_account_name: str) -> ():
|
|
|
36
36
|
exchange = account['exchange']
|
|
37
37
|
sub_account = account.get('sub_account_name')
|
|
38
38
|
test_net = account['test_net']
|
|
39
|
+
master_email = account.get('master_email')
|
|
40
|
+
master_name = account.get('master_name')
|
|
39
41
|
#
|
|
40
42
|
api_key = account['api_key']
|
|
41
43
|
api_secret = account['api_secret']
|
|
42
44
|
passphrase = account.get('passphrase')
|
|
45
|
+
two_fa = account.get('two_fa')
|
|
43
46
|
#
|
|
44
47
|
endpoint = config['endpoint'][exchange]
|
|
45
48
|
#
|
|
@@ -61,7 +64,11 @@ def get_account(_account_name: str) -> ():
|
|
|
61
64
|
api_auth, # 7
|
|
62
65
|
ws_auth, # 8
|
|
63
66
|
ws_public_mbr, # 9
|
|
64
|
-
passphrase
|
|
67
|
+
passphrase, # 10
|
|
68
|
+
master_email, # 11
|
|
69
|
+
master_name, # 12
|
|
70
|
+
two_fa, # 13
|
|
71
|
+
)
|
|
65
72
|
break
|
|
66
73
|
return res
|
|
67
74
|
|
|
@@ -74,19 +81,7 @@ class OpenClient:
|
|
|
74
81
|
if account:
|
|
75
82
|
self.name = _account_name
|
|
76
83
|
self.real_market = not account[2]
|
|
77
|
-
self.client = Client(
|
|
78
|
-
account[0], # exchange
|
|
79
|
-
account[1], # sub_account
|
|
80
|
-
account[2], # test_net
|
|
81
|
-
account[3], # api_key
|
|
82
|
-
account[4], # api_secret
|
|
83
|
-
account[5], # api_public
|
|
84
|
-
account[6], # ws_public
|
|
85
|
-
account[7], # api_auth
|
|
86
|
-
account[8], # ws_auth
|
|
87
|
-
account[9], # ws_public_mbr
|
|
88
|
-
account[10], # passphrase
|
|
89
|
-
)
|
|
84
|
+
self.client = Client(*account)
|
|
90
85
|
self.on_order_update_queues = {}
|
|
91
86
|
OpenClient.open_clients.append(self)
|
|
92
87
|
else:
|
|
@@ -128,6 +123,19 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
128
123
|
try:
|
|
129
124
|
open_client = OpenClient(request.account_name)
|
|
130
125
|
client_id = id(open_client)
|
|
126
|
+
if open_client.client.master_name == 'Huobi':
|
|
127
|
+
# For HuobiPro get master account uid and account_id
|
|
128
|
+
main_account = get_account(open_client.client.master_name)
|
|
129
|
+
main_client = Client(*main_account)
|
|
130
|
+
await main_client.fetch_exchange_info()
|
|
131
|
+
if main_client.hbp_uid and main_client.hbp_account_id:
|
|
132
|
+
open_client.client.hbp_main_uid = main_client.hbp_uid
|
|
133
|
+
open_client.client.hbp_main_account_id = main_client.hbp_account_id
|
|
134
|
+
logger.info(f"The values for main Huobi account were received and set:"
|
|
135
|
+
f" UID: {main_client.hbp_uid} and account ID: {main_client.hbp_account_id}")
|
|
136
|
+
else:
|
|
137
|
+
logger.warning("No account IDs were received for the Huobi master account")
|
|
138
|
+
await main_client.close()
|
|
131
139
|
except UserWarning:
|
|
132
140
|
_context.set_details(f"Account {request.account_name} not registered into"
|
|
133
141
|
f" {WORK_PATH}/config/exch_srv_cfg.toml")
|
|
@@ -155,11 +163,12 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
155
163
|
|
|
156
164
|
async def FetchServerTime(self, request: api_pb2.OpenClientConnectionId,
|
|
157
165
|
_context: grpc.aio.ServicerContext) -> api_pb2.FetchServerTimeResponse:
|
|
158
|
-
|
|
166
|
+
open_client = OpenClient.get_client(request.client_id)
|
|
167
|
+
client = open_client.client
|
|
159
168
|
try:
|
|
160
169
|
res = await client.fetch_server_time()
|
|
161
170
|
except Exception as ex:
|
|
162
|
-
logger.error(f"FetchServerTime for {
|
|
171
|
+
logger.error(f"FetchServerTime for {open_client.name} exception: {ex}")
|
|
163
172
|
_context.set_details(f"{ex}")
|
|
164
173
|
_context.set_code(grpc.StatusCode.UNKNOWN)
|
|
165
174
|
else:
|
|
@@ -761,6 +770,29 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
761
770
|
json_format.ParseDict(res, response)
|
|
762
771
|
return response
|
|
763
772
|
|
|
773
|
+
async def TransferToMaster(self, request: api_pb2.MarketRequest,
|
|
774
|
+
_context: grpc.aio.ServicerContext) -> api_pb2.SimpleResponse:
|
|
775
|
+
response = api_pb2.SimpleResponse()
|
|
776
|
+
response.success = False
|
|
777
|
+
open_client = OpenClient.get_client(request.client_id)
|
|
778
|
+
client = open_client.client
|
|
779
|
+
try:
|
|
780
|
+
res = await client.transfer_to_master(symbol=request.symbol, quantity=request.amount)
|
|
781
|
+
except errors.HTTPError as ex:
|
|
782
|
+
logger.error(f"TransferToMaster for {open_client.name}: {request.symbol} exception: {ex}")
|
|
783
|
+
_context.set_details(f"{ex}")
|
|
784
|
+
_context.set_code(grpc.StatusCode.RESOURCE_EXHAUSTED)
|
|
785
|
+
except Exception as ex:
|
|
786
|
+
logger.error(f"TransferToMaster for {open_client.name}: {request.symbol} exception: {ex}")
|
|
787
|
+
logger.debug(f"TransferToMaster for {open_client.name}: {request.symbol} error: {traceback.format_exc()}")
|
|
788
|
+
_context.set_details(f"{ex}")
|
|
789
|
+
_context.set_code(grpc.StatusCode.UNKNOWN)
|
|
790
|
+
else:
|
|
791
|
+
if res and res.get("txnId"):
|
|
792
|
+
response.success = True
|
|
793
|
+
response.result = json.dumps(res)
|
|
794
|
+
return response
|
|
795
|
+
|
|
764
796
|
async def StartStream(self, request: api_pb2.StartStreamRequest,
|
|
765
797
|
_context: grpc.aio.ServicerContext) -> api_pb2.SimpleResponse:
|
|
766
798
|
open_client = OpenClient.get_client(request.client_id)
|
|
@@ -772,8 +804,8 @@ class Martin(api_pb2_grpc.MartinServicer):
|
|
|
772
804
|
_market_stream_count = sum(len(k) for k in ([list(i.get(request.trade_id, []))
|
|
773
805
|
for i in list(client.events.registered_streams.values())]))
|
|
774
806
|
logger.info(f"Start WS streams for {open_client.name}")
|
|
775
|
-
asyncio.create_task(
|
|
776
|
-
asyncio.create_task(
|
|
807
|
+
asyncio.create_task(client.start_market_events_listener(request.trade_id))
|
|
808
|
+
asyncio.create_task(client.start_user_events_listener(request.trade_id, request.symbol))
|
|
777
809
|
response.success = True
|
|
778
810
|
return response
|
|
779
811
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Parameters for exchanges-wrapper REST API Server exch_srv.py
|
|
2
2
|
# Copyright © 2021 Jerry Fedorenko aka VM
|
|
3
|
-
# __version__ = "1.2.
|
|
3
|
+
# __version__ = "1.2.10"
|
|
4
4
|
|
|
5
|
+
# region endpoint
|
|
5
6
|
[endpoint]
|
|
6
7
|
[endpoint.binance]
|
|
7
8
|
api_public = 'https://api.binance.com'
|
|
@@ -47,11 +48,9 @@
|
|
|
47
48
|
ws_auth = 'wss://wsaws.okx.com:8443/ws/v5/private'
|
|
48
49
|
api_test = 'https://aws.okx.com'
|
|
49
50
|
ws_test = 'wss://wspap.okx.com:8443/ws/v5/private?brokerId=9999'
|
|
51
|
+
# endregion
|
|
50
52
|
|
|
51
|
-
#
|
|
52
|
-
# You can add subaccounts by duplicate records and set name, API and test_net fields
|
|
53
|
-
#
|
|
54
|
-
# Binance.com accounts
|
|
53
|
+
# region Binance.com accounts
|
|
55
54
|
[[accounts]]
|
|
56
55
|
exchange = 'binance'
|
|
57
56
|
name = 'Demo - Binance'
|
|
@@ -73,23 +72,31 @@
|
|
|
73
72
|
api_key = '*********** Place API key there ************'
|
|
74
73
|
api_secret = '*********** Place secret API key there ************'
|
|
75
74
|
test_net = false
|
|
75
|
+
# endregion
|
|
76
76
|
|
|
77
|
-
# Bitfinex accounts
|
|
77
|
+
# region Bitfinex accounts
|
|
78
|
+
# Set up a sub-account two-fa (2FA) key and master_email (Main account EMail)
|
|
79
|
+
# for transfer funds from sub-account to master account
|
|
78
80
|
[[accounts]]
|
|
79
81
|
exchange = 'bitfinex'
|
|
80
82
|
name = 'Demo - Bitfinex'
|
|
83
|
+
two_fa = '*********** Place 2FA key there ************'
|
|
81
84
|
api_key = '*********** Place API key there ************'
|
|
82
85
|
api_secret = '*********** Place secret API key there ************'
|
|
86
|
+
master_email = '*********** Place Main account EMail ************'
|
|
83
87
|
test_net = true
|
|
84
88
|
|
|
85
89
|
[[accounts]]
|
|
86
90
|
exchange = 'bitfinex'
|
|
87
91
|
name = 'Bitfinex'
|
|
92
|
+
two_fa = ''
|
|
88
93
|
api_key = '*********** Place API key there ************'
|
|
89
94
|
api_secret = '*********** Place secret API key there ************'
|
|
95
|
+
master_email = ''
|
|
90
96
|
test_net = false
|
|
97
|
+
# endregion
|
|
91
98
|
|
|
92
|
-
# Huobi
|
|
99
|
+
# region Huobi acconts
|
|
93
100
|
[[accounts]]
|
|
94
101
|
exchange = 'huobi'
|
|
95
102
|
name = 'Huobi'
|
|
@@ -97,11 +104,21 @@
|
|
|
97
104
|
api_secret = '*********** Place secret API key there ************'
|
|
98
105
|
test_net = false
|
|
99
106
|
|
|
100
|
-
|
|
107
|
+
[[accounts]]
|
|
108
|
+
exchange = 'huobi'
|
|
109
|
+
name = 'HuobiSub1'
|
|
110
|
+
api_key = '*********** Place API key there ************'
|
|
111
|
+
api_secret = '*********** Place secret API key there ************'
|
|
112
|
+
test_net = false
|
|
113
|
+
master_name = 'Huobi'
|
|
114
|
+
# endregion
|
|
115
|
+
|
|
116
|
+
# region OKX
|
|
101
117
|
[[accounts]]
|
|
102
118
|
exchange = 'okx'
|
|
103
119
|
name = 'Demo - OKX'
|
|
104
120
|
api_key = '*********** Place API key there ************'
|
|
105
121
|
api_secret = '*********** Place secret API key there ************'
|
|
106
122
|
passphrase = '*********** Place API password there ************'
|
|
107
|
-
test_net = true
|
|
123
|
+
test_net = true
|
|
124
|
+
# endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from urllib.parse import urlencode, urlparse
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import aiohttp
|
|
4
5
|
import logging
|
|
5
6
|
import time
|
|
6
7
|
from datetime import datetime
|
|
@@ -25,8 +26,6 @@ class HttpClient:
|
|
|
25
26
|
self.api_secret = kwargs.get('api_secret')
|
|
26
27
|
self.passphrase = kwargs.get('passphrase')
|
|
27
28
|
self.endpoint = kwargs.get('endpoint')
|
|
28
|
-
self.user_agent = kwargs.get('user_agent') or f"exchanges-wrapper, {__version__}"
|
|
29
|
-
self.proxy = kwargs.get('proxy')
|
|
30
29
|
self.session = kwargs.get('session')
|
|
31
30
|
self.exchange = kwargs.get('exchange')
|
|
32
31
|
self.sub_account = kwargs.get('sub_account')
|
|
@@ -41,13 +40,16 @@ class HttpClient:
|
|
|
41
40
|
logger.error(f"handle_errors RateLimitReached:response.url: {response.url}")
|
|
42
41
|
self.rate_limit_reached = self.exchange in ('binance', 'okx')
|
|
43
42
|
raise RateLimitReached(RateLimitReached.message)
|
|
44
|
-
|
|
43
|
+
try:
|
|
44
|
+
payload = await response.json()
|
|
45
|
+
except aiohttp.ContentTypeError:
|
|
46
|
+
payload = None
|
|
45
47
|
if self.exchange == 'binance' and payload and "code" in payload:
|
|
46
48
|
# as defined here: https://github.com/binance/binance-spot-api-docs/blob/
|
|
47
49
|
# master/errors.md#error-codes-for-binance-2019-09-25
|
|
48
50
|
raise ExchangeError(payload["msg"])
|
|
49
51
|
if response.status >= 400:
|
|
50
|
-
logger.debug(f"handle_errors.response
|
|
52
|
+
logger.debug(f"handle_errors.response: {response.text}")
|
|
51
53
|
if response.status == 400 and payload and payload.get("error", str()) == "ERR_RATE_LIMIT":
|
|
52
54
|
raise RateLimitReached(RateLimitReached.message)
|
|
53
55
|
elif response.status == 403 and self.exchange != 'okx':
|
|
@@ -55,7 +57,7 @@ class HttpClient:
|
|
|
55
57
|
elif response.status == 418:
|
|
56
58
|
raise IPAddressBanned(IPAddressBanned.message)
|
|
57
59
|
else:
|
|
58
|
-
raise HTTPError(f"Malformed request: {
|
|
60
|
+
raise HTTPError(f"Malformed request: status: {response.status}, reason: {response.reason}")
|
|
59
61
|
if self.exchange in ('binance', 'bitfinex'):
|
|
60
62
|
return payload
|
|
61
63
|
elif self.exchange == 'huobi' and payload and (payload.get('status') == 'ok' or payload.get('ok')):
|
|
@@ -63,7 +65,7 @@ class HttpClient:
|
|
|
63
65
|
elif self.exchange == 'okx' and payload and payload.get('code') == '0':
|
|
64
66
|
return payload.get('data', [])
|
|
65
67
|
else:
|
|
66
|
-
raise HTTPError(f"API request failed: {payload}")
|
|
68
|
+
raise HTTPError(f"API request failed: {response.status}:{response.reason}:{payload}")
|
|
67
69
|
|
|
68
70
|
async def send_api_call(self,
|
|
69
71
|
path,
|
|
@@ -90,12 +92,11 @@ class ClientBinance(HttpClient):
|
|
|
90
92
|
raise QueryCanceled(QueryCanceled.message)
|
|
91
93
|
_endpoint = endpoint or self.endpoint
|
|
92
94
|
url = f'{_endpoint}{path}'
|
|
93
|
-
query_kwargs = dict({"headers": {"
|
|
95
|
+
query_kwargs = dict({"headers": {"Content-Type": AJ}}, **kwargs)
|
|
94
96
|
if send_api_key:
|
|
95
97
|
query_kwargs["headers"]["X-MBX-APIKEY"] = self.api_key
|
|
96
98
|
if signed:
|
|
97
99
|
content = str()
|
|
98
|
-
query_kwargs["headers"]["Content-Type"] = AJ
|
|
99
100
|
location = "params" if "params" in kwargs else "data"
|
|
100
101
|
query_kwargs[location]["timestamp"] = str(int(time.time() * 1000))
|
|
101
102
|
if "params" in kwargs:
|
|
@@ -103,8 +104,6 @@ class ClientBinance(HttpClient):
|
|
|
103
104
|
if "data" in kwargs:
|
|
104
105
|
content += urlencode(kwargs["data"])
|
|
105
106
|
query_kwargs[location]["signature"] = generate_signature(self.exchange, self.api_secret, content)
|
|
106
|
-
if self.proxy:
|
|
107
|
-
query_kwargs["proxy"] = self.proxy
|
|
108
107
|
# print(f"send_api_call.request: url: {url}, query_kwargs: {query_kwargs}")
|
|
109
108
|
async with self.session.request(method, url, timeout=timeout, **query_kwargs) as response:
|
|
110
109
|
# print(f"send_api_call.response: url: {response.url}, status: {response.status}")
|
|
@@ -124,14 +123,12 @@ class ClientBFX(HttpClient):
|
|
|
124
123
|
if self.rate_limit_reached:
|
|
125
124
|
raise QueryCanceled(QueryCanceled.message)
|
|
126
125
|
_endpoint = endpoint or self.endpoint
|
|
127
|
-
content = str()
|
|
128
126
|
bfx_post = self.exchange == 'bitfinex' and ((method == 'POST' and kwargs) or "params" in kwargs)
|
|
129
127
|
_params = json.dumps(kwargs) if bfx_post else None
|
|
130
128
|
url = f'{_endpoint}/{path}'
|
|
131
129
|
query_kwargs = {"headers": {"Accept": AJ}}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
url += f'?{content}'
|
|
130
|
+
if kwargs and not bfx_post:
|
|
131
|
+
url += f"?{urlencode(kwargs, safe='/')}"
|
|
135
132
|
if bfx_post and "params" in kwargs:
|
|
136
133
|
query_kwargs.update({'data': _params})
|
|
137
134
|
if signed:
|
|
@@ -148,7 +145,6 @@ class ClientBFX(HttpClient):
|
|
|
148
145
|
self.api_secret,
|
|
149
146
|
signature_payload)
|
|
150
147
|
query_kwargs["headers"]["bfx-nonce"] = str(ts)
|
|
151
|
-
|
|
152
148
|
# print(f"send_api_call.request: url: {url}, query_kwargs: {query_kwargs}")
|
|
153
149
|
async with self.session.request(method, url, timeout=timeout, **query_kwargs) as response:
|
|
154
150
|
# print(f"send_api_call.response: url: {response.url}, status: {response.status}")
|
|
@@ -34,6 +34,7 @@ service Martin {
|
|
|
34
34
|
rpc ResetRateLimit (OpenClientConnectionId) returns (SimpleResponse) {}
|
|
35
35
|
rpc OnKlinesUpdate(FetchKlinesRequest) returns (stream OnKlinesUpdateResponse) {}
|
|
36
36
|
rpc FetchFundingWallet(FetchFundingWalletRequest) returns (FetchFundingWalletResponse) {}
|
|
37
|
+
rpc TransferToMaster(MarketRequest) returns (SimpleResponse) {}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
message OnBalanceUpdateResponse {
|
|
@@ -163,6 +164,7 @@ message OnFundsUpdateRequest {
|
|
|
163
164
|
|
|
164
165
|
message SimpleResponse {
|
|
165
166
|
bool success = 1;
|
|
167
|
+
string result = 2;
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
message OnTickerUpdateResponse {
|
|
@@ -440,6 +442,7 @@ message MarketRequest {
|
|
|
440
442
|
int64 client_id = 1;
|
|
441
443
|
string trade_id = 2;
|
|
442
444
|
string symbol = 3;
|
|
445
|
+
string amount = 4;
|
|
443
446
|
}
|
|
444
447
|
|
|
445
448
|
message StartStreamRequest {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
# __version__ = "1.2.6b4"
|
|
2
|
-
|
|
3
|
-
from exchanges_wrapper import __version__
|
|
4
|
-
|
|
5
1
|
import aiohttp
|
|
6
2
|
import asyncio
|
|
7
3
|
import json
|
|
@@ -23,14 +19,10 @@ logger = logging.getLogger('exch_srv_logger')
|
|
|
23
19
|
|
|
24
20
|
|
|
25
21
|
class EventsDataStream:
|
|
26
|
-
def __init__(self, client, endpoint,
|
|
22
|
+
def __init__(self, client, endpoint, exchange, trade_id):
|
|
27
23
|
self.client = client
|
|
28
24
|
self.session = client.session
|
|
29
25
|
self.endpoint = endpoint
|
|
30
|
-
if user_agent:
|
|
31
|
-
self.user_agent = user_agent
|
|
32
|
-
else:
|
|
33
|
-
self.user_agent = f"exchanges-wrapper, {__version__}"
|
|
34
26
|
self.exchange = exchange
|
|
35
27
|
self.trade_id = trade_id
|
|
36
28
|
self.web_socket = None
|
|
@@ -53,7 +45,11 @@ class EventsDataStream:
|
|
|
53
45
|
pass # meant to be overridden in a subclass
|
|
54
46
|
|
|
55
47
|
async def stop(self):
|
|
56
|
-
|
|
48
|
+
"""
|
|
49
|
+
Stop data stream
|
|
50
|
+
"""
|
|
51
|
+
if self.web_socket:
|
|
52
|
+
await self.web_socket.close()
|
|
57
53
|
|
|
58
54
|
async def upstream_bitfinex(self, request, symbol=None, ch_type=str()):
|
|
59
55
|
await self.web_socket.send_json(request)
|
|
@@ -172,26 +168,17 @@ class EventsDataStream:
|
|
|
172
168
|
|
|
173
169
|
class MarketEventsDataStream(EventsDataStream):
|
|
174
170
|
|
|
175
|
-
def __init__(self, client, endpoint,
|
|
176
|
-
super().__init__(client, endpoint,
|
|
171
|
+
def __init__(self, client, endpoint, exchange, trade_id, channel=None):
|
|
172
|
+
super().__init__(client, endpoint, exchange, trade_id)
|
|
177
173
|
self.channel = channel
|
|
178
174
|
self.candles_max_time = None
|
|
179
175
|
|
|
180
|
-
async def stop(self):
|
|
181
|
-
"""
|
|
182
|
-
Stop market data stream
|
|
183
|
-
"""
|
|
184
|
-
logger.info(f"Market WSS stop for {self.exchange}:{self.trade_id}:{self.channel}")
|
|
185
|
-
if self.web_socket:
|
|
186
|
-
await self.web_socket.close()
|
|
187
|
-
|
|
188
176
|
async def start_wss(self):
|
|
189
177
|
logger.info(f"Start market WSS {self.channel if self.channel else ''} for {self.exchange}")
|
|
190
178
|
registered_streams = self.client.events.registered_streams.get(self.exchange, {}).get(self.trade_id, set())
|
|
191
179
|
if self.exchange == 'binance':
|
|
192
180
|
combined_streams = "/".join(registered_streams)
|
|
193
|
-
self.web_socket = await self.session.ws_connect(f"{self.endpoint}/stream?streams={combined_streams}"
|
|
194
|
-
proxy=self.client.proxy)
|
|
181
|
+
self.web_socket = await self.session.ws_connect(f"{self.endpoint}/stream?streams={combined_streams}")
|
|
195
182
|
logger.info(f"Combined events stream started: {combined_streams}")
|
|
196
183
|
await self._handle_messages(self.web_socket)
|
|
197
184
|
else:
|
|
@@ -199,9 +186,7 @@ class MarketEventsDataStream(EventsDataStream):
|
|
|
199
186
|
ch_type = self.channel.split('@')[1]
|
|
200
187
|
request = {}
|
|
201
188
|
if self.exchange == 'okx':
|
|
202
|
-
self.web_socket = await self.session.ws_connect(self.endpoint,
|
|
203
|
-
heartbeat=25,
|
|
204
|
-
proxy=self.client.proxy)
|
|
189
|
+
self.web_socket = await self.session.ws_connect(self.endpoint, heartbeat=25)
|
|
205
190
|
if ch_type == 'miniTicker':
|
|
206
191
|
_ch_type = 'tickers'
|
|
207
192
|
elif 'kline_' in ch_type:
|
|
@@ -220,9 +205,7 @@ class MarketEventsDataStream(EventsDataStream):
|
|
|
220
205
|
await self.web_socket.send_json(request)
|
|
221
206
|
await self._handle_messages(self.web_socket, symbol=symbol, ch_type=ch_type)
|
|
222
207
|
elif self.exchange == 'bitfinex':
|
|
223
|
-
self.web_socket = await self.session.ws_connect(self.endpoint,
|
|
224
|
-
receive_timeout=30,
|
|
225
|
-
proxy=self.client.proxy)
|
|
208
|
+
self.web_socket = await self.session.ws_connect(self.endpoint, receive_timeout=30)
|
|
226
209
|
if ch_type == 'miniTicker':
|
|
227
210
|
ch_type = 'ticker'
|
|
228
211
|
request = {'event': 'subscribe', 'channel': ch_type, 'pair': symbol}
|
|
@@ -235,10 +218,7 @@ class MarketEventsDataStream(EventsDataStream):
|
|
|
235
218
|
request = {'event': 'subscribe', 'channel': ch_type, 'symbol': symbol, 'prec': 'P0', }
|
|
236
219
|
await self.upstream_bitfinex(request, symbol, ch_type)
|
|
237
220
|
elif self.exchange == 'huobi':
|
|
238
|
-
self.web_socket = await self.session.ws_connect(self.endpoint,
|
|
239
|
-
receive_timeout=20,
|
|
240
|
-
proxy=self.client.proxy,
|
|
241
|
-
autoping=False)
|
|
221
|
+
self.web_socket = await self.session.ws_connect(self.endpoint, receive_timeout=20, autoping=False)
|
|
242
222
|
if ch_type == 'miniTicker':
|
|
243
223
|
ch_type = 'ticker'
|
|
244
224
|
request = {'sub': f"market.{symbol}.{ch_type}"}
|
|
@@ -299,22 +279,12 @@ class MarketEventsDataStream(EventsDataStream):
|
|
|
299
279
|
|
|
300
280
|
|
|
301
281
|
class HbpPrivateEventsDataStream(EventsDataStream):
|
|
302
|
-
def __init__(self, client, endpoint,
|
|
303
|
-
super().__init__(client, endpoint,
|
|
282
|
+
def __init__(self, client, endpoint, exchange, trade_id, symbol):
|
|
283
|
+
super().__init__(client, endpoint, exchange, trade_id)
|
|
304
284
|
self.symbol = symbol
|
|
305
285
|
|
|
306
|
-
async def stop(self):
|
|
307
|
-
"""
|
|
308
|
-
Stop data stream
|
|
309
|
-
"""
|
|
310
|
-
if self.web_socket:
|
|
311
|
-
await self.web_socket.close()
|
|
312
|
-
|
|
313
286
|
async def start_wss(self):
|
|
314
|
-
self.web_socket = await self.session.ws_connect(self.endpoint,
|
|
315
|
-
receive_timeout=30,
|
|
316
|
-
proxy=self.client.proxy,
|
|
317
|
-
autoping=False)
|
|
287
|
+
self.web_socket = await self.session.ws_connect(self.endpoint, receive_timeout=30, autoping=False)
|
|
318
288
|
ts = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S")
|
|
319
289
|
_params = {
|
|
320
290
|
"accessKey": self.client.api_key,
|
|
@@ -362,17 +332,8 @@ class HbpPrivateEventsDataStream(EventsDataStream):
|
|
|
362
332
|
|
|
363
333
|
class BfxPrivateEventsDataStream(EventsDataStream):
|
|
364
334
|
|
|
365
|
-
async def stop(self):
|
|
366
|
-
"""
|
|
367
|
-
Stop data stream
|
|
368
|
-
"""
|
|
369
|
-
if self.web_socket:
|
|
370
|
-
await self.web_socket.close()
|
|
371
|
-
|
|
372
335
|
async def start_wss(self):
|
|
373
|
-
self.web_socket = await self.session.ws_connect(self.endpoint,
|
|
374
|
-
receive_timeout=30,
|
|
375
|
-
proxy=self.client.proxy)
|
|
336
|
+
self.web_socket = await self.session.ws_connect(self.endpoint, receive_timeout=30)
|
|
376
337
|
ts = int(time.time() * 1000)
|
|
377
338
|
data = f"AUTH{ts}"
|
|
378
339
|
request = {
|
|
@@ -418,21 +379,12 @@ class BfxPrivateEventsDataStream(EventsDataStream):
|
|
|
418
379
|
|
|
419
380
|
|
|
420
381
|
class OkxPrivateEventsDataStream(EventsDataStream):
|
|
421
|
-
def __init__(self, client, endpoint,
|
|
422
|
-
super().__init__(client, endpoint,
|
|
382
|
+
def __init__(self, client, endpoint, exchange, trade_id, symbol):
|
|
383
|
+
super().__init__(client, endpoint, exchange, trade_id)
|
|
423
384
|
self.symbol = symbol
|
|
424
385
|
|
|
425
|
-
async def stop(self):
|
|
426
|
-
"""
|
|
427
|
-
Stop data stream
|
|
428
|
-
"""
|
|
429
|
-
if self.web_socket:
|
|
430
|
-
await self.web_socket.close()
|
|
431
|
-
|
|
432
386
|
async def start_wss(self):
|
|
433
|
-
self.web_socket = await self.session.ws_connect(self.endpoint,
|
|
434
|
-
heartbeat=25,
|
|
435
|
-
proxy=self.client.proxy)
|
|
387
|
+
self.web_socket = await self.session.ws_connect(self.endpoint, heartbeat=25)
|
|
436
388
|
ts = int(time.time())
|
|
437
389
|
signature_payload = f"{ts}GET/users/self/verify"
|
|
438
390
|
signature = generate_signature(self.exchange, self.client.api_secret, signature_payload)
|
|
@@ -486,19 +438,9 @@ class UserEventsDataStream(EventsDataStream):
|
|
|
486
438
|
await asyncio.sleep(interval)
|
|
487
439
|
await self.client.keep_alive_listen_key(listen_key)
|
|
488
440
|
|
|
489
|
-
async def stop(self):
|
|
490
|
-
"""
|
|
491
|
-
Stop user data stream
|
|
492
|
-
"""
|
|
493
|
-
# logger.info(f"UserEventsDataStream.stop: handlers: {self.client.events.handlers}")
|
|
494
|
-
if self.web_socket:
|
|
495
|
-
await self.web_socket.close()
|
|
496
|
-
|
|
497
441
|
async def start_wss(self):
|
|
498
442
|
listen_key = (await self.client.create_listen_key())["listenKey"]
|
|
499
|
-
self.web_socket = await self.session.ws_connect(f"{self.endpoint}/ws/{listen_key}",
|
|
500
|
-
heartbeat=15,
|
|
501
|
-
proxy=self.client.proxy)
|
|
443
|
+
self.web_socket = await self.session.ws_connect(f"{self.endpoint}/ws/{listen_key}", heartbeat=15)
|
|
502
444
|
_task = asyncio.ensure_future(self._heartbeat(listen_key))
|
|
503
445
|
try:
|
|
504
446
|
await self._handle_messages(self.web_socket)
|
|
@@ -17,11 +17,12 @@ dynamic = ["version", "description"]
|
|
|
17
17
|
requires-python = ">=3.8"
|
|
18
18
|
|
|
19
19
|
dependencies = [
|
|
20
|
-
"aiohttp==3.8.
|
|
20
|
+
"aiohttp==3.8.4",
|
|
21
21
|
"grpcio==1.48.1",
|
|
22
22
|
"grpcio-tools==1.48.1",
|
|
23
23
|
"toml==0.10.2",
|
|
24
|
-
"idna==3.
|
|
24
|
+
"idna==3.4",
|
|
25
|
+
"pyotp~=2.8.0"
|
|
25
26
|
]
|
|
26
27
|
|
|
27
28
|
[tool.flit.module]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/bitfinex_parser.py
RENAMED
|
File without changes
|
{exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/c_structures.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{exchanges-wrapper-1.2.9.post2 → exchanges-wrapper-1.2.10}/exchanges_wrapper/huobi_parser.py
RENAMED
|
File without changes
|