compass_api_sdk 0.1.14__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 +3 -3
- compass_api_sdk/aave_v3.py +214 -0
- compass_api_sdk/models/__init__.py +62 -25
- compass_api_sdk/models/aave_reserve_overviewop.py +97 -0
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +45 -11
- compass_api_sdk/models/aavelooprequest.py +87 -0
- compass_api_sdk/models/aavereserveoverviewresponse.py +25 -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.1.14.dist-info → compass_api_sdk-0.2.1.dist-info}/METADATA +12 -11
- {compass_api_sdk-0.1.14.dist-info → compass_api_sdk-0.2.1.dist-info}/RECORD +34 -35
- 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.1.14.dist-info → compass_api_sdk-0.2.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from .signedauthorization import SignedAuthorization, SignedAuthorizationTypedDict
|
|
6
|
+
from .token_enum import TokenEnum
|
|
7
|
+
from compass_api_sdk.types import BaseModel
|
|
8
|
+
from typing import Union
|
|
9
|
+
from typing_extensions import TypeAliasType, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
CollateralAmountTypedDict = TypeAliasType(
|
|
13
|
+
"CollateralAmountTypedDict", Union[float, str]
|
|
14
|
+
)
|
|
15
|
+
r"""Amount of collateral token to supply to Aave"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
CollateralAmount = TypeAliasType("CollateralAmount", Union[float, str])
|
|
19
|
+
r"""Amount of collateral token to supply to Aave"""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AaveLoopRequestTypedDict(TypedDict):
|
|
23
|
+
r"""Request model for executing an Aave loop transaction."""
|
|
24
|
+
|
|
25
|
+
chain: Chain
|
|
26
|
+
r"""The chain to use."""
|
|
27
|
+
sender: str
|
|
28
|
+
r"""The address of the transaction sender."""
|
|
29
|
+
signed_authorization: SignedAuthorizationTypedDict
|
|
30
|
+
collateral_token: TokenEnum
|
|
31
|
+
r"""A class representing the token.
|
|
32
|
+
|
|
33
|
+
This class is used to represent the token in the system. Notice individual
|
|
34
|
+
endpoints' documentation where per chain tokens are presented.
|
|
35
|
+
"""
|
|
36
|
+
borrow_token: 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
|
+
"""
|
|
42
|
+
collateral_amount: CollateralAmountTypedDict
|
|
43
|
+
r"""Amount of collateral token to supply to Aave"""
|
|
44
|
+
loop_count: int
|
|
45
|
+
r"""Number of times to perform the supply-borrow loop"""
|
|
46
|
+
max_slippage_percent: float
|
|
47
|
+
r"""Maximum allowed slippage for token swaps in percentage"""
|
|
48
|
+
loan_to_value: float
|
|
49
|
+
r"""Loan To Value percentage of the loop"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AaveLoopRequest(BaseModel):
|
|
53
|
+
r"""Request model for executing an Aave loop transaction."""
|
|
54
|
+
|
|
55
|
+
chain: Chain
|
|
56
|
+
r"""The chain to use."""
|
|
57
|
+
|
|
58
|
+
sender: str
|
|
59
|
+
r"""The address of the transaction sender."""
|
|
60
|
+
|
|
61
|
+
signed_authorization: SignedAuthorization
|
|
62
|
+
|
|
63
|
+
collateral_token: TokenEnum
|
|
64
|
+
r"""A class representing the token.
|
|
65
|
+
|
|
66
|
+
This class is used to represent the token in the system. Notice individual
|
|
67
|
+
endpoints' documentation where per chain tokens are presented.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
borrow_token: TokenEnum
|
|
71
|
+
r"""A class representing the token.
|
|
72
|
+
|
|
73
|
+
This class is used to represent the token in the system. Notice individual
|
|
74
|
+
endpoints' documentation where per chain tokens are presented.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
collateral_amount: CollateralAmount
|
|
78
|
+
r"""Amount of collateral token to supply to Aave"""
|
|
79
|
+
|
|
80
|
+
loop_count: int
|
|
81
|
+
r"""Number of times to perform the supply-borrow loop"""
|
|
82
|
+
|
|
83
|
+
max_slippage_percent: float
|
|
84
|
+
r"""Maximum allowed slippage for token swaps in percentage"""
|
|
85
|
+
|
|
86
|
+
loan_to_value: float
|
|
87
|
+
r"""Loan To Value percentage of the loop"""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import BaseModel
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AaveReserveOverviewResponseTypedDict(TypedDict):
|
|
9
|
+
tvl: float
|
|
10
|
+
r"""Total tokens supplied in an Aave Reserve in USD. E.G. How much WBTC has been supplied on Aave in USD."""
|
|
11
|
+
total_borrowed: float
|
|
12
|
+
r"""Total tokens borrowed in an Aave Reserve converted to USD. E.G. How much WBTC has been supplied on Aave (in USD)."""
|
|
13
|
+
utilization_ratio: float
|
|
14
|
+
r"""Total borrowed divided by total supplied in an Aave Reserve. E.G. How much WBTC has been borrowed on Aaave divided by the amount supplied"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AaveReserveOverviewResponse(BaseModel):
|
|
18
|
+
tvl: float
|
|
19
|
+
r"""Total tokens supplied in an Aave Reserve in USD. E.G. How much WBTC has been supplied on Aave in USD."""
|
|
20
|
+
|
|
21
|
+
total_borrowed: float
|
|
22
|
+
r"""Total tokens borrowed in an Aave Reserve converted to USD. E.G. How much WBTC has been supplied on Aave (in USD)."""
|
|
23
|
+
|
|
24
|
+
utilization_ratio: float
|
|
25
|
+
r"""Total borrowed divided by total supplied in an Aave Reserve. E.G. How much WBTC has been borrowed on Aaave divided by the amount supplied"""
|
compass_api_sdk/models/borrow.py
CHANGED
|
@@ -3,31 +3,65 @@
|
|
|
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
|
|
7
|
+
from enum import Enum
|
|
6
8
|
import pydantic
|
|
9
|
+
from pydantic.functional_validators import AfterValidator
|
|
10
|
+
from typing import Literal
|
|
7
11
|
from typing_extensions import Annotated, TypedDict
|
|
8
12
|
|
|
9
13
|
|
|
14
|
+
class Borrowratemode(int, Enum):
|
|
15
|
+
r"""The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode"""
|
|
16
|
+
|
|
17
|
+
ONE = 1
|
|
18
|
+
TWO = 2
|
|
19
|
+
|
|
20
|
+
|
|
10
21
|
class BorrowTypedDict(TypedDict):
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
id: str
|
|
23
|
+
r"""The id of a historical transaction on aave"""
|
|
24
|
+
timestamp: int
|
|
25
|
+
r"""Timestamp in unix time"""
|
|
26
|
+
tx_hash: str
|
|
27
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
28
|
+
amount: float
|
|
29
|
+
r"""Quantity of token"""
|
|
30
|
+
borrow_rate_mode: Borrowratemode
|
|
31
|
+
r"""The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode"""
|
|
16
32
|
reserve: ReserveTypedDict
|
|
17
|
-
asset_price_usd:
|
|
33
|
+
asset_price_usd: float
|
|
34
|
+
r"""Price of token in USD"""
|
|
35
|
+
block: int
|
|
36
|
+
action: Literal["Borrow"]
|
|
37
|
+
r"""The type of transaction"""
|
|
18
38
|
|
|
19
39
|
|
|
20
40
|
class Borrow(BaseModel):
|
|
21
|
-
|
|
41
|
+
id: str
|
|
42
|
+
r"""The id of a historical transaction on aave"""
|
|
22
43
|
|
|
23
|
-
|
|
44
|
+
timestamp: int
|
|
45
|
+
r"""Timestamp in unix time"""
|
|
24
46
|
|
|
25
|
-
|
|
47
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
48
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
26
49
|
|
|
27
|
-
|
|
50
|
+
amount: float
|
|
51
|
+
r"""Quantity of token"""
|
|
28
52
|
|
|
29
|
-
|
|
53
|
+
borrow_rate_mode: Annotated[Borrowratemode, pydantic.Field(alias="borrowRateMode")]
|
|
54
|
+
r"""The interest rate mode to borrow: 1 represents stable interest rate mode. 2 represents variable interest rate mode"""
|
|
30
55
|
|
|
31
56
|
reserve: Reserve
|
|
32
57
|
|
|
33
|
-
asset_price_usd: Annotated[
|
|
58
|
+
asset_price_usd: Annotated[float, pydantic.Field(alias="assetPriceUSD")]
|
|
59
|
+
r"""Price of token in USD"""
|
|
60
|
+
|
|
61
|
+
block: int
|
|
62
|
+
|
|
63
|
+
ACTION: Annotated[
|
|
64
|
+
Annotated[Literal["Borrow"], AfterValidator(validate_const("Borrow"))],
|
|
65
|
+
pydantic.Field(alias="action"),
|
|
66
|
+
] = "Borrow"
|
|
67
|
+
r"""The type of transaction"""
|
|
@@ -1,37 +1,64 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .
|
|
5
|
-
from .principalreserve import PrincipalReserve, PrincipalReserveTypedDict
|
|
4
|
+
from .reserve import Reserve, ReserveTypedDict
|
|
6
5
|
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
7
7
|
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal
|
|
8
10
|
from typing_extensions import Annotated, TypedDict
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
class LiquidationCallTypedDict(TypedDict):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
collateral_amount: float
|
|
21
|
+
collateral_reserve: ReserveTypedDict
|
|
22
|
+
principal_amount: float
|
|
23
|
+
principal_reserve: ReserveTypedDict
|
|
24
|
+
collateral_asset_price_usd: float
|
|
25
|
+
borrow_asset_price_usd: float
|
|
26
|
+
block: int
|
|
27
|
+
action: Literal["LiquidationCall"]
|
|
18
28
|
|
|
19
29
|
|
|
20
30
|
class LiquidationCall(BaseModel):
|
|
21
|
-
|
|
31
|
+
id: str
|
|
32
|
+
r"""The id of a historical transaction on aave"""
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
]
|
|
34
|
+
timestamp: int
|
|
35
|
+
r"""Timestamp in unix time"""
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
tx_hash: Annotated[str, pydantic.Field(alias="txHash")]
|
|
38
|
+
r"""Transaction hash. You can paste these into the search bar on etherscan"""
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
40
|
+
collateral_amount: Annotated[float, pydantic.Field(alias="collateralAmount")]
|
|
41
|
+
|
|
42
|
+
collateral_reserve: Annotated[Reserve, pydantic.Field(alias="collateralReserve")]
|
|
43
|
+
|
|
44
|
+
principal_amount: Annotated[float, pydantic.Field(alias="principalAmount")]
|
|
45
|
+
|
|
46
|
+
principal_reserve: Annotated[Reserve, pydantic.Field(alias="principalReserve")]
|
|
32
47
|
|
|
33
48
|
collateral_asset_price_usd: Annotated[
|
|
34
|
-
|
|
49
|
+
float, pydantic.Field(alias="collateralAssetPriceUSD")
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
borrow_asset_price_usd: Annotated[
|
|
53
|
+
float, pydantic.Field(alias="borrowAssetPriceUSD")
|
|
35
54
|
]
|
|
36
55
|
|
|
37
|
-
|
|
56
|
+
block: int
|
|
57
|
+
|
|
58
|
+
ACTION: Annotated[
|
|
59
|
+
Annotated[
|
|
60
|
+
Literal["LiquidationCall"],
|
|
61
|
+
AfterValidator(validate_const("LiquidationCall")),
|
|
62
|
+
],
|
|
63
|
+
pydantic.Field(alias="action"),
|
|
64
|
+
] = "LiquidationCall"
|
|
@@ -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 MorphoMarketPositionChain(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 MorphoMarketPositionRequestTypedDict(TypedDict):
|
|
19
|
-
chain: MorphoMarketPositionChain
|
|
20
|
-
r"""The chain to use."""
|
|
17
|
+
chain: NotRequired[MorphoMarketPositionChain]
|
|
21
18
|
user_address: str
|
|
22
19
|
unique_market_key: str
|
|
23
20
|
|
|
24
21
|
|
|
25
22
|
class MorphoMarketPositionRequest(BaseModel):
|
|
26
23
|
chain: Annotated[
|
|
27
|
-
MorphoMarketPositionChain,
|
|
24
|
+
Optional[MorphoMarketPositionChain],
|
|
28
25
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
29
26
|
] = MorphoMarketPositionChain.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))
|
|
@@ -11,30 +11,26 @@ from compass_api_sdk.types import (
|
|
|
11
11
|
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
12
12
|
from enum import Enum
|
|
13
13
|
from pydantic import model_serializer
|
|
14
|
+
from typing import Optional
|
|
14
15
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
class MorphoMarketsChain(str, Enum):
|
|
18
|
-
r"""The chain to use."""
|
|
19
|
-
|
|
20
|
-
BASE_MAINNET = "base:mainnet"
|
|
21
19
|
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
22
|
-
|
|
20
|
+
BASE_MAINNET = "base:mainnet"
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
class MorphoMarketsRequestTypedDict(TypedDict):
|
|
26
|
-
chain: MorphoMarketsChain
|
|
27
|
-
r"""The chain to use."""
|
|
24
|
+
chain: NotRequired[MorphoMarketsChain]
|
|
28
25
|
collateral_token: NotRequired[Nullable[str]]
|
|
29
26
|
loan_token: NotRequired[Nullable[str]]
|
|
30
27
|
|
|
31
28
|
|
|
32
29
|
class MorphoMarketsRequest(BaseModel):
|
|
33
30
|
chain: Annotated[
|
|
34
|
-
MorphoMarketsChain,
|
|
31
|
+
Optional[MorphoMarketsChain],
|
|
35
32
|
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
36
33
|
] = MorphoMarketsChain.ETHEREUM_MAINNET
|
|
37
|
-
r"""The chain to use."""
|
|
38
34
|
|
|
39
35
|
collateral_token: Annotated[
|
|
40
36
|
OptionalNullable[str],
|
|
@@ -48,7 +44,7 @@ class MorphoMarketsRequest(BaseModel):
|
|
|
48
44
|
|
|
49
45
|
@model_serializer(mode="wrap")
|
|
50
46
|
def serialize_model(self, handler):
|
|
51
|
-
optional_fields = ["collateral_token", "loan_token"]
|
|
47
|
+
optional_fields = ["chain", "collateral_token", "loan_token"]
|
|
52
48
|
nullable_fields = ["collateral_token", "loan_token"]
|
|
53
49
|
null_default_fields = []
|
|
54
50
|
|
|
@@ -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."""
|