compass_api_sdk 0.9.8__py3-none-any.whl → 0.9.9__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 (51) hide show
  1. compass_api_sdk/_version.py +3 -3
  2. compass_api_sdk/aave_v3.py +2 -14
  3. compass_api_sdk/aerodrome_slipstream.py +0 -12
  4. compass_api_sdk/models/__init__.py +68 -6
  5. compass_api_sdk/models/aave_avg_rateop.py +1 -1
  6. compass_api_sdk/models/aave_historical_transactionsop.py +1 -46
  7. compass_api_sdk/models/aave_liquidity_changeop.py +2 -47
  8. compass_api_sdk/models/aavelooprequest.py +17 -9
  9. compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +1 -46
  10. compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +1 -46
  11. compass_api_sdk/models/generic_allowanceop.py +1 -46
  12. compass_api_sdk/models/generic_ensop.py +1 -46
  13. compass_api_sdk/models/generic_portfolioop.py +1 -46
  14. compass_api_sdk/models/generic_supported_tokensop.py +2 -47
  15. compass_api_sdk/models/generic_visualize_portfolioop.py +1 -46
  16. compass_api_sdk/models/morpho_market_positionop.py +2 -47
  17. compass_api_sdk/models/morpho_marketop.py +2 -47
  18. compass_api_sdk/models/morpho_marketsop.py +2 -10
  19. compass_api_sdk/models/morpho_user_positionop.py +2 -47
  20. compass_api_sdk/models/morpho_vault_positionop.py +2 -47
  21. compass_api_sdk/models/morpho_vaultop.py +2 -47
  22. compass_api_sdk/models/morpho_vaultsop.py +2 -10
  23. compass_api_sdk/models/pendle_marketop.py +2 -47
  24. compass_api_sdk/models/pendle_marketsop.py +2 -47
  25. compass_api_sdk/models/pendle_positionop.py +2 -47
  26. compass_api_sdk/models/pendle_positionsop.py +2 -47
  27. compass_api_sdk/models/pendleaddliquidityparams.py +45 -0
  28. compass_api_sdk/models/pendleaddliquidityrequest.py +56 -0
  29. compass_api_sdk/models/pendlegetmarketresponse.py +5 -0
  30. compass_api_sdk/models/pendlegetuserpositionresponse.py +5 -0
  31. compass_api_sdk/models/pendleremoveliquidityparams.py +45 -0
  32. compass_api_sdk/models/pendleremoveliquidityrequest.py +56 -0
  33. compass_api_sdk/models/sky_positionop.py +2 -47
  34. compass_api_sdk/models/token_addressop.py +2 -47
  35. compass_api_sdk/models/token_balanceop.py +2 -47
  36. compass_api_sdk/models/uniswap_liquidity_provision_in_rangeop.py +2 -47
  37. compass_api_sdk/models/uniswap_liquidity_provision_positionsop.py +1 -46
  38. compass_api_sdk/models/uniswap_pool_priceop.py +2 -47
  39. compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +2 -47
  40. compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +2 -47
  41. compass_api_sdk/models/useroperation.py +25 -13
  42. compass_api_sdk/morpho.py +0 -42
  43. compass_api_sdk/pendle.py +508 -66
  44. compass_api_sdk/sky.py +0 -6
  45. compass_api_sdk/token_sdk.py +0 -12
  46. compass_api_sdk/transaction_batching.py +14 -14
  47. compass_api_sdk/uniswap_v3.py +0 -30
  48. compass_api_sdk/universal.py +6 -34
  49. {compass_api_sdk-0.9.8.dist-info → compass_api_sdk-0.9.9.dist-info}/METADATA +5 -3
  50. {compass_api_sdk-0.9.8.dist-info → compass_api_sdk-0.9.9.dist-info}/RECORD +51 -47
  51. {compass_api_sdk-0.9.8.dist-info → compass_api_sdk-0.9.9.dist-info}/WHEEL +0 -0
