ccxt 4.4.99__py2.py3-none-any.whl → 4.4.100__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bingx.py +1 -0
  3. ccxt/alpaca.py +1 -1
  4. ccxt/apex.py +1 -1
  5. ccxt/ascendex.py +1 -1
  6. ccxt/async_support/__init__.py +1 -1
  7. ccxt/async_support/alpaca.py +1 -1
  8. ccxt/async_support/apex.py +1 -1
  9. ccxt/async_support/ascendex.py +1 -1
  10. ccxt/async_support/base/exchange.py +44 -9
  11. ccxt/async_support/base/ws/client.py +3 -1
  12. ccxt/async_support/bigone.py +1 -1
  13. ccxt/async_support/binance.py +3 -2
  14. ccxt/async_support/bingx.py +33 -4
  15. ccxt/async_support/bitbank.py +1 -1
  16. ccxt/async_support/bitfinex.py +4 -1
  17. ccxt/async_support/bitflyer.py +1 -1
  18. ccxt/async_support/bitget.py +32 -14
  19. ccxt/async_support/bithumb.py +1 -1
  20. ccxt/async_support/bitmart.py +2 -2
  21. ccxt/async_support/bitmex.py +3 -2
  22. ccxt/async_support/bitopro.py +1 -1
  23. ccxt/async_support/bitrue.py +2 -2
  24. ccxt/async_support/bitso.py +1 -1
  25. ccxt/async_support/bitstamp.py +1 -1
  26. ccxt/async_support/bittrade.py +1 -1
  27. ccxt/async_support/bitvavo.py +1 -1
  28. ccxt/async_support/blockchaincom.py +1 -1
  29. ccxt/async_support/blofin.py +1 -1
  30. ccxt/async_support/btcmarkets.py +1 -1
  31. ccxt/async_support/bybit.py +2 -2
  32. ccxt/async_support/coinbase.py +1 -1
  33. ccxt/async_support/coinbaseexchange.py +1 -1
  34. ccxt/async_support/coinbaseinternational.py +1 -1
  35. ccxt/async_support/coincatch.py +2 -2
  36. ccxt/async_support/coinex.py +3 -3
  37. ccxt/async_support/coinmate.py +1 -1
  38. ccxt/async_support/coinsph.py +1 -1
  39. ccxt/async_support/cryptocom.py +1 -1
  40. ccxt/async_support/defx.py +2 -2
  41. ccxt/async_support/delta.py +1 -1
  42. ccxt/async_support/deribit.py +1 -1
  43. ccxt/async_support/digifinex.py +2 -2
  44. ccxt/async_support/ellipx.py +1 -1
  45. ccxt/async_support/exmo.py +1 -1
  46. ccxt/async_support/foxbit.py +3 -3
  47. ccxt/async_support/gate.py +17 -2
  48. ccxt/async_support/gemini.py +1 -1
  49. ccxt/async_support/hashkey.py +2 -2
  50. ccxt/async_support/hibachi.py +1 -1
  51. ccxt/async_support/hitbtc.py +2 -2
  52. ccxt/async_support/hollaex.py +1 -1
  53. ccxt/async_support/htx.py +4 -3
  54. ccxt/async_support/hyperliquid.py +71 -29
  55. ccxt/async_support/independentreserve.py +1 -1
  56. ccxt/async_support/indodax.py +1 -1
  57. ccxt/async_support/kraken.py +1 -1
  58. ccxt/async_support/krakenfutures.py +2 -1
  59. ccxt/async_support/kucoin.py +2 -2
  60. ccxt/async_support/kucoinfutures.py +2 -1
  61. ccxt/async_support/lbank.py +2 -2
  62. ccxt/async_support/mercado.py +1 -1
  63. ccxt/async_support/mexc.py +9 -2
  64. ccxt/async_support/modetrade.py +93 -2
  65. ccxt/async_support/ndax.py +1 -1
  66. ccxt/async_support/novadax.py +1 -1
  67. ccxt/async_support/okcoin.py +1 -1
  68. ccxt/async_support/okx.py +2 -2
  69. ccxt/async_support/onetrading.py +33 -0
  70. ccxt/async_support/oxfun.py +1 -1
  71. ccxt/async_support/p2b.py +32 -0
  72. ccxt/async_support/paradex.py +2 -1
  73. ccxt/async_support/phemex.py +2 -2
  74. ccxt/async_support/poloniex.py +2 -2
  75. ccxt/async_support/probit.py +36 -1
  76. ccxt/async_support/tokocrypto.py +1 -1
  77. ccxt/async_support/upbit.py +1 -1
  78. ccxt/async_support/vertex.py +1 -1
  79. ccxt/async_support/wavesexchange.py +1 -1
  80. ccxt/async_support/whitebit.py +2 -2
  81. ccxt/async_support/woo.py +4 -4
  82. ccxt/async_support/woofipro.py +93 -2
  83. ccxt/async_support/xt.py +2 -2
  84. ccxt/async_support/yobit.py +1 -1
  85. ccxt/async_support/zaif.py +1 -1
  86. ccxt/async_support/zonda.py +1 -1
  87. ccxt/base/exchange.py +11 -9
  88. ccxt/base/types.py +1 -0
  89. ccxt/bigone.py +1 -1
  90. ccxt/binance.py +3 -2
  91. ccxt/bingx.py +33 -4
  92. ccxt/bitbank.py +1 -1
  93. ccxt/bitfinex.py +4 -1
  94. ccxt/bitflyer.py +1 -1
  95. ccxt/bitget.py +32 -14
  96. ccxt/bithumb.py +1 -1
  97. ccxt/bitmart.py +2 -2
  98. ccxt/bitmex.py +3 -2
  99. ccxt/bitopro.py +1 -1
  100. ccxt/bitrue.py +2 -2
  101. ccxt/bitso.py +1 -1
  102. ccxt/bitstamp.py +1 -1
  103. ccxt/bittrade.py +1 -1
  104. ccxt/bitvavo.py +1 -1
  105. ccxt/blockchaincom.py +1 -1
  106. ccxt/blofin.py +1 -1
  107. ccxt/btcmarkets.py +1 -1
  108. ccxt/bybit.py +2 -2
  109. ccxt/coinbase.py +1 -1
  110. ccxt/coinbaseexchange.py +1 -1
  111. ccxt/coinbaseinternational.py +1 -1
  112. ccxt/coincatch.py +2 -2
  113. ccxt/coinex.py +3 -3
  114. ccxt/coinmate.py +1 -1
  115. ccxt/coinsph.py +1 -1
  116. ccxt/cryptocom.py +1 -1
  117. ccxt/defx.py +2 -2
  118. ccxt/delta.py +1 -1
  119. ccxt/deribit.py +1 -1
  120. ccxt/digifinex.py +2 -2
  121. ccxt/ellipx.py +1 -1
  122. ccxt/exmo.py +1 -1
  123. ccxt/foxbit.py +3 -3
  124. ccxt/gate.py +17 -2
  125. ccxt/gemini.py +1 -1
  126. ccxt/hashkey.py +2 -2
  127. ccxt/hibachi.py +1 -1
  128. ccxt/hitbtc.py +2 -2
  129. ccxt/hollaex.py +1 -1
  130. ccxt/htx.py +4 -3
  131. ccxt/hyperliquid.py +71 -29
  132. ccxt/independentreserve.py +1 -1
  133. ccxt/indodax.py +1 -1
  134. ccxt/kraken.py +1 -1
  135. ccxt/krakenfutures.py +2 -1
  136. ccxt/kucoin.py +2 -2
  137. ccxt/kucoinfutures.py +2 -1
  138. ccxt/lbank.py +2 -2
  139. ccxt/mercado.py +1 -1
  140. ccxt/mexc.py +9 -2
  141. ccxt/modetrade.py +93 -2
  142. ccxt/ndax.py +1 -1
  143. ccxt/novadax.py +1 -1
  144. ccxt/okcoin.py +1 -1
  145. ccxt/okx.py +2 -2
  146. ccxt/onetrading.py +33 -0
  147. ccxt/oxfun.py +1 -1
  148. ccxt/p2b.py +32 -0
  149. ccxt/paradex.py +2 -1
  150. ccxt/phemex.py +2 -2
  151. ccxt/poloniex.py +2 -2
  152. ccxt/pro/__init__.py +1 -1
  153. ccxt/pro/binance.py +2 -1
  154. ccxt/pro/bitvavo.py +1 -1
  155. ccxt/pro/bybit.py +1 -0
  156. ccxt/pro/coinex.py +1 -1
  157. ccxt/pro/hyperliquid.py +99 -12
  158. ccxt/pro/kucoin.py +1 -1
  159. ccxt/pro/kucoinfutures.py +1 -1
  160. ccxt/pro/mexc.py +328 -139
  161. ccxt/pro/okx.py +2 -1
  162. ccxt/pro/oxfun.py +1 -1
  163. ccxt/probit.py +36 -1
  164. ccxt/protobuf/__init__.py +0 -0
  165. ccxt/protobuf/mexc/PrivateAccountV3Api_pb2.py +37 -0
  166. ccxt/protobuf/mexc/PrivateDealsV3Api_pb2.py +37 -0
  167. ccxt/protobuf/mexc/PrivateOrdersV3Api_pb2.py +37 -0
  168. ccxt/protobuf/mexc/PublicAggreBookTickerV3Api_pb2.py +37 -0
  169. ccxt/protobuf/mexc/PublicAggreDealsV3Api_pb2.py +39 -0
  170. ccxt/protobuf/mexc/PublicAggreDepthsV3Api_pb2.py +39 -0
  171. ccxt/protobuf/mexc/PublicBookTickerBatchV3Api_pb2.py +38 -0
  172. ccxt/protobuf/mexc/PublicBookTickerV3Api_pb2.py +37 -0
  173. ccxt/protobuf/mexc/PublicDealsV3Api_pb2.py +39 -0
  174. ccxt/protobuf/mexc/PublicIncreaseDepthsBatchV3Api_pb2.py +38 -0
  175. ccxt/protobuf/mexc/PublicIncreaseDepthsV3Api_pb2.py +39 -0
  176. ccxt/protobuf/mexc/PublicLimitDepthsV3Api_pb2.py +39 -0
  177. ccxt/protobuf/mexc/PublicMiniTickerV3Api_pb2.py +37 -0
  178. ccxt/protobuf/mexc/PublicMiniTickersV3Api_pb2.py +38 -0
  179. ccxt/protobuf/mexc/PublicSpotKlineV3Api_pb2.py +37 -0
  180. ccxt/protobuf/mexc/PushDataV3ApiWrapper_pb2.py +52 -0
  181. ccxt/protobuf/mexc/__init__.py +0 -0
  182. ccxt/tokocrypto.py +1 -1
  183. ccxt/upbit.py +1 -1
  184. ccxt/vertex.py +1 -1
  185. ccxt/wavesexchange.py +1 -1
  186. ccxt/whitebit.py +2 -2
  187. ccxt/woo.py +4 -4
  188. ccxt/woofipro.py +93 -2
  189. ccxt/xt.py +2 -2
  190. ccxt/yobit.py +1 -1
  191. ccxt/zaif.py +1 -1
  192. ccxt/zonda.py +1 -1
  193. {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/METADATA +5 -5
  194. {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/RECORD +197 -179
  195. {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/LICENSE.txt +0 -0
  196. {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/WHEEL +0 -0
  197. {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.99'
25
+ __version__ = '4.4.100'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/bingx.py CHANGED
@@ -2,6 +2,7 @@ from ccxt.base.types import Entry
2
2
 
3
3
 
4
4
  class ImplicitAPI:
5
+ fund_v1_private_get_account_balance = fundV1PrivateGetAccountBalance = Entry('account/balance', ['fund', 'v1', 'private'], 'GET', {'cost': 1})
5
6
  spot_v1_public_get_server_time = spotV1PublicGetServerTime = Entry('server/time', ['spot', 'v1', 'public'], 'GET', {'cost': 1})
6
7
  spot_v1_public_get_common_symbols = spotV1PublicGetCommonSymbols = Entry('common/symbols', ['spot', 'v1', 'public'], 'GET', {'cost': 1})
7
8
  spot_v1_public_get_market_trades = spotV1PublicGetMarketTrades = Entry('market/trades', ['spot', 'v1', 'public'], 'GET', {'cost': 1})
ccxt/alpaca.py CHANGED
@@ -1567,7 +1567,7 @@ class alpaca(Exchange, ImplicitAPI):
1567
1567
  'tag': None,
1568
1568
  }
1569
1569
 
1570
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1570
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1571
1571
  """
1572
1572
  make a withdrawal
1573
1573
 
ccxt/apex.py CHANGED
@@ -1735,7 +1735,7 @@ class apex(Exchange, ImplicitAPI):
1735
1735
  'rate': self.safe_number(income, 'rate'),
1736
1736
  }
1737
1737
 
1738
- def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
1738
+ def set_leverage(self, leverage: int, symbol: Str = None, params={}):
1739
1739
  """
1740
1740
  set the level of leverage for a market
1741
1741
 
ccxt/ascendex.py CHANGED
@@ -2957,7 +2957,7 @@ class ascendex(Exchange, ImplicitAPI):
2957
2957
  """
2958
2958
  return self.modify_margin_helper(symbol, amount, 'add', params)
2959
2959
 
2960
- def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2960
+ def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2961
2961
  """
2962
2962
  set the level of leverage for a market
2963
2963
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.99'
7
+ __version__ = '4.4.100'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1567,7 +1567,7 @@ class alpaca(Exchange, ImplicitAPI):
1567
1567
  'tag': None,
1568
1568
  }
1569
1569
 
1570
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1570
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1571
1571
  """
1572
1572
  make a withdrawal
1573
1573
 
@@ -1735,7 +1735,7 @@ class apex(Exchange, ImplicitAPI):
1735
1735
  'rate': self.safe_number(income, 'rate'),
1736
1736
  }
1737
1737
 
1738
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
1738
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
1739
1739
  """
1740
1740
  set the level of leverage for a market
1741
1741
 
@@ -2958,7 +2958,7 @@ class ascendex(Exchange, ImplicitAPI):
2958
2958
  """
2959
2959
  return await self.modify_margin_helper(symbol, amount, 'add', params)
2960
2960
 
2961
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2961
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2962
2962
  """
2963
2963
  set the level of leverage for a market
2964
2964
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.99'
5
+ __version__ = '4.4.100'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -54,6 +54,15 @@ __all__ = [
54
54
  ]
55
55
 
56
56
  # -----------------------------------------------------------------------------
57
+ # --- PROTO BUF IMPORTS
58
+ try:
59
+ from ccxt.protobuf.mexc import PushDataV3ApiWrapper_pb2
60
+ from google.protobuf.json_format import MessageToDict
61
+ except ImportError:
62
+ PushDataV3ApiWrapper_pb2 = None
63
+ MessageToDict = None
64
+
65
+ # -----------------------------------------------------------------------------
57
66
 
58
67
 
59
68
  class Exchange(BaseExchange):
@@ -418,6 +427,7 @@ class Exchange(BaseExchange):
418
427
  'verbose': self.verbose,
419
428
  'throttle': Throttler(self.tokenBucket, self.asyncio_loop),
420
429
  'asyncio_loop': self.asyncio_loop,
430
+ 'decompressBinary': self.safe_bool(self.options, 'decompressBinary', True),
421
431
  }, ws_options)
422
432
  # we use aiohttp instead of fastClient now because of this
423
433
  # https://github.com/ccxt/ccxt/pull/25995
@@ -573,6 +583,31 @@ class Exchange(BaseExchange):
573
583
  return '0e-00'
574
584
  return format(n, 'g')
575
585
 
586
+ def decode_proto_msg(self, data):
587
+ if not MessageToDict:
588
+ raise NotSupported(self.id + ' requires protobuf to decode messages, please install it with `pip install "protobuf==5.29.3"`')
589
+ message = PushDataV3ApiWrapper_pb2.PushDataV3ApiWrapper()
590
+ message.ParseFromString(data)
591
+ dict_msg = MessageToDict(message)
592
+ # {
593
+ # "channel":"spot@public.kline.v3.api.pb@BTCUSDT@Min1",
594
+ # "symbol":"BTCUSDT",
595
+ # "symbolId":"2fb942154ef44a4ab2ef98c8afb6a4a7",
596
+ # "createTime":"1754735110559",
597
+ # "publicSpotKline":{
598
+ # "interval":"Min1",
599
+ # "windowStart":"1754735100",
600
+ # "openingPrice":"117792.45",
601
+ # "closingPrice":"117805.32",
602
+ # "highestPrice":"117814.63",
603
+ # "lowestPrice":"117792.45",
604
+ # "volume":"0.13425465",
605
+ # "amount":"15815.77",
606
+ # "windowEnd":"1754735160"
607
+ # }
608
+ # }
609
+ return dict_msg
610
+
576
611
  # ########################################################################
577
612
  # ########################################################################
578
613
  # ########################################################################
@@ -742,13 +777,13 @@ class Exchange(BaseExchange):
742
777
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
743
778
  raise NotSupported(self.id + ' transfer() is not supported yet')
744
779
 
745
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
780
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}):
746
781
  raise NotSupported(self.id + ' withdraw() is not supported yet')
