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.

Files changed (81) hide show
  1. compass_api_sdk/_version.py +2 -2
  2. compass_api_sdk/aave_v3.py +1 -25
  3. compass_api_sdk/aerodrome_slipstream.py +1 -31
  4. compass_api_sdk/models/__init__.py +0 -3
  5. compass_api_sdk/models/aaveborrowparams.py +15 -20
  6. compass_api_sdk/models/aaveborrowrequest.py +15 -20
  7. compass_api_sdk/models/aaverepayparams.py +15 -20
  8. compass_api_sdk/models/aaverepayrequest.py +15 -20
  9. compass_api_sdk/models/aavesupplyparams.py +15 -20
  10. compass_api_sdk/models/aavesupplyrequest.py +15 -20
  11. compass_api_sdk/models/aavewithdrawparams.py +12 -15
  12. compass_api_sdk/models/aavewithdrawrequest.py +12 -15
  13. compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +12 -15
  14. compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +12 -15
  15. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionparams.py +14 -15
  16. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +14 -15
  17. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +17 -20
  18. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +17 -20
  19. compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +13 -16
  20. compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +13 -16
  21. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionparams.py +14 -15
  22. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +14 -15
  23. compass_api_sdk/models/increaseallowanceparams.py +12 -15
  24. compass_api_sdk/models/increaseallowancerequest.py +12 -15
  25. compass_api_sdk/models/morphoborrowparams.py +15 -20
  26. compass_api_sdk/models/morphoborrowrequest.py +15 -20
  27. compass_api_sdk/models/morphodepositparams.py +15 -20
  28. compass_api_sdk/models/morphodepositrequest.py +15 -20
  29. compass_api_sdk/models/morphorepayparams.py +15 -20
  30. compass_api_sdk/models/morphorepayrequest.py +15 -20
  31. compass_api_sdk/models/morphosetvaultallowanceparams.py +12 -15
  32. compass_api_sdk/models/morphosetvaultallowancerequest.py +12 -15
  33. compass_api_sdk/models/morphosupplycollateralparams.py +15 -20
  34. compass_api_sdk/models/morphosupplycollateralrequest.py +15 -20
  35. compass_api_sdk/models/morphowithdrawcollateralparams.py +15 -20
  36. compass_api_sdk/models/morphowithdrawcollateralrequest.py +15 -20
  37. compass_api_sdk/models/morphowithdrawparams.py +15 -20
  38. compass_api_sdk/models/morphowithdrawrequest.py +15 -20
  39. compass_api_sdk/models/pendlebuyptparams.py +12 -15
  40. compass_api_sdk/models/pendlebuyptrequest.py +12 -15
  41. compass_api_sdk/models/pendlebuyytparams.py +12 -15
  42. compass_api_sdk/models/pendlebuyytrequest.py +12 -15
  43. compass_api_sdk/models/pendlesellptparams.py +12 -15
  44. compass_api_sdk/models/pendlesellptrequest.py +12 -15
  45. compass_api_sdk/models/pendlesellytparams.py +12 -15
  46. compass_api_sdk/models/pendlesellytrequest.py +12 -15
  47. compass_api_sdk/models/skybuyparams.py +11 -15
  48. compass_api_sdk/models/skybuyrequest.py +9 -15
  49. compass_api_sdk/models/skydepositparams.py +15 -20
  50. compass_api_sdk/models/skydepositrequest.py +12 -19
  51. compass_api_sdk/models/skysellparams.py +11 -15
  52. compass_api_sdk/models/skysellrequest.py +9 -15
  53. compass_api_sdk/models/skywithdrawparams.py +15 -20
  54. compass_api_sdk/models/skywithdrawrequest.py +12 -19
  55. compass_api_sdk/models/tokentransfererc20params.py +12 -15
  56. compass_api_sdk/models/tokentransferrequest.py +12 -15
  57. compass_api_sdk/models/uniswapbuyexactlyparams.py +13 -16
  58. compass_api_sdk/models/uniswapbuyexactlyrequest.py +13 -16
  59. compass_api_sdk/models/uniswapincreaseliquidityprovisionparams.py +12 -15
  60. compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +12 -15
  61. compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +15 -20
  62. compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +15 -20
  63. compass_api_sdk/models/uniswapsellexactlyparams.py +13 -16
  64. compass_api_sdk/models/uniswapsellexactlyrequest.py +13 -16
  65. compass_api_sdk/models/uniswapwithdrawliquidityprovisionparams.py +12 -15
  66. compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +12 -15
  67. compass_api_sdk/models/unwrapwethparams.py +12 -15
  68. compass_api_sdk/models/unwrapwethrequest.py +12 -15
  69. compass_api_sdk/models/useroperation.py +73 -72
  70. compass_api_sdk/models/wrapethparams.py +11 -15
  71. compass_api_sdk/models/wrapethrequest.py +11 -15
  72. compass_api_sdk/morpho.py +1 -43
  73. compass_api_sdk/pendle.py +1 -25
  74. compass_api_sdk/sky.py +1 -25
  75. compass_api_sdk/token_sdk.py +1 -7
  76. compass_api_sdk/uniswap_v3.py +1 -31
  77. compass_api_sdk/universal.py +1 -19
  78. {compass_api_sdk-0.8.3.dist-info → compass_api_sdk-0.9.1.dist-info}/METADATA +1 -1
  79. {compass_api_sdk-0.8.3.dist-info → compass_api_sdk-0.9.1.dist-info}/RECORD +80 -81
  80. compass_api_sdk/models/multicallactiontype.py +0 -40
  81. {compass_api_sdk-0.8.3.dist-info → compass_api_sdk-0.9.1.dist-info}/WHEEL +0 -0
