exchanges-wrapper 1.4.7__tar.gz → 1.4.9__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.
Files changed (33) hide show
  1. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/CHANGELOG.md +30 -1
  2. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/PKG-INFO +4 -5
  3. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/__init__.py +1 -1
  4. exchanges-wrapper-1.4.9/exchanges_wrapper/api_pb2.py +120 -0
  5. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/bitfinex_parser.py +34 -25
  6. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/bybit_parser.py +1 -2
  7. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/client.py +80 -59
  8. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/exch_srv.py +15 -19
  9. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/exch_srv_cfg.toml.template +9 -1
  10. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/http_client.py +2 -3
  11. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/huobi_parser.py +71 -90
  12. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/okx_parser.py +0 -1
  13. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/proto/exchanges_wrapper/api.proto +15 -16
  14. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/web_sockets.py +66 -27
  15. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/pyproject.toml +3 -4
  16. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/requirements.txt +3 -4
  17. exchanges-wrapper-1.4.7/exchanges_wrapper/api_pb2.py +0 -513
  18. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/.deepsource.toml +0 -0
  19. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/.dockerignore +0 -0
  20. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/.github/FUNDING.yml +0 -0
  21. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/.github/dependabot.yml +0 -0
  22. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/.github/workflows/docker-image.yml +0 -0
  23. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/.github/workflows/python-publish.yml +0 -0
  24. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/Dockerfile +0 -0
  25. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/LICENSE.md +0 -0
  26. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/README.md +0 -0
  27. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/example/exch_client.py +0 -0
  28. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/example/ms_cfg.toml +0 -0
  29. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/api_pb2_grpc.py +0 -0
  30. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/c_structures.py +0 -0
  31. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/definitions.py +0 -0
  32. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/errors.py +0 -0
  33. {exchanges-wrapper-1.4.7 → exchanges-wrapper-1.4.9}/exchanges_wrapper/events.py +0 -0
@@ -1,4 +1,33 @@
1
- ## 1.4.7 2024-01-25
1
+ ## 1.4.9 2024-02-07
2
+ ### Fix
3
+ * Some minor fixes
4
+
5
+ ## 1.4.9b5 2024-02-07
6
+ ### Update
7
+ * Dependency: Up requirements for `grpcio` and `grpcio-tools` to 1.60.1
8
+
9
+ ## 1.4.9b3 2024-02-07
10
+ ### Update
11
+ * Bitfinex: refining order processing
12
+
13
+ ## 1.4.9b2 2024-02-05
14
+ ### Fix
15
+ * Binance: `TransferToMaster`: sentence `Email address should be encoded. e.g. alice@test.com should be encoded into
16
+ alice%40test.com` from API docs the are False, must be `content += urlencode(kwargs["params"], safe="@")`
17
+
18
+ ### Update
19
+ * HTX: changed deprecated endpoint "v1/common/symbols" to "v1/settings/common/market-symbols"
20
+ * Binance: `GET /api/v3/exchangeInfo` from response remove deprecated `quotePrecision`
21
+
22
+ ## 1.4.8 2024-02-02
23
+ ### Added for new features
24
+ * Binance: `TransferToMaster` now can be used for collect assets on the sub-account
25
+
26
+ ## 1.4.7.post6 2024-01-31
27
+ ### Fix
28
+ * Bitfinex: order processing
29
+
30
+ ## 1.4.7 2024-01-25
2
31
  ### Fix
3
32
  * Bybit: filter LOT_SIZE.stepSize
4
33
  * Bitfinex: filter LOT_SIZE.stepSize
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exchanges-wrapper
3
- Version: 1.4.7
3
+ Version: 1.4.9
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.9
@@ -12,12 +12,11 @@ Classifier: Operating System :: Unix
12
12
  Classifier: Operating System :: Microsoft :: Windows
13
13
  Classifier: Operating System :: MacOS
14
14
  Requires-Dist: crypto-ws-api==2.0.6
15
- Requires-Dist: grpcio==1.48.2
16
- Requires-Dist: grpcio-tools==1.48.2
17
- Requires-Dist: idna==3.4
15
+ Requires-Dist: grpcio==1.60.1
16
+ Requires-Dist: grpcio-tools==1.60.1
18
17
  Requires-Dist: pyotp~=2.9.0
19
18
  Requires-Dist: simplejson==3.19.2
20
- Requires-Dist: aiohttp==3.9.0
19
+ Requires-Dist: aiohttp==3.9.1
21
20
  Requires-Dist: Pympler~=1.0.1