747
782
 
748
783
  async def create_deposit_address(self, code: str, params={}):
749
784
  raise NotSupported(self.id + ' createDepositAddress() is not supported yet')
750
785
 
751
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
786
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
752
787
  raise NotSupported(self.id + ' setLeverage() is not supported yet')
753
788
 
754
789
  async def fetch_leverage(self, symbol: str, params={}):
@@ -797,7 +832,7 @@ class Exchange(BaseExchange):
797
832
  async def fetch_deposit_addresses_by_network(self, code: str, params={}):
798
833
  raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
799
834
 
800
- async def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
835
+ async def fetch_open_interest_history(self, symbol: str, timeframe: str = '1h', since: Int = None, limit: Int = None, params={}):
801
836
  raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
802
837
 
803
838
  async def fetch_open_interest(self, symbol: str, params={}):
@@ -1182,7 +1217,7 @@ class Exchange(BaseExchange):
1182
1217
  async def fetch_position_mode(self, symbol: Str = None, params={}):
1183
1218
  raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
1184
1219
 
1185
- async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
1220
+ async def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
1186
1221
  """
1187
1222
  create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
1188
1223
  :param str symbol: unified symbol of the market to create an order in
@@ -1204,7 +1239,7 @@ class Exchange(BaseExchange):
1204
1239
  return await self.create_order(symbol, type, side, amount, price, params)
1205
1240
  raise NotSupported(self.id + ' createTrailingAmountOrder() is not supported yet')
1206
1241
 
1207
- async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
1242
+ async def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
1208
1243
  """