@@ -0,0 +1,56 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .chain import Chain
5
+ from compass_api_sdk.types import BaseModel
6
+ from compass_api_sdk.utils import validate_const
7
+ import pydantic
8
+ from pydantic.functional_validators import AfterValidator
9
+ from typing import Literal, Optional, Union
10
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
11
+
12
+
13
+ PendleRemoveLiquidityRequestAmountTypedDict = TypeAliasType(
14
+ "PendleRemoveLiquidityRequestAmountTypedDict", Union[float, str]
15
+ )
16
+ r"""The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP)."""
17
+
18
+
19
+ PendleRemoveLiquidityRequestAmount = TypeAliasType(
20
+ "PendleRemoveLiquidityRequestAmount", Union[float, str]
21
+ )
22
+ r"""The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP)."""
23
+
24
+
25
+ class PendleRemoveLiquidityRequestTypedDict(TypedDict):
26
+ market_address: str
27
+ r"""The address identifying which Pendle Market you would like to remove liquidity from."""
28
+ amount: PendleRemoveLiquidityRequestAmountTypedDict
29
+ r"""The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP)."""
30
+ chain: Chain
31
+ r"""The chain to use."""
32
+ sender: str
33
+ r"""The address of the transaction sender."""
34
+ action_type: Literal["PENDLE_REMOVE_LIQUIDITY"]
35
+
36
+
37
+ class PendleRemoveLiquidityRequest(BaseModel):
38
+ market_address: str
39
+ r"""The address identifying which Pendle Market you would like to remove liquidity from."""
40
+
41
+ amount: PendleRemoveLiquidityRequestAmount
42
+ r"""The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP)."""
43
+
44
+ chain: Chain
45
+ r"""The chain to use."""
46
+
47
+ sender: str
48
+ r"""The address of the transaction sender."""
49
+
50
+ ACTION_TYPE: Annotated[
51
+ Annotated[
52
+ Optional[Literal["PENDLE_REMOVE_LIQUIDITY"]],
53
+ AfterValidator(validate_const("PENDLE_REMOVE_LIQUIDITY")),
54
+ ],
55
+ pydantic.Field(alias="action_type"),
56
+ ] = "PENDLE_REMOVE_LIQUIDITY"
@@ -1,25 +1,16 @@
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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata, validate_const
12
6
  import pydantic
13
- from pydantic import model_serializer
14
7
  from pydantic.functional_validators import AfterValidator
15
8
  from typing import Literal, Optional
16
- from typing_extensions import Annotated, NotRequired, TypedDict
9
+ from typing_extensions import Annotated, TypedDict
17
10
 
18
11
 
19
12
  class SkyPositionRequestTypedDict(TypedDict):
20
13
  chain: Literal["ethereum:mainnet"]
21
- block: NotRequired[Nullable[int]]
22
- r"""Optional block number (defaults to latest)."""
23
14
  user_address: str
24
15
  r"""The user address of the desired position."""
25
16
 
@@ -34,43 +25,7 @@ class SkyPositionRequest(BaseModel):
34
25
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
35
26
  ] = "ethereum:mainnet"
36
27
 
37
- block: Annotated[
38
- OptionalNullable[int],
39
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
40
- ] = UNSET
41
- r"""Optional block number (defaults to latest)."""
42
-
43
28
  user_address: Annotated[
44
29
  str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
45
30
  ] = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B"
46
31
  r"""The user address of the desired position."""
47
-
48
- @model_serializer(mode="wrap")
49
- def serialize_model(self, handler):
50
- optional_fields = ["chain", "block"]
51
- nullable_fields = ["block"]
52
- null_default_fields = []
53
-
54
- serialized = handler(self)
55
-
56
- m = {}
57
-
58
- for n, f in type(self).model_fields.items():
59
- k = f.alias or n
60
- val = serialized.get(k)
61
- serialized.pop(k, None)
62
-
63
- optional_nullable = k in optional_fields and k in nullable_fields
64
- is_set = (
65
- self.__pydantic_fields_set__.intersection({n})
66
- or k in null_default_fields
67
- ) # pylint: disable=no-member
68
-
69
- if val is not None and val != UNSET_SENTINEL:
70
- m[k] = val
71
- elif val != UNSET_SENTINEL and (
72
- not k in optional_fields or (optional_nullable and is_set)
73
- ):
74
- m[k] = val
75
-
76
- return m
@@ -1,17 +1,10 @@
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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
6
  from enum import Enum
13
- from pydantic import model_serializer
14
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import Annotated, TypedDict
15
8
 
16
9
 
17
10
  class TokenAddressChain(str, Enum):
