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
@@ -8,11 +8,13 @@ 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
  from enum import Enum
12
13
  import pydantic
13
- from pydantic import ConfigDict, model_serializer
14
- from typing import Any, Dict
15
- from typing_extensions import NotRequired, TypedDict
14
+ from pydantic import model_serializer
15
+ from pydantic.functional_validators import AfterValidator
16
+ from typing import Any, Literal, Optional
17
+ from typing_extensions import Annotated, NotRequired, TypedDict
16
18
 
17
19
 
18
20
  class MorphoWithdrawRequestChain(str, Enum):
@@ -28,16 +30,12 @@ class MorphoWithdrawRequestTypedDict(TypedDict):
28
30
  chain: MorphoWithdrawRequestChain
29
31
  sender: str
30
32
  r"""The address of the transaction sender."""
33
+ action_type: Literal["MORPHO_WITHDRAW"]
31
34
  receiver: NotRequired[Nullable[str]]
32
35
  r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
33
36
 
34
37
 
35
38
  class MorphoWithdrawRequest(BaseModel):
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
39
  vault_address: str
42
40
  r"""The vault address you are withdrawing from."""
43
41
 
@@ -49,20 +47,20 @@ class MorphoWithdrawRequest(BaseModel):
49
47
  sender: str
50
48
  r"""The address of the transaction sender."""
51
49
 
50
+ ACTION_TYPE: Annotated[
51
+ Annotated[
52
+ Optional[Literal["MORPHO_WITHDRAW"]],
53
+ AfterValidator(validate_const("MORPHO_WITHDRAW")),
54
+ ],
55
+ pydantic.Field(alias="action_type"),
56
+ ] = "MORPHO_WITHDRAW"
57
+
52
58
  receiver: OptionalNullable[str] = UNSET
53
59
  r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
54
60
 
55
- @property
56
- def additional_properties(self):
57
- return self.__pydantic_extra__
58
-
59
- @additional_properties.setter
60
- def additional_properties(self, value):
61
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
62
-
63
61
  @model_serializer(mode="wrap")
64
62
  def serialize_model(self, handler):
65
- optional_fields = ["receiver"]
63
+ optional_fields = ["action_type", "receiver"]
66
64
  nullable_fields = ["receiver"]
67
65
  null_default_fields = []
68
66
 
@@ -88,7 +86,4 @@ class MorphoWithdrawRequest(BaseModel):
88
86
  ):
89
87
  m[k] = val
90
88
 
91
- for k, v in serialized.items():
92
- m[k] = v
93
-
94
89
  return m
