ccxt 4.4.98__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 (234) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/bingx.py +1 -0
  3. ccxt/abstract/bitget.py +6 -0
  4. ccxt/abstract/hibachi.py +26 -0
  5. ccxt/alpaca.py +1 -1
  6. ccxt/apex.py +1 -1
  7. ccxt/ascendex.py +1 -1
  8. ccxt/async_support/__init__.py +3 -1
  9. ccxt/async_support/alpaca.py +1 -1
  10. ccxt/async_support/apex.py +1 -1
  11. ccxt/async_support/ascendex.py +1 -1
  12. ccxt/async_support/base/exchange.py +44 -9
  13. ccxt/async_support/base/ws/client.py +3 -1
  14. ccxt/async_support/bigone.py +1 -1
  15. ccxt/async_support/binance.py +10 -8
  16. ccxt/async_support/bingx.py +33 -4
  17. ccxt/async_support/bitbank.py +1 -1
  18. ccxt/async_support/bitfinex.py +4 -1
  19. ccxt/async_support/bitflyer.py +1 -1
  20. ccxt/async_support/bitget.py +2040 -561
  21. ccxt/async_support/bithumb.py +1 -1
  22. ccxt/async_support/bitmart.py +2 -2
  23. ccxt/async_support/bitmex.py +3 -2
  24. ccxt/async_support/bitopro.py +1 -1
  25. ccxt/async_support/bitrue.py +2 -2
  26. ccxt/async_support/bitso.py +1 -1
  27. ccxt/async_support/bitstamp.py +1 -1
  28. ccxt/async_support/bittrade.py +1 -1
  29. ccxt/async_support/bitvavo.py +1 -1
  30. ccxt/async_support/blockchaincom.py +1 -1
  31. ccxt/async_support/blofin.py +1 -1
  32. ccxt/async_support/btcmarkets.py +1 -1
  33. ccxt/async_support/bybit.py +7 -3
  34. ccxt/async_support/coinbase.py +1 -1
  35. ccxt/async_support/coinbaseexchange.py +1 -1
  36. ccxt/async_support/coinbaseinternational.py +1 -1
  37. ccxt/async_support/coincatch.py +2 -2
  38. ccxt/async_support/coinex.py +67 -6
  39. ccxt/async_support/coinmate.py +1 -1
  40. ccxt/async_support/coinsph.py +1 -1
  41. ccxt/async_support/cryptocom.py +2 -2
  42. ccxt/async_support/defx.py +2 -2
  43. ccxt/async_support/delta.py +1 -1
  44. ccxt/async_support/deribit.py +1 -1
  45. ccxt/async_support/digifinex.py +2 -2
  46. ccxt/async_support/ellipx.py +1 -1
  47. ccxt/async_support/exmo.py +1 -1
  48. ccxt/async_support/foxbit.py +3 -3
  49. ccxt/async_support/gate.py +18 -4
  50. ccxt/async_support/gemini.py +1 -1
  51. ccxt/async_support/hashkey.py +2 -2
  52. ccxt/async_support/hibachi.py +2080 -0
  53. ccxt/async_support/hitbtc.py +2 -2
  54. ccxt/async_support/hollaex.py +1 -1
  55. ccxt/async_support/htx.py +4 -3
  56. ccxt/async_support/hyperliquid.py +71 -29
  57. ccxt/async_support/independentreserve.py +1 -1
  58. ccxt/async_support/indodax.py +1 -1
  59. ccxt/async_support/kraken.py +1 -1
  60. ccxt/async_support/krakenfutures.py +2 -1
  61. ccxt/async_support/kucoin.py +2 -2
  62. ccxt/async_support/kucoinfutures.py +2 -1
  63. ccxt/async_support/lbank.py +2 -2
  64. ccxt/async_support/mercado.py +1 -1
  65. ccxt/async_support/mexc.py +9 -2
  66. ccxt/async_support/modetrade.py +93 -2
  67. ccxt/async_support/ndax.py +1 -1
  68. ccxt/async_support/novadax.py +35 -1
  69. ccxt/async_support/okcoin.py +1 -1
  70. ccxt/async_support/okx.py +2 -2
  71. ccxt/async_support/onetrading.py +33 -0
  72. ccxt/async_support/oxfun.py +1 -1
  73. ccxt/async_support/p2b.py +32 -0
  74. ccxt/async_support/paradex.py +2 -1
  75. ccxt/async_support/phemex.py +2 -2
  76. ccxt/async_support/poloniex.py +2 -2
  77. ccxt/async_support/probit.py +36 -1
  78. ccxt/async_support/tokocrypto.py +1 -1
  79. ccxt/async_support/upbit.py +1 -1
  80. ccxt/async_support/vertex.py +1 -1
  81. ccxt/async_support/wavesexchange.py +1 -1
  82. ccxt/async_support/whitebit.py +2 -2
  83. ccxt/async_support/woo.py +4 -4
  84. ccxt/async_support/woofipro.py +93 -2
  85. ccxt/async_support/xt.py +2 -2
  86. ccxt/async_support/yobit.py +1 -1
  87. ccxt/async_support/zaif.py +1 -1
  88. ccxt/async_support/zonda.py +1 -1
  89. ccxt/base/errors.py +0 -6
  90. ccxt/base/exchange.py +11 -9
  91. ccxt/base/types.py +1 -0
  92. ccxt/bigone.py +1 -1
  93. ccxt/binance.py +10 -8
  94. ccxt/bingx.py +33 -4
  95. ccxt/bitbank.py +1 -1
  96. ccxt/bitfinex.py +4 -1
  97. ccxt/bitflyer.py +1 -1
  98. ccxt/bitget.py +2040 -561
  99. ccxt/bithumb.py +1 -1
  100. ccxt/bitmart.py +2 -2
  101. ccxt/bitmex.py +3 -2
  102. ccxt/bitopro.py +1 -1
  103. ccxt/bitrue.py +2 -2
  104. ccxt/bitso.py +1 -1
  105. ccxt/bitstamp.py +1 -1
  106. ccxt/bittrade.py +1 -1
  107. ccxt/bitvavo.py +1 -1
  108. ccxt/blockchaincom.py +1 -1
  109. ccxt/blofin.py +1 -1
  110. ccxt/btcmarkets.py +1 -1
  111. ccxt/bybit.py +7 -3
  112. ccxt/coinbase.py +1 -1
  113. ccxt/coinbaseexchange.py +1 -1
  114. ccxt/coinbaseinternational.py +1 -1
  115. ccxt/coincatch.py +2 -2
  116. ccxt/coinex.py +67 -6
  117. ccxt/coinmate.py +1 -1
  118. ccxt/coinsph.py +1 -1
  119. ccxt/cryptocom.py +2 -2
  120. ccxt/defx.py +2 -2
  121. ccxt/delta.py +1 -1
  122. ccxt/deribit.py +1 -1
  123. ccxt/digifinex.py +2 -2
  124. ccxt/ellipx.py +1 -1
  125. ccxt/exmo.py +1 -1
  126. ccxt/foxbit.py +3 -3
  127. ccxt/gate.py +18 -4
  128. ccxt/gemini.py +1 -1
  129. ccxt/hashkey.py +2 -2
  130. ccxt/hibachi.py +2079 -0
  131. ccxt/hitbtc.py +2 -2
  132. ccxt/hollaex.py +1 -1
  133. ccxt/htx.py +4 -3
  134. ccxt/hyperliquid.py +71 -29
  135. ccxt/independentreserve.py +1 -1
  136. ccxt/indodax.py +1 -1
  137. ccxt/kraken.py +1 -1
  138. ccxt/krakenfutures.py +2 -1
  139. ccxt/kucoin.py +2 -2
  140. ccxt/kucoinfutures.py +2 -1
  141. ccxt/lbank.py +2 -2
  142. ccxt/mercado.py +1 -1
  143. ccxt/mexc.py +9 -2
  144. ccxt/modetrade.py +93 -2
  145. ccxt/ndax.py +1 -1
  146. ccxt/novadax.py +35 -1
  147. ccxt/okcoin.py +1 -1
  148. ccxt/okx.py +2 -2
  149. ccxt/onetrading.py +33 -0
  150. ccxt/oxfun.py +1 -1
  151. ccxt/p2b.py +32 -0
  152. ccxt/paradex.py +2 -1
  153. ccxt/phemex.py +2 -2
  154. ccxt/poloniex.py +2 -2
  155. ccxt/pro/__init__.py +1 -1
  156. ccxt/pro/alpaca.py +2 -2
  157. ccxt/pro/apex.py +2 -2
  158. ccxt/pro/ascendex.py +2 -2
  159. ccxt/pro/binance.py +4 -5
  160. ccxt/pro/bitget.py +3 -3
  161. ccxt/pro/bithumb.py +2 -2
  162. ccxt/pro/bitmart.py +2 -2
  163. ccxt/pro/bitmex.py +3 -3
  164. ccxt/pro/bitstamp.py +3 -3
  165. ccxt/pro/bittrade.py +2 -2
  166. ccxt/pro/bitvavo.py +5 -3
  167. ccxt/pro/bybit.py +5 -4
  168. ccxt/pro/cex.py +3 -2
  169. ccxt/pro/coinbaseexchange.py +4 -4
  170. ccxt/pro/coinbaseinternational.py +2 -2
  171. ccxt/pro/coincatch.py +1 -1
  172. ccxt/pro/coinex.py +1 -1
  173. ccxt/pro/coinone.py +2 -2
  174. ccxt/pro/cryptocom.py +2 -2
  175. ccxt/pro/derive.py +2 -2
  176. ccxt/pro/gate.py +3 -3
  177. ccxt/pro/hollaex.py +2 -2
  178. ccxt/pro/htx.py +3 -3
  179. ccxt/pro/hyperliquid.py +101 -14
  180. ccxt/pro/kraken.py +2 -2
  181. ccxt/pro/krakenfutures.py +4 -3
  182. ccxt/pro/kucoin.py +4 -3
  183. ccxt/pro/kucoinfutures.py +4 -3
  184. ccxt/pro/mexc.py +328 -139
  185. ccxt/pro/modetrade.py +2 -2
  186. ccxt/pro/okcoin.py +2 -2
  187. ccxt/pro/okx.py +7 -6
  188. ccxt/pro/onetrading.py +2 -2
  189. ccxt/pro/oxfun.py +1 -1
  190. ccxt/pro/p2b.py +2 -2
  191. ccxt/pro/paradex.py +2 -2
  192. ccxt/pro/poloniex.py +2 -2
  193. ccxt/pro/probit.py +2 -2
  194. ccxt/pro/vertex.py +2 -2
  195. ccxt/pro/whitebit.py +2 -2
  196. ccxt/pro/woo.py +2 -2
  197. ccxt/pro/woofipro.py +2 -2
  198. ccxt/probit.py +36 -1
  199. ccxt/protobuf/__init__.py +0 -0
  200. ccxt/protobuf/mexc/PrivateAccountV3Api_pb2.py +37 -0
  201. ccxt/protobuf/mexc/PrivateDealsV3Api_pb2.py +37 -0
  202. ccxt/protobuf/mexc/PrivateOrdersV3Api_pb2.py +37 -0
  203. ccxt/protobuf/mexc/PublicAggreBookTickerV3Api_pb2.py +37 -0
  204. ccxt/protobuf/mexc/PublicAggreDealsV3Api_pb2.py +39 -0
  205. ccxt/protobuf/mexc/PublicAggreDepthsV3Api_pb2.py +39 -0
  206. ccxt/protobuf/mexc/PublicBookTickerBatchV3Api_pb2.py +38 -0
  207. ccxt/protobuf/mexc/PublicBookTickerV3Api_pb2.py +37 -0
  208. ccxt/protobuf/mexc/PublicDealsV3Api_pb2.py +39 -0
  209. ccxt/protobuf/mexc/PublicIncreaseDepthsBatchV3Api_pb2.py +38 -0
  210. ccxt/protobuf/mexc/PublicIncreaseDepthsV3Api_pb2.py +39 -0
  211. ccxt/protobuf/mexc/PublicLimitDepthsV3Api_pb2.py +39 -0
  212. ccxt/protobuf/mexc/PublicMiniTickerV3Api_pb2.py +37 -0
  213. ccxt/protobuf/mexc/PublicMiniTickersV3Api_pb2.py +38 -0
  214. ccxt/protobuf/mexc/PublicSpotKlineV3Api_pb2.py +37 -0
  215. ccxt/protobuf/mexc/PushDataV3ApiWrapper_pb2.py +52 -0
  216. ccxt/protobuf/mexc/__init__.py +0 -0
  217. ccxt/test/tests_async.py +1 -1
  218. ccxt/test/tests_sync.py +1 -1
  219. ccxt/tokocrypto.py +1 -1
  220. ccxt/upbit.py +1 -1
  221. ccxt/vertex.py +1 -1
  222. ccxt/wavesexchange.py +1 -1
  223. ccxt/whitebit.py +2 -2
  224. ccxt/woo.py +4 -4
  225. ccxt/woofipro.py +93 -2
  226. ccxt/xt.py +2 -2
  227. ccxt/yobit.py +1 -1
  228. ccxt/zaif.py +1 -1
  229. ccxt/zonda.py +1 -1
  230. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/METADATA +8 -7
  231. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/RECORD +234 -213
  232. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/LICENSE.txt +0 -0
  233. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/WHEEL +0 -0
  234. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/top_level.txt +0 -0
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.98'
7
+ __version__ = '4.4.100'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1862,6 +1862,8 @@ class Exchange(object):
1862
1862
  signature = auth_data.signature
