compass_api_sdk 1.1.3rc0__py3-none-any.whl → 1.1.3rc1__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 (60) hide show
  1. compass_api_sdk/_version.py +2 -2
  2. compass_api_sdk/aave_v3.py +24 -0
  3. compass_api_sdk/aerodrome_slipstream.py +30 -0
  4. compass_api_sdk/erc_4626_vaults.py +12 -0
  5. compass_api_sdk/ethena.py +18 -0
  6. compass_api_sdk/models/aaveborrowrequest.py +6 -1
  7. compass_api_sdk/models/aavelooprequest.py +10 -1
  8. compass_api_sdk/models/aaverepayrequest.py +6 -1
  9. compass_api_sdk/models/aavesupplyrequest.py +6 -1
  10. compass_api_sdk/models/aavewithdrawrequest.py +6 -1
  11. compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +6 -1
  12. compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +6 -1
  13. compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +6 -1
  14. compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +5 -0
  15. compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +6 -1
  16. compass_api_sdk/models/batcheduseroperationsrequest.py +7 -2
  17. compass_api_sdk/models/ethenadepositrequest.py +6 -1
  18. compass_api_sdk/models/ethenarequesttowithdrawrequest.py +6 -1
  19. compass_api_sdk/models/ethenaunstakerequest.py +6 -1
  20. compass_api_sdk/models/morphoborrowrequest.py +6 -1
  21. compass_api_sdk/models/morphodepositrequest.py +6 -1
  22. compass_api_sdk/models/morphorepayrequest.py +11 -1
  23. compass_api_sdk/models/morphosupplycollateralrequest.py +11 -1
  24. compass_api_sdk/models/morphowithdrawcollateralrequest.py +6 -1
  25. compass_api_sdk/models/morphowithdrawrequest.py +6 -1
  26. compass_api_sdk/models/multicallexecuterequest.py +7 -2
  27. compass_api_sdk/models/odosswaprequest.py +6 -1
  28. compass_api_sdk/models/pendlemanageliquidityrequest.py +6 -1
  29. compass_api_sdk/models/pendleredeemyieldrequest.py +6 -1
  30. compass_api_sdk/models/pendletradeptrequest.py +6 -1
  31. compass_api_sdk/models/pendletradeytrequest.py +6 -1
  32. compass_api_sdk/models/setallowancerequest.py +6 -1
  33. compass_api_sdk/models/skybuyrequest.py +6 -1
  34. compass_api_sdk/models/skydepositrequest.py +6 -1
  35. compass_api_sdk/models/skysellrequest.py +6 -1
  36. compass_api_sdk/models/skywithdrawrequest.py +6 -1
  37. compass_api_sdk/models/tokentransferrequest.py +6 -1
  38. compass_api_sdk/models/uniswapbuyexactlyrequest.py +6 -1
  39. compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +6 -1
  40. compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +6 -1
  41. compass_api_sdk/models/uniswapsellexactlyrequest.py +6 -1
  42. compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +6 -1
  43. compass_api_sdk/models/unsignedmulticalltransaction.py +34 -3
  44. compass_api_sdk/models/unsignedtransaction.py +34 -3
  45. compass_api_sdk/models/unwrapwethrequest.py +6 -1
  46. compass_api_sdk/models/vaultdepositrequest.py +6 -1
  47. compass_api_sdk/models/vaultwithdrawrequest.py +6 -1
  48. compass_api_sdk/models/wrapethrequest.py +6 -1
  49. compass_api_sdk/morpho.py +36 -0
  50. compass_api_sdk/pendle.py +24 -0
  51. compass_api_sdk/sky.py +24 -0
  52. compass_api_sdk/smart_account.py +6 -0
  53. compass_api_sdk/swap.py +6 -0
  54. compass_api_sdk/token.py +6 -0
  55. compass_api_sdk/transaction_bundler.py +12 -0
  56. compass_api_sdk/uniswap_v3.py +30 -0
  57. compass_api_sdk/universal.py +18 -0
  58. {compass_api_sdk-1.1.3rc0.dist-info → compass_api_sdk-1.1.3rc1.dist-info}/METADATA +1 -1
  59. {compass_api_sdk-1.1.3rc0.dist-info → compass_api_sdk-1.1.3rc1.dist-info}/RECORD +60 -60
  60. {compass_api_sdk-1.1.3rc0.dist-info → compass_api_sdk-1.1.3rc1.dist-info}/WHEEL +0 -0
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  class PendleTradeYtRequestAction(str, Enum):
@@ -50,6 +50,8 @@ class PendleTradeYtRequestTypedDict(TypedDict):
50
50
  sender: str
