ccxt 4.4.25__py2.py3-none-any.whl → 4.4.27__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 (123) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/alpaca.py +3 -0
  3. ccxt/abstract/bingx.py +1 -0
  4. ccxt/abstract/hyperliquid.py +1 -1
  5. ccxt/abstract/okx.py +1 -0
  6. ccxt/abstract/phemex.py +1 -0
  7. ccxt/ace.py +1 -1
  8. ccxt/alpaca.py +426 -17
  9. ccxt/ascendex.py +1 -1
  10. ccxt/async_support/__init__.py +1 -1
  11. ccxt/async_support/ace.py +1 -1
  12. ccxt/async_support/alpaca.py +426 -17
  13. ccxt/async_support/ascendex.py +1 -1
  14. ccxt/async_support/base/exchange.py +24 -6
  15. ccxt/async_support/bequant.py +1 -1
  16. ccxt/async_support/bigone.py +1 -1
  17. ccxt/async_support/binance.py +6 -7
  18. ccxt/async_support/binancecoinm.py +1 -1
  19. ccxt/async_support/binanceus.py +1 -1
  20. ccxt/async_support/binanceusdm.py +1 -1
  21. ccxt/async_support/bingx.py +29 -29
  22. ccxt/async_support/bit2c.py +1 -1
  23. ccxt/async_support/bitbank.py +1 -1
  24. ccxt/async_support/bitbns.py +1 -1
  25. ccxt/async_support/bitfinex.py +1 -1
  26. ccxt/async_support/bitfinex2.py +1 -1
  27. ccxt/async_support/bitflyer.py +1 -1
  28. ccxt/async_support/bitget.py +6 -6
  29. ccxt/async_support/bithumb.py +1 -1
  30. ccxt/async_support/bitmart.py +7 -7
  31. ccxt/async_support/bitmex.py +1 -1
  32. ccxt/async_support/bitopro.py +1 -1
  33. ccxt/async_support/bitrue.py +1 -1
  34. ccxt/async_support/bitso.py +1 -1
  35. ccxt/async_support/bitstamp.py +1 -1
  36. ccxt/async_support/bitteam.py +1 -1
  37. ccxt/async_support/bitvavo.py +1 -1
  38. ccxt/async_support/bl3p.py +1 -1
  39. ccxt/async_support/blockchaincom.py +1 -1
  40. ccxt/async_support/blofin.py +1 -1
  41. ccxt/async_support/btcalpha.py +1 -1
  42. ccxt/async_support/btcbox.py +1 -1
  43. ccxt/async_support/btcmarkets.py +1 -1
  44. ccxt/async_support/btcturk.py +1 -1
  45. ccxt/async_support/bybit.py +10 -16
  46. ccxt/async_support/cex.py +36 -0
  47. ccxt/async_support/coinbase.py +89 -11
  48. ccxt/async_support/coinex.py +6 -8
  49. ccxt/async_support/digifinex.py +5 -5
  50. ccxt/async_support/exmo.py +1 -0
  51. ccxt/async_support/gate.py +26 -22
  52. ccxt/async_support/htx.py +5 -6
  53. ccxt/async_support/hyperliquid.py +31 -5
  54. ccxt/async_support/kucoin.py +5 -5
  55. ccxt/async_support/lbank.py +97 -2
  56. ccxt/async_support/okx.py +6 -5
  57. ccxt/async_support/phemex.py +4 -2
  58. ccxt/async_support/wavesexchange.py +13 -2
  59. ccxt/async_support/whitebit.py +5 -5
  60. ccxt/async_support/woo.py +1 -1
  61. ccxt/async_support/xt.py +32 -24
  62. ccxt/base/exchange.py +29 -6
  63. ccxt/base/types.py +12 -0
  64. ccxt/bequant.py +1 -1
  65. ccxt/bigone.py +1 -1
  66. ccxt/binance.py +6 -7
  67. ccxt/binancecoinm.py +1 -1
  68. ccxt/binanceus.py +1 -1
  69. ccxt/binanceusdm.py +1 -1
  70. ccxt/bingx.py +29 -29
  71. ccxt/bit2c.py +1 -1
  72. ccxt/bitbank.py +1 -1
  73. ccxt/bitbns.py +1 -1
  74. ccxt/bitfinex.py +1 -1
  75. ccxt/bitfinex2.py +1 -1
  76. ccxt/bitflyer.py +1 -1
  77. ccxt/bitget.py +6 -6
  78. ccxt/bithumb.py +1 -1
  79. ccxt/bitmart.py +7 -7
  80. ccxt/bitmex.py +1 -1
  81. ccxt/bitopro.py +1 -1
  82. ccxt/bitrue.py +1 -1
  83. ccxt/bitso.py +1 -1
  84. ccxt/bitstamp.py +1 -1
  85. ccxt/bitteam.py +1 -1
  86. ccxt/bitvavo.py +1 -1
  87. ccxt/bl3p.py +1 -1
  88. ccxt/blockchaincom.py +1 -1
  89. ccxt/blofin.py +1 -1
  90. ccxt/btcalpha.py +1 -1
  91. ccxt/btcbox.py +1 -1
  92. ccxt/btcmarkets.py +1 -1
  93. ccxt/btcturk.py +1 -1
  94. ccxt/bybit.py +10 -16
  95. ccxt/cex.py +36 -0
  96. ccxt/coinbase.py +89 -11
  97. ccxt/coinex.py +6 -8
  98. ccxt/digifinex.py +5 -5
  99. ccxt/exmo.py +1 -0
  100. ccxt/gate.py +26 -22
  101. ccxt/htx.py +5 -6
  102. ccxt/hyperliquid.py +31 -5
  103. ccxt/kucoin.py +5 -5
  104. ccxt/lbank.py +97 -2
  105. ccxt/okx.py +6 -5
  106. ccxt/phemex.py +4 -2
  107. ccxt/pro/__init__.py +1 -1
  108. ccxt/pro/binance.py +2 -2
  109. ccxt/pro/bybit.py +1 -1
  110. ccxt/pro/exmo.py +204 -4
  111. ccxt/pro/lbank.py +7 -4
  112. ccxt/pro/okx.py +1 -1
  113. ccxt/test/tests_helpers.py +3 -1
  114. ccxt/wavesexchange.py +13 -2
  115. ccxt/whitebit.py +5 -5
  116. ccxt/woo.py +1 -1
  117. ccxt/xt.py +32 -24
  118. ccxt-4.4.27.dist-info/METADATA +637 -0
  119. {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/RECORD +122 -122
  120. ccxt-4.4.25.dist-info/METADATA +0 -636
  121. {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/LICENSE.txt +0 -0
  122. {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/WHEEL +0 -0
  123. {ccxt-4.4.25.dist-info → ccxt-4.4.27.dist-info}/top_level.txt +0 -0
ccxt/whitebit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.whitebit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, BorrowInterest, Bool, Currencies, Currency, DepositAddress, Int, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -2144,7 +2144,7 @@ class whitebit(Exchange, ImplicitAPI):
2144
2144
  records = self.safe_list(response, 'records', [])
2145
2145
  return self.parse_transactions(records, currency, since, limit)
2146
2146
 
2147
- def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2147
+ def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[BorrowInterest]:
2148
2148
  """
2149
2149
  fetch the interest owed by the user for borrowing currency for margin trading
2150
2150
  :see: https://docs.whitebit.com/private/http-trade-v4/#open-positions
@@ -2186,7 +2186,7 @@ class whitebit(Exchange, ImplicitAPI):
2186
2186
  interest = self.parse_borrow_interests(response, market)
2187
2187
  return self.filter_by_currency_since_limit(interest, code, since, limit)
2188
2188
 
2189
- def parse_borrow_interest(self, info: dict, market: Market = None):
2189
+ def parse_borrow_interest(self, info: dict, market: Market = None) -> BorrowInterest:
2190
2190
  #
2191
2191
  # {
2192
2192
  # "positionId": 191823,
@@ -2210,15 +2210,15 @@ class whitebit(Exchange, ImplicitAPI):
2210
2210
  symbol = self.safe_symbol(marketId, market, '_')
2211
2211
  timestamp = self.safe_timestamp(info, 'modifyDate')
2212
2212
  return {
2213
+ 'info': info,
2213
2214
  'symbol': symbol,
2214
- 'marginMode': 'cross',
2215
2215
  'currency': 'USDT',
2216
2216
  'interest': self.safe_number(info, 'unrealizedFunding'),
2217
2217
  'interestRate': 0.00098, # https://whitebit.com/fees
2218
2218
  'amountBorrowed': self.safe_number(info, 'amount'),
2219
+ 'marginMode': 'cross',
2219
2220
  'timestamp': timestamp,
2220
2221
  'datetime': self.iso8601(timestamp),
2221
- 'info': info,
2222
2222
  }
2223
2223
 
2224
2224
  def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
ccxt/woo.py CHANGED
@@ -2332,7 +2332,7 @@ class woo(Exchange, ImplicitAPI):
2332
2332
  #
2333
2333
  return self.parse_transaction(response, currency)
2334
2334
 
2335
- def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
2335
+ def repay_margin(self, code: str, amount: float, symbol: Str = None, params={}):
2336
2336
  """
2337
2337
  repay borrowed margin and interest
2338
2338
  :see: https://docs.woo.org/#repay-interest
ccxt/xt.py CHANGED
@@ -1905,6 +1905,17 @@ class xt(Exchange, ImplicitAPI):
1905
1905
  # "b": True
1906
1906
  # }
1907
1907
  #
1908
+ # spot: watchTrades
1909
+ #
1910
+ # {
1911
+ # s: 'btc_usdt',
1912
+ # i: '228825383103928709',
1913
+ # t: 1684258222702,
1914
+ # p: '27003.65',
1915
+ # q: '0.000796',
1916
+ # b: True
1917
+ # }
1918
+ #
1908
1919
  # spot: watchMyTrades
1909
1920
  #
1910
1921
  # {
@@ -1917,17 +1928,6 @@ class xt(Exchange, ImplicitAPI):
1917
1928
  # "v": "90000" # volume trade amount
1918
1929
  # }
1919
1930
  #
1920
- # spot: watchTrades
1921
- #
1922
- # {
1923
- # s: 'btc_usdt',
1924
- # i: '228825383103928709',
1925
- # t: 1684258222702,
1926
- # p: '27003.65',
1927
- # q: '0.000796',
1928
- # b: True
1929
- # }
1930
- #
1931
1931
  # swap and future: fetchTrades
1932
1932
  #
1933
1933
  # {
@@ -2006,19 +2006,27 @@ class xt(Exchange, ImplicitAPI):
2006
2006
  if marketType is None:
2007
2007
  marketType = 'spot' if hasSpotKeys else 'contract'
2008
2008
  market = self.safe_market(marketId, market, '_', marketType)
2009
- bidOrAsk = self.safe_string(trade, 'm')
2010
- side = self.safe_string_lower(trade, 'orderSide')
2011
- if bidOrAsk is not None:
2012
- side = 'buy' if (bidOrAsk == 'BID') else 'sell'
2013
- buyerMaker = self.safe_value(trade, 'b')
2014
- if buyerMaker is not None:
2015
- side = 'buy'
2016
- takerOrMaker = self.safe_string_lower(trade, 'takerMaker')
2017
- if buyerMaker is not None:
2018
- takerOrMaker = 'maker' if buyerMaker else 'taker'
2019
- isMaker = self.safe_bool(trade, 'isMaker')
2020
- if isMaker is not None:
2021
- takerOrMaker = 'maker' if isMaker else 'taker'
2009
+ side = None
2010
+ takerOrMaker = None
2011
+ isBuyerMaker = self.safe_bool(trade, 'b')
2012
+ if isBuyerMaker is not None:
2013
+ side = 'sell' if isBuyerMaker else 'buy'
2014
+ takerOrMaker = 'taker' # public trades always taker
2015
+ else:
2016
+ takerMaker = self.safe_string_lower(trade, 'takerMaker')
2017
+ if takerMaker is not None:
2018
+ takerOrMaker = takerMaker
2019
+ else:
2020
+ isMaker = self.safe_bool(trade, 'isMaker')
2021
+ if isMaker is not None:
2022
+ takerOrMaker = 'maker' if isMaker else 'taker'
2023
+ orderSide = self.safe_string_lower(trade, 'orderSide')
2024
+ if orderSide is not None:
2025
+ side = orderSide
2026
+ else:
2027
+ bidOrAsk = self.safe_string(trade, 'm')
2028
+ if bidOrAsk is not None:
2029
+ side = 'buy' if (bidOrAsk == 'BID') else 'sell'
2022
2030
  timestamp = self.safe_integer_n(trade, ['t', 'time', 'timestamp'])
2023
2031
  quantity = self.safe_string_2(trade, 'q', 'quantity')
2024
2032
  amount = None