@@ -78,8 +71,6 @@ class TokenAddressToken(str, Enum):
78
71
  class TokenAddressRequestTypedDict(TypedDict):
79
72
  chain: TokenAddressChain
80
73
  r"""The chain to use."""
81
- block: NotRequired[Nullable[int]]
82
- r"""Optional block number (defaults to latest)."""
83
74
  token: TokenAddressToken
84
75
  r"""The token symbol to get the address for.."""
85
76
 
@@ -91,44 +82,8 @@ class TokenAddressRequest(BaseModel):
91
82
  ] = TokenAddressChain.ARBITRUM_MAINNET
92
83
  r"""The chain to use."""
93
84
 
94
- block: Annotated[
95
- OptionalNullable[int],
96
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
97
- ] = UNSET
98
- r"""Optional block number (defaults to latest)."""
99
-
100
85
  token: Annotated[
101
86
  TokenAddressToken,
102
87
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
103
88
  ] = TokenAddressToken.WETH
104
89
  r"""The token symbol to get the address for.."""
105
-
106
- @model_serializer(mode="wrap")
107
- def serialize_model(self, handler):
108
- optional_fields = ["block"]
109
- nullable_fields = ["block"]
110
- null_default_fields = []
111
-
112
- serialized = handler(self)
113
-
114
- m = {}
115
-
116
- for n, f in type(self).model_fields.items():
117
- k = f.alias or n
118
- val = serialized.get(k)
119
- serialized.pop(k, None)
120
-
121
- optional_nullable = k in optional_fields and k in nullable_fields
122
- is_set = (
123
- self.__pydantic_fields_set__.intersection({n})
124
- or k in null_default_fields
125
- ) # pylint: disable=no-member
126
-
127
- if val is not None and val != UNSET_SENTINEL:
128
- m[k] = val
129
- elif val != UNSET_SENTINEL and (
130
- not k in optional_fields or (optional_nullable and is_set)
131
- ):
132
- m[k] = val
133
-
134
- return m
@@ -2,18 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from .token_enum import TokenEnum
5
- from compass_api_sdk.types import (
6
- BaseModel,
7
- Nullable,
8
- OptionalNullable,
9
- UNSET,
10
- UNSET_SENTINEL,
11
- )
5
+ from compass_api_sdk.types import BaseModel
12
6
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
13
7
  from enum import Enum
14
- from pydantic import model_serializer
15
8
  from typing import Union
16
- from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
9
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
17
10
 
18
11
 
19
12
  class TokenBalanceChain(str, Enum):
@@ -39,8 +32,6 @@ class TokenBalanceRequestTypedDict(TypedDict):
39
32
  r"""The symbol of the token for which the balance is checked.."""
40
33
  chain: TokenBalanceChain
41
34
  r"""The chain to use."""
42
- block: NotRequired[Nullable[int]]
43
- r"""Optional block number (defaults to latest)."""
44
35
  user: str
45
36
  r"""The user to get the ERC20 balance of."""
46
37
 
@@ -58,43 +49,7 @@ class TokenBalanceRequest(BaseModel):
58
49
  ] = TokenBalanceChain.ARBITRUM_MAINNET
59
50
  r"""The chain to use."""
60
51
 
61
- block: Annotated[
62
- OptionalNullable[int],
63
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
64
- ] = UNSET
65
- r"""Optional block number (defaults to latest)."""
66
-
67
52
  user: Annotated[
68
53
  str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
69
54
  ] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
70
55
  r"""The user to get the ERC20 balance of."""
71
-
72
- @model_serializer(mode="wrap")
73
- def serialize_model(self, handler):
74
- optional_fields = ["block"]
75
- nullable_fields = ["block"]
76
- null_default_fields = []
77
-
78
- serialized = handler(self)
79
-
80
- m = {}
81
-
82
- for n, f in type(self).model_fields.items():
83
- k = f.alias or n
84
- val = serialized.get(k)
85
- serialized.pop(k, None)
86
-
87
- optional_nullable = k in optional_fields and k in nullable_fields
88
- is_set = (
89
- self.__pydantic_fields_set__.intersection({n})
90
- or k in null_default_fields
91
- ) # pylint: disable=no-member
92
-
93
- if val is not None and val != UNSET_SENTINEL:
94
- m[k] = val
95
- elif val != UNSET_SENTINEL and (
96
- not k in optional_fields or (optional_nullable and is_set)
97
- ):
98
- m[k] = val
99
-
100
- return m
@@ -1,17 +1,10 @@
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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
6
  from enum import Enum