51
51
  r"""The address of the transaction sender."""
52
52
  action_type: Literal["PENDLE_TRADE_YT"]
53
+ estimate_gas: NotRequired[bool]
54
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
53
55
 
54
56
 
55
57
  class PendleTradeYtRequest(BaseModel):
@@ -80,3 +82,6 @@ class PendleTradeYtRequest(BaseModel):
80
82
  ],
81
83
  pydantic.Field(alias="action_type"),
82
84
  ] = "PENDLE_TRADE_YT"
85
+
86
+ estimate_gas: Optional[bool] = True
87
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  class SetAllowanceRequestContractEnum(str, Enum):
@@ -72,6 +72,8 @@ class SetAllowanceRequestTypedDict(TypedDict):
72
72
  sender: str
73
73
  r"""The address of the transaction sender."""
74
74
  action_type: Literal["SET_ALLOWANCE"]
75
+ estimate_gas: NotRequired[bool]
76
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
75
77
 
76
78
 
77
79
  class SetAllowanceRequest(BaseModel):
@@ -98,3 +100,6 @@ class SetAllowanceRequest(BaseModel):
98
100
  ],
99
101
  pydantic.Field(alias="action_type"),
100
102
  ] = "SET_ALLOWANCE"
103
+
104
+ estimate_gas: Optional[bool] = True
105
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  class SkyBuyRequestTokenIn(str, Enum):
@@ -40,6 +40,8 @@ class SkyBuyRequestTypedDict(TypedDict):
40
40
  sender: str
41
41
  r"""The address of the transaction sender."""
42
42
  action_type: Literal["SKY_BUY"]
43
+ estimate_gas: NotRequired[bool]
44
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
43
45
 
44
46
 
45
47
  class SkyBuyRequest(BaseModel):
@@ -60,3 +62,6 @@ class SkyBuyRequest(BaseModel):
60
62
  ],
61
63
  pydantic.Field(alias="action_type"),
62
64
  ] = "SKY_BUY"
65
+
66
+ estimate_gas: Optional[bool] = True
67
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -40,6 +40,8 @@ class SkyDepositRequestTypedDict(TypedDict):
40
40
  receiver: NotRequired[Nullable[str]]
41
41
  r"""The address which will receive the sUSDS. Defaults to the sender."""
42
42
  chain: NotRequired[SkyDepositRequestChain]
43
+ estimate_gas: NotRequired[bool]
44
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
43
45
 
44
46
 
45
47
  class SkyDepositRequest(BaseModel):
@@ -62,9 +64,12 @@ class SkyDepositRequest(BaseModel):
62
64
 
63
65
  chain: Optional[SkyDepositRequestChain] = SkyDepositRequestChain.ETHEREUM
64
66
 
67
+ estimate_gas: Optional[bool] = True
68
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
69
+
65
70
  @model_serializer(mode="wrap")
66
71
  def serialize_model(self, handler):
67
- optional_fields = ["action_type", "receiver", "chain"]
72
+ optional_fields = ["action_type", "receiver", "chain", "estimate_gas"]
68
73
  nullable_fields = ["receiver"]
69
74
  null_default_fields = []
70
75
 
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  class SkySellRequestTokenOut(str, Enum):
@@ -40,6 +40,8 @@ class SkySellRequestTypedDict(TypedDict):
40
40
  sender: str
41
41
  r"""The address of the transaction sender."""