@@ -10,9 +10,9 @@ from compass_api_sdk.types import (
10
10
  )
11
11
  from compass_api_sdk.utils import validate_const
12
12
  import pydantic
13
- from pydantic import ConfigDict, model_serializer
13
+ from pydantic import model_serializer
14
14
  from pydantic.functional_validators import AfterValidator
15
- from typing import Any, Dict, Literal, Optional, Union
15
+ from typing import Literal, Optional, Union
16
16
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
17
17
 
18
18
 
@@ -31,23 +31,27 @@ class SkyDepositRequestTypedDict(TypedDict):
31
31
  r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
32
32
  sender: str
33
33
  r"""The address of the transaction sender."""
34
+ action_type: Literal["SKY_DEPOSIT"]
34
35
  receiver: NotRequired[Nullable[str]]
35
36
  r"""The address which will receive the sUSDS. Defaults to the sender."""
36
37
  chain: Literal["ethereum:mainnet"]
37
38
 
38
39
 
39
40
  class SkyDepositRequest(BaseModel):
40
- model_config = ConfigDict(
41
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
42
- )
43
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
44
-
45
41
  amount: SkyDepositRequestAmount
46
42
  r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
47
43
 
48
44
  sender: str
49
45
  r"""The address of the transaction sender."""
50
46
 
47
+ ACTION_TYPE: Annotated[
48
+ Annotated[
49
+ Optional[Literal["SKY_DEPOSIT"]],
50
+ AfterValidator(validate_const("SKY_DEPOSIT")),
51
+ ],
52
+ pydantic.Field(alias="action_type"),
53
+ ] = "SKY_DEPOSIT"
54
+
51
55
  receiver: OptionalNullable[str] = UNSET
52
56
  r"""The address which will receive the sUSDS. Defaults to the sender."""
53
57
 
@@ -59,17 +63,9 @@ class SkyDepositRequest(BaseModel):
59
63
  pydantic.Field(alias="chain"),
60
64
  ] = "ethereum:mainnet"
61
65
 
62
- @property
63
- def additional_properties(self):
64
- return self.__pydantic_extra__
65
-
66
- @additional_properties.setter
67
- def additional_properties(self, value):
68
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
69
-
70
66
  @model_serializer(mode="wrap")
71
67
  def serialize_model(self, handler):
72
- optional_fields = ["receiver", "chain"]
68
+ optional_fields = ["action_type", "receiver", "chain"]
73
69
  nullable_fields = ["receiver"]
74
70
  null_default_fields = []
75
71
 
@@ -95,7 +91,4 @@ class SkyDepositRequest(BaseModel):
95
91
  ):
96
92
  m[k] = val
97
93
 
98
- for k, v in serialized.items():
99
- m[k] = v
100
-
101
94
  return m
@@ -2,11 +2,12 @@
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
  from enum import Enum
6
7
  import pydantic
7
- from pydantic import ConfigDict
8
- from typing import Any, Dict, Union
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
  class SkySellParamsTokenOut(str, Enum):
@@ -31,24 +32,19 @@ class SkySellParamsTypedDict(TypedDict):
31
32
  r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