22
21
  Requires-Dist: websockets~=12.0
23
22
  Requires-Dist: expiringdict~=1.2.2
@@ -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.4.7"
15
+ __version__ = "1.4.9"
16
16
 
17
17
  from pathlib import Path
18
18
  import shutil
@@ -0,0 +1,120 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: exchanges_wrapper/api.proto
4
+ # Protobuf Python Version: 4.25.0
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
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\"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\"\xb3\x15\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\x1b\n\x13quoteAssetPrecision\x18\x06 \x01(\r\x12\x1f\n\x17\x62\x61seCommissionPrecision\x18\x07 \x01(\r\x12 \n\x18quoteCommissionPrecision\x18\x08 \x01(\r\x12\x12\n\norderTypes\x18\t \x03(\t\x12\x16\n\x0eicebergAllowed\x18\n \x01(\x08\x12\x12\n\nocoAllowed\x18\x0b \x01(\x08\x12\"\n\x1aquoteOrderQtyMarketAllowed\x18\x0c \x01(\x08\x12\x19\n\x11\x61llowTrailingStop\x18\r \x01(\x08\x12\x1c\n\x14\x63\x61ncelReplaceAllowed\x18\x0e \x01(\x08\x12\x1c\n\x14isSpotTradingAllowed\x18\x0f \x01(\x08\x12\x1e\n\x16isMarginTradingAllowed\x18\x10 \x01(\x08\x12@\n\x07\x66ilters\x18\x11 \x01(\x0b\x32/.martin.FetchExchangeInfoSymbolResponse.Filters\x12\x13\n\x0bpermissions\x18\x12 \x03(\t\x12&\n\x1e\x64\x65\x66\x61ultSelfTradePreventionMode\x18\x13 \x01(\t\x12\'\n\x1f\x61llowedSelfTradePreventionModes\x18\x14 \x03(\t\x1a\xc9\x10\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\x12O\n\x08notional\x18\x0b \x01(\x0b\x32\x38.martin.FetchExchangeInfoSymbolResponse.Filters.NotionalH\n\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(\t\x1a\x92\x01\n\x08Notional\x12\x12\n\nfilterType\x18\x01 \x01(\t\x12\x13\n\x0bminNotional\x18\x02 \x01(\t\x12\x18\n\x10\x61pplyMinToMarket\x18\x03 \x01(\x08\x12\x13\n\x0bmaxNotional\x18\x04 \x01(\t\x12\x18\n\x10\x61pplyMaxToMarket\x18\x05 \x01(\x08\x12\x14\n\x0c\x61vgPriceMins\x18\x06 \x01(\rB\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_positionB\x0b\n\t_notional\"\x8f\x01\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\x17\n\x0f\x63lient_order_id\x18\x05 \x01(\t\x12\x1a\n\x12\x66illed_update_call\x18\x06 \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\"\xa0\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\x12\x1d\n\x15update_max_queue_size\x18\x06 \x01(\x08\"k\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\x12\x0e\n\x06symbol\x18\x04 \x01(\t\"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\x87\x11\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\x12\x42\n\x0f\x43\x61ncelAllOrders\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\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\x12\x42\n\rOnOrderUpdate\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\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\x12>\n\x0b\x43heckStream\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\x00\x12I\n\x16OneClickArrivalDeposit\x12\x15.martin.MarketRequest\x1a\x16.martin.SimpleResponse\"\x00\x62\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exchanges_wrapper.api_pb2', _globals)
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
+ _globals['_ONBALANCEUPDATERESPONSE']._serialized_start=39
25
+ _globals['_ONBALANCEUPDATERESPONSE']._serialized_end=81
26
+ _globals['_FETCHFUNDINGWALLETREQUEST']._serialized_start=84
27
+ _globals['_FETCHFUNDINGWALLETREQUEST']._serialized_end=215
28
+ _globals['_FETCHFUNDINGWALLETRESPONSE']._serialized_start=218
29
+ _globals['_FETCHFUNDINGWALLETRESPONSE']._serialized_end=426
30
+ _globals['_FETCHFUNDINGWALLETRESPONSE_BALANCES']._serialized_start=311
31
+ _globals['_FETCHFUNDINGWALLETRESPONSE_BALANCES']._serialized_end=426
32
+ _globals['_CANCELORDERRESPONSE']._serialized_start=429
33
+ _globals['_CANCELORDERRESPONSE']._serialized_end=756
34
+ _globals['_CANCELORDERREQUEST']._serialized_start=758
35
+ _globals['_CANCELORDERREQUEST']._serialized_end=849
36
+ _globals['_CREATELIMITORDERRESPONSE']._serialized_start=852
37
+ _globals['_CREATELIMITORDERRESPONSE']._serialized_end=1220
38
+ _globals['_CREATELIMITORDERREQUEST']._serialized_start=1223
39
+ _globals['_CREATELIMITORDERREQUEST']._serialized_end=1381
40
+ _globals['_ONORDERUPDATERESPONSE']._serialized_start=1384
41
+ _globals['_ONORDERUPDATERESPONSE']._serialized_end=2144
42
+ _globals['_ONFUNDSUPDATERESPONSE']._serialized_start=2146
43
+ _globals['_ONFUNDSUPDATERESPONSE']._serialized_end=2184
44
+ _globals['_ONFUNDSUPDATEREQUEST']._serialized_start=2186
45
+ _globals['_ONFUNDSUPDATEREQUEST']._serialized_end=2302
46
+ _globals['_SIMPLERESPONSE']._serialized_start=2304
47
+ _globals['_SIMPLERESPONSE']._serialized_end=2353
48
+ _globals['_ONTICKERUPDATERESPONSE']._serialized_start=2355
49
+ _globals['_ONTICKERUPDATERESPONSE']._serialized_end=2456
50
+ _globals['_ACCOUNTTRADELISTRESPONSE']._serialized_start=2459
51
+ _globals['_ACCOUNTTRADELISTRESPONSE']._serialized_end=2776
52
+ _globals['_ACCOUNTTRADELISTRESPONSE_TRADE']._serialized_start=2543
53
+ _globals['_ACCOUNTTRADELISTRESPONSE_TRADE']._serialized_end=2776
54
+ _globals['_ACCOUNTTRADELISTREQUEST']._serialized_start=2778
55
+ _globals['_ACCOUNTTRADELISTREQUEST']._serialized_end=2891
56
+ _globals['_FETCHKLINESRESPONSE']._serialized_start=2893
57
+ _globals['_FETCHKLINESRESPONSE']._serialized_end=2930
58
+ _globals['_ONKLINESUPDATERESPONSE']._serialized_start=2932
59
+ _globals['_ONKLINESUPDATERESPONSE']._serialized_end=3006
60
+ _globals['_FETCHKLINESREQUEST']._serialized_start=3008
61
+ _globals['_FETCHKLINESREQUEST']._serialized_end=3114
62
+ _globals['_FETCHTICKERPRICECHANGESTATISTICSRESPONSE']._serialized_start=3117
63
+ _globals['_FETCHTICKERPRICECHANGESTATISTICSRESPONSE']._serialized_end=3556
64
+ _globals['_FETCHSYMBOLPRICETICKERRESPONSE']._serialized_start=3558
65
+ _globals['_FETCHSYMBOLPRICETICKERRESPONSE']._serialized_end=3621
66
+ _globals['_FETCHORDERBOOKRESPONSE']._serialized_start=3623
67
+ _globals['_FETCHORDERBOOKRESPONSE']._serialized_end=3697
68
+ _globals['_FETCHACCOUNTBALANCERESPONSE']._serialized_start=3700
69
+ _globals['_FETCHACCOUNTBALANCERESPONSE']._serialized_end=3850
70
+ _globals['_FETCHACCOUNTBALANCERESPONSE_BALANCES']._serialized_start=311
71
+ _globals['_FETCHACCOUNTBALANCERESPONSE_BALANCES']._serialized_end=366
72
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE']._serialized_start=3853
73
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE']._serialized_end=6592
74
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS']._serialized_start=4471
75
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS']._serialized_end=6592
76
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PRICEFILTER']._serialized_start=5477
77
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PRICEFILTER']._serialized_end=5564
78
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PERCENTPRICE']._serialized_start=5566
79
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_PERCENTPRICE']._serialized_end=5668
80
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_LOTSIZE']._serialized_start=5670
81
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_LOTSIZE']._serialized_end=5749
82
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MINNOTIONAL']._serialized_start=5751
83
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MINNOTIONAL']._serialized_end=5850
84
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_ICEBERGPARTS']._serialized_start=5852
85
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_ICEBERGPARTS']._serialized_end=5901
86
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MARKETLOTSIZE']._serialized_start=5903
87
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MARKETLOTSIZE']._serialized_end=5988
88
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMORDERS']._serialized_start=5990
89
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMORDERS']._serialized_end=6046
90
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMALGOORDERS']._serialized_start=6048
91
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMALGOORDERS']._serialized_end=6112
92
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMICEBERGORDERS']._serialized_start=6114
93
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXNUMICEBERGORDERS']._serialized_end=6184
94
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXPOSITION']._serialized_start=6186
95
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_MAXPOSITION']._serialized_end=6240
96
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_NOTIONAL']._serialized_start=6243
97
+ _globals['_FETCHEXCHANGEINFOSYMBOLRESPONSE_FILTERS_NOTIONAL']._serialized_end=6389
98
+ _globals['_FETCHORDERREQUEST']._serialized_start=6595
99
+ _globals['_FETCHORDERREQUEST']._serialized_end=6738
100
+ _globals['_FETCHORDERRESPONSE']._serialized_start=6741
101
+ _globals['_FETCHORDERRESPONSE']._serialized_end=7158
102
+ _globals['_FETCHOPENORDERSRESPONSE']._serialized_start=7161
103
+ _globals['_FETCHOPENORDERSRESPONSE']._serialized_end=7669
104
+ _globals['_FETCHOPENORDERSRESPONSE_ORDER']._serialized_start=7265
105
+ _globals['_FETCHOPENORDERSRESPONSE_ORDER']._serialized_end=7669
106
+ _globals['_MARKETREQUEST']._serialized_start=7671
107
+ _globals['_MARKETREQUEST']._serialized_end=7755
108
+ _globals['_STARTSTREAMREQUEST']._serialized_start=7758
109
+ _globals['_STARTSTREAMREQUEST']._serialized_end=7918
110
+ _globals['_OPENCLIENTCONNECTIONREQUEST']._serialized_start=7920
111
+ _globals['_OPENCLIENTCONNECTIONREQUEST']._serialized_end=8027
112
+ _globals['_OPENCLIENTCONNECTIONID']._serialized_start=8029
113
+ _globals['_OPENCLIENTCONNECTIONID']._serialized_end=8151
114
+ _globals['_FETCHSERVERTIMEREQUEST']._serialized_start=8153
115
+ _globals['_FETCHSERVERTIMEREQUEST']._serialized_end=8214
116
+ _globals['_FETCHSERVERTIMERESPONSE']._serialized_start=8216
117
+ _globals['_FETCHSERVERTIMERESPONSE']._serialized_end=8262
118
+ _globals['_MARTIN']._serialized_start=8265
119
+ _globals['_MARTIN']._serialized_end=10448
120
+ # @@protoc_insertion_point(module_scope)
@@ -134,7 +134,6 @@ def exchange_info(symbols_details: [], tickers: [], symbol_t) -> {}:
134
134
  "baseAsset": _base_asset,