@@ -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
  PendleBuyPtParamsAmountTypedDict = TypeAliasType(
@@ -23,24 +24,20 @@ class PendleBuyPtParamsTypedDict(TypedDict):
23
24
  r"""The address of the market identifying which Principal Token (PT) you would like to buy."""
24
25
  amount: PendleBuyPtParamsAmountTypedDict
25
26
  r"""The amount of market's Underlying Token you would like to sell for market's Principal Token (PT)."""
27
+ action_type: Literal["PENDLE_BUY_PT"]
26
28
 
27
29
 
28
30
  class PendleBuyPtParams(BaseModel):
29
- model_config = ConfigDict(
30
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
31
- )
32
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
33
-
34
31
  market_address: str
35
32
  r"""The address of the market identifying which Principal Token (PT) you would like to buy."""
36
33
 
37
34
  amount: PendleBuyPtParamsAmount
38
35
  r"""The amount of market's Underlying Token you would like to sell for market's Principal Token (PT)."""
39
36
 
40
- @property
41
- def additional_properties(self):
42
- return self.__pydantic_extra__
43
-
44
- @additional_properties.setter
45
- def additional_properties(self, value):
46
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
37
+ ACTION_TYPE: Annotated[
38
+ Annotated[
39
+ Optional[Literal["PENDLE_BUY_PT"]],
40
+ AfterValidator(validate_const("PENDLE_BUY_PT")),
41
+ ],
42
+ pydantic.Field(alias="action_type"),
43
+ ] = "PENDLE_BUY_PT"
@@ -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
  PendleBuyPtRequestAmountTypedDict = TypeAliasType(
@@ -28,14 +29,10 @@ class PendleBuyPtRequestTypedDict(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["PENDLE_BUY_PT"]
31
33
 
32
34
 
33
35
  class PendleBuyPtRequest(BaseModel):
34
- model_config = ConfigDict(
35
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
36
- )
37
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
38
-
39
36
  market_address: str
40
37
  r"""The address of the market identifying which Principal Token (PT) you would like to buy."""
41
38
 
@@ -48,10 +45,10 @@ class PendleBuyPtRequest(BaseModel):
48
45
  sender: str
49
46
  r"""The address of the transaction sender."""
50
47
 
51
- @property
52
- def additional_properties(self):
53
- return self.__pydantic_extra__
54
-
55
- @additional_properties.setter
56
- def additional_properties(self, value):
57
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
48
+ ACTION_TYPE: Annotated[
49
+ Annotated[
50
+ Optional[Literal["PENDLE_BUY_PT"]],
51
+ AfterValidator(validate_const("PENDLE_BUY_PT")),
52
+ ],
53
+ pydantic.Field(alias="action_type"),
54
+ ] = "PENDLE_BUY_PT"
@@ -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
  PendleBuyYtParamsAmountTypedDict = TypeAliasType(
@@ -23,24 +24,20 @@ class PendleBuyYtParamsTypedDict(TypedDict):
23
24
  r"""The address of the market identifying which Yield Token (YT) you would like to buy."""
24
25
  amount: PendleBuyYtParamsAmountTypedDict
25
26
  r"""The amount of market's Underlying Token you would like to sell for market's Yield Token (YT)."""
27
+ action_type: Literal["PENDLE_BUY_YT"]
26
28
 
27
29
 
28
30
  class PendleBuyYtParams(BaseModel):
29
- model_config = ConfigDict(
30
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
31
- )
32
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
33
-
34
31
  market_address: str
35
32
  r"""The address of the market identifying which Yield Token (YT) you would like to buy."""
36
33
 
37
34
  amount: PendleBuyYtParamsAmount
38
35
  r"""The amount of market's Underlying Token you would like to sell for market's Yield Token (YT)."""
39
36
 
40
- @property
41
- def additional_properties(self):
42
- return self.__pydantic_extra__
43
-
44
- @additional_properties.setter
45
- def additional_properties(self, value):
46
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
37
+ ACTION_TYPE: Annotated[
38
+ Annotated[
39
+ Optional[Literal["PENDLE_BUY_YT"]],
40
+ AfterValidator(validate_const("PENDLE_BUY_YT")),
41
+ ],
42
+ pydantic.Field(alias="action_type"),
43
+ ] = "PENDLE_BUY_YT"
@@ -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
  PendleBuyYtRequestAmountTypedDict = TypeAliasType(
@@ -28,14 +29,10 @@ class PendleBuyYtRequestTypedDict(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["PENDLE_BUY_YT"]
31
33
 
32
34
 
33
35
  class PendleBuyYtRequest(BaseModel):
34
- model_config = ConfigDict(
35
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
36
- )
37
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
38
-
39
36
  market_address: str
40
37
  r"""The address of the market identifying which Yield Token (YT) you would like to buy."""
41
38
 
@@ -48,10 +45,10 @@ class PendleBuyYtRequest(BaseModel):
48
45
  sender: str
49
46
  r"""The address of the transaction sender."""
50
47
 
51
- @property
52
- def additional_properties(self):
53
- return self.__pydantic_extra__
54
-
55
- @additional_properties.setter
56
- def additional_properties(self, value):
57
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
48
+ ACTION_TYPE: Annotated[
49
+ Annotated[
50
+ Optional[Literal["PENDLE_BUY_YT"]],
51
+ AfterValidator(validate_const("PENDLE_BUY_YT")),
52
+ ],
53
+ pydantic.Field(alias="action_type"),
54
+ ] = "PENDLE_BUY_YT"
@@ -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
  PendleSellPtParamsAmountTypedDict = TypeAliasType(
@@ -23,24 +24,20 @@ class PendleSellPtParamsTypedDict(TypedDict):
23
24
  r"""The address of the market identifying which Principal Token (PT) you would like to sell."""
24
25
  amount: PendleSellPtParamsAmountTypedDict
25
26
  r"""The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token."""
27
+ action_type: Literal["PENDLE_SELL_PT"]
26
28
 
27
29
 
28
30
  class PendleSellPtParams(BaseModel):
29
- model_config = ConfigDict(
30
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
31
- )
32
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
33
-
34
31
  market_address: str
35
32
  r"""The address of the market identifying which Principal Token (PT) you would like to sell."""
36
33
 
37
34
  amount: PendleSellPtParamsAmount
38
35
  r"""The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token."""
39
36
 
40
- @property
41
- def additional_properties(self):
42
- return self.__pydantic_extra__
43
-
44
- @additional_properties.setter
45
- def additional_properties(self, value):
46
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
37
+ ACTION_TYPE: Annotated[
38
+ Annotated[
39
+ Optional[Literal["PENDLE_SELL_PT"]],
40
+ AfterValidator(validate_const("PENDLE_SELL_PT")),
41
+ ],
42
+ pydantic.Field(alias="action_type"),
43
+ ] = "PENDLE_SELL_PT"
@@ -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
  PendleSellPtRequestAmountTypedDict = TypeAliasType(
@@ -30,14 +31,10 @@ class PendleSellPtRequestTypedDict(TypedDict):
30
31
  r"""The chain to use."""
31
32
  sender: str
32
33
  r"""The address of the transaction sender."""
34
+ action_type: Literal["PENDLE_SELL_PT"]
33
35
 
34
36
 
35
37
  class PendleSellPtRequest(BaseModel):
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
  market_address: str
42
39
  r"""The address of the market identifying which Principal Token (PT) you would like to sell."""
43
40
 
@@ -50,10 +47,10 @@ class PendleSellPtRequest(BaseModel):
50
47
  sender: str
51
48
  r"""The address of the transaction sender."""
52
49
 
53
- @property
54
- def additional_properties(self):
55
- return self.__pydantic_extra__
56
-
57
- @additional_properties.setter
58
- def additional_properties(self, value):
59
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
50
+ ACTION_TYPE: Annotated[
51
+ Annotated[
52
+ Optional[Literal["PENDLE_SELL_PT"]],
53
+ AfterValidator(validate_const("PENDLE_SELL_PT")),
54
+ ],
55
+ pydantic.Field(alias="action_type"),
56
+ ] = "PENDLE_SELL_PT"
@@ -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
  PendleSellYtParamsAmountTypedDict = TypeAliasType(
@@ -23,24 +24,20 @@ class PendleSellYtParamsTypedDict(TypedDict):
23
24
  r"""The address of the market identifying which Yield Token (YT) you would like to sell."""
24
25
  amount: PendleSellYtParamsAmountTypedDict
25
26
  r"""The amount of market's Yield Token (YT) you would like to sell for market's Underlying Token."""
27
+ action_type: Literal["PENDLE_SELL_YT"]
26
28
 
27
29
 
28
30
  class PendleSellYtParams(BaseModel):
29
- model_config = ConfigDict(
30
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
31
- )
32
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
33
-
34
31
  market_address: str
35
32
  r"""The address of the market identifying which Yield Token (YT) you would like to sell."""
36
33
 
37
34
  amount: PendleSellYtParamsAmount
38
35
  r"""The amount of market's Yield Token (YT) you would like to sell for market's Underlying Token."""
39
36
 
40
- @property
41
- def additional_properties(self):
42
- return self.__pydantic_extra__
43
-
44
- @additional_properties.setter
45
- def additional_properties(self, value):
46
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
37
+ ACTION_TYPE: Annotated[
38
+ Annotated[
39
+ Optional[Literal["PENDLE_SELL_YT"]],
40
+ AfterValidator(validate_const("PENDLE_SELL_YT")),
41
+ ],
42
+ pydantic.Field(alias="action_type"),
43
+ ] = "PENDLE_SELL_YT"
@@ -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
  PendleSellYtRequestAmountTypedDict = TypeAliasType(
@@ -30,14 +31,10 @@ class PendleSellYtRequestTypedDict(TypedDict):
30
31
  r"""The chain to use."""
31
32
  sender: str
32
33
  r"""The address of the transaction sender."""
34
+ action_type: Literal["PENDLE_SELL_YT"]
33
35
 
34
36
 
35
37
  class PendleSellYtRequest(BaseModel):
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
  market_address: str
42
39
  r"""The address of the market identifying which Yield Token (YT) you would like to sell."""
43
40
 
@@ -50,10 +47,10 @@ class PendleSellYtRequest(BaseModel):
50
47
  sender: str
51
48
  r"""The address of the transaction sender."""
52
49
 
53
- @property
54
- def additional_properties(self):
55
- return self.__pydantic_extra__
56
-
57
- @additional_properties.setter
58
- def additional_properties(self, value):
59
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
50
+ ACTION_TYPE: Annotated[
51
+ Annotated[
52
+ Optional[Literal["PENDLE_SELL_YT"]],
53
+ AfterValidator(validate_const("PENDLE_SELL_YT")),
54
+ ],
55
+ pydantic.Field(alias="action_type"),
56
+ ] = "PENDLE_SELL_YT"
@@ -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 SkyBuyParamsTokenIn(str, Enum):
@@ -31,24 +32,19 @@ class SkyBuyParamsTypedDict(TypedDict):
31
32
  r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
32
33
  amount: SkyBuyParamsAmountTypedDict
33
34
  r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
35
+ action_type: Literal["SKY_BUY"]
34
36
 
35
37
 
36
38
  class SkyBuyParams(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_in: SkyBuyParamsTokenIn
43
40
  r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
44
41
 
45
42
  amount: SkyBuyParamsAmount
46
43
  r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
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_BUY"]], AfterValidator(validate_const("SKY_BUY"))
48
+ ],
49
+ pydantic.Field(alias="action_type"),
50
+ ] = "SKY_BUY"
@@ -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 SkyBuyRequestTypedDict(TypedDict):
35
34
  r"""The amount of USDS you would like to buy 1:1 with 'token_in'."""
36
35
  sender: str
37
36
  r"""The address of the transaction sender."""
37
+ action_type: Literal["SKY_BUY"]
38
38
  chain: Literal["ethereum:mainnet"]
39
39
 
40
40
 
41
41
  class SkyBuyRequest(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_in: SkyBuyRequestTokenIn
48
43
  r"""The token you would like to swap 1:1 for USDS. Choose from DAI or USDC."""
49
44
 
@@ -53,6 +48,13 @@ class SkyBuyRequest(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_BUY"]], AfterValidator(validate_const("SKY_BUY"))
54
+ ],
55
+ pydantic.Field(alias="action_type"),
56
+ ] = "SKY_BUY"
57
+
56
58
  CHAIN: Annotated[
57
59
  Annotated[
58
60
  Optional[Literal["ethereum:mainnet"]],
@@ -60,11 +62,3 @@ class SkyBuyRequest(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,10 +8,12 @@ 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, Union
14
- from typing_extensions import NotRequired, TypeAliasType, TypedDict
13
+ from pydantic import model_serializer
14
+ from pydantic.functional_validators import AfterValidator
15
+ from typing import Literal, Optional, Union
16
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
15
17
 
16
18
 
17
19
  SkyDepositParamsAmountTypedDict = TypeAliasType(
@@ -27,33 +29,29 @@ r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
27
29
  class SkyDepositParamsTypedDict(TypedDict):
28
30
  amount: SkyDepositParamsAmountTypedDict
29
31
  r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
32
+ action_type: Literal["SKY_DEPOSIT"]
30
33
  receiver: NotRequired[Nullable[str]]
31
34
  r"""The address which will receive the sUSDS. Defaults to the sender."""
32
35
 
33
36
 
34
37
  class SkyDepositParams(BaseModel):
35
- model_config = ConfigDict(
36
- populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
37
- )
38
- __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
39
-
40
38
  amount: SkyDepositParamsAmount
41
39
  r"""The amount of USDS you would like to deposit for sUSDS to earn yield."""
42
40
 
41
+ ACTION_TYPE: Annotated[
42
+ Annotated[
43
+ Optional[Literal["SKY_DEPOSIT"]],
44
+ AfterValidator(validate_const("SKY_DEPOSIT")),
45
+ ],
46
+ pydantic.Field(alias="action_type"),
47
+ ] = "SKY_DEPOSIT"
48
+
43
49
  receiver: OptionalNullable[str] = UNSET
44
50
  r"""The address which will receive the sUSDS. Defaults to the sender."""
45
51
 
46
- @property
47
- def additional_properties(self):
48
- return self.__pydantic_extra__
49
-
50
- @additional_properties.setter
51
- def additional_properties(self, value):
52
- self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
53
-
54
52
  @model_serializer(mode="wrap")
55
53
  def serialize_model(self, handler):
56
- optional_fields = ["receiver"]
54
+ optional_fields = ["action_type", "receiver"]
57
55
  nullable_fields = ["receiver"]
58
56
  null_default_fields = []
59
57
 
@@ -79,7 +77,4 @@ class SkyDepositParams(BaseModel):
79
77
  ):
80
78
  m[k] = val
81
79
 
82
- for k, v in serialized.items():
83
- m[k] = v
84
-
85
80
  return m