1209
1244
  create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
1210
1245
  :param str symbol: unified symbol of the market to create an order in
@@ -1226,7 +1261,7 @@ class Exchange(BaseExchange):
1226
1261
  return await self.create_order_ws(symbol, type, side, amount, price, params)
1227
1262
  raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
1228
1263
 
1229
- async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
1264
+ async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
1230
1265
  """
1231
1266
  create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
1232
1267
  :param str symbol: unified symbol of the market to create an order in
@@ -1248,7 +1283,7 @@ class Exchange(BaseExchange):
1248
1283
  return await self.create_order(symbol, type, side, amount, price, params)
1249
1284
  raise NotSupported(self.id + ' createTrailingPercentOrder() is not supported yet')
1250
1285
 
1251
- async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
1286
+ async def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
1252
1287
  """
1253
1288
  create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
1254
1289
  :param str symbol: unified symbol of the market to create an order in
@@ -1815,7 +1850,7 @@ class Exchange(BaseExchange):
1815
1850
  else:
1816
1851
  raise NotSupported(self.id + ' fetchFundingInterval() is not supported yet')
1817
1852
 
1818
- async def fetch_mark_ohlcv(self, symbol, timeframe='1m', since: Int = None, limit: Int = None, params={}):
1853
+ async def fetch_mark_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
1819
1854
  """
1820
1855
  fetches historical mark price candlestick data containing the open, high, low, and close price of a market
1821
1856
  :param str symbol: unified symbol of the market to fetch OHLCV data for
@@ -50,6 +50,7 @@ class Client(object):
50
50
  connecting = False
51
51
  asyncio_loop: BaseEventLoop = None
52
52
  ping_looper = None
53
+ decompressBinary = True # decompress binary messages by default
53
54
 
54
55
  def __init__(self, url, on_message_callback, on_error_callback, on_close_callback, on_connected_callback, config={}):
55
56
  defaults = {
@@ -218,7 +219,8 @@ class Client(object):
218
219
  if self.verbose:
219
220
  self.log(iso8601(milliseconds()), 'message', data)
220
221
  if isinstance(data, bytes):
221
- data = data.decode()
222
+ if self.decompressBinary:
223
+ data = data.decode()
222
224
  # decoded = json.loads(data) if is_json_encoded_object(data) else data
223
225
  decode = None
224
226
  if is_json_encoded_object(data):
@@ -2177,7 +2177,7 @@ class bigone(Exchange, ImplicitAPI):
2177
2177
  }
2178
2178
  return self.safe_string(statuses, status, 'failed')
2179
2179
 
2180
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2180
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2181
2181
  """