32
33
  amount: SkySellParamsAmountTypedDict
33
34
  r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
35
+ action_type: Literal["SKY_SELL"]
34
36
 
35
37
 
36
38
  class SkySellParams(BaseModel):
37
- model_config = ConfigDict(
38
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
39
- )
40
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
41
-
42
39
  token_out: SkySellParamsTokenOut
43
40
  r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
44
41
 
45
42
  amount: SkySellParamsAmount
46
43
  r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
47
44
 
48
- @property
49
- def additional_properties(self):
50
- return self.__pydantic_extra__
51
-
52
- @additional_properties.setter
53
- def additional_properties(self, value):
54
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
45
+ ACTION_TYPE: Annotated[
46
+ Annotated[
47
+ Optional[Literal["SKY_SELL"]], AfterValidator(validate_const("SKY_SELL"))
48
+ ],
49
+ pydantic.Field(alias="action_type"),
50
+ ] = "SKY_SELL"
@@ -5,9 +5,8 @@ from compass_api_sdk.types import BaseModel
5
5
  from compass_api_sdk.utils import validate_const
6
6
  from enum import Enum
7
7
  import pydantic
8
- from pydantic import ConfigDict
9
8
  from pydantic.functional_validators import AfterValidator
10
- from typing import Any, Dict, Literal, Optional, Union
9
+ from typing import Literal, Optional, Union
11
10
  from typing_extensions import Annotated, TypeAliasType, TypedDict
12
11
 
13
12
 
@@ -35,15 +34,11 @@ class SkySellRequestTypedDict(TypedDict):
35
34
  r"""The amount of USDS you would like to sell 1:1 for 'token_out'."""
36
35
  sender: str
37
36
  r"""The address of the transaction sender."""
37
+ action_type: Literal["SKY_SELL"]
38
38
  chain: Literal["ethereum:mainnet"]
39
39
 
40
40
 
41
41
  class SkySellRequest(BaseModel):
42
- model_config = ConfigDict(
43
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
44
- )
45
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
46
-
47
42
  token_out: SkySellRequestTokenOut
48
43
  r"""The token you would like to swap 1:1 with USDS. Choose from DAI or USDC."""
49
44
 
@@ -53,6 +48,13 @@ class SkySellRequest(BaseModel):
53
48
  sender: str
54
49
  r"""The address of the transaction sender."""
55
50
 
51
+ ACTION_TYPE: Annotated[
52
+ Annotated[
53
+ Optional[Literal["SKY_SELL"]], AfterValidator(validate_const("SKY_SELL"))
54
+ ],
55
+ pydantic.Field(alias="action_type"),
56
+ ] = "SKY_SELL"
57
+
56
58
  CHAIN: Annotated[
57
59
  Annotated[
58
60
  Optional[Literal["ethereum:mainnet"]],
@@ -60,11 +62,3 @@ class SkySellRequest(BaseModel):
60
62
  ],
61
63
  pydantic.Field(alias="chain"),
62
64
  ] = "ethereum:mainnet"
63
-
64
- @property
65
- def additional_properties(self):
66
- return self.__pydantic_extra__
67
-
68
- @additional_properties.setter
69
- def additional_properties(self, value):
70
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -8,42 +8,40 @@ from compass_api_sdk.types import (
8
8
  UNSET,
9
9
  UNSET_SENTINEL,
10
10
  )
11
+ from compass_api_sdk.utils import validate_const
11
12
  import pydantic
12
- from pydantic import ConfigDict, model_serializer
13
- from typing import Any, Dict
14
- from typing_extensions import NotRequired, TypedDict
13
+ from pydantic import model_serializer
14
+ from pydantic.functional_validators import AfterValidator
15
+ from typing import Any, Literal, Optional
16
+ from typing_extensions import Annotated, NotRequired, TypedDict
15
17
 
16
18
 
17
19
  class SkyWithdrawParamsTypedDict(TypedDict):
18
20
  amount: Any
19
21
  r"""The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn."""
22
+ action_type: Literal["SKY_WITHDRAW"]
20
23
  receiver: NotRequired[Nullable[str]]
21
24
  r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
22
25
 
23
26
 
24
27
  class SkyWithdrawParams(BaseModel):
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
28
  amount: Any
31
29
  r"""The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn."""
32
30
 