1863
1863
  return signature
1864
1864
 
1865
+ def is_binary_message(self, message):
1866
+ return isinstance(message, bytes) or isinstance(message, bytearray)
1865
1867
 
1866
1868
  # ########################################################################
1867
1869
  # ########################################################################
@@ -2774,13 +2776,13 @@ class Exchange(object):
2774
2776
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}):
2775
2777
  raise NotSupported(self.id + ' transfer() is not supported yet')
2776
2778
 
2777
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2779
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}):
2778
2780
  raise NotSupported(self.id + ' withdraw() is not supported yet')
2779
2781
 
2780
2782
  def create_deposit_address(self, code: str, params={}):
2781
2783
  raise NotSupported(self.id + ' createDepositAddress() is not supported yet')
2782
2784
 
2783
- def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2785
+ def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2784
2786
  raise NotSupported(self.id + ' setLeverage() is not supported yet')
2785
2787
 
2786
2788
  def fetch_leverage(self, symbol: str, params={}):
@@ -2829,7 +2831,7 @@ class Exchange(object):
2829
2831
  def fetch_deposit_addresses_by_network(self, code: str, params={}):
2830
2832
  raise NotSupported(self.id + ' fetchDepositAddressesByNetwork() is not supported yet')
2831
2833
 
2832
- def fetch_open_interest_history(self, symbol: str, timeframe='1h', since: Int = None, limit: Int = None, params={}):
2834
+ def fetch_open_interest_history(self, symbol: str, timeframe: str = '1h', since: Int = None, limit: Int = None, params={}):
2833
2835
  raise NotSupported(self.id + ' fetchOpenInterestHistory() is not supported yet')