42
42
  action_type: Literal["SKY_SELL"]
43
+ estimate_gas: NotRequired[bool]
44
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
43
45
 
44
46
 
45
47
  class SkySellRequest(BaseModel):
@@ -60,3 +62,6 @@ class SkySellRequest(BaseModel):
60
62
  ],
61
63
  pydantic.Field(alias="action_type"),
62
64
  ] = "SKY_SELL"
65
+
66
+ estimate_gas: Optional[bool] = True
67
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -30,6 +30,8 @@ class SkyWithdrawRequestTypedDict(TypedDict):
30
30
  receiver: NotRequired[Nullable[str]]
31
31
  r"""The address which will receive the withdrawn USDS. Defaults to the sender."""
32
32
  chain: NotRequired[SkyWithdrawRequestChain]
33
+ estimate_gas: NotRequired[bool]
34
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
33
35
 
34
36
 
35
37
  class SkyWithdrawRequest(BaseModel):
@@ -52,9 +54,12 @@ class SkyWithdrawRequest(BaseModel):
52
54
 
53
55
  chain: Optional[SkyWithdrawRequestChain] = SkyWithdrawRequestChain.ETHEREUM
54
56
 
57
+ estimate_gas: Optional[bool] = True
58
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
59
+
55
60
  @model_serializer(mode="wrap")
56
61
  def serialize_model(self, handler):
57
- optional_fields = ["action_type", "receiver", "chain"]
62
+ optional_fields = ["action_type", "receiver", "chain", "estimate_gas"]
58
63
  nullable_fields = ["receiver"]
59
64
  null_default_fields = []
60
65
 
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  TokenTransferRequestAmountTypedDict = TypeAliasType(
@@ -41,6 +41,8 @@ class TokenTransferRequestTypedDict(TypedDict):
41
41
  sender: str
42
42
  r"""The address of the transaction sender."""
43
43
  action_type: Literal["TOKEN_TRANSFER"]
44
+ estimate_gas: NotRequired[bool]
45
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
44
46
 
45
47
 
46
48
  class TokenTransferRequest(BaseModel):
@@ -67,3 +69,6 @@ class TokenTransferRequest(BaseModel):
67
69
  ],
68
70
  pydantic.Field(alias="action_type"),
69
71
  ] = "TOKEN_TRANSFER"
72
+
73
+ estimate_gas: Optional[bool] = True
74
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -8,7 +8,7 @@ from enum import Enum
8
8
  import pydantic
9
9
  from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional, Union
11
- from typing_extensions import Annotated, TypeAliasType, TypedDict
11
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
12
12
 
13
13
 
14
14
  UniswapBuyExactlyRequestAmountOutTypedDict = TypeAliasType(
@@ -49,6 +49,8 @@ class UniswapBuyExactlyRequestTypedDict(TypedDict):
49
49
  sender: str
50
50
  r"""The address of the transaction sender."""
51
51
  action_type: Literal["UNISWAP_BUY_EXACTLY"]
52
+ estimate_gas: NotRequired[bool]
53
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
52
54
 
53
55
 
54
56
  class UniswapBuyExactlyRequest(BaseModel):
@@ -84,3 +86,6 @@ class UniswapBuyExactlyRequest(BaseModel):
84
86
  ],
85
87
  pydantic.Field(alias="action_type"),
86
88
  ] = "UNISWAP_BUY_EXACTLY"
89
+
90
+ estimate_gas: Optional[bool] = True
91
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  UniswapIncreaseLiquidityProvisionRequestAmount0DesiredTypedDict = TypeAliasType(
@@ -81,6 +81,8 @@ class UniswapIncreaseLiquidityProvisionRequestTypedDict(TypedDict):
81
81
  sender: str
82
82
  r"""The address of the transaction sender."""
83
83
  action_type: Literal["UNISWAP_ADD_LIQUIDITY"]
84
+ estimate_gas: NotRequired[bool]
85
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
84
86
 
85
87
 
86
88
  class UniswapIncreaseLiquidityProvisionRequest(BaseModel):
@@ -113,3 +115,6 @@ class UniswapIncreaseLiquidityProvisionRequest(BaseModel):
113
115
  ],