135
135
  "baseAssetPrecision": _base_asset_precision,
136
136
  "quoteAsset": _quote_asset,
137
- "quotePrecision": _base_asset_precision,
138
137
  "quoteAssetPrecision": _base_asset_precision,
139
138
  "baseCommissionPrecision": 8,
140
139
  "quoteCommissionPrecision": 8,
@@ -549,49 +548,59 @@ def on_order_update(res: [], _order: {}) -> {}:
549
548
  }
550
549
 
551
550
 
552
- def on_order_trade(res: [], orig_qty: str, executed_qty: str) -> {}:
553
- # logger.info(f"on_order_trade.res: {res}, qty: {orig_qty}, filled: {executed_qty}")
554
- side = 'BUY' if res[4] > 0 else 'SELL'
551
+ def on_order_trade(_order: {}) -> {}:
552
+ # logger.info(f"on_order_trade._order: {_order}")
553
+ event = _order['lastEvent']
554
+ orig_qty = _order['origQty']
555
+ executed_qty = _order['executedQty']
555
556
  #
556
- status = 'PARTIALLY_FILLED'
557
+ order_price = Decimal(str(event[7]))
558
+ quote_order_qty = str(Decimal(executed_qty) * order_price)
559
+ cumulative_quote_asset = str(executed_qty * order_price)
557
560
  #
