compass_api_sdk 1.1.4__py3-none-any.whl → 1.1.5__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.

Potentially problematic release.


This version of compass_api_sdk might be problematic. Click here for more details.

@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "compass_api_sdk"
6
- __version__: str = "1.1.4"
6
+ __version__: str = "1.1.5"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
- __gen_version__: str = "2.707.0"
9
- __user_agent__: str = "speakeasy-sdk/python 1.1.4 2.707.0 0.0.1 compass_api_sdk"
8
+ __gen_version__: str = "2.716.16"
9
+ __user_agent__: str = "speakeasy-sdk/python 1.1.5 2.716.16 0.0.1 compass_api_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
compass_api_sdk/sdk.py CHANGED
@@ -93,7 +93,7 @@ class CompassAPI(BaseSDK):
93
93
  """
94
94
  client_supplied = True
95
95
  if client is None:
96
- client = httpx.Client()
96
+ client = httpx.Client(follow_redirects=True)
97
97
  client_supplied = False
98
98
 
99
99
  assert issubclass(
@@ -102,7 +102,7 @@ class CompassAPI(BaseSDK):
102
102
 
103
103
  async_client_supplied = True
104
104
  if async_client is None:
105
- async_client = httpx.AsyncClient()
105
+ async_client = httpx.AsyncClient(follow_redirects=True)
106
106
  async_client_supplied = False
107
107
 
108
108
  if debug_logger is None:
compass_api_sdk/token.py CHANGED
@@ -22,11 +22,7 @@ class Token(BaseSDK):
22
22
  ) -> models.TokenPriceResponse:
23
23
  r"""Token Price
24
24
 
25
- Retrieves the price of a token in USD using Chainlink's on-chain price feeds.
26
-
27
- Chainlink is a decentralized oracle that aggregates price data from off-chain
28
- sources. This ensures the price is tamper-resistant but the price might be stale
29
- with the update frequency of the oracle.
25
+ Retrieves the price of a token in USD.
30
26
 
31
27
  :param chain:
32
28
  :param token: The symbol or address of the token for which to get the price..
@@ -119,11 +115,7 @@ class Token(BaseSDK):
119
115
  ) -> models.TokenPriceResponse:
120
116
  r"""Token Price
121
117
 
122
- Retrieves the price of a token in USD using Chainlink's on-chain price feeds.
123
-
124
- Chainlink is a decentralized oracle that aggregates price data from off-chain
125
- sources. This ensures the price is tamper-resistant but the price might be stale
126
- with the update frequency of the oracle.
118
+ Retrieves the price of a token in USD.
127
119
 
128
120
  :param chain:
129
121
  :param token: The symbol or address of the token for which to get the price..
@@ -3,6 +3,7 @@
3
3
  from enum import Enum
4
4
  from typing import Any, Optional
5
5
 
6
+
6
7
  def get_discriminator(model: Any, fieldname: str, key: str) -> str:
7
8
  """
8
9
  Recursively search for the discriminator attribute in a model.
@@ -25,31 +26,54 @@ def get_discriminator(model: Any, fieldname: str, key: str) -> str:
25
26
 
26
27
  if isinstance(field, dict):
27
28
  if key in field:
28
- return f'{field[key]}'
29
+ return f"{field[key]}"
29
30
 
30
31
  if hasattr(field, fieldname):
31
32
  attr = getattr(field, fieldname)
32
33
  if isinstance(attr, Enum):
33
- return f'{attr.value}'
34
- return f'{attr}'
34
+ return f"{attr.value}"
35
+ return f"{attr}"
35
36
 
36
37
  if hasattr(field, upper_fieldname):
37
38
  attr = getattr(field, upper_fieldname)
38
39
  if isinstance(attr, Enum):
39
- return f'{attr.value}'
40
- return f'{attr}'
40
+ return f"{attr.value}"
41
+ return f"{attr}"
41
42
 
