compass_api_sdk 0.0.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/__init__.py +17 -0
- compass_api_sdk/_hooks/__init__.py +5 -0
- compass_api_sdk/_hooks/registration.py +13 -0
- compass_api_sdk/_hooks/sdkhooks.py +76 -0
- compass_api_sdk/_hooks/types.py +106 -0
- compass_api_sdk/_version.py +15 -0
- compass_api_sdk/aave_v3.py +1903 -0
- compass_api_sdk/aerodrome_slipstream.py +1875 -0
- compass_api_sdk/basesdk.py +362 -0
- compass_api_sdk/errors/__init__.py +7 -0
- compass_api_sdk/errors/apierror.py +22 -0
- compass_api_sdk/errors/httpvalidationerror.py +21 -0
- compass_api_sdk/httpclient.py +136 -0
- compass_api_sdk/models/__init__.py +777 -0
- compass_api_sdk/models/aave_liquidity_changeop.py +108 -0
- compass_api_sdk/models/aave_token_priceop.py +98 -0
- compass_api_sdk/models/aave_user_position_per_tokenop.py +104 -0
- compass_api_sdk/models/aave_user_position_summaryop.py +35 -0
- compass_api_sdk/models/aaveborrowrequest.py +105 -0
- compass_api_sdk/models/aaveliquiditychangeresponse.py +26 -0
- compass_api_sdk/models/aaverepayrequest.py +105 -0
- compass_api_sdk/models/aavesupplyrequest.py +93 -0
- compass_api_sdk/models/aavetokenpriceresponse.py +15 -0
- compass_api_sdk/models/aaveuserpositionpertokenresponse.py +73 -0
- compass_api_sdk/models/aaveuserpositionsummaryresponse.py +50 -0
- compass_api_sdk/models/aavewithdrawrequest.py +58 -0
- compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +35 -0
- compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +173 -0
- compass_api_sdk/models/aerodromelppositionsresponse.py +21 -0
- compass_api_sdk/models/aerodromeposition.py +70 -0
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +92 -0
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +109 -0
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +186 -0
- compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +57 -0
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +96 -0
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +50 -0
- compass_api_sdk/models/allowanceinforesponse.py +48 -0
- compass_api_sdk/models/balanceinforesponse.py +43 -0
- compass_api_sdk/models/chain.py +12 -0
- compass_api_sdk/models/chaininfo.py +53 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_asset.py +22 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_asset.py +23 -0
- compass_api_sdk/models/ensnameinforesponse.py +24 -0
- compass_api_sdk/models/feeenum.py +16 -0
- compass_api_sdk/models/generic_allowanceop.py +121 -0
- compass_api_sdk/models/generic_balanceop.py +104 -0
- compass_api_sdk/models/generic_ensop.py +35 -0
- compass_api_sdk/models/generic_portfolioop.py +35 -0
- compass_api_sdk/models/generic_price_usdop.py +98 -0
- compass_api_sdk/models/generic_supported_tokensop.py +29 -0
- compass_api_sdk/models/generic_visualize_portfolioop.py +35 -0
- compass_api_sdk/models/image.py +15 -0
- compass_api_sdk/models/increaseallowancerequest.py +77 -0
- compass_api_sdk/models/interestratemode.py +14 -0
- compass_api_sdk/models/marketstate.py +35 -0
- compass_api_sdk/models/morpho_market_positionop.py +39 -0
- compass_api_sdk/models/morpho_marketsop.py +78 -0
- compass_api_sdk/models/morpho_vault_positionop.py +39 -0
- compass_api_sdk/models/morpho_vaultsop.py +72 -0
- compass_api_sdk/models/morphoborrowrequest.py +91 -0
- compass_api_sdk/models/morphocheckmarketpositionresponse.py +23 -0
- compass_api_sdk/models/morphocheckvaultpositionresponse.py +20 -0
- compass_api_sdk/models/morphodepositrequest.py +86 -0
- compass_api_sdk/models/morphogetmarketsresponse.py +17 -0
- compass_api_sdk/models/morphogetvaultsresponse.py +17 -0
- compass_api_sdk/models/morphomarket.py +80 -0
- compass_api_sdk/models/morphorepayrequest.py +79 -0
- compass_api_sdk/models/morphosetvaultallowancerequest.py +44 -0
- compass_api_sdk/models/morphosupplycollateralrequest.py +91 -0
- compass_api_sdk/models/morphovault.py +47 -0
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +91 -0
- compass_api_sdk/models/morphowithdrawrequest.py +74 -0
- compass_api_sdk/models/portfolio.py +22 -0
- compass_api_sdk/models/priceresponse.py +15 -0
- compass_api_sdk/models/security.py +24 -0
- compass_api_sdk/models/token_addressop.py +98 -0
- compass_api_sdk/models/token_balanceop.py +49 -0
- compass_api_sdk/models/token_enum.py +57 -0
- compass_api_sdk/models/token_priceop.py +97 -0
- compass_api_sdk/models/tokenaddressresponse.py +15 -0
- compass_api_sdk/models/tokenbalance.py +49 -0
- compass_api_sdk/models/tokenbalanceresponse.py +44 -0
- compass_api_sdk/models/tokeninfo.py +17 -0
- compass_api_sdk/models/tokenpriceresponse.py +15 -0
- compass_api_sdk/models/tokentransferrequest.py +66 -0
- compass_api_sdk/models/transfererc20request.py +62 -0
- compass_api_sdk/models/transferethrequest.py +46 -0
- compass_api_sdk/models/uniswap_liquidity_provision_in_rangeop.py +34 -0
- compass_api_sdk/models/uniswap_liquidity_provision_positionsop.py +35 -0
- compass_api_sdk/models/uniswap_pool_priceop.py +193 -0
- compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +209 -0
- compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +209 -0
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +104 -0
- compass_api_sdk/models/uniswapbuyquoteinforesponse.py +20 -0
- compass_api_sdk/models/uniswapcheckinrangeresponse.py +15 -0
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +99 -0
- compass_api_sdk/models/uniswaplppositionsinforesponse.py +24 -0
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +185 -0
- compass_api_sdk/models/uniswappoolpriceresponse.py +47 -0
- compass_api_sdk/models/uniswappositionssolidityresponse.py +46 -0
- compass_api_sdk/models/uniswapsellexactlyrequest.py +104 -0
- compass_api_sdk/models/uniswapsellquoteinforesponse.py +20 -0
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +51 -0
- compass_api_sdk/models/unsignedtransaction.py +58 -0
- compass_api_sdk/models/unwrapwethrequest.py +41 -0
- compass_api_sdk/models/validationerror.py +26 -0
- compass_api_sdk/models/vaultstate.py +32 -0
- compass_api_sdk/models/weeklyapys.py +23 -0
- compass_api_sdk/models/wrapethrequest.py +41 -0
- compass_api_sdk/morpho.py +2577 -0
- compass_api_sdk/py.typed +1 -0
- compass_api_sdk/sdk.py +155 -0
- compass_api_sdk/sdkconfiguration.py +56 -0
- compass_api_sdk/token_sdk.py +861 -0
- compass_api_sdk/types/__init__.py +21 -0
- compass_api_sdk/types/basemodel.py +39 -0
- compass_api_sdk/uniswap_v3.py +2551 -0
- compass_api_sdk/universal.py +2625 -0
- compass_api_sdk/utils/__init__.py +100 -0
- compass_api_sdk/utils/annotations.py +55 -0
- compass_api_sdk/utils/datetimes.py +23 -0
- compass_api_sdk/utils/enums.py +74 -0
- compass_api_sdk/utils/eventstreaming.py +238 -0
- compass_api_sdk/utils/forms.py +202 -0
- compass_api_sdk/utils/headers.py +136 -0
- compass_api_sdk/utils/logger.py +22 -0
- compass_api_sdk/utils/metadata.py +118 -0
- compass_api_sdk/utils/queryparams.py +205 -0
- compass_api_sdk/utils/requestbodies.py +66 -0
- compass_api_sdk/utils/retries.py +217 -0
- compass_api_sdk/utils/security.py +174 -0
- compass_api_sdk/utils/serializers.py +248 -0
- compass_api_sdk/utils/url.py +155 -0
- compass_api_sdk/utils/values.py +137 -0
- compass_api_sdk-0.0.1.dist-info/METADATA +534 -0
- compass_api_sdk-0.0.1.dist-info/RECORD +137 -0
- compass_api_sdk-0.0.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
11
|
+
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
12
|
+
from enum import Enum
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing import Optional
|
|
15
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class MorphoMarketsChain(str, Enum):
|
|
19
|
+
r"""The chain to use."""
|
|
20
|
+
|
|
21
|
+
BASE_MAINNET = "base:mainnet"
|
|
22
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
23
|
+
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MorphoMarketsRequestTypedDict(TypedDict):
|
|
27
|
+
chain: NotRequired[MorphoMarketsChain]
|
|
28
|
+
r"""The chain to use."""
|
|
29
|
+
collateral_token: NotRequired[Nullable[str]]
|
|
30
|
+
loan_token: NotRequired[Nullable[str]]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class MorphoMarketsRequest(BaseModel):
|
|
34
|
+
chain: Annotated[
|
|
35
|
+
Optional[MorphoMarketsChain],
|
|
36
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
37
|
+
] = MorphoMarketsChain.ETHEREUM_MAINNET
|
|
38
|
+
r"""The chain to use."""
|
|
39
|
+
|
|
40
|
+
collateral_token: Annotated[
|
|
41
|
+
OptionalNullable[str],
|
|
42
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
43
|
+
] = UNSET
|
|
44
|
+
|
|
45
|
+
loan_token: Annotated[
|
|
46
|
+
OptionalNullable[str],
|
|
47
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
48
|
+
] = UNSET
|
|
49
|
+
|
|
50
|
+
@model_serializer(mode="wrap")
|
|
51
|
+
def serialize_model(self, handler):
|
|
52
|
+
optional_fields = ["chain", "collateral_token", "loan_token"]
|
|
53
|
+
nullable_fields = ["collateral_token", "loan_token"]
|
|
54
|
+
null_default_fields = []
|
|
55
|
+
|
|
56
|
+
serialized = handler(self)
|
|
57
|
+
|
|
58
|
+
m = {}
|
|
59
|
+
|
|
60
|
+
for n, f in type(self).model_fields.items():
|
|
61
|
+
k = f.alias or n
|
|
62
|
+
val = serialized.get(k)
|
|
63
|
+
serialized.pop(k, None)
|
|
64
|
+
|
|
65
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
66
|
+
is_set = (
|
|
67
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
68
|
+
or k in null_default_fields
|
|
69
|
+
) # pylint: disable=no-member
|
|
70
|
+
|
|
71
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
72
|
+
m[k] = val
|
|
73
|
+
elif val != UNSET_SENTINEL and (
|
|
74
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
75
|
+
):
|
|
76
|
+
m[k] = val
|
|
77
|
+
|
|
78
|
+
return m
|
|
@@ -0,0 +1,39 @@
|
|
|
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 compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
6
|
+
from enum import Enum
|
|
7
|
+
from typing import Optional
|
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class MorphoVaultPositionChain(str, Enum):
|
|
12
|
+
r"""The chain to use."""
|
|
13
|
+
|
|
14
|
+
BASE_MAINNET = "base:mainnet"
|
|
15
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
16
|
+
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class MorphoVaultPositionRequestTypedDict(TypedDict):
|
|
20
|
+
chain: NotRequired[MorphoVaultPositionChain]
|
|
21
|
+
r"""The chain to use."""
|
|
22
|
+
user_address: str
|
|
23
|
+
vault_address: str
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MorphoVaultPositionRequest(BaseModel):
|
|
27
|
+
chain: Annotated[
|
|
28
|
+
Optional[MorphoVaultPositionChain],
|
|
29
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
30
|
+
] = MorphoVaultPositionChain.ETHEREUM_MAINNET
|
|
31
|
+
r"""The chain to use."""
|
|
32
|
+
|
|
33
|
+
user_address: Annotated[
|
|
34
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
35
|
+
] = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B"
|
|
36
|
+
|
|
37
|
+
vault_address: Annotated[
|
|
38
|
+
str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
|
|
39
|
+
] = "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
11
|
+
from compass_api_sdk.utils import FieldMetadata, QueryParamMetadata
|
|
12
|
+
from enum import Enum
|
|
13
|
+
from pydantic import model_serializer
|
|
14
|
+
from typing import Optional
|
|
15
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class MorphoVaultsChain(str, Enum):
|
|
19
|
+
r"""The chain to use."""
|
|
20
|
+
|
|
21
|
+
BASE_MAINNET = "base:mainnet"
|
|
22
|
+
ETHEREUM_MAINNET = "ethereum:mainnet"
|
|
23
|
+
ARBITRUM_MAINNET = "arbitrum:mainnet"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class MorphoVaultsRequestTypedDict(TypedDict):
|
|
27
|
+
chain: NotRequired[MorphoVaultsChain]
|
|
28
|
+
r"""The chain to use."""
|
|
29
|
+
deposit_token: NotRequired[Nullable[str]]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class MorphoVaultsRequest(BaseModel):
|
|
33
|
+
chain: Annotated[
|
|
34
|
+
Optional[MorphoVaultsChain],
|
|
35
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
36
|
+
] = MorphoVaultsChain.ETHEREUM_MAINNET
|
|
37
|
+
r"""The chain to use."""
|
|
38
|
+
|
|
39
|
+
deposit_token: Annotated[
|
|
40
|
+
OptionalNullable[str],
|
|
41
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
42
|
+
] = UNSET
|
|
43
|
+
|
|
44
|
+
@model_serializer(mode="wrap")
|
|
45
|
+
def serialize_model(self, handler):
|
|
46
|
+
optional_fields = ["chain", "deposit_token"]
|
|
47
|
+
nullable_fields = ["deposit_token"]
|
|
48
|
+
null_default_fields = []
|
|
49
|
+
|
|
50
|
+
serialized = handler(self)
|
|
51
|
+
|
|
52
|
+
m = {}
|
|
53
|
+
|
|
54
|
+
for n, f in type(self).model_fields.items():
|
|
55
|
+
k = f.alias or n
|
|
56
|
+
val = serialized.get(k)
|
|
57
|
+
serialized.pop(k, None)
|
|
58
|
+
|
|
59
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
60
|
+
is_set = (
|
|
61
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
62
|
+
or k in null_default_fields
|
|
63
|
+
) # pylint: disable=no-member
|
|
64
|
+
|
|
65
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
66
|
+
m[k] = val
|
|
67
|
+
elif val != UNSET_SENTINEL and (
|
|
68
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
69
|
+
):
|
|
70
|
+
m[k] = val
|
|
71
|
+
|
|
72
|
+
return m
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from compass_api_sdk.types import (
|
|
6
|
+
BaseModel,
|
|
7
|
+
Nullable,
|
|
8
|
+
OptionalNullable,
|
|
9
|
+
UNSET,
|
|
10
|
+
UNSET_SENTINEL,
|
|
11
|
+
)
|
|
12
|
+
from pydantic import model_serializer
|
|
13
|
+
from typing import Union
|
|
14
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
MorphoBorrowRequestAmountTypedDict = TypeAliasType(
|
|
18
|
+
"MorphoBorrowRequestAmountTypedDict", Union[float, str]
|
|
19
|
+
)
|
|
20
|
+
r"""Amount of the token to borrow from the market."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
MorphoBorrowRequestAmount = TypeAliasType(
|
|
24
|
+
"MorphoBorrowRequestAmount", Union[float, str]
|
|
25
|
+
)
|
|
26
|
+
r"""Amount of the token to borrow from the market."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class MorphoBorrowRequestTypedDict(TypedDict):
|
|
30
|
+
amount: MorphoBorrowRequestAmountTypedDict
|
|
31
|
+
r"""Amount of the token to borrow from the market."""
|
|
32
|
+
unique_market_key: str
|
|
33
|
+
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
34
|
+
chain: Chain
|
|
35
|
+
r"""The chain to use."""
|
|
36
|
+
sender: str
|
|
37
|
+
r"""The address of the transaction sender."""
|
|
38
|
+
on_behalf_of: NotRequired[Nullable[str]]
|
|
39
|
+
r"""The address where the collateral is borrowed against. Defaults to sender."""
|
|
40
|
+
receiver: NotRequired[Nullable[str]]
|
|
41
|
+
r"""The address of the receiver of the tokens borrowed. Defaults to the transaction sender."""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class MorphoBorrowRequest(BaseModel):
|
|
45
|
+
amount: MorphoBorrowRequestAmount
|
|
46
|
+
r"""Amount of the token to borrow from the market."""
|
|
47
|
+
|
|
48
|
+
unique_market_key: str
|
|
49
|
+
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
50
|
+
|
|
51
|
+
chain: Chain
|
|
52
|
+
r"""The chain to use."""
|
|
53
|
+
|
|
54
|
+
sender: str
|
|
55
|
+
r"""The address of the transaction sender."""
|
|
56
|
+
|
|
57
|
+
on_behalf_of: OptionalNullable[str] = UNSET
|
|
58
|
+
r"""The address where the collateral is borrowed against. Defaults to sender."""
|
|
59
|
+
|
|
60
|
+
receiver: OptionalNullable[str] = UNSET
|
|
61
|
+
r"""The address of the receiver of the tokens borrowed. Defaults to the transaction sender."""
|
|
62
|
+
|
|
63
|
+
@model_serializer(mode="wrap")
|
|
64
|
+
def serialize_model(self, handler):
|
|
65
|
+
optional_fields = ["on_behalf_of", "receiver"]
|
|
66
|
+
nullable_fields = ["on_behalf_of", "receiver"]
|
|
67
|
+
null_default_fields = []
|
|
68
|
+
|
|
69
|
+
serialized = handler(self)
|
|
70
|
+
|
|
71
|
+
m = {}
|
|
72
|
+
|
|
73
|
+
for n, f in type(self).model_fields.items():
|
|
74
|
+
k = f.alias or n
|
|
75
|
+
val = serialized.get(k)
|
|
76
|
+
serialized.pop(k, None)
|
|
77
|
+
|
|
78
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
79
|
+
is_set = (
|
|
80
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
81
|
+
or k in null_default_fields
|
|
82
|
+
) # pylint: disable=no-member
|
|
83
|
+
|
|
84
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
85
|
+
m[k] = val
|
|
86
|
+
elif val != UNSET_SENTINEL and (
|
|
87
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
88
|
+
):
|
|
89
|
+
m[k] = val
|
|
90
|
+
|
|
91
|
+
return m
|
|
@@ -0,0 +1,23 @@
|
|
|
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 MorphoCheckMarketPositionResponseTypedDict(TypedDict):
|
|
9
|
+
borrow_shares: int
|
|
10
|
+
borrow_amount: str
|
|
11
|
+
r"""The amount of the loan token borrowed."""
|
|
12
|
+
collateral_amount: str
|
|
13
|
+
r"""The amount of the collateral token supplied."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MorphoCheckMarketPositionResponse(BaseModel):
|
|
17
|
+
borrow_shares: int
|
|
18
|
+
|
|
19
|
+
borrow_amount: str
|
|
20
|
+
r"""The amount of the loan token borrowed."""
|
|
21
|
+
|
|
22
|
+
collateral_amount: str
|
|
23
|
+
r"""The amount of the collateral token supplied."""
|
|
@@ -0,0 +1,20 @@
|
|
|
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 MorphoCheckVaultPositionResponseTypedDict(TypedDict):
|
|
9
|
+
shares: str
|
|
10
|
+
r"""The number of vault shares the user holds."""
|
|
11
|
+
token_amount: str
|
|
12
|
+
r"""The amount of tokens the user has deposited."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MorphoCheckVaultPositionResponse(BaseModel):
|
|
16
|
+
shares: str
|
|
17
|
+
r"""The number of vault shares the user holds."""
|
|
18
|
+
|
|
19
|
+
token_amount: str
|
|
20
|
+
r"""The amount of tokens the user has deposited."""
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from compass_api_sdk.types import (
|
|
6
|
+
BaseModel,
|
|
7
|
+
Nullable,
|
|
8
|
+
OptionalNullable,
|
|
9
|
+
UNSET,
|
|
10
|
+
UNSET_SENTINEL,
|
|
11
|
+
)
|
|
12
|
+
from pydantic import model_serializer
|
|
13
|
+
from typing import Union
|
|
14
|
+
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
MorphoDepositRequestAmountTypedDict = TypeAliasType(
|
|
18
|
+
"MorphoDepositRequestAmountTypedDict", Union[float, str]
|
|
19
|
+
)
|
|
20
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
MorphoDepositRequestAmount = TypeAliasType(
|
|
24
|
+
"MorphoDepositRequestAmount", Union[float, str]
|
|
25
|
+
)
|
|
26
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class MorphoDepositRequestTypedDict(TypedDict):
|
|
30
|
+
vault_address: str
|
|
31
|
+
r"""The vault address you are depositing to."""
|
|
32
|
+
amount: MorphoDepositRequestAmountTypedDict
|
|
33
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
34
|
+
chain: Chain
|
|
35
|
+
r"""The chain to use."""
|
|
36
|
+
sender: str
|
|
37
|
+
r"""The address of the transaction sender."""
|
|
38
|
+
receiver: NotRequired[Nullable[str]]
|
|
39
|
+
r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class MorphoDepositRequest(BaseModel):
|
|
43
|
+
vault_address: str
|
|
44
|
+
r"""The vault address you are depositing to."""
|
|
45
|
+
|
|
46
|
+
amount: MorphoDepositRequestAmount
|
|
47
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
48
|
+
|
|
49
|
+
chain: Chain
|
|
50
|
+
r"""The chain to use."""
|
|
51
|
+
|
|
52
|
+
sender: str
|
|
53
|
+
r"""The address of the transaction sender."""
|
|
54
|
+
|
|
55
|
+
receiver: OptionalNullable[str] = UNSET
|
|
56
|
+
r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
|
|
57
|
+
|
|
58
|
+
@model_serializer(mode="wrap")
|
|
59
|
+
def serialize_model(self, handler):
|
|
60
|
+
optional_fields = ["receiver"]
|
|
61
|
+
nullable_fields = ["receiver"]
|
|
62
|
+
null_default_fields = []
|
|
63
|
+
|
|
64
|
+
serialized = handler(self)
|
|
65
|
+
|
|
66
|
+
m = {}
|
|
67
|
+
|
|
68
|
+
for n, f in type(self).model_fields.items():
|
|
69
|
+
k = f.alias or n
|
|
70
|
+
val = serialized.get(k)
|
|
71
|
+
serialized.pop(k, None)
|
|
72
|
+
|
|
73
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
74
|
+
is_set = (
|
|
75
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
76
|
+
or k in null_default_fields
|
|
77
|
+
) # pylint: disable=no-member
|
|
78
|
+
|
|
79
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
80
|
+
m[k] = val
|
|
81
|
+
elif val != UNSET_SENTINEL and (
|
|
82
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
83
|
+
):
|
|
84
|
+
m[k] = val
|
|
85
|
+
|
|
86
|
+
return m
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .morphomarket import MorphoMarket, MorphoMarketTypedDict
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from typing import List
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MorphoGetMarketsResponseTypedDict(TypedDict):
|
|
11
|
+
markets: List[MorphoMarketTypedDict]
|
|
12
|
+
r"""A list of markets matching the query."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MorphoGetMarketsResponse(BaseModel):
|
|
16
|
+
markets: List[MorphoMarket]
|
|
17
|
+
r"""A list of markets matching the query."""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .morphovault import MorphoVault, MorphoVaultTypedDict
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from typing import List
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class MorphoGetVaultsResponseTypedDict(TypedDict):
|
|
11
|
+
vaults: List[MorphoVaultTypedDict]
|
|
12
|
+
r"""A list of vaults matching the query."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MorphoGetVaultsResponse(BaseModel):
|
|
16
|
+
vaults: List[MorphoVault]
|
|
17
|
+
r"""A list of vaults matching the query."""
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .compass_api_backend_models_morpho_read_response_get_markets_asset import (
|
|
5
|
+
CompassAPIBackendModelsMorphoReadResponseGetMarketsAsset,
|
|
6
|
+
CompassAPIBackendModelsMorphoReadResponseGetMarketsAssetTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from .marketstate import MarketState, MarketStateTypedDict
|
|
9
|
+
from .weeklyapys import WeeklyApys, WeeklyApysTypedDict
|
|
10
|
+
from compass_api_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
11
|
+
import pydantic
|
|
12
|
+
from pydantic import model_serializer
|
|
13
|
+
from typing_extensions import Annotated, TypedDict
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class MorphoMarketTypedDict(TypedDict):
|
|
17
|
+
unique_key: str
|
|
18
|
+
lltv: str
|
|
19
|
+
oracle_address: str
|
|
20
|
+
irm_address: str
|
|
21
|
+
state: MarketStateTypedDict
|
|
22
|
+
weekly_apys: WeeklyApysTypedDict
|
|
23
|
+
collateral_asset: Nullable[
|
|
24
|
+
CompassAPIBackendModelsMorphoReadResponseGetMarketsAssetTypedDict
|
|
25
|
+
]
|
|
26
|
+
loan_asset: CompassAPIBackendModelsMorphoReadResponseGetMarketsAssetTypedDict
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class MorphoMarket(BaseModel):
|
|
30
|
+
unique_key: Annotated[str, pydantic.Field(alias="uniqueKey")]
|
|
31
|
+
|
|
32
|
+
lltv: str
|
|
33
|
+
|
|
34
|
+
oracle_address: Annotated[str, pydantic.Field(alias="oracleAddress")]
|
|
35
|
+
|
|
36
|
+
irm_address: Annotated[str, pydantic.Field(alias="irmAddress")]
|
|
37
|
+
|
|
38
|
+
state: MarketState
|
|
39
|
+
|
|
40
|
+
weekly_apys: Annotated[WeeklyApys, pydantic.Field(alias="weeklyApys")]
|
|
41
|
+
|
|
42
|
+
collateral_asset: Annotated[
|
|
43
|
+
Nullable[CompassAPIBackendModelsMorphoReadResponseGetMarketsAsset],
|
|
44
|
+
pydantic.Field(alias="collateralAsset"),
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
loan_asset: Annotated[
|
|
48
|
+
CompassAPIBackendModelsMorphoReadResponseGetMarketsAsset,
|
|
49
|
+
pydantic.Field(alias="loanAsset"),
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
@model_serializer(mode="wrap")
|
|
53
|
+
def serialize_model(self, handler):
|
|
54
|
+
optional_fields = []
|
|
55
|
+
nullable_fields = ["collateralAsset"]
|
|
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
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from compass_api_sdk.types import (
|
|
6
|
+
BaseModel,
|
|
7
|
+
Nullable,
|
|
8
|
+
OptionalNullable,
|
|
9
|
+
UNSET,
|
|
10
|
+
UNSET_SENTINEL,
|
|
11
|
+
)
|
|
12
|
+
from pydantic import model_serializer
|
|
13
|
+
from typing import Any
|
|
14
|
+
from typing_extensions import NotRequired, TypedDict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class MorphoRepayRequestTypedDict(TypedDict):
|
|
18
|
+
amount: Any
|
|
19
|
+
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
|
+
unique_market_key: str
|
|
21
|
+
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
22
|
+
chain: Chain
|
|
23
|
+
r"""The chain to use."""
|
|
24
|
+
sender: str
|
|
25
|
+
r"""The address of the transaction sender."""
|
|
26
|
+
on_behalf_of: NotRequired[Nullable[str]]
|
|
27
|
+
r"""The address on behalf of whom the repayment is made. Defaults to sender."""
|
|
28
|
+
callback_data: NotRequired[Nullable[bytes]]
|
|
29
|
+
r"""An optional field for callback byte data that will be triggered upon successful repaying of debt."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class MorphoRepayRequest(BaseModel):
|
|
33
|
+
amount: Any
|
|
34
|
+
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."""
|
|
35
|
+
|
|
36
|
+
unique_market_key: str
|
|
37
|
+
r"""The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint."""
|
|
38
|
+
|
|
39
|
+
chain: Chain
|
|
40
|
+
r"""The chain to use."""
|
|
41
|
+
|
|
42
|
+
sender: str
|
|
43
|
+
r"""The address of the transaction sender."""
|
|
44
|
+
|
|
45
|
+
on_behalf_of: OptionalNullable[str] = UNSET
|
|
46
|
+
r"""The address on behalf of whom the repayment is made. Defaults to sender."""
|
|
47
|
+
|
|
48
|
+
callback_data: OptionalNullable[bytes] = UNSET
|
|
49
|
+
r"""An optional field for callback byte data that will be triggered upon successful repaying of debt."""
|
|
50
|
+
|
|
51
|
+
@model_serializer(mode="wrap")
|
|
52
|
+
def serialize_model(self, handler):
|
|
53
|
+
optional_fields = ["on_behalf_of", "callback_data"]
|
|
54
|
+
nullable_fields = ["on_behalf_of", "callback_data"]
|
|
55
|
+
null_default_fields = []
|
|
56
|
+
|
|
57
|
+
serialized = handler(self)
|
|
58
|
+
|
|
59
|
+
m = {}
|
|
60
|
+
|
|
61
|
+
for n, f in type(self).model_fields.items():
|
|
62
|
+
k = f.alias or n
|
|
63
|
+
val = serialized.get(k)
|
|
64
|
+
serialized.pop(k, None)
|
|
65
|
+
|
|
66
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
67
|
+
is_set = (
|
|
68
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
69
|
+
or k in null_default_fields
|
|
70
|
+
) # pylint: disable=no-member
|
|
71
|
+
|
|
72
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
73
|
+
m[k] = val
|
|
74
|
+
elif val != UNSET_SENTINEL and (
|
|
75
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
76
|
+
):
|
|
77
|
+
m[k] = val
|
|
78
|
+
|
|
79
|
+
return m
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from typing import Union
|
|
7
|
+
from typing_extensions import TypeAliasType, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
MorphoSetVaultAllowanceRequestAmountTypedDict = TypeAliasType(
|
|
11
|
+
"MorphoSetVaultAllowanceRequestAmountTypedDict", Union[float, str]
|
|
12
|
+
)
|
|
13
|
+
r"""The amount of tokens to increase the allowance by."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
MorphoSetVaultAllowanceRequestAmount = TypeAliasType(
|
|
17
|
+
"MorphoSetVaultAllowanceRequestAmount", Union[float, str]
|
|
18
|
+
)
|
|
19
|
+
r"""The amount of tokens to increase the allowance by."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class MorphoSetVaultAllowanceRequestTypedDict(TypedDict):
|
|
23
|
+
vault_address: str
|
|
24
|
+
r"""The vault address you are increasing the allowance for."""
|
|
25
|
+
amount: MorphoSetVaultAllowanceRequestAmountTypedDict
|
|
26
|
+
r"""The amount of tokens to increase the allowance by."""
|
|
27
|
+
chain: Chain
|
|
28
|
+
r"""The chain to use."""
|
|
29
|
+
sender: str
|
|
30
|
+
r"""The address of the transaction sender."""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class MorphoSetVaultAllowanceRequest(BaseModel):
|
|
34
|
+
vault_address: str
|
|
35
|
+
r"""The vault address you are increasing the allowance for."""
|
|
36
|
+
|
|
37
|
+
amount: MorphoSetVaultAllowanceRequestAmount
|
|
38
|
+
r"""The amount of tokens to increase the allowance by."""
|
|
39
|
+
|
|
40
|
+
chain: Chain
|
|
41
|
+
r"""The chain to use."""
|
|
42
|
+
|
|
43
|
+
sender: str
|
|
44
|
+
r"""The address of the transaction sender."""
|