558
- last_executed_quantity = str(abs(res[4]))
559
- last_executed_price = str(res[5])
561
+ last_executed_quantity = str(abs(event[4]))
562
+ last_executed_price = str(event[5])
560
563
  last_quote_asset = str(Decimal(last_executed_quantity) * Decimal(last_executed_price))
561
- quote_order_qty = str(Decimal(executed_qty) * Decimal(last_executed_price))
564
+ #
565
+ status = 'NEW'
566
+ if orig_qty > executed_qty > 0:
567
+ status = 'PARTIALLY_FILLED'
568
+ elif executed_qty >= orig_qty:
569
+ status = 'FILLED'
570
+
562
571
  return {
563
572
  "e": "executionReport",
564
- "E": res[2],
565
- "s": res[1][1:].replace(':', ''),
566
- "c": str(res[11]),
567
- "S": side,
573
+ "E": event[2],
574
+ "s": event[1][1:].replace(':', ''),
575
+ "c": str(event[11]),
576
+ "S": 'BUY' if event[4] > 0 else 'SELL',
568
577
  "o": "LIMIT",
569
578
  "f": "GTC",
570
- "q": orig_qty,
571
- "p": str(res[7]),
579
+ "q": str(orig_qty),
580
+ "p": str(order_price),
572
581
  "P": "0.00000000",
573
582
  "F": "0.00000000",
574
583
  "g": -1,
575
- "C": "NEW",
584
+ "C": "",
576
585
  "x": "TRADE",
577
586
  "X": status,
578
587
  "r": "NONE",
579
- "i": res[3],
588
+ "i": event[3],
580
589
  "l": last_executed_quantity,
581
- "z": executed_qty,
590
+ "z": str(executed_qty),
582
591
  "L": last_executed_price,
583
- "n": str(res[9]) if res[9] else "0",
584
- "N": res[10],
585
- "T": res[2],
586
- "t": res[0],
592
+ "n": str(event[9]) if event[9] else "0",
593
+ "N": event[10],
594
+ "T": event[2],
595
+ "t": event[0],
587
596
  "I": 123456789,
588
597
  "w": True,
589
- "m": res[8] == 1,
598
+ "m": event[8] == 1,
590
599
  "M": False,
591
- "O": res[2],
592
- "Z": quote_order_qty,
600
+ "O": event[2],
601
+ "Z": cumulative_quote_asset,
593
602
  "Y": last_quote_asset,
594
- "Q": "0.0",
603
+ "Q": quote_order_qty,
595
604
  }
