ccxt 4.4.3__py2.py3-none-any.whl → 4.4.5__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 (90) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binanceus.py +36 -36
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/base/exchange.py +24 -13
  5. ccxt/async_support/base/ws/cache.py +1 -0
  6. ccxt/async_support/binance.py +43 -18
  7. ccxt/async_support/binanceus.py +1 -0
  8. ccxt/async_support/bingx.py +1 -0
  9. ccxt/async_support/bitfinex2.py +10 -9
  10. ccxt/async_support/bitget.py +55 -99
  11. ccxt/async_support/bitmex.py +14 -13
  12. ccxt/async_support/bitso.py +8 -7
  13. ccxt/async_support/bitstamp.py +12 -12
  14. ccxt/async_support/blofin.py +24 -26
  15. ccxt/async_support/bybit.py +101 -29
  16. ccxt/async_support/coinbase.py +31 -10
  17. ccxt/async_support/coinbaseexchange.py +14 -14
  18. ccxt/async_support/coinlist.py +9 -8
  19. ccxt/async_support/coinmetro.py +6 -6
  20. ccxt/async_support/cryptocom.py +10 -8
  21. ccxt/async_support/currencycom.py +9 -9
  22. ccxt/async_support/delta.py +8 -8
  23. ccxt/async_support/digifinex.py +11 -9
  24. ccxt/async_support/gate.py +9 -8
  25. ccxt/async_support/hashkey.py +12 -10
  26. ccxt/async_support/htx.py +16 -19
  27. ccxt/async_support/hyperliquid.py +70 -117
  28. ccxt/async_support/kraken.py +12 -10
  29. ccxt/async_support/kucoin.py +12 -11
  30. ccxt/async_support/luno.py +13 -12
  31. ccxt/async_support/lykke.py +2 -2
  32. ccxt/async_support/mexc.py +41 -3
  33. ccxt/async_support/ndax.py +9 -8
  34. ccxt/async_support/okcoin.py +21 -30
  35. ccxt/async_support/okx.py +21 -29
  36. ccxt/async_support/paradex.py +1 -1
  37. ccxt/async_support/woo.py +10 -9
  38. ccxt/async_support/woofipro.py +11 -9
  39. ccxt/async_support/xt.py +7 -6
  40. ccxt/async_support/zonda.py +9 -8
  41. ccxt/base/exchange.py +3 -1
  42. ccxt/binance.py +43 -18
  43. ccxt/binanceus.py +1 -0
  44. ccxt/bingx.py +1 -0
  45. ccxt/bitfinex2.py +10 -9
  46. ccxt/bitget.py +55 -99
  47. ccxt/bitmex.py +14 -13
  48. ccxt/bitso.py +8 -7
  49. ccxt/bitstamp.py +12 -12
  50. ccxt/blofin.py +24 -26
  51. ccxt/bybit.py +101 -29
  52. ccxt/coinbase.py +31 -10
  53. ccxt/coinbaseexchange.py +14 -14
  54. ccxt/coinlist.py +9 -8
  55. ccxt/coinmetro.py +6 -6
  56. ccxt/cryptocom.py +10 -8
  57. ccxt/currencycom.py +9 -9
  58. ccxt/delta.py +8 -8
  59. ccxt/digifinex.py +11 -9
  60. ccxt/gate.py +9 -8
  61. ccxt/hashkey.py +12 -10
  62. ccxt/htx.py +16 -19
  63. ccxt/hyperliquid.py +70 -117
  64. ccxt/kraken.py +12 -10
  65. ccxt/kucoin.py +12 -11
  66. ccxt/luno.py +13 -12
  67. ccxt/lykke.py +2 -2
  68. ccxt/mexc.py +40 -3
  69. ccxt/ndax.py +9 -8
  70. ccxt/okcoin.py +21 -30
  71. ccxt/okx.py +21 -29
  72. ccxt/paradex.py +1 -1
  73. ccxt/pro/__init__.py +1 -1
  74. ccxt/pro/binance.py +6 -2
  75. ccxt/pro/binanceus.py +2 -1
  76. ccxt/pro/bybit.py +51 -0
  77. ccxt/pro/hyperliquid.py +14 -1
  78. ccxt/pro/mexc.py +78 -0
  79. ccxt/pro/paradex.py +1 -0
  80. ccxt/test/tests_async.py +1 -1
  81. ccxt/test/tests_sync.py +1 -1
  82. ccxt/woo.py +10 -9
  83. ccxt/woofipro.py +11 -9
  84. ccxt/xt.py +7 -6
  85. ccxt/zonda.py +9 -8
  86. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/METADATA +5 -5
  87. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/RECORD +90 -90
  88. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/LICENSE.txt +0 -0
  89. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/WHEEL +0 -0
  90. {ccxt-4.4.3.dist-info → ccxt-4.4.5.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,7 @@ from ccxt.abstract.digifinex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
11
+ from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LedgerEntry, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -2384,7 +2384,7 @@ class digifinex(Exchange, ImplicitAPI):
2384
2384
  types: dict = {}
2385
2385
  return self.safe_string(types, type, type)
2386
2386
 
2387
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
2387
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
2388
2388
  #
2389
2389
  # spot and margin
2390
2390
  #
@@ -2406,13 +2406,15 @@ class digifinex(Exchange, ImplicitAPI):
2406
2406
  # }
2407
2407
  #
2408
2408
  type = self.parse_ledger_entry_type(self.safe_string_2(item, 'type', 'finance_type'))
2409
- code = self.safe_currency_code(self.safe_string_2(item, 'currency_mark', 'currency'), currency)
2409
+ currencyId = self.safe_string_2(item, 'currency_mark', 'currency')
2410
+ code = self.safe_currency_code(currencyId, currency)
2411
+ currency = self.safe_currency(currencyId, currency)
2410
2412
  amount = self.safe_number_2(item, 'num', 'change')
2411
2413
  after = self.safe_number(item, 'balance')
2412
2414
  timestamp = self.safe_timestamp(item, 'time')
2413
2415
  if timestamp is None:
2414
2416
  timestamp = self.safe_integer(item, 'timestamp')
2415
- return {
2417
+ return self.safe_ledger_entry({
2416
2418
  'info': item,
2417
2419
  'id': None,
2418
2420
  'direction': None,
@@ -2428,16 +2430,16 @@ class digifinex(Exchange, ImplicitAPI):
2428
2430
  'timestamp': timestamp,
2429
2431
  'datetime': self.iso8601(timestamp),
2430
2432
  'fee': None,
2431
- }
2433
+ }, currency)
2432
2434
 
2433
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2435
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
2434
2436
  """
2435
- fetch the history of changes, actions done by the user or operations that altered balance of the user
2437
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
2436
2438
  :see: https://docs.digifinex.com/en-ww/spot/v3/rest.html#spot-margin-otc-financial-logs
2437
2439
  :see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#bills
2438
- :param str code: unified currency code, default is None
2440
+ :param str [code]: unified currency code, default is None
2439
2441
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
2440
- :param int [limit]: max number of ledger entrys to return, default is None
2442
+ :param int [limit]: max number of ledger entries to return, default is None
2441
2443
  :param dict [params]: extra parameters specific to the exchange API endpoint
2442
2444
  :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
2443
2445
  """
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.gate import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -6139,7 +6139,7 @@ class gate(Exchange, ImplicitAPI):
6139
6139
  result.append(self.parse_settlement(settlements[i], market))
6140
6140
  return result
6141
6141
 
6142
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
6142
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
6143
6143
  """
6144
6144
  fetch the history of changes, actions done by the user or operations that altered the balance of the user
6145
6145
  :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book
@@ -6147,12 +6147,12 @@ class gate(Exchange, ImplicitAPI):
6147
6147
  :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
6148
6148
  :see: https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
6149
6149
  :see: https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
6150
- :param str code: unified currency code
6150
+ :param str [code]: unified currency code
6151
6151
  :param int [since]: timestamp in ms of the earliest ledger entry
6152
6152
  :param int [limit]: max number of ledger entries to return
6153
6153
  :param dict [params]: extra parameters specific to the exchange API endpoint
6154
6154
  :param int [params.until]: end time in ms
6155
- :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
6155
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
6156
6156
  :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
6157
6157
  """
6158
6158
  await self.load_markets()
@@ -6243,7 +6243,7 @@ class gate(Exchange, ImplicitAPI):
6243
6243
  #
6244
6244
  return self.parse_ledger(response, currency, since, limit)
6245
6245
 
6246
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
6246
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
6247
6247
  #
6248
6248
  # spot
6249
6249
  #
@@ -6296,6 +6296,7 @@ class gate(Exchange, ImplicitAPI):
6296
6296
  else:
6297
6297
  direction = 'in'
6298
6298
  currencyId = self.safe_string(item, 'currency')
6299
+ currency = self.safe_currency(currencyId, currency)
6299
6300
  type = self.safe_string(item, 'type')
6300
6301
  rawTimestamp = self.safe_string(item, 'time')
6301
6302
  timestamp = None
@@ -6306,7 +6307,8 @@ class gate(Exchange, ImplicitAPI):
6306
6307
  balanceString = self.safe_string(item, 'balance')
6307
6308
  changeString = self.safe_string(item, 'change')
6308
6309
  before = self.parse_number(Precise.string_sub(balanceString, changeString))
6309
- return {
6310
+ return self.safe_ledger_entry({
6311
+ 'info': item,
6310
6312
  'id': self.safe_string(item, 'id'),
6311
6313
  'direction': direction,
6312
6314
  'account': None,
@@ -6321,8 +6323,7 @@ class gate(Exchange, ImplicitAPI):
6321
6323
  'after': self.safe_number(item, 'balance'),
6322
6324
  'status': None,
6323
6325
  'fee': None,
6324
- 'info': item,
6325
- }
6326
+ }, currency)
6326
6327
 
6327
6328
  def parse_ledger_entry_type(self, type):
6328
6329
  ledgerType: dict = {
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.hashkey import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, Int, LastPrice, LastPrices, Leverage, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, Int, LastPrice, LastPrices, LedgerEntry, Leverage, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, 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
@@ -2147,13 +2147,13 @@ class hashkey(Exchange, ImplicitAPI):
2147
2147
  }
2148
2148
  return self.safe_integer(types, type, type)
2149
2149
 
2150
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
2150
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
2151
2151
  """
2152
- fetch the history of changes, actions done by the user or operations that altered balance of the user
2152
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
2153
2153
  :see: https://hashkeyglobal-apidoc.readme.io/reference/get-account-transaction-list
2154
- :param str code: unified currency code, default is None(not used)
2154
+ :param str [code]: unified currency code, default is None(not used)
2155
2155
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
2156
- :param int [limit]: max number of ledger entrys to return, default is None
2156
+ :param int [limit]: max number of ledger entries to return, default is None
2157
2157
  :param dict [params]: extra parameters specific to the exchange API endpoint
2158
2158
  :param int [params.until]: the latest time in ms to fetch entries for
2159
2159
  :param int [params.flowType]: trade, fee, transfer, deposit, withdrawal
@@ -2213,7 +2213,7 @@ class hashkey(Exchange, ImplicitAPI):
2213
2213
  }
2214
2214
  return self.safe_string(types, type, type)
2215
2215
 
2216
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
2216
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
2217
2217
  #
2218
2218
  # {
2219
2219
  # "id": "1740844413612065537",
@@ -2233,7 +2233,9 @@ class hashkey(Exchange, ImplicitAPI):
2233
2233
  account = self.safe_string(item, 'accountId')
2234
2234
  timestamp = self.safe_integer(item, 'created')
2235
2235
  type = self.parse_ledger_entry_type(self.safe_string(item, 'flowTypeValue'))
2236
- code = self.safe_currency_code(self.safe_string(item, 'coin'), currency)
2236
+ currencyId = self.safe_string(item, 'coin')
2237
+ code = self.safe_currency_code(currencyId, currency)
2238
+ currency = self.safe_currency(currencyId, currency)
2237
2239
  amountString = self.safe_string(item, 'change')
2238
2240
  amount = self.parse_number(amountString)
2239
2241
  direction = 'in'
@@ -2242,9 +2244,9 @@ class hashkey(Exchange, ImplicitAPI):
2242
2244
  afterString = self.safe_string(item, 'total')
2243
2245
  after = self.parse_number(afterString)
2244
2246
  status = 'ok'
2245
- return {
2246
- 'id': id,
2247
+ return self.safe_ledger_entry({
2247
2248
  'info': item,
2249
+ 'id': id,
2248
2250
  'timestamp': timestamp,
2249
2251
  'datetime': self.iso8601(timestamp),
2250
2252
  'account': account,
@@ -2259,7 +2261,7 @@ class hashkey(Exchange, ImplicitAPI):
2259
2261
  'after': after,
2260
2262
  'status': status,
2261
2263
  'fee': None,
2262
- }
2264
+ }, currency)
2263
2265
 
2264
2266
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}) -> Order:
2265
2267
  """
ccxt/async_support/htx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.htx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, LeverageTier, LeverageTiers, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -7393,7 +7393,7 @@ class htx(Exchange, ImplicitAPI):
7393
7393
  }
