ccxt 4.4.63__py2.py3-none-any.whl → 4.4.68__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 (60) hide show
  1. ccxt/__init__.py +5 -3
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/cryptomus.py +20 -0
  7. ccxt/abstract/derive.py +117 -0
  8. ccxt/abstract/tradeogre.py +1 -0
  9. ccxt/abstract/whitebit.py +16 -0
  10. ccxt/async_support/__init__.py +5 -3
  11. ccxt/async_support/base/exchange.py +6 -5
  12. ccxt/async_support/binance.py +8 -6
  13. ccxt/async_support/bitget.py +22 -12
  14. ccxt/async_support/bitrue.py +6 -3
  15. ccxt/async_support/bybit.py +1 -1
  16. ccxt/async_support/coinbase.py +73 -2
  17. ccxt/async_support/cryptocom.py +2 -0
  18. ccxt/async_support/cryptomus.py +1041 -0
  19. ccxt/async_support/derive.py +2530 -0
  20. ccxt/async_support/gate.py +5 -1
  21. ccxt/async_support/htx.py +19 -5
  22. ccxt/async_support/hyperliquid.py +108 -68
  23. ccxt/async_support/luno.py +113 -1
  24. ccxt/async_support/paradex.py +51 -12
  25. ccxt/async_support/tradeogre.py +132 -13
  26. ccxt/async_support/whitebit.py +276 -2
  27. ccxt/base/exchange.py +13 -4
  28. ccxt/binance.py +8 -6
  29. ccxt/bitget.py +22 -12
  30. ccxt/bitrue.py +6 -3
  31. ccxt/bybit.py +1 -1
  32. ccxt/coinbase.py +73 -2
  33. ccxt/cryptocom.py +2 -0
  34. ccxt/cryptomus.py +1041 -0
  35. ccxt/derive.py +2529 -0
  36. ccxt/gate.py +5 -1
  37. ccxt/htx.py +19 -5
  38. ccxt/hyperliquid.py +108 -68
  39. ccxt/luno.py +113 -1
  40. ccxt/paradex.py +51 -12
  41. ccxt/pro/__init__.py +3 -3
  42. ccxt/pro/bitopro.py +1 -1
  43. ccxt/pro/bybit.py +3 -2
  44. ccxt/pro/derive.py +704 -0
  45. ccxt/pro/gate.py +8 -1
  46. ccxt/pro/hyperliquid.py +3 -3
  47. ccxt/pro/vertex.py +5 -0
  48. ccxt/test/tests_async.py +36 -3
  49. ccxt/test/tests_sync.py +36 -3
  50. ccxt/tradeogre.py +132 -13
  51. ccxt/whitebit.py +276 -2
  52. {ccxt-4.4.63.dist-info → ccxt-4.4.68.dist-info}/METADATA +16 -12
  53. {ccxt-4.4.63.dist-info → ccxt-4.4.68.dist-info}/RECORD +56 -53
  54. ccxt/abstract/currencycom.py +0 -68
  55. ccxt/async_support/currencycom.py +0 -2070
  56. ccxt/currencycom.py +0 -2070
  57. ccxt/pro/currencycom.py +0 -536
  58. {ccxt-4.4.63.dist-info → ccxt-4.4.68.dist-info}/LICENSE.txt +0 -0
  59. {ccxt-4.4.63.dist-info → ccxt-4.4.68.dist-info}/WHEEL +0 -0
  60. {ccxt-4.4.63.dist-info → ccxt-4.4.68.dist-info}/top_level.txt +0 -0
@@ -4127,7 +4127,8 @@ class coinbase(Exchange, ImplicitAPI):
4127
4127
  # }
4128
4128
  # }
4129
4129
  #
4130
- data = self.safe_dict(response, 'data', {})
4130
+ # https://github.com/ccxt/ccxt/issues/25484
4131
+ data = self.safe_dict_2(response, 'data', 'transfer', {})
4131
4132
  return self.parse_transaction(data)
4132
4133
 
4133
4134
  async def fetch_deposit(self, id: str, code: Str = None, params={}):
@@ -4192,7 +4193,8 @@ class coinbase(Exchange, ImplicitAPI):
4192
4193
  # }
4193
4194
  # }
4194
4195
  #
4195
- data = self.safe_dict(response, 'data', {})
4196
+ # https://github.com/ccxt/ccxt/issues/25484
4197
+ data = self.safe_dict_2(response, 'data', 'transfer', {})
4196
4198
  return self.parse_transaction(data)
4197
4199
 
4198
4200
  async def fetch_deposit_method_ids(self, params={}):
@@ -4670,6 +4672,75 @@ class coinbase(Exchange, ImplicitAPI):
4670
4672
  }
4671
4673
  return result
4672
4674
 
