compass_api_sdk 0.1.9__py3-none-any.whl → 0.1.11__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 = "0.1.9"
6
+ __version__: str = "0.1.11"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
- __gen_version__: str = "2.597.9"
9
- __user_agent__: str = "speakeasy-sdk/python 0.1.9 2.597.9 0.0.1 compass_api_sdk"
8
+ __gen_version__: str = "2.598.21"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.1.11 2.598.21 0.0.1 compass_api_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -2,7 +2,6 @@
2
2
 
3
3
  # pyright: reportReturnType = false
4
4
  import asyncio
5
- from concurrent.futures import ThreadPoolExecutor
6
5
  from typing_extensions import Protocol, runtime_checkable
7
6
  import httpx
8
7
  from typing import Any, Optional, Union
@@ -116,21 +115,42 @@ def close_clients(
116
115
  pass
117
116
 
118
117
  if async_client is not None and not async_client_supplied:
119
- is_async = False
118
+ # First, try the simplest approach - use asyncio.run()
119
+ # This works when we're not in an async context
120
120
  try:
121
- asyncio.get_running_loop()
122
- is_async = True
123
- except RuntimeError:
124
- pass
125
-
126
- try:
127
- # If this function is called in an async loop then start another
128
- # loop in a separate thread to close the async http client.
129
- if is_async:
130
- with ThreadPoolExecutor(max_workers=1) as executor:
131
- future = executor.submit(asyncio.run, async_client.aclose())
132
- future.result()
121
+ asyncio.run(async_client.aclose())
122
+ except RuntimeError as e:
123
+ # If we get "RuntimeError: This event loop is already running",
124
+ # it means we're in an async context
125
+ if "already running" in str(e):
126
+ try:
127
+ # We're in an async context, so get the running loop
128
+ loop = asyncio.get_running_loop()
129
+ # Create a task but don't wait for it
130
+ loop.create_task(async_client.aclose())
131
+ except Exception:
132
+ # If we can't get the loop or create a task, just ignore
133
+ # The GC will eventually clean up the resources
134
+ pass
135
+ # If we get "RuntimeError: There is no current event loop in thread",
136
+ # we're not in an async context, but asyncio.run() failed for some reason
137
+ # In this case, we can try to create a new event loop explicitly
138
+ elif "no current event loop" in str(e):
139
+ try:
140
+ # Create a new event loop and run the coroutine
141
+ loop = asyncio.new_event_loop()
142
+ asyncio.set_event_loop(loop)
143
+ try:
144
+ loop.run_until_complete(async_client.aclose())
145
+ finally:
146
+ loop.close()
147
+ asyncio.set_event_loop(None)
148
+ except Exception:
149
+ # If this also fails, just ignore
150
+ pass
151
+ # For any other RuntimeError, just ignore
133
152
  else:
134
- asyncio.run(async_client.aclose())
153
+ pass
135
154
  except Exception:
155
+ # For any other exception, just ignore
136
156
  pass
@@ -12,6 +12,8 @@ class MulticallAuthorizationRequestTypedDict(TypedDict):
12
12
  This model is used to authorize a sender address to perform multicall operations,
13
13
  allowing it to call multiple functions on multiple contracts in a single
14
14
  transaction.
15
+
16
+ Only needs to be done once per an EOA.
15
17
  """
16
18
 
17
19
  chain: Chain
@@ -26,6 +28,8 @@ class MulticallAuthorizationRequest(BaseModel):
26
28
  This model is used to authorize a sender address to perform multicall operations,
27
29
  allowing it to call multiple functions on multiple contracts in a single
28
30
  transaction.
31
+
32
+ Only needs to be done once per an EOA.
29
33
  """
30
34
 
31
35
  chain: Chain
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: compass_api_sdk
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Compass API Python SDK
5
5
  Author: royalnine
6
6
  Requires-Python: >=3.9
@@ -3,14 +3,14 @@ compass_api_sdk/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpv
3
3
  compass_api_sdk/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
4
4
  compass_api_sdk/_hooks/sdkhooks.py,sha256=eVxHB2Q_JG6zZx5xn74i208ij-fpTHqq2jod6fbghRQ,2503
5
5
  compass_api_sdk/_hooks/types.py,sha256=VC7TZz0BiM721MghXneEovG3UkaktRkt1OhMY3iLmZM,2818
6
- compass_api_sdk/_version.py,sha256=mXCoIOESHzubD8KD-uPOSI7itCdZxlN-1lY3RQvCldo,472
6
+ compass_api_sdk/_version.py,sha256=jTgpCND9mb0CjMzykSVX6yvXDANYnppJx7FcRMyDMTA,476
7
7
  compass_api_sdk/aave_v3.py,sha256=XaSnohTBRL-LxZp0IOBe77yz5AOMp-RswgK_pJDMVo0,89308
8
8
  compass_api_sdk/aerodrome_slipstream.py,sha256=iZLOFguQiZD8eMNIxV_4h8JSr9P-V4gISxNCXisVYN8,83389
9
9
  compass_api_sdk/basesdk.py,sha256=29RfgnfgQq_cRx8OHdQEdJuJ2DrgRZlzGIPC-_6-2bM,12136
10
10
  compass_api_sdk/errors/__init__.py,sha256=f8nyj2IhW5h_xtEeg6cfKgByLkqowLv0Fxm0hUofQPs,257
11
11
  compass_api_sdk/errors/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
12
12
  compass_api_sdk/errors/httpvalidationerror.py,sha256=KBdpK3fYQoeMB-3m9dLKiMYimFN7B9VLma6YqMKX5k0,671
13
- compass_api_sdk/httpclient.py,sha256=lC-YQ7q4yiJGKElxBeb3aZnr-4aYxjgEpZ6roeXYlyg,4318
13
+ compass_api_sdk/httpclient.py,sha256=xAUX3nxG-fwYAE9lfv9uaspYKMFRJf5NM79mV2HKb1I,5486
14
14
  compass_api_sdk/models/__init__.py,sha256=u2QQssNwQJ9RHu7HtoM5C--EHFmewnsIlPILwVg0ueE,49447
15
15
  compass_api_sdk/models/aave_historical_transactionsop.py,sha256=ruwlHogJUn6HGWtoRNwEmoA6kXdu8rbDrxzJo-e9UmA,1461
16
16
  compass_api_sdk/models/aave_liquidity_changeop.py,sha256=tR_nsySpTiXHxIreoDJ-Bk07wZgTLGLM05oWxsfpbrM,2801
@@ -95,7 +95,7 @@ compass_api_sdk/models/morphowithdrawcollateralrequest.py,sha256=TVfxhB8eSgu8xeO
95
95
  compass_api_sdk/models/morphowithdrawrequest.py,sha256=PCrsA5Tg8zI8LiraHqniLvj6mhbvMZUCn6gKmUvj-pM,2309
96
96
  compass_api_sdk/models/multicallaction.py,sha256=ll0DjVAsG3xDNBmUCgSw82C-hcU7vl1iTQYbSrqdXMU,6070
97
97
  compass_api_sdk/models/multicallactiontype.py,sha256=sh0DRth1Ka4K1K-sDfPB_E4UkcpxHqCni2pwrUjOeFg,1686
98
- compass_api_sdk/models/multicallauthorizationrequest.py,sha256=QMLF51v9GJvalEVQaAVpKc_x6FcChXSx-haO3oJ-2PE,1067
98
+ compass_api_sdk/models/multicallauthorizationrequest.py,sha256=h5-2acLlhV9assgIIHyVIgTak1IJathqa-viS-PkvMA,1155
99
99
  compass_api_sdk/models/multicallauthorizationresponse.py,sha256=3jjdz9Mz-tKjhBzZbVaJW51no58HSqcxfHJwuZsgnhg,914
100
100
  compass_api_sdk/models/multicallexecuterequest.py,sha256=ST9BeTeptLKi6UO7lWH4-mYiYuG7t5scF1CLnb4Sbd0,1105
101
101
  compass_api_sdk/models/portfolio.py,sha256=Ey2gbh7ZqSWIMmfLrflpZS7QzvCR8QMp5bHx6-BMEp4,687
@@ -182,6 +182,6 @@ compass_api_sdk/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFId
182
182
  compass_api_sdk/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
183
183
  compass_api_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
184
184
  compass_api_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
185
- compass_api_sdk-0.1.9.dist-info/METADATA,sha256=82zRnmO74MiTMPMYBETcrd0EPTJ9he6Ybh9s8snLlHI,24334
186
- compass_api_sdk-0.1.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
187
- compass_api_sdk-0.1.9.dist-info/RECORD,,
185
+ compass_api_sdk-0.1.11.dist-info/METADATA,sha256=iqd3j7tA_mKU2HwmkRO2aiwbUBAwwkyP4fHEHhUS9fI,24335
186
+ compass_api_sdk-0.1.11.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
187
+ compass_api_sdk-0.1.11.dist-info/RECORD,,