7394
7394
  return self.safe_string(types, type, type)
7395
7395
 
7396
- def parse_ledger_entry(self, item: dict, currency: Currency = None):
7396
+ def parse_ledger_entry(self, item: dict, currency: Currency = None) -> LedgerEntry:
7397
7397
  #
7398
7398
  # {
7399
7399
  # "accountId": 10000001,
@@ -7407,44 +7407,41 @@ class htx(Exchange, ImplicitAPI):
7407
7407
  # "transferee": 13496526
7408
7408
  # }
7409
7409
  #
7410
- id = self.safe_string(item, 'transactId')
7411
7410
  currencyId = self.safe_string(item, 'currency')
7412
7411
  code = self.safe_currency_code(currencyId, currency)
7413
- amount = self.safe_number(item, 'transactAmt')
7412
+ currency = self.safe_currency(currencyId, currency)
7413
+ id = self.safe_string(item, 'transactId')
7414
7414
  transferType = self.safe_string(item, 'transferType')
7415
- type = self.parse_ledger_entry_type(transferType)
7416
- direction = self.safe_string(item, 'direction')
7417
7415
  timestamp = self.safe_integer(item, 'transactTime')
7418
- datetime = self.iso8601(timestamp)
7419
7416
  account = self.safe_string(item, 'accountId')