2182
2182
  make a withdrawal
2183
2183
 
@@ -8844,7 +8844,7 @@ class binance(Exchange, ImplicitAPI):
8844
8844
  }
8845
8845
  return result
8846
8846
 
8847
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
8847
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
8848
8848
  """
8849
8849
  make a withdrawal
8850
8850
 
@@ -10552,7 +10552,7 @@ class binance(Exchange, ImplicitAPI):
10552
10552
  raise NotSupported(self.id + ' fetchFundingHistory() supports linear and inverse contracts only')
10553
10553
  return self.parse_incomes(response, market, since, limit)
10554
10554
 
10555
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
10555
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
10556
10556
  """
10557
10557
  set the level of leverage for a market
10558
10558
 
@@ -12441,6 +12441,7 @@ class binance(Exchange, ImplicitAPI):
12441
12441
  'contracts': self.safe_number(liquidation, 'executedQty'),
12442
12442
  'contractSize': self.safe_number(market, 'contractSize'),
12443
12443
  'price': self.safe_number(liquidation, 'avgPrice'),
12444
+ 'side': self.safe_string_lower(liquidation, 'side'),
12444
12445
  'baseValue': self.safe_number(liquidation, 'cumBase'),
12445
12446
  'quoteValue': self.safe_number(liquidation, 'cumQuote'),