596
605
 
597
606
 
@@ -88,7 +88,6 @@ def exchange_info(server_time: int, trading_symbol: list) -> dict:
88
88
  "baseAsset": market['baseCoin'],
89
89
  "baseAssetPrecision": len(market['lotSizeFilter']['basePrecision']) - 2,
90
90
  "quoteAsset": market['quoteCoin'],
91
- "quotePrecision": 8,
92
91
  "quoteAssetPrecision": len(market['lotSizeFilter']['quotePrecision']) - 2,
93
92
  "baseCommissionPrecision": 8,
94
93
  "quoteCommissionPrecision": 8,
@@ -403,7 +402,7 @@ def on_trade_update(res: dict) -> dict:
403
402
  "t": int(res.get("execId", -1)),
404
403
  "I": 123456789,
405
404
  "w": True,
406
- "m": False,
405
+ "m": res.get("isMaker", False),
407
406
  "M": False,
408
407
  "O": int(res.get("execTime", res.get("createdTime"))),
409
408
  "Z": cumulative_quote_asset,
@@ -10,7 +10,7 @@ from collections import defaultdict
10
10
  import pyotp
11
11
  from expiringdict import ExpiringDict
12
12
  import uuid
13
- from decimal import Decimal
13
+ from decimal import Decimal, ROUND_HALF_DOWN
14
14
 
15
15
  from exchanges_wrapper.http_client import ClientBinance, ClientBFX, ClientHBP, ClientOKX, ClientBybit
16
16
  from exchanges_wrapper.errors import ExchangePyError
@@ -37,6 +37,10 @@ def truncate(f, n):
37
37
  return math.floor(f * 10 ** n) / 10 ** n
38
38
 
39
39
 
40
+ def any2str(_x) -> str:
41
+ return f"{_x:.10f}".rstrip('0').rstrip('.')
42
+
43
+
40
44
  class Client:
41
45
  def __init__(self, *acc):
42
46
  self.exchange = acc[0]
@@ -95,7 +99,7 @@ class Client:
95
99
  self.rate_limits = None
96
100
  self.data_streams = defaultdict(set)