42
43
  return None
43
44
 
45
+ def search_nested_discriminator(obj: Any) -> Optional[str]:
46
+ """Recursively search for discriminator in nested structures."""
47
+ # First try direct field lookup
48
+ discriminator = get_field_discriminator(obj)
49
+ if discriminator is not None:
50
+ return discriminator
51
+
52
+ # If it's a dict, search in nested values
53
+ if isinstance(obj, dict):
54
+ for value in obj.values():
55
+ if isinstance(value, list):
56
+ # Search in list items
57
+ for item in value:
58
+ nested_discriminator = search_nested_discriminator(item)
59
+ if nested_discriminator is not None:
60
+ return nested_discriminator
61
+ elif isinstance(value, dict):
62
+ # Search in nested dict
63
+ nested_discriminator = search_nested_discriminator(value)
64
+ if nested_discriminator is not None:
65
+ return nested_discriminator
66
+
67
+ return None
44
68
 
45
69
  if isinstance(model, list):
46
70
  for field in model:
47
- discriminator = get_field_discriminator(field)
71
+ discriminator = search_nested_discriminator(field)
48
72
  if discriminator is not None:
49
73
  return discriminator
50
74
 
51
- discriminator = get_field_discriminator(model)
75
+ discriminator = search_nested_discriminator(model)
52
76
  if discriminator is not None:
53
77
  return discriminator
54
78
 