12446
12447
  'timestamp': timestamp,
@@ -119,6 +119,7 @@ class bingx(Exchange, ImplicitAPI):
119
119
  'urls': {
120
120
  'logo': 'https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/253675376-6983b72e-4999-4549-b177-33b374c195e3.jpg',
121
121
  'api': {
122
+ 'fund': 'https://open-api.{hostname}/openApi',
122
123
  'spot': 'https://open-api.{hostname}/openApi',
123
124
  'swap': 'https://open-api.{hostname}/openApi',
124
125
  'contract': 'https://open-api.{hostname}/openApi',
@@ -155,6 +156,15 @@ class bingx(Exchange, ImplicitAPI):
155
156
  'secret': True,
156
157
  },
157
158
  'api': {
159
+ 'fund': {
160
+ 'v1': {
161
+ 'private': {
162
+ 'get': {
163
+ 'account/balance': 1,
164
+ },
165
+ },
166
+ },
167
+ },
158
168
  'spot': {
159
169
  'v1': {
160
170
  'public': {
@@ -569,8 +579,11 @@ class bingx(Exchange, ImplicitAPI):
569
579
  'LTC': 'LTC',
570
580
  },
571
581
  'networks': {
572
- 'ARB': 'ARBITRUM',
582
+ 'ARBITRUM': 'ARB',
573
583
  'MATIC': 'POLYGON',
584
+ 'ZKSYNC': 'ZKSYNCERA',
585
+ 'AVAXC': 'AVAX-C',
586
+ 'HBAR': 'HEDERA',
574
587
  },
575
588
  },
576
589
  'features': {
@@ -2127,6 +2140,7 @@ class bingx(Exchange, ImplicitAPI):
2127
2140
 
2128
2141
  :param dict [params]: extra parameters specific to the exchange API endpoint
2129
2142
  :param boolean [params.standard]: whether to fetch standard contract balances
2143
+ :param str [params.type]: the type of balance to fetch(spot, swap, funding) default is `spot`
2130
2144
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
2131
2145
  """
2132
2146
  await self.load_markets()
@@ -2156,6 +2170,21 @@ class bingx(Exchange, ImplicitAPI):
2156
2170
  # ]
2157
2171
  # }
2158
2172
  #
2173
+ elif (marketType == 'funding') or (marketType == 'fund'):
2174
+ response = await self.fundV1PrivateGetAccountBalance(marketTypeQuery)
2175
+ # {
2176
+ # code: '0',
2177
+ # timestamp: '1754906016631',
2178
+ # data: {
2179
+ # assets: [
2180
+ # {
2181
+ # asset: 'USDT',
2182
+ # free: '44.37692200000000237300',
2183
+ # locked: '0.00000000000000000000'
2184
+ # }
2185
+ # ]
2186
+ # }
2187
+ # }
2159
2188
  elif marketType == 'spot':
2160
2189
  response = await self.spotV1PrivateGetAccountBalance(marketTypeQuery)
2161
2190
  #
@@ -2304,7 +2333,7 @@ class bingx(Exchange, ImplicitAPI):
2304
2333
  firstStandardOrInverse = self.safe_dict(standardAndInverseBalances, 0)
2305
2334
  isStandardOrInverse = firstStandardOrInverse is not None
2306
2335
  spotData = self.safe_dict(response, 'data', {})
2307
- spotBalances = self.safe_list(spotData, 'balances')
2336
+ spotBalances = self.safe_list_2(spotData, 'balances', 'assets', [])
2308
2337
  firstSpot = self.safe_dict(spotBalances, 0)
2309
2338
  isSpot = firstSpot is not None
2310
2339
  if isStandardOrInverse:
@@ -5316,7 +5345,7 @@ class bingx(Exchange, ImplicitAPI):
5316
5345
  'shortLeverage': self.safe_integer(leverage, 'shortLeverage'),
5317
5346
  }
5318
5347
 
5319
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
5348
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
5320
5349
  """
5321
5350
  set the level of leverage for a market
5322
5351
 
@@ -5563,7 +5592,7 @@ class bingx(Exchange, ImplicitAPI):
5563
5592
  depositWithdrawFees[code] = self.parse_deposit_withdraw_fee(entry)
5564
5593
  return depositWithdrawFees
5565
5594
 
5566
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
5595
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
5567
5596
  """
5568
5597
  make a withdrawal
5569
5598
 
@@ -937,7 +937,7 @@ class bitbank(Exchange, ImplicitAPI):
937
937
  'tag': None,
938
938
  }
939
939
 
940
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
940
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
941
941
  """
942
942
  make a withdrawal
943
943
 
@@ -2632,7 +2632,7 @@ class bitfinex(Exchange, ImplicitAPI):
2632
2632
  #
2633
2633
  return self.parse_transactions(response, currency, since, limit)
2634
2634
 
2635
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2635
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2636
2636
  """
2637
2637
  make a withdrawal
2638
2638
 
@@ -3542,12 +3542,15 @@ class bitfinex(Exchange, ImplicitAPI):
3542
3542
  contractSize = self.safe_string(market, 'contractSize')
3543
3543
  baseValue = Precise.string_mul(contracts, contractSize)
3544
3544
  price = self.safe_string(entry, 11)
3545
+ sideFlag = self.safe_integer(entry, 8)
3546
+ side = 'buy' if (sideFlag == 1) else 'sell'
3545
3547
  return self.safe_liquidation({
3546
3548
  'info': entry,
3547
3549
  'symbol': self.safe_symbol(marketId, market, None, 'contract'),
3548
3550
  'contracts': self.parse_number(contracts),
3549
3551
  'contractSize': self.parse_number(contractSize),
3550
3552
  'price': self.parse_number(price),
3553
+ 'side': side,
3551
3554
  'baseValue': self.parse_number(baseValue),
3552
3555
  'quoteValue': self.parse_number(Precise.string_mul(baseValue, price)),
3553
3556
  'timestamp': timestamp,
@@ -879,7 +879,7 @@ class bitflyer(Exchange, ImplicitAPI):
879
879
  # todo unify parsePosition/parsePositions
880
880
  return response
881
881
 
882
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
882
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
883
883
  """
884
884
  make a withdrawal
885
885
 
@@ -2731,7 +2731,7 @@ class bitget(Exchange, ImplicitAPI):
2731
2731
  rawTransactions = self.safe_list(response, 'data', [])
2732
2732
  return self.parse_transactions(rawTransactions, None, since, limit)
2733
2733
 
2734
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2734
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2735
2735
  """
2736
2736
  make a withdrawal
2737
2737
 
@@ -5554,6 +5554,7 @@ class bitget(Exchange, ImplicitAPI):
5554
5554
  :param str [params.planType]: *swap only* either profit_plan, loss_plan, normal_plan, pos_profit, pos_loss, moving_plan or track_plan
5555
5555
  :param boolean [params.trailing]: set to True if you want to cancel a trailing order
5556
5556
  :param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
5557
+ :param str [params.clientOrderId]: the clientOrderId of the order, id does not need to be provided if clientOrderId is provided
5557
5558
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
5558
5559
  """
5559
5560
  if symbol is None:
@@ -5569,12 +5570,29 @@ class bitget(Exchange, ImplicitAPI):
5569
5570
  params = self.omit(params, ['stop', 'trigger', 'trailing'])
5570
5571
  if not (market['spot'] and trigger):
5571
5572
  request['symbol'] = market['id']
5572
- if not ((market['swap'] or market['future']) and trigger):
5573
- request['orderId'] = id
5574
5573
  uta = None
5575
5574
  uta, params = self.handle_option_and_params(params, 'cancelOrder', 'uta', False)
5575
+ isPlanOrder = trigger or trailing
5576
+ isContract = market['swap'] or market['future']
5577
+ isContractTriggerEndpoint = isContract and isPlanOrder and not uta
5578
+ clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clientOid')
5579
+ if isContractTriggerEndpoint:
5580
+ orderIdList = []
5581
+ orderId: dict = {}
5582
+ if clientOrderId is not None:
5583
+ params = self.omit(params, 'clientOrderId')
5584
+ orderId['clientOid'] = clientOrderId
5585
+ else:
5586
+ orderId['orderId'] = id
5587
+ orderIdList.append(orderId)
5588
+ request['orderIdList'] = orderIdList
5589
+ else:
5590
+ if clientOrderId is not None:
5591
+ params = self.omit(params, 'clientOrderId')
5592
+ request['clientOid'] = clientOrderId
5593
+ else:
5594
+ request['orderId'] = id
5576
5595
  if uta:
5577
- request['orderId'] = id
5578
5596
  if trigger:
5579
5597
  response = await self.privateUtaPostV3TradeCancelStrategyOrder(self.extend(request, params))
5580
5598
  else:
@@ -5583,13 +5601,6 @@ class bitget(Exchange, ImplicitAPI):
5583
5601
  productType = None
5584
5602
  productType, params = self.handle_product_type_and_params(market, params)
5585
5603
  request['productType'] = productType
5586
- if trigger or trailing:
5587
- orderIdList = []
5588
- orderId: dict = {
5589
- 'orderId': id,
5590
- }
5591
- orderIdList.append(orderId)
5592
- request['orderIdList'] = orderIdList
5593
5604
  if trailing:
5594
5605
  planType = self.safe_string(params, 'planType', 'track_plan')
5595
5606
  request['planType'] = planType
@@ -5663,7 +5674,7 @@ class bitget(Exchange, ImplicitAPI):
5663
5674
  #
5664
5675
  data = self.safe_value(response, 'data', {})
5665
5676
  order = None
5666
- if (market['swap'] or market['future']) and trigger and not uta:
5677
+ if isContractTriggerEndpoint:
5667
5678
  orderInfo = self.safe_value(data, 'successList', [])
5668
5679
  order = orderInfo[0]
5669
5680
  else:
@@ -5936,6 +5947,7 @@ class bitget(Exchange, ImplicitAPI):
5936
5947
  :param str symbol: unified symbol of the market the order was made in
5937
5948
  :param dict [params]: extra parameters specific to the exchange API endpoint
5938
5949
  :param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
5950
+ :param str [params.clientOrderId]: the clientOrderId of the order, id does not need to be provided if clientOrderId is provided
5939
5951
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
5940
5952
  """
5941
5953
  if symbol is None:
@@ -5943,8 +5955,14 @@ class bitget(Exchange, ImplicitAPI):
5943
5955
  await self.load_markets()
5944
5956
  market = self.market(symbol)
5945
5957
  request: dict = {
5946
- 'orderId': id,
5958
+ # 'orderId': id,
5947
5959
  }
5960
+ clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clientOid')
5961
+ if clientOrderId is not None:
5962
+ params = self.omit(params, ['clientOrderId'])
5963
+ request['clientOid'] = clientOrderId
5964
+ else:
5965
+ request['orderId'] = id
5948
5966
  response = None
5949
5967
  uta = None
5950
5968
  uta, params = self.handle_option_and_params(params, 'fetchOrder', 'uta', False)
@@ -8383,7 +8401,7 @@ class bitget(Exchange, ImplicitAPI):
8383
8401
  'shortLeverage': self.safe_integer(leverage, shortLevKey),
8384
8402
  }
8385
8403
 
8386
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
8404
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
8387
8405
  """
8388
8406
  set the level of leverage for a market
8389
8407
 
@@ -1095,7 +1095,7 @@ class bithumb(Exchange, ImplicitAPI):
1095
1095
  }
1096
1096
  return await self.cancel_order(order['id'], order['symbol'], self.extend(request, params))
1097
1097
 
1098
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1098
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1099
1099
  """
1100
1100
  make a withdrawal
1101
1101
 
@@ -3606,7 +3606,7 @@ class bitmart(Exchange, ImplicitAPI):
3606
3606
  'tag': self.safe_string_2(depositAddress, 'address_memo', 'memo'),
3607
3607
  }
3608
3608
 
3609
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
3609
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
3610
3610
  """
3611
3611
  make a withdrawal
3612
3612
 
@@ -4466,7 +4466,7 @@ class bitmart(Exchange, ImplicitAPI):
4466
4466
  'info': interest,
4467
4467
  }, market)
4468
4468
 
4469
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
4469
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
4470
4470
  """
4471
4471
  set the level of leverage for a market
4472
4472
 
@@ -2446,7 +2446,7 @@ class bitmex(Exchange, ImplicitAPI):
2446
2446
  'takeProfitPrice': None,
2447
2447
  })
2448
2448
 
2449
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2449
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2450
2450
  """
2451
2451
  make a withdrawal
2452
2452
 
@@ -2625,7 +2625,7 @@ class bitmex(Exchange, ImplicitAPI):
2625
2625
  'datetime': datetime,
2626
2626
  }