31
+ ACTION_TYPE: Annotated[
32
+ Annotated[
33
+ Optional[Literal["SKY_WITHDRAW"]],
34
+ AfterValidator(validate_const("SKY_WITHDRAW")),
35
+ ],
36
+ pydantic.Field(alias="action_type"),
37
+ ] = "SKY_WITHDRAW"
38
+
33
39
  receiver: OptionalNullable[str] = UNSET
34
40
  r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
35
41
 
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]
43
-
44
42
  @model_serializer(mode="wrap")
45
43
  def serialize_model(self, handler):
46
- optional_fields = ["receiver"]
44
+ optional_fields = ["action_type", "receiver"]
47
45
  nullable_fields = ["receiver"]
48
46
  null_default_fields = []
49
47
 
@@ -69,7 +67,4 @@ class SkyWithdrawParams(BaseModel):
69
67
  ):
70
68
  m[k] = val
71
69
 
72
- for k, v in serialized.items():
73
- m[k] = v
74
-
75
70
  return m
@@ -10,9 +10,9 @@ from compass_api_sdk.types import (
10
10
  )
11
11
  from compass_api_sdk.utils import validate_const
12
12
  import pydantic
13
- from pydantic import ConfigDict, model_serializer
13
+ from pydantic import model_serializer
14
14
  from pydantic.functional_validators import AfterValidator
15
- from typing import Any, Dict, Literal, Optional
15
+ from typing import Any, Literal, Optional
16
16
  from typing_extensions import Annotated, NotRequired, TypedDict
17
17
 
18
18
 
@@ -21,23 +21,27 @@ class SkyWithdrawRequestTypedDict(TypedDict):
21
21
  r"""The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn."""
22
22
  sender: str
23
23
  r"""The address of the transaction sender."""
24
+ action_type: Literal["SKY_WITHDRAW"]
24
25
  receiver: NotRequired[Nullable[str]]
25
26
  r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
26
27
  chain: Literal["ethereum:mainnet"]
27
28
 
28
29
 
29
30
  class SkyWithdrawRequest(BaseModel):
30
- model_config = ConfigDict(
31
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
32
- )
33
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
34
-
35
31
  amount: Any
36
32
  r"""The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn."""
37
33
 
38
34
  sender: str
39
35
  r"""The address of the transaction sender."""
40
36
 
37
+ ACTION_TYPE: Annotated[
38
+ Annotated[
39
+ Optional[Literal["SKY_WITHDRAW"]],
40
+ AfterValidator(validate_const("SKY_WITHDRAW")),
41
+ ],
42
+ pydantic.Field(alias="action_type"),
43
+ ] = "SKY_WITHDRAW"
44
+
41
45
  receiver: OptionalNullable[str] = UNSET
42
46
  r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
43
47
 
@@ -49,17 +53,9 @@ class SkyWithdrawRequest(BaseModel):
49
53
  pydantic.Field(alias="chain"),
50
54
  ] = "ethereum:mainnet"
51
55
 
52
- @property
53
- def additional_properties(self):
54
- return self.__pydantic_extra__
55
-
56
- @additional_properties.setter
57
- def additional_properties(self, value):
58
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
59
-
60
56
  @model_serializer(mode="wrap")
61
57
  def serialize_model(self, handler):
62
- optional_fields = ["receiver", "chain"]
58
+ optional_fields = ["action_type", "receiver", "chain"]
63
59
  nullable_fields = ["receiver"]
64
60
  null_default_fields = []
65
61
 
@@ -85,7 +81,4 @@ class SkyWithdrawRequest(BaseModel):
85
81
  ):
86
82
  m[k] = val
87
83
 
88
- for k, v in serialized.items():
89
- m[k] = v
90
-
91
84
  return m
@@ -3,10 +3,11 @@
3
3
  from __future__ import annotations