114
116
  pydantic.Field(alias="action_type"),
115
117
  ] = "UNISWAP_ADD_LIQUIDITY"
118
+
119
+ estimate_gas: Optional[bool] = True
120
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -102,6 +102,8 @@ class UniswapMintLiquidityProvisionRequestTypedDict(TypedDict):
102
102
  action_type: Literal["UNISWAP_MINT_LIQUIDITY_PROVISION"]
103
103
  recipient: NotRequired[Nullable[str]]
104
104
  r"""The address that will receive the LP tokens"""
105
+ estimate_gas: NotRequired[bool]
106
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
105
107
 
106
108
 
107
109
  class UniswapMintLiquidityProvisionRequest(BaseModel):
@@ -153,9 +155,12 @@ class UniswapMintLiquidityProvisionRequest(BaseModel):
153
155
  recipient: OptionalNullable[str] = UNSET
154
156
  r"""The address that will receive the LP tokens"""
155
157
 
158
+ estimate_gas: Optional[bool] = True
159
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
160
+
156
161
  @model_serializer(mode="wrap")
157
162
  def serialize_model(self, handler):
158
- optional_fields = ["action_type", "recipient"]
163
+ optional_fields = ["action_type", "recipient", "estimate_gas"]
159
164
  nullable_fields = ["recipient"]
160
165
  null_default_fields = []
161
166
 
@@ -8,7 +8,7 @@ from enum import Enum
8
8
  import pydantic
9
9
  from pydantic.functional_validators import AfterValidator
10
10
  from typing import Literal, Optional, Union
11
- from typing_extensions import Annotated, TypeAliasType, TypedDict
11
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
12
12
 
13
13
 
14
14
  UniswapSellExactlyRequestAmountInTypedDict = TypeAliasType(
@@ -49,6 +49,8 @@ class UniswapSellExactlyRequestTypedDict(TypedDict):
49
49
  sender: str
50
50
  r"""The address of the transaction sender."""
51
51
  action_type: Literal["UNISWAP_SELL_EXACTLY"]
52
+ estimate_gas: NotRequired[bool]
53
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
52
54
 
53
55
 
54
56
  class UniswapSellExactlyRequest(BaseModel):
@@ -84,3 +86,6 @@ class UniswapSellExactlyRequest(BaseModel):
84
86
  ],
85
87
  pydantic.Field(alias="action_type"),
86
88
  ] = "UNISWAP_SELL_EXACTLY"
89
+
90
+ estimate_gas: Optional[bool] = True
91
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  UniswapWithdrawLiquidityProvisionRequestPercentageForWithdrawalTypedDict = (
@@ -42,6 +42,8 @@ class UniswapWithdrawLiquidityProvisionRequestTypedDict(TypedDict):
42
42
  sender: str
43
43
  r"""The address of the transaction sender."""
44
44
  action_type: Literal["UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"]
45
+ estimate_gas: NotRequired[bool]
46
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
45
47
 
46
48
 
47
49
  class UniswapWithdrawLiquidityProvisionRequest(BaseModel):
@@ -65,3 +67,6 @@ class UniswapWithdrawLiquidityProvisionRequest(BaseModel):
65
67
  ],
66
68
  pydantic.Field(alias="action_type"),
67
69
  ] = "UNISWAP_WITHDRAW_LIQUIDITY_PROVISION"
70
+
71
+ estimate_gas: Optional[bool] = True
72
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -2,8 +2,9 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
5
- from compass_api_sdk.types import BaseModel
5
+ from compass_api_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
6
6
  import pydantic
7
+ from pydantic import model_serializer
7
8
  from typing import List, Optional
8
9
  from typing_extensions import Annotated, NotRequired, TypedDict
9
10
 
@@ -15,7 +16,7 @@ class UnsignedMulticallTransactionTypedDict(TypedDict):
15
16
  r"""The data of the transaction"""