55
- raise ValueError(f'Could not find discriminator field {fieldname} in {model}')
79
+ raise ValueError(f"Could not find discriminator field {fieldname} in {model}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compass_api_sdk
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: Compass API SDK.
5
5
  Author: royalnine
6
6
  Requires-Python: >=3.9.2
@@ -146,6 +146,7 @@ with CompassAPI(
146
146
  </br>
147
147
 
148
148
  The same SDK client can also be used to make asynchronous requests by importing asyncio.
149
+
149
150
  ```python
150
151
  # Asynchronous Example
151
152
  import asyncio
@@ -2,7 +2,7 @@ compass_api_sdk/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,4
2
2
  compass_api_sdk/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
3
3
  compass_api_sdk/_hooks/sdkhooks.py,sha256=eVxHB2Q_JG6zZx5xn74i208ij-fpTHqq2jod6fbghRQ,2503
4
4
  compass_api_sdk/_hooks/types.py,sha256=4qXm6dEntJOC2QeOdTklcc53oFzTU3HBb1xGdZ-kBXY,3059
5
- compass_api_sdk/_version.py,sha256=w5Fx8YrHEorq9NQvakQ2pZarZG-9wdlgkPefSVAacHE,472
5
+ compass_api_sdk/_version.py,sha256=2dT-ngPvvVveKqRrZSTA1f-DPlx5HJfqMp4olEtSFmI,474
6
6
  compass_api_sdk/aave_v3.py,sha256=WIdvFMSeBETBATSKHbH49zhWiIsd16lvr0VfpdsXbtY,126824
7
7
  compass_api_sdk/aerodrome_slipstream.py,sha256=JwrNXxfot0mhLdikFHyxwoHNLPykGiAmzu22CJAQP8g,81395
8
8
  compass_api_sdk/basesdk.py,sha256=oB3y9BXwZfnqTN9IsqjdUVXirXeNnV5vUsqBioB5YPE,12139
@@ -237,19 +237,19 @@ compass_api_sdk/models/yieldrange.py,sha256=WEpZR24JddnCS1_13y2P1CdD0lBi6dPktysC
237
237
  compass_api_sdk/morpho.py,sha256=NxxNOBrSv-5mnR-uKs7UDt3F8wZcy_K_tBFbxshsw_g,113190
238
238
  compass_api_sdk/pendle.py,sha256=8vJHEfSq9KLruyAvvzLAkQTPLngtimbtt1t6Cvv3vjs,66608
239
239
  compass_api_sdk/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
240
- compass_api_sdk/sdk.py,sha256=hm1Ucp3Cd6Cyv6K6zigDkLRPIuPsXUqc2oAXSdKkoeE,8591
240
+ compass_api_sdk/sdk.py,sha256=PdoXmq3la7HN74SnCrOmkhxJldEcrGuPwhvzxcu3T-Q,8633
241
241
  compass_api_sdk/sdkconfiguration.py,sha256=5nec4ViMLCsNWBd3DyEv8zWqU5Z77YZfzwX69jkdSnM,1607
242
242
  compass_api_sdk/sky.py,sha256=hKja93sxdiAF6FG1pnB5ZBPcHbofiXAnF2fau6w0oUA,45811
243
243
  compass_api_sdk/smart_account.py,sha256=PXCOHDrWdYJOJJa18Lzl1hL8OcMLFwSsS0L61yd8Qjg,9218
244
244
  compass_api_sdk/swap.py,sha256=jJgQNailwnt_gBfkGu0O6U8WtDqXM5ukdeB0wvq3gWo,10018
245
- compass_api_sdk/token.py,sha256=na7StCVMxg9-rR533FhhJ23OOjZ8Az8ONjVog8MwudE,24751
245
+ compass_api_sdk/token.py,sha256=Q0nTrmYST5U-8wlyilIwm_ANnCcjpNytg-JamqNMEdI,24223
246
246
  compass_api_sdk/transaction_bundler.py,sha256=g4L9jk7s41kizQuj54BqMMMQIzKMs2bQT4TbOcuBdtQ,31554
247
247
  compass_api_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
248
248
  compass_api_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
249
249
  compass_api_sdk/uniswap_v3.py,sha256=zCfXXSr-wyNjneJjQTxquM0A97HIkOWWpSS_dkguHlA,103605
250
250
  compass_api_sdk/universal.py,sha256=YEUh3SymRcGM_w6M3gP5KyNDT4fBct1fSuopoR_5X2I,58435
251
251
  compass_api_sdk/utils/__init__.py,sha256=88uXYJ3d7C29IuuhPMgWfu4i00tNl555vaqrLA61hds,5766
252
- compass_api_sdk/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y,1699
252
+ compass_api_sdk/utils/annotations.py,sha256=FvfvVTUj8TUclm4HbGgY5yi2Ap7EzGmu2UPFU4FwC1w,2755
253
253
  compass_api_sdk/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
254
254
  compass_api_sdk/utils/enums.py,sha256=REU6ydF8gsVL3xaeGX4sMNyiL3q5P9h29-f6Sa6luAE,2633
255
255
  compass_api_sdk/utils/eventstreaming.py,sha256=SgFqMcUOYKlrTQ4gAp_dNcKLvDXukeiEMNU3DP8mXk8,6692
@@ -265,6 +265,6 @@ compass_api_sdk/utils/serializers.py,sha256=Hndks5M_rJXVub_N5lu0gKZQUoEmWrn6PN7R
265
265
  compass_api_sdk/utils/unmarshal_json_response.py,sha256=GI4Cw4JB6H2qNkqbOuBiUcxtEOJhRm2bz3qfer9KmoE,591
266
266
  compass_api_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
267
267
  compass_api_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
268
- compass_api_sdk-1.1.4.dist-info/METADATA,sha256=Q-BY4JVlahZt3QSLbI-FyvdvOT509zqMmlUqsWAfFrA,31203
269
- compass_api_sdk-1.1.4.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
270
- compass_api_sdk-1.1.4.dist-info/RECORD,,
268
+ compass_api_sdk-1.1.5.dist-info/METADATA,sha256=Y3NY0AUCqybgdO6weV3NbUv3Sum--ZHSBseViMRgNDY,31204
269
+ compass_api_sdk-1.1.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
270
+ compass_api_sdk-1.1.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.2.0
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any