97
101
  self.active_orders = {}
98
- self.wss_buffer = ExpiringDict(max_len=50, max_age_seconds=STATUS_TIMEOUT*2)
102
+ self.wss_buffer = ExpiringDict(max_len=50, max_age_seconds=STATUS_TIMEOUT*20)
99
103
  self.stream_queue = defaultdict(set)
100
104
  self.on_order_update_queues = {}
101
105
  self.account_id = None
@@ -170,15 +174,20 @@ class Client:
170
174
  user_data_stream = BBTPrivateEventsDataStream(self, self.endpoint_ws_auth, self.exchange, _trade_id)
171
175
  if user_data_stream:
172
176
  self.data_streams[_trade_id] |= {user_data_stream}
173
- await asyncio.sleep(1)
174
177
  asyncio.ensure_future(user_data_stream.start())
178
+ timeout = STATUS_TIMEOUT / 0.1
179
+ while not user_data_stream.wss_started:
180
+ timeout -= 1
181
+ if not timeout:
182
+ logger.warning(f"{self.exchange} user WSS start timeout reached for {_trade_id}")
183
+ break
184
+ await asyncio.sleep(0.05)
175
185
 
176
186
  async def start_market_events_listener(self, _trade_id):
177
187
  _events = self.events.registered_streams.get(self.exchange, {}).get(_trade_id, set())
178
188
  if self.exchange == 'binance':
179
189
  market_data_stream = MarketEventsDataStream(self, self.endpoint_ws_public, self.exchange, _trade_id)
180
190
  self.data_streams[_trade_id] |= {market_data_stream}
181
- await asyncio.sleep(1)
182
191
  asyncio.ensure_future(market_data_stream.start())
183
192
  # start_list.append(market_data_stream.start())
184
193
  else:
@@ -191,7 +200,6 @@ class Client:
191
200
  #
192
201
  market_data_stream = MarketEventsDataStream(self, _endpoint, self.exchange, _trade_id, channel)
193
202
  self.data_streams[_trade_id] |= {market_data_stream}
194
- await asyncio.sleep(1)
195
203
  asyncio.ensure_future(market_data_stream.start())
196
204
 
197
205
  async def stop_events_listener(self, _trade_id):
@@ -221,28 +229,29 @@ class Client:
221
229
  return f"{symbol_info.get('baseAsset')}-{symbol_info.get('quoteAsset')}"
222
230
 
223
231
  def active_order(self, order_id: int, quantity="0", executed_qty="0", last_event=None):
224
- if last_event is None:
225
- last_event = []
226
- if order_id in self.active_orders and not self.active_orders[order_id]["origQty"]:
227
- self.active_orders[order_id].update({'origQty': Decimal(quantity)})
228
- elif order_id not in self.active_orders:
232
+ if order_id not in self.active_orders:
229
233
  self.active_orders[order_id] = {
230
- 'lifeTime': int(time.time()) + 60 * STATUS_TIMEOUT,
231
234
  'origQty': Decimal(quantity),
232
235
  'executedQty': Decimal(executed_qty),
233
- 'lastEvent': last_event, # trade_event: list
236
+ 'lastEvent': last_event if last_event else None,
237
+ 'eventIds': [],
234
238
  'cancelled': False
235
239
  }
236
- if last_event:
237
- self.active_orders[order_id].update({'lastEvent': last_event})
240
+ elif last_event is not None:
241
+ self.active_orders[order_id]['lastEvent'] = last_event
242
+
243
+ self.active_orders[order_id]['lifeTime'] = int(time.time()) + 60 * STATUS_TIMEOUT
238
244
 
239
- def active_orders_clear(self, active_orders: list = None):
245
+ if not self.active_orders[order_id]["origQty"] and Decimal(quantity):
246
+ self.active_orders[order_id]["origQty"] = Decimal(quantity)
247
+
248
+ def active_orders_clear(self):
240
249
  ts = int(time.time())
241
- self.active_orders = {key: val for key, val in self.active_orders.items() if val['lifeTime'] > ts}
242
- for order_id in active_orders:
243
- self.active_orders[order_id]['lifeTime'] = ts + 60 * STATUS_TIMEOUT
250
+ self.active_orders = {
251
+ key: val for key, val in self.active_orders.items() if val['lifeTime'] > ts
252
+ }
244
253
 
245
- def refine_amount(self, symbol, amount: Union[str, Decimal], quote=False):
254
+ def refine_amount(self, symbol, amount: Union[str, Decimal], _quote=False):
246
255
  if type(amount) is str: # to save time for developers