16
17
  from_: str
17
18
  r"""The sender of the transaction"""
18
- gas: str
19
+ gas: Nullable[str]
19
20
  r"""The gas of the transaction"""
20
21
  to: str
21
22
  r"""The recipient of the transaction"""
@@ -41,7 +42,7 @@ class UnsignedMulticallTransaction(BaseModel):
41
42
  from_: Annotated[str, pydantic.Field(alias="from")]
42
43
  r"""The sender of the transaction"""
43
44
 
44
- gas: str
45
+ gas: Nullable[str]
45
46
  r"""The gas of the transaction"""
46
47
 
47
48
  to: str
@@ -65,3 +66,33 @@ class UnsignedMulticallTransaction(BaseModel):
65
66
  Optional[List[SignedAuthorization]], pydantic.Field(alias="authorizationList")
66
67
  ] = None
67
68
  r"""EIP-7702 authorization"""
69
+
70
+ @model_serializer(mode="wrap")
71
+ def serialize_model(self, handler):
72
+ optional_fields = ["authorizationList"]
73
+ nullable_fields = ["gas"]
74
+ null_default_fields = []
75
+
76
+ serialized = handler(self)
77
+
78
+ m = {}
79
+
80
+ for n, f in type(self).model_fields.items():
81
+ k = f.alias or n
82
+ val = serialized.get(k)
83
+ serialized.pop(k, None)
84
+
85
+ optional_nullable = k in optional_fields and k in nullable_fields
86
+ is_set = (
87
+ self.__pydantic_fields_set__.intersection({n})
88
+ or k in null_default_fields
89
+ ) # pylint: disable=no-member
90
+
91
+ if val is not None and val != UNSET_SENTINEL:
92
+ m[k] = val
93
+ elif val != UNSET_SENTINEL and (
94
+ not k in optional_fields or (optional_nullable and is_set)
95
+ ):
96
+ m[k] = val
97
+
98
+ return m
@@ -1,8 +1,9 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from compass_api_sdk.types import BaseModel
4
+ from compass_api_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
5
5
  import pydantic
6
+ from pydantic import model_serializer
6
7
  from typing_extensions import Annotated, TypedDict
7
8
 
8
9
 
@@ -13,7 +14,7 @@ class UnsignedTransactionTypedDict(TypedDict):
13
14
  r"""The data of the transaction"""
14
15
  from_: str
15
16
  r"""The sender of the transaction"""
16
- gas: str
17
+ gas: Nullable[str]
17
18
  r"""The gas of the transaction"""
18
19
  to: str
19
20
  r"""The recipient of the transaction"""
@@ -37,7 +38,7 @@ class UnsignedTransaction(BaseModel):
37
38
  from_: Annotated[str, pydantic.Field(alias="from")]
38
39
  r"""The sender of the transaction"""
39
40
 
40
- gas: str
41
+ gas: Nullable[str]
41
42
  r"""The gas of the transaction"""
42
43
 
43
44
  to: str
@@ -56,3 +57,33 @@ class UnsignedTransaction(BaseModel):
56
57
  str, pydantic.Field(alias="maxPriorityFeePerGas")
57
58
  ]
58
59
  r"""The max priority fee per gas of the transaction"""