2834
2836
 
2835
2837
  def fetch_open_interest(self, symbol: str, params={}):
@@ -5073,7 +5075,7 @@ class Exchange(object):
5073
5075
  def fetch_position_mode(self, symbol: Str = None, params={}):
5074
5076
  raise NotSupported(self.id + ' fetchPositionMode() is not supported yet')
5075
5077
 
5076
- def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
5078
+ def create_trailing_amount_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount: Num = None, trailingTriggerPrice: Num = None, params={}):
5077
5079
  """
5078
5080
  create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
5079
5081
  :param str symbol: unified symbol of the market to create an order in
@@ -5095,7 +5097,7 @@ class Exchange(object):
5095
5097
  return self.create_order(symbol, type, side, amount, price, params)
5096
5098
  raise NotSupported(self.id + ' createTrailingAmountOrder() is not supported yet')
5097
5099
 
5098
- def create_trailing_amount_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingAmount=None, trailingTriggerPrice=None, params={}):
5100
+ 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={}):
5099
5101
  """
5100
5102
  create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
5101
5103
  :param str symbol: unified symbol of the market to create an order in
@@ -5117,7 +5119,7 @@ class Exchange(object):
5117
5119
  return self.create_order_ws(symbol, type, side, amount, price, params)
5118
5120
  raise NotSupported(self.id + ' createTrailingAmountOrderWs() is not supported yet')
