compass_api_sdk 0.2.0__py3-none-any.whl → 0.2.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/models/__init__.py +46 -25
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +45 -11
- compass_api_sdk/models/aavelooprequest.py +87 -0
- compass_api_sdk/models/borrow.py +46 -12
- compass_api_sdk/models/liquidationcall.py +45 -18
- compass_api_sdk/models/morpho_market_positionop.py +5 -9
- compass_api_sdk/models/morpho_marketsop.py +5 -9
- compass_api_sdk/models/morpho_vault_positionop.py +5 -9
- compass_api_sdk/models/morpho_vaultsop.py +19 -17
- compass_api_sdk/models/morphoborrowrequest.py +8 -5
- compass_api_sdk/models/morphodepositrequest.py +8 -5
- compass_api_sdk/models/morphorepayrequest.py +8 -5
- compass_api_sdk/models/morphosetvaultallowancerequest.py +8 -5
- compass_api_sdk/models/morphosupplycollateralrequest.py +8 -5
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +8 -5
- compass_api_sdk/models/morphowithdrawrequest.py +8 -5
- compass_api_sdk/models/redeemunderlying.py +31 -4
- compass_api_sdk/models/repay.py +35 -4
- compass_api_sdk/models/reserve.py +67 -6
- compass_api_sdk/models/supply.py +37 -4
- compass_api_sdk/models/swapborrowrate.py +37 -8
- compass_api_sdk/models/uniswapbuyexactlyparams.py +6 -6
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +6 -6
- compass_api_sdk/models/usageascollateral.py +36 -4
- compass_api_sdk/morpho.py +63 -47
- compass_api_sdk/transaction_batching.py +284 -0
- compass_api_sdk/uniswap_v3.py +10 -10
- {compass_api_sdk-0.2.0.dist-info → compass_api_sdk-0.2.1.dist-info}/METADATA +2 -1
- {compass_api_sdk-0.2.0.dist-info → compass_api_sdk-0.2.1.dist-info}/RECORD +31 -34
- compass_api_sdk/models/aavehistoricaltransactionbase.py +0 -113
- compass_api_sdk/models/action.py +0 -14
- compass_api_sdk/models/collateralreserve.py +0 -16
- compass_api_sdk/models/principalreserve.py +0 -16
- {compass_api_sdk-0.2.0.dist-info → compass_api_sdk-0.2.1.dist-info}/WHEEL +0 -0
|
@@ -4,30 +4,26 @@ from __future__ import annotations
|
|
|
4
4
|
from compass_api_sdk.types import BaseModel
|
|
5
5
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
6
|
from enum import Enum
|
|
7
|
-
from
|
|
7
|
+
from typing import Optional
|
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class MorphoVaultPositionChain(str, Enum):
|
|
11
|
-
r"""The chain to use."""
|
|
12
|
-
|
|
13
|
-
BASE_MAINNET = "base:mainnet"
|
|
14
12
|
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
15
|
-
|
|
13
|
+
BASE_MAINNET = "base:mainnet"
|
|
16
14
|
|
|
17
15
|
|
|
18
16
|
class MorphoVaultPositionRequestTypedDict(TypedDict):
|
|
19
|
-
chain: MorphoVaultPositionChain
|
|
20
|
-
r"""The chain to use."""
|
|
17
|
+
chain: NotRequired[MorphoVaultPositionChain]
|
|
21
18
|
user_address: str
|
|
22
19
|
vault_address: str
|
|
23
20
|
|
|
24
21
|
|
|
25
22
|
class MorphoVaultPositionRequest(BaseModel):
|
|
26
23
|
chain: Annotated[
|
|
27
|
-
MorphoVaultPositionChain,
|
|
24
|
+
Optional[MorphoVaultPositionChain],
|
|
28
25
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
29
26
|
] = MorphoVaultPositionChain.ETHEREUM_MAINNET
|
|
30
|
-
r"""The chain to use."""
|
|
31
27
|
|
|
32
28
|
user_address: Annotated[
|
|
33
29
|
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
@@ -1,42 +1,44 @@
|
|
|
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
13
|
from pydantic import model_serializer
|
|
8
|
-
from
|
|
14
|
+
from typing import Optional
|
|
15
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
16
|
|
|
10
17
|
|
|
11
18
|
class MorphoVaultsChain(str, Enum):
|
|
12
|
-
r"""The chain to use."""
|
|
13
|
-
|
|
14
|
-
BASE_MAINNET = "base:mainnet"
|
|
15
19
|
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
16
|
-
|
|
20
|
+
BASE_MAINNET = "base:mainnet"
|
|
17
21
|
|
|
18
22
|
|
|
19
23
|
class MorphoVaultsRequestTypedDict(TypedDict):
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
r"""The chain to use."""
|
|
24
|
+
chain: NotRequired[MorphoVaultsChain]
|
|
25
|
+
deposit_token: NotRequired[Nullable[str]]
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
class MorphoVaultsRequest(BaseModel):
|
|
26
|
-
deposit_token: Annotated[
|
|
27
|
-
Nullable[str],
|
|
28
|
-
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
29
|
-
]
|
|
30
|
-
|
|
31
29
|
chain: Annotated[
|
|
32
|
-
MorphoVaultsChain,
|
|
30
|
+
Optional[MorphoVaultsChain],
|
|
33
31
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
34
32
|
] = MorphoVaultsChain.ETHEREUM_MAINNET
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
deposit_token: Annotated[
|
|
35
|
+
OptionalNullable[str],
|
|
36
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
37
|
+
] = UNSET
|
|
36
38
|
|
|
37
39
|
@model_serializer(mode="wrap")
|
|
38
40
|
def serialize_model(self, handler):
|
|
39
|
-
optional_fields = []
|
|
41
|
+
optional_fields = ["chain", "deposit_token"]
|
|
40
42
|
nullable_fields = ["deposit_token"]
|
|
41
43
|
null_default_fields = []
|
|
42
44
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,6 +8,7 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Union
|
|
14
14
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
@@ -26,13 +26,17 @@ MorphoBorrowRequestAmount = TypeAliasType(
|
|
|
26
26
|
r"""Amount of the token to borrow from the market."""
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class MorphoBorrowRequestChain(str, Enum):
|
|
30
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
31
|
+
BASE_MAINNET = "base:mainnet"
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
class MorphoBorrowRequestTypedDict(TypedDict):
|
|
30
35
|
amount: MorphoBorrowRequestAmountTypedDict
|
|
31
36
|
r"""Amount of the token to borrow from the market."""
|
|
32
37
|
unique_market_key: str
|
|
33
38
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
34
|
-
chain:
|
|
35
|
-
r"""The chain to use."""
|
|
39
|
+
chain: MorphoBorrowRequestChain
|
|
36
40
|
sender: str
|
|
37
41
|
r"""The address of the transaction sender."""
|
|
38
42
|
on_behalf_of: NotRequired[Nullable[str]]
|
|
@@ -48,8 +52,7 @@ class MorphoBorrowRequest(BaseModel):
|
|
|
48
52
|
unique_market_key: str
|
|
49
53
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
50
54
|
|
|
51
|
-
chain:
|
|
52
|
-
r"""The chain to use."""
|
|
55
|
+
chain: MorphoBorrowRequestChain
|
|
53
56
|
|
|
54
57
|
sender: str
|
|
55
58
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,6 +8,7 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Union
|
|
14
14
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
@@ -26,13 +26,17 @@ MorphoDepositRequestAmount = TypeAliasType(
|
|
|
26
26
|
r"""The amount of tokens to deposit into the vault."""
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class MorphoDepositRequestChain(str, Enum):
|
|
30
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
31
|
+
BASE_MAINNET = "base:mainnet"
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
class MorphoDepositRequestTypedDict(TypedDict):
|
|
30
35
|
vault_address: str
|
|
31
36
|
r"""The vault address you are depositing to."""
|
|
32
37
|
amount: MorphoDepositRequestAmountTypedDict
|
|
33
38
|
r"""The amount of tokens to deposit into the vault."""
|
|
34
|
-
chain:
|
|
35
|
-
r"""The chain to use."""
|
|
39
|
+
chain: MorphoDepositRequestChain
|
|
36
40
|
sender: str
|
|
37
41
|
r"""The address of the transaction sender."""
|
|
38
42
|
receiver: NotRequired[Nullable[str]]
|
|
@@ -46,8 +50,7 @@ class MorphoDepositRequest(BaseModel):
|
|
|
46
50
|
amount: MorphoDepositRequestAmount
|
|
47
51
|
r"""The amount of tokens to deposit into the vault."""
|
|
48
52
|
|
|
49
|
-
chain:
|
|
50
|
-
r"""The chain to use."""
|
|
53
|
+
chain: MorphoDepositRequestChain
|
|
51
54
|
|
|
52
55
|
sender: str
|
|
53
56
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,18 +8,23 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Any
|
|
14
14
|
from typing_extensions import NotRequired, TypedDict
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
class MorphoRepayRequestChain(str, Enum):
|
|
18
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
19
|
+
BASE_MAINNET = "base:mainnet"
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
class MorphoRepayRequestTypedDict(TypedDict):
|
|
18
23
|
amount: Any
|
|
19
24
|
r"""Amount of the token to repay to the market. If set to 'ALL', all debt plus interest will be paid back if the user has a sufficient token balance in their wallet."""
|
|
20
25
|
unique_market_key: str
|
|
21
26
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
22
|
-
chain:
|
|
23
|
-
r"""The chain to use."""
|
|
27
|
+
chain: MorphoRepayRequestChain
|
|
24
28
|
sender: str
|
|
25
29
|
r"""The address of the transaction sender."""
|
|
26
30
|
on_behalf_of: NotRequired[Nullable[str]]
|
|
@@ -36,8 +40,7 @@ class MorphoRepayRequest(BaseModel):
|
|
|
36
40
|
unique_market_key: str
|
|
37
41
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
38
42
|
|
|
39
|
-
chain:
|
|
40
|
-
r"""The chain to use."""
|
|
43
|
+
chain: MorphoRepayRequestChain
|
|
41
44
|
|
|
42
45
|
sender: str
|
|
43
46
|
r"""The address of the transaction sender."""
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import BaseModel
|
|
5
|
+
from enum import Enum
|
|
6
6
|
from typing import Union
|
|
7
7
|
from typing_extensions import TypeAliasType, TypedDict
|
|
8
8
|
|
|
@@ -19,13 +19,17 @@ MorphoSetVaultAllowanceRequestAmount = TypeAliasType(
|
|
|
19
19
|
r"""The amount of tokens to increase the allowance by."""
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
class MorphoSetVaultAllowanceRequestChain(str, Enum):
|
|
23
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
24
|
+
BASE_MAINNET = "base:mainnet"
|
|
25
|
+
|
|
26
|
+
|
|
22
27
|
class MorphoSetVaultAllowanceRequestTypedDict(TypedDict):
|
|
23
28
|
vault_address: str
|
|
24
29
|
r"""The vault address you are increasing the allowance for."""
|
|
25
30
|
amount: MorphoSetVaultAllowanceRequestAmountTypedDict
|
|
26
31
|
r"""The amount of tokens to increase the allowance by."""
|
|
27
|
-
chain:
|
|
28
|
-
r"""The chain to use."""
|
|
32
|
+
chain: MorphoSetVaultAllowanceRequestChain
|
|
29
33
|
sender: str
|
|
30
34
|
r"""The address of the transaction sender."""
|
|
31
35
|
|
|
@@ -37,8 +41,7 @@ class MorphoSetVaultAllowanceRequest(BaseModel):
|
|
|
37
41
|
amount: MorphoSetVaultAllowanceRequestAmount
|
|
38
42
|
r"""The amount of tokens to increase the allowance by."""
|
|
39
43
|
|
|
40
|
-
chain:
|
|
41
|
-
r"""The chain to use."""
|
|
44
|
+
chain: MorphoSetVaultAllowanceRequestChain
|
|
42
45
|
|
|
43
46
|
sender: str
|
|
44
47
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,6 +8,7 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Union
|
|
14
14
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
@@ -26,13 +26,17 @@ MorphoSupplyCollateralRequestAmount = TypeAliasType(
|
|
|
26
26
|
r"""Amount of the token to supply to the market as collateral."""
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class MorphoSupplyCollateralRequestChain(str, Enum):
|
|
30
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
31
|
+
BASE_MAINNET = "base:mainnet"
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
class MorphoSupplyCollateralRequestTypedDict(TypedDict):
|
|
30
35
|
amount: MorphoSupplyCollateralRequestAmountTypedDict
|
|
31
36
|
r"""Amount of the token to supply to the market as collateral."""
|
|
32
37
|
unique_market_key: str
|
|
33
38
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
34
|
-
chain:
|
|
35
|
-
r"""The chain to use."""
|
|
39
|
+
chain: MorphoSupplyCollateralRequestChain
|
|
36
40
|
sender: str
|
|
37
41
|
r"""The address of the transaction sender."""
|
|
38
42
|
on_behalf_of: NotRequired[Nullable[str]]
|
|
@@ -48,8 +52,7 @@ class MorphoSupplyCollateralRequest(BaseModel):
|
|
|
48
52
|
unique_market_key: str
|
|
49
53
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
50
54
|
|
|
51
|
-
chain:
|
|
52
|
-
r"""The chain to use."""
|
|
55
|
+
chain: MorphoSupplyCollateralRequestChain
|
|
53
56
|
|
|
54
57
|
sender: str
|
|
55
58
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,6 +8,7 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Union
|
|
14
14
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
@@ -26,13 +26,17 @@ MorphoWithdrawCollateralRequestAmount = TypeAliasType(
|
|
|
26
26
|
r"""Amount of the token to supply to the market as collateral."""
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
class MorphoWithdrawCollateralRequestChain(str, Enum):
|
|
30
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
31
|
+
BASE_MAINNET = "base:mainnet"
|
|
32
|
+
|
|
33
|
+
|
|
29
34
|
class MorphoWithdrawCollateralRequestTypedDict(TypedDict):
|
|
30
35
|
amount: MorphoWithdrawCollateralRequestAmountTypedDict
|
|
31
36
|
r"""Amount of the token to supply to the market as collateral."""
|
|
32
37
|
unique_market_key: str
|
|
33
38
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
34
|
-
chain:
|
|
35
|
-
r"""The chain to use."""
|
|
39
|
+
chain: MorphoWithdrawCollateralRequestChain
|
|
36
40
|
sender: str
|
|
37
41
|
r"""The address of the transaction sender."""
|
|
38
42
|
on_behalf_of: NotRequired[Nullable[str]]
|
|
@@ -48,8 +52,7 @@ class MorphoWithdrawCollateralRequest(BaseModel):
|
|
|
48
52
|
unique_market_key: str
|
|
49
53
|
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
50
54
|
|
|
51
|
-
chain:
|
|
52
|
-
r"""The chain to use."""
|
|
55
|
+
chain: MorphoWithdrawCollateralRequestChain
|
|
53
56
|
|
|
54
57
|
sender: str
|
|
55
58
|
r"""The address of the transaction sender."""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .chain import Chain
|
|
5
4
|
from compass_api_sdk.types import (
|
|
6
5
|
BaseModel,
|
|
7
6
|
Nullable,
|
|
@@ -9,18 +8,23 @@ from compass_api_sdk.types import (
|
|
|
9
8
|
UNSET,
|
|
10
9
|
UNSET_SENTINEL,
|
|
11
10
|
)
|
|
11
|
+
from enum import Enum
|
|
12
12
|
from pydantic import model_serializer
|
|
13
13
|
from typing import Any
|
|
14
14
|
from typing_extensions import NotRequired, TypedDict
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
class MorphoWithdrawRequestChain(str, Enum):
|
|
18
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
19
|
+
BASE_MAINNET = "base:mainnet"
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
class MorphoWithdrawRequestTypedDict(TypedDict):
|
|
18
23
|
vault_address: str
|
|
19
24
|
r"""The vault address you are withdrawing from."""
|
|
20
25
|
amount: Any
|
|
21
26
|
r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
|
|
22
|
-
chain:
|
|
23
|
-
r"""The chain to use."""
|
|
27
|
+
chain: MorphoWithdrawRequestChain
|
|
24
28
|
sender: str
|
|
25
29
|
r"""The address of the transaction sender."""
|
|
26
30
|
receiver: NotRequired[Nullable[str]]
|
|
@@ -34,8 +38,7 @@ class MorphoWithdrawRequest(BaseModel):
|
|
|
34
38
|
amount: Any
|
|
35
39
|
r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
|
|
36
40
|
|
|
37
|
-
chain:
|
|
38
|
-
r"""The chain to use."""
|
|
41
|
+
chain: MorphoWithdrawRequestChain
|
|
39
42
|
|
|
40
43
|
sender: str
|
|
41
44
|
r"""The address of the transaction sender."""
|
|
@@ -8,14 +8,41 @@ from typing_extensions import Annotated, TypedDict
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class RedeemUnderlyingTypedDict(TypedDict):
|
|
11
|
-
|
|
11
|
+
id: str
|
|
12
|
+
r"""The id of a historical transaction on aave"""
|
|
13
|
+
timestamp: int
|
|
14
|
+
r"""Timestamp in unix time"""
|
|
15
|
+
tx_hash: str
|
|
16
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
17
|
+
amount: float
|
|
18
|
+
r"""Quantity of token"""
|
|
12
19
|
reserve: ReserveTypedDict
|
|
13
|
-
asset_price_usd:
|
|
20
|
+
asset_price_usd: float
|
|
21
|
+
r"""Price of token in USD"""
|
|
22
|
+
action: str
|
|
23
|
+
r"""The type of transaction"""
|
|
24
|
+
block: int
|
|
14
25
|
|
|
15
26
|
|
|
16
27
|
class RedeemUnderlying(BaseModel):
|
|
17
|
-
|
|
28
|
+
id: str
|
|
29
|
+
r"""The id of a historical transaction on aave"""
|
|
30
|
+
|
|
31
|
+
timestamp: int
|
|
32
|
+
r"""Timestamp in unix time"""
|
|
33
|
+
|
|
34
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
35
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
36
|
+
|
|
37
|
+
amount: float
|
|
38
|
+
r"""Quantity of token"""
|
|
18
39
|
|
|
19
40
|
reserve: Reserve
|
|
20
41
|
|
|
21
|
-
asset_price_usd: Annotated[
|
|
42
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
43
|
+
r"""Price of token in USD"""
|
|
44
|
+
|
|
45
|
+
action: str
|
|
46
|
+
r"""The type of transaction"""
|
|
47
|
+
|
|
48
|
+
block: int
|
compass_api_sdk/models/repay.py
CHANGED
|
@@ -3,19 +3,50 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .reserve import Reserve, ReserveTypedDict
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
7
10
|
from typing_extensions import Annotated, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class RepayTypedDict(TypedDict):
|
|
11
|
-
|
|
14
|
+
id: str
|
|
15
|
+
r"""The id of a historical transaction on aave"""
|
|
16
|
+
timestamp: int
|
|
17
|
+
r"""Timestamp in unix time"""
|
|
18
|
+
tx_hash: str
|
|
19
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
20
|
+
amount: float
|
|
21
|
+
r"""Quantity of token"""
|
|
12
22
|
reserve: ReserveTypedDict
|
|
13
|
-
asset_price_usd:
|
|
23
|
+
asset_price_usd: float
|
|
24
|
+
block: int
|
|
25
|
+
action: Literal["Repay"]
|
|
26
|
+
r"""The type of transaction"""
|
|
14
27
|
|
|
15
28
|
|
|
16
29
|
class Repay(BaseModel):
|
|
17
|
-
|
|
30
|
+
id: str
|
|
31
|
+
r"""The id of a historical transaction on aave"""
|
|
32
|
+
|
|
33
|
+
timestamp: int
|
|
34
|
+
r"""Timestamp in unix time"""
|
|
35
|
+
|
|
36
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
37
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
38
|
+
|
|
39
|
+
amount: float
|
|
40
|
+
r"""Quantity of token"""
|
|
18
41
|
|
|
19
42
|
reserve: Reserve
|
|
20
43
|
|
|
21
|
-
asset_price_usd: Annotated[
|
|
44
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
45
|
+
|
|
46
|
+
block: int
|
|
47
|
+
|
|
48
|
+
ACTION: Annotated[
|
|
49
|
+
Annotated[Literal["Repay"], AfterValidator(validate_const("Repay"))],
|
|
50
|
+
pydantic.Field(alias="action"),
|
|
51
|
+
] = "Repay"
|
|
52
|
+
r"""The type of transaction"""
|
|
@@ -1,16 +1,77 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from
|
|
5
|
-
from
|
|
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
|
+
)
|
|
12
|
+
import pydantic
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
6
15
|
|
|
7
16
|
|
|
8
17
|
class ReserveTypedDict(TypedDict):
|
|
9
|
-
symbol:
|
|
10
|
-
|
|
18
|
+
symbol: TokenEnum
|
|
19
|
+
r"""A class representing the token.
|
|
20
|
+
|
|
21
|
+
This class is used to represent the token in the system. Notice individual
|
|
22
|
+
endpoints' documentation where per chain tokens are presented.
|
|
23
|
+
"""
|
|
24
|
+
name: str
|
|
25
|
+
r"""Name of Token"""
|
|
26
|
+
underlying_asset: str
|
|
27
|
+
r"""Checksum address of Token."""
|
|
28
|
+
decimals: NotRequired[Nullable[int]]
|
|
29
|
+
r"""Number of decimals of token."""
|
|
11
30
|
|
|
12
31
|
|
|
13
32
|
class Reserve(BaseModel):
|
|
14
|
-
symbol:
|
|
33
|
+
symbol: TokenEnum
|
|
34
|
+
r"""A class representing the token.
|
|
35
|
+
|
|
36
|
+
This class is used to represent the token in the system. Notice individual
|
|
37
|
+
endpoints' documentation where per chain tokens are presented.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
name: str
|
|
41
|
+
r"""Name of Token"""
|
|
42
|
+
|
|
43
|
+
underlying_asset: Annotated[str, pydantic.Field(alias="underlyingAsset")]
|
|
44
|
+
r"""Checksum address of Token."""
|
|
45
|
+
|
|
46
|
+
decimals: OptionalNullable[int] = UNSET
|
|
47
|
+
r"""Number of decimals of token."""
|
|
48
|
+
|
|
49
|
+
@model_serializer(mode="wrap")
|
|
50
|
+
def serialize_model(self, handler):
|
|
51
|
+
optional_fields = ["decimals"]
|
|
52
|
+
nullable_fields = ["decimals"]
|
|
53
|
+
null_default_fields = []
|
|
54
|
+
|
|
55
|
+
serialized = handler(self)
|
|
56
|
+
|
|
57
|
+
m = {}
|
|
58
|
+
|
|
59
|
+
for n, f in type(self).model_fields.items():
|
|
60
|
+
k = f.alias or n
|
|
61
|
+
val = serialized.get(k)
|
|
62
|
+
serialized.pop(k, None)
|
|
63
|
+
|
|
64
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
65
|
+
is_set = (
|
|
66
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
67
|
+
or k in null_default_fields
|
|
68
|
+
) # pylint: disable=no-member
|
|
69
|
+
|
|
70
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
71
|
+
m[k] = val
|
|
72
|
+
elif val != UNSET_SENTINEL and (
|
|
73
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
74
|
+
):
|
|
75
|
+
m[k] = val
|
|
15
76
|
|
|
16
|
-
|
|
77
|
+
return m
|
compass_api_sdk/models/supply.py
CHANGED
|
@@ -3,19 +3,52 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .reserve import Reserve, ReserveTypedDict
|
|
5
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
6
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
7
10
|
from typing_extensions import Annotated, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
class SupplyTypedDict(TypedDict):
|
|
11
|
-
|
|
14
|
+
id: str
|
|
15
|
+
r"""The id of a historical transaction on aave"""
|
|
16
|
+
timestamp: int
|
|
17
|
+
r"""Timestamp in unix time"""
|
|
18
|
+
tx_hash: str
|
|
19
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
20
|
+
amount: float
|
|
21
|
+
r"""Quantity of token"""
|
|
12
22
|
reserve: ReserveTypedDict
|
|
13
|
-
asset_price_usd:
|
|
23
|
+
asset_price_usd: float
|
|
24
|
+
r"""Price of token in USD"""
|
|
25
|
+
block: int
|
|
26
|
+
action: Literal["Supply"]
|
|
27
|
+
r"""The type of transaction"""
|
|
14
28
|
|
|
15
29
|
|
|
16
30
|
class Supply(BaseModel):
|
|
17
|
-
|
|
31
|
+
id: str
|
|
32
|
+
r"""The id of a historical transaction on aave"""
|
|
33
|
+
|
|
34
|
+
timestamp: int
|
|
35
|
+
r"""Timestamp in unix time"""
|
|
36
|
+
|
|
37
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
38
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
39
|
+
|
|
40
|
+
amount: float
|
|
41
|
+
r"""Quantity of token"""
|
|
18
42
|
|
|
19
43
|
reserve: Reserve
|
|
20
44
|
|
|
21
|
-
asset_price_usd: Annotated[
|
|
45
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
46
|
+
r"""Price of token in USD"""
|
|
47
|
+
|
|
48
|
+
block: int
|
|
49
|
+
|
|
50
|
+
ACTION: Annotated[
|
|
51
|
+
Annotated[Literal["Supply"], AfterValidator(validate_const("Supply"))],
|
|
52
|
+
pydantic.Field(alias="action"),
|
|
53
|
+
] = "Supply"
|
|
54
|
+
r"""The type of transaction"""
|