compass_api_sdk 1.1.2__py3-none-any.whl → 1.1.3__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 +3 -3
- compass_api_sdk/aave_v3.py +68 -44
- compass_api_sdk/aerodrome_slipstream.py +62 -32
- compass_api_sdk/erc_4626_vaults.py +12 -0
- compass_api_sdk/ethena.py +18 -0
- compass_api_sdk/models/__init__.py +0 -254
- compass_api_sdk/models/aaveborrowparams.py +4 -13
- compass_api_sdk/models/aaveborrowrequest.py +10 -14
- compass_api_sdk/models/aavelooprequest.py +18 -26
- compass_api_sdk/models/aaverepayparams.py +4 -13
- compass_api_sdk/models/aaverepayrequest.py +10 -14
- compass_api_sdk/models/aavesupplyparams.py +4 -13
- compass_api_sdk/models/aavesupplyrequest.py +10 -14
- compass_api_sdk/models/aavewithdrawparams.py +4 -13
- compass_api_sdk/models/aavewithdrawrequest.py +10 -14
- compass_api_sdk/models/aerodromeposition.py +4 -25
- compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +14 -26
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +14 -26
- compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +13 -25
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/batcheduseroperationsrequest.py +15 -4
- compass_api_sdk/models/compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py +4 -13
- compass_api_sdk/models/ethenadepositrequest.py +6 -1
- compass_api_sdk/models/ethenarequesttowithdrawrequest.py +6 -1
- compass_api_sdk/models/ethenaunstakerequest.py +6 -1
- compass_api_sdk/models/morphoborrowrequest.py +6 -1
- compass_api_sdk/models/morphodepositrequest.py +6 -1
- compass_api_sdk/models/morphorepayrequest.py +11 -1
- compass_api_sdk/models/morphosupplycollateralrequest.py +11 -1
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +6 -1
- compass_api_sdk/models/morphowithdrawrequest.py +6 -1
- compass_api_sdk/models/multicallexecuterequest.py +7 -2
- compass_api_sdk/models/odosswapparams.py +4 -25
- compass_api_sdk/models/odosswaprequest.py +10 -28
- compass_api_sdk/models/pendlemanageliquidityparams.py +2 -15
- compass_api_sdk/models/pendlemanageliquidityrequest.py +8 -16
- compass_api_sdk/models/pendleredeemyieldrequest.py +6 -1
- compass_api_sdk/models/pendletradeptparams.py +2 -15
- compass_api_sdk/models/pendletradeptrequest.py +8 -16
- compass_api_sdk/models/pendletradeytparams.py +2 -15
- compass_api_sdk/models/pendletradeytrequest.py +8 -16
- compass_api_sdk/models/reserve.py +6 -15
- compass_api_sdk/models/setallowanceparams.py +2 -15
- compass_api_sdk/models/setallowancerequest.py +8 -16
- compass_api_sdk/models/skybuyrequest.py +6 -1
- compass_api_sdk/models/skydepositrequest.py +6 -1
- compass_api_sdk/models/skysellrequest.py +7 -2
- compass_api_sdk/models/skywithdrawrequest.py +6 -1
- compass_api_sdk/models/tokenbalanceresponse.py +5 -15
- compass_api_sdk/models/tokentransferparams.py +2 -15
- compass_api_sdk/models/tokentransferrequest.py +8 -16
- compass_api_sdk/models/uniswapbuyexactlyparams.py +8 -33
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +14 -34
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +14 -26
- compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
- compass_api_sdk/models/uniswapsellexactlyparams.py +4 -29
- compass_api_sdk/models/uniswapsellexactlyrequest.py +10 -30
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/unsignedmulticalltransaction.py +34 -3
- compass_api_sdk/models/unsignedtransaction.py +34 -3
- compass_api_sdk/models/unwrapwethrequest.py +6 -1
- compass_api_sdk/models/v1_aave_avg_rateop.py +5 -83
- compass_api_sdk/models/v1_aave_liquidity_changeop.py +5 -83
- compass_api_sdk/models/v1_aave_rateop.py +5 -83
- compass_api_sdk/models/v1_aave_reserve_overviewop.py +5 -83
- compass_api_sdk/models/v1_aave_std_rateop.py +5 -83
- compass_api_sdk/models/v1_aave_token_priceop.py +5 -83
- compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +5 -83
- compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +10 -166
- compass_api_sdk/models/v1_generic_allowanceop.py +7 -21
- compass_api_sdk/models/v1_morpho_marketsop.py +9 -29
- compass_api_sdk/models/v1_morpho_vaultsop.py +5 -15
- compass_api_sdk/models/v1_sky_positionop.py +4 -5
- compass_api_sdk/models/v1_token_balanceop.py +10 -23
- compass_api_sdk/models/v1_token_priceop.py +7 -8
- compass_api_sdk/models/v1_uniswap_pool_priceop.py +10 -166
- compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +10 -166
- compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +10 -166
- compass_api_sdk/models/vaultdepositrequest.py +6 -1
- compass_api_sdk/models/vaultwithdrawrequest.py +6 -1
- compass_api_sdk/models/wrapethrequest.py +6 -1
- compass_api_sdk/morpho.py +48 -24
- compass_api_sdk/pendle.py +30 -20
- compass_api_sdk/sdk.py +3 -3
- compass_api_sdk/sky.py +38 -16
- compass_api_sdk/smart_account.py +6 -0
- compass_api_sdk/swap.py +10 -12
- compass_api_sdk/{token_sdk.py → token.py} +19 -197
- compass_api_sdk/transaction_bundler.py +20 -8
- compass_api_sdk/uniswap_v3.py +74 -68
- compass_api_sdk/universal.py +24 -188
- {compass_api_sdk-1.1.2.dist-info → compass_api_sdk-1.1.3.dist-info}/METADATA +5 -7
- {compass_api_sdk-1.1.2.dist-info → compass_api_sdk-1.1.3.dist-info}/RECORD +101 -106
- compass_api_sdk/models/token_enum.py +0 -81
- compass_api_sdk/models/tokenaddressresponse.py +0 -15
- compass_api_sdk/models/tokeninfo.py +0 -17
- compass_api_sdk/models/v1_generic_supported_tokensop.py +0 -24
- compass_api_sdk/models/v1_token_addressop.py +0 -109
- {compass_api_sdk-1.1.2.dist-info → compass_api_sdk-1.1.3.dist-info}/WHEEL +0 -0
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .token_enum import TokenEnum
|
|
5
4
|
from compass_api_sdk.types import BaseModel
|
|
6
5
|
from typing_extensions import TypedDict
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class UniswapPoolPriceResponseTypedDict(TypedDict):
|
|
10
|
-
token_in:
|
|
11
|
-
r"""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
endpoints' documentation where per chain tokens are presented.
|
|
15
|
-
"""
|
|
16
|
-
token_out: TokenEnum
|
|
17
|
-
r"""A class representing the token.
|
|
18
|
-
|
|
19
|
-
This class is used to represent the token in the system. Notice individual
|
|
20
|
-
endpoints' documentation where per chain tokens are presented.
|
|
21
|
-
"""
|
|
9
|
+
token_in: str
|
|
10
|
+
r"""The first token in the pool"""
|
|
11
|
+
token_out: str
|
|
12
|
+
r"""The second token in the pool"""
|
|
22
13
|
price: str
|
|
23
14
|
r"""The price of the pool. This is expressed as an instantanteous amount of how many token0 you need to buy 1 token1. In any swap this will not change during the trade; use the quote endpoint to get a better idea of how much you will pay!"""
|
|
24
15
|
tick: int
|
|
@@ -26,19 +17,11 @@ class UniswapPoolPriceResponseTypedDict(TypedDict):
|
|
|
26
17
|
|
|
27
18
|
|
|
28
19
|
class UniswapPoolPriceResponse(BaseModel):
|
|
29
|
-
token_in:
|
|
30
|
-
r"""
|
|
20
|
+
token_in: str
|
|
21
|
+
r"""The first token in the pool"""
|
|
31
22
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"""
|
|
35
|
-
|
|
36
|
-
token_out: TokenEnum
|
|
37
|
-
r"""A class representing the token.
|
|
38
|
-
|
|
39
|
-
This class is used to represent the token in the system. Notice individual
|
|
40
|
-
endpoints' documentation where per chain tokens are presented.
|
|
41
|
-
"""
|
|
23
|
+
token_out: str
|
|
24
|
+
r"""The second token in the pool"""
|
|
42
25
|
|
|
43
26
|
price: str
|
|
44
27
|
r"""The price of the pool. This is expressed as an instantanteous amount of how many token0 you need to buy 1 token1. In any swap this will not change during the trade; use the quote endpoint to get a better idea of how much you will pay!"""
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .feeenum import FeeEnum
|
|
5
|
-
from .token_enum import TokenEnum
|
|
6
5
|
from compass_api_sdk.types import BaseModel
|
|
7
6
|
from compass_api_sdk.utils import validate_const
|
|
8
7
|
import pydantic
|
|
@@ -11,30 +10,6 @@ from typing import Literal, Optional, Union
|
|
|
11
10
|
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
12
11
|
|
|
13
12
|
|
|
14
|
-
UniswapSellExactlyParamsTokenInTypedDict = TypeAliasType(
|
|
15
|
-
"UniswapSellExactlyParamsTokenInTypedDict", Union[TokenEnum, str]
|
|
16
|
-
)
|
|
17
|
-
r"""The symbol or address of the token to sell.."""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
UniswapSellExactlyParamsTokenIn = TypeAliasType(
|
|
21
|
-
"UniswapSellExactlyParamsTokenIn", Union[TokenEnum, str]
|
|
22
|
-
)
|
|
23
|
-
r"""The symbol or address of the token to sell.."""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
UniswapSellExactlyParamsTokenOutTypedDict = TypeAliasType(
|
|
27
|
-
"UniswapSellExactlyParamsTokenOutTypedDict", Union[TokenEnum, str]
|
|
28
|
-
)
|
|
29
|
-
r"""The symbol or address of the token to buy.."""
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
UniswapSellExactlyParamsTokenOut = TypeAliasType(
|
|
33
|
-
"UniswapSellExactlyParamsTokenOut", Union[TokenEnum, str]
|
|
34
|
-
)
|
|
35
|
-
r"""The symbol or address of the token to buy.."""
|
|
36
|
-
|
|
37
|
-
|
|
38
13
|
UniswapSellExactlyParamsAmountInTypedDict = TypeAliasType(
|
|
39
14
|
"UniswapSellExactlyParamsAmountInTypedDict", Union[float, str]
|
|
40
15
|
)
|
|
@@ -50,9 +25,9 @@ r"""The amount of the `token_in` to sell"""
|
|
|
50
25
|
class UniswapSellExactlyParamsTypedDict(TypedDict):
|
|
51
26
|
r"""Parameters model for selling exactly an amount of tokens."""
|
|
52
27
|
|
|
53
|
-
token_in:
|
|
28
|
+
token_in: str
|
|
54
29
|
r"""The symbol or address of the token to sell.."""
|
|
55
|
-
token_out:
|
|
30
|
+
token_out: str
|
|
56
31
|
r"""The symbol or address of the token to buy.."""
|
|
57
32
|
fee: FeeEnum
|
|
58
33
|
r"""The transaction fee of a Uniswap pool in bips.
|
|
@@ -69,10 +44,10 @@ class UniswapSellExactlyParamsTypedDict(TypedDict):
|
|
|
69
44
|
class UniswapSellExactlyParams(BaseModel):
|
|
70
45
|
r"""Parameters model for selling exactly an amount of tokens."""
|
|
71
46
|
|
|
72
|
-
token_in:
|
|
47
|
+
token_in: str
|
|
73
48
|
r"""The symbol or address of the token to sell.."""
|
|
74
49
|
|
|
75
|
-
token_out:
|
|
50
|
+
token_out: str
|
|
76
51
|
r"""The symbol or address of the token to buy.."""
|
|
77
52
|
|
|
78
53
|
fee: FeeEnum
|
|
@@ -2,38 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .feeenum import FeeEnum
|
|
5
|
-
from .token_enum import TokenEnum
|
|
6
5
|
from compass_api_sdk.types import BaseModel
|
|
7
6
|
from compass_api_sdk.utils import validate_const
|
|
8
7
|
from enum import Enum
|
|
9
8
|
import pydantic
|
|
10
9
|
from pydantic.functional_validators import AfterValidator
|
|
11
10
|
from typing import Literal, Optional, Union
|
|
12
|
-
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
UniswapSellExactlyRequestTokenInTypedDict = TypeAliasType(
|
|
16
|
-
"UniswapSellExactlyRequestTokenInTypedDict", Union[TokenEnum, str]
|
|
17
|
-
)
|
|
18
|
-
r"""The symbol or address of the token to sell.."""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
UniswapSellExactlyRequestTokenIn = TypeAliasType(
|
|
22
|
-
"UniswapSellExactlyRequestTokenIn", Union[TokenEnum, str]
|
|
23
|
-
)
|
|
24
|
-
r"""The symbol or address of the token to sell.."""
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
UniswapSellExactlyRequestTokenOutTypedDict = TypeAliasType(
|
|
28
|
-
"UniswapSellExactlyRequestTokenOutTypedDict", Union[TokenEnum, str]
|
|
29
|
-
)
|
|
30
|
-
r"""The symbol or address of the token to buy.."""
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
UniswapSellExactlyRequestTokenOut = TypeAliasType(
|
|
34
|
-
"UniswapSellExactlyRequestTokenOut", Union[TokenEnum, str]
|
|
35
|
-
)
|
|
36
|
-
r"""The symbol or address of the token to buy.."""
|
|
11
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
37
12
|
|
|
38
13
|
|
|
39
14
|
UniswapSellExactlyRequestAmountInTypedDict = TypeAliasType(
|
|
@@ -57,9 +32,9 @@ class UniswapSellExactlyRequestChain(str, Enum):
|
|
|
57
32
|
class UniswapSellExactlyRequestTypedDict(TypedDict):
|
|
58
33
|
r"""Request model for selling exactly an amount of tokens."""
|
|
59
34
|
|
|
60
|
-
token_in:
|
|
35
|
+
token_in: str
|
|
61
36
|
r"""The symbol or address of the token to sell.."""
|
|
62
|
-
token_out:
|
|
37
|
+
token_out: str
|
|
63
38
|
r"""The symbol or address of the token to buy.."""
|
|
64
39
|
fee: FeeEnum
|
|
65
40
|
r"""The transaction fee of a Uniswap pool in bips.
|
|
@@ -74,15 +49,17 @@ class UniswapSellExactlyRequestTypedDict(TypedDict):
|
|
|
74
49
|
sender: str
|
|
75
50
|
r"""The address of the transaction sender."""
|
|
76
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."""
|
|
77
54
|
|
|
78
55
|
|
|
79
56
|
class UniswapSellExactlyRequest(BaseModel):
|
|
80
57
|
r"""Request model for selling exactly an amount of tokens."""
|
|
81
58
|
|
|
82
|
-
token_in:
|
|
59
|
+
token_in: str
|
|
83
60
|
r"""The symbol or address of the token to sell.."""
|
|
84
61
|
|
|
85
|
-
token_out:
|
|
62
|
+
token_out: str
|
|
86
63
|
r"""The symbol or address of the token to buy.."""
|
|
87
64
|
|
|
88
65
|
fee: FeeEnum
|
|
@@ -109,3 +86,6 @@ class UniswapSellExactlyRequest(BaseModel):
|
|
|
109
86
|
],
|
|
110
87
|
pydantic.Field(alias="action_type"),
|
|
111
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."""
|
|
@@ -20,89 +20,12 @@ class V1AaveAvgRateChain(str, Enum):
|
|
|
20
20
|
ETHEREUM = "ethereum"
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
class V1AaveAvgRateToken(str, Enum):
|
|
24
|
-
r"""A class representing the token.
|
|
25
|
-
|
|
26
|
-
This class is used to represent the token in the system. Notice individual
|
|
27
|
-
endpoints' documentation where per chain tokens are presented.
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
ONE_INCH = "1INCH"
|
|
31
|
-
AAVE = "AAVE"
|
|
32
|
-
AERO = "AERO"
|
|
33
|
-
ARB = "ARB"
|
|
34
|
-
BAL = "BAL"
|
|
35
|
-
BNKR = "BNKR"
|
|
36
|
-
CB_BTC = "cbBTC"
|
|
37
|
-
CB_ETH = "cbETH"
|
|
38
|
-
CLANKER = "CLANKER"
|
|
39
|
-
COPI = "COPI"
|
|
40
|
-
CRV = "CRV"
|
|
41
|
-
CRV_USD = "crvUSD"
|
|
42
|
-
CYBER = "CYBER"
|
|
43
|
-
DAI = "DAI"
|
|
44
|
-
DOGINME = "DOGINME"
|
|
45
|
-
E_BTC = "eBTC"
|
|
46
|
-
ENS = "ENS"
|
|
47
|
-
ETH = "ETH"
|
|
48
|
-
ETHFI = "ETHFI"
|
|
49
|
-
ET_HX = "ETHx"
|
|
50
|
-
EURC = "EURC"
|
|
51
|
-
EUR = "EUR"
|
|
52
|
-
EURS = "EURS"
|
|
53
|
-
E_US_DE = "eUSDe"
|
|
54
|
-
EZ_ETH = "ezETH"
|
|
55
|
-
FBTC = "FBTC"
|
|
56
|
-
FRAX = "FRAX"
|
|
57
|
-
FXS = "FXS"
|
|
58
|
-
GHO = "GHO"
|
|
59
|
-
KNC = "KNC"
|
|
60
|
-
LBTC = "LBTC"
|
|
61
|
-
LDO = "LDO"
|
|
62
|
-
LINK = "LINK"
|
|
63
|
-
LS_ETH = "LsETH"
|
|
64
|
-
LUSD = "LUSD"
|
|
65
|
-
MAI = "MAI"
|
|
66
|
-
MKR = "MKR"
|
|
67
|
-
OS_ETH = "osETH"
|
|
68
|
-
PT_E_USDE_14_AUG2025 = "PT-eUSDE-14AUG2025"
|
|
69
|
-
PT_E_USDE_29_MAY2025 = "PT-eUSDE-29MAY2025"
|
|
70
|
-
PT_S_USDE_25_SEP2025 = "PT-sUSDE-25SEP2025"
|
|
71
|
-
PT_S_USDE_31_JUL2025 = "PT-sUSDE-31JUL2025"
|
|
72
|
-
PT_US_DE_31_JUL2025 = "PT-USDe-31JUL2025"
|
|
73
|
-
PYUSD = "PYUSD"
|
|
74
|
-
R_ETH = "rETH"
|
|
75
|
-
RLUSD = "RLUSD"
|
|
76
|
-
RPL = "RPL"
|
|
77
|
-
RS_ETH = "rsETH"
|
|
78
|
-
S_DAI = "sDAI"
|
|
79
|
-
SNX = "SNX"
|
|
80
|
-
STG = "STG"
|
|
81
|
-
S_US_DE = "sUSDe"
|
|
82
|
-
T_BTC = "tBTC"
|
|
83
|
-
UNI = "UNI"
|
|
84
|
-
US_DB_C = "USDbC"
|
|
85
|
-
USD_CE = "USDCe"
|
|
86
|
-
USDC = "USDC"
|
|
87
|
-
US_DE = "USDe"
|
|
88
|
-
USDS = "USDS"
|
|
89
|
-
US_DTB = "USDtb"
|
|
90
|
-
USDT = "USDT"
|
|
91
|
-
VIRTUAL = "VIRTUAL"
|
|
92
|
-
WBTC = "WBTC"
|
|
93
|
-
WE_ETH = "weETH"
|
|
94
|
-
WELL = "WELL"
|
|
95
|
-
WETH = "WETH"
|
|
96
|
-
WRS_ETH = "wrsETH"
|
|
97
|
-
WST_ETH = "wstETH"
|
|
98
|
-
|
|
99
|
-
|
|
100
23
|
class V1AaveAvgRateRequestTypedDict(TypedDict):
|
|
101
24
|
chain: V1AaveAvgRateChain
|
|
102
25
|
block: NotRequired[Nullable[int]]
|
|
103
26
|
r"""Optional block number (defaults to latest)."""
|
|
104
|
-
token:
|
|
105
|
-
r"""The symbol of the token.."""
|
|
27
|
+
token: str
|
|
28
|
+
r"""The symbol or address of the token.."""
|
|
106
29
|
days: int
|
|
107
30
|
r"""The number of days for which the average shall be calculated."""
|
|
108
31
|
|
|
@@ -120,10 +43,9 @@ class V1AaveAvgRateRequest(BaseModel):
|
|
|
120
43
|
r"""Optional block number (defaults to latest)."""
|
|
121
44
|
|
|
122
45
|
token: Annotated[
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
r"""The symbol of the token.."""
|
|
46
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
47
|
+
] = "USDC"
|
|
48
|
+
r"""The symbol or address of the token.."""
|
|
127
49
|
|
|
128
50
|
days: Annotated[
|
|
129
51
|
int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
@@ -13,87 +13,10 @@ class V1AaveLiquidityChangeChain(str, Enum):
|
|
|
13
13
|
ETHEREUM = "ethereum"
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class V1AaveLiquidityChangeToken(str, Enum):
|
|
17
|
-
r"""A class representing the token.
|
|
18
|
-
|
|
19
|
-
This class is used to represent the token in the system. Notice individual
|
|
20
|
-
endpoints' documentation where per chain tokens are presented.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
ONE_INCH = "1INCH"
|
|
24
|
-
AAVE = "AAVE"
|
|
25
|
-
AERO = "AERO"
|
|
26
|
-
ARB = "ARB"
|
|
27
|
-
BAL = "BAL"
|
|
28
|
-
BNKR = "BNKR"
|
|
29
|
-
CB_BTC = "cbBTC"
|
|
30
|
-
CB_ETH = "cbETH"
|
|
31
|
-
CLANKER = "CLANKER"
|
|
32
|
-
COPI = "COPI"
|
|
33
|
-
CRV = "CRV"
|
|
34
|
-
CRV_USD = "crvUSD"
|
|
35
|
-
CYBER = "CYBER"
|
|
36
|
-
DAI = "DAI"
|
|
37
|
-
DOGINME = "DOGINME"
|
|
38
|
-
E_BTC = "eBTC"
|
|
39
|
-
ENS = "ENS"
|
|
40
|
-
ETH = "ETH"
|
|
41
|
-
ETHFI = "ETHFI"
|
|
42
|
-
ET_HX = "ETHx"
|
|
43
|
-
EURC = "EURC"
|
|
44
|
-
EUR = "EUR"
|
|
45
|
-
EURS = "EURS"
|
|
46
|
-
E_US_DE = "eUSDe"
|
|
47
|
-
EZ_ETH = "ezETH"
|
|
48
|
-
FBTC = "FBTC"
|
|
49
|
-
FRAX = "FRAX"
|
|
50
|
-
FXS = "FXS"
|
|
51
|
-
GHO = "GHO"
|
|
52
|
-
KNC = "KNC"
|
|
53
|
-
LBTC = "LBTC"
|
|
54
|
-
LDO = "LDO"
|
|
55
|
-
LINK = "LINK"
|
|
56
|
-
LS_ETH = "LsETH"
|
|
57
|
-
LUSD = "LUSD"
|
|
58
|
-
MAI = "MAI"
|
|
59
|
-
MKR = "MKR"
|
|
60
|
-
OS_ETH = "osETH"
|
|
61
|
-
PT_E_USDE_14_AUG2025 = "PT-eUSDE-14AUG2025"
|
|
62
|
-
PT_E_USDE_29_MAY2025 = "PT-eUSDE-29MAY2025"
|
|
63
|
-
PT_S_USDE_25_SEP2025 = "PT-sUSDE-25SEP2025"
|
|
64
|
-
PT_S_USDE_31_JUL2025 = "PT-sUSDE-31JUL2025"
|
|
65
|
-
PT_US_DE_31_JUL2025 = "PT-USDe-31JUL2025"
|
|
66
|
-
PYUSD = "PYUSD"
|
|
67
|
-
R_ETH = "rETH"
|
|
68
|
-
RLUSD = "RLUSD"
|
|
69
|
-
RPL = "RPL"
|
|
70
|
-
RS_ETH = "rsETH"
|
|
71
|
-
S_DAI = "sDAI"
|
|
72
|
-
SNX = "SNX"
|
|
73
|
-
STG = "STG"
|
|
74
|
-
S_US_DE = "sUSDe"
|
|
75
|
-
T_BTC = "tBTC"
|
|
76
|
-
UNI = "UNI"
|
|
77
|
-
US_DB_C = "USDbC"
|
|
78
|
-
USD_CE = "USDCe"
|
|
79
|
-
USDC = "USDC"
|
|
80
|
-
US_DE = "USDe"
|
|
81
|
-
USDS = "USDS"
|
|
82
|
-
US_DTB = "USDtb"
|
|
83
|
-
USDT = "USDT"
|
|
84
|
-
VIRTUAL = "VIRTUAL"
|
|
85
|
-
WBTC = "WBTC"
|
|
86
|
-
WE_ETH = "weETH"
|
|
87
|
-
WELL = "WELL"
|
|
88
|
-
WETH = "WETH"
|
|
89
|
-
WRS_ETH = "wrsETH"
|
|
90
|
-
WST_ETH = "wstETH"
|
|
91
|
-
|
|
92
|
-
|
|
93
16
|
class V1AaveLiquidityChangeRequestTypedDict(TypedDict):
|
|
94
17
|
chain: V1AaveLiquidityChangeChain
|
|
95
|
-
token:
|
|
96
|
-
r"""The symbol of the asset to get liquidity change for.."""
|
|
18
|
+
token: str
|
|
19
|
+
r"""The symbol or address of the asset to get liquidity change for.."""
|
|
97
20
|
start_block: int
|
|
98
21
|
r"""The start block to calculate liquidity change from."""
|
|
99
22
|
end_block: int
|
|
@@ -107,10 +30,9 @@ class V1AaveLiquidityChangeRequest(BaseModel):
|
|
|
107
30
|
] = V1AaveLiquidityChangeChain.ARBITRUM
|
|
108
31
|
|
|
109
32
|
token: Annotated[
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
r"""The symbol of the asset to get liquidity change for.."""
|
|
33
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
34
|
+
] = "USDC"
|
|
35
|
+
r"""The symbol or address of the asset to get liquidity change for.."""
|
|
114
36
|
|
|
115
37
|
start_block: Annotated[
|
|
116
38
|
int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
@@ -20,89 +20,12 @@ class V1AaveRateChain(str, Enum):
|
|
|
20
20
|
ETHEREUM = "ethereum"
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
class V1AaveRateToken(str, Enum):
|
|
24
|
-
r"""A class representing the token.
|
|
25
|
-
|
|
26
|
-
This class is used to represent the token in the system. Notice individual
|
|
27
|
-
endpoints' documentation where per chain tokens are presented.
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
ONE_INCH = "1INCH"
|
|
31
|
-
AAVE = "AAVE"
|
|
32
|
-
AERO = "AERO"
|
|
33
|
-
ARB = "ARB"
|
|
34
|
-
BAL = "BAL"
|
|
35
|
-
BNKR = "BNKR"
|
|
36
|
-
CB_BTC = "cbBTC"
|
|
37
|
-
CB_ETH = "cbETH"
|
|
38
|
-
CLANKER = "CLANKER"
|
|
39
|
-
COPI = "COPI"
|
|
40
|
-
CRV = "CRV"
|
|
41
|
-
CRV_USD = "crvUSD"
|
|
42
|
-
CYBER = "CYBER"
|
|
43
|
-
DAI = "DAI"
|
|
44
|
-
DOGINME = "DOGINME"
|
|
45
|
-
E_BTC = "eBTC"
|
|
46
|
-
ENS = "ENS"
|
|
47
|
-
ETH = "ETH"
|
|
48
|
-
ETHFI = "ETHFI"
|
|
49
|
-
ET_HX = "ETHx"
|
|
50
|
-
EURC = "EURC"
|
|
51
|
-
EUR = "EUR"
|
|
52
|
-
EURS = "EURS"
|
|
53
|
-
E_US_DE = "eUSDe"
|
|
54
|
-
EZ_ETH = "ezETH"
|
|
55
|
-
FBTC = "FBTC"
|
|
56
|
-
FRAX = "FRAX"
|
|
57
|
-
FXS = "FXS"
|
|
58
|
-
GHO = "GHO"
|
|
59
|
-
KNC = "KNC"
|
|
60
|
-
LBTC = "LBTC"
|
|
61
|
-
LDO = "LDO"
|
|
62
|
-
LINK = "LINK"
|
|
63
|
-
LS_ETH = "LsETH"
|
|
64
|
-
LUSD = "LUSD"
|
|
65
|
-
MAI = "MAI"
|
|
66
|
-
MKR = "MKR"
|
|
67
|
-
OS_ETH = "osETH"
|
|
68
|
-
PT_E_USDE_14_AUG2025 = "PT-eUSDE-14AUG2025"
|
|
69
|
-
PT_E_USDE_29_MAY2025 = "PT-eUSDE-29MAY2025"
|
|
70
|
-
PT_S_USDE_25_SEP2025 = "PT-sUSDE-25SEP2025"
|
|
71
|
-
PT_S_USDE_31_JUL2025 = "PT-sUSDE-31JUL2025"
|
|
72
|
-
PT_US_DE_31_JUL2025 = "PT-USDe-31JUL2025"
|
|
73
|
-
PYUSD = "PYUSD"
|
|
74
|
-
R_ETH = "rETH"
|
|
75
|
-
RLUSD = "RLUSD"
|
|
76
|
-
RPL = "RPL"
|
|
77
|
-
RS_ETH = "rsETH"
|
|
78
|
-
S_DAI = "sDAI"
|
|
79
|
-
SNX = "SNX"
|
|
80
|
-
STG = "STG"
|
|
81
|
-
S_US_DE = "sUSDe"
|
|
82
|
-
T_BTC = "tBTC"
|
|
83
|
-
UNI = "UNI"
|
|
84
|
-
US_DB_C = "USDbC"
|
|
85
|
-
USD_CE = "USDCe"
|
|
86
|
-
USDC = "USDC"
|
|
87
|
-
US_DE = "USDe"
|
|
88
|
-
USDS = "USDS"
|
|
89
|
-
US_DTB = "USDtb"
|
|
90
|
-
USDT = "USDT"
|
|
91
|
-
VIRTUAL = "VIRTUAL"
|
|
92
|
-
WBTC = "WBTC"
|
|
93
|
-
WE_ETH = "weETH"
|
|
94
|
-
WELL = "WELL"
|
|
95
|
-
WETH = "WETH"
|
|
96
|
-
WRS_ETH = "wrsETH"
|
|
97
|
-
WST_ETH = "wstETH"
|
|
98
|
-
|
|
99
|
-
|
|
100
23
|
class V1AaveRateRequestTypedDict(TypedDict):
|
|
101
24
|
chain: V1AaveRateChain
|
|
102
25
|
block: NotRequired[Nullable[int]]
|
|
103
26
|
r"""Optional block number (defaults to latest)."""
|
|
104
|
-
token:
|
|
105
|
-
r"""The symbol of the
|
|
27
|
+
token: str
|
|
28
|
+
r"""The symbol or address of the token to fetch the user's position on.."""
|
|
106
29
|
|
|
107
30
|
|
|
108
31
|
class V1AaveRateRequest(BaseModel):
|
|
@@ -118,10 +41,9 @@ class V1AaveRateRequest(BaseModel):
|
|
|
118
41
|
r"""Optional block number (defaults to latest)."""
|
|
119
42
|
|
|
120
43
|
token: Annotated[
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
r"""The symbol of the asset to fetch the users' position on.."""
|
|
44
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
45
|
+
] = "USDC"
|
|
46
|
+
r"""The symbol or address of the token to fetch the user's position on.."""
|
|
125
47
|
|
|
126
48
|
@model_serializer(mode="wrap")
|
|
127
49
|
def serialize_model(self, handler):
|