4
4
  from .token_enum import TokenEnum
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 ConfigDict
8
- from typing import Any, Dict, Union
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
  TokenTransferErc20ParamsAmountTypedDict = TypeAliasType(
@@ -34,16 +35,12 @@ class TokenTransferErc20ParamsTypedDict(TypedDict):
34
35
  """
35
36
  to: str
36
37
  r"""The recipient of the tokens."""
38
+ action_type: Literal["TOKEN_TRANSFER_ERC20"]
37
39
 
38
40
 
39
41
  class TokenTransferErc20Params(BaseModel):
40
42
  r"""Parameters model for transferring ERC20 tokens."""
41
43
 
42
- model_config = ConfigDict(
43
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
44
- )
45
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
46
-
47
44
  amount: TokenTransferErc20ParamsAmount
48
45
  r"""Amount of token to transfer"""
49
46
 
@@ -57,10 +54,10 @@ class TokenTransferErc20Params(BaseModel):
57
54
  to: str
58
55
  r"""The recipient of the tokens."""
59
56
 
60
- @property
61
- def additional_properties(self):
62
- return self.__pydantic_extra__
63
-
64
- @additional_properties.setter
65
- def additional_properties(self, value):
66
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
57
+ ACTION_TYPE: Annotated[
58
+ Annotated[
59
+ Optional[Literal["TOKEN_TRANSFER_ERC20"]],
60
+ AfterValidator(validate_const("TOKEN_TRANSFER_ERC20")),
61
+ ],
62
+ pydantic.Field(alias="action_type"),
63
+ ] = "TOKEN_TRANSFER_ERC20"
@@ -4,10 +4,11 @@ from __future__ import annotations
4
4
  from .chain import Chain
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 ConfigDict
9
- from typing import Any, Dict, Union
10
- from typing_extensions import TypeAliasType, TypedDict
9
+ from pydantic.functional_validators import AfterValidator
10
+ from typing import Literal, Optional, Union
11
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
11
12
 
12
13
 
13
14
  TokenTransferRequestAmountTypedDict = TypeAliasType(
@@ -47,16 +48,12 @@ class TokenTransferRequestTypedDict(TypedDict):
47
48
  r"""The chain to use."""
48
49
  sender: str
49
50
  r"""The address of the transaction sender."""
51
+ action_type: Literal["TOKEN_TRANSFER"]
50
52
 
51
53
 
52
54
  class TokenTransferRequest(BaseModel):
53
55
  r"""Request model for transferring ETH or ERC20 tokens."""
54
56
 
55
- model_config = ConfigDict(
56
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
57
- )
58
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
59
-
60
57
  amount: TokenTransferRequestAmount
61
58
  r"""Amount of token to transfer"""
62
59
 
@@ -72,10 +69,10 @@ class TokenTransferRequest(BaseModel):
72
69
  sender: str
73
70
  r"""The address of the transaction sender."""
74
71
 
75
- @property
76
- def additional_properties(self):
77
- return self.__pydantic_extra__
78
-
79
- @additional_properties.setter
80
- def additional_properties(self, value):
81
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
72
+ ACTION_TYPE: Annotated[
73
+ Annotated[
74
+ Optional[Literal["TOKEN_TRANSFER"]],
75
+ AfterValidator(validate_const("TOKEN_TRANSFER")),
76
+ ],
77
+ pydantic.Field(alias="action_type"),
78
+ ] = "TOKEN_TRANSFER"
@@ -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 ConfigDict
9
- from typing import Any, Dict, Optional, Union
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
  UniswapBuyExactlyParamsAmountTypedDict = TypeAliasType(
@@ -44,16 +45,12 @@ class UniswapBuyExactlyParamsTypedDict(TypedDict):
44
45
  r"""The amount of the token to swap to"""
45
46
  max_slippage_percent: float
46
47
  r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
48
+ action_type: Literal["UNISWAP_BUY_EXACTLY"]
47
49
  wrap_eth: NotRequired[bool]
48
50
  r"""Whether to wrap ETH to WETH, only use when swapping WETH into something"""
49
51
 
50
52
 
51
53
  class UniswapBuyExactlyParams(BaseModel):
52
- model_config = ConfigDict(
53
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
54
- )
55
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
56
-
57
54
  token_in: TokenEnum
58
55
  r"""A class representing the token.
59
56
 
@@ -80,13 +77,13 @@ class UniswapBuyExactlyParams(BaseModel):
80
77
  max_slippage_percent: float
81
78
  r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
82
79
 
80
+ ACTION_TYPE: Annotated[
81
+ Annotated[
82
+ Optional[Literal["UNISWAP_BUY_EXACTLY"]],
83
+ AfterValidator(validate_const("UNISWAP_BUY_EXACTLY")),
84
+ ],
85
+ pydantic.Field(alias="action_type"),
86
+ ] = "UNISWAP_BUY_EXACTLY"
87
+
83
88
  wrap_eth: Optional[bool] = False
84
89
  r"""Whether to wrap ETH to WETH, only use when swapping WETH into something"""
85
-
86
- @property
87
- def additional_properties(self):
88
- return self.__pydantic_extra__
89
-
90
- @additional_properties.setter
91
- def additional_properties(self, value):
92
- 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 ConfigDict
10
- from typing import Any, Dict, Optional, Union
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
  UniswapBuyExactlyRequestAmountTypedDict = TypeAliasType(
@@ -51,6 +52,7 @@ class UniswapBuyExactlyRequestTypedDict(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_BUY_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 UniswapBuyExactlyRequestTypedDict(TypedDict):
58
60
  class UniswapBuyExactlyRequest(BaseModel):
59
61
  r"""Request model for buying an exact 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 UniswapBuyExactlyRequest(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_BUY_EXACTLY"]],
98
+ AfterValidator(validate_const("UNISWAP_BUY_EXACTLY")),
99
+ ],
100
+ pydantic.Field(alias="action_type"),
101
+ ] = "UNISWAP_BUY_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 ConfigDict
7
- from typing import Any, Dict, Union
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
  UniswapIncreaseLiquidityProvisionParamsAmount0DesiredTypedDict = TypeAliasType(
@@ -67,14 +68,10 @@ class UniswapIncreaseLiquidityProvisionParamsTypedDict(TypedDict):
67
68
  r"""The minimum amount of the first token to deposit"""
68
69
  amount1_min: UniswapIncreaseLiquidityProvisionParamsAmount1MinTypedDict
69
70
  r"""The minimum amount of the second token to deposit"""
71
+ action_type: Literal["UNISWAP_INCREASE_LIQUIDITY_PROVISION"]
70
72
 
71
73
 
72
74
  class UniswapIncreaseLiquidityProvisionParams(BaseModel):
73
- model_config = ConfigDict(
74
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
75
- )
76
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
77
-
78
75
  token_id: int
79
76
  r"""Token ID of the NFT representing the liquidity provisioned position."""
80
77
 
@@ -90,10 +87,10 @@ class UniswapIncreaseLiquidityProvisionParams(BaseModel):
90
87
  amount1_min: UniswapIncreaseLiquidityProvisionParamsAmount1Min
91
88
  r"""The minimum amount of the second token to deposit"""
92
89
 
93
- @property
94
- def additional_properties(self):
95
- return self.__pydantic_extra__
96
-
97
- @additional_properties.setter
98
- def additional_properties(self, value):
99
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
90
+ ACTION_TYPE: Annotated[
91
+ Annotated[
92
+ Optional[Literal["UNISWAP_INCREASE_LIQUIDITY_PROVISION"]],
93
+ AfterValidator(validate_const("UNISWAP_INCREASE_LIQUIDITY_PROVISION")),
94
+ ],
95
+ pydantic.Field(alias="action_type"),
96
+ ] = "UNISWAP_INCREASE_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 ConfigDict
8
- from typing import Any, Dict, Union
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
  UniswapIncreaseLiquidityProvisionRequestAmount0DesiredTypedDict = TypeAliasType(
@@ -74,16 +75,12 @@ class UniswapIncreaseLiquidityProvisionRequestTypedDict(TypedDict):
74
75
  r"""The chain to use."""
75
76
  sender: str
76
77
  r"""The address of the transaction sender."""
78
+ action_type: Literal["UNISWAP_INCREASE_LIQUIDITY_PROVISION"]
77
79
 
78
80
 
79
81
  class UniswapIncreaseLiquidityProvisionRequest(BaseModel):
80
82
  r"""Request model for increasing liquidity provision in Uniswap V3."""
81
83
 
82
- model_config = ConfigDict(
83
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
84
- )
85
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
86
-
87
84
  token_id: int
88
85
  r"""Token ID of the NFT representing the liquidity provisioned position."""
89
86
 
@@ -105,10 +102,10 @@ class UniswapIncreaseLiquidityProvisionRequest(BaseModel):
105
102
  sender: str
106
103
  r"""The address of the transaction sender."""
107
104
 
108
- @property
109
- def additional_properties(self):
110
- return self.__pydantic_extra__
111
-
112
- @additional_properties.setter
113
- def additional_properties(self, value):
114
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
105
+ ACTION_TYPE: Annotated[
106
+ Annotated[
107
+ Optional[Literal["UNISWAP_INCREASE_LIQUIDITY_PROVISION"]],
108
+ AfterValidator(validate_const("UNISWAP_INCREASE_LIQUIDITY_PROVISION")),
109
+ ],
110
+ pydantic.Field(alias="action_type"),
111
+ ] = "UNISWAP_INCREASE_LIQUIDITY_PROVISION"