5119
5121
 
5120
- def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
5122
+ def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}):
5121
5123
  """
5122
5124
  create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5123
5125
  :param str symbol: unified symbol of the market to create an order in
@@ -5139,7 +5141,7 @@ class Exchange(object):
5139
5141
  return self.create_order(symbol, type, side, amount, price, params)
5140
5142
  raise NotSupported(self.id + ' createTrailingPercentOrder() is not supported yet')
5141
5143
 
5142
- def create_trailing_percent_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}):
5144
+ 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={}):
5143
5145
  """
5144
5146
  create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5145
5147
  :param str symbol: unified symbol of the market to create an order in
@@ -6193,7 +6195,7 @@ class Exchange(object):
6193
6195
  else:
6194
6196
  raise NotSupported(self.id + ' fetchFundingInterval() is not supported yet')
6195
6197
 
6196
- def fetch_mark_ohlcv(self, symbol, timeframe='1m', since: Int = None, limit: Int = None, params={}):
6198
+ def fetch_mark_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
6197
6199
  """
6198
6200
  fetches historical mark price candlestick data containing the open, high, low, and close price of a market
6199
6201
  :param str symbol: unified symbol of the market to fetch OHLCV data for
ccxt/base/types.py CHANGED
@@ -190,6 +190,7 @@ class Liquidation(TypedDict):
190
190
  price: Num
191
191
  baseValue: Num
192
192
  quoteValue: Num
193
+ side: OrderSide
193
194
 
194
195
 
195
196
  class FundingHistory(TypedDict):
ccxt/bigone.py CHANGED
@@ -2176,7 +2176,7 @@ class bigone(Exchange, ImplicitAPI):
2176
2176
  }
2177
2177
  return self.safe_string(statuses, status, 'failed')
2178
2178
 
2179
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2179
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2180
2180
  """