2627
2627
 
2628
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2628
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2629
2629
  """
2630
2630
  set the level of leverage for a market
2631
2631
 
@@ -2883,6 +2883,7 @@ class bitmex(Exchange, ImplicitAPI):
2883
2883
  'contracts': None,
2884
2884
  'contractSize': self.safe_number(market, 'contractSize'),
2885
2885
  'price': self.safe_number(liquidation, 'price'),
2886
+ 'side': self.safe_string_lower(liquidation, 'side'),
2886
2887
  'baseValue': None,
2887
2888
  'quoteValue': None,
2888
2889
  'timestamp': None,
@@ -1680,7 +1680,7 @@ class bitopro(Exchange, ImplicitAPI):
1680
1680
  #
1681
1681
  return self.parse_transaction(result, currency)
1682
1682
 
1683
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1683
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1684
1684
  """
1685
1685
  make a withdrawal
1686
1686
 
@@ -2749,7 +2749,7 @@ class bitrue(Exchange, ImplicitAPI):
2749
2749
  'fee': fee,
2750
2750
  }
2751
2751
 
2752
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2752
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2753
2753
  """
2754
2754
  make a withdrawal
2755
2755
 
@@ -2975,7 +2975,7 @@ class bitrue(Exchange, ImplicitAPI):
2975
2975
  data = self.safe_dict(response, 'data', {})
2976
2976
  return self.parse_transfer(data, currency)
2977
2977
 
2978
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2978
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2979
2979
  """
