compass_api_sdk 0.5.4__py3-none-any.whl → 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of compass_api_sdk might be problematic. Click here for more details.
- compass_api_sdk/_version.py +2 -2
- compass_api_sdk/aave_v3.py +38 -104
- compass_api_sdk/aerodrome_slipstream.py +8 -28
- compass_api_sdk/models/__init__.py +1 -208
- compass_api_sdk/models/aave_avg_rateop.py +44 -16
- compass_api_sdk/models/aave_historical_transactionsop.py +45 -20
- compass_api_sdk/models/aave_liquidity_changeop.py +44 -18
- compass_api_sdk/models/aave_rateop.py +44 -16
- compass_api_sdk/models/aave_reserve_overviewop.py +44 -18
- compass_api_sdk/models/aave_std_rateop.py +44 -16
- compass_api_sdk/models/aave_token_priceop.py +44 -18
- compass_api_sdk/models/aave_user_position_per_tokenop.py +44 -20
- compass_api_sdk/models/aave_user_position_summaryop.py +44 -20
- compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +45 -20
- compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +45 -20
- compass_api_sdk/models/batcheduseroperationsrequest.py +1 -16
- compass_api_sdk/models/generic_allowanceop.py +45 -18
- compass_api_sdk/models/generic_ensop.py +45 -16
- compass_api_sdk/models/generic_portfolioop.py +45 -18
- compass_api_sdk/models/generic_supported_tokensop.py +44 -20
- compass_api_sdk/models/generic_visualize_portfolioop.py +45 -20
- compass_api_sdk/models/morpho_market_positionop.py +44 -18
- compass_api_sdk/models/morpho_marketop.py +44 -18
- compass_api_sdk/models/morpho_marketsop.py +7 -18
- compass_api_sdk/models/morpho_user_positionop.py +44 -18
- compass_api_sdk/models/morpho_vault_positionop.py +44 -18
- compass_api_sdk/models/morpho_vaultop.py +44 -16
- compass_api_sdk/models/morpho_vaultsop.py +7 -18
- compass_api_sdk/models/multicallauthorizationrequest.py +1 -15
- compass_api_sdk/models/pendle_marketop.py +44 -18
- compass_api_sdk/models/pendle_positionop.py +44 -18
- compass_api_sdk/models/sky_positionop.py +45 -16
- compass_api_sdk/models/token_addressop.py +44 -18
- compass_api_sdk/models/token_balanceop.py +44 -17
- compass_api_sdk/models/uniswap_liquidity_provision_in_rangeop.py +44 -20
- compass_api_sdk/models/uniswap_liquidity_provision_positionsop.py +45 -20
- compass_api_sdk/models/uniswap_pool_priceop.py +44 -18
- compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +44 -19
- compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +44 -19
- compass_api_sdk/morpho.py +28 -72
- compass_api_sdk/pendle.py +9 -17
- compass_api_sdk/sky.py +4 -8
- compass_api_sdk/smart_account.py +1 -7
- compass_api_sdk/token_sdk.py +8 -16
- compass_api_sdk/transaction_batching.py +0 -6
- compass_api_sdk/uniswap_v3.py +20 -64
- compass_api_sdk/universal.py +20 -52
- {compass_api_sdk-0.5.4.dist-info → compass_api_sdk-0.6.1.dist-info}/METADATA +2 -2
- {compass_api_sdk-0.5.4.dist-info → compass_api_sdk-0.6.1.dist-info}/RECORD +50 -50
- {compass_api_sdk-0.5.4.dist-info → compass_api_sdk-0.6.1.dist-info}/WHEEL +0 -0
|
@@ -2,10 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .token_enum import TokenEnum
|
|
5
|
-
from compass_api_sdk.types import
|
|
5
|
+
from compass_api_sdk.types import (
|
|
6
|
+
BaseModel,
|
|
7
|
+
Nullable,
|
|
8
|
+
OptionalNullable,
|
|
9
|
+
UNSET,
|
|
10
|
+
UNSET_SENTINEL,
|
|
11
|
+
)
|
|
6
12
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
7
13
|
from enum import Enum
|
|
8
|
-
from
|
|
14
|
+
from pydantic import model_serializer
|
|
15
|
+
from typing import Union
|
|
9
16
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
10
17
|
|
|
11
18
|
|
|
@@ -17,16 +24,6 @@ class TokenBalanceChain(str, Enum):
|
|
|
17
24
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
18
25
|
|
|
19
26
|
|
|
20
|
-
TokenBalanceBlockTypedDict = TypeAliasType(
|
|
21
|
-
"TokenBalanceBlockTypedDict", Union[int, str]
|
|
22
|
-
)
|
|
23
|
-
r"""The block number you want to get this data at."""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
TokenBalanceBlock = TypeAliasType("TokenBalanceBlock", Union[int, str])
|
|
27
|
-
r"""The block number you want to get this data at."""
|
|
28
|
-
|
|
29
|
-
|
|
30
27
|
TokenBalanceTokenTypedDict = TypeAliasType(
|
|
31
28
|
"TokenBalanceTokenTypedDict", Union[TokenEnum, str]
|
|
32
29
|
)
|
|
@@ -42,8 +39,8 @@ class TokenBalanceRequestTypedDict(TypedDict):
|
|
|
42
39
|
r"""The symbol of the token for which the balance is checked.."""
|
|
43
40
|
chain: TokenBalanceChain
|
|
44
41
|
r"""The chain to use."""
|
|
45
|
-
block: NotRequired[
|
|
46
|
-
r"""
|
|
42
|
+
block: NotRequired[Nullable[int]]
|
|
43
|
+
r"""Optional block number (defaults to latest)."""
|
|
47
44
|
user: str
|
|
48
45
|
r"""The user to get the ERC20 balance of."""
|
|
49
46
|
|
|
@@ -62,12 +59,42 @@ class TokenBalanceRequest(BaseModel):
|
|
|
62
59
|
r"""The chain to use."""
|
|
63
60
|
|
|
64
61
|
block: Annotated[
|
|
65
|
-
|
|
62
|
+
OptionalNullable[int],
|
|
66
63
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
67
|
-
] =
|
|
68
|
-
r"""
|
|
64
|
+
] = UNSET
|
|
65
|
+
r"""Optional block number (defaults to latest)."""
|
|
69
66
|
|
|
70
67
|
user: Annotated[
|
|
71
68
|
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
72
69
|
] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
|
|
73
70
|
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,11 +1,17 @@
|
|
|
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
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
8
|
-
from typing_extensions import Annotated, NotRequired,
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
15
|
|
|
10
16
|
|
|
11
17
|
class UniswapLiquidityProvisionInRangeChain(str, Enum):
|
|
@@ -16,23 +22,11 @@ class UniswapLiquidityProvisionInRangeChain(str, Enum):
|
|
|
16
22
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
23
|
|
|
18
24
|
|
|
19
|
-
UniswapLiquidityProvisionInRangeBlockTypedDict = TypeAliasType(
|
|
20
|
-
"UniswapLiquidityProvisionInRangeBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
UniswapLiquidityProvisionInRangeBlock = TypeAliasType(
|
|
26
|
-
"UniswapLiquidityProvisionInRangeBlock", Union[int, str]
|
|
27
|
-
)
|
|
28
|
-
r"""The block number you want to get this data at."""
|
|
29
|
-
|
|
30
|
-
|
|
31
25
|
class UniswapLiquidityProvisionInRangeRequestTypedDict(TypedDict):
|
|
32
26
|
chain: UniswapLiquidityProvisionInRangeChain
|
|
33
27
|
r"""The chain to use."""
|
|
34
|
-
block: NotRequired[
|
|
35
|
-
r"""
|
|
28
|
+
block: NotRequired[Nullable[int]]
|
|
29
|
+
r"""Optional block number (defaults to latest)."""
|
|
36
30
|
token_id: int
|
|
37
31
|
r"""Token ID of the NFT representing the liquidity provisioned position."""
|
|
38
32
|
|
|
@@ -45,12 +39,42 @@ class UniswapLiquidityProvisionInRangeRequest(BaseModel):
|
|
|
45
39
|
r"""The chain to use."""
|
|
46
40
|
|
|
47
41
|
block: Annotated[
|
|
48
|
-
|
|
42
|
+
OptionalNullable[int],
|
|
49
43
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
50
|
-
] =
|
|
51
|
-
r"""
|
|
44
|
+
] = UNSET
|
|
45
|
+
r"""Optional block number (defaults to latest)."""
|
|
52
46
|
|
|
53
47
|
token_id: Annotated[
|
|
54
48
|
int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
55
49
|
] = 4318185
|
|
56
50
|
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,11 +1,18 @@
|
|
|
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
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
8
|
-
from
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing import Optional
|
|
15
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
16
|
|
|
10
17
|
|
|
11
18
|
class UniswapLiquidityProvisionPositionsChain(str, Enum):
|
|
@@ -16,23 +23,11 @@ class UniswapLiquidityProvisionPositionsChain(str, Enum):
|
|
|
16
23
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
24
|
|
|
18
25
|
|
|
19
|
-
UniswapLiquidityProvisionPositionsBlockTypedDict = TypeAliasType(
|
|
20
|
-
"UniswapLiquidityProvisionPositionsBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
UniswapLiquidityProvisionPositionsBlock = TypeAliasType(
|
|
26
|
-
"UniswapLiquidityProvisionPositionsBlock", Union[int, str]
|
|
27
|
-
)
|
|
28
|
-
r"""The block number you want to get this data at."""
|
|
29
|
-
|
|
30
|
-
|
|
31
26
|
class UniswapLiquidityProvisionPositionsRequestTypedDict(TypedDict):
|
|
32
27
|
chain: UniswapLiquidityProvisionPositionsChain
|
|
33
28
|
r"""The chain to use."""
|
|
34
|
-
block: NotRequired[
|
|
35
|
-
r"""
|
|
29
|
+
block: NotRequired[Nullable[int]]
|
|
30
|
+
r"""Optional block number (defaults to latest)."""
|
|
36
31
|
user: NotRequired[str]
|
|
37
32
|
r"""The user to get positions for."""
|
|
38
33
|
|
|
@@ -45,13 +40,43 @@ class UniswapLiquidityProvisionPositionsRequest(BaseModel):
|
|
|
45
40
|
r"""The chain to use."""
|
|
46
41
|
|
|
47
42
|
block: Annotated[
|
|
48
|
-
|
|
43
|
+
OptionalNullable[int],
|
|
49
44
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
50
|
-
] =
|
|
51
|
-
r"""
|
|
45
|
+
] = UNSET
|
|
46
|
+
r"""Optional block number (defaults to latest)."""
|
|
52
47
|
|
|
53
48
|
user: Annotated[
|
|
54
49
|
Optional[str],
|
|
55
50
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
56
51
|
] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"
|
|
57
52
|
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,11 +1,17 @@
|
|
|
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
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
8
|
-
from typing_extensions import Annotated, NotRequired,
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
15
|
|
|
10
16
|
|
|
11
17
|
class UniswapPoolPriceChain(str, Enum):
|
|
@@ -16,16 +22,6 @@ class UniswapPoolPriceChain(str, Enum):
|
|
|
16
22
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
23
|
|
|
18
24
|
|
|
19
|
-
UniswapPoolPriceBlockTypedDict = TypeAliasType(
|
|
20
|
-
"UniswapPoolPriceBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
UniswapPoolPriceBlock = TypeAliasType("UniswapPoolPriceBlock", Union[int, str])
|
|
26
|
-
r"""The block number you want to get this data at."""
|
|
27
|
-
|
|
28
|
-
|
|
29
25
|
class UniswapPoolPriceTokenInToken(str, Enum):
|
|
30
26
|
r"""A class representing the token.
|
|
31
27
|
|
|
@@ -147,8 +143,8 @@ class UniswapPoolPriceFeeEnum(str, Enum):
|
|
|
147
143
|
class UniswapPoolPriceRequestTypedDict(TypedDict):
|
|
148
144
|
chain: UniswapPoolPriceChain
|
|
149
145
|
r"""The chain to use."""
|
|
150
|
-
block: NotRequired[
|
|
151
|
-
r"""
|
|
146
|
+
block: NotRequired[Nullable[int]]
|
|
147
|
+
r"""Optional block number (defaults to latest)."""
|
|
152
148
|
token_in: UniswapPoolPriceTokenInToken
|
|
153
149
|
r"""The symbol of a token in the pool"""
|
|
154
150
|
token_out: UniswapPoolPriceTokenOutToken
|
|
@@ -165,10 +161,10 @@ class UniswapPoolPriceRequest(BaseModel):
|
|
|
165
161
|
r"""The chain to use."""
|
|
166
162
|
|
|
167
163
|
block: Annotated[
|
|
168
|
-
|
|
164
|
+
OptionalNullable[int],
|
|
169
165
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
170
|
-
] =
|
|
171
|
-
r"""
|
|
166
|
+
] = UNSET
|
|
167
|
+
r"""Optional block number (defaults to latest)."""
|
|
172
168
|
|
|
173
169
|
token_in: Annotated[
|
|
174
170
|
UniswapPoolPriceTokenInToken,
|
|
@@ -187,3 +183,33 @@ class UniswapPoolPriceRequest(BaseModel):
|
|
|
187
183
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
188
184
|
] = UniswapPoolPriceFeeEnum.ZERO_DOT_01
|
|
189
185
|
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,10 +1,17 @@
|
|
|
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
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing import Union
|
|
8
15
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
9
16
|
|
|
10
17
|
|
|
@@ -16,18 +23,6 @@ class UniswapQuoteBuyExactlyChain(str, Enum):
|
|
|
16
23
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
24
|
|
|
18
25
|
|
|
19
|
-
UniswapQuoteBuyExactlyBlockTypedDict = TypeAliasType(
|
|
20
|
-
"UniswapQuoteBuyExactlyBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
UniswapQuoteBuyExactlyBlock = TypeAliasType(
|
|
26
|
-
"UniswapQuoteBuyExactlyBlock", Union[int, str]
|
|
27
|
-
)
|
|
28
|
-
r"""The block number you want to get this data at."""
|
|
29
|
-
|
|
30
|
-
|
|
31
26
|
class UniswapQuoteBuyExactlyTokenInToken(str, Enum):
|
|
32
27
|
r"""A class representing the token.
|
|
33
28
|
|
|
@@ -163,8 +158,8 @@ class UniswapQuoteBuyExactlyRequestTypedDict(TypedDict):
|
|
|
163
158
|
r"""The amount of the token to swap to"""
|
|
164
159
|
chain: UniswapQuoteBuyExactlyChain
|
|
165
160
|
r"""The chain to use."""
|
|
166
|
-
block: NotRequired[
|
|
167
|
-
r"""
|
|
161
|
+
block: NotRequired[Nullable[int]]
|
|
162
|
+
r"""Optional block number (defaults to latest)."""
|
|
168
163
|
token_in: UniswapQuoteBuyExactlyTokenInToken
|
|
169
164
|
r"""The symbol of the token to swap from."""
|
|
170
165
|
token_out: UniswapQuoteBuyExactlyTokenOutToken
|
|
@@ -187,10 +182,10 @@ class UniswapQuoteBuyExactlyRequest(BaseModel):
|
|
|
187
182
|
r"""The chain to use."""
|
|
188
183
|
|
|
189
184
|
block: Annotated[
|
|
190
|
-
|
|
185
|
+
OptionalNullable[int],
|
|
191
186
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
192
|
-
] =
|
|
193
|
-
r"""
|
|
187
|
+
] = UNSET
|
|
188
|
+
r"""Optional block number (defaults to latest)."""
|
|
194
189
|
|
|
195
190
|
token_in: Annotated[
|
|
196
191
|
UniswapQuoteBuyExactlyTokenInToken,
|
|
@@ -209,3 +204,33 @@ class UniswapQuoteBuyExactlyRequest(BaseModel):
|
|
|
209
204
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
210
205
|
] = UniswapQuoteBuyExactlyFeeEnum.ZERO_DOT_01
|
|
211
206
|
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,10 +1,17 @@
|
|
|
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
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
12
|
from enum import Enum
|
|
7
|
-
from
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing import Union
|
|
8
15
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
9
16
|
|
|
10
17
|
|
|
@@ -16,18 +23,6 @@ class UniswapQuoteSellExactlyChain(str, Enum):
|
|
|
16
23
|
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
24
|
|
|
18
25
|
|
|
19
|
-
UniswapQuoteSellExactlyBlockTypedDict = TypeAliasType(
|
|
20
|
-
"UniswapQuoteSellExactlyBlockTypedDict", Union[int, str]
|
|
21
|
-
)
|
|
22
|
-
r"""The block number you want to get this data at."""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
UniswapQuoteSellExactlyBlock = TypeAliasType(
|
|
26
|
-
"UniswapQuoteSellExactlyBlock", Union[int, str]
|
|
27
|
-
)
|
|
28
|
-
r"""The block number you want to get this data at."""
|
|
29
|
-
|
|
30
|
-
|
|
31
26
|
class UniswapQuoteSellExactlyTokenInToken(str, Enum):
|
|
32
27
|
r"""A class representing the token.
|
|
33
28
|
|
|
@@ -163,8 +158,8 @@ class UniswapQuoteSellExactlyRequestTypedDict(TypedDict):
|
|
|
163
158
|
r"""The amount of the token to swap from"""
|
|
164
159
|
chain: UniswapQuoteSellExactlyChain
|
|
165
160
|
r"""The chain to use."""
|
|
166
|
-
block: NotRequired[
|
|
167
|
-
r"""
|
|
161
|
+
block: NotRequired[Nullable[int]]
|
|
162
|
+
r"""Optional block number (defaults to latest)."""
|
|
168
163
|
token_in: UniswapQuoteSellExactlyTokenInToken
|
|
169
164
|
r"""The symbol of the token to swap from."""
|
|
170
165
|
token_out: UniswapQuoteSellExactlyTokenOutToken
|
|
@@ -187,10 +182,10 @@ class UniswapQuoteSellExactlyRequest(BaseModel):
|
|
|
187
182
|
r"""The chain to use."""
|
|
188
183
|
|
|
189
184
|
block: Annotated[
|
|
190
|
-
|
|
185
|
+
OptionalNullable[int],
|
|
191
186
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
192
|
-
] =
|
|
193
|
-
r"""
|
|
187
|
+
] = UNSET
|
|
188
|
+
r"""Optional block number (defaults to latest)."""
|
|
194
189
|
|
|
195
190
|
token_in: Annotated[
|
|
196
191
|
UniswapQuoteSellExactlyTokenInToken,
|
|
@@ -209,3 +204,33 @@ class UniswapQuoteSellExactlyRequest(BaseModel):
|
|
|
209
204
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
210
205
|
] = UniswapQuoteSellExactlyFeeEnum.ZERO_DOT_01
|
|
211
206
|
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
|