247
256
  amount = Decimal(amount)
248
257
  if self.loaded:
@@ -251,7 +260,7 @@ class Client:
251
260
  step_size = Decimal(lot_size_filter["stepSize"])
252
261
  # noinspection PyStringFormat
253
262
  amount = (
254
- (f"%.{precision}f" % truncate(amount if quote else (amount - amount % step_size), precision))
263
+ (f"%.{precision}f" % truncate(amount if _quote else (amount - amount % step_size), precision))
255
264
  .rstrip("0")
256
265
  .rstrip(".")
257
266
  )
@@ -331,7 +340,8 @@ class Client:
331
340
  binance_res = bfx.exchange_info(symbols_details, tickers, symbol)
332
341
  elif self.exchange == 'huobi':
333
342
  server_time = await self.fetch_server_time()
334
- trading_symbols = await self.http.send_api_call("v1/common/symbols")
343
+ params = {'symbols': symbol.lower()}
344
+ trading_symbol = await self.http.send_api_call("v1/settings/common/market-symbols", **params)
335
345
  if self.account_id is None:
336
346
  accounts = await self.http.send_api_call("v1/account/accounts", signed=True)
337
347
  for account in accounts:
@@ -339,7 +349,7 @@ class Client:
339
349
  self.account_id = account.get('id')
340
350
  break
341
351
  self.account_uid = await self.http.send_api_call("v2/user/uid", signed=True)
342
- binance_res = hbp.exchange_info(server_time.get('serverTime'), trading_symbols, symbol)
352
+ binance_res = hbp.exchange_info(server_time.get('serverTime'), trading_symbol[0])
343
353
  elif self.exchange == 'okx':
344
354
  params = {'instType': 'SPOT'}
345
355
  server_time = await self.fetch_server_time()
@@ -351,7 +361,7 @@ class Client:
351
361
  server_time = await self.fetch_server_time()
352
362
  instruments, _ = await self.http.send_api_call("/v5/market/instruments-info", **params)
353
363
  binance_res = bbt.exchange_info(server_time.get('serverTime'), instruments.get('list'))
354
- # print(f"fetch_exchange_info: binance_res: {binance_res}")
364
+ # logger.info(f"fetch_exchange_info: binance_res: {binance_res}")
355
365
  return binance_res
356
366
 
357
367
  # MARKET DATA ENDPOINTS
@@ -868,7 +878,6 @@ class Client:
868
878
  **params,
869
879
  )
870
880
  )
871
- logger.info(f"create_order.res: {res}")
872
881
  if res and isinstance(res, list) and res[6] == 'SUCCESS':
873
882
  self.active_order(res[4][0][0], quantity)
874
883
  binance_res = bfx.order(res[4][0], response_type=False)
@@ -883,22 +892,20 @@ class Client:
883
892
  }
884
893
  if new_client_order_id:
885
894
  params["client-order-id"] = str(new_client_order_id)
886
- count = 0
887
- res = None
888
- while count < STATUS_TIMEOUT:
889
- res = await self.http.send_api_call(
890
- "v1/order/orders/place",
891
- method="POST",
892
- signed=True,
893
- timeout=STATUS_TIMEOUT,
894
- **params,
895
- )
896
- if res:
897
- break
898
- count += 1
899
- logger.debug(f"RateLimitReached for {symbol}, count {count}, try one else")
895
+ res = await self.http.send_api_call(
896
+ "v1/order/orders/place",
897
+ method="POST",
898
+ signed=True,
899
+ timeout=STATUS_TIMEOUT,
900
+ **params,
901
+ )
900
902
  if res:
903
+ timeout = STATUS_TIMEOUT / 0.1
904
+ while not self.active_orders.get(int(res)) and timeout:
905
+ timeout -= 1
906
+ await asyncio.sleep(0.1)
901
907
  binance_res = await self.fetch_order(trade_id, symbol, order_id=res, response_type=False)
908
+ self.active_order(int(res), quantity, binance_res['executedQty'])
902
909
  elif self.exchange == 'okx':
903
910
  params = {
904
911
  "instId": self.symbol_to_okx(symbol),
@@ -936,7 +943,6 @@ class Client:
936
943
  if res:
937
944
  res["ts"] = ts
938
945
  binance_res = bbt.place_order_response(res, params)
939
-
940
946
  return binance_res
941
947
 
942
948
  # https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#query-order-user_data
@@ -1092,13 +1098,13 @@ class Client:
1092
1098
  method="POST",
1093
1099
  signed=True
1094
1100
  )
