compass_api_sdk 0.8.3__py3-none-any.whl → 0.9.1__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.
- compass_api_sdk/_version.py +2 -2
- compass_api_sdk/aave_v3.py +1 -25
- compass_api_sdk/aerodrome_slipstream.py +1 -31
- compass_api_sdk/models/__init__.py +0 -3
- compass_api_sdk/models/aaveborrowparams.py +15 -20
- compass_api_sdk/models/aaveborrowrequest.py +15 -20
- compass_api_sdk/models/aaverepayparams.py +15 -20
- compass_api_sdk/models/aaverepayrequest.py +15 -20
- compass_api_sdk/models/aavesupplyparams.py +15 -20
- compass_api_sdk/models/aavesupplyrequest.py +15 -20
- compass_api_sdk/models/aavewithdrawparams.py +12 -15
- compass_api_sdk/models/aavewithdrawrequest.py +12 -15
- compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +12 -15
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +12 -15
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionparams.py +14 -15
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +14 -15
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +17 -20
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +17 -20
- compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +13 -16
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +13 -16
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionparams.py +14 -15
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +14 -15
- compass_api_sdk/models/increaseallowanceparams.py +12 -15
- compass_api_sdk/models/increaseallowancerequest.py +12 -15
- compass_api_sdk/models/morphoborrowparams.py +15 -20
- compass_api_sdk/models/morphoborrowrequest.py +15 -20
- compass_api_sdk/models/morphodepositparams.py +15 -20
- compass_api_sdk/models/morphodepositrequest.py +15 -20
- compass_api_sdk/models/morphorepayparams.py +15 -20
- compass_api_sdk/models/morphorepayrequest.py +15 -20
- compass_api_sdk/models/morphosetvaultallowanceparams.py +12 -15
- compass_api_sdk/models/morphosetvaultallowancerequest.py +12 -15
- compass_api_sdk/models/morphosupplycollateralparams.py +15 -20
- compass_api_sdk/models/morphosupplycollateralrequest.py +15 -20
- compass_api_sdk/models/morphowithdrawcollateralparams.py +15 -20
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +15 -20
- compass_api_sdk/models/morphowithdrawparams.py +15 -20
- compass_api_sdk/models/morphowithdrawrequest.py +15 -20
- compass_api_sdk/models/pendlebuyptparams.py +12 -15
- compass_api_sdk/models/pendlebuyptrequest.py +12 -15
- compass_api_sdk/models/pendlebuyytparams.py +12 -15
- compass_api_sdk/models/pendlebuyytrequest.py +12 -15
- compass_api_sdk/models/pendlesellptparams.py +12 -15
- compass_api_sdk/models/pendlesellptrequest.py +12 -15
- compass_api_sdk/models/pendlesellytparams.py +12 -15
- compass_api_sdk/models/pendlesellytrequest.py +12 -15
- compass_api_sdk/models/skybuyparams.py +11 -15
- compass_api_sdk/models/skybuyrequest.py +9 -15
- compass_api_sdk/models/skydepositparams.py +15 -20
- compass_api_sdk/models/skydepositrequest.py +12 -19
- compass_api_sdk/models/skysellparams.py +11 -15
- compass_api_sdk/models/skysellrequest.py +9 -15
- compass_api_sdk/models/skywithdrawparams.py +15 -20
- compass_api_sdk/models/skywithdrawrequest.py +12 -19
- compass_api_sdk/models/tokentransfererc20params.py +12 -15
- compass_api_sdk/models/tokentransferrequest.py +12 -15
- compass_api_sdk/models/uniswapbuyexactlyparams.py +13 -16
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +13 -16
- compass_api_sdk/models/uniswapincreaseliquidityprovisionparams.py +12 -15
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +12 -15
- compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +15 -20
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +15 -20
- compass_api_sdk/models/uniswapsellexactlyparams.py +13 -16
- compass_api_sdk/models/uniswapsellexactlyrequest.py +13 -16
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionparams.py +12 -15
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +12 -15
- compass_api_sdk/models/unwrapwethparams.py +12 -15
- compass_api_sdk/models/unwrapwethrequest.py +12 -15
- compass_api_sdk/models/useroperation.py +73 -72
- compass_api_sdk/models/wrapethparams.py +11 -15
- compass_api_sdk/models/wrapethrequest.py +11 -15
- compass_api_sdk/morpho.py +1 -43
- compass_api_sdk/pendle.py +1 -25
- compass_api_sdk/sky.py +1 -25
- compass_api_sdk/token_sdk.py +1 -7
- compass_api_sdk/uniswap_v3.py +1 -31
- compass_api_sdk/universal.py +1 -19
- {compass_api_sdk-0.8.3.dist-info → compass_api_sdk-0.9.1.dist-info}/METADATA +1 -1
- {compass_api_sdk-0.8.3.dist-info → compass_api_sdk-0.9.1.dist-info}/RECORD +80 -81
- compass_api_sdk/models/multicallactiontype.py +0 -40
- {compass_api_sdk-0.8.3.dist-info → compass_api_sdk-0.9.1.dist-info}/WHEEL +0 -0
|
@@ -10,10 +10,12 @@ from compass_api_sdk.types import (
|
|
|
10
10
|
UNSET,
|
|
11
11
|
UNSET_SENTINEL,
|
|
12
12
|
)
|
|
13
|
+
from compass_api_sdk.utils import validate_const
|
|
13
14
|
import pydantic
|
|
14
|
-
from pydantic import
|
|
15
|
-
from
|
|
16
|
-
from
|
|
15
|
+
from pydantic import model_serializer
|
|
16
|
+
from pydantic.functional_validators import AfterValidator
|
|
17
|
+
from typing import Literal, Optional, Union
|
|
18
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
UniswapMintLiquidityProvisionParamsAmount0DesiredTypedDict = TypeAliasType(
|
|
@@ -94,16 +96,12 @@ class UniswapMintLiquidityProvisionParamsTypedDict(TypedDict):
|
|
|
94
96
|
r"""The minimum amount of the first token to deposit"""
|
|
95
97
|
amount1_min: UniswapMintLiquidityProvisionParamsAmount1MinTypedDict
|
|
96
98
|
r"""The minimum amount of the second token to deposit"""
|
|
99
|
+
action_type: Literal["UNISWAP_MINT_LIQUIDITY_PROVISION"]
|
|
97
100
|
recipient: NotRequired[Nullable[str]]
|
|
98
101
|
r"""The address that will receive the LP tokens"""
|
|
99
102
|
|
|
100
103
|
|
|
101
104
|
class UniswapMintLiquidityProvisionParams(BaseModel):
|
|
102
|
-
model_config = ConfigDict(
|
|
103
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
104
|
-
)
|
|
105
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
106
|
-
|
|
107
105
|
token0: TokenEnum
|
|
108
106
|
r"""A class representing the token.
|
|
109
107
|
|
|
@@ -142,20 +140,20 @@ class UniswapMintLiquidityProvisionParams(BaseModel):
|
|
|
142
140
|
amount1_min: UniswapMintLiquidityProvisionParamsAmount1Min
|
|
143
141
|
r"""The minimum amount of the second token to deposit"""
|
|
144
142
|
|
|
143
|
+
ACTION_TYPE: Annotated[
|
|
144
|
+
Annotated[
|
|
145
|
+
Optional[Literal["UNISWAP_MINT_LIQUIDITY_PROVISION"]],
|
|
146
|
+
AfterValidator(validate_const("UNISWAP_MINT_LIQUIDITY_PROVISION")),
|
|
147
|
+
],
|
|
148
|
+
pydantic.Field(alias="action_type"),
|
|
149
|
+
] = "UNISWAP_MINT_LIQUIDITY_PROVISION"
|
|
150
|
+
|
|
145
151
|
recipient: OptionalNullable[str] = UNSET
|
|
146
152
|
r"""The address that will receive the LP tokens"""
|
|
147
153
|
|
|
148
|
-
@property
|
|
149
|
-
def additional_properties(self):
|
|
150
|
-
return self.__pydantic_extra__
|
|
151
|
-
|
|
152
|
-
@additional_properties.setter
|
|
153
|
-
def additional_properties(self, value):
|
|
154
|
-
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
|
155
|
-
|
|
156
154
|
@model_serializer(mode="wrap")
|
|
157
155
|
def serialize_model(self, handler):
|
|
158
|
-
optional_fields = ["recipient"]
|
|
156
|
+
optional_fields = ["action_type", "recipient"]
|
|
159
157
|
nullable_fields = ["recipient"]
|
|
160
158
|
null_default_fields = []
|
|
161
159
|
|
|
@@ -181,7 +179,4 @@ class UniswapMintLiquidityProvisionParams(BaseModel):
|
|
|
181
179
|
):
|
|
182
180
|
m[k] = val
|
|
183
181
|
|
|
184
|
-
for k, v in serialized.items():
|
|
185
|
-
m[k] = v
|
|
186
|
-
|
|
187
182
|
return m
|
|
@@ -11,10 +11,12 @@ from compass_api_sdk.types import (
|
|
|
11
11
|
UNSET,
|
|
12
12
|
UNSET_SENTINEL,
|
|
13
13
|
)
|
|
14
|
+
from compass_api_sdk.utils import validate_const
|
|
14
15
|
import pydantic
|
|
15
|
-
from pydantic import
|
|
16
|
-
from
|
|
17
|
-
from
|
|
16
|
+
from pydantic import model_serializer
|
|
17
|
+
from pydantic.functional_validators import AfterValidator
|
|
18
|
+
from typing import Literal, Optional, Union
|
|
19
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
UniswapMintLiquidityProvisionRequestAmount0DesiredTypedDict = TypeAliasType(
|
|
@@ -101,6 +103,7 @@ class UniswapMintLiquidityProvisionRequestTypedDict(TypedDict):
|
|
|
101
103
|
r"""The chain to use."""
|
|
102
104
|
sender: str
|
|
103
105
|
r"""The address of the transaction sender."""
|
|
106
|
+
action_type: Literal["UNISWAP_MINT_LIQUIDITY_PROVISION"]
|
|
104
107
|
recipient: NotRequired[Nullable[str]]
|
|
105
108
|
r"""The address that will receive the LP tokens"""
|
|
106
109
|
|
|
@@ -108,11 +111,6 @@ class UniswapMintLiquidityProvisionRequestTypedDict(TypedDict):
|
|
|
108
111
|
class UniswapMintLiquidityProvisionRequest(BaseModel):
|
|
109
112
|
r"""Request model for minting a new liquidity position."""
|
|
110
113
|
|
|
111
|
-
model_config = ConfigDict(
|
|
112
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
113
|
-
)
|
|
114
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
115
|
-
|
|
116
114
|
token0: TokenEnum
|
|
117
115
|
r"""A class representing the token.
|
|
118
116
|
|
|
@@ -157,20 +155,20 @@ class UniswapMintLiquidityProvisionRequest(BaseModel):
|
|
|
157
155
|
sender: str
|
|
158
156
|
r"""The address of the transaction sender."""
|
|
159
157
|
|
|
158
|
+
ACTION_TYPE: Annotated[
|
|
159
|
+
Annotated[
|
|
160
|
+
Optional[Literal["UNISWAP_MINT_LIQUIDITY_PROVISION"]],
|
|
161
|
+
AfterValidator(validate_const("UNISWAP_MINT_LIQUIDITY_PROVISION")),
|
|
162
|
+
],
|
|
163
|
+
pydantic.Field(alias="action_type"),
|
|
164
|
+
] = "UNISWAP_MINT_LIQUIDITY_PROVISION"
|
|
165
|
+
|
|
160
166
|
recipient: OptionalNullable[str] = UNSET
|
|
161
167
|
r"""The address that will receive the LP tokens"""
|
|
162
168
|
|
|
163
|
-
@property
|
|
164
|
-
def additional_properties(self):
|
|
165
|
-
return self.__pydantic_extra__
|
|
166
|
-
|
|
167
|
-
@additional_properties.setter
|
|
168
|
-
def additional_properties(self, value):
|
|
169
|
-
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
|
170
|
-
|
|
171
169
|
@model_serializer(mode="wrap")
|
|
172
170
|
def serialize_model(self, handler):
|
|
173
|
-
optional_fields = ["recipient"]
|
|
171
|
+
optional_fields = ["action_type", "recipient"]
|
|
174
172
|
nullable_fields = ["recipient"]
|
|
175
173
|
null_default_fields = []
|
|
176
174
|
|
|
@@ -196,7 +194,4 @@ class UniswapMintLiquidityProvisionRequest(BaseModel):
|
|
|
196
194
|
):
|
|
197
195
|
m[k] = val
|
|
198
196
|
|
|
199
|
-
for k, v in serialized.items():
|
|
200
|
-
m[k] = v
|
|
201
|
-
|
|
202
197
|
return m
|
|
@@ -4,10 +4,11 @@ from __future__ import annotations
|
|
|
4
4
|
from .feeenum import FeeEnum
|
|
5
5
|
from .token_enum import TokenEnum
|
|
6
6
|
from compass_api_sdk.types import BaseModel
|
|
7
|
+
from compass_api_sdk.utils import validate_const
|
|
7
8
|
import pydantic
|
|
8
|
-
from pydantic import
|
|
9
|
-
from typing import
|
|
10
|
-
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
9
|
+
from pydantic.functional_validators import AfterValidator
|
|
10
|
+
from typing import Literal, Optional, Union
|
|
11
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
UniswapSellExactlyParamsAmountTypedDict = TypeAliasType(
|
|
@@ -46,6 +47,7 @@ class UniswapSellExactlyParamsTypedDict(TypedDict):
|
|
|
46
47
|
r"""The amount of the token to swap from"""
|
|
47
48
|
max_slippage_percent: float
|
|
48
49
|
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
50
|
+
action_type: Literal["UNISWAP_SELL_EXACTLY"]
|
|
49
51
|
wrap_eth: NotRequired[bool]
|
|
50
52
|
r"""Whether to wrap ETH to WETH, only use when swapping WETH into something"""
|
|
51
53
|
|
|
@@ -53,11 +55,6 @@ class UniswapSellExactlyParamsTypedDict(TypedDict):
|
|
|
53
55
|
class UniswapSellExactlyParams(BaseModel):
|
|
54
56
|
r"""Parameters model for selling exactly an amount of tokens."""
|
|
55
57
|
|
|
56
|
-
model_config = ConfigDict(
|
|
57
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
58
|
-
)
|
|
59
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
60
|
-
|
|
61
58
|
token_in: TokenEnum
|
|
62
59
|
r"""A class representing the token.
|
|
63
60
|
|
|
@@ -84,13 +81,13 @@ class UniswapSellExactlyParams(BaseModel):
|
|
|
84
81
|
max_slippage_percent: float
|
|
85
82
|
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
86
83
|
|
|
84
|
+
ACTION_TYPE: Annotated[
|
|
85
|
+
Annotated[
|
|
86
|
+
Optional[Literal["UNISWAP_SELL_EXACTLY"]],
|
|
87
|
+
AfterValidator(validate_const("UNISWAP_SELL_EXACTLY")),
|
|
88
|
+
],
|
|
89
|
+
pydantic.Field(alias="action_type"),
|
|
90
|
+
] = "UNISWAP_SELL_EXACTLY"
|
|
91
|
+
|
|
87
92
|
wrap_eth: Optional[bool] = False
|
|
88
93
|
r"""Whether to wrap ETH to WETH, only use when swapping WETH into something"""
|
|
89
|
-
|
|
90
|
-
@property
|
|
91
|
-
def additional_properties(self):
|
|
92
|
-
return self.__pydantic_extra__
|
|
93
|
-
|
|
94
|
-
@additional_properties.setter
|
|
95
|
-
def additional_properties(self, value):
|
|
96
|
-
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
|
@@ -5,10 +5,11 @@ from .chain import Chain
|
|
|
5
5
|
from .feeenum import FeeEnum
|
|
6
6
|
from .token_enum import TokenEnum
|
|
7
7
|
from compass_api_sdk.types import BaseModel
|
|
8
|
+
from compass_api_sdk.utils import validate_const
|
|
8
9
|
import pydantic
|
|
9
|
-
from pydantic import
|
|
10
|
-
from typing import
|
|
11
|
-
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
10
|
+
from pydantic.functional_validators import AfterValidator
|
|
11
|
+
from typing import Literal, Optional, Union
|
|
12
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
UniswapSellExactlyRequestAmountTypedDict = TypeAliasType(
|
|
@@ -51,6 +52,7 @@ class UniswapSellExactlyRequestTypedDict(TypedDict):
|
|
|
51
52
|
r"""The chain to use."""
|
|
52
53
|
sender: str
|
|
53
54
|
r"""The address of the transaction sender."""
|
|
55
|
+
action_type: Literal["UNISWAP_SELL_EXACTLY"]
|
|
54
56
|
wrap_eth: NotRequired[bool]
|
|
55
57
|
r"""Whether to wrap ETH to WETH, only use when swapping WETH into something"""
|
|
56
58
|
|
|
@@ -58,11 +60,6 @@ class UniswapSellExactlyRequestTypedDict(TypedDict):
|
|
|
58
60
|
class UniswapSellExactlyRequest(BaseModel):
|
|
59
61
|
r"""Request model for selling exactly an amount of tokens."""
|
|
60
62
|
|
|
61
|
-
model_config = ConfigDict(
|
|
62
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
63
|
-
)
|
|
64
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
65
|
-
|
|
66
63
|
token_in: TokenEnum
|
|
67
64
|
r"""A class representing the token.
|
|
68
65
|
|
|
@@ -95,13 +92,13 @@ class UniswapSellExactlyRequest(BaseModel):
|
|
|
95
92
|
sender: str
|
|
96
93
|
r"""The address of the transaction sender."""
|
|
97
94
|
|
|
95
|
+
ACTION_TYPE: Annotated[
|
|
96
|
+
Annotated[
|
|
97
|
+
Optional[Literal["UNISWAP_SELL_EXACTLY"]],
|
|
98
|
+
AfterValidator(validate_const("UNISWAP_SELL_EXACTLY")),
|
|
99
|
+
],
|
|
100
|
+
pydantic.Field(alias="action_type"),
|
|
101
|
+
] = "UNISWAP_SELL_EXACTLY"
|
|
102
|
+
|
|
98
103
|
wrap_eth: Optional[bool] = False
|
|
99
104
|
r"""Whether to wrap ETH to WETH, only use when swapping WETH into something"""
|
|
100
|
-
|
|
101
|
-
@property
|
|
102
|
-
def additional_properties(self):
|
|
103
|
-
return self.__pydantic_extra__
|
|
104
|
-
|
|
105
|
-
@additional_properties.setter
|
|
106
|
-
def additional_properties(self, value):
|
|
107
|
-
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from compass_api_sdk.types import BaseModel
|
|
5
|
+
from compass_api_sdk.utils import validate_const
|
|
5
6
|
import pydantic
|
|
6
|
-
from pydantic import
|
|
7
|
-
from typing import
|
|
8
|
-
from typing_extensions import TypeAliasType, TypedDict
|
|
7
|
+
from pydantic.functional_validators import AfterValidator
|
|
8
|
+
from typing import Literal, Optional, Union
|
|
9
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
UniswapWithdrawLiquidityProvisionParamsPercentageForWithdrawalTypedDict = TypeAliasType(
|
|
@@ -34,6 +35,7 @@ class UniswapWithdrawLiquidityProvisionParamsTypedDict(TypedDict):
|
|
|
34
35
|
UniswapWithdrawLiquidityProvisionParamsPercentageForWithdrawalTypedDict
|
|
35
36
|
)
|
|
36
37
|
r"""How much liquidity to take out in percentage."""
|
|
38
|
+
action_type: Literal["UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"]
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
class UniswapWithdrawLiquidityProvisionParams(BaseModel):
|
|
@@ -43,11 +45,6 @@ class UniswapWithdrawLiquidityProvisionParams(BaseModel):
|
|
|
43
45
|
First, we call decrease liquidity then collect the tokens owed to the user.
|
|
44
46
|
"""
|
|
45
47
|
|
|
46
|
-
model_config = ConfigDict(
|
|
47
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
48
|
-
)
|
|
49
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
50
|
-
|
|
51
48
|
token_id: int
|
|
52
49
|
r"""Token ID of the NFT representing the liquidity provisioned position."""
|
|
53
50
|
|
|
@@ -56,10 +53,10 @@ class UniswapWithdrawLiquidityProvisionParams(BaseModel):
|
|
|
56
53
|
)
|
|
57
54
|
r"""How much liquidity to take out in percentage."""
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
ACTION_TYPE: Annotated[
|
|
57
|
+
Annotated[
|
|
58
|
+
Optional[Literal["UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"]],
|
|
59
|
+
AfterValidator(validate_const("UNISWAP_WITHDRAW_LIQUIDITY_PROVISION")),
|
|
60
|
+
],
|
|
61
|
+
pydantic.Field(alias="action_type"),
|
|
62
|
+
] = "UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .chain import Chain
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
7
|
-
from pydantic import
|
|
8
|
-
from typing import
|
|
9
|
-
from typing_extensions import TypeAliasType, TypedDict
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal, Optional, Union
|
|
10
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
UniswapWithdrawLiquidityProvisionRequestPercentageForWithdrawalTypedDict = (
|
|
@@ -35,14 +36,10 @@ class UniswapWithdrawLiquidityProvisionRequestTypedDict(TypedDict):
|
|
|
35
36
|
r"""The chain to use."""
|
|
36
37
|
sender: str
|
|
37
38
|
r"""The address of the transaction sender."""
|
|
39
|
+
action_type: Literal["UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"]
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
class UniswapWithdrawLiquidityProvisionRequest(BaseModel):
|
|
41
|
-
model_config = ConfigDict(
|
|
42
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
43
|
-
)
|
|
44
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
45
|
-
|
|
46
43
|
token_id: int
|
|
47
44
|
r"""Token ID of the NFT representing the liquidity provisioned position."""
|
|
48
45
|
|
|
@@ -57,10 +54,10 @@ class UniswapWithdrawLiquidityProvisionRequest(BaseModel):
|
|
|
57
54
|
sender: str
|
|
58
55
|
r"""The address of the transaction sender."""
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
ACTION_TYPE: Annotated[
|
|
58
|
+
Annotated[
|
|
59
|
+
Optional[Literal["UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"]],
|
|
60
|
+
AfterValidator(validate_const("UNISWAP_WITHDRAW_LIQUIDITY_PROVISION")),
|
|
61
|
+
],
|
|
62
|
+
pydantic.Field(alias="action_type"),
|
|
63
|
+
] = "UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from compass_api_sdk.types import BaseModel
|
|
5
|
+
from compass_api_sdk.utils import validate_const
|
|
5
6
|
import pydantic
|
|
6
|
-
from pydantic import
|
|
7
|
-
from typing import
|
|
8
|
-
from typing_extensions import TypeAliasType, TypedDict
|
|
7
|
+
from pydantic.functional_validators import AfterValidator
|
|
8
|
+
from typing import Literal, Optional, Union
|
|
9
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
UnwrapWethParamsAmountTypedDict = TypeAliasType(
|
|
@@ -23,23 +24,19 @@ class UnwrapWethParamsTypedDict(TypedDict):
|
|
|
23
24
|
|
|
24
25
|
amount: UnwrapWethParamsAmountTypedDict
|
|
25
26
|
r"""The amount of WETH to unwrap."""
|
|
27
|
+
action_type: Literal["UNWRAP_WETH"]
|
|
26
28
|
|
|
27
29
|
|
|
28
30
|
class UnwrapWethParams(BaseModel):
|
|
29
31
|
r"""Parameters model for unwrapping WETH back to native ETH."""
|
|
30
32
|
|
|
31
|
-
model_config = ConfigDict(
|
|
32
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
33
|
-
)
|
|
34
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
35
|
-
|
|
36
33
|
amount: UnwrapWethParamsAmount
|
|
37
34
|
r"""The amount of WETH to unwrap."""
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
ACTION_TYPE: Annotated[
|
|
37
|
+
Annotated[
|
|
38
|
+
Optional[Literal["UNWRAP_WETH"]],
|
|
39
|
+
AfterValidator(validate_const("UNWRAP_WETH")),
|
|
40
|
+
],
|
|
41
|
+
pydantic.Field(alias="action_type"),
|
|
42
|
+
] = "UNWRAP_WETH"
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .chain import Chain
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
7
|
-
from pydantic import
|
|
8
|
-
from typing import
|
|
9
|
-
from typing_extensions import TypeAliasType, TypedDict
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal, Optional, Union
|
|
10
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
UnwrapWethRequestAmountTypedDict = TypeAliasType(
|
|
@@ -28,16 +29,12 @@ class UnwrapWethRequestTypedDict(TypedDict):
|
|
|
28
29
|
r"""The chain to use."""
|
|
29
30
|
sender: str
|
|
30
31
|
r"""The address of the transaction sender."""
|
|
32
|
+
action_type: Literal["UNWRAP_WETH"]
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
class UnwrapWethRequest(BaseModel):
|
|
34
36
|
r"""Request model for unwrapping WETH back to native ETH."""
|
|
35
37
|
|
|
36
|
-
model_config = ConfigDict(
|
|
37
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
38
|
-
)
|
|
39
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
40
|
-
|
|
41
38
|
amount: UnwrapWethRequestAmount
|
|
42
39
|
r"""The amount of WETH to unwrap."""
|
|
43
40
|
|
|
@@ -47,10 +44,10 @@ class UnwrapWethRequest(BaseModel):
|
|
|
47
44
|
sender: str
|
|
48
45
|
r"""The address of the transaction sender."""
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
ACTION_TYPE: Annotated[
|
|
48
|
+
Annotated[
|
|
49
|
+
Optional[Literal["UNWRAP_WETH"]],
|
|
50
|
+
AfterValidator(validate_const("UNWRAP_WETH")),
|
|
51
|
+
],
|
|
52
|
+
pydantic.Field(alias="action_type"),
|
|
53
|
+
] = "UNWRAP_WETH"
|
|
@@ -45,7 +45,6 @@ from .morphowithdrawcollateralparams import (
|
|
|
45
45
|
MorphoWithdrawCollateralParamsTypedDict,
|
|
46
46
|
)
|
|
47
47
|
from .morphowithdrawparams import MorphoWithdrawParams, MorphoWithdrawParamsTypedDict
|
|
48
|
-
from .multicallactiontype import MulticallActionType
|
|
49
48
|
from .pendlebuyptparams import PendleBuyPtParams, PendleBuyPtParamsTypedDict
|
|
50
49
|
from .pendlebuyytparams import PendleBuyYtParams, PendleBuyYtParamsTypedDict
|
|
51
50
|
from .pendlesellptparams import PendleSellPtParams, PendleSellPtParamsTypedDict
|
|
@@ -81,111 +80,113 @@ from .uniswapwithdrawliquidityprovisionparams import (
|
|
|
81
80
|
from .unwrapwethparams import UnwrapWethParams, UnwrapWethParamsTypedDict
|
|
82
81
|
from .wrapethparams import WrapEthParams, WrapEthParamsTypedDict
|
|
83
82
|
from compass_api_sdk.types import BaseModel
|
|
84
|
-
import
|
|
85
|
-
from pydantic import
|
|
86
|
-
from typing import
|
|
87
|
-
from typing_extensions import TypeAliasType, TypedDict
|
|
83
|
+
from compass_api_sdk.utils import get_discriminator
|
|
84
|
+
from pydantic import Discriminator, Tag
|
|
85
|
+
from typing import Union
|
|
86
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
88
87
|
|
|
89
88
|
|
|
90
89
|
BodyTypedDict = TypeAliasType(
|
|
91
90
|
"BodyTypedDict",
|
|
92
91
|
Union[
|
|
93
|
-
WrapEthParamsTypedDict,
|
|
94
92
|
UnwrapWethParamsTypedDict,
|
|
95
|
-
|
|
93
|
+
WrapEthParamsTypedDict,
|
|
94
|
+
SkyWithdrawParamsTypedDict,
|
|
95
|
+
MorphoSetVaultAllowanceParamsTypedDict,
|
|
96
|
+
PendleSellYtParamsTypedDict,
|
|
96
97
|
UniswapWithdrawLiquidityProvisionParamsTypedDict,
|
|
98
|
+
PendleBuyYtParamsTypedDict,
|
|
99
|
+
SkySellParamsTypedDict,
|
|
97
100
|
AerodromeSlipstreamWithdrawLiquidityProvisionParamsTypedDict,
|
|
98
|
-
|
|
101
|
+
PendleBuyPtParamsTypedDict,
|
|
99
102
|
SkyDepositParamsTypedDict,
|
|
100
103
|
PendleSellPtParamsTypedDict,
|
|
101
|
-
PendleBuyPtParamsTypedDict,
|
|
102
|
-
SkyWithdrawParamsTypedDict,
|
|
103
|
-
MorphoSetVaultAllowanceParamsTypedDict,
|
|
104
104
|
SkyBuyParamsTypedDict,
|
|
105
|
-
SkySellParamsTypedDict,
|
|
106
|
-
MorphoWithdrawParamsTypedDict,
|
|
107
105
|
MorphoDepositParamsTypedDict,
|
|
106
|
+
IncreaseAllowanceParamsTypedDict,
|
|
107
|
+
MorphoWithdrawParamsTypedDict,
|
|
108
|
+
AaveWithdrawParamsTypedDict,
|
|
108
109
|
TokenTransferErc20ParamsTypedDict,
|
|
109
110
|
AaveSupplyParamsTypedDict,
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
MorphoBorrowParamsTypedDict,
|
|
112
|
+
MorphoSupplyCollateralParamsTypedDict,
|
|
112
113
|
MorphoRepayParamsTypedDict,
|
|
113
114
|
MorphoWithdrawCollateralParamsTypedDict,
|
|
114
115
|
AaveRepayParamsTypedDict,
|
|
115
|
-
MorphoBorrowParamsTypedDict,
|
|
116
116
|
AaveBorrowParamsTypedDict,
|
|
117
|
-
|
|
117
|
+
UniswapIncreaseLiquidityProvisionParamsTypedDict,
|
|
118
|
+
AerodromeSlipstreamIncreaseLiquidityProvisionParamsTypedDict,
|
|
118
119
|
AerodromeSlipstreamBuyExactlyParamsTypedDict,
|
|
119
120
|
AerodromeSlipstreamSellExactlyParamsTypedDict,
|
|
120
|
-
AerodromeSlipstreamIncreaseLiquidityProvisionParamsTypedDict,
|
|
121
|
-
UniswapIncreaseLiquidityProvisionParamsTypedDict,
|
|
122
121
|
UniswapBuyExactlyParamsTypedDict,
|
|
123
122
|
UniswapSellExactlyParamsTypedDict,
|
|
124
|
-
UniswapMintLiquidityProvisionParamsTypedDict,
|
|
125
123
|
AerodromeSlipstreamMintLiquidityProvisionParamsTypedDict,
|
|
124
|
+
UniswapMintLiquidityProvisionParamsTypedDict,
|
|
126
125
|
],
|
|
127
126
|
)
|
|
128
127
|
|
|
129
128
|
|
|
130
|
-
Body =
|
|
131
|
-
"Body",
|
|
129
|
+
Body = Annotated[
|
|
132
130
|
Union[
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
131
|
+
Annotated[AaveBorrowParams, Tag("AAVE_BORROW")],
|
|
132
|
+
Annotated[AaveRepayParams, Tag("AAVE_REPAY")],
|
|
133
|
+
Annotated[AaveSupplyParams, Tag("AAVE_SUPPLY")],
|
|
134
|
+
Annotated[AaveWithdrawParams, Tag("AAVE_WITHDRAW")],
|
|
135
|
+
Annotated[
|
|
136
|
+
AerodromeSlipstreamBuyExactlyParams, Tag("AERODROME_SLIPSTREAM_BUY_EXACTLY")
|
|
137
|
+
],
|
|
138
|
+
Annotated[
|
|
139
|
+
AerodromeSlipstreamIncreaseLiquidityProvisionParams,
|
|
140
|
+
Tag("AERODROME_SLIPSTREAM_INCREASE_LIQUIDITY"),
|
|
141
|
+
],
|
|
142
|
+
Annotated[
|
|
143
|
+
AerodromeSlipstreamMintLiquidityProvisionParams,
|
|
144
|
+
Tag("AERODROME_SLIPSTREAM_MINT_LIQUIDITY"),
|
|
145
|
+
],
|
|
146
|
+
Annotated[
|
|
147
|
+
AerodromeSlipstreamSellExactlyParams,
|
|
148
|
+
Tag("AERODROME_SLIPSTREAM_SELL_EXACTLY"),
|
|
149
|
+
],
|
|
150
|
+
Annotated[
|
|
151
|
+
AerodromeSlipstreamWithdrawLiquidityProvisionParams,
|
|
152
|
+
Tag("AERODROME_SLIPSTREAM_WITHDRAW_LIQUIDITY"),
|
|
153
|
+
],
|
|
154
|
+
Annotated[IncreaseAllowanceParams, Tag("ALLOWANCE_INCREASE")],
|
|
155
|
+
Annotated[MorphoBorrowParams, Tag("MORPHO_BORROW")],
|
|
156
|
+
Annotated[MorphoDepositParams, Tag("MORPHO_DEPOSIT")],
|
|
157
|
+
Annotated[MorphoRepayParams, Tag("MORPHO_REPAY")],
|
|
158
|
+
Annotated[MorphoSetVaultAllowanceParams, Tag("MORPHO_SET_VAULT_ALLOWANCE")],
|
|
159
|
+
Annotated[MorphoSupplyCollateralParams, Tag("MORPHO_SUPPLY_COLLATERAL")],
|
|
160
|
+
Annotated[MorphoWithdrawParams, Tag("MORPHO_WITHDRAW")],
|
|
161
|
+
Annotated[MorphoWithdrawCollateralParams, Tag("MORPHO_WITHDRAW_COLLATERAL")],
|
|
162
|
+
Annotated[PendleBuyPtParams, Tag("PENDLE_BUY_PT")],
|
|
163
|
+
Annotated[PendleBuyYtParams, Tag("PENDLE_BUY_YT")],
|
|
164
|
+
Annotated[PendleSellPtParams, Tag("PENDLE_SELL_PT")],
|
|
165
|
+
Annotated[PendleSellYtParams, Tag("PENDLE_SELL_YT")],
|
|
166
|
+
Annotated[SkyBuyParams, Tag("SKY_BUY")],
|
|
167
|
+
Annotated[SkyDepositParams, Tag("SKY_DEPOSIT")],
|
|
168
|
+
Annotated[SkySellParams, Tag("SKY_SELL")],
|
|
169
|
+
Annotated[SkyWithdrawParams, Tag("SKY_WITHDRAW")],
|
|
170
|
+
Annotated[TokenTransferErc20Params, Tag("TRANSFER_ERC20")],
|
|
171
|
+
Annotated[
|
|
172
|
+
UniswapIncreaseLiquidityProvisionParams, Tag("UNISWAP_ADD_LIQUIDITY")
|
|
173
|
+
],
|
|
174
|
+
Annotated[UniswapBuyExactlyParams, Tag("UNISWAP_BUY_EXACTLY")],
|
|
175
|
+
Annotated[UniswapMintLiquidityProvisionParams, Tag("UNISWAP_MINT_LIQUIDITY")],
|
|
176
|
+
Annotated[UniswapSellExactlyParams, Tag("UNISWAP_SELL_EXACTLY")],
|
|
177
|
+
Annotated[
|
|
178
|
+
UniswapWithdrawLiquidityProvisionParams, Tag("UNISWAP_WITHDRAW_LIQUIDITY")
|
|
179
|
+
],
|
|
180
|
+
Annotated[UnwrapWethParams, Tag("UNWRAP_WETH")],
|
|
181
|
+
Annotated[WrapEthParams, Tag("WRAP_ETH")],
|
|
166
182
|
],
|
|
167
|
-
)
|
|
183
|
+
Discriminator(lambda m: get_discriminator(m, "action_type", "action_type")),
|
|
184
|
+
]
|
|
168
185
|
|
|
169
186
|
|
|
170
187
|
class UserOperationTypedDict(TypedDict):
|
|
171
|
-
action_type: MulticallActionType
|
|
172
188
|
body: BodyTypedDict
|
|
173
189
|
|
|
174
190
|
|
|
175
191
|
class UserOperation(BaseModel):
|
|
176
|
-
model_config = ConfigDict(
|
|
177
|
-
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
|
|
178
|
-
)
|
|
179
|
-
__pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
|
|
180
|
-
|
|
181
|
-
action_type: MulticallActionType
|
|
182
|
-
|
|
183
192
|
body: Body
|
|
184
|
-
|
|
185
|
-
@property
|
|
186
|
-
def additional_properties(self):
|
|
187
|
-
return self.__pydantic_extra__
|
|
188
|
-
|
|
189
|
-
@additional_properties.setter
|
|
190
|
-
def additional_properties(self, value):
|
|
191
|
-
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
|