compass_api_sdk 0.3.4__py3-none-any.whl → 0.3.7__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.
- {compassapisdk → compass_api_sdk}/_hooks/sdkhooks.py +1 -1
- {compassapisdk → compass_api_sdk}/_hooks/types.py +1 -1
- {compassapisdk → compass_api_sdk}/_version.py +3 -3
- {compassapisdk → compass_api_sdk}/aave_v3.py +15 -15
- {compassapisdk → compass_api_sdk}/aerodrome_slipstream.py +3 -3
- {compassapisdk → compass_api_sdk}/basesdk.py +3 -3
- {compassapisdk → compass_api_sdk}/errors/httpvalidationerror.py +3 -3
- {compassapisdk → compass_api_sdk}/models/__init__.py +132 -6
- {compassapisdk → compass_api_sdk}/models/aave_avg_rateop.py +6 -6
- {compassapisdk → compass_api_sdk}/models/aave_historical_transactionsop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aave_liquidity_changeop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aave_rateop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aave_reserve_overviewop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aave_std_rateop.py +6 -6
- {compassapisdk → compass_api_sdk}/models/aave_token_priceop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aave_user_position_per_tokenop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aave_user_position_summaryop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aaveavgrateresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aaveborrowparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aaveborrowrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavehistoricaltransactionsresponse.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aaveliquiditychangeresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavelooprequest.py +3 -3
- {compassapisdk → compass_api_sdk}/models/aaverateresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aaverepayparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aaverepayrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavereserveoverviewresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavestdrateresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavesupplyparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavesupplyrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavetokenpriceresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aaveuserpositionpertokenresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aaveuserpositionsummaryresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavewithdrawparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aavewithdrawrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodrome_slipstream_liquidity_provision_positionsop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aerodrome_slipstream_pool_priceop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/aerodromelppositionsresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeposition.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreambuyexactlyparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreambuyexactlyrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreamincreaseliquidityprovisionparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreammintliquidityprovisionparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreammintliquidityprovisionrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreampoolpriceresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreamsellexactlyparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreamsellexactlyrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreamwithdrawliquidityprovisionparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/allowanceinforesponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/borrow.py +2 -2
- {compassapisdk → compass_api_sdk}/models/chaininfo.py +1 -1
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_apydata.py +19 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_asset.py +62 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_marketstate.py +40 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_vaultstate.py +25 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_apydata.py +23 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_asset.py +60 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_market_marketstate.py +38 -0
- {compassapisdk → compass_api_sdk}/models/compass_api_backend_models_morpho_read_response_get_markets_asset.py +1 -1
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_marketstate.py +72 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_asset.py +60 -0
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_vaultstate.py +53 -0
- {compassapisdk → compass_api_sdk}/models/compass_api_backend_models_morpho_read_response_get_vaults_asset.py +1 -1
- compassapisdk/models/vaultstate.py → compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_vaultstate.py +3 -3
- compass_api_sdk/models/curator.py +53 -0
- {compassapisdk → compass_api_sdk}/models/ensnameinforesponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/generic_allowanceop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/generic_ensop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/generic_portfolioop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/generic_supported_tokensop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/generic_visualize_portfolioop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/image.py +1 -1
- {compassapisdk → compass_api_sdk}/models/increaseallowanceanyparams.py +3 -7
- {compassapisdk → compass_api_sdk}/models/increaseallowanceparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/increaseallowancerequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/liquidationcall.py +2 -2
- compass_api_sdk/models/liquidity.py +16 -0
- compass_api_sdk/models/market.py +14 -0
- compass_api_sdk/models/marketposition.py +63 -0
- compass_api_sdk/models/metadata.py +56 -0
- {compassapisdk → compass_api_sdk}/models/morpho_market_positionop.py +2 -2
- compass_api_sdk/models/morpho_marketop.py +30 -0
- {compassapisdk → compass_api_sdk}/models/morpho_marketsop.py +22 -16
- compass_api_sdk/models/morpho_user_positionop.py +30 -0
- {compassapisdk → compass_api_sdk}/models/morpho_vault_positionop.py +2 -2
- compass_api_sdk/models/morpho_vaultop.py +30 -0
- {compassapisdk → compass_api_sdk}/models/morpho_vaultsop.py +18 -12
- {compassapisdk → compass_api_sdk}/models/morphoborrowparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphoborrowrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphocheckmarketpositionresponse.py +1 -1
- compass_api_sdk/models/morphocheckuserpositionresponse.py +32 -0
- {compassapisdk → compass_api_sdk}/models/morphocheckvaultpositionresponse.py +3 -3
- {compassapisdk → compass_api_sdk}/models/morphodepositparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphodepositrequest.py +1 -1
- compass_api_sdk/models/morphogetmarketresponse.py +78 -0
- {compassapisdk → compass_api_sdk}/models/morphogetmarketsresponse.py +1 -1
- compass_api_sdk/models/morphogetvaultresponse.py +47 -0
- {compassapisdk → compass_api_sdk}/models/morphogetvaultsresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphomarket.py +7 -4
- {compassapisdk → compass_api_sdk}/models/morphorepayparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphorepayrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphosetvaultallowanceparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphosetvaultallowancerequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphosupplycollateralparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphosupplycollateralrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphovault.py +7 -4
- {compassapisdk → compass_api_sdk}/models/morphowithdrawcollateralparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphowithdrawcollateralrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphowithdrawparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/morphowithdrawrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/multicallaction.py +1 -1
- {compassapisdk → compass_api_sdk}/models/multicallauthorizationrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/multicallauthorizationresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/multicallexecuterequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/portfolio.py +1 -1
- {compassapisdk → compass_api_sdk}/models/redeemunderlying.py +1 -1
- {compassapisdk → compass_api_sdk}/models/repay.py +2 -2
- {compassapisdk → compass_api_sdk}/models/reserve.py +1 -1
- {compassapisdk → compass_api_sdk}/models/security.py +2 -2
- {compassapisdk → compass_api_sdk}/models/signedauthorization.py +1 -1
- {compassapisdk → compass_api_sdk}/models/sky_positionop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/skybuyparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/skybuyrequest.py +2 -2
- {compassapisdk → compass_api_sdk}/models/skycheckpositionresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/skydepositparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/skydepositrequest.py +2 -2
- {compassapisdk → compass_api_sdk}/models/skysellparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/skysellrequest.py +2 -2
- {compassapisdk → compass_api_sdk}/models/skywithdrawparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/skywithdrawrequest.py +2 -2
- {compassapisdk → compass_api_sdk}/models/supply.py +2 -2
- {compassapisdk → compass_api_sdk}/models/swapborrowrate.py +2 -2
- {compassapisdk → compass_api_sdk}/models/token_addressop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/token_balanceop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/token_priceop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/tokenaddressresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/tokenbalance.py +1 -1
- {compassapisdk → compass_api_sdk}/models/tokenbalanceresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/tokeninfo.py +1 -1
- {compassapisdk → compass_api_sdk}/models/tokenpriceresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/tokentransfererc20params.py +1 -1
- {compassapisdk → compass_api_sdk}/models/tokentransferrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswap_liquidity_provision_in_rangeop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/uniswap_liquidity_provision_positionsop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/uniswap_pool_priceop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/uniswap_quote_buy_exactlyop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/uniswap_quote_sell_exactlyop.py +2 -2
- {compassapisdk → compass_api_sdk}/models/uniswapbuyexactlyparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapbuyexactlyrequest.py +3 -3
- {compassapisdk → compass_api_sdk}/models/uniswapbuyquoteinforesponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapcheckinrangeresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapincreaseliquidityprovisionparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapincreaseliquidityprovisionrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswaplppositionsinforesponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapmintliquidityprovisionparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapmintliquidityprovisionrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswappoolpriceresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswappositionssolidityresponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapsellexactlyparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapsellexactlyrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapsellquoteinforesponse.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapwithdrawliquidityprovisionparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/uniswapwithdrawliquidityprovisionrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/unsignedmulticalltransaction.py +1 -1
- {compassapisdk → compass_api_sdk}/models/unsignedtransaction.py +1 -1
- {compassapisdk → compass_api_sdk}/models/unwrapwethparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/unwrapwethrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/models/usageascollateral.py +2 -2
- compass_api_sdk/models/userstate.py +33 -0
- {compassapisdk → compass_api_sdk}/models/validationerror.py +1 -1
- compass_api_sdk/models/vault.py +58 -0
- compass_api_sdk/models/vaultposition.py +24 -0
- {compassapisdk → compass_api_sdk}/models/weeklyapys.py +1 -1
- {compassapisdk → compass_api_sdk}/models/wrapethparams.py +1 -1
- {compassapisdk → compass_api_sdk}/models/wrapethrequest.py +1 -1
- {compassapisdk → compass_api_sdk}/morpho.py +646 -42
- {compassapisdk → compass_api_sdk}/sdk.py +12 -12
- {compassapisdk → compass_api_sdk}/sdkconfiguration.py +2 -2
- {compassapisdk → compass_api_sdk}/sky.py +3 -7
- {compassapisdk → compass_api_sdk}/token_sdk.py +5 -5
- {compassapisdk → compass_api_sdk}/transaction_batching.py +3 -3
- {compassapisdk → compass_api_sdk}/uniswap_v3.py +3 -3
- {compassapisdk → compass_api_sdk}/universal.py +5 -5
- {compass_api_sdk-0.3.4.dist-info → compass_api_sdk-0.3.7.dist-info}/METADATA +53 -57
- compass_api_sdk-0.3.7.dist-info/RECORD +218 -0
- compass_api_sdk-0.3.4.dist-info/RECORD +0 -195
- compassapisdk/models/marketstate.py +0 -35
- {compassapisdk → compass_api_sdk}/__init__.py +0 -0
- {compassapisdk → compass_api_sdk}/_hooks/__init__.py +0 -0
- {compassapisdk → compass_api_sdk}/errors/__init__.py +0 -0
- {compassapisdk → compass_api_sdk}/errors/apierror.py +0 -0
- {compassapisdk → compass_api_sdk}/httpclient.py +0 -0
- {compassapisdk → compass_api_sdk}/models/chain.py +0 -0
- {compassapisdk → compass_api_sdk}/models/contractname.py +0 -0
- {compassapisdk → compass_api_sdk}/models/feeenum.py +0 -0
- {compassapisdk → compass_api_sdk}/models/interestratemode.py +0 -0
- {compassapisdk → compass_api_sdk}/models/multicallactiontype.py +0 -0
- {compassapisdk → compass_api_sdk}/models/token_enum.py +0 -0
- {compassapisdk → compass_api_sdk}/py.typed +0 -0
- {compassapisdk → compass_api_sdk}/types/__init__.py +0 -0
- {compassapisdk → compass_api_sdk}/types/basemodel.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/__init__.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/annotations.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/datetimes.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/enums.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/eventstreaming.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/forms.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/headers.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/logger.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/metadata.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/queryparams.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/requestbodies.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/retries.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/security.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/serializers.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/url.py +0 -0
- {compassapisdk → compass_api_sdk}/utils/values.py +0 -0
- {compass_api_sdk-0.3.4.dist-info → compass_api_sdk-0.3.7.dist-info}/WHEEL +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from compass_api_sdk import errors, models, utils
|
|
5
|
+
from compass_api_sdk._hooks import HookContext
|
|
6
|
+
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
7
|
from typing import Any, Mapping, Optional, Union
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ class Morpho(BaseSDK):
|
|
|
12
12
|
self,
|
|
13
13
|
*,
|
|
14
14
|
chain: models.MorphoVaultsChain = models.MorphoVaultsChain.ETHEREUM_MAINNET,
|
|
15
|
-
deposit_token:
|
|
15
|
+
deposit_token: OptionalNullable[str] = UNSET,
|
|
16
16
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
17
|
server_url: Optional[str] = None,
|
|
18
18
|
timeout_ms: Optional[int] = None,
|
|
@@ -20,7 +20,7 @@ class Morpho(BaseSDK):
|
|
|
20
20
|
) -> models.MorphoGetVaultsResponse:
|
|
21
21
|
r"""Get Vaults
|
|
22
22
|
|
|
23
|
-
Query a list of vaults
|
|
23
|
+
Query a list of available vaults for depositing tokens.
|
|
24
24
|
|
|
25
25
|
Each vault has one unique token that can be deposited. In exchange for depositing
|
|
26
26
|
tokens into a vault you receive shares. You earn yield on these shares by their
|
|
@@ -116,7 +116,7 @@ class Morpho(BaseSDK):
|
|
|
116
116
|
self,
|
|
117
117
|
*,
|
|
118
118
|
chain: models.MorphoVaultsChain = models.MorphoVaultsChain.ETHEREUM_MAINNET,
|
|
119
|
-
deposit_token:
|
|
119
|
+
deposit_token: OptionalNullable[str] = UNSET,
|
|
120
120
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
121
121
|
server_url: Optional[str] = None,
|
|
122
122
|
timeout_ms: Optional[int] = None,
|
|
@@ -124,7 +124,7 @@ class Morpho(BaseSDK):
|
|
|
124
124
|
) -> models.MorphoGetVaultsResponse:
|
|
125
125
|
r"""Get Vaults
|
|
126
126
|
|
|
127
|
-
Query a list of vaults
|
|
127
|
+
Query a list of available vaults for depositing tokens.
|
|
128
128
|
|
|
129
129
|
Each vault has one unique token that can be deposited. In exchange for depositing
|
|
130
130
|
tokens into a vault you receive shares. You earn yield on these shares by their
|
|
@@ -216,6 +216,206 @@ class Morpho(BaseSDK):
|
|
|
216
216
|
http_res,
|
|
217
217
|
)
|
|
218
218
|
|
|
219
|
+
def vault(
|
|
220
|
+
self,
|
|
221
|
+
*,
|
|
222
|
+
chain: models.MorphoVaultChain = models.MorphoVaultChain.ETHEREUM_MAINNET,
|
|
223
|
+
vault_address: str = "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
224
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
225
|
+
server_url: Optional[str] = None,
|
|
226
|
+
timeout_ms: Optional[int] = None,
|
|
227
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
228
|
+
) -> models.MorphoGetVaultResponse:
|
|
229
|
+
r"""Get Vault
|
|
230
|
+
|
|
231
|
+
Get data & metrics for a specific Morpho vault.
|
|
232
|
+
|
|
233
|
+
:param chain:
|
|
234
|
+
:param vault_address: The vault address of the desired vault data & metrics.
|
|
235
|
+
:param retries: Override the default retry configuration for this method
|
|
236
|
+
:param server_url: Override the default server URL for this method
|
|
237
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
238
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
239
|
+
"""
|
|
240
|
+
base_url = None
|
|
241
|
+
url_variables = None
|
|
242
|
+
if timeout_ms is None:
|
|
243
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
244
|
+
|
|
245
|
+
if server_url is not None:
|
|
246
|
+
base_url = server_url
|
|
247
|
+
else:
|
|
248
|
+
base_url = self._get_url(base_url, url_variables)
|
|
249
|
+
|
|
250
|
+
request = models.MorphoVaultRequest(
|
|
251
|
+
chain=chain,
|
|
252
|
+
vault_address=vault_address,
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
req = self._build_request(
|
|
256
|
+
method="GET",
|
|
257
|
+
path="/v0/morpho/vault",
|
|
258
|
+
base_url=base_url,
|
|
259
|
+
url_variables=url_variables,
|
|
260
|
+
request=request,
|
|
261
|
+
request_body_required=False,
|
|
262
|
+
request_has_path_params=False,
|
|
263
|
+
request_has_query_params=True,
|
|
264
|
+
user_agent_header="user-agent",
|
|
265
|
+
accept_header_value="application/json",
|
|
266
|
+
http_headers=http_headers,
|
|
267
|
+
security=self.sdk_configuration.security,
|
|
268
|
+
timeout_ms=timeout_ms,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
if retries == UNSET:
|
|
272
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
273
|
+
retries = self.sdk_configuration.retry_config
|
|
274
|
+
|
|
275
|
+
retry_config = None
|
|
276
|
+
if isinstance(retries, utils.RetryConfig):
|
|
277
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
278
|
+
|
|
279
|
+
http_res = self.do_request(
|
|
280
|
+
hook_ctx=HookContext(
|
|
281
|
+
base_url=base_url or "",
|
|
282
|
+
operation_id="morpho_vault",
|
|
283
|
+
oauth2_scopes=[],
|
|
284
|
+
security_source=self.sdk_configuration.security,
|
|
285
|
+
),
|
|
286
|
+
request=req,
|
|
287
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
288
|
+
retry_config=retry_config,
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
response_data: Any = None
|
|
292
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
293
|
+
return utils.unmarshal_json(http_res.text, models.MorphoGetVaultResponse)
|
|
294
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
295
|
+
response_data = utils.unmarshal_json(
|
|
296
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
297
|
+
)
|
|
298
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
299
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
300
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
301
|
+
raise errors.APIError(
|
|
302
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
303
|
+
)
|
|
304
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
305
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
306
|
+
raise errors.APIError(
|
|
307
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
308
|
+
)
|
|
309
|
+
|
|
310
|
+
content_type = http_res.headers.get("Content-Type")
|
|
311
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
312
|
+
raise errors.APIError(
|
|
313
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
314
|
+
http_res.status_code,
|
|
315
|
+
http_res_text,
|
|
316
|
+
http_res,
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
async def vault_async(
|
|
320
|
+
self,
|
|
321
|
+
*,
|
|
322
|
+
chain: models.MorphoVaultChain = models.MorphoVaultChain.ETHEREUM_MAINNET,
|
|
323
|
+
vault_address: str = "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
|
|
324
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
325
|
+
server_url: Optional[str] = None,
|
|
326
|
+
timeout_ms: Optional[int] = None,
|
|
327
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
328
|
+
) -> models.MorphoGetVaultResponse:
|
|
329
|
+
r"""Get Vault
|
|
330
|
+
|
|
331
|
+
Get data & metrics for a specific Morpho vault.
|
|
332
|
+
|
|
333
|
+
:param chain:
|
|
334
|
+
:param vault_address: The vault address of the desired vault data & metrics.
|
|
335
|
+
:param retries: Override the default retry configuration for this method
|
|
336
|
+
:param server_url: Override the default server URL for this method
|
|
337
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
338
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
339
|
+
"""
|
|
340
|
+
base_url = None
|
|
341
|
+
url_variables = None
|
|
342
|
+
if timeout_ms is None:
|
|
343
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
344
|
+
|
|
345
|
+
if server_url is not None:
|
|
346
|
+
base_url = server_url
|
|
347
|
+
else:
|
|
348
|
+
base_url = self._get_url(base_url, url_variables)
|
|
349
|
+
|
|
350
|
+
request = models.MorphoVaultRequest(
|
|
351
|
+
chain=chain,
|
|
352
|
+
vault_address=vault_address,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
req = self._build_request_async(
|
|
356
|
+
method="GET",
|
|
357
|
+
path="/v0/morpho/vault",
|
|
358
|
+
base_url=base_url,
|
|
359
|
+
url_variables=url_variables,
|
|
360
|
+
request=request,
|
|
361
|
+
request_body_required=False,
|
|
362
|
+
request_has_path_params=False,
|
|
363
|
+
request_has_query_params=True,
|
|
364
|
+
user_agent_header="user-agent",
|
|
365
|
+
accept_header_value="application/json",
|
|
366
|
+
http_headers=http_headers,
|
|
367
|
+
security=self.sdk_configuration.security,
|
|
368
|
+
timeout_ms=timeout_ms,
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
if retries == UNSET:
|
|
372
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
373
|
+
retries = self.sdk_configuration.retry_config
|
|
374
|
+
|
|
375
|
+
retry_config = None
|
|
376
|
+
if isinstance(retries, utils.RetryConfig):
|
|
377
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
378
|
+
|
|
379
|
+
http_res = await self.do_request_async(
|
|
380
|
+
hook_ctx=HookContext(
|
|
381
|
+
base_url=base_url or "",
|
|
382
|
+
operation_id="morpho_vault",
|
|
383
|
+
oauth2_scopes=[],
|
|
384
|
+
security_source=self.sdk_configuration.security,
|
|
385
|
+
),
|
|
386
|
+
request=req,
|
|
387
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
388
|
+
retry_config=retry_config,
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
response_data: Any = None
|
|
392
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
393
|
+
return utils.unmarshal_json(http_res.text, models.MorphoGetVaultResponse)
|
|
394
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
395
|
+
response_data = utils.unmarshal_json(
|
|
396
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
397
|
+
)
|
|
398
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
399
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
400
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
401
|
+
raise errors.APIError(
|
|
402
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
403
|
+
)
|
|
404
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
405
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
406
|
+
raise errors.APIError(
|
|
407
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
content_type = http_res.headers.get("Content-Type")
|
|
411
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
412
|
+
raise errors.APIError(
|
|
413
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
414
|
+
http_res.status_code,
|
|
415
|
+
http_res_text,
|
|
416
|
+
http_res,
|
|
417
|
+
)
|
|
418
|
+
|
|
219
419
|
def vault_position(
|
|
220
420
|
self,
|
|
221
421
|
*,
|
|
@@ -432,8 +632,8 @@ class Morpho(BaseSDK):
|
|
|
432
632
|
self,
|
|
433
633
|
*,
|
|
434
634
|
chain: models.MorphoMarketsChain = models.MorphoMarketsChain.ETHEREUM_MAINNET,
|
|
435
|
-
collateral_token:
|
|
436
|
-
loan_token:
|
|
635
|
+
collateral_token: OptionalNullable[str] = UNSET,
|
|
636
|
+
loan_token: OptionalNullable[str] = UNSET,
|
|
437
637
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
438
638
|
server_url: Optional[str] = None,
|
|
439
639
|
timeout_ms: Optional[int] = None,
|
|
@@ -538,8 +738,8 @@ class Morpho(BaseSDK):
|
|
|
538
738
|
self,
|
|
539
739
|
*,
|
|
540
740
|
chain: models.MorphoMarketsChain = models.MorphoMarketsChain.ETHEREUM_MAINNET,
|
|
541
|
-
collateral_token:
|
|
542
|
-
loan_token:
|
|
741
|
+
collateral_token: OptionalNullable[str] = UNSET,
|
|
742
|
+
loan_token: OptionalNullable[str] = UNSET,
|
|
543
743
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
544
744
|
server_url: Optional[str] = None,
|
|
545
745
|
timeout_ms: Optional[int] = None,
|
|
@@ -640,24 +840,21 @@ class Morpho(BaseSDK):
|
|
|
640
840
|
http_res,
|
|
641
841
|
)
|
|
642
842
|
|
|
643
|
-
def
|
|
843
|
+
def market(
|
|
644
844
|
self,
|
|
645
845
|
*,
|
|
646
|
-
chain: models.
|
|
647
|
-
|
|
648
|
-
unique_market_key: str = "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
846
|
+
chain: models.MorphoMarketChain = models.MorphoMarketChain.ETHEREUM_MAINNET,
|
|
847
|
+
unique_market_key: str = "0x83b7ad16905809ea36482f4fbf6cfee9c9f316d128de9a5da1952607d5e4df5e",
|
|
649
848
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
650
849
|
server_url: Optional[str] = None,
|
|
651
850
|
timeout_ms: Optional[int] = None,
|
|
652
851
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
653
|
-
) -> models.
|
|
654
|
-
r"""
|
|
852
|
+
) -> models.MorphoGetMarketResponse:
|
|
853
|
+
r"""Get Market
|
|
655
854
|
|
|
656
|
-
|
|
657
|
-
market.
|
|
855
|
+
Get data & metrics for a specific Morpho market.
|
|
658
856
|
|
|
659
857
|
:param chain:
|
|
660
|
-
:param user_address: The user address of the desired market position.
|
|
661
858
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
662
859
|
:param retries: Override the default retry configuration for this method
|
|
663
860
|
:param server_url: Override the default server URL for this method
|
|
@@ -674,15 +871,14 @@ class Morpho(BaseSDK):
|
|
|
674
871
|
else:
|
|
675
872
|
base_url = self._get_url(base_url, url_variables)
|
|
676
873
|
|
|
677
|
-
request = models.
|
|
874
|
+
request = models.MorphoMarketRequest(
|
|
678
875
|
chain=chain,
|
|
679
|
-
user_address=user_address,
|
|
680
876
|
unique_market_key=unique_market_key,
|
|
681
877
|
)
|
|
682
878
|
|
|
683
879
|
req = self._build_request(
|
|
684
880
|
method="GET",
|
|
685
|
-
path="/v0/morpho/
|
|
881
|
+
path="/v0/morpho/market",
|
|
686
882
|
base_url=base_url,
|
|
687
883
|
url_variables=url_variables,
|
|
688
884
|
request=request,
|
|
@@ -707,7 +903,7 @@ class Morpho(BaseSDK):
|
|
|
707
903
|
http_res = self.do_request(
|
|
708
904
|
hook_ctx=HookContext(
|
|
709
905
|
base_url=base_url or "",
|
|
710
|
-
operation_id="
|
|
906
|
+
operation_id="morpho_market",
|
|
711
907
|
oauth2_scopes=[],
|
|
712
908
|
security_source=self.sdk_configuration.security,
|
|
713
909
|
),
|
|
@@ -718,9 +914,7 @@ class Morpho(BaseSDK):
|
|
|
718
914
|
|
|
719
915
|
response_data: Any = None
|
|
720
916
|
if utils.match_response(http_res, "200", "application/json"):
|
|
721
|
-
return utils.unmarshal_json(
|
|
722
|
-
http_res.text, models.MorphoCheckMarketPositionResponse
|
|
723
|
-
)
|
|
917
|
+
return utils.unmarshal_json(http_res.text, models.MorphoGetMarketResponse)
|
|
724
918
|
if utils.match_response(http_res, "422", "application/json"):
|
|
725
919
|
response_data = utils.unmarshal_json(
|
|
726
920
|
http_res.text, errors.HTTPValidationErrorData
|
|
@@ -746,24 +940,21 @@ class Morpho(BaseSDK):
|
|
|
746
940
|
http_res,
|
|
747
941
|
)
|
|
748
942
|
|
|
749
|
-
async def
|
|
943
|
+
async def market_async(
|
|
750
944
|
self,
|
|
751
945
|
*,
|
|
752
|
-
chain: models.
|
|
753
|
-
|
|
754
|
-
unique_market_key: str = "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
946
|
+
chain: models.MorphoMarketChain = models.MorphoMarketChain.ETHEREUM_MAINNET,
|
|
947
|
+
unique_market_key: str = "0x83b7ad16905809ea36482f4fbf6cfee9c9f316d128de9a5da1952607d5e4df5e",
|
|
755
948
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
756
949
|
server_url: Optional[str] = None,
|
|
757
950
|
timeout_ms: Optional[int] = None,
|
|
758
951
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
759
|
-
) -> models.
|
|
760
|
-
r"""
|
|
952
|
+
) -> models.MorphoGetMarketResponse:
|
|
953
|
+
r"""Get Market
|
|
761
954
|
|
|
762
|
-
|
|
763
|
-
market.
|
|
955
|
+
Get data & metrics for a specific Morpho market.
|
|
764
956
|
|
|
765
957
|
:param chain:
|
|
766
|
-
:param user_address: The user address of the desired market position.
|
|
767
958
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
768
959
|
:param retries: Override the default retry configuration for this method
|
|
769
960
|
:param server_url: Override the default server URL for this method
|
|
@@ -780,15 +971,14 @@ class Morpho(BaseSDK):
|
|
|
780
971
|
else:
|
|
781
972
|
base_url = self._get_url(base_url, url_variables)
|
|
782
973
|
|
|
783
|
-
request = models.
|
|
974
|
+
request = models.MorphoMarketRequest(
|
|
784
975
|
chain=chain,
|
|
785
|
-
user_address=user_address,
|
|
786
976
|
unique_market_key=unique_market_key,
|
|
787
977
|
)
|
|
788
978
|
|
|
789
979
|
req = self._build_request_async(
|
|
790
980
|
method="GET",
|
|
791
|
-
path="/v0/morpho/
|
|
981
|
+
path="/v0/morpho/market",
|
|
792
982
|
base_url=base_url,
|
|
793
983
|
url_variables=url_variables,
|
|
794
984
|
request=request,
|
|
@@ -813,7 +1003,7 @@ class Morpho(BaseSDK):
|
|
|
813
1003
|
http_res = await self.do_request_async(
|
|
814
1004
|
hook_ctx=HookContext(
|
|
815
1005
|
base_url=base_url or "",
|
|
816
|
-
operation_id="
|
|
1006
|
+
operation_id="morpho_market",
|
|
817
1007
|
oauth2_scopes=[],
|
|
818
1008
|
security_source=self.sdk_configuration.security,
|
|
819
1009
|
),
|
|
@@ -824,8 +1014,422 @@ class Morpho(BaseSDK):
|
|
|
824
1014
|
|
|
825
1015
|
response_data: Any = None
|
|
826
1016
|
if utils.match_response(http_res, "200", "application/json"):
|
|
827
|
-
return utils.unmarshal_json(
|
|
828
|
-
|
|
1017
|
+
return utils.unmarshal_json(http_res.text, models.MorphoGetMarketResponse)
|
|
1018
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1019
|
+
response_data = utils.unmarshal_json(
|
|
1020
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
1021
|
+
)
|
|
1022
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
1023
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1024
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1025
|
+
raise errors.APIError(
|
|
1026
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1027
|
+
)
|
|
1028
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1029
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1030
|
+
raise errors.APIError(
|
|
1031
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1032
|
+
)
|
|
1033
|
+
|
|
1034
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1035
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1036
|
+
raise errors.APIError(
|
|
1037
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1038
|
+
http_res.status_code,
|
|
1039
|
+
http_res_text,
|
|
1040
|
+
http_res,
|
|
1041
|
+
)
|
|
1042
|
+
|
|
1043
|
+
def market_position(
|
|
1044
|
+
self,
|
|
1045
|
+
*,
|
|
1046
|
+
chain: models.MorphoMarketPositionChain = models.MorphoMarketPositionChain.ETHEREUM_MAINNET,
|
|
1047
|
+
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
1048
|
+
unique_market_key: str = "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
1049
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1050
|
+
server_url: Optional[str] = None,
|
|
1051
|
+
timeout_ms: Optional[int] = None,
|
|
1052
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1053
|
+
) -> models.MorphoCheckMarketPositionResponse:
|
|
1054
|
+
r"""Check Market Position
|
|
1055
|
+
|
|
1056
|
+
Check how many shares you've borrowed and the equivalent token amount of a given
|
|
1057
|
+
market.
|
|
1058
|
+
|
|
1059
|
+
:param chain:
|
|
1060
|
+
:param user_address: The user address of the desired market position.
|
|
1061
|
+
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
1062
|
+
:param retries: Override the default retry configuration for this method
|
|
1063
|
+
:param server_url: Override the default server URL for this method
|
|
1064
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1065
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1066
|
+
"""
|
|
1067
|
+
base_url = None
|
|
1068
|
+
url_variables = None
|
|
1069
|
+
if timeout_ms is None:
|
|
1070
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1071
|
+
|
|
1072
|
+
if server_url is not None:
|
|
1073
|
+
base_url = server_url
|
|
1074
|
+
else:
|
|
1075
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1076
|
+
|
|
1077
|
+
request = models.MorphoMarketPositionRequest(
|
|
1078
|
+
chain=chain,
|
|
1079
|
+
user_address=user_address,
|
|
1080
|
+
unique_market_key=unique_market_key,
|
|
1081
|
+
)
|
|
1082
|
+
|
|
1083
|
+
req = self._build_request(
|
|
1084
|
+
method="GET",
|
|
1085
|
+
path="/v0/morpho/market_position",
|
|
1086
|
+
base_url=base_url,
|
|
1087
|
+
url_variables=url_variables,
|
|
1088
|
+
request=request,
|
|
1089
|
+
request_body_required=False,
|
|
1090
|
+
request_has_path_params=False,
|
|
1091
|
+
request_has_query_params=True,
|
|
1092
|
+
user_agent_header="user-agent",
|
|
1093
|
+
accept_header_value="application/json",
|
|
1094
|
+
http_headers=http_headers,
|
|
1095
|
+
security=self.sdk_configuration.security,
|
|
1096
|
+
timeout_ms=timeout_ms,
|
|
1097
|
+
)
|
|
1098
|
+
|
|
1099
|
+
if retries == UNSET:
|
|
1100
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1101
|
+
retries = self.sdk_configuration.retry_config
|
|
1102
|
+
|
|
1103
|
+
retry_config = None
|
|
1104
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1105
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1106
|
+
|
|
1107
|
+
http_res = self.do_request(
|
|
1108
|
+
hook_ctx=HookContext(
|
|
1109
|
+
base_url=base_url or "",
|
|
1110
|
+
operation_id="morpho_market_position",
|
|
1111
|
+
oauth2_scopes=[],
|
|
1112
|
+
security_source=self.sdk_configuration.security,
|
|
1113
|
+
),
|
|
1114
|
+
request=req,
|
|
1115
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1116
|
+
retry_config=retry_config,
|
|
1117
|
+
)
|
|
1118
|
+
|
|
1119
|
+
response_data: Any = None
|
|
1120
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1121
|
+
return utils.unmarshal_json(
|
|
1122
|
+
http_res.text, models.MorphoCheckMarketPositionResponse
|
|
1123
|
+
)
|
|
1124
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1125
|
+
response_data = utils.unmarshal_json(
|
|
1126
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
1127
|
+
)
|
|
1128
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
1129
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1130
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1131
|
+
raise errors.APIError(
|
|
1132
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1133
|
+
)
|
|
1134
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1135
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1136
|
+
raise errors.APIError(
|
|
1137
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1138
|
+
)
|
|
1139
|
+
|
|
1140
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1141
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1142
|
+
raise errors.APIError(
|
|
1143
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1144
|
+
http_res.status_code,
|
|
1145
|
+
http_res_text,
|
|
1146
|
+
http_res,
|
|
1147
|
+
)
|
|
1148
|
+
|
|
1149
|
+
async def market_position_async(
|
|
1150
|
+
self,
|
|
1151
|
+
*,
|
|
1152
|
+
chain: models.MorphoMarketPositionChain = models.MorphoMarketPositionChain.ETHEREUM_MAINNET,
|
|
1153
|
+
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
1154
|
+
unique_market_key: str = "0xe7399fdebc318d76dfec7356caafcf8cd4b91287e139a3ec423f09aeeb656fc4",
|
|
1155
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1156
|
+
server_url: Optional[str] = None,
|
|
1157
|
+
timeout_ms: Optional[int] = None,
|
|
1158
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1159
|
+
) -> models.MorphoCheckMarketPositionResponse:
|
|
1160
|
+
r"""Check Market Position
|
|
1161
|
+
|
|
1162
|
+
Check how many shares you've borrowed and the equivalent token amount of a given
|
|
1163
|
+
market.
|
|
1164
|
+
|
|
1165
|
+
:param chain:
|
|
1166
|
+
:param user_address: The user address of the desired market position.
|
|
1167
|
+
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
1168
|
+
:param retries: Override the default retry configuration for this method
|
|
1169
|
+
:param server_url: Override the default server URL for this method
|
|
1170
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1171
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1172
|
+
"""
|
|
1173
|
+
base_url = None
|
|
1174
|
+
url_variables = None
|
|
1175
|
+
if timeout_ms is None:
|
|
1176
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1177
|
+
|
|
1178
|
+
if server_url is not None:
|
|
1179
|
+
base_url = server_url
|
|
1180
|
+
else:
|
|
1181
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1182
|
+
|
|
1183
|
+
request = models.MorphoMarketPositionRequest(
|
|
1184
|
+
chain=chain,
|
|
1185
|
+
user_address=user_address,
|
|
1186
|
+
unique_market_key=unique_market_key,
|
|
1187
|
+
)
|
|
1188
|
+
|
|
1189
|
+
req = self._build_request_async(
|
|
1190
|
+
method="GET",
|
|
1191
|
+
path="/v0/morpho/market_position",
|
|
1192
|
+
base_url=base_url,
|
|
1193
|
+
url_variables=url_variables,
|
|
1194
|
+
request=request,
|
|
1195
|
+
request_body_required=False,
|
|
1196
|
+
request_has_path_params=False,
|
|
1197
|
+
request_has_query_params=True,
|
|
1198
|
+
user_agent_header="user-agent",
|
|
1199
|
+
accept_header_value="application/json",
|
|
1200
|
+
http_headers=http_headers,
|
|
1201
|
+
security=self.sdk_configuration.security,
|
|
1202
|
+
timeout_ms=timeout_ms,
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
if retries == UNSET:
|
|
1206
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1207
|
+
retries = self.sdk_configuration.retry_config
|
|
1208
|
+
|
|
1209
|
+
retry_config = None
|
|
1210
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1211
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1212
|
+
|
|
1213
|
+
http_res = await self.do_request_async(
|
|
1214
|
+
hook_ctx=HookContext(
|
|
1215
|
+
base_url=base_url or "",
|
|
1216
|
+
operation_id="morpho_market_position",
|
|
1217
|
+
oauth2_scopes=[],
|
|
1218
|
+
security_source=self.sdk_configuration.security,
|
|
1219
|
+
),
|
|
1220
|
+
request=req,
|
|
1221
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1222
|
+
retry_config=retry_config,
|
|
1223
|
+
)
|
|
1224
|
+
|
|
1225
|
+
response_data: Any = None
|
|
1226
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1227
|
+
return utils.unmarshal_json(
|
|
1228
|
+
http_res.text, models.MorphoCheckMarketPositionResponse
|
|
1229
|
+
)
|
|
1230
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1231
|
+
response_data = utils.unmarshal_json(
|
|
1232
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
1233
|
+
)
|
|
1234
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
1235
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1236
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1237
|
+
raise errors.APIError(
|
|
1238
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1239
|
+
)
|
|
1240
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1241
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1242
|
+
raise errors.APIError(
|
|
1243
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1244
|
+
)
|
|
1245
|
+
|
|
1246
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1247
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1248
|
+
raise errors.APIError(
|
|
1249
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1250
|
+
http_res.status_code,
|
|
1251
|
+
http_res_text,
|
|
1252
|
+
http_res,
|
|
1253
|
+
)
|
|
1254
|
+
|
|
1255
|
+
def user_position(
|
|
1256
|
+
self,
|
|
1257
|
+
*,
|
|
1258
|
+
chain: models.MorphoUserPositionChain = models.MorphoUserPositionChain.ETHEREUM_MAINNET,
|
|
1259
|
+
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
1260
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1261
|
+
server_url: Optional[str] = None,
|
|
1262
|
+
timeout_ms: Optional[int] = None,
|
|
1263
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1264
|
+
) -> models.MorphoCheckUserPositionResponse:
|
|
1265
|
+
r"""Check User Position
|
|
1266
|
+
|
|
1267
|
+
Check user's overall position across the entire Morpho ecosystem.
|
|
1268
|
+
|
|
1269
|
+
:param chain:
|
|
1270
|
+
:param user_address: The user wallet address of the desired user position.
|
|
1271
|
+
:param retries: Override the default retry configuration for this method
|
|
1272
|
+
:param server_url: Override the default server URL for this method
|
|
1273
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1274
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1275
|
+
"""
|
|
1276
|
+
base_url = None
|
|
1277
|
+
url_variables = None
|
|
1278
|
+
if timeout_ms is None:
|
|
1279
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1280
|
+
|
|
1281
|
+
if server_url is not None:
|
|
1282
|
+
base_url = server_url
|
|
1283
|
+
else:
|
|
1284
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1285
|
+
|
|
1286
|
+
request = models.MorphoUserPositionRequest(
|
|
1287
|
+
chain=chain,
|
|
1288
|
+
user_address=user_address,
|
|
1289
|
+
)
|
|
1290
|
+
|
|
1291
|
+
req = self._build_request(
|
|
1292
|
+
method="GET",
|
|
1293
|
+
path="/v0/morpho/user_position",
|
|
1294
|
+
base_url=base_url,
|
|
1295
|
+
url_variables=url_variables,
|
|
1296
|
+
request=request,
|
|
1297
|
+
request_body_required=False,
|
|
1298
|
+
request_has_path_params=False,
|
|
1299
|
+
request_has_query_params=True,
|
|
1300
|
+
user_agent_header="user-agent",
|
|
1301
|
+
accept_header_value="application/json",
|
|
1302
|
+
http_headers=http_headers,
|
|
1303
|
+
security=self.sdk_configuration.security,
|
|
1304
|
+
timeout_ms=timeout_ms,
|
|
1305
|
+
)
|
|
1306
|
+
|
|
1307
|
+
if retries == UNSET:
|
|
1308
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1309
|
+
retries = self.sdk_configuration.retry_config
|
|
1310
|
+
|
|
1311
|
+
retry_config = None
|
|
1312
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1313
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1314
|
+
|
|
1315
|
+
http_res = self.do_request(
|
|
1316
|
+
hook_ctx=HookContext(
|
|
1317
|
+
base_url=base_url or "",
|
|
1318
|
+
operation_id="morpho_user_position",
|
|
1319
|
+
oauth2_scopes=[],
|
|
1320
|
+
security_source=self.sdk_configuration.security,
|
|
1321
|
+
),
|
|
1322
|
+
request=req,
|
|
1323
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1324
|
+
retry_config=retry_config,
|
|
1325
|
+
)
|
|
1326
|
+
|
|
1327
|
+
response_data: Any = None
|
|
1328
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1329
|
+
return utils.unmarshal_json(
|
|
1330
|
+
http_res.text, models.MorphoCheckUserPositionResponse
|
|
1331
|
+
)
|
|
1332
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1333
|
+
response_data = utils.unmarshal_json(
|
|
1334
|
+
http_res.text, errors.HTTPValidationErrorData
|
|
1335
|
+
)
|
|
1336
|
+
raise errors.HTTPValidationError(data=response_data)
|
|
1337
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1338
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1339
|
+
raise errors.APIError(
|
|
1340
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1341
|
+
)
|
|
1342
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1343
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1344
|
+
raise errors.APIError(
|
|
1345
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1346
|
+
)
|
|
1347
|
+
|
|
1348
|
+
content_type = http_res.headers.get("Content-Type")
|
|
1349
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1350
|
+
raise errors.APIError(
|
|
1351
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1352
|
+
http_res.status_code,
|
|
1353
|
+
http_res_text,
|
|
1354
|
+
http_res,
|
|
1355
|
+
)
|
|
1356
|
+
|
|
1357
|
+
async def user_position_async(
|
|
1358
|
+
self,
|
|
1359
|
+
*,
|
|
1360
|
+
chain: models.MorphoUserPositionChain = models.MorphoUserPositionChain.ETHEREUM_MAINNET,
|
|
1361
|
+
user_address: str = "0xa829B388A3DF7f581cE957a95edbe419dd146d1B",
|
|
1362
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1363
|
+
server_url: Optional[str] = None,
|
|
1364
|
+
timeout_ms: Optional[int] = None,
|
|
1365
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1366
|
+
) -> models.MorphoCheckUserPositionResponse:
|
|
1367
|
+
r"""Check User Position
|
|
1368
|
+
|
|
1369
|
+
Check user's overall position across the entire Morpho ecosystem.
|
|
1370
|
+
|
|
1371
|
+
:param chain:
|
|
1372
|
+
:param user_address: The user wallet address of the desired user position.
|
|
1373
|
+
:param retries: Override the default retry configuration for this method
|
|
1374
|
+
:param server_url: Override the default server URL for this method
|
|
1375
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1376
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1377
|
+
"""
|
|
1378
|
+
base_url = None
|
|
1379
|
+
url_variables = None
|
|
1380
|
+
if timeout_ms is None:
|
|
1381
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1382
|
+
|
|
1383
|
+
if server_url is not None:
|
|
1384
|
+
base_url = server_url
|
|
1385
|
+
else:
|
|
1386
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1387
|
+
|
|
1388
|
+
request = models.MorphoUserPositionRequest(
|
|
1389
|
+
chain=chain,
|
|
1390
|
+
user_address=user_address,
|
|
1391
|
+
)
|
|
1392
|
+
|
|
1393
|
+
req = self._build_request_async(
|
|
1394
|
+
method="GET",
|
|
1395
|
+
path="/v0/morpho/user_position",
|
|
1396
|
+
base_url=base_url,
|
|
1397
|
+
url_variables=url_variables,
|
|
1398
|
+
request=request,
|
|
1399
|
+
request_body_required=False,
|
|
1400
|
+
request_has_path_params=False,
|
|
1401
|
+
request_has_query_params=True,
|
|
1402
|
+
user_agent_header="user-agent",
|
|
1403
|
+
accept_header_value="application/json",
|
|
1404
|
+
http_headers=http_headers,
|
|
1405
|
+
security=self.sdk_configuration.security,
|
|
1406
|
+
timeout_ms=timeout_ms,
|
|
1407
|
+
)
|
|
1408
|
+
|
|
1409
|
+
if retries == UNSET:
|
|
1410
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1411
|
+
retries = self.sdk_configuration.retry_config
|
|
1412
|
+
|
|
1413
|
+
retry_config = None
|
|
1414
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1415
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1416
|
+
|
|
1417
|
+
http_res = await self.do_request_async(
|
|
1418
|
+
hook_ctx=HookContext(
|
|
1419
|
+
base_url=base_url or "",
|
|
1420
|
+
operation_id="morpho_user_position",
|
|
1421
|
+
oauth2_scopes=[],
|
|
1422
|
+
security_source=self.sdk_configuration.security,
|
|
1423
|
+
),
|
|
1424
|
+
request=req,
|
|
1425
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1426
|
+
retry_config=retry_config,
|
|
1427
|
+
)
|
|
1428
|
+
|
|
1429
|
+
response_data: Any = None
|
|
1430
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1431
|
+
return utils.unmarshal_json(
|
|
1432
|
+
http_res.text, models.MorphoCheckUserPositionResponse
|
|
829
1433
|
)
|
|
830
1434
|
if utils.match_response(http_res, "422", "application/json"):
|
|
831
1435
|
response_data = utils.unmarshal_json(
|