1095
- order_cancelled = False
1096
- timeout = STATUS_TIMEOUT
1097
- while res and not order_cancelled and timeout:
1098
- timeout -= 1
1101
+ if res:
1102
+ timeout = STATUS_TIMEOUT / 0.1
1103
+ while not self.active_orders.get(order_id, {}).get('cancelled', False) and timeout:
1104
+ timeout -= 1
1105
+ await asyncio.sleep(0.1)
1099
1106
  binance_res = await self.fetch_order(trade_id, symbol, order_id=res, response_type=True)
1100
- order_cancelled = binance_res.get('status') == 'CANCELED'
1101
- await asyncio.sleep(1)
1107
+
1102
1108
  elif self.exchange == 'okx':
1103
1109
  _symbol = self.symbol_to_okx(symbol)
1104
1110
  _queue = asyncio.Queue()
@@ -1587,17 +1593,29 @@ class Client:
1587
1593
 
1588
1594
  # https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account
1589
1595
  async def transfer_to_master(self, symbol, quantity, receive_window=None):
1596
+ quantity = any2str(Decimal(quantity).quantize(Decimal('0.01234567'), rounding=ROUND_HALF_DOWN))
1597
+
1590
1598
  binance_res = {}
1591
1599
  if self.exchange == 'binance':
1592
1600
  params = {"asset": symbol, "amount": quantity}
1593
1601
  if receive_window:
1594
1602
  params["recvWindow"] = receive_window
1595
- binance_res = await self.http.send_api_call(
1596
- "/sapi/v1/sub-account/transfer/subToMaster",
1597
- "POST",
1598
- params=params,
1599
- signed=True
1600
- )
1603
+ if self.master_email:
1604
+ logger.info(f"Collect {quantity}{symbol} to {self.master_email} sub-account")
1605
+ params["toEmail"] = self.master_email
1606
+ binance_res = await self.http.send_api_call(
1607
+ "/sapi/v1/sub-account/transfer/subToSub",
1608
+ "POST",
1609
+ signed=True,
1610
+ params=params
1611
+ )
1612
+ else:
1613
+ binance_res = await self.http.send_api_call(
1614
+ "/sapi/v1/sub-account/transfer/subToMaster",
1615
+ "POST",
1616
+ signed=True,
1617
+ params=params
1618
+ )
1601
1619
  elif self.exchange == 'bitfinex':
1602
1620
  if self.master_email is None or self.two_fa is None:
1603
1621
  raise ValueError("This query requires master_email and 2FA")
@@ -1768,6 +1786,8 @@ class Client:
1768
1786
  return binance_res
1769
1787
 
1770
1788
  async def fetch_order_trade_list(self, trade_id, symbol, order_id):
1789
+ if not order_id:
1790
+ raise ValueError("This query (fetch_order_trade_list) requires an order_id")
1771
1791
  self.assert_symbol(symbol)
1772
1792
  binance_res = []
1773
1793
  if self.exchange == 'binance':
@@ -1794,14 +1814,15 @@ class Client:
1794
1814
  binance_res = okx.order_trade_list(res)
1795
1815
  elif self.exchange == 'bybit':
1796
1816
  res = await self.fetch_order(trade_id, symbol, order_id)
1797
- params = {
1798
- 'accountType': "UNIFIED",
1799
- 'category': "spot",
1800
- 'startTime': res.get('time'),
1801
- 'endTime': res.get('updateTime') + 500,
1802
- }
1803
- res, _ = await self.http.send_api_call("/v5/account/transaction-log", signed=True, **params)
1804
- binance_res = bbt.order_trade_list(res['list'], str(order_id))
1817
+ if res:
1818
+ params = {
1819
+ 'accountType': "UNIFIED",
1820
+ 'category': "spot",
1821
+ 'startTime': res.get('time'),
1822
+ 'endTime': res.get('updateTime') + 500,
1823
+ }
1824
+ res, _ = await self.http.send_api_call("/v5/account/transaction-log", signed=True, **params)
1825
+ binance_res = bbt.order_trade_list(res['list'], str(order_id))
1805
1826
 
1806
1827
  logger.debug(f"fetch_order_trade_list.binance_res: {binance_res}")
1807
1828
  return binance_res