13
- from pydantic import model_serializer
14
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import Annotated, TypedDict
15
8
 
16
9
 
17
10
  class UniswapLiquidityProvisionInRangeChain(str, Enum):
@@ -25,8 +18,6 @@ class UniswapLiquidityProvisionInRangeChain(str, Enum):
25
18
  class UniswapLiquidityProvisionInRangeRequestTypedDict(TypedDict):
26
19
  chain: UniswapLiquidityProvisionInRangeChain
27
20
  r"""The chain to use."""
28
- block: NotRequired[Nullable[int]]
29
- r"""Optional block number (defaults to latest)."""
30
21
  token_id: int
31
22
  r"""Token ID of the NFT representing the liquidity provisioned position."""
32
23
 
@@ -38,43 +29,7 @@ class UniswapLiquidityProvisionInRangeRequest(BaseModel):
38
29
  ] = UniswapLiquidityProvisionInRangeChain.ARBITRUM_MAINNET
39
30
  r"""The chain to use."""
40
31
 
41
- block: Annotated[
42
- OptionalNullable[int],
43
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
44
- ] = UNSET
45
- r"""Optional block number (defaults to latest)."""
46
-
47
32
  token_id: Annotated[
48
33
  int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
49
34
  ] = 4318185
50
35
  r"""Token ID of the NFT representing the liquidity provisioned position."""
51
-
52
- @model_serializer(mode="wrap")
53
- def serialize_model(self, handler):
54
- optional_fields = ["block"]
55
- nullable_fields = ["block"]
56
- null_default_fields = []
57
-
58
- serialized = handler(self)
59
-
60
- m = {}
61
-
62
- for n, f in type(self).model_fields.items():
63
- k = f.alias or n
64
- val = serialized.get(k)
65
- serialized.pop(k, None)
66
-
67
- optional_nullable = k in optional_fields and k in nullable_fields
68
- is_set = (
69
- self.__pydantic_fields_set__.intersection({n})
70
- or k in null_default_fields
71
- ) # pylint: disable=no-member
72
-
73
- if val is not None and val != UNSET_SENTINEL:
74
- m[k] = val
75
- elif val != UNSET_SENTINEL and (
76
- not k in optional_fields or (optional_nullable and is_set)
77
- ):
78
- m[k] = val
79
-
80
- return m
@@ -1,16 +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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
6
  from enum import Enum
13
- from pydantic import model_serializer
14
7
  from typing import Optional
15
8
  from typing_extensions import Annotated, NotRequired, TypedDict
16
9
 
@@ -26,8 +19,6 @@ class UniswapLiquidityProvisionPositionsChain(str, Enum):
26
19
  class UniswapLiquidityProvisionPositionsRequestTypedDict(TypedDict):
27
20
  chain: UniswapLiquidityProvisionPositionsChain
28
21
  r"""The chain to use."""
29
- block: NotRequired[Nullable[int]]
30
- r"""Optional block number (defaults to latest)."""
31
22
  user: NotRequired[str]
32
23
  r"""The user to get positions for."""
33
24
 
@@ -39,44 +30,8 @@ class UniswapLiquidityProvisionPositionsRequest(BaseModel):
39
30
  ] = UniswapLiquidityProvisionPositionsChain.ARBITRUM_MAINNET
40
31
  r"""The chain to use."""
41
32
 
42
- block: Annotated[
43
- OptionalNullable[int],
44
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
45
- ] = UNSET
46
- r"""Optional block number (defaults to latest)."""
47
-
48
33
  user: Annotated[
49
34
  Optional[str],
50
35
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
51
36
  ] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
52
37
  r"""The user to get positions for."""