2181
2181
  make a withdrawal
2182
2182
 
ccxt/binance.py CHANGED
@@ -2731,12 +2731,13 @@ class binance(Exchange, ImplicitAPI):
2731
2731
  return market
2732
2732
  return markets[0]
2733
2733
  elif (symbol.find('/') > -1) and (symbol.find(':') < 0):
2734
- # support legacy symbols
2735
- base, quote = symbol.split('/')
2736
- settle = base if (quote == 'USD') else quote
2737
- futuresSymbol = symbol + ':' + settle
2738
- if futuresSymbol in self.markets:
2739
- return self.markets[futuresSymbol]
2734
+ if (defaultType is not None) and (defaultType != 'spot'):
2735
+ # support legacy symbols
2736
+ base, quote = symbol.split('/')
2737
+ settle = base if (quote == 'USD') else quote
2738
+ futuresSymbol = symbol + ':' + settle
2739
+ if futuresSymbol in self.markets:
2740
+ return self.markets[futuresSymbol]
2740
2741
  elif (symbol.find('-C') > -1) or (symbol.find('-P') > -1): # both exchange-id and unified symbols are supported self way regardless of the defaultType
2741
2742
  return self.create_expired_option_market(symbol)
2742
2743
  raise BadSymbol(self.id + ' does not have market symbol ' + symbol)