4675
+ async def fetch_portfolio_details(self, portfolioUuid: str, params={}) -> List[Any]:
4676
+ """
4677
+ Fetch details for a specific portfolio by UUID
4678
+
4679
+ https://docs.cloud.coinbase.com/advanced-trade/reference/retailbrokerageapi_getportfolios
4680
+
4681
+ :param str portfolioUuid: The unique identifier of the portfolio to fetch
4682
+ :param Dict [params]: Extra parameters specific to the exchange API endpoint
4683
+ :returns any[]: An account structure <https://docs.ccxt.com/#/?id=account-structure>
4684
+ """
4685
+ await self.load_markets()
4686
+ request = {
4687
+ 'portfolio_uuid': portfolioUuid,
4688
+ }
4689
+ response = await self.v3PrivateGetBrokeragePortfoliosPortfolioUuid(self.extend(request, params))
4690
+ result = self.parse_portfolio_details(response)
4691
+ return result
4692
+
4693
+ def parse_portfolio_details(self, portfolioData: dict):
4694
+ """
4695
+ Parse a Coinbase portfolio JSON object and extract relevant trading information.
4696
+ :param Dict portfolioData: The JSON response containing portfolio details
4697
+ :returns any[]: List of dictionaries with parsed portfolio position data
4698
+ """
4699
+ breakdown = portfolioData['breakdown']
4700
+ portfolioInfo = self.safe_dict(breakdown, 'portfolio', {})
4701
+ portfolioName = self.safe_string(portfolioInfo, 'name', 'Unknown')
4702
+ portfolioUuid = self.safe_string(portfolioInfo, 'uuid', '')
4703
+ spotPositions = self.safe_list(breakdown, 'spot_positions', [])
4704
+ parsedPositions = []
4705
+ for i in range(0, len(spotPositions)):
4706
+ position: dict = spotPositions[i]
4707
+ currencyCode = self.safe_string(position, 'asset', 'Unknown')
4708
+ availableBalanceStr = self.safe_string(position, 'available_to_trade_fiat', '0')
4709
+ availableBalance = self.parse_number(availableBalanceStr)
4710
+ totalBalanceFiatStr = self.safe_string(position, 'total_balance_fiat', '0')
4711
+ totalBalanceFiat = self.parse_number(totalBalanceFiatStr)
4712
+ holdAmount = totalBalanceFiat - availableBalance
4713
+ costBasisDict = self.safe_dict(position, 'cost_basis', {})
4714
+ costBasisStr = self.safe_string(costBasisDict, 'value', '0')
4715
+ averageEntryPriceDict = self.safe_dict(position, 'average_entry_price', {})
4716
+ averageEntryPriceStr = self.safe_string(averageEntryPriceDict, 'value', '0')
4717
+ positionData: dict = {
4718
+ 'currency': currencyCode,
4719
+ 'available_balance': availableBalance,
4720
+ 'hold_amount': holdAmount > holdAmount if 0 else 0,
4721
+ 'wallet_name': portfolioName,
4722
+ 'account_id': portfolioUuid,
4723
+ 'account_uuid': self.safe_string(position, 'account_uuid', ''),
4724
+ 'total_balance_fiat': totalBalanceFiat,
4725
+ 'total_balance_crypto': self.parse_number(self.safe_string(position, 'total_balance_crypto', '0')),
4726
+ 'available_to_trade_fiat': self.parse_number(self.safe_string(position, 'available_to_trade_fiat', '0')),
4727
+ 'available_to_trade_crypto': self.parse_number(self.safe_string(position, 'available_to_trade_crypto', '0')),
4728
+ 'available_to_transfer_fiat': self.parse_number(self.safe_string(position, 'available_to_transfer_fiat', '0')),
4729
+ 'available_to_transfer_crypto': self.parse_number(self.safe_string(position, 'available_to_trade_crypto', '0')),
4730
+ 'allocation': self.parse_number(self.safe_string(position, 'allocation', '0')),
4731
+ 'cost_basis': self.parse_number(costBasisStr),
4732
+ 'cost_basis_currency': self.safe_string(costBasisDict, 'currency', 'USD'),
4733
+ 'is_cash': self.safe_bool(position, 'is_cash', False),
4734
+ 'average_entry_price': self.parse_number(averageEntryPriceStr),
4735
+ 'average_entry_price_currency': self.safe_string(averageEntryPriceDict, 'currency', 'USD'),
4736
+ 'asset_uuid': self.safe_string(position, 'asset_uuid', ''),
4737
+ 'unrealized_pnl': self.parse_number(self.safe_string(position, 'unrealized_pnl', '0')),
4738
+ 'asset_color': self.safe_string(position, 'asset_color', ''),
4739
+ 'account_type': self.safe_string(position, 'account_type', ''),
4740
+ }
4741
+ parsedPositions.append(positionData)
4742
+ return parsedPositions
4743
+
4673
4744
  def create_auth_token(self, seconds: Int, method: Str = None, url: Str = None):
4674
4745
  # it may not work for v2
4675
4746
  uri = None
@@ -471,6 +471,8 @@ class cryptocom(Exchange, ImplicitAPI):
471
471
  'exact': {
472
472
  '219': InvalidOrder,
473
473
  '314': InvalidOrder, # {"id" : 1700xxx, "method" : "private/create-order", "code" : 314, "message" : "EXCEEDS_MAX_ORDER_SIZE", "result" : {"client_oid" : "1700xxx", "order_id" : "6530xxx"}}
474
+ '325': InvalidOrder, # {"id" : 1741xxx, "method" : "private/create-order", "code" : 325, "message" : "EXCEED_DAILY_VOL_LIMIT", "result" : {"client_oid" : "1741xxx", "order_id" : "6530xxx"}}
475
+ '415': InvalidOrder, # {"id" : 1741xxx, "method" : "private/create-order", "code" : 415, "message" : "BELOW_MIN_ORDER_SIZE", "result" : {"client_oid" : "1741xxx", "order_id" : "6530xxx"}}
474
476
  '10001': ExchangeError,
475
477
  '10002': PermissionDenied,
476
478
  '10003': PermissionDenied,