53
-
54
- @model_serializer(mode="wrap")
55
- def serialize_model(self, handler):
56
- optional_fields = ["block", "user"]
57
- nullable_fields = ["block"]
58
- null_default_fields = []
59
-
60
- serialized = handler(self)
61
-
62
- m = {}
63
-
64
- for n, f in type(self).model_fields.items():
65
- k = f.alias or n
66
- val = serialized.get(k)
67
- serialized.pop(k, None)
68
-
69
- optional_nullable = k in optional_fields and k in nullable_fields
70
- is_set = (
71
- self.__pydantic_fields_set__.intersection({n})
72
- or k in null_default_fields
73
- ) # pylint: disable=no-member
74
-
75
- if val is not None and val != UNSET_SENTINEL:
76
- m[k] = val
77
- elif val != UNSET_SENTINEL and (
78
- not k in optional_fields or (optional_nullable and is_set)
79
- ):
80
- m[k] = val
81
-
82
- return m
@@ -1,17 +1,10 @@
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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
6
  from enum import Enum
13
- from pydantic import model_serializer
14
- from typing_extensions import Annotated, NotRequired, TypedDict
7
+ from typing_extensions import Annotated, TypedDict
15
8
 
16
9
 
17
10
  class UniswapPoolPriceChain(str, Enum):
@@ -143,8 +136,6 @@ class UniswapPoolPriceFeeEnum(str, Enum):
143
136
  class UniswapPoolPriceRequestTypedDict(TypedDict):
144
137
  chain: UniswapPoolPriceChain
145
138
  r"""The chain to use."""
146
- block: NotRequired[Nullable[int]]
147
- r"""Optional block number (defaults to latest)."""
148
139
  token_in: UniswapPoolPriceTokenInToken
149
140
  r"""The symbol of a token in the pool"""
150
141
  token_out: UniswapPoolPriceTokenOutToken
@@ -160,12 +151,6 @@ class UniswapPoolPriceRequest(BaseModel):
160
151
  ] = UniswapPoolPriceChain.ARBITRUM_MAINNET
161
152
  r"""The chain to use."""
162
153
 
163
- block: Annotated[
164
- OptionalNullable[int],
165
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
166
- ] = UNSET
167
- r"""Optional block number (defaults to latest)."""
168
-
169
154
  token_in: Annotated[
170
155
  UniswapPoolPriceTokenInToken,
171
156
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
@@ -183,33 +168,3 @@ class UniswapPoolPriceRequest(BaseModel):
183
168
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
184
169
  ] = UniswapPoolPriceFeeEnum.ZERO_DOT_01
185
170
  r"""The fee of the pool"""
186
-
187
- @model_serializer(mode="wrap")
188
- def serialize_model(self, handler):
189
- optional_fields = ["block"]
190
- nullable_fields = ["block"]
191
- null_default_fields = []
192
-
193
- serialized = handler(self)
194
-
195
- m = {}
196
-
197
- for n, f in type(self).model_fields.items():
198
- k = f.alias or n
199
- val = serialized.get(k)
200
- serialized.pop(k, None)
201
-
202
- optional_nullable = k in optional_fields and k in nullable_fields
203
- is_set = (
204
- self.__pydantic_fields_set__.intersection({n})
205
- or k in null_default_fields
206
- ) # pylint: disable=no-member
207
-
208
- if val is not None and val != UNSET_SENTINEL:
209
- m[k] = val
210
- elif val != UNSET_SENTINEL and (
211
- not k in optional_fields or (optional_nullable and is_set)
212
- ):
213
- m[k] = val
214
-
215
- return m
@@ -1,18 +1,11 @@
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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
6
  from enum import Enum
13
- from pydantic import model_serializer
14
7
  from typing import Union
15
- from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
8
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
16
9
 
17
10
 
18
11
  class UniswapQuoteBuyExactlyChain(str, Enum):
@@ -158,8 +151,6 @@ class UniswapQuoteBuyExactlyRequestTypedDict(TypedDict):
158
151
  r"""The amount of the token to swap to"""
159
152
  chain: UniswapQuoteBuyExactlyChain
160
153
  r"""The chain to use."""
161
- block: NotRequired[Nullable[int]]
162
- r"""Optional block number (defaults to latest)."""
163
154
  token_in: UniswapQuoteBuyExactlyTokenInToken
164
155
  r"""The symbol of the token to swap from."""
165
156
  token_out: UniswapQuoteBuyExactlyTokenOutToken
@@ -181,12 +172,6 @@ class UniswapQuoteBuyExactlyRequest(BaseModel):
181
172
  ] = UniswapQuoteBuyExactlyChain.ARBITRUM_MAINNET
182
173
  r"""The chain to use."""
183
174
 