@@ -8842,7 +8843,7 @@ class binance(Exchange, ImplicitAPI):
8842
8843
  }
8843
8844
  return result
8844
8845
 
8845
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
8846
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
8846
8847
  """
8847
8848
  make a withdrawal
8848
8849
 
@@ -10550,7 +10551,7 @@ class binance(Exchange, ImplicitAPI):
10550
10551
  raise NotSupported(self.id + ' fetchFundingHistory() supports linear and inverse contracts only')
10551
10552
  return self.parse_incomes(response, market, since, limit)
10552
10553
 
10553
- def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
10554
+ def set_leverage(self, leverage: int, symbol: Str = None, params={}):
10554
10555
  """
10555
10556
  set the level of leverage for a market
10556
10557
 
@@ -12439,6 +12440,7 @@ class binance(Exchange, ImplicitAPI):
12439
12440
  'contracts': self.safe_number(liquidation, 'executedQty'),
12440
12441
  'contractSize': self.safe_number(market, 'contractSize'),
12441
12442
  'price': self.safe_number(liquidation, 'avgPrice'),
12443
+ 'side': self.safe_string_lower(liquidation, 'side'),
12442
12444
  'baseValue': self.safe_number(liquidation, 'cumBase'),
12443
12445
  'quoteValue': self.safe_number(liquidation, 'cumQuote'),
12444
12446
  'timestamp': timestamp,