60
+
61
+ @model_serializer(mode="wrap")
62
+ def serialize_model(self, handler):
63
+ optional_fields = []
64
+ nullable_fields = ["gas"]
65
+ null_default_fields = []
66
+
67
+ serialized = handler(self)
68
+
69
+ m = {}
70
+
71
+ for n, f in type(self).model_fields.items():
72
+ k = f.alias or n
73
+ val = serialized.get(k)
74
+ serialized.pop(k, None)
75
+
76
+ optional_nullable = k in optional_fields and k in nullable_fields
77
+ is_set = (
78
+ self.__pydantic_fields_set__.intersection({n})
79
+ or k in null_default_fields
80
+ ) # pylint: disable=no-member
81
+
82
+ if val is not None and val != UNSET_SENTINEL:
83
+ m[k] = val
84
+ elif val != UNSET_SENTINEL and (
85
+ not k in optional_fields or (optional_nullable and is_set)
86
+ ):
87
+ m[k] = val
88
+
89
+ return m
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  UnwrapWethRequestAmountTypedDict = TypeAliasType(
@@ -35,6 +35,8 @@ class UnwrapWethRequestTypedDict(TypedDict):
35
35
  sender: str
36
36
  r"""The address of the transaction sender."""
37
37
  action_type: Literal["UNWRAP_WETH"]
38
+ estimate_gas: NotRequired[bool]
39
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
38
40
 
39
41
 
40
42
  class UnwrapWethRequest(BaseModel):
@@ -55,3 +57,6 @@ class UnwrapWethRequest(BaseModel):
55
57
  ],
56
58
  pydantic.Field(alias="action_type"),
57
59
  ] = "UNWRAP_WETH"
60
+
61
+ estimate_gas: Optional[bool] = True
62
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
@@ -46,6 +46,8 @@ class VaultDepositRequestTypedDict(TypedDict):
46
46
  action_type: Literal["VAULT_DEPOSIT"]
47
47
  receiver: NotRequired[Nullable[str]]
48
48
  r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
49
+ estimate_gas: NotRequired[bool]
50
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
49
51
 
50
52
 
51
53
  class VaultDepositRequest(BaseModel):
@@ -71,9 +73,12 @@ class VaultDepositRequest(BaseModel):
71
73
  receiver: OptionalNullable[str] = UNSET
72
74
  r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
73
75
 
76
+ estimate_gas: Optional[bool] = True
77
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
78
+
74
79
  @model_serializer(mode="wrap")
75
80
  def serialize_model(self, handler):
76
- optional_fields = ["action_type", "receiver"]
81
+ optional_fields = ["action_type", "receiver", "estimate_gas"]
77
82
  nullable_fields = ["receiver"]
78
83
  null_default_fields = []
79
84
 
@@ -34,6 +34,8 @@ class VaultWithdrawRequestTypedDict(TypedDict):
34
34
  action_type: Literal["VAULT_WITHDRAW"]
35
35
  receiver: NotRequired[Nullable[str]]
36
36
  r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
37
+ estimate_gas: NotRequired[bool]
38
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
37
39
 
38
40
 
39
41
  class VaultWithdrawRequest(BaseModel):
@@ -59,9 +61,12 @@ class VaultWithdrawRequest(BaseModel):
59
61
  receiver: OptionalNullable[str] = UNSET
60
62
  r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
61
63
 
64
+ estimate_gas: Optional[bool] = True
65
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
66
+
62
67
  @model_serializer(mode="wrap")
63
68
  def serialize_model(self, handler):
64
- optional_fields = ["action_type", "receiver"]
69
+ optional_fields = ["action_type", "receiver", "estimate_gas"]
65
70
  nullable_fields = ["receiver"]
66
71
  null_default_fields = []
67
72
 
@@ -7,7 +7,7 @@ from enum import Enum
7
7
  import pydantic
8
8
  from pydantic.functional_validators import AfterValidator
9
9
  from typing import Literal, Optional, Union
10
- from typing_extensions import Annotated, TypeAliasType, TypedDict
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  WrapEthRequestAmountTypedDict = TypeAliasType(
@@ -35,6 +35,8 @@ class WrapEthRequestTypedDict(TypedDict):
35
35
  sender: str
36
36
  r"""The address of the transaction sender."""
37
37
  action_type: Literal["WRAP_ETH"]
38
+ estimate_gas: NotRequired[bool]
39
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""
38
40
 
39
41
 
40
42
  class WrapEthRequest(BaseModel):
@@ -54,3 +56,6 @@ class WrapEthRequest(BaseModel):
54
56
  ],
55
57
  pydantic.Field(alias="action_type"),
56
58
  ] = "WRAP_ETH"
59
+
60
+ estimate_gas: Optional[bool] = True
61
+ r"""Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed."""