184
- block: Annotated[
185
- OptionalNullable[int],
186
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
187
- ] = UNSET
188
- r"""Optional block number (defaults to latest)."""
189
-
190
175
  token_in: Annotated[
191
176
  UniswapQuoteBuyExactlyTokenInToken,
192
177
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
@@ -204,33 +189,3 @@ class UniswapQuoteBuyExactlyRequest(BaseModel):
204
189
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
205
190
  ] = UniswapQuoteBuyExactlyFeeEnum.ZERO_DOT_01
206
191
  r"""The fee to pay for the swap"""
207
-
208
- @model_serializer(mode="wrap")
209
- def serialize_model(self, handler):
210
- optional_fields = ["block"]
211
- nullable_fields = ["block"]
212
- null_default_fields = []
213
-
214
- serialized = handler(self)
215
-
216
- m = {}
217
-
218
- for n, f in type(self).model_fields.items():
219
- k = f.alias or n
220
- val = serialized.get(k)
221
- serialized.pop(k, None)
222
-
223
- optional_nullable = k in optional_fields and k in nullable_fields
224
- is_set = (
225
- self.__pydantic_fields_set__.intersection({n})
226
- or k in null_default_fields
227
- ) # pylint: disable=no-member
228
-
229
- if val is not None and val != UNSET_SENTINEL:
230
- m[k] = val
231
- elif val != UNSET_SENTINEL and (
232
- not k in optional_fields or (optional_nullable and is_set)
233
- ):
234
- m[k] = val
235
-
236
- return m
@@ -1,18 +1,11 @@
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 (
5
- BaseModel,
6
- Nullable,
7
- OptionalNullable,
8
- UNSET,
9
- UNSET_SENTINEL,
10
- )
4
+ from compass_api_sdk.types import BaseModel
11
5
  from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
12
6
  from enum import Enum
13
- from pydantic import model_serializer
14
7
  from typing import Union
15
- from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
8
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
16
9
 
17
10
 
18
11
  class UniswapQuoteSellExactlyChain(str, Enum):
@@ -158,8 +151,6 @@ class UniswapQuoteSellExactlyRequestTypedDict(TypedDict):
158
151
  r"""The amount of the token to swap from"""
159
152
  chain: UniswapQuoteSellExactlyChain
160
153
  r"""The chain to use."""
161
- block: NotRequired[Nullable[int]]
162
- r"""Optional block number (defaults to latest)."""
163
154
  token_in: UniswapQuoteSellExactlyTokenInToken
164
155
  r"""The symbol of the token to swap from."""
165
156
  token_out: UniswapQuoteSellExactlyTokenOutToken
@@ -181,12 +172,6 @@ class UniswapQuoteSellExactlyRequest(BaseModel):
181
172
  ] = UniswapQuoteSellExactlyChain.ARBITRUM_MAINNET
182
173
  r"""The chain to use."""
183
174
 
184
- block: Annotated[
185
- OptionalNullable[int],
186
- FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
187
- ] = UNSET
188
- r"""Optional block number (defaults to latest)."""
189
-
190
175
  token_in: Annotated[
191
176
  UniswapQuoteSellExactlyTokenInToken,
192
177
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
@@ -204,33 +189,3 @@ class UniswapQuoteSellExactlyRequest(BaseModel):
204
189
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
205
190
  ] = UniswapQuoteSellExactlyFeeEnum.ZERO_DOT_01
206
191
  r"""The fee to pay for the swap"""
207
-
208
- @model_serializer(mode="wrap")
209
- def serialize_model(self, handler):
210
- optional_fields = ["block"]
211
- nullable_fields = ["block"]
212
- null_default_fields = []
213
-
214
- serialized = handler(self)
215
-
216
- m = {}
217
-
218
- for n, f in type(self).model_fields.items():
219
- k = f.alias or n
220
- val = serialized.get(k)
221
- serialized.pop(k, None)
222
-
223
- optional_nullable = k in optional_fields and k in nullable_fields
224
- is_set = (
225
- self.__pydantic_fields_set__.intersection({n})
226
- or k in null_default_fields
227
- ) # pylint: disable=no-member
228
-
229
- if val is not None and val != UNSET_SENTINEL:
230
- m[k] = val
231
- elif val != UNSET_SENTINEL and (
232
- not k in optional_fields or (optional_nullable and is_set)
233
- ):
234
- m[k] = val
235
-
236
- return m