ccxt/bingx.py CHANGED
@@ -118,6 +118,7 @@ class bingx(Exchange, ImplicitAPI):
118
118
  'urls': {
119
119
  'logo': 'https://github-production-user-asset-6210df.s3.amazonaws.com/1294454/253675376-6983b72e-4999-4549-b177-33b374c195e3.jpg',
120
120
  'api': {
121
+ 'fund': 'https://open-api.{hostname}/openApi',
121
122
  'spot': 'https://open-api.{hostname}/openApi',
122
123
  'swap': 'https://open-api.{hostname}/openApi',
123
124
  'contract': 'https://open-api.{hostname}/openApi',
@@ -154,6 +155,15 @@ class bingx(Exchange, ImplicitAPI):
154
155
  'secret': True,
155
156
  },
156
157
  'api': {
158
+ 'fund': {
159
+ 'v1': {
160
+ 'private': {
161
+ 'get': {
162
+ 'account/balance': 1,
163
+ },
164
+ },
165
+ },
166
+ },
157
167
  'spot': {
158
168
  'v1': {
159
169
  'public': {
@@ -568,8 +578,11 @@ class bingx(Exchange, ImplicitAPI):
568
578
  'LTC': 'LTC',
569
579
  },
570
580
  'networks': {
571
- 'ARB': 'ARBITRUM',
581
+ 'ARBITRUM': 'ARB',
572
582
  'MATIC': 'POLYGON',
583
+ 'ZKSYNC': 'ZKSYNCERA',
584
+ 'AVAXC': 'AVAX-C',
585
+ 'HBAR': 'HEDERA',
573
586
  },
574
587
  },
575
588
  'features': {
@@ -2126,6 +2139,7 @@ class bingx(Exchange, ImplicitAPI):
2126
2139
 
2127
2140
  :param dict [params]: extra parameters specific to the exchange API endpoint
2128
2141
  :param boolean [params.standard]: whether to fetch standard contract balances
2142
+ :param str [params.type]: the type of balance to fetch(spot, swap, funding) default is `spot`
2129
2143
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
2130
2144
  """
2131
2145
  self.load_markets()
@@ -2155,6 +2169,21 @@ class bingx(Exchange, ImplicitAPI):
2155
2169
  # ]
2156
2170
  # }
2157
2171
  #
2172
+ elif (marketType == 'funding') or (marketType == 'fund'):
2173
+ response = self.fundV1PrivateGetAccountBalance(marketTypeQuery)
2174
+ # {
2175
+ # code: '0',
2176
+ # timestamp: '1754906016631',
2177
+ # data: {
2178
+ # assets: [
2179
+ # {
2180
+ # asset: 'USDT',
2181
+ # free: '44.37692200000000237300',
2182
+ # locked: '0.00000000000000000000'
2183
+ # }
2184
+ # ]
2185
+ # }
2186
+ # }
2158
2187
  elif marketType == 'spot':
2159
2188
  response = self.spotV1PrivateGetAccountBalance(marketTypeQuery)
2160
2189
  #
@@ -2303,7 +2332,7 @@ class bingx(Exchange, ImplicitAPI):
2303
2332
  firstStandardOrInverse = self.safe_dict(standardAndInverseBalances, 0)
2304
2333
  isStandardOrInverse = firstStandardOrInverse is not None
2305
2334
  spotData = self.safe_dict(response, 'data', {})
2306
- spotBalances = self.safe_list(spotData, 'balances')
2335
+ spotBalances = self.safe_list_2(spotData, 'balances', 'assets', [])
2307
2336
  firstSpot = self.safe_dict(spotBalances, 0)
2308
2337
  isSpot = firstSpot is not None
2309
2338
  if isStandardOrInverse:
@@ -5315,7 +5344,7 @@ class bingx(Exchange, ImplicitAPI):
5315
5344
  'shortLeverage': self.safe_integer(leverage, 'shortLeverage'),
5316
5345
  }
5317
5346
 
5318
- def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
5347
+ def set_leverage(self, leverage: int, symbol: Str = None, params={}):
5319
5348
  """
5320
5349
  set the level of leverage for a market
5321
5350
 
@@ -5562,7 +5591,7 @@ class bingx(Exchange, ImplicitAPI):
5562
5591
  depositWithdrawFees[code] = self.parse_deposit_withdraw_fee(entry)
5563
5592
  return depositWithdrawFees
5564
5593
 
5565
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
5594
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
5566
5595
  """
5567
5596
  make a withdrawal
5568
5597
 
ccxt/bitbank.py CHANGED
@@ -937,7 +937,7 @@ class bitbank(Exchange, ImplicitAPI):
937
937
  'tag': None,
938
938
  }
939
939
 
940
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
940
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
941
941
  """
942
942
  make a withdrawal
943
943
 
ccxt/bitfinex.py CHANGED
@@ -2631,7 +2631,7 @@ class bitfinex(Exchange, ImplicitAPI):
2631
2631
  #
2632
2632
  return self.parse_transactions(response, currency, since, limit)
2633
2633
 
2634
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2634
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2635
2635
  """
2636
2636
  make a withdrawal
2637
2637
 
@@ -3541,12 +3541,15 @@ class bitfinex(Exchange, ImplicitAPI):
3541
3541
  contractSize = self.safe_string(market, 'contractSize')
3542
3542
  baseValue = Precise.string_mul(contracts, contractSize)
3543
3543
  price = self.safe_string(entry, 11)
3544
+ sideFlag = self.safe_integer(entry, 8)
3545
+ side = 'buy' if (sideFlag == 1) else 'sell'
3544
3546
  return self.safe_liquidation({
3545
3547
  'info': entry,
3546
3548
  'symbol': self.safe_symbol(marketId, market, None, 'contract'),
3547
3549
  'contracts': self.parse_number(contracts),
3548
3550
  'contractSize': self.parse_number(contractSize),
3549
3551
  'price': self.parse_number(price),
3552
+ 'side': side,
3550
3553
  'baseValue': self.parse_number(baseValue),
3551
3554
  'quoteValue': self.parse_number(Precise.string_mul(baseValue, price)),
3552
3555
  'timestamp': timestamp,
ccxt/bitflyer.py CHANGED
@@ -879,7 +879,7 @@ class bitflyer(Exchange, ImplicitAPI):
879
879
  # todo unify parsePosition/parsePositions
880
880
  return response
881
881
 
882
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
882
+ def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
883
883
  """
884
884
  make a withdrawal
885
885