2980
2980
  set the level of leverage for a market
2981
2981
 
@@ -1630,7 +1630,7 @@ class bitso(Exchange, ImplicitAPI):
1630
1630
  result[code]['info'][code] = withdrawFee
1631
1631
  return result
1632
1632
 
1633
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1633
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1634
1634
  """
1635
1635
  make a withdrawal
1636
1636
  :param str code: unified currency code
@@ -2148,7 +2148,7 @@ class bitstamp(Exchange, ImplicitAPI):
2148
2148
  'tag': tag,
2149
2149
  }
2150
2150
 
2151
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2151
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2152
2152
  """
2153
2153
  make a withdrawal
2154
2154
 
@@ -1824,7 +1824,7 @@ class bittrade(Exchange, ImplicitAPI):
1824
1824
  }
1825
1825
  return self.safe_string(statuses, status, status)
1826
1826
 
1827
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1827
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1828
1828
  """
1829
1829
  make a withdrawal
1830
1830
  :param str code: unified currency code
@@ -1788,7 +1788,7 @@ class bitvavo(Exchange, ImplicitAPI):
1788
1788
  request['paymentId'] = tag
1789
1789
  return self.extend(request, params)
1790
1790
 
1791
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1791
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1792
1792
  """
1793
1793
  make a withdrawal
1794
1794
  :param str code: unified currency code