7420
- return {
7417
+ return self.safe_ledger_entry({
7418
+ 'info': item,
7421
7419
  'id': id,
7422
- 'direction': direction,
7420
+ 'direction': self.safe_string(item, 'direction'),
7423
7421
  'account': account,
7424
7422
  'referenceId': id,
7425
7423
  'referenceAccount': account,
7426
- 'type': type,
7424
+ 'type': self.parse_ledger_entry_type(transferType),
7427
7425
  'currency': code,
7428
- 'amount': amount,
7426
+ 'amount': self.safe_number(item, 'transactAmt'),
7429
7427
  'timestamp': timestamp,
7430
- 'datetime': datetime,
7428
+ 'datetime': self.iso8601(timestamp),
7431
7429
  'before': None,
7432
7430
  'after': None,
7433
7431
  'status': None,
7434
7432
  'fee': None,
7435
- 'info': item,
7436
- }
7433
+ }, currency)
7437
7434
 
7438
- async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
7435
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[LedgerEntry]:
7439
7436
  """
7437
+ fetch the history of changes, actions done by the user or operations that altered the balance of the user
7440
7438
  :see: https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
7441
- fetch the history of changes, actions done by the user or operations that altered balance of the user
7442
- :param str code: unified currency code, default is None
7439
+ :param str [code]: unified currency code, default is None
7443
7440
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
7444
- :param int [limit]: max number of ledger entrys to return, default is None
7441
+ :param int [limit]: max number of ledger entries to return, default is None
7445
7442
  :param dict [params]: extra parameters specific to the exchange API endpoint
7446
7443
  :param int [params.until]: the latest time in ms to fetch entries for
7447
- :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
7444
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
7448
7445
  :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
7449
7446
  """
7450
7447
  await self.load_markets()