compass_api_sdk 0.3.11__py3-none-any.whl → 0.4.0__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.
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/models/__init__.py +18 -8
- compass_api_sdk/models/batcheduseroperation.py +25 -0
- compass_api_sdk/models/batcheduseroperationsrequest.py +42 -0
- compass_api_sdk/models/batcheduseroperationsresponse.py +17 -0
- compass_api_sdk/models/multicallexecuterequest.py +3 -3
- compass_api_sdk/models/{multicallaction.py → useroperation.py} +2 -2
- compass_api_sdk/sdk.py +3 -0
- compass_api_sdk/smart_account.py +229 -0
- compass_api_sdk/transaction_batching.py +4 -8
- {compass_api_sdk-0.3.11.dist-info → compass_api_sdk-0.4.0.dist-info}/METADATA +5 -1
- {compass_api_sdk-0.3.11.dist-info → compass_api_sdk-0.4.0.dist-info}/RECORD +13 -9
- {compass_api_sdk-0.3.11.dist-info → compass_api_sdk-0.4.0.dist-info}/WHEEL +0 -0
compass_api_sdk/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "compass_api_sdk"
|
|
6
|
-
__version__: str = "0.
|
|
6
|
+
__version__: str = "0.4.0"
|
|
7
7
|
__openapi_doc_version__: str = "0.0.1"
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.
|
|
8
|
+
__gen_version__: str = "2.605.0"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.4.0 2.605.0 0.0.1 compass_api_sdk"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
|
@@ -249,6 +249,15 @@ from .aerodromeslipstreamwithdrawliquidityprovisionrequest import (
|
|
|
249
249
|
AerodromeSlipstreamWithdrawLiquidityProvisionRequestTypedDict,
|
|
250
250
|
)
|
|
251
251
|
from .allowanceinforesponse import AllowanceInfoResponse, AllowanceInfoResponseTypedDict
|
|
252
|
+
from .batcheduseroperation import BatchedUserOperation, BatchedUserOperationTypedDict
|
|
253
|
+
from .batcheduseroperationsrequest import (
|
|
254
|
+
BatchedUserOperationsRequest,
|
|
255
|
+
BatchedUserOperationsRequestTypedDict,
|
|
256
|
+
)
|
|
257
|
+
from .batcheduseroperationsresponse import (
|
|
258
|
+
BatchedUserOperationsResponse,
|
|
259
|
+
BatchedUserOperationsResponseTypedDict,
|
|
260
|
+
)
|
|
252
261
|
from .borrow import Borrow, BorrowTypedDict, Borrowratemode
|
|
253
262
|
from .chain import Chain
|
|
254
263
|
from .chaininfo import ChainInfo, ChainInfoTypedDict
|
|
@@ -504,12 +513,6 @@ from .morphowithdrawrequest import (
|
|
|
504
513
|
MorphoWithdrawRequestChain,
|
|
505
514
|
MorphoWithdrawRequestTypedDict,
|
|
506
515
|
)
|
|
507
|
-
from .multicallaction import (
|
|
508
|
-
Body,
|
|
509
|
-
BodyTypedDict,
|
|
510
|
-
MulticallAction,
|
|
511
|
-
MulticallActionTypedDict,
|
|
512
|
-
)
|
|
513
516
|
from .multicallactiontype import MulticallActionType
|
|
514
517
|
from .multicallauthorizationrequest import (
|
|
515
518
|
MulticallAuthorizationRequest,
|
|
@@ -793,6 +796,7 @@ from .unwrapwethrequest import (
|
|
|
793
796
|
UnwrapWethRequestTypedDict,
|
|
794
797
|
)
|
|
795
798
|
from .usageascollateral import UsageAsCollateral, UsageAsCollateralTypedDict
|
|
799
|
+
from .useroperation import Body, BodyTypedDict, UserOperation, UserOperationTypedDict
|
|
796
800
|
from .userstate import UserState, UserStateTypedDict
|
|
797
801
|
from .validationerror import (
|
|
798
802
|
Loc,
|
|
@@ -992,6 +996,12 @@ __all__ = [
|
|
|
992
996
|
"AerodromeSlipstreamWithdrawLiquidityProvisionRequestTypedDict",
|
|
993
997
|
"AllowanceInfoResponse",
|
|
994
998
|
"AllowanceInfoResponseTypedDict",
|
|
999
|
+
"BatchedUserOperation",
|
|
1000
|
+
"BatchedUserOperationTypedDict",
|
|
1001
|
+
"BatchedUserOperationsRequest",
|
|
1002
|
+
"BatchedUserOperationsRequestTypedDict",
|
|
1003
|
+
"BatchedUserOperationsResponse",
|
|
1004
|
+
"BatchedUserOperationsResponseTypedDict",
|
|
995
1005
|
"Body",
|
|
996
1006
|
"BodyTypedDict",
|
|
997
1007
|
"Borrow",
|
|
@@ -1174,9 +1184,7 @@ __all__ = [
|
|
|
1174
1184
|
"MorphoWithdrawRequest",
|
|
1175
1185
|
"MorphoWithdrawRequestChain",
|
|
1176
1186
|
"MorphoWithdrawRequestTypedDict",
|
|
1177
|
-
"MulticallAction",
|
|
1178
1187
|
"MulticallActionType",
|
|
1179
|
-
"MulticallActionTypedDict",
|
|
1180
1188
|
"MulticallAuthorizationRequest",
|
|
1181
1189
|
"MulticallAuthorizationRequestTypedDict",
|
|
1182
1190
|
"MulticallAuthorizationResponse",
|
|
@@ -1395,6 +1403,8 @@ __all__ = [
|
|
|
1395
1403
|
"UnwrapWethRequestTypedDict",
|
|
1396
1404
|
"UsageAsCollateral",
|
|
1397
1405
|
"UsageAsCollateralTypedDict",
|
|
1406
|
+
"UserOperation",
|
|
1407
|
+
"UserOperationTypedDict",
|
|
1398
1408
|
"UserState",
|
|
1399
1409
|
"UserStateTypedDict",
|
|
1400
1410
|
"ValidationError",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import BaseModel
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BatchedUserOperationTypedDict(TypedDict):
|
|
9
|
+
to: str
|
|
10
|
+
r"""The target contract address for the operation"""
|
|
11
|
+
call_data: str
|
|
12
|
+
r"""The calldata for the operation"""
|
|
13
|
+
value: int
|
|
14
|
+
r"""The ETH value to send with the operation"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class BatchedUserOperation(BaseModel):
|
|
18
|
+
to: str
|
|
19
|
+
r"""The target contract address for the operation"""
|
|
20
|
+
|
|
21
|
+
call_data: str
|
|
22
|
+
r"""The calldata for the operation"""
|
|
23
|
+
|
|
24
|
+
value: int
|
|
25
|
+
r"""The ETH value to send with the operation"""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from .useroperation import UserOperation, UserOperationTypedDict
|
|
6
|
+
from compass_api_sdk.types import BaseModel
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic import ConfigDict
|
|
9
|
+
from typing import Any, Dict, List
|
|
10
|
+
from typing_extensions import TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BatchedUserOperationsRequestTypedDict(TypedDict):
|
|
14
|
+
r"""Request model for batching user operations."""
|
|
15
|
+
|
|
16
|
+
chain: Chain
|
|
17
|
+
r"""The chain to use."""
|
|
18
|
+
operations: List[UserOperationTypedDict]
|
|
19
|
+
r"""List of possible user operations"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class BatchedUserOperationsRequest(BaseModel):
|
|
23
|
+
r"""Request model for batching user operations."""
|
|
24
|
+
|
|
25
|
+
model_config = ConfigDict(
|
|
26
|
+
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
27
|
+
)
|
|
28
|
+
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
29
|
+
|
|
30
|
+
chain: Chain
|
|
31
|
+
r"""The chain to use."""
|
|
32
|
+
|
|
33
|
+
operations: List[UserOperation]
|
|
34
|
+
r"""List of possible user operations"""
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def additional_properties(self):
|
|
38
|
+
return self.__pydantic_extra__
|
|
39
|
+
|
|
40
|
+
@additional_properties.setter
|
|
41
|
+
def additional_properties(self, value):
|
|
42
|
+
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .batcheduseroperation import BatchedUserOperation, BatchedUserOperationTypedDict
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from typing import List
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BatchedUserOperationsResponseTypedDict(TypedDict):
|
|
11
|
+
operations: List[BatchedUserOperationTypedDict]
|
|
12
|
+
r"""List of user operations to be batched and executed by the smart account."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class BatchedUserOperationsResponse(BaseModel):
|
|
16
|
+
operations: List[BatchedUserOperation]
|
|
17
|
+
r"""List of user operations to be batched and executed by the smart account."""
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .chain import Chain
|
|
5
|
-
from .multicallaction import MulticallAction, MulticallActionTypedDict
|
|
6
5
|
from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
|
|
6
|
+
from .useroperation import UserOperation, UserOperationTypedDict
|
|
7
7
|
from compass_api_sdk.types import BaseModel
|
|
8
8
|
from typing import List
|
|
9
9
|
from typing_extensions import TypedDict
|
|
@@ -17,7 +17,7 @@ class MulticallExecuteRequestTypedDict(TypedDict):
|
|
|
17
17
|
sender: str
|
|
18
18
|
r"""The address of the transaction sender."""
|
|
19
19
|
signed_authorization: SignedAuthorizationTypedDict
|
|
20
|
-
actions: List[
|
|
20
|
+
actions: List[UserOperationTypedDict]
|
|
21
21
|
r"""List of possible actions for multicall"""
|
|
22
22
|
|
|
23
23
|
|
|
@@ -32,5 +32,5 @@ class MulticallExecuteRequest(BaseModel):
|
|
|
32
32
|
|
|
33
33
|
signed_authorization: SignedAuthorization
|
|
34
34
|
|
|
35
|
-
actions: List[
|
|
35
|
+
actions: List[UserOperation]
|
|
36
36
|
r"""List of possible actions for multicall"""
|
|
@@ -159,12 +159,12 @@ Body = TypeAliasType(
|
|
|
159
159
|
)
|
|
160
160
|
|
|
161
161
|
|
|
162
|
-
class
|
|
162
|
+
class UserOperationTypedDict(TypedDict):
|
|
163
163
|
action_type: MulticallActionType
|
|
164
164
|
body: BodyTypedDict
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
class
|
|
167
|
+
class UserOperation(BaseModel):
|
|
168
168
|
action_type: MulticallActionType
|
|
169
169
|
|
|
170
170
|
body: Body
|
compass_api_sdk/sdk.py
CHANGED
|
@@ -11,6 +11,7 @@ from compass_api_sdk.aave_v3 import AaveV3
|
|
|
11
11
|
from compass_api_sdk.aerodrome_slipstream import AerodromeSlipstream
|
|
12
12
|
from compass_api_sdk.morpho import Morpho
|
|
13
13
|
from compass_api_sdk.sky import Sky
|
|
14
|
+
from compass_api_sdk.smart_account import SmartAccount
|
|
14
15
|
from compass_api_sdk.token_sdk import TokenSDK
|
|
15
16
|
from compass_api_sdk.transaction_batching import TransactionBatching
|
|
16
17
|
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
@@ -32,6 +33,7 @@ class CompassAPI(BaseSDK):
|
|
|
32
33
|
uniswap_v3: UniswapV3
|
|
33
34
|
universal: Universal
|
|
34
35
|
transaction_batching: TransactionBatching
|
|
36
|
+
smart_account: SmartAccount
|
|
35
37
|
|
|
36
38
|
def __init__(
|
|
37
39
|
self,
|
|
@@ -137,6 +139,7 @@ class CompassAPI(BaseSDK):
|
|
|
137
139
|
self.uniswap_v3 = UniswapV3(self.sdk_configuration)
|
|
138
140
|
self.universal = Universal(self.sdk_configuration)
|
|
139
141
|
self.transaction_batching = TransactionBatching(self.sdk_configuration)
|
|
142
|
+
self.smart_account = SmartAccount(self.sdk_configuration)
|
|
140
143
|
|
|
141
144
|
def __enter__(self):
|
|
142
145
|
return self
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from compass_api_sdk import errors, models, utils
|
|
5
|
+
from compass_api_sdk._hooks import HookContext
|
|
6
|
+
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from typing import Any, Dict, List, Mapping, Optional, Union
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SmartAccount(BaseSDK):
|
|
11
|
+
def account_batched_user_operations(
|
|
12
|
+
self,
|
|
13
|
+
*,
|
|
14
|
+
chain: models.Chain,
|
|
15
|
+
operations: Union[
|
|
16
|
+
List[models.UserOperation], List[models.UserOperationTypedDict]
|
|
17
|
+
],
|
|
18
|
+
additional_properties: Optional[Dict[str, Any]] = None,
|
|
19
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
20
|
+
server_url: Optional[str] = None,
|
|
21
|
+
timeout_ms: Optional[int] = None,
|
|
22
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
23
|
+
) -> models.BatchedUserOperationsResponse:
|
|
24
|
+
r"""Get Smart Account Batched User Operations
|
|
25
|
+
|
|
26
|
+
Generate a list of user operations for smart account batching.
|
|
27
|
+
|
|
28
|
+
:param chain: The chain to use.
|
|
29
|
+
:param operations: List of possible user operations
|
|
30
|
+
:param additional_properties:
|
|
31
|
+
:param retries: Override the default retry configuration for this method
|
|
32
|
+
:param server_url: Override the default server URL for this method
|
|
33
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
34
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
35
|
+
"""
|
|
36
|
+
base_url = None
|
|
37
|
+
url_variables = None
|
|
38
|
+
if timeout_ms is None:
|
|
39
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
40
|
+
|
|
41
|
+
if server_url is not None:
|
|
42
|
+
base_url = server_url
|
|
43
|
+
else:
|
|
44
|
+
base_url = self._get_url(base_url, url_variables)
|
|
45
|
+
|
|
46
|
+
request = models.BatchedUserOperationsRequest(
|
|
47
|
+
chain=chain,
|
|
48
|
+
operations=utils.get_pydantic_model(operations, List[models.UserOperation]),
|
|
49
|
+
**(additional_properties or {}),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
req = self._build_request(
|
|
53
|
+
method="POST",
|
|
54
|
+
path="/v0/smart_account/batched_user_operations",
|
|
55
|
+
base_url=base_url,
|
|
56
|
+
url_variables=url_variables,
|
|
57
|
+
request=request,
|
|
58
|
+
request_body_required=True,
|
|
59
|
+
request_has_path_params=False,
|
|
60
|
+
request_has_query_params=True,
|
|
61
|
+
user_agent_header="user-agent",
|
|
62
|
+
accept_header_value="application/json",
|
|
63
|
+
http_headers=http_headers,
|
|
64
|
+
security=self.sdk_configuration.security,
|
|
65
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
66
|
+
request, False, False, "json", models.BatchedUserOperationsRequest
|
|
67
|
+
),
|
|
68
|
+
timeout_ms=timeout_ms,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
if retries == UNSET:
|
|
72
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
73
|
+
retries = self.sdk_configuration.retry_config
|
|
74
|
+
|
|
75
|
+
retry_config = None
|
|
76
|
+
if isinstance(retries, utils.RetryConfig):
|
|
77
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
78
|
+
|
|
79
|
+
http_res = self.do_request(
|
|
80
|
+
hook_ctx=HookContext(
|
|
81
|
+
base_url=base_url or "",
|
|
82
|
+
operation_id="smart_account_batched_user_operations",
|
|
83
|
+
oauth2_scopes=[],
|
|
84
|
+
security_source=self.sdk_configuration.security,
|
|
85
|
+
),
|
|
86
|
+
request=req,
|
|
87
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
88
|
+
retry_config=retry_config,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
response_data: Any = None
|
|
92
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
93
|
+
return utils.unmarshal_json(
|
|
94
|
+
http_res.text, models.BatchedUserOperationsResponse
|
|
95
|
+
)
|
|
96
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
97
|
+
response_data = utils.unmarshal_json(
|
|
98
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
99
|
+
)
|
|
100
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
101
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
102
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
103
|
+
raise errors.APIError(
|
|
104
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
105
|
+
)
|
|
106
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
107
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
108
|
+
raise errors.APIError(
|
|
109
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
content_type = http_res.headers.get("Content-Type")
|
|
113
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
114
|
+
raise errors.APIError(
|
|
115
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
116
|
+
http_res.status_code,
|
|
117
|
+
http_res_text,
|
|
118
|
+
http_res,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
async def account_batched_user_operations_async(
|
|
122
|
+
self,
|
|
123
|
+
*,
|
|
124
|
+
chain: models.Chain,
|
|
125
|
+
operations: Union[
|
|
126
|
+
List[models.UserOperation], List[models.UserOperationTypedDict]
|
|
127
|
+
],
|
|
128
|
+
additional_properties: Optional[Dict[str, Any]] = None,
|
|
129
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
130
|
+
server_url: Optional[str] = None,
|
|
131
|
+
timeout_ms: Optional[int] = None,
|
|
132
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
133
|
+
) -> models.BatchedUserOperationsResponse:
|
|
134
|
+
r"""Get Smart Account Batched User Operations
|
|
135
|
+
|
|
136
|
+
Generate a list of user operations for smart account batching.
|
|
137
|
+
|
|
138
|
+
:param chain: The chain to use.
|
|
139
|
+
:param operations: List of possible user operations
|
|
140
|
+
:param additional_properties:
|
|
141
|
+
:param retries: Override the default retry configuration for this method
|
|
142
|
+
:param server_url: Override the default server URL for this method
|
|
143
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
144
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
145
|
+
"""
|
|
146
|
+
base_url = None
|
|
147
|
+
url_variables = None
|
|
148
|
+
if timeout_ms is None:
|
|
149
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
150
|
+
|
|
151
|
+
if server_url is not None:
|
|
152
|
+
base_url = server_url
|
|
153
|
+
else:
|
|
154
|
+
base_url = self._get_url(base_url, url_variables)
|
|
155
|
+
|
|
156
|
+
request = models.BatchedUserOperationsRequest(
|
|
157
|
+
chain=chain,
|
|
158
|
+
operations=utils.get_pydantic_model(operations, List[models.UserOperation]),
|
|
159
|
+
**(additional_properties or {}),
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
req = self._build_request_async(
|
|
163
|
+
method="POST",
|
|
164
|
+
path="/v0/smart_account/batched_user_operations",
|
|
165
|
+
base_url=base_url,
|
|
166
|
+
url_variables=url_variables,
|
|
167
|
+
request=request,
|
|
168
|
+
request_body_required=True,
|
|
169
|
+
request_has_path_params=False,
|
|
170
|
+
request_has_query_params=True,
|
|
171
|
+
user_agent_header="user-agent",
|
|
172
|
+
accept_header_value="application/json",
|
|
173
|
+
http_headers=http_headers,
|
|
174
|
+
security=self.sdk_configuration.security,
|
|
175
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
176
|
+
request, False, False, "json", models.BatchedUserOperationsRequest
|
|
177
|
+
),
|
|
178
|
+
timeout_ms=timeout_ms,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
if retries == UNSET:
|
|
182
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
183
|
+
retries = self.sdk_configuration.retry_config
|
|
184
|
+
|
|
185
|
+
retry_config = None
|
|
186
|
+
if isinstance(retries, utils.RetryConfig):
|
|
187
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
188
|
+
|
|
189
|
+
http_res = await self.do_request_async(
|
|
190
|
+
hook_ctx=HookContext(
|
|
191
|
+
base_url=base_url or "",
|
|
192
|
+
operation_id="smart_account_batched_user_operations",
|
|
193
|
+
oauth2_scopes=[],
|
|
194
|
+
security_source=self.sdk_configuration.security,
|
|
195
|
+
),
|
|
196
|
+
request=req,
|
|
197
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
198
|
+
retry_config=retry_config,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
response_data: Any = None
|
|
202
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
203
|
+
return utils.unmarshal_json(
|
|
204
|
+
http_res.text, models.BatchedUserOperationsResponse
|
|
205
|
+
)
|
|
206
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
207
|
+
response_data = utils.unmarshal_json(
|
|
208
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
209
|
+
)
|
|
210
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
211
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
212
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
213
|
+
raise errors.APIError(
|
|
214
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
215
|
+
)
|
|
216
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
217
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
218
|
+
raise errors.APIError(
|
|
219
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
content_type = http_res.headers.get("Content-Type")
|
|
223
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
224
|
+
raise errors.APIError(
|
|
225
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
226
|
+
http_res.status_code,
|
|
227
|
+
http_res_text,
|
|
228
|
+
http_res,
|
|
229
|
+
)
|
|
@@ -236,9 +236,7 @@ class TransactionBatching(BaseSDK):
|
|
|
236
236
|
signed_authorization: Union[
|
|
237
237
|
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
238
238
|
],
|
|
239
|
-
actions: Union[
|
|
240
|
-
List[models.MulticallAction], List[models.MulticallActionTypedDict]
|
|
241
|
-
],
|
|
239
|
+
actions: Union[List[models.UserOperation], List[models.UserOperationTypedDict]],
|
|
242
240
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
243
241
|
server_url: Optional[str] = None,
|
|
244
242
|
timeout_ms: Optional[int] = None,
|
|
@@ -278,7 +276,7 @@ class TransactionBatching(BaseSDK):
|
|
|
278
276
|
signed_authorization=utils.get_pydantic_model(
|
|
279
277
|
signed_authorization, models.SignedAuthorization
|
|
280
278
|
),
|
|
281
|
-
actions=utils.get_pydantic_model(actions, List[models.
|
|
279
|
+
actions=utils.get_pydantic_model(actions, List[models.UserOperation]),
|
|
282
280
|
)
|
|
283
281
|
|
|
284
282
|
req = self._build_request(
|
|
@@ -358,9 +356,7 @@ class TransactionBatching(BaseSDK):
|
|
|
358
356
|
signed_authorization: Union[
|
|
359
357
|
models.SignedAuthorization, models.SignedAuthorizationTypedDict
|
|
360
358
|
],
|
|
361
|
-
actions: Union[
|
|
362
|
-
List[models.MulticallAction], List[models.MulticallActionTypedDict]
|
|
363
|
-
],
|
|
359
|
+
actions: Union[List[models.UserOperation], List[models.UserOperationTypedDict]],
|
|
364
360
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
365
361
|
server_url: Optional[str] = None,
|
|
366
362
|
timeout_ms: Optional[int] = None,
|
|
@@ -400,7 +396,7 @@ class TransactionBatching(BaseSDK):
|
|
|
400
396
|
signed_authorization=utils.get_pydantic_model(
|
|
401
397
|
signed_authorization, models.SignedAuthorization
|
|
402
398
|
),
|
|
403
|
-
actions=utils.get_pydantic_model(actions, List[models.
|
|
399
|
+
actions=utils.get_pydantic_model(actions, List[models.UserOperation]),
|
|
404
400
|
)
|
|
405
401
|
|
|
406
402
|
req = self._build_request_async(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: compass_api_sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Compass API SDK.
|
|
5
5
|
Author: royalnine
|
|
6
6
|
Requires-Python: >=3.9.2
|
|
@@ -242,6 +242,10 @@ with CompassAPI(
|
|
|
242
242
|
* [deposit](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#deposit) - Deposit USDS
|
|
243
243
|
* [withdraw](https://github.com/CompassLabs/mono/blob/master/docs/sdks/sky/README.md#withdraw) - Withdraw USDS
|
|
244
244
|
|
|
245
|
+
### [smart_account](https://github.com/CompassLabs/mono/blob/master/docs/sdks/smartaccount/README.md)
|
|
246
|
+
|
|
247
|
+
* [account_batched_user_operations](https://github.com/CompassLabs/mono/blob/master/docs/sdks/smartaccount/README.md#account_batched_user_operations) - Get Smart Account Batched User Operations
|
|
248
|
+
|
|
245
249
|
### [token](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md)
|
|
246
250
|
|
|
247
251
|
* [address](https://github.com/CompassLabs/mono/blob/master/docs/sdks/tokensdk/README.md#address) - Token Address
|
|
@@ -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=VC7TZz0BiM721MghXneEovG3UkaktRkt1OhMY3iLmZM,2818
|
|
5
|
-
compass_api_sdk/_version.py,sha256=
|
|
5
|
+
compass_api_sdk/_version.py,sha256=4iAx9XnkKtkPnDQvAnexGZVnbiWzf5hgxCasNFVgyfk,472
|
|
6
6
|
compass_api_sdk/aave_v3.py,sha256=munMaquKel0HNDg7ULn0BH-Mmgski-4OvBAD9D37rEA,123242
|
|
7
7
|
compass_api_sdk/aerodrome_slipstream.py,sha256=3UX3TnFBlCqs_lBYhRsL2J21WClvlhUcpwDHv7RQNGY,82965
|
|
8
8
|
compass_api_sdk/basesdk.py,sha256=29RfgnfgQq_cRx8OHdQEdJuJ2DrgRZlzGIPC-_6-2bM,12136
|
|
@@ -10,7 +10,7 @@ compass_api_sdk/errors/__init__.py,sha256=f8nyj2IhW5h_xtEeg6cfKgByLkqowLv0Fxm0hU
|
|
|
10
10
|
compass_api_sdk/errors/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
|
|
11
11
|
compass_api_sdk/errors/httpvalidationerror.py,sha256=KBdpK3fYQoeMB-3m9dLKiMYimFN7B9VLma6YqMKX5k0,671
|
|
12
12
|
compass_api_sdk/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
|
|
13
|
-
compass_api_sdk/models/__init__.py,sha256=
|
|
13
|
+
compass_api_sdk/models/__init__.py,sha256=cFqNUzr3Jqt-oMc6AWceZZCU_eg0iapLxjBg01yZK0E,55824
|
|
14
14
|
compass_api_sdk/models/aave_avg_rateop.py,sha256=PEdn3yManrwWI6SCD8nrgAFp4KJoXn4nwo56exPhRPA,2392
|
|
15
15
|
compass_api_sdk/models/aave_historical_transactionsop.py,sha256=7Ghmin3AWvh2knbC-M0CZ0chL8q3fJU-GeDgXeoY0s4,1789
|
|
16
16
|
compass_api_sdk/models/aave_liquidity_changeop.py,sha256=o9G4dD2foyhbunziTv_177Qr2AK37KTIQsQfvPxo5Fs,2785
|
|
@@ -54,6 +54,9 @@ compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py,sha256=PO94biGAB
|
|
|
54
54
|
compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionparams.py,sha256=DQKPJCyd66mFq6irFqMh7wvAQyF_HniRxoASPmmsvcQ,2265
|
|
55
55
|
compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py,sha256=DXbQqFH6qRyrnqQ61y8O7regkqgu_kqY0yY1AamZXTs,1738
|
|
56
56
|
compass_api_sdk/models/allowanceinforesponse.py,sha256=OIvJVxMrRNBay8DIeqlwGBFQ1fbaGVWlaGsOZpo40fY,1393
|
|
57
|
+
compass_api_sdk/models/batcheduseroperation.py,sha256=vk_u6LEt3etlfE2oY8zz43YLvqM6ydLKpL8dkLJ7oIE,679
|
|
58
|
+
compass_api_sdk/models/batcheduseroperationsrequest.py,sha256=ga49DkHKZ9RnuaRDqad4wCKZxeMo0GAg2PrxVV94GJ4,1292
|
|
59
|
+
compass_api_sdk/models/batcheduseroperationsresponse.py,sha256=MIrYKYaCMlWpqfaEVvuXHdAwGqUrkJBZavTlb0iMnJw,674
|
|
57
60
|
compass_api_sdk/models/borrow.py,sha256=YQxBejrFjAvfjrYC7kmQRsQL2q6bb6MZxLzFuVHZEFg,2140
|
|
58
61
|
compass_api_sdk/models/chain.py,sha256=TzxP0Ujy0L-o3__gggsKeJIWMaflQTNnNSEaXBnSlGU,304
|
|
59
62
|
compass_api_sdk/models/chaininfo.py,sha256=XUUk-Nfz8-S9uOD4d9QVm_gsRIEXyIgeBGCS3dcFTmc,1406
|
|
@@ -119,11 +122,10 @@ compass_api_sdk/models/morphowithdrawcollateralparams.py,sha256=8l37mTA6nVVT9HRz
|
|
|
119
122
|
compass_api_sdk/models/morphowithdrawcollateralrequest.py,sha256=AXjtL47SbwhjoT2WtYy0V94sUAwRLDw-czAPg2ePidA,3245
|
|
120
123
|
compass_api_sdk/models/morphowithdrawparams.py,sha256=66ZNPNlpr1Jfo29_qYFKeqtPA09I1cgNDzWWlqFof60,2056
|
|
121
124
|
compass_api_sdk/models/morphowithdrawrequest.py,sha256=hV8recUvGxYTTpWT3FyCLYefeWYIibIFtfIu_IAvtE4,2413
|
|
122
|
-
compass_api_sdk/models/multicallaction.py,sha256=h1fUCWhkhd4eiM89QsVsN-UZcfF_guYJUSieIuNnTS4,6298
|
|
123
125
|
compass_api_sdk/models/multicallactiontype.py,sha256=zUoQJ_v_lyrIQWydn16iknjjX1J5oWdvm2PEdmyrPUA,1614
|
|
124
126
|
compass_api_sdk/models/multicallauthorizationrequest.py,sha256=h5-2acLlhV9assgIIHyVIgTak1IJathqa-viS-PkvMA,1155
|
|
125
127
|
compass_api_sdk/models/multicallauthorizationresponse.py,sha256=3jjdz9Mz-tKjhBzZbVaJW51no58HSqcxfHJwuZsgnhg,914
|
|
126
|
-
compass_api_sdk/models/multicallexecuterequest.py,sha256=
|
|
128
|
+
compass_api_sdk/models/multicallexecuterequest.py,sha256=iVCfkarzlLYQrdo2sCRB9YJyJ-dayaf321j0Hh4Fit8,1095
|
|
127
129
|
compass_api_sdk/models/portfolio.py,sha256=Ey2gbh7ZqSWIMmfLrflpZS7QzvCR8QMp5bHx6-BMEp4,687
|
|
128
130
|
compass_api_sdk/models/redeemunderlying.py,sha256=YK6I29RAeIgE4gfxyjgoUiktxqFAnJfvNv4qz1QvmTU,1282
|
|
129
131
|
compass_api_sdk/models/repay.py,sha256=dCDDG9BvJOnT-OgEs013t7l5xG0r-5M_BUxal4cfU0I,1482
|
|
@@ -179,6 +181,7 @@ compass_api_sdk/models/unsignedtransaction.py,sha256=DHPEOKI-xgmu7tLiVxsv4JJp93k
|
|
|
179
181
|
compass_api_sdk/models/unwrapwethparams.py,sha256=nBbf-Z2z8-yYPWuNqpESpxRsssJ1PPu4jLRZ2iwBGfk,884
|
|
180
182
|
compass_api_sdk/models/unwrapwethrequest.py,sha256=LaeHJHs6YZ24HLfUunvybNsLJ9uiQ-v_meEk_VyQo4Y,1137
|
|
181
183
|
compass_api_sdk/models/usageascollateral.py,sha256=hHBgh83BO9WA6u-9xzTvBlPOLoiYV1N21G6vDeo_b30,1561
|
|
184
|
+
compass_api_sdk/models/useroperation.py,sha256=6pdlhqMjceZds-wOH2Umo_ZvHQqVfCzzDg6mfdwzHoA,6294
|
|
182
185
|
compass_api_sdk/models/userstate.py,sha256=xK6ZrhqogPE32JH7J4i1_oK7KxYkmebJU-jfcBp8FOo,1003
|
|
183
186
|
compass_api_sdk/models/validationerror.py,sha256=01WnpU7Tgin0B_poO97_hl6b5CNJ_9VGzpcmoeJs4GU,532
|
|
184
187
|
compass_api_sdk/models/vault.py,sha256=ttepBiKO4o7-C97oALWOYAcN7ALDXmBFBcbQV_nfwO4,1849
|
|
@@ -188,11 +191,12 @@ compass_api_sdk/models/wrapethparams.py,sha256=eMIOqxDM3hCwMJiJsMdnO6ZsMXg1K-_E3
|
|
|
188
191
|
compass_api_sdk/models/wrapethrequest.py,sha256=aJBhcooob-etvReQEjNdC8HOUQ7oUNkOPYr6A4a3BFE,1077
|
|
189
192
|
compass_api_sdk/morpho.py,sha256=RbvyhVM2T2uRuWJQs8x52VS7AyjgVc83NxrvL_mPCWA,132124
|
|
190
193
|
compass_api_sdk/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
191
|
-
compass_api_sdk/sdk.py,sha256=
|
|
194
|
+
compass_api_sdk/sdk.py,sha256=ISOCKopTD8hEDFh1rVgqC-ZBgHPRg71QrK5QxgvXQr0,6251
|
|
192
195
|
compass_api_sdk/sdkconfiguration.py,sha256=K-B67o2xftk7Rh5z59xBL0TcCn_XhX0Yh_JePPegvvU,1764
|
|
193
196
|
compass_api_sdk/sky.py,sha256=lAEwbjZwse_M2sWx-VY37eD1xcDlbk5W1AGbIUeHHBw,43639
|
|
197
|
+
compass_api_sdk/smart_account.py,sha256=qMBOBYPQr_3UUx1t6VAAGBCtKm2s9UHxgh2UnUsJmHA,9356
|
|
194
198
|
compass_api_sdk/token_sdk.py,sha256=YsmluOW2GAAUgwUhDBneaO__xpcbg6DSwtlSc1yZYYw,34262
|
|
195
|
-
compass_api_sdk/transaction_batching.py,sha256=
|
|
199
|
+
compass_api_sdk/transaction_batching.py,sha256=TClHaSuMgvLrJ83mMQo1dgrJwEl11UT_zhPFvRft_mY,31315
|
|
196
200
|
compass_api_sdk/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
197
201
|
compass_api_sdk/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
|
198
202
|
compass_api_sdk/uniswap_v3.py,sha256=t8wh3AUVt71ulXmW8mkINNm6zOIz4qHQSOixW_aceP0,108327
|
|
@@ -213,6 +217,6 @@ compass_api_sdk/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFId
|
|
|
213
217
|
compass_api_sdk/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
|
|
214
218
|
compass_api_sdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
215
219
|
compass_api_sdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
216
|
-
compass_api_sdk-0.
|
|
217
|
-
compass_api_sdk-0.
|
|
218
|
-
compass_api_sdk-0.
|
|
220
|
+
compass_api_sdk-0.4.0.dist-info/METADATA,sha256=c_jIp7VfCwYYCG8Kij2jz9ektdS5vuIJfQ6K_Rs7icA,25294
|
|
221
|
+
compass_api_sdk-0.4.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
222
|
+
compass_api_sdk-0.4.0.dist-info/RECORD,,
|
|
File without changes
|