compass_api_sdk 0.9.35__py3-none-any.whl → 2.0.21rc1__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.
- compass_api_sdk/_hooks/sdkhooks.py +4 -4
- compass_api_sdk/_hooks/types.py +1 -2
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/aave_v3.py +971 -728
- compass_api_sdk/aerodrome_slipstream.py +367 -390
- compass_api_sdk/basesdk.py +21 -5
- compass_api_sdk/bridge.py +536 -0
- compass_api_sdk/earn.py +1780 -0
- compass_api_sdk/erc_4626_vaults.py +127 -154
- compass_api_sdk/errors/__init__.py +38 -4
- compass_api_sdk/errors/apierror.py +32 -14
- compass_api_sdk/errors/compassapierror.py +30 -0
- compass_api_sdk/errors/httpvalidationerror.py +15 -8
- compass_api_sdk/errors/mintpreparenotfoundresponse_error.py +49 -0
- compass_api_sdk/errors/no_response_error.py +17 -0
- compass_api_sdk/errors/responsevalidationerror.py +27 -0
- compass_api_sdk/{token_sdk.py → ethena.py} +318 -293
- compass_api_sdk/gas_sponsorship.py +446 -0
- compass_api_sdk/httpclient.py +0 -1
- compass_api_sdk/models/__init__.py +1701 -945
- compass_api_sdk/models/aaveborrowparams.py +4 -13
- compass_api_sdk/models/aaveborrowrequest.py +19 -19
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +8 -8
- compass_api_sdk/models/aavelooprequest.py +88 -36
- compass_api_sdk/models/aaveposition.py +49 -0
- compass_api_sdk/models/aaverepayparams.py +4 -13
- compass_api_sdk/models/aaverepayrequest.py +19 -19
- compass_api_sdk/models/aavereserveoverviewresponse.py +34 -3
- compass_api_sdk/models/aavesetuseremodeparams.py +28 -0
- compass_api_sdk/models/aavesetuseremoderequest.py +48 -0
- compass_api_sdk/models/aavesupplyparams.py +4 -13
- compass_api_sdk/models/aavesupplyrequest.py +19 -19
- compass_api_sdk/models/aavesupportedtokenmetadata.py +30 -0
- compass_api_sdk/models/aavesupportedtokensresponse.py +20 -0
- compass_api_sdk/models/aavevenue.py +27 -0
- compass_api_sdk/models/aavewithdrawparams.py +4 -13
- compass_api_sdk/models/aavewithdrawrequest.py +19 -19
- compass_api_sdk/models/aerodromeenrichedposition.py +109 -0
- compass_api_sdk/models/aerodromelppositionsresponse.py +10 -7
- compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +21 -31
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +13 -6
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +21 -31
- compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +20 -30
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +13 -6
- compass_api_sdk/models/approvetransferrequest.py +32 -0
- compass_api_sdk/models/{curator.py → approvetransferresponse.py} +12 -13
- compass_api_sdk/models/apy.py +3 -0
- compass_api_sdk/models/batchedsafeoperationsresponse_input.py +52 -0
- compass_api_sdk/models/batchedsafeoperationsresponse_output.py +52 -0
- compass_api_sdk/models/batcheduseroperationsrequest.py +24 -9
- compass_api_sdk/models/bundlertransactionresponse.py +17 -0
- compass_api_sdk/models/chain.py +3 -3
- compass_api_sdk/models/chainmarketinfo.py +29 -0
- compass_api_sdk/models/{compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py → compass_api_backend_v1_models_generic_read_response_portfolio_tokenbalance.py} +6 -15
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_apydata.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_apydata.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_asset.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_asset.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_marketstate.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_marketstate.py} +4 -2
- compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultposition.py +30 -0
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_vaultstate.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultstate.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_apydata.py → compass_api_backend_v1_models_morpho_read_response_get_market_apydata.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vault_asset.py → compass_api_backend_v1_models_morpho_read_response_get_market_asset.py} +5 -5
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_marketstate.py → compass_api_backend_v1_models_morpho_read_response_get_market_marketstate.py} +4 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_asset.py → compass_api_backend_v1_models_morpho_read_response_get_markets_asset.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_marketstate.py → compass_api_backend_v1_models_morpho_read_response_get_markets_marketstate.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vaults_asset.py → compass_api_backend_v1_models_morpho_read_response_get_vaults_asset.py} +2 -2
- compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_get_vaults_vaultstate.py +73 -0
- compass_api_sdk/models/compass_api_backend_v1_models_pendle_read_response_market_userposition.py +82 -0
- compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_positions_tokenbalance.py → compass_api_backend_v1_models_pendle_read_response_positions_tokenbalance.py} +2 -2
- compass_api_sdk/models/compass_api_backend_v1_models_vaults_read_response_vault_userposition.py +20 -0
- compass_api_sdk/models/compass_api_backend_v1_models_wildcat_read_response_market_userposition.py +22 -0
- compass_api_sdk/models/compass_api_backend_v2_models_earn_read_response_positions_vaultposition.py +49 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712domain.py +36 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712types.py +36 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712domain.py +37 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712types.py +32 -0
- compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712domain.py +29 -0
- compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712types.py +34 -0
- compass_api_sdk/models/cooldownposition.py +35 -0
- compass_api_sdk/models/createaccountrequest.py +40 -0
- compass_api_sdk/models/createaccountresponse.py +56 -0
- compass_api_sdk/models/depositforburnrequest.py +77 -0
- compass_api_sdk/models/depositforburnresponse.py +100 -0
- compass_api_sdk/models/details.py +44 -7
- compass_api_sdk/models/earnmanageparams.py +74 -0
- compass_api_sdk/models/earnmanagerequest.py +130 -0
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_asset.py → earnmanageresponse.py} +13 -21
- compass_api_sdk/models/earnpositionsresponse.py +39 -0
- compass_api_sdk/models/earnswapparams.py +74 -0
- compass_api_sdk/models/earnswaprequest.py +90 -0
- compass_api_sdk/models/earnswapresponse.py +55 -0
- compass_api_sdk/models/earntransferrequest.py +104 -0
- compass_api_sdk/models/earntransferresponse.py +71 -0
- compass_api_sdk/models/eip712domainfield.py +20 -0
- compass_api_sdk/models/eip712field.py +20 -0
- compass_api_sdk/models/ethenadepositparams.py +82 -0
- compass_api_sdk/models/ethenadepositrequest.py +100 -0
- compass_api_sdk/models/ethenagetvaultresponse.py +109 -0
- compass_api_sdk/models/ethenarequesttowithdrawparams.py +28 -0
- compass_api_sdk/models/ethenarequesttowithdrawrequest.py +46 -0
- compass_api_sdk/models/ethenarequesttowithdrawtransactionresponse.py +37 -0
- compass_api_sdk/models/ethenaunstakeparams.py +65 -0
- compass_api_sdk/models/ethenaunstakerequest.py +83 -0
- compass_api_sdk/models/fee.py +42 -0
- compass_api_sdk/models/listaavemarketsresponse.py +21 -0
- compass_api_sdk/models/marketposition.py +5 -5
- compass_api_sdk/models/maxsupplyapyinfo.py +34 -0
- compass_api_sdk/models/mintpreparecompletedresponse.py +46 -0
- compass_api_sdk/models/mintpreparependingresponse.py +65 -0
- compass_api_sdk/models/mintpreparereadyresponse.py +43 -0
- compass_api_sdk/models/mintpreparerequest.py +25 -0
- compass_api_sdk/models/morphoborrowrequest.py +9 -3
- compass_api_sdk/models/morphocheckuserpositionresponse.py +9 -3
- compass_api_sdk/models/morphodepositrequest.py +9 -3
- compass_api_sdk/models/morphogetmarketresponse.py +72 -31
- compass_api_sdk/models/morphomarket.py +26 -20
- compass_api_sdk/models/morphorepayrequest.py +14 -3
- compass_api_sdk/models/morphosupplycollateralrequest.py +14 -3
- compass_api_sdk/models/morphovault.py +10 -10
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +9 -3
- compass_api_sdk/models/morphowithdrawrequest.py +9 -3
- compass_api_sdk/models/movement10percent.py +65 -10
- compass_api_sdk/models/multicallauthorizationrequest.py +9 -9
- compass_api_sdk/models/multicallexecuterequest.py +59 -11
- compass_api_sdk/models/odosswapparams.py +52 -0
- compass_api_sdk/models/odosswaprequest.py +72 -0
- compass_api_sdk/models/odostransactionresponse.py +37 -0
- compass_api_sdk/models/oneinchswapparams.py +59 -0
- compass_api_sdk/models/openposition.py +7 -7
- compass_api_sdk/models/operationtype.py +11 -0
- compass_api_sdk/models/pendlegetmarketresponse.py +52 -2
- compass_api_sdk/models/pendlemanageliquidityparams.py +68 -0
- compass_api_sdk/models/pendlemanageliquidityrequest.py +87 -0
- compass_api_sdk/models/pendleredeemyieldrequest.py +15 -6
- compass_api_sdk/models/pendletradeptparams.py +68 -0
- compass_api_sdk/models/pendletradeptrequest.py +87 -0
- compass_api_sdk/models/pendletradeytparams.py +68 -0
- compass_api_sdk/models/pendletradeytrequest.py +87 -0
- compass_api_sdk/models/pendletxresponse.py +36 -0
- compass_api_sdk/models/permit2typeddata_input.py +46 -0
- compass_api_sdk/models/permit2typeddata_output.py +46 -0
- compass_api_sdk/models/permitfield.py +20 -0
- compass_api_sdk/models/permitmessage.py +39 -0
- compass_api_sdk/models/permittransferfrommessage.py +29 -0
- compass_api_sdk/models/permittypeddataresponse_input.py +50 -0
- compass_api_sdk/models/permittypeddataresponse_output.py +50 -0
- compass_api_sdk/models/portfolio.py +5 -5
- compass_api_sdk/models/protocol.py +13 -0
- compass_api_sdk/models/reserve.py +6 -15
- compass_api_sdk/models/safetransactionparams.py +78 -0
- compass_api_sdk/models/safetransactionresponse.py +28 -0
- compass_api_sdk/models/safetxfield.py +20 -0
- compass_api_sdk/models/safetxmessage.py +66 -0
- compass_api_sdk/models/setallowanceparams.py +5 -16
- compass_api_sdk/models/setallowancerequest.py +19 -22
- compass_api_sdk/models/skybuyrequest.py +12 -9
- compass_api_sdk/models/skydepositrequest.py +13 -9
- compass_api_sdk/models/skysellrequest.py +12 -9
- compass_api_sdk/models/skywithdrawrequest.py +13 -9
- compass_api_sdk/models/sponsorgasrequest.py +71 -0
- compass_api_sdk/models/sponsorgasresponse.py +14 -0
- compass_api_sdk/models/supportedchaininfo.py +19 -0
- compass_api_sdk/models/tokenbalanceresponse.py +5 -15
- compass_api_sdk/models/tokenconfig.py +30 -0
- compass_api_sdk/models/tokenlistresponse.py +21 -0
- compass_api_sdk/models/tokenmarketdata.py +27 -0
- compass_api_sdk/models/tokenpermissions.py +20 -0
- compass_api_sdk/models/tokentransferparams.py +54 -0
- compass_api_sdk/models/tokentransferrequest.py +23 -27
- compass_api_sdk/models/transactionresponse.py +31 -0
- compass_api_sdk/models/{compass_api_backend_models_vaults_read_response_vault_asset.py → underlyingtoken.py} +2 -2
- compass_api_sdk/models/uniswapbuyexactlyparams.py +19 -41
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +31 -44
- compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +37 -0
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +15 -6
- compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +23 -31
- compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
- compass_api_sdk/models/uniswappositionssolidityresponse.py +42 -2
- compass_api_sdk/models/uniswapsellexactlyparams.py +19 -41
- compass_api_sdk/models/uniswapsellexactlyrequest.py +31 -44
- compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +37 -0
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +15 -6
- compass_api_sdk/models/unsignedmulticalltransaction.py +44 -13
- compass_api_sdk/models/unsignedtransaction.py +44 -13
- compass_api_sdk/models/unwrapwethrequest.py +15 -6
- compass_api_sdk/models/useroperation.py +61 -49
- compass_api_sdk/models/useroperationresponse.py +2 -2
- compass_api_sdk/models/userstate.py +3 -3
- compass_api_sdk/models/v1_aave_aave_supported_tokensop.py +69 -0
- compass_api_sdk/models/v1_aave_avg_rateop.py +83 -0
- compass_api_sdk/models/{aave_historical_transactionsop.py → v1_aave_historical_transactionsop.py} +21 -25
- compass_api_sdk/models/v1_aave_liquidity_changeop.py +45 -0
- compass_api_sdk/models/{pendle_marketop.py → v1_aave_rateop.py} +16 -20
- compass_api_sdk/models/v1_aave_reserve_overviewop.py +76 -0
- compass_api_sdk/models/v1_aave_std_rateop.py +83 -0
- compass_api_sdk/models/v1_aave_token_priceop.py +76 -0
- compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +83 -0
- compass_api_sdk/models/{aave_user_position_summaryop.py → v1_aave_user_position_summaryop.py} +16 -20
- compass_api_sdk/models/v1_aerodrome_slipstream_liquidity_provision_positionsop.py +76 -0
- compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +45 -0
- compass_api_sdk/models/v1_ethena_vaultop.py +75 -0
- compass_api_sdk/models/{generic_allowanceop.py → v1_generic_allowanceop.py} +28 -41
- compass_api_sdk/models/{generic_ensop.py → v1_generic_ensop.py} +8 -14
- compass_api_sdk/models/{generic_portfolioop.py → v1_generic_portfolioop.py} +10 -14
- compass_api_sdk/models/v1_generic_supported_chainsop.py +57 -0
- compass_api_sdk/models/{morpho_market_positionop.py → v1_morpho_market_positionop.py} +11 -10
- compass_api_sdk/models/{morpho_marketop.py → v1_morpho_marketop.py} +10 -9
- compass_api_sdk/models/{morpho_marketsop.py → v1_morpho_marketsop.py} +13 -12
- compass_api_sdk/models/{morpho_user_positionop.py → v1_morpho_user_positionop.py} +10 -9
- compass_api_sdk/models/{vaults_vaultop.py → v1_morpho_vaultop.py} +16 -20
- compass_api_sdk/models/{morpho_vaultsop.py → v1_morpho_vaultsop.py} +11 -10
- compass_api_sdk/models/{pendle_positionop.py → v1_pendle_marketop.py} +24 -27
- compass_api_sdk/models/v1_pendle_marketsop.py +24 -0
- compass_api_sdk/models/{pendle_positionsop.py → v1_pendle_positionsop.py} +10 -14
- compass_api_sdk/models/v1_sky_positionop.py +29 -0
- compass_api_sdk/models/v1_token_balanceop.py +38 -0
- compass_api_sdk/models/v1_token_listop.py +24 -0
- compass_api_sdk/models/v1_token_priceop.py +76 -0
- compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +27 -0
- compass_api_sdk/models/{uniswap_liquidity_provision_in_rangeop.py → v1_uniswap_liquidity_provision_in_rangeop.py} +10 -14
- compass_api_sdk/models/{uniswap_liquidity_provision_positionsop.py → v1_uniswap_liquidity_provision_positionsop.py} +10 -14
- compass_api_sdk/models/v1_uniswap_pool_priceop.py +58 -0
- compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +79 -0
- compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +79 -0
- compass_api_sdk/models/v1_vaults_vaultop.py +84 -0
- compass_api_sdk/models/v1_wildcat_marketop.py +82 -0
- compass_api_sdk/models/v2_cctp_mintop.py +47 -0
- compass_api_sdk/models/v2_earn_aave_marketsop.py +57 -0
- compass_api_sdk/models/v2_earn_positionsop.py +56 -0
- compass_api_sdk/models/v2_earn_vaultsop.py +105 -0
- compass_api_sdk/models/v2bundlerequest.py +33 -0
- compass_api_sdk/models/v2bundleresponse.py +67 -0
- compass_api_sdk/models/v2useroperation.py +37 -0
- compass_api_sdk/models/vault.py +14 -14
- compass_api_sdk/models/vaultdepositparams.py +85 -0
- compass_api_sdk/models/vaultdepositrequest.py +15 -6
- compass_api_sdk/models/vaultgetvaultresponse.py +21 -11
- compass_api_sdk/models/vaultinfo.py +129 -0
- compass_api_sdk/models/vaultsresponse.py +30 -0
- compass_api_sdk/models/vaultvenue.py +27 -0
- compass_api_sdk/models/vaultwithdrawparams.py +75 -0
- compass_api_sdk/models/vaultwithdrawrequest.py +15 -6
- compass_api_sdk/models/wildcatgetmarketresponse.py +151 -0
- compass_api_sdk/models/{redeemunderlying.py → withdraw.py} +2 -2
- compass_api_sdk/models/wrapethrequest.py +15 -6
- compass_api_sdk/morpho.py +481 -816
- compass_api_sdk/pendle.py +495 -1384
- compass_api_sdk/sdk.py +39 -13
- compass_api_sdk/sky.py +275 -240
- compass_api_sdk/smart_account.py +37 -50
- compass_api_sdk/swap.py +248 -0
- compass_api_sdk/token.py +1192 -0
- compass_api_sdk/transaction_bundler.py +151 -184
- compass_api_sdk/uniswap_v3.py +531 -620
- compass_api_sdk/universal.py +181 -932
- compass_api_sdk/utils/__init__.py +18 -5
- compass_api_sdk/utils/annotations.py +32 -8
- compass_api_sdk/utils/eventstreaming.py +10 -0
- compass_api_sdk/utils/forms.py +21 -10
- compass_api_sdk/utils/queryparams.py +14 -2
- compass_api_sdk/utils/retries.py +69 -5
- compass_api_sdk/utils/serializers.py +3 -2
- compass_api_sdk/utils/unmarshal_json_response.py +38 -0
- compass_api_sdk/wildcat.py +208 -0
- compass_api_sdk-2.0.21rc1.dist-info/METADATA +623 -0
- compass_api_sdk-2.0.21rc1.dist-info/RECORD +346 -0
- {compass_api_sdk-0.9.35.dist-info → compass_api_sdk-2.0.21rc1.dist-info}/WHEEL +1 -1
- compass_api_sdk/models/aave_avg_rateop.py +0 -141
- compass_api_sdk/models/aave_liquidity_changeop.py +0 -103
- compass_api_sdk/models/aave_rateop.py +0 -134
- compass_api_sdk/models/aave_reserve_overviewop.py +0 -134
- compass_api_sdk/models/aave_std_rateop.py +0 -141
- compass_api_sdk/models/aave_token_priceop.py +0 -134
- compass_api_sdk/models/aave_user_position_per_tokenop.py +0 -141
- compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +0 -37
- compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +0 -159
- compass_api_sdk/models/aerodromeposition.py +0 -70
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_vaultstate.py +0 -53
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_vaultstate.py +0 -32
- compass_api_sdk/models/generic_supported_tokensop.py +0 -28
- compass_api_sdk/models/generic_visualize_portfolioop.py +0 -37
- compass_api_sdk/models/image.py +0 -15
- compass_api_sdk/models/liquidity.py +0 -16
- compass_api_sdk/models/metadata.py +0 -50
- compass_api_sdk/models/morpho_vault_positionop.py +0 -37
- compass_api_sdk/models/morpho_vaultop.py +0 -30
- compass_api_sdk/models/morphocheckvaultpositionresponse.py +0 -20
- compass_api_sdk/models/morphogetvaultresponse.py +0 -86
- compass_api_sdk/models/pendle_marketsop.py +0 -28
- compass_api_sdk/models/pendleaddliquidityparams.py +0 -50
- compass_api_sdk/models/pendleaddliquidityrequest.py +0 -61
- compass_api_sdk/models/pendlebuyptparams.py +0 -48
- compass_api_sdk/models/pendlebuyptrequest.py +0 -59
- compass_api_sdk/models/pendlebuyytparams.py +0 -48
- compass_api_sdk/models/pendlebuyytrequest.py +0 -59
- compass_api_sdk/models/pendlegetuserpositionresponse.py +0 -56
- compass_api_sdk/models/pendleremoveliquidityparams.py +0 -50
- compass_api_sdk/models/pendleremoveliquidityrequest.py +0 -61
- compass_api_sdk/models/pendlesellptparams.py +0 -48
- compass_api_sdk/models/pendlesellptrequest.py +0 -61
- compass_api_sdk/models/pendlesellytparams.py +0 -48
- compass_api_sdk/models/pendlesellytrequest.py +0 -61
- compass_api_sdk/models/sky_positionop.py +0 -31
- compass_api_sdk/models/token_addressop.py +0 -89
- compass_api_sdk/models/token_balanceop.py +0 -55
- compass_api_sdk/models/token_enum.py +0 -57
- compass_api_sdk/models/token_priceop.py +0 -89
- compass_api_sdk/models/tokenaddressresponse.py +0 -15
- compass_api_sdk/models/tokeninfo.py +0 -17
- compass_api_sdk/models/tokentransfererc20params.py +0 -63
- compass_api_sdk/models/txresponse.py +0 -27
- compass_api_sdk/models/uniswap_pool_priceop.py +0 -170
- compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +0 -191
- compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +0 -191
- compass_api_sdk/models/userposition.py +0 -16
- compass_api_sdk/models/vaultposition.py +0 -24
- compass_api_sdk-0.9.35.dist-info/METADATA +0 -558
- compass_api_sdk-0.9.35.dist-info/RECORD +0 -260
compass_api_sdk/morpho.py
CHANGED
|
@@ -4,14 +4,15 @@ from .basesdk import BaseSDK
|
|
|
4
4
|
from compass_api_sdk import errors, models, utils
|
|
5
5
|
from compass_api_sdk._hooks import HookContext
|
|
6
6
|
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
7
8
|
from typing import Any, Mapping, Optional, Union
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class Morpho(BaseSDK):
|
|
11
|
-
def
|
|
12
|
+
def morpho_vaults(
|
|
12
13
|
self,
|
|
13
14
|
*,
|
|
14
|
-
chain: models.
|
|
15
|
+
chain: models.V1MorphoVaultsChain,
|
|
15
16
|
deposit_token: OptionalNullable[str] = UNSET,
|
|
16
17
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
18
|
server_url: Optional[str] = None,
|
|
@@ -27,7 +28,7 @@ class Morpho(BaseSDK):
|
|
|
27
28
|
exchange value increasing over time.
|
|
28
29
|
|
|
29
30
|
:param chain:
|
|
30
|
-
:param deposit_token:
|
|
31
|
+
:param deposit_token: Symbol or address of the deposit token to filter vaults by. Optional parameter.
|
|
31
32
|
:param retries: Override the default retry configuration for this method
|
|
32
33
|
:param server_url: Override the default server URL for this method
|
|
33
34
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -43,14 +44,14 @@ class Morpho(BaseSDK):
|
|
|
43
44
|
else:
|
|
44
45
|
base_url = self._get_url(base_url, url_variables)
|
|
45
46
|
|
|
46
|
-
request = models.
|
|
47
|
+
request = models.V1MorphoVaultsRequest(
|
|
47
48
|
chain=chain,
|
|
48
49
|
deposit_token=deposit_token,
|
|
49
50
|
)
|
|
50
51
|
|
|
51
52
|
req = self._build_request(
|
|
52
53
|
method="GET",
|
|
53
|
-
path="/
|
|
54
|
+
path="/v1/morpho/vaults",
|
|
54
55
|
base_url=base_url,
|
|
55
56
|
url_variables=url_variables,
|
|
56
57
|
request=request,
|
|
@@ -61,6 +62,7 @@ class Morpho(BaseSDK):
|
|
|
61
62
|
accept_header_value="application/json",
|
|
62
63
|
http_headers=http_headers,
|
|
63
64
|
security=self.sdk_configuration.security,
|
|
65
|
+
allow_empty_value=None,
|
|
64
66
|
timeout_ms=timeout_ms,
|
|
65
67
|
)
|
|
66
68
|
|
|
@@ -76,8 +78,8 @@ class Morpho(BaseSDK):
|
|
|
76
78
|
hook_ctx=HookContext(
|
|
77
79
|
config=self.sdk_configuration,
|
|
78
80
|
base_url=base_url or "",
|
|
79
|
-
operation_id="
|
|
80
|
-
oauth2_scopes=
|
|
81
|
+
operation_id="v1_morpho_vaults",
|
|
82
|
+
oauth2_scopes=None,
|
|
81
83
|
security_source=self.sdk_configuration.security,
|
|
82
84
|
),
|
|
83
85
|
request=req,
|
|
@@ -87,36 +89,25 @@ class Morpho(BaseSDK):
|
|
|
87
89
|
|
|
88
90
|
response_data: Any = None
|
|
89
91
|
if utils.match_response(http_res, "200", "application/json"):
|
|
90
|
-
return
|
|
92
|
+
return unmarshal_json_response(models.MorphoGetVaultsResponse, http_res)
|
|
91
93
|
if utils.match_response(http_res, "422", "application/json"):
|
|
92
|
-
response_data =
|
|
93
|
-
|
|
94
|
+
response_data = unmarshal_json_response(
|
|
95
|
+
errors.HTTPValidationErrorData, http_res
|
|
94
96
|
)
|
|
95
|
-
raise errors.HTTPValidationError(
|
|
97
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
96
98
|
if utils.match_response(http_res, "4XX", "*"):
|
|
97
99
|
http_res_text = utils.stream_to_text(http_res)
|
|
98
|
-
raise errors.APIError(
|
|
99
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
100
|
-
)
|
|
100
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
101
101
|
if utils.match_response(http_res, "5XX", "*"):
|
|
102
102
|
http_res_text = utils.stream_to_text(http_res)
|
|
103
|
-
raise errors.APIError(
|
|
104
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
105
|
-
)
|
|
103
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
106
104
|
|
|
107
|
-
|
|
108
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
109
|
-
raise errors.APIError(
|
|
110
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
111
|
-
http_res.status_code,
|
|
112
|
-
http_res_text,
|
|
113
|
-
http_res,
|
|
114
|
-
)
|
|
105
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
115
106
|
|
|
116
|
-
async def
|
|
107
|
+
async def morpho_vaults_async(
|
|
117
108
|
self,
|
|
118
109
|
*,
|
|
119
|
-
chain: models.
|
|
110
|
+
chain: models.V1MorphoVaultsChain,
|
|
120
111
|
deposit_token: OptionalNullable[str] = UNSET,
|
|
121
112
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
122
113
|
server_url: Optional[str] = None,
|
|
@@ -132,7 +123,7 @@ class Morpho(BaseSDK):
|
|
|
132
123
|
exchange value increasing over time.
|
|
133
124
|
|
|
134
125
|
:param chain:
|
|
135
|
-
:param deposit_token:
|
|
126
|
+
:param deposit_token: Symbol or address of the deposit token to filter vaults by. Optional parameter.
|
|
136
127
|
:param retries: Override the default retry configuration for this method
|
|
137
128
|
:param server_url: Override the default server URL for this method
|
|
138
129
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -148,14 +139,14 @@ class Morpho(BaseSDK):
|
|
|
148
139
|
else:
|
|
149
140
|
base_url = self._get_url(base_url, url_variables)
|
|
150
141
|
|
|
151
|
-
request = models.
|
|
142
|
+
request = models.V1MorphoVaultsRequest(
|
|
152
143
|
chain=chain,
|
|
153
144
|
deposit_token=deposit_token,
|
|
154
145
|
)
|
|
155
146
|
|
|
156
147
|
req = self._build_request_async(
|
|
157
148
|
method="GET",
|
|
158
|
-
path="/
|
|
149
|
+
path="/v1/morpho/vaults",
|
|
159
150
|
base_url=base_url,
|
|
160
151
|
url_variables=url_variables,
|
|
161
152
|
request=request,
|
|
@@ -166,6 +157,7 @@ class Morpho(BaseSDK):
|
|
|
166
157
|
accept_header_value="application/json",
|
|
167
158
|
http_headers=http_headers,
|
|
168
159
|
security=self.sdk_configuration.security,
|
|
160
|
+
allow_empty_value=None,
|
|
169
161
|
timeout_ms=timeout_ms,
|
|
170
162
|
)
|
|
171
163
|
|
|
@@ -181,8 +173,8 @@ class Morpho(BaseSDK):
|
|
|
181
173
|
hook_ctx=HookContext(
|
|
182
174
|
config=self.sdk_configuration,
|
|
183
175
|
base_url=base_url or "",
|
|
184
|
-
operation_id="
|
|
185
|
-
oauth2_scopes=
|
|
176
|
+
operation_id="v1_morpho_vaults",
|
|
177
|
+
oauth2_scopes=None,
|
|
186
178
|
security_source=self.sdk_configuration.security,
|
|
187
179
|
),
|
|
188
180
|
request=req,
|
|
@@ -192,55 +184,43 @@ class Morpho(BaseSDK):
|
|
|
192
184
|
|
|
193
185
|
response_data: Any = None
|
|
194
186
|
if utils.match_response(http_res, "200", "application/json"):
|
|
195
|
-
return
|
|
187
|
+
return unmarshal_json_response(models.MorphoGetVaultsResponse, http_res)
|
|
196
188
|
if utils.match_response(http_res, "422", "application/json"):
|
|
197
|
-
response_data =
|
|
198
|
-
|
|
189
|
+
response_data = unmarshal_json_response(
|
|
190
|
+
errors.HTTPValidationErrorData, http_res
|
|
199
191
|
)
|
|
200
|
-
raise errors.HTTPValidationError(
|
|
192
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
201
193
|
if utils.match_response(http_res, "4XX", "*"):
|
|
202
194
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
203
|
-
raise errors.APIError(
|
|
204
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
205
|
-
)
|
|
195
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
206
196
|
if utils.match_response(http_res, "5XX", "*"):
|
|
207
197
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
208
|
-
raise errors.APIError(
|
|
209
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
210
|
-
)
|
|
198
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
211
199
|
|
|
212
|
-
|
|
213
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
214
|
-
raise errors.APIError(
|
|
215
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
216
|
-
http_res.status_code,
|
|
217
|
-
http_res_text,
|
|
218
|
-
http_res,
|
|
219
|
-
)
|
|
200
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
220
201
|
|
|
221
|
-
def
|
|
202
|
+
def morpho_vault(
|
|
222
203
|
self,
|
|
223
204
|
*,
|
|
224
|
-
chain: models.
|
|
225
|
-
vault_address: str
|
|
205
|
+
chain: models.V1MorphoVaultChain,
|
|
206
|
+
vault_address: str,
|
|
207
|
+
block: OptionalNullable[int] = UNSET,
|
|
208
|
+
user_address: OptionalNullable[str] = UNSET,
|
|
226
209
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
227
210
|
server_url: Optional[str] = None,
|
|
228
211
|
timeout_ms: Optional[int] = None,
|
|
229
212
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
230
|
-
) -> models.
|
|
231
|
-
r"""Get Vault
|
|
213
|
+
) -> models.VaultGetVaultResponse:
|
|
214
|
+
r"""Get Vault & User Position
|
|
232
215
|
|
|
233
|
-
Get data &
|
|
216
|
+
Get Vault data & User Position.
|
|
234
217
|
|
|
235
|
-
|
|
236
|
-
- Current, daily, weekly, monthly, yearly APY
|
|
237
|
-
- Underlying asset data
|
|
238
|
-
- Total liquidity
|
|
239
|
-
- Pertinent metadata
|
|
240
|
-
- Whitelist status
|
|
218
|
+
The user position is only included if 'user_address' parameter is included.
|
|
241
219
|
|
|
242
220
|
:param chain:
|
|
243
|
-
:param vault_address: The vault address of the desired vault
|
|
221
|
+
:param vault_address: The vault address of the desired vault position.
|
|
222
|
+
:param block: Optional block number (defaults to latest).
|
|
223
|
+
:param user_address: The user address of the desired vault position. Only include if you would like the user position included in the response. Defaults to `None`.
|
|
244
224
|
:param retries: Override the default retry configuration for this method
|
|
245
225
|
:param server_url: Override the default server URL for this method
|
|
246
226
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -256,14 +236,16 @@ class Morpho(BaseSDK):
|
|
|
256
236
|
else:
|
|
257
237
|
base_url = self._get_url(base_url, url_variables)
|
|
258
238
|
|
|
259
|
-
request = models.
|
|
239
|
+
request = models.V1MorphoVaultRequest(
|
|
260
240
|
chain=chain,
|
|
241
|
+
block=block,
|
|
261
242
|
vault_address=vault_address,
|
|
243
|
+
user_address=user_address,
|
|
262
244
|
)
|
|
263
245
|
|
|
264
246
|
req = self._build_request(
|
|
265
247
|
method="GET",
|
|
266
|
-
path="/
|
|
248
|
+
path="/v1/morpho/vault",
|
|
267
249
|
base_url=base_url,
|
|
268
250
|
url_variables=url_variables,
|
|
269
251
|
request=request,
|
|
@@ -274,6 +256,7 @@ class Morpho(BaseSDK):
|
|
|
274
256
|
accept_header_value="application/json",
|
|
275
257
|
http_headers=http_headers,
|
|
276
258
|
security=self.sdk_configuration.security,
|
|
259
|
+
allow_empty_value=None,
|
|
277
260
|
timeout_ms=timeout_ms,
|
|
278
261
|
)
|
|
279
262
|
|
|
@@ -289,8 +272,8 @@ class Morpho(BaseSDK):
|
|
|
289
272
|
hook_ctx=HookContext(
|
|
290
273
|
config=self.sdk_configuration,
|
|
291
274
|
base_url=base_url or "",
|
|
292
|
-
operation_id="
|
|
293
|
-
oauth2_scopes=
|
|
275
|
+
operation_id="v1_morpho_vault",
|
|
276
|
+
oauth2_scopes=None,
|
|
294
277
|
security_source=self.sdk_configuration.security,
|
|
295
278
|
),
|
|
296
279
|
request=req,
|
|
@@ -300,159 +283,43 @@ class Morpho(BaseSDK):
|
|
|
300
283
|
|
|
301
284
|
response_data: Any = None
|
|
302
285
|
if utils.match_response(http_res, "200", "application/json"):
|
|
303
|
-
return
|
|
286
|
+
return unmarshal_json_response(models.VaultGetVaultResponse, http_res)
|
|
304
287
|
if utils.match_response(http_res, "422", "application/json"):
|
|
305
|
-
response_data =
|
|
306
|
-
|
|
288
|
+
response_data = unmarshal_json_response(
|
|
289
|
+
errors.HTTPValidationErrorData, http_res
|
|
307
290
|
)
|
|
308
|
-
raise errors.HTTPValidationError(
|
|
291
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
309
292
|
if utils.match_response(http_res, "4XX", "*"):
|
|
310
293
|
http_res_text = utils.stream_to_text(http_res)
|
|
311
|
-
raise errors.APIError(
|
|
312
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
313
|
-
)
|
|
294
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
314
295
|
if utils.match_response(http_res, "5XX", "*"):
|
|
315
296
|
http_res_text = utils.stream_to_text(http_res)
|
|
316
|
-
raise errors.APIError(
|
|
317
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
318
|
-
)
|
|
297
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
319
298
|
|
|
320
|
-
|
|
321
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
322
|
-
raise errors.APIError(
|
|
323
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
324
|
-
http_res.status_code,
|
|
325
|
-
http_res_text,
|
|
326
|
-
http_res,
|
|
327
|
-
)
|
|
299
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
328
300
|
|
|
329
|
-
async def
|
|
301
|
+
async def morpho_vault_async(
|
|
330
302
|
self,
|
|
331
303
|
*,
|
|
332
|
-
chain: models.
|
|
333
|
-
vault_address: str
|
|
304
|
+
chain: models.V1MorphoVaultChain,
|
|
305
|
+
vault_address: str,
|
|
306
|
+
block: OptionalNullable[int] = UNSET,
|
|
307
|
+
user_address: OptionalNullable[str] = UNSET,
|
|
334
308
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
335
309
|
server_url: Optional[str] = None,
|
|
336
310
|
timeout_ms: Optional[int] = None,
|
|
337
311
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
338
|
-
) -> models.
|
|
339
|
-
r"""Get Vault
|
|
340
|
-
|
|
341
|
-
Get data & metrics for a specific Morpho vault.
|
|
342
|
-
|
|
343
|
-
Including:
|
|
344
|
-
- Current, daily, weekly, monthly, yearly APY
|
|
345
|
-
- Underlying asset data
|
|
346
|
-
- Total liquidity
|
|
347
|
-
- Pertinent metadata
|
|
348
|
-
- Whitelist status
|
|
349
|
-
|
|
350
|
-
:param chain:
|
|
351
|
-
:param vault_address: The vault address of the desired vault data & metrics.
|
|
352
|
-
:param retries: Override the default retry configuration for this method
|
|
353
|
-
:param server_url: Override the default server URL for this method
|
|
354
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
355
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
356
|
-
"""
|
|
357
|
-
base_url = None
|
|
358
|
-
url_variables = None
|
|
359
|
-
if timeout_ms is None:
|
|
360
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
361
|
-
|
|
362
|
-
if server_url is not None:
|
|
363
|
-
base_url = server_url
|
|
364
|
-
else:
|
|
365
|
-
base_url = self._get_url(base_url, url_variables)
|
|
366
|
-
|
|
367
|
-
request = models.MorphoVaultRequest(
|
|
368
|
-
chain=chain,
|
|
369
|
-
vault_address=vault_address,
|
|
370
|
-
)
|
|
371
|
-
|
|
372
|
-
req = self._build_request_async(
|
|
373
|
-
method="GET",
|
|
374
|
-
path="/v0/morpho/vault",
|
|
375
|
-
base_url=base_url,
|
|
376
|
-
url_variables=url_variables,
|
|
377
|
-
request=request,
|
|
378
|
-
request_body_required=False,
|
|
379
|
-
request_has_path_params=False,
|
|
380
|
-
request_has_query_params=True,
|
|
381
|
-
user_agent_header="user-agent",
|
|
382
|
-
accept_header_value="application/json",
|
|
383
|
-
http_headers=http_headers,
|
|
384
|
-
security=self.sdk_configuration.security,
|
|
385
|
-
timeout_ms=timeout_ms,
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
if retries == UNSET:
|
|
389
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
390
|
-
retries = self.sdk_configuration.retry_config
|
|
391
|
-
|
|
392
|
-
retry_config = None
|
|
393
|
-
if isinstance(retries, utils.RetryConfig):
|
|
394
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
395
|
-
|
|
396
|
-
http_res = await self.do_request_async(
|
|
397
|
-
hook_ctx=HookContext(
|
|
398
|
-
config=self.sdk_configuration,
|
|
399
|
-
base_url=base_url or "",
|
|
400
|
-
operation_id="morpho_vault",
|
|
401
|
-
oauth2_scopes=[],
|
|
402
|
-
security_source=self.sdk_configuration.security,
|
|
403
|
-
),
|
|
404
|
-
request=req,
|
|
405
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
406
|
-
retry_config=retry_config,
|
|
407
|
-
)
|
|
408
|
-
|
|
409
|
-
response_data: Any = None
|
|
410
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
411
|
-
return utils.unmarshal_json(http_res.text, models.MorphoGetVaultResponse)
|
|
412
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
413
|
-
response_data = utils.unmarshal_json(
|
|
414
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
415
|
-
)
|
|
416
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
417
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
418
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
419
|
-
raise errors.APIError(
|
|
420
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
421
|
-
)
|
|
422
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
423
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
424
|
-
raise errors.APIError(
|
|
425
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
426
|
-
)
|
|
312
|
+
) -> models.VaultGetVaultResponse:
|
|
313
|
+
r"""Get Vault & User Position
|
|
427
314
|
|
|
428
|
-
|
|
429
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
430
|
-
raise errors.APIError(
|
|
431
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
432
|
-
http_res.status_code,
|
|
433
|
-
http_res_text,
|
|
434
|
-
http_res,
|
|
435
|
-
)
|
|
315
|
+
Get Vault data & User Position.
|
|
436
316
|
|
|
437
|
-
|
|
438
|
-
self,
|
|
439
|
-
*,
|
|
440
|
-
chain: models.MorphoVaultPositionChain = models.MorphoVaultPositionChain.BASE_MAINNET,
|
|
441
|
-
user_address: str = "0xB3B45f5aCBb58a432BDe58724c1C959E11D5A418",
|
|
442
|
-
vault_address: str = "0xc1256Ae5FF1cf2719D4937adb3bbCCab2E00A2Ca",
|
|
443
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
444
|
-
server_url: Optional[str] = None,
|
|
445
|
-
timeout_ms: Optional[int] = None,
|
|
446
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
447
|
-
) -> models.MorphoCheckVaultPositionResponse:
|
|
448
|
-
r"""Check Vault Position
|
|
449
|
-
|
|
450
|
-
Check how many shares you own and the equivalent token amount of a given
|
|
451
|
-
vault.
|
|
317
|
+
The user position is only included if 'user_address' parameter is included.
|
|
452
318
|
|
|
453
319
|
:param chain:
|
|
454
|
-
:param user_address: The user address of the desired vault position.
|
|
455
320
|
:param vault_address: The vault address of the desired vault position.
|
|
321
|
+
:param block: Optional block number (defaults to latest).
|
|
322
|
+
:param user_address: The user address of the desired vault position. Only include if you would like the user position included in the response. Defaults to `None`.
|
|
456
323
|
:param retries: Override the default retry configuration for this method
|
|
457
324
|
:param server_url: Override the default server URL for this method
|
|
458
325
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -468,122 +335,16 @@ class Morpho(BaseSDK):
|
|
|
468
335
|
else:
|
|
469
336
|
base_url = self._get_url(base_url, url_variables)
|
|
470
337
|
|
|
471
|
-
request = models.
|
|
338
|
+
request = models.V1MorphoVaultRequest(
|
|
472
339
|
chain=chain,
|
|
473
|
-
|
|
340
|
+
block=block,
|
|
474
341
|
vault_address=vault_address,
|
|
475
|
-
)
|
|
476
|
-
|
|
477
|
-
req = self._build_request(
|
|
478
|
-
method="GET",
|
|
479
|
-
path="/v0/morpho/vault_position",
|
|
480
|
-
base_url=base_url,
|
|
481
|
-
url_variables=url_variables,
|
|
482
|
-
request=request,
|
|
483
|
-
request_body_required=False,
|
|
484
|
-
request_has_path_params=False,
|
|
485
|
-
request_has_query_params=True,
|
|
486
|
-
user_agent_header="user-agent",
|
|
487
|
-
accept_header_value="application/json",
|
|
488
|
-
http_headers=http_headers,
|
|
489
|
-
security=self.sdk_configuration.security,
|
|
490
|
-
timeout_ms=timeout_ms,
|
|
491
|
-
)
|
|
492
|
-
|
|
493
|
-
if retries == UNSET:
|
|
494
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
495
|
-
retries = self.sdk_configuration.retry_config
|
|
496
|
-
|
|
497
|
-
retry_config = None
|
|
498
|
-
if isinstance(retries, utils.RetryConfig):
|
|
499
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
500
|
-
|
|
501
|
-
http_res = self.do_request(
|
|
502
|
-
hook_ctx=HookContext(
|
|
503
|
-
config=self.sdk_configuration,
|
|
504
|
-
base_url=base_url or "",
|
|
505
|
-
operation_id="morpho_vault_position",
|
|
506
|
-
oauth2_scopes=[],
|
|
507
|
-
security_source=self.sdk_configuration.security,
|
|
508
|
-
),
|
|
509
|
-
request=req,
|
|
510
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
511
|
-
retry_config=retry_config,
|
|
512
|
-
)
|
|
513
|
-
|
|
514
|
-
response_data: Any = None
|
|
515
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
516
|
-
return utils.unmarshal_json(
|
|
517
|
-
http_res.text, models.MorphoCheckVaultPositionResponse
|
|
518
|
-
)
|
|
519
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
520
|
-
response_data = utils.unmarshal_json(
|
|
521
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
522
|
-
)
|
|
523
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
524
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
525
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
526
|
-
raise errors.APIError(
|
|
527
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
528
|
-
)
|
|
529
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
530
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
531
|
-
raise errors.APIError(
|
|
532
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
533
|
-
)
|
|
534
|
-
|
|
535
|
-
content_type = http_res.headers.get("Content-Type")
|
|
536
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
537
|
-
raise errors.APIError(
|
|
538
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
539
|
-
http_res.status_code,
|
|
540
|
-
http_res_text,
|
|
541
|
-
http_res,
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
async def vault_position_async(
|
|
545
|
-
self,
|
|
546
|
-
*,
|
|
547
|
-
chain: models.MorphoVaultPositionChain = models.MorphoVaultPositionChain.BASE_MAINNET,
|
|
548
|
-
user_address: str = "0xB3B45f5aCBb58a432BDe58724c1C959E11D5A418",
|
|
549
|
-
vault_address: str = "0xc1256Ae5FF1cf2719D4937adb3bbCCab2E00A2Ca",
|
|
550
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
551
|
-
server_url: Optional[str] = None,
|
|
552
|
-
timeout_ms: Optional[int] = None,
|
|
553
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
554
|
-
) -> models.MorphoCheckVaultPositionResponse:
|
|
555
|
-
r"""Check Vault Position
|
|
556
|
-
|
|
557
|
-
Check how many shares you own and the equivalent token amount of a given
|
|
558
|
-
vault.
|
|
559
|
-
|
|
560
|
-
:param chain:
|
|
561
|
-
:param user_address: The user address of the desired vault position.
|
|
562
|
-
:param vault_address: The vault address of the desired vault position.
|
|
563
|
-
:param retries: Override the default retry configuration for this method
|
|
564
|
-
:param server_url: Override the default server URL for this method
|
|
565
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
566
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
567
|
-
"""
|
|
568
|
-
base_url = None
|
|
569
|
-
url_variables = None
|
|
570
|
-
if timeout_ms is None:
|
|
571
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
572
|
-
|
|
573
|
-
if server_url is not None:
|
|
574
|
-
base_url = server_url
|
|
575
|
-
else:
|
|
576
|
-
base_url = self._get_url(base_url, url_variables)
|
|
577
|
-
|
|
578
|
-
request = models.MorphoVaultPositionRequest(
|
|
579
|
-
chain=chain,
|
|
580
342
|
user_address=user_address,
|
|
581
|
-
vault_address=vault_address,
|
|
582
343
|
)
|
|
583
344
|
|
|
584
345
|
req = self._build_request_async(
|
|
585
346
|
method="GET",
|
|
586
|
-
path="/
|
|
347
|
+
path="/v1/morpho/vault",
|
|
587
348
|
base_url=base_url,
|
|
588
349
|
url_variables=url_variables,
|
|
589
350
|
request=request,
|
|
@@ -594,6 +355,7 @@ class Morpho(BaseSDK):
|
|
|
594
355
|
accept_header_value="application/json",
|
|
595
356
|
http_headers=http_headers,
|
|
596
357
|
security=self.sdk_configuration.security,
|
|
358
|
+
allow_empty_value=None,
|
|
597
359
|
timeout_ms=timeout_ms,
|
|
598
360
|
)
|
|
599
361
|
|
|
@@ -609,8 +371,8 @@ class Morpho(BaseSDK):
|
|
|
609
371
|
hook_ctx=HookContext(
|
|
610
372
|
config=self.sdk_configuration,
|
|
611
373
|
base_url=base_url or "",
|
|
612
|
-
operation_id="
|
|
613
|
-
oauth2_scopes=
|
|
374
|
+
operation_id="v1_morpho_vault",
|
|
375
|
+
oauth2_scopes=None,
|
|
614
376
|
security_source=self.sdk_configuration.security,
|
|
615
377
|
),
|
|
616
378
|
request=req,
|
|
@@ -620,38 +382,25 @@ class Morpho(BaseSDK):
|
|
|
620
382
|
|
|
621
383
|
response_data: Any = None
|
|
622
384
|
if utils.match_response(http_res, "200", "application/json"):
|
|
623
|
-
return
|
|
624
|
-
http_res.text, models.MorphoCheckVaultPositionResponse
|
|
625
|
-
)
|
|
385
|
+
return unmarshal_json_response(models.VaultGetVaultResponse, http_res)
|
|
626
386
|
if utils.match_response(http_res, "422", "application/json"):
|
|
627
|
-
response_data =
|
|
628
|
-
|
|
387
|
+
response_data = unmarshal_json_response(
|
|
388
|
+
errors.HTTPValidationErrorData, http_res
|
|
629
389
|
)
|
|
630
|
-
raise errors.HTTPValidationError(
|
|
390
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
631
391
|
if utils.match_response(http_res, "4XX", "*"):
|
|
632
392
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
633
|
-
raise errors.APIError(
|
|
634
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
635
|
-
)
|
|
393
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
636
394
|
if utils.match_response(http_res, "5XX", "*"):
|
|
637
395
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
638
|
-
raise errors.APIError(
|
|
639
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
640
|
-
)
|
|
396
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
641
397
|
|
|
642
|
-
|
|
643
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
644
|
-
raise errors.APIError(
|
|
645
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
646
|
-
http_res.status_code,
|
|
647
|
-
http_res_text,
|
|
648
|
-
http_res,
|
|
649
|
-
)
|
|
398
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
650
399
|
|
|
651
|
-
def
|
|
400
|
+
def morpho_markets(
|
|
652
401
|
self,
|
|
653
402
|
*,
|
|
654
|
-
chain: models.
|
|
403
|
+
chain: models.V1MorphoMarketsChain,
|
|
655
404
|
collateral_token: OptionalNullable[str] = UNSET,
|
|
656
405
|
loan_token: OptionalNullable[str] = UNSET,
|
|
657
406
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -667,8 +416,8 @@ class Morpho(BaseSDK):
|
|
|
667
416
|
can be used as collateral.
|
|
668
417
|
|
|
669
418
|
:param chain:
|
|
670
|
-
:param collateral_token:
|
|
671
|
-
:param loan_token:
|
|
419
|
+
:param collateral_token: Symbol or address of the collateral token to filter markets by. Optional parameter.
|
|
420
|
+
:param loan_token: Symbol or address of the loan token to filter markets by. Optional parameter.
|
|
672
421
|
:param retries: Override the default retry configuration for this method
|
|
673
422
|
:param server_url: Override the default server URL for this method
|
|
674
423
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -684,7 +433,7 @@ class Morpho(BaseSDK):
|
|
|
684
433
|
else:
|
|
685
434
|
base_url = self._get_url(base_url, url_variables)
|
|
686
435
|
|
|
687
|
-
request = models.
|
|
436
|
+
request = models.V1MorphoMarketsRequest(
|
|
688
437
|
chain=chain,
|
|
689
438
|
collateral_token=collateral_token,
|
|
690
439
|
loan_token=loan_token,
|
|
@@ -692,7 +441,7 @@ class Morpho(BaseSDK):
|
|
|
692
441
|
|
|
693
442
|
req = self._build_request(
|
|
694
443
|
method="GET",
|
|
695
|
-
path="/
|
|
444
|
+
path="/v1/morpho/markets",
|
|
696
445
|
base_url=base_url,
|
|
697
446
|
url_variables=url_variables,
|
|
698
447
|
request=request,
|
|
@@ -703,6 +452,7 @@ class Morpho(BaseSDK):
|
|
|
703
452
|
accept_header_value="application/json",
|
|
704
453
|
http_headers=http_headers,
|
|
705
454
|
security=self.sdk_configuration.security,
|
|
455
|
+
allow_empty_value=None,
|
|
706
456
|
timeout_ms=timeout_ms,
|
|
707
457
|
)
|
|
708
458
|
|
|
@@ -718,8 +468,8 @@ class Morpho(BaseSDK):
|
|
|
718
468
|
hook_ctx=HookContext(
|
|
719
469
|
config=self.sdk_configuration,
|
|
720
470
|
base_url=base_url or "",
|
|
721
|
-
operation_id="
|
|
722
|
-
oauth2_scopes=
|
|
471
|
+
operation_id="v1_morpho_markets",
|
|
472
|
+
oauth2_scopes=None,
|
|
723
473
|
security_source=self.sdk_configuration.security,
|
|
724
474
|
),
|
|
725
475
|
request=req,
|
|
@@ -729,36 +479,25 @@ class Morpho(BaseSDK):
|
|
|
729
479
|
|
|
730
480
|
response_data: Any = None
|
|
731
481
|
if utils.match_response(http_res, "200", "application/json"):
|
|
732
|
-
return
|
|
482
|
+
return unmarshal_json_response(models.MorphoGetMarketsResponse, http_res)
|
|
733
483
|
if utils.match_response(http_res, "422", "application/json"):
|
|
734
|
-
response_data =
|
|
735
|
-
|
|
484
|
+
response_data = unmarshal_json_response(
|
|
485
|
+
errors.HTTPValidationErrorData, http_res
|
|
736
486
|
)
|
|
737
|
-
raise errors.HTTPValidationError(
|
|
487
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
738
488
|
if utils.match_response(http_res, "4XX", "*"):
|
|
739
489
|
http_res_text = utils.stream_to_text(http_res)
|
|
740
|
-
raise errors.APIError(
|
|
741
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
742
|
-
)
|
|
490
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
743
491
|
if utils.match_response(http_res, "5XX", "*"):
|
|
744
492
|
http_res_text = utils.stream_to_text(http_res)
|
|
745
|
-
raise errors.APIError(
|
|
746
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
747
|
-
)
|
|
493
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
748
494
|
|
|
749
|
-
|
|
750
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
751
|
-
raise errors.APIError(
|
|
752
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
753
|
-
http_res.status_code,
|
|
754
|
-
http_res_text,
|
|
755
|
-
http_res,
|
|
756
|
-
)
|
|
495
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
757
496
|
|
|
758
|
-
async def
|
|
497
|
+
async def morpho_markets_async(
|
|
759
498
|
self,
|
|
760
499
|
*,
|
|
761
|
-
chain: models.
|
|
500
|
+
chain: models.V1MorphoMarketsChain,
|
|
762
501
|
collateral_token: OptionalNullable[str] = UNSET,
|
|
763
502
|
loan_token: OptionalNullable[str] = UNSET,
|
|
764
503
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
@@ -774,8 +513,8 @@ class Morpho(BaseSDK):
|
|
|
774
513
|
can be used as collateral.
|
|
775
514
|
|
|
776
515
|
:param chain:
|
|
777
|
-
:param collateral_token:
|
|
778
|
-
:param loan_token:
|
|
516
|
+
:param collateral_token: Symbol or address of the collateral token to filter markets by. Optional parameter.
|
|
517
|
+
:param loan_token: Symbol or address of the loan token to filter markets by. Optional parameter.
|
|
779
518
|
:param retries: Override the default retry configuration for this method
|
|
780
519
|
:param server_url: Override the default server URL for this method
|
|
781
520
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -791,7 +530,7 @@ class Morpho(BaseSDK):
|
|
|
791
530
|
else:
|
|
792
531
|
base_url = self._get_url(base_url, url_variables)
|
|
793
532
|
|
|
794
|
-
request = models.
|
|
533
|
+
request = models.V1MorphoMarketsRequest(
|
|
795
534
|
chain=chain,
|
|
796
535
|
collateral_token=collateral_token,
|
|
797
536
|
loan_token=loan_token,
|
|
@@ -799,7 +538,7 @@ class Morpho(BaseSDK):
|
|
|
799
538
|
|
|
800
539
|
req = self._build_request_async(
|
|
801
540
|
method="GET",
|
|
802
|
-
path="/
|
|
541
|
+
path="/v1/morpho/markets",
|
|
803
542
|
base_url=base_url,
|
|
804
543
|
url_variables=url_variables,
|
|
805
544
|
request=request,
|
|
@@ -810,6 +549,7 @@ class Morpho(BaseSDK):
|
|
|
810
549
|
accept_header_value="application/json",
|
|
811
550
|
http_headers=http_headers,
|
|
812
551
|
security=self.sdk_configuration.security,
|
|
552
|
+
allow_empty_value=None,
|
|
813
553
|
timeout_ms=timeout_ms,
|
|
814
554
|
)
|
|
815
555
|
|
|
@@ -825,8 +565,8 @@ class Morpho(BaseSDK):
|
|
|
825
565
|
hook_ctx=HookContext(
|
|
826
566
|
config=self.sdk_configuration,
|
|
827
567
|
base_url=base_url or "",
|
|
828
|
-
operation_id="
|
|
829
|
-
oauth2_scopes=
|
|
568
|
+
operation_id="v1_morpho_markets",
|
|
569
|
+
oauth2_scopes=None,
|
|
830
570
|
security_source=self.sdk_configuration.security,
|
|
831
571
|
),
|
|
832
572
|
request=req,
|
|
@@ -836,37 +576,26 @@ class Morpho(BaseSDK):
|
|
|
836
576
|
|
|
837
577
|
response_data: Any = None
|
|
838
578
|
if utils.match_response(http_res, "200", "application/json"):
|
|
839
|
-
return
|
|
579
|
+
return unmarshal_json_response(models.MorphoGetMarketsResponse, http_res)
|
|
840
580
|
if utils.match_response(http_res, "422", "application/json"):
|
|
841
|
-
response_data =
|
|
842
|
-
|
|
581
|
+
response_data = unmarshal_json_response(
|
|
582
|
+
errors.HTTPValidationErrorData, http_res
|
|
843
583
|
)
|
|
844
|
-
raise errors.HTTPValidationError(
|
|
584
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
845
585
|
if utils.match_response(http_res, "4XX", "*"):
|
|
846
586
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
847
|
-
raise errors.APIError(
|
|
848
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
849
|
-
)
|
|
587
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
850
588
|
if utils.match_response(http_res, "5XX", "*"):
|
|
851
589
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
852
|
-
raise errors.APIError(
|
|
853
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
854
|
-
)
|
|
590
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
855
591
|
|
|
856
|
-
|
|
857
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
858
|
-
raise errors.APIError(
|
|
859
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
860
|
-
http_res.status_code,
|
|
861
|
-
http_res_text,
|
|
862
|
-
http_res,
|
|
863
|
-
)
|
|
592
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
864
593
|
|
|
865
|
-
def
|
|
594
|
+
def morpho_market(
|
|
866
595
|
self,
|
|
867
596
|
*,
|
|
868
|
-
chain: models.
|
|
869
|
-
unique_market_key: str
|
|
597
|
+
chain: models.V1MorphoMarketChain,
|
|
598
|
+
unique_market_key: str,
|
|
870
599
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
871
600
|
server_url: Optional[str] = None,
|
|
872
601
|
timeout_ms: Optional[int] = None,
|
|
@@ -902,14 +631,14 @@ class Morpho(BaseSDK):
|
|
|
902
631
|
else:
|
|
903
632
|
base_url = self._get_url(base_url, url_variables)
|
|
904
633
|
|
|
905
|
-
request = models.
|
|
634
|
+
request = models.V1MorphoMarketRequest(
|
|
906
635
|
chain=chain,
|
|
907
636
|
unique_market_key=unique_market_key,
|
|
908
637
|
)
|
|
909
638
|
|
|
910
639
|
req = self._build_request(
|
|
911
640
|
method="GET",
|
|
912
|
-
path="/
|
|
641
|
+
path="/v1/morpho/market",
|
|
913
642
|
base_url=base_url,
|
|
914
643
|
url_variables=url_variables,
|
|
915
644
|
request=request,
|
|
@@ -920,6 +649,7 @@ class Morpho(BaseSDK):
|
|
|
920
649
|
accept_header_value="application/json",
|
|
921
650
|
http_headers=http_headers,
|
|
922
651
|
security=self.sdk_configuration.security,
|
|
652
|
+
allow_empty_value=None,
|
|
923
653
|
timeout_ms=timeout_ms,
|
|
924
654
|
)
|
|
925
655
|
|
|
@@ -935,8 +665,8 @@ class Morpho(BaseSDK):
|
|
|
935
665
|
hook_ctx=HookContext(
|
|
936
666
|
config=self.sdk_configuration,
|
|
937
667
|
base_url=base_url or "",
|
|
938
|
-
operation_id="
|
|
939
|
-
oauth2_scopes=
|
|
668
|
+
operation_id="v1_morpho_market",
|
|
669
|
+
oauth2_scopes=None,
|
|
940
670
|
security_source=self.sdk_configuration.security,
|
|
941
671
|
),
|
|
942
672
|
request=req,
|
|
@@ -946,37 +676,26 @@ class Morpho(BaseSDK):
|
|
|
946
676
|
|
|
947
677
|
response_data: Any = None
|
|
948
678
|
if utils.match_response(http_res, "200", "application/json"):
|
|
949
|
-
return
|
|
679
|
+
return unmarshal_json_response(models.MorphoGetMarketResponse, http_res)
|
|
950
680
|
if utils.match_response(http_res, "422", "application/json"):
|
|
951
|
-
response_data =
|
|
952
|
-
|
|
681
|
+
response_data = unmarshal_json_response(
|
|
682
|
+
errors.HTTPValidationErrorData, http_res
|
|
953
683
|
)
|
|
954
|
-
raise errors.HTTPValidationError(
|
|
684
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
955
685
|
if utils.match_response(http_res, "4XX", "*"):
|
|
956
686
|
http_res_text = utils.stream_to_text(http_res)
|
|
957
|
-
raise errors.APIError(
|
|
958
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
959
|
-
)
|
|
687
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
960
688
|
if utils.match_response(http_res, "5XX", "*"):
|
|
961
689
|
http_res_text = utils.stream_to_text(http_res)
|
|
962
|
-
raise errors.APIError(
|
|
963
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
964
|
-
)
|
|
690
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
965
691
|
|
|
966
|
-
|
|
967
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
968
|
-
raise errors.APIError(
|
|
969
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
970
|
-
http_res.status_code,
|
|
971
|
-
http_res_text,
|
|
972
|
-
http_res,
|
|
973
|
-
)
|
|
692
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
974
693
|
|
|
975
|
-
async def
|
|
694
|
+
async def morpho_market_async(
|
|
976
695
|
self,
|
|
977
696
|
*,
|
|
978
|
-
chain: models.
|
|
979
|
-
unique_market_key: str
|
|
697
|
+
chain: models.V1MorphoMarketChain,
|
|
698
|
+
unique_market_key: str,
|
|
980
699
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
981
700
|
server_url: Optional[str] = None,
|
|
982
701
|
timeout_ms: Optional[int] = None,
|
|
@@ -1012,14 +731,14 @@ class Morpho(BaseSDK):
|
|
|
1012
731
|
else:
|
|
1013
732
|
base_url = self._get_url(base_url, url_variables)
|
|
1014
733
|
|
|
1015
|
-
request = models.
|
|
734
|
+
request = models.V1MorphoMarketRequest(
|
|
1016
735
|
chain=chain,
|
|
1017
736
|
unique_market_key=unique_market_key,
|
|
1018
737
|
)
|
|
1019
738
|
|
|
1020
739
|
req = self._build_request_async(
|
|
1021
740
|
method="GET",
|
|
1022
|
-
path="/
|
|
741
|
+
path="/v1/morpho/market",
|
|
1023
742
|
base_url=base_url,
|
|
1024
743
|
url_variables=url_variables,
|
|
1025
744
|
request=request,
|
|
@@ -1030,6 +749,7 @@ class Morpho(BaseSDK):
|
|
|
1030
749
|
accept_header_value="application/json",
|
|
1031
750
|
http_headers=http_headers,
|
|
1032
751
|
security=self.sdk_configuration.security,
|
|
752
|
+
allow_empty_value=None,
|
|
1033
753
|
timeout_ms=timeout_ms,
|
|
1034
754
|
)
|
|
1035
755
|
|
|
@@ -1045,8 +765,8 @@ class Morpho(BaseSDK):
|
|
|
1045
765
|
hook_ctx=HookContext(
|
|
1046
766
|
config=self.sdk_configuration,
|
|
1047
767
|
base_url=base_url or "",
|
|
1048
|
-
operation_id="
|
|
1049
|
-
oauth2_scopes=
|
|
768
|
+
operation_id="v1_morpho_market",
|
|
769
|
+
oauth2_scopes=None,
|
|
1050
770
|
security_source=self.sdk_configuration.security,
|
|
1051
771
|
),
|
|
1052
772
|
request=req,
|
|
@@ -1056,38 +776,27 @@ class Morpho(BaseSDK):
|
|
|
1056
776
|
|
|
1057
777
|
response_data: Any = None
|
|
1058
778
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1059
|
-
return
|
|
779
|
+
return unmarshal_json_response(models.MorphoGetMarketResponse, http_res)
|
|
1060
780
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1061
|
-
response_data =
|
|
1062
|
-
|
|
781
|
+
response_data = unmarshal_json_response(
|
|
782
|
+
errors.HTTPValidationErrorData, http_res
|
|
1063
783
|
)
|
|
1064
|
-
raise errors.HTTPValidationError(
|
|
784
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1065
785
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1066
786
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1067
|
-
raise errors.APIError(
|
|
1068
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1069
|
-
)
|
|
787
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1070
788
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1071
789
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1072
|
-
raise errors.APIError(
|
|
1073
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1074
|
-
)
|
|
790
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1075
791
|
|
|
1076
|
-
|
|
1077
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1078
|
-
raise errors.APIError(
|
|
1079
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1080
|
-
http_res.status_code,
|
|
1081
|
-
http_res_text,
|
|
1082
|
-
http_res,
|
|
1083
|
-
)
|
|
792
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1084
793
|
|
|
1085
|
-
def
|
|
794
|
+
def morpho_market_position(
|
|
1086
795
|
self,
|
|
1087
796
|
*,
|
|
1088
|
-
chain: models.
|
|
1089
|
-
user_address: str
|
|
1090
|
-
unique_market_key: str
|
|
797
|
+
chain: models.V1MorphoMarketPositionChain,
|
|
798
|
+
user_address: str,
|
|
799
|
+
unique_market_key: str,
|
|
1091
800
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1092
801
|
server_url: Optional[str] = None,
|
|
1093
802
|
timeout_ms: Optional[int] = None,
|
|
@@ -1116,7 +825,7 @@ class Morpho(BaseSDK):
|
|
|
1116
825
|
else:
|
|
1117
826
|
base_url = self._get_url(base_url, url_variables)
|
|
1118
827
|
|
|
1119
|
-
request = models.
|
|
828
|
+
request = models.V1MorphoMarketPositionRequest(
|
|
1120
829
|
chain=chain,
|
|
1121
830
|
user_address=user_address,
|
|
1122
831
|
unique_market_key=unique_market_key,
|
|
@@ -1124,7 +833,7 @@ class Morpho(BaseSDK):
|
|
|
1124
833
|
|
|
1125
834
|
req = self._build_request(
|
|
1126
835
|
method="GET",
|
|
1127
|
-
path="/
|
|
836
|
+
path="/v1/morpho/market_position",
|
|
1128
837
|
base_url=base_url,
|
|
1129
838
|
url_variables=url_variables,
|
|
1130
839
|
request=request,
|
|
@@ -1135,6 +844,7 @@ class Morpho(BaseSDK):
|
|
|
1135
844
|
accept_header_value="application/json",
|
|
1136
845
|
http_headers=http_headers,
|
|
1137
846
|
security=self.sdk_configuration.security,
|
|
847
|
+
allow_empty_value=None,
|
|
1138
848
|
timeout_ms=timeout_ms,
|
|
1139
849
|
)
|
|
1140
850
|
|
|
@@ -1150,8 +860,8 @@ class Morpho(BaseSDK):
|
|
|
1150
860
|
hook_ctx=HookContext(
|
|
1151
861
|
config=self.sdk_configuration,
|
|
1152
862
|
base_url=base_url or "",
|
|
1153
|
-
operation_id="
|
|
1154
|
-
oauth2_scopes=
|
|
863
|
+
operation_id="v1_morpho_market_position",
|
|
864
|
+
oauth2_scopes=None,
|
|
1155
865
|
security_source=self.sdk_configuration.security,
|
|
1156
866
|
),
|
|
1157
867
|
request=req,
|
|
@@ -1161,40 +871,29 @@ class Morpho(BaseSDK):
|
|
|
1161
871
|
|
|
1162
872
|
response_data: Any = None
|
|
1163
873
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1164
|
-
return
|
|
1165
|
-
|
|
874
|
+
return unmarshal_json_response(
|
|
875
|
+
models.MorphoCheckMarketPositionResponse, http_res
|
|
1166
876
|
)
|
|
1167
877
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1168
|
-
response_data =
|
|
1169
|
-
|
|
878
|
+
response_data = unmarshal_json_response(
|
|
879
|
+
errors.HTTPValidationErrorData, http_res
|
|
1170
880
|
)
|
|
1171
|
-
raise errors.HTTPValidationError(
|
|
881
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1172
882
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1173
883
|
http_res_text = utils.stream_to_text(http_res)
|
|
1174
|
-
raise errors.APIError(
|
|
1175
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1176
|
-
)
|
|
884
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1177
885
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1178
886
|
http_res_text = utils.stream_to_text(http_res)
|
|
1179
|
-
raise errors.APIError(
|
|
1180
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1181
|
-
)
|
|
887
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1182
888
|
|
|
1183
|
-
|
|
1184
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1185
|
-
raise errors.APIError(
|
|
1186
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1187
|
-
http_res.status_code,
|
|
1188
|
-
http_res_text,
|
|
1189
|
-
http_res,
|
|
1190
|
-
)
|
|
889
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1191
890
|
|
|
1192
|
-
async def
|
|
891
|
+
async def morpho_market_position_async(
|
|
1193
892
|
self,
|
|
1194
893
|
*,
|
|
1195
|
-
chain: models.
|
|
1196
|
-
user_address: str
|
|
1197
|
-
unique_market_key: str
|
|
894
|
+
chain: models.V1MorphoMarketPositionChain,
|
|
895
|
+
user_address: str,
|
|
896
|
+
unique_market_key: str,
|
|
1198
897
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1199
898
|
server_url: Optional[str] = None,
|
|
1200
899
|
timeout_ms: Optional[int] = None,
|
|
@@ -1223,7 +922,7 @@ class Morpho(BaseSDK):
|
|
|
1223
922
|
else:
|
|
1224
923
|
base_url = self._get_url(base_url, url_variables)
|
|
1225
924
|
|
|
1226
|
-
request = models.
|
|
925
|
+
request = models.V1MorphoMarketPositionRequest(
|
|
1227
926
|
chain=chain,
|
|
1228
927
|
user_address=user_address,
|
|
1229
928
|
unique_market_key=unique_market_key,
|
|
@@ -1231,7 +930,7 @@ class Morpho(BaseSDK):
|
|
|
1231
930
|
|
|
1232
931
|
req = self._build_request_async(
|
|
1233
932
|
method="GET",
|
|
1234
|
-
path="/
|
|
933
|
+
path="/v1/morpho/market_position",
|
|
1235
934
|
base_url=base_url,
|
|
1236
935
|
url_variables=url_variables,
|
|
1237
936
|
request=request,
|
|
@@ -1242,6 +941,7 @@ class Morpho(BaseSDK):
|
|
|
1242
941
|
accept_header_value="application/json",
|
|
1243
942
|
http_headers=http_headers,
|
|
1244
943
|
security=self.sdk_configuration.security,
|
|
944
|
+
allow_empty_value=None,
|
|
1245
945
|
timeout_ms=timeout_ms,
|
|
1246
946
|
)
|
|
1247
947
|
|
|
@@ -1257,8 +957,8 @@ class Morpho(BaseSDK):
|
|
|
1257
957
|
hook_ctx=HookContext(
|
|
1258
958
|
config=self.sdk_configuration,
|
|
1259
959
|
base_url=base_url or "",
|
|
1260
|
-
operation_id="
|
|
1261
|
-
oauth2_scopes=
|
|
960
|
+
operation_id="v1_morpho_market_position",
|
|
961
|
+
oauth2_scopes=None,
|
|
1262
962
|
security_source=self.sdk_configuration.security,
|
|
1263
963
|
),
|
|
1264
964
|
request=req,
|
|
@@ -1268,39 +968,28 @@ class Morpho(BaseSDK):
|
|
|
1268
968
|
|
|
1269
969
|
response_data: Any = None
|
|
1270
970
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1271
|
-
return
|
|
1272
|
-
|
|
971
|
+
return unmarshal_json_response(
|
|
972
|
+
models.MorphoCheckMarketPositionResponse, http_res
|
|
1273
973
|
)
|
|
1274
974
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1275
|
-
response_data =
|
|
1276
|
-
|
|
975
|
+
response_data = unmarshal_json_response(
|
|
976
|
+
errors.HTTPValidationErrorData, http_res
|
|
1277
977
|
)
|
|
1278
|
-
raise errors.HTTPValidationError(
|
|
978
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1279
979
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1280
980
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1281
|
-
raise errors.APIError(
|
|
1282
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1283
|
-
)
|
|
981
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1284
982
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1285
983
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1286
|
-
raise errors.APIError(
|
|
1287
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1288
|
-
)
|
|
984
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1289
985
|
|
|
1290
|
-
|
|
1291
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1292
|
-
raise errors.APIError(
|
|
1293
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1294
|
-
http_res.status_code,
|
|
1295
|
-
http_res_text,
|
|
1296
|
-
http_res,
|
|
1297
|
-
)
|
|
986
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1298
987
|
|
|
1299
|
-
def
|
|
988
|
+
def morpho_user_position(
|
|
1300
989
|
self,
|
|
1301
990
|
*,
|
|
1302
|
-
chain: models.
|
|
1303
|
-
user_address: str
|
|
991
|
+
chain: models.V1MorphoUserPositionChain,
|
|
992
|
+
user_address: str,
|
|
1304
993
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1305
994
|
server_url: Optional[str] = None,
|
|
1306
995
|
timeout_ms: Optional[int] = None,
|
|
@@ -1330,14 +1019,14 @@ class Morpho(BaseSDK):
|
|
|
1330
1019
|
else:
|
|
1331
1020
|
base_url = self._get_url(base_url, url_variables)
|
|
1332
1021
|
|
|
1333
|
-
request = models.
|
|
1022
|
+
request = models.V1MorphoUserPositionRequest(
|
|
1334
1023
|
chain=chain,
|
|
1335
1024
|
user_address=user_address,
|
|
1336
1025
|
)
|
|
1337
1026
|
|
|
1338
1027
|
req = self._build_request(
|
|
1339
1028
|
method="GET",
|
|
1340
|
-
path="/
|
|
1029
|
+
path="/v1/morpho/user_position",
|
|
1341
1030
|
base_url=base_url,
|
|
1342
1031
|
url_variables=url_variables,
|
|
1343
1032
|
request=request,
|
|
@@ -1348,6 +1037,7 @@ class Morpho(BaseSDK):
|
|
|
1348
1037
|
accept_header_value="application/json",
|
|
1349
1038
|
http_headers=http_headers,
|
|
1350
1039
|
security=self.sdk_configuration.security,
|
|
1040
|
+
allow_empty_value=None,
|
|
1351
1041
|
timeout_ms=timeout_ms,
|
|
1352
1042
|
)
|
|
1353
1043
|
|
|
@@ -1363,8 +1053,8 @@ class Morpho(BaseSDK):
|
|
|
1363
1053
|
hook_ctx=HookContext(
|
|
1364
1054
|
config=self.sdk_configuration,
|
|
1365
1055
|
base_url=base_url or "",
|
|
1366
|
-
operation_id="
|
|
1367
|
-
oauth2_scopes=
|
|
1056
|
+
operation_id="v1_morpho_user_position",
|
|
1057
|
+
oauth2_scopes=None,
|
|
1368
1058
|
security_source=self.sdk_configuration.security,
|
|
1369
1059
|
),
|
|
1370
1060
|
request=req,
|
|
@@ -1374,39 +1064,28 @@ class Morpho(BaseSDK):
|
|
|
1374
1064
|
|
|
1375
1065
|
response_data: Any = None
|
|
1376
1066
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1377
|
-
return
|
|
1378
|
-
|
|
1067
|
+
return unmarshal_json_response(
|
|
1068
|
+
models.MorphoCheckUserPositionResponse, http_res
|
|
1379
1069
|
)
|
|
1380
1070
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1381
|
-
response_data =
|
|
1382
|
-
|
|
1071
|
+
response_data = unmarshal_json_response(
|
|
1072
|
+
errors.HTTPValidationErrorData, http_res
|
|
1383
1073
|
)
|
|
1384
|
-
raise errors.HTTPValidationError(
|
|
1074
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1385
1075
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1386
1076
|
http_res_text = utils.stream_to_text(http_res)
|
|
1387
|
-
raise errors.APIError(
|
|
1388
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1389
|
-
)
|
|
1077
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1390
1078
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1391
1079
|
http_res_text = utils.stream_to_text(http_res)
|
|
1392
|
-
raise errors.APIError(
|
|
1393
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1394
|
-
)
|
|
1080
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1395
1081
|
|
|
1396
|
-
|
|
1397
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1398
|
-
raise errors.APIError(
|
|
1399
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1400
|
-
http_res.status_code,
|
|
1401
|
-
http_res_text,
|
|
1402
|
-
http_res,
|
|
1403
|
-
)
|
|
1082
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1404
1083
|
|
|
1405
|
-
async def
|
|
1084
|
+
async def morpho_user_position_async(
|
|
1406
1085
|
self,
|
|
1407
1086
|
*,
|
|
1408
|
-
chain: models.
|
|
1409
|
-
user_address: str
|
|
1087
|
+
chain: models.V1MorphoUserPositionChain,
|
|
1088
|
+
user_address: str,
|
|
1410
1089
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1411
1090
|
server_url: Optional[str] = None,
|
|
1412
1091
|
timeout_ms: Optional[int] = None,
|
|
@@ -1436,14 +1115,14 @@ class Morpho(BaseSDK):
|
|
|
1436
1115
|
else:
|
|
1437
1116
|
base_url = self._get_url(base_url, url_variables)
|
|
1438
1117
|
|
|
1439
|
-
request = models.
|
|
1118
|
+
request = models.V1MorphoUserPositionRequest(
|
|
1440
1119
|
chain=chain,
|
|
1441
1120
|
user_address=user_address,
|
|
1442
1121
|
)
|
|
1443
1122
|
|
|
1444
1123
|
req = self._build_request_async(
|
|
1445
1124
|
method="GET",
|
|
1446
|
-
path="/
|
|
1125
|
+
path="/v1/morpho/user_position",
|
|
1447
1126
|
base_url=base_url,
|
|
1448
1127
|
url_variables=url_variables,
|
|
1449
1128
|
request=request,
|
|
@@ -1454,6 +1133,7 @@ class Morpho(BaseSDK):
|
|
|
1454
1133
|
accept_header_value="application/json",
|
|
1455
1134
|
http_headers=http_headers,
|
|
1456
1135
|
security=self.sdk_configuration.security,
|
|
1136
|
+
allow_empty_value=None,
|
|
1457
1137
|
timeout_ms=timeout_ms,
|
|
1458
1138
|
)
|
|
1459
1139
|
|
|
@@ -1469,8 +1149,8 @@ class Morpho(BaseSDK):
|
|
|
1469
1149
|
hook_ctx=HookContext(
|
|
1470
1150
|
config=self.sdk_configuration,
|
|
1471
1151
|
base_url=base_url or "",
|
|
1472
|
-
operation_id="
|
|
1473
|
-
oauth2_scopes=
|
|
1152
|
+
operation_id="v1_morpho_user_position",
|
|
1153
|
+
oauth2_scopes=None,
|
|
1474
1154
|
security_source=self.sdk_configuration.security,
|
|
1475
1155
|
),
|
|
1476
1156
|
request=req,
|
|
@@ -1480,35 +1160,24 @@ class Morpho(BaseSDK):
|
|
|
1480
1160
|
|
|
1481
1161
|
response_data: Any = None
|
|
1482
1162
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1483
|
-
return
|
|
1484
|
-
|
|
1163
|
+
return unmarshal_json_response(
|
|
1164
|
+
models.MorphoCheckUserPositionResponse, http_res
|
|
1485
1165
|
)
|
|
1486
1166
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1487
|
-
response_data =
|
|
1488
|
-
|
|
1167
|
+
response_data = unmarshal_json_response(
|
|
1168
|
+
errors.HTTPValidationErrorData, http_res
|
|
1489
1169
|
)
|
|
1490
|
-
raise errors.HTTPValidationError(
|
|
1170
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1491
1171
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1492
1172
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1493
|
-
raise errors.APIError(
|
|
1494
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1495
|
-
)
|
|
1173
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1496
1174
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1497
1175
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1498
|
-
raise errors.APIError(
|
|
1499
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1500
|
-
)
|
|
1176
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1501
1177
|
|
|
1502
|
-
|
|
1503
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1504
|
-
raise errors.APIError(
|
|
1505
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1506
|
-
http_res.status_code,
|
|
1507
|
-
http_res_text,
|
|
1508
|
-
http_res,
|
|
1509
|
-
)
|
|
1178
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1510
1179
|
|
|
1511
|
-
def
|
|
1180
|
+
def morpho_deposit(
|
|
1512
1181
|
self,
|
|
1513
1182
|
*,
|
|
1514
1183
|
vault_address: str,
|
|
@@ -1519,11 +1188,12 @@ class Morpho(BaseSDK):
|
|
|
1519
1188
|
chain: models.MorphoDepositRequestChain,
|
|
1520
1189
|
sender: str,
|
|
1521
1190
|
receiver: OptionalNullable[str] = UNSET,
|
|
1191
|
+
estimate_gas: Optional[bool] = None,
|
|
1522
1192
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1523
1193
|
server_url: Optional[str] = None,
|
|
1524
1194
|
timeout_ms: Optional[int] = None,
|
|
1525
1195
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1526
|
-
) -> models.
|
|
1196
|
+
) -> models.TransactionResponse:
|
|
1527
1197
|
r"""Deposit to Vault
|
|
1528
1198
|
|
|
1529
1199
|
Deposit tokens into a Morpho Vault to earn passive yield from interest paid by
|
|
@@ -1537,12 +1207,21 @@ class Morpho(BaseSDK):
|
|
|
1537
1207
|
exposure for all deposited assets so users don't need to make these decisions
|
|
1538
1208
|
themselves. Users maintain full control over their assets, can monitor the vault's
|
|
1539
1209
|
state at any time, and withdraw their liquidity at their discretion.
|
|
1210
|
+
<Info>
|
|
1211
|
+
**Required Allowances**
|
|
1212
|
+
|
|
1213
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1214
|
+
|
|
1215
|
+
- `<vault-contract-address>`
|
|
1216
|
+
</Info>
|
|
1217
|
+
|
|
1540
1218
|
|
|
1541
1219
|
:param vault_address: The vault address you are depositing to.
|
|
1542
1220
|
:param amount: The amount of tokens to deposit into the vault.
|
|
1543
1221
|
:param chain:
|
|
1544
1222
|
:param sender: The address of the transaction sender.
|
|
1545
1223
|
:param receiver: The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender.
|
|
1224
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1546
1225
|
:param retries: Override the default retry configuration for this method
|
|
1547
1226
|
:param server_url: Override the default server URL for this method
|
|
1548
1227
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1564,11 +1243,12 @@ class Morpho(BaseSDK):
|
|
|
1564
1243
|
receiver=receiver,
|
|
1565
1244
|
chain=chain,
|
|
1566
1245
|
sender=sender,
|
|
1246
|
+
estimate_gas=estimate_gas,
|
|
1567
1247
|
)
|
|
1568
1248
|
|
|
1569
1249
|
req = self._build_request(
|
|
1570
1250
|
method="POST",
|
|
1571
|
-
path="/
|
|
1251
|
+
path="/v1/morpho/deposit",
|
|
1572
1252
|
base_url=base_url,
|
|
1573
1253
|
url_variables=url_variables,
|
|
1574
1254
|
request=request,
|
|
@@ -1582,6 +1262,7 @@ class Morpho(BaseSDK):
|
|
|
1582
1262
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1583
1263
|
request, False, False, "json", models.MorphoDepositRequest
|
|
1584
1264
|
),
|
|
1265
|
+
allow_empty_value=None,
|
|
1585
1266
|
timeout_ms=timeout_ms,
|
|
1586
1267
|
)
|
|
1587
1268
|
|
|
@@ -1597,8 +1278,8 @@ class Morpho(BaseSDK):
|
|
|
1597
1278
|
hook_ctx=HookContext(
|
|
1598
1279
|
config=self.sdk_configuration,
|
|
1599
1280
|
base_url=base_url or "",
|
|
1600
|
-
operation_id="
|
|
1601
|
-
oauth2_scopes=
|
|
1281
|
+
operation_id="v1_morpho_deposit",
|
|
1282
|
+
oauth2_scopes=None,
|
|
1602
1283
|
security_source=self.sdk_configuration.security,
|
|
1603
1284
|
),
|
|
1604
1285
|
request=req,
|
|
@@ -1608,33 +1289,22 @@ class Morpho(BaseSDK):
|
|
|
1608
1289
|
|
|
1609
1290
|
response_data: Any = None
|
|
1610
1291
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1611
|
-
return
|
|
1292
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1612
1293
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1613
|
-
response_data =
|
|
1614
|
-
|
|
1294
|
+
response_data = unmarshal_json_response(
|
|
1295
|
+
errors.HTTPValidationErrorData, http_res
|
|
1615
1296
|
)
|
|
1616
|
-
raise errors.HTTPValidationError(
|
|
1297
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1617
1298
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1618
1299
|
http_res_text = utils.stream_to_text(http_res)
|
|
1619
|
-
raise errors.APIError(
|
|
1620
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1621
|
-
)
|
|
1300
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1622
1301
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1623
1302
|
http_res_text = utils.stream_to_text(http_res)
|
|
1624
|
-
raise errors.APIError(
|
|
1625
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1626
|
-
)
|
|
1303
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1627
1304
|
|
|
1628
|
-
|
|
1629
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1630
|
-
raise errors.APIError(
|
|
1631
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1632
|
-
http_res.status_code,
|
|
1633
|
-
http_res_text,
|
|
1634
|
-
http_res,
|
|
1635
|
-
)
|
|
1305
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1636
1306
|
|
|
1637
|
-
async def
|
|
1307
|
+
async def morpho_deposit_async(
|
|
1638
1308
|
self,
|
|
1639
1309
|
*,
|
|
1640
1310
|
vault_address: str,
|
|
@@ -1645,11 +1315,12 @@ class Morpho(BaseSDK):
|
|
|
1645
1315
|
chain: models.MorphoDepositRequestChain,
|
|
1646
1316
|
sender: str,
|
|
1647
1317
|
receiver: OptionalNullable[str] = UNSET,
|
|
1318
|
+
estimate_gas: Optional[bool] = None,
|
|
1648
1319
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1649
1320
|
server_url: Optional[str] = None,
|
|
1650
1321
|
timeout_ms: Optional[int] = None,
|
|
1651
1322
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1652
|
-
) -> models.
|
|
1323
|
+
) -> models.TransactionResponse:
|
|
1653
1324
|
r"""Deposit to Vault
|
|
1654
1325
|
|
|
1655
1326
|
Deposit tokens into a Morpho Vault to earn passive yield from interest paid by
|
|
@@ -1663,12 +1334,21 @@ class Morpho(BaseSDK):
|
|
|
1663
1334
|
exposure for all deposited assets so users don't need to make these decisions
|
|
1664
1335
|
themselves. Users maintain full control over their assets, can monitor the vault's
|
|
1665
1336
|
state at any time, and withdraw their liquidity at their discretion.
|
|
1337
|
+
<Info>
|
|
1338
|
+
**Required Allowances**
|
|
1339
|
+
|
|
1340
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1341
|
+
|
|
1342
|
+
- `<vault-contract-address>`
|
|
1343
|
+
</Info>
|
|
1344
|
+
|
|
1666
1345
|
|
|
1667
1346
|
:param vault_address: The vault address you are depositing to.
|
|
1668
1347
|
:param amount: The amount of tokens to deposit into the vault.
|
|
1669
1348
|
:param chain:
|
|
1670
1349
|
:param sender: The address of the transaction sender.
|
|
1671
1350
|
:param receiver: The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender.
|
|
1351
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1672
1352
|
:param retries: Override the default retry configuration for this method
|
|
1673
1353
|
:param server_url: Override the default server URL for this method
|
|
1674
1354
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1690,11 +1370,12 @@ class Morpho(BaseSDK):
|
|
|
1690
1370
|
receiver=receiver,
|
|
1691
1371
|
chain=chain,
|
|
1692
1372
|
sender=sender,
|
|
1373
|
+
estimate_gas=estimate_gas,
|
|
1693
1374
|
)
|
|
1694
1375
|
|
|
1695
1376
|
req = self._build_request_async(
|
|
1696
1377
|
method="POST",
|
|
1697
|
-
path="/
|
|
1378
|
+
path="/v1/morpho/deposit",
|
|
1698
1379
|
base_url=base_url,
|
|
1699
1380
|
url_variables=url_variables,
|
|
1700
1381
|
request=request,
|
|
@@ -1708,6 +1389,7 @@ class Morpho(BaseSDK):
|
|
|
1708
1389
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1709
1390
|
request, False, False, "json", models.MorphoDepositRequest
|
|
1710
1391
|
),
|
|
1392
|
+
allow_empty_value=None,
|
|
1711
1393
|
timeout_ms=timeout_ms,
|
|
1712
1394
|
)
|
|
1713
1395
|
|
|
@@ -1723,8 +1405,8 @@ class Morpho(BaseSDK):
|
|
|
1723
1405
|
hook_ctx=HookContext(
|
|
1724
1406
|
config=self.sdk_configuration,
|
|
1725
1407
|
base_url=base_url or "",
|
|
1726
|
-
operation_id="
|
|
1727
|
-
oauth2_scopes=
|
|
1408
|
+
operation_id="v1_morpho_deposit",
|
|
1409
|
+
oauth2_scopes=None,
|
|
1728
1410
|
security_source=self.sdk_configuration.security,
|
|
1729
1411
|
),
|
|
1730
1412
|
request=req,
|
|
@@ -1734,33 +1416,22 @@ class Morpho(BaseSDK):
|
|
|
1734
1416
|
|
|
1735
1417
|
response_data: Any = None
|
|
1736
1418
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1737
|
-
return
|
|
1419
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1738
1420
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1739
|
-
response_data =
|
|
1740
|
-
|
|
1421
|
+
response_data = unmarshal_json_response(
|
|
1422
|
+
errors.HTTPValidationErrorData, http_res
|
|
1741
1423
|
)
|
|
1742
|
-
raise errors.HTTPValidationError(
|
|
1424
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1743
1425
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1744
1426
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1745
|
-
raise errors.APIError(
|
|
1746
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1747
|
-
)
|
|
1427
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1748
1428
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1749
1429
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1750
|
-
raise errors.APIError(
|
|
1751
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1752
|
-
)
|
|
1430
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1753
1431
|
|
|
1754
|
-
|
|
1755
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1756
|
-
raise errors.APIError(
|
|
1757
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1758
|
-
http_res.status_code,
|
|
1759
|
-
http_res_text,
|
|
1760
|
-
http_res,
|
|
1761
|
-
)
|
|
1432
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1762
1433
|
|
|
1763
|
-
def
|
|
1434
|
+
def morpho_withdraw(
|
|
1764
1435
|
self,
|
|
1765
1436
|
*,
|
|
1766
1437
|
vault_address: str,
|
|
@@ -1768,11 +1439,12 @@ class Morpho(BaseSDK):
|
|
|
1768
1439
|
chain: models.MorphoWithdrawRequestChain,
|
|
1769
1440
|
sender: str,
|
|
1770
1441
|
receiver: OptionalNullable[str] = UNSET,
|
|
1442
|
+
estimate_gas: Optional[bool] = None,
|
|
1771
1443
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1772
1444
|
server_url: Optional[str] = None,
|
|
1773
1445
|
timeout_ms: Optional[int] = None,
|
|
1774
1446
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1775
|
-
) -> models.
|
|
1447
|
+
) -> models.TransactionResponse:
|
|
1776
1448
|
r"""Withdraw from Vault
|
|
1777
1449
|
|
|
1778
1450
|
Withdraw deposited tokens from a Morpho Vault.
|
|
@@ -1792,6 +1464,7 @@ class Morpho(BaseSDK):
|
|
|
1792
1464
|
:param chain:
|
|
1793
1465
|
:param sender: The address of the transaction sender.
|
|
1794
1466
|
:param receiver: The address which will receive the tokens withdrawn. Defaults to the sender.
|
|
1467
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1795
1468
|
:param retries: Override the default retry configuration for this method
|
|
1796
1469
|
:param server_url: Override the default server URL for this method
|
|
1797
1470
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1813,11 +1486,12 @@ class Morpho(BaseSDK):
|
|
|
1813
1486
|
receiver=receiver,
|
|
1814
1487
|
chain=chain,
|
|
1815
1488
|
sender=sender,
|
|
1489
|
+
estimate_gas=estimate_gas,
|
|
1816
1490
|
)
|
|
1817
1491
|
|
|
1818
1492
|
req = self._build_request(
|
|
1819
1493
|
method="POST",
|
|
1820
|
-
path="/
|
|
1494
|
+
path="/v1/morpho/withdraw",
|
|
1821
1495
|
base_url=base_url,
|
|
1822
1496
|
url_variables=url_variables,
|
|
1823
1497
|
request=request,
|
|
@@ -1831,6 +1505,7 @@ class Morpho(BaseSDK):
|
|
|
1831
1505
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1832
1506
|
request, False, False, "json", models.MorphoWithdrawRequest
|
|
1833
1507
|
),
|
|
1508
|
+
allow_empty_value=None,
|
|
1834
1509
|
timeout_ms=timeout_ms,
|
|
1835
1510
|
)
|
|
1836
1511
|
|
|
@@ -1846,8 +1521,8 @@ class Morpho(BaseSDK):
|
|
|
1846
1521
|
hook_ctx=HookContext(
|
|
1847
1522
|
config=self.sdk_configuration,
|
|
1848
1523
|
base_url=base_url or "",
|
|
1849
|
-
operation_id="
|
|
1850
|
-
oauth2_scopes=
|
|
1524
|
+
operation_id="v1_morpho_withdraw",
|
|
1525
|
+
oauth2_scopes=None,
|
|
1851
1526
|
security_source=self.sdk_configuration.security,
|
|
1852
1527
|
),
|
|
1853
1528
|
request=req,
|
|
@@ -1857,33 +1532,22 @@ class Morpho(BaseSDK):
|
|
|
1857
1532
|
|
|
1858
1533
|
response_data: Any = None
|
|
1859
1534
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1860
|
-
return
|
|
1535
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1861
1536
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1862
|
-
response_data =
|
|
1863
|
-
|
|
1537
|
+
response_data = unmarshal_json_response(
|
|
1538
|
+
errors.HTTPValidationErrorData, http_res
|
|
1864
1539
|
)
|
|
1865
|
-
raise errors.HTTPValidationError(
|
|
1540
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1866
1541
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1867
1542
|
http_res_text = utils.stream_to_text(http_res)
|
|
1868
|
-
raise errors.APIError(
|
|
1869
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1870
|
-
)
|
|
1543
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1871
1544
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1872
1545
|
http_res_text = utils.stream_to_text(http_res)
|
|
1873
|
-
raise errors.APIError(
|
|
1874
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1875
|
-
)
|
|
1546
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1876
1547
|
|
|
1877
|
-
|
|
1878
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1879
|
-
raise errors.APIError(
|
|
1880
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1881
|
-
http_res.status_code,
|
|
1882
|
-
http_res_text,
|
|
1883
|
-
http_res,
|
|
1884
|
-
)
|
|
1548
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1885
1549
|
|
|
1886
|
-
async def
|
|
1550
|
+
async def morpho_withdraw_async(
|
|
1887
1551
|
self,
|
|
1888
1552
|
*,
|
|
1889
1553
|
vault_address: str,
|
|
@@ -1891,11 +1555,12 @@ class Morpho(BaseSDK):
|
|
|
1891
1555
|
chain: models.MorphoWithdrawRequestChain,
|
|
1892
1556
|
sender: str,
|
|
1893
1557
|
receiver: OptionalNullable[str] = UNSET,
|
|
1558
|
+
estimate_gas: Optional[bool] = None,
|
|
1894
1559
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1895
1560
|
server_url: Optional[str] = None,
|
|
1896
1561
|
timeout_ms: Optional[int] = None,
|
|
1897
1562
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1898
|
-
) -> models.
|
|
1563
|
+
) -> models.TransactionResponse:
|
|
1899
1564
|
r"""Withdraw from Vault
|
|
1900
1565
|
|
|
1901
1566
|
Withdraw deposited tokens from a Morpho Vault.
|
|
@@ -1915,6 +1580,7 @@ class Morpho(BaseSDK):
|
|
|
1915
1580
|
:param chain:
|
|
1916
1581
|
:param sender: The address of the transaction sender.
|
|
1917
1582
|
:param receiver: The address which will receive the tokens withdrawn. Defaults to the sender.
|
|
1583
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1918
1584
|
:param retries: Override the default retry configuration for this method
|
|
1919
1585
|
:param server_url: Override the default server URL for this method
|
|
1920
1586
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1936,11 +1602,12 @@ class Morpho(BaseSDK):
|
|
|
1936
1602
|
receiver=receiver,
|
|
1937
1603
|
chain=chain,
|
|
1938
1604
|
sender=sender,
|
|
1605
|
+
estimate_gas=estimate_gas,
|
|
1939
1606
|
)
|
|
1940
1607
|
|
|
1941
1608
|
req = self._build_request_async(
|
|
1942
1609
|
method="POST",
|
|
1943
|
-
path="/
|
|
1610
|
+
path="/v1/morpho/withdraw",
|
|
1944
1611
|
base_url=base_url,
|
|
1945
1612
|
url_variables=url_variables,
|
|
1946
1613
|
request=request,
|
|
@@ -1954,6 +1621,7 @@ class Morpho(BaseSDK):
|
|
|
1954
1621
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1955
1622
|
request, False, False, "json", models.MorphoWithdrawRequest
|
|
1956
1623
|
),
|
|
1624
|
+
allow_empty_value=None,
|
|
1957
1625
|
timeout_ms=timeout_ms,
|
|
1958
1626
|
)
|
|
1959
1627
|
|
|
@@ -1969,8 +1637,8 @@ class Morpho(BaseSDK):
|
|
|
1969
1637
|
hook_ctx=HookContext(
|
|
1970
1638
|
config=self.sdk_configuration,
|
|
1971
1639
|
base_url=base_url or "",
|
|
1972
|
-
operation_id="
|
|
1973
|
-
oauth2_scopes=
|
|
1640
|
+
operation_id="v1_morpho_withdraw",
|
|
1641
|
+
oauth2_scopes=None,
|
|
1974
1642
|
security_source=self.sdk_configuration.security,
|
|
1975
1643
|
),
|
|
1976
1644
|
request=req,
|
|
@@ -1980,33 +1648,22 @@ class Morpho(BaseSDK):
|
|
|
1980
1648
|
|
|
1981
1649
|
response_data: Any = None
|
|
1982
1650
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1983
|
-
return
|
|
1651
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1984
1652
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1985
|
-
response_data =
|
|
1986
|
-
|
|
1653
|
+
response_data = unmarshal_json_response(
|
|
1654
|
+
errors.HTTPValidationErrorData, http_res
|
|
1987
1655
|
)
|
|
1988
|
-
raise errors.HTTPValidationError(
|
|
1656
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1989
1657
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1990
1658
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1991
|
-
raise errors.APIError(
|
|
1992
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1993
|
-
)
|
|
1659
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1994
1660
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1995
1661
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1996
|
-
raise errors.APIError(
|
|
1997
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1998
|
-
)
|
|
1662
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1999
1663
|
|
|
2000
|
-
|
|
2001
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2002
|
-
raise errors.APIError(
|
|
2003
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2004
|
-
http_res.status_code,
|
|
2005
|
-
http_res_text,
|
|
2006
|
-
http_res,
|
|
2007
|
-
)
|
|
1664
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2008
1665
|
|
|
2009
|
-
def
|
|
1666
|
+
def morpho_supply_collateral(
|
|
2010
1667
|
self,
|
|
2011
1668
|
*,
|
|
2012
1669
|
amount: Union[
|
|
@@ -2018,11 +1675,12 @@ class Morpho(BaseSDK):
|
|
|
2018
1675
|
sender: str,
|
|
2019
1676
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2020
1677
|
callback_data: OptionalNullable[bytes] = UNSET,
|
|
1678
|
+
estimate_gas: Optional[bool] = None,
|
|
2021
1679
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2022
1680
|
server_url: Optional[str] = None,
|
|
2023
1681
|
timeout_ms: Optional[int] = None,
|
|
2024
1682
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2025
|
-
) -> models.
|
|
1683
|
+
) -> models.TransactionResponse:
|
|
2026
1684
|
r"""Supply Collateral to Market
|
|
2027
1685
|
|
|
2028
1686
|
Supply collateral to a Morpho Market in order to borrow against it.
|
|
@@ -2031,6 +1689,14 @@ class Morpho(BaseSDK):
|
|
|
2031
1689
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2032
1690
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2033
1691
|
as long as the blockchain it is deployed on is live.
|
|
1692
|
+
<Info>
|
|
1693
|
+
**Required Allowances**
|
|
1694
|
+
|
|
1695
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1696
|
+
|
|
1697
|
+
- `MorphoMarket`
|
|
1698
|
+
</Info>
|
|
1699
|
+
|
|
2034
1700
|
|
|
2035
1701
|
:param amount: Amount of the token to supply to the market as collateral.
|
|
2036
1702
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2038,6 +1704,7 @@ class Morpho(BaseSDK):
|
|
|
2038
1704
|
:param sender: The address of the transaction sender.
|
|
2039
1705
|
:param on_behalf_of: The address on behalf of whom the supplied collateral is made. Defaults to sender.
|
|
2040
1706
|
:param callback_data: An optional field for callback byte data that will be triggered upon successful supplying of collateral.
|
|
1707
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2041
1708
|
:param retries: Override the default retry configuration for this method
|
|
2042
1709
|
:param server_url: Override the default server URL for this method
|
|
2043
1710
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2060,11 +1727,12 @@ class Morpho(BaseSDK):
|
|
|
2060
1727
|
callback_data=callback_data,
|
|
2061
1728
|
chain=chain,
|
|
2062
1729
|
sender=sender,
|
|
1730
|
+
estimate_gas=estimate_gas,
|
|
2063
1731
|
)
|
|
2064
1732
|
|
|
2065
1733
|
req = self._build_request(
|
|
2066
1734
|
method="POST",
|
|
2067
|
-
path="/
|
|
1735
|
+
path="/v1/morpho/supply_collateral",
|
|
2068
1736
|
base_url=base_url,
|
|
2069
1737
|
url_variables=url_variables,
|
|
2070
1738
|
request=request,
|
|
@@ -2078,6 +1746,7 @@ class Morpho(BaseSDK):
|
|
|
2078
1746
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2079
1747
|
request, False, False, "json", models.MorphoSupplyCollateralRequest
|
|
2080
1748
|
),
|
|
1749
|
+
allow_empty_value=None,
|
|
2081
1750
|
timeout_ms=timeout_ms,
|
|
2082
1751
|
)
|
|
2083
1752
|
|
|
@@ -2093,8 +1762,8 @@ class Morpho(BaseSDK):
|
|
|
2093
1762
|
hook_ctx=HookContext(
|
|
2094
1763
|
config=self.sdk_configuration,
|
|
2095
1764
|
base_url=base_url or "",
|
|
2096
|
-
operation_id="
|
|
2097
|
-
oauth2_scopes=
|
|
1765
|
+
operation_id="v1_morpho_supply_collateral",
|
|
1766
|
+
oauth2_scopes=None,
|
|
2098
1767
|
security_source=self.sdk_configuration.security,
|
|
2099
1768
|
),
|
|
2100
1769
|
request=req,
|
|
@@ -2104,33 +1773,22 @@ class Morpho(BaseSDK):
|
|
|
2104
1773
|
|
|
2105
1774
|
response_data: Any = None
|
|
2106
1775
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2107
|
-
return
|
|
1776
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2108
1777
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2109
|
-
response_data =
|
|
2110
|
-
|
|
1778
|
+
response_data = unmarshal_json_response(
|
|
1779
|
+
errors.HTTPValidationErrorData, http_res
|
|
2111
1780
|
)
|
|
2112
|
-
raise errors.HTTPValidationError(
|
|
1781
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2113
1782
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2114
1783
|
http_res_text = utils.stream_to_text(http_res)
|
|
2115
|
-
raise errors.APIError(
|
|
2116
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2117
|
-
)
|
|
1784
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2118
1785
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2119
1786
|
http_res_text = utils.stream_to_text(http_res)
|
|
2120
|
-
raise errors.APIError(
|
|
2121
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2122
|
-
)
|
|
1787
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2123
1788
|
|
|
2124
|
-
|
|
2125
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2126
|
-
raise errors.APIError(
|
|
2127
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2128
|
-
http_res.status_code,
|
|
2129
|
-
http_res_text,
|
|
2130
|
-
http_res,
|
|
2131
|
-
)
|
|
1789
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2132
1790
|
|
|
2133
|
-
async def
|
|
1791
|
+
async def morpho_supply_collateral_async(
|
|
2134
1792
|
self,
|
|
2135
1793
|
*,
|
|
2136
1794
|
amount: Union[
|
|
@@ -2142,11 +1800,12 @@ class Morpho(BaseSDK):
|
|
|
2142
1800
|
sender: str,
|
|
2143
1801
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2144
1802
|
callback_data: OptionalNullable[bytes] = UNSET,
|
|
1803
|
+
estimate_gas: Optional[bool] = None,
|
|
2145
1804
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2146
1805
|
server_url: Optional[str] = None,
|
|
2147
1806
|
timeout_ms: Optional[int] = None,
|
|
2148
1807
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2149
|
-
) -> models.
|
|
1808
|
+
) -> models.TransactionResponse:
|
|
2150
1809
|
r"""Supply Collateral to Market
|
|
2151
1810
|
|
|
2152
1811
|
Supply collateral to a Morpho Market in order to borrow against it.
|
|
@@ -2155,6 +1814,14 @@ class Morpho(BaseSDK):
|
|
|
2155
1814
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2156
1815
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2157
1816
|
as long as the blockchain it is deployed on is live.
|
|
1817
|
+
<Info>
|
|
1818
|
+
**Required Allowances**
|
|
1819
|
+
|
|
1820
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1821
|
+
|
|
1822
|
+
- `MorphoMarket`
|
|
1823
|
+
</Info>
|
|
1824
|
+
|
|
2158
1825
|
|
|
2159
1826
|
:param amount: Amount of the token to supply to the market as collateral.
|
|
2160
1827
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2162,6 +1829,7 @@ class Morpho(BaseSDK):
|
|
|
2162
1829
|
:param sender: The address of the transaction sender.
|
|
2163
1830
|
:param on_behalf_of: The address on behalf of whom the supplied collateral is made. Defaults to sender.
|
|
2164
1831
|
:param callback_data: An optional field for callback byte data that will be triggered upon successful supplying of collateral.
|
|
1832
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2165
1833
|
:param retries: Override the default retry configuration for this method
|
|
2166
1834
|
:param server_url: Override the default server URL for this method
|
|
2167
1835
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2184,11 +1852,12 @@ class Morpho(BaseSDK):
|
|
|
2184
1852
|
callback_data=callback_data,
|
|
2185
1853
|
chain=chain,
|
|
2186
1854
|
sender=sender,
|
|
1855
|
+
estimate_gas=estimate_gas,
|
|
2187
1856
|
)
|
|
2188
1857
|
|
|
2189
1858
|
req = self._build_request_async(
|
|
2190
1859
|
method="POST",
|
|
2191
|
-
path="/
|
|
1860
|
+
path="/v1/morpho/supply_collateral",
|
|
2192
1861
|
base_url=base_url,
|
|
2193
1862
|
url_variables=url_variables,
|
|
2194
1863
|
request=request,
|
|
@@ -2202,6 +1871,7 @@ class Morpho(BaseSDK):
|
|
|
2202
1871
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2203
1872
|
request, False, False, "json", models.MorphoSupplyCollateralRequest
|
|
2204
1873
|
),
|
|
1874
|
+
allow_empty_value=None,
|
|
2205
1875
|
timeout_ms=timeout_ms,
|
|
2206
1876
|
)
|
|
2207
1877
|
|
|
@@ -2217,8 +1887,8 @@ class Morpho(BaseSDK):
|
|
|
2217
1887
|
hook_ctx=HookContext(
|
|
2218
1888
|
config=self.sdk_configuration,
|
|
2219
1889
|
base_url=base_url or "",
|
|
2220
|
-
operation_id="
|
|
2221
|
-
oauth2_scopes=
|
|
1890
|
+
operation_id="v1_morpho_supply_collateral",
|
|
1891
|
+
oauth2_scopes=None,
|
|
2222
1892
|
security_source=self.sdk_configuration.security,
|
|
2223
1893
|
),
|
|
2224
1894
|
request=req,
|
|
@@ -2228,33 +1898,22 @@ class Morpho(BaseSDK):
|
|
|
2228
1898
|
|
|
2229
1899
|
response_data: Any = None
|
|
2230
1900
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2231
|
-
return
|
|
1901
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2232
1902
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2233
|
-
response_data =
|
|
2234
|
-
|
|
1903
|
+
response_data = unmarshal_json_response(
|
|
1904
|
+
errors.HTTPValidationErrorData, http_res
|
|
2235
1905
|
)
|
|
2236
|
-
raise errors.HTTPValidationError(
|
|
1906
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2237
1907
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2238
1908
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2239
|
-
raise errors.APIError(
|
|
2240
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2241
|
-
)
|
|
1909
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2242
1910
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2243
1911
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2244
|
-
raise errors.APIError(
|
|
2245
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2246
|
-
)
|
|
1912
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2247
1913
|
|
|
2248
|
-
|
|
2249
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2250
|
-
raise errors.APIError(
|
|
2251
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2252
|
-
http_res.status_code,
|
|
2253
|
-
http_res_text,
|
|
2254
|
-
http_res,
|
|
2255
|
-
)
|
|
1914
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2256
1915
|
|
|
2257
|
-
def
|
|
1916
|
+
def morpho_withdraw_collateral(
|
|
2258
1917
|
self,
|
|
2259
1918
|
*,
|
|
2260
1919
|
amount: Union[
|
|
@@ -2266,11 +1925,12 @@ class Morpho(BaseSDK):
|
|
|
2266
1925
|
sender: str,
|
|
2267
1926
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2268
1927
|
receiver: OptionalNullable[str] = UNSET,
|
|
1928
|
+
estimate_gas: Optional[bool] = None,
|
|
2269
1929
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2270
1930
|
server_url: Optional[str] = None,
|
|
2271
1931
|
timeout_ms: Optional[int] = None,
|
|
2272
1932
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2273
|
-
) -> models.
|
|
1933
|
+
) -> models.TransactionResponse:
|
|
2274
1934
|
r"""Withdraw Collateral from Market
|
|
2275
1935
|
|
|
2276
1936
|
Withdraw collateral that has been supplied to a Morpho Market.
|
|
@@ -2279,6 +1939,14 @@ class Morpho(BaseSDK):
|
|
|
2279
1939
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2280
1940
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2281
1941
|
as long as the blockchain it is deployed on is live.
|
|
1942
|
+
<Info>
|
|
1943
|
+
**Required Allowances**
|
|
1944
|
+
|
|
1945
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1946
|
+
|
|
1947
|
+
- `MorphoMarket`
|
|
1948
|
+
</Info>
|
|
1949
|
+
|
|
2282
1950
|
|
|
2283
1951
|
:param amount: Amount of the token to supply to the market as collateral.
|
|
2284
1952
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2286,6 +1954,7 @@ class Morpho(BaseSDK):
|
|
|
2286
1954
|
:param sender: The address of the transaction sender.
|
|
2287
1955
|
:param on_behalf_of: The address on behalf of whom the withdraw is made. Defaults to sender.
|
|
2288
1956
|
:param receiver: The address where the withdrawn collateral will be received. Defaults to sender.
|
|
1957
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2289
1958
|
:param retries: Override the default retry configuration for this method
|
|
2290
1959
|
:param server_url: Override the default server URL for this method
|
|
2291
1960
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2308,11 +1977,12 @@ class Morpho(BaseSDK):
|
|
|
2308
1977
|
receiver=receiver,
|
|
2309
1978
|
chain=chain,
|
|
2310
1979
|
sender=sender,
|
|
1980
|
+
estimate_gas=estimate_gas,
|
|
2311
1981
|
)
|
|
2312
1982
|
|
|
2313
1983
|
req = self._build_request(
|
|
2314
1984
|
method="POST",
|
|
2315
|
-
path="/
|
|
1985
|
+
path="/v1/morpho/withdraw_collateral",
|
|
2316
1986
|
base_url=base_url,
|
|
2317
1987
|
url_variables=url_variables,
|
|
2318
1988
|
request=request,
|
|
@@ -2326,6 +1996,7 @@ class Morpho(BaseSDK):
|
|
|
2326
1996
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2327
1997
|
request, False, False, "json", models.MorphoWithdrawCollateralRequest
|
|
2328
1998
|
),
|
|
1999
|
+
allow_empty_value=None,
|
|
2329
2000
|
timeout_ms=timeout_ms,
|
|
2330
2001
|
)
|
|
2331
2002
|
|
|
@@ -2341,8 +2012,8 @@ class Morpho(BaseSDK):
|
|
|
2341
2012
|
hook_ctx=HookContext(
|
|
2342
2013
|
config=self.sdk_configuration,
|
|
2343
2014
|
base_url=base_url or "",
|
|
2344
|
-
operation_id="
|
|
2345
|
-
oauth2_scopes=
|
|
2015
|
+
operation_id="v1_morpho_withdraw_collateral",
|
|
2016
|
+
oauth2_scopes=None,
|
|
2346
2017
|
security_source=self.sdk_configuration.security,
|
|
2347
2018
|
),
|
|
2348
2019
|
request=req,
|
|
@@ -2352,33 +2023,22 @@ class Morpho(BaseSDK):
|
|
|
2352
2023
|
|
|
2353
2024
|
response_data: Any = None
|
|
2354
2025
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2355
|
-
return
|
|
2026
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2356
2027
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2357
|
-
response_data =
|
|
2358
|
-
|
|
2028
|
+
response_data = unmarshal_json_response(
|
|
2029
|
+
errors.HTTPValidationErrorData, http_res
|
|
2359
2030
|
)
|
|
2360
|
-
raise errors.HTTPValidationError(
|
|
2031
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2361
2032
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2362
2033
|
http_res_text = utils.stream_to_text(http_res)
|
|
2363
|
-
raise errors.APIError(
|
|
2364
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2365
|
-
)
|
|
2034
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2366
2035
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2367
2036
|
http_res_text = utils.stream_to_text(http_res)
|
|
2368
|
-
raise errors.APIError(
|
|
2369
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2370
|
-
)
|
|
2037
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2371
2038
|
|
|
2372
|
-
|
|
2373
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2374
|
-
raise errors.APIError(
|
|
2375
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2376
|
-
http_res.status_code,
|
|
2377
|
-
http_res_text,
|
|
2378
|
-
http_res,
|
|
2379
|
-
)
|
|
2039
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2380
2040
|
|
|
2381
|
-
async def
|
|
2041
|
+
async def morpho_withdraw_collateral_async(
|
|
2382
2042
|
self,
|
|
2383
2043
|
*,
|
|
2384
2044
|
amount: Union[
|
|
@@ -2390,11 +2050,12 @@ class Morpho(BaseSDK):
|
|
|
2390
2050
|
sender: str,
|
|
2391
2051
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2392
2052
|
receiver: OptionalNullable[str] = UNSET,
|
|
2053
|
+
estimate_gas: Optional[bool] = None,
|
|
2393
2054
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2394
2055
|
server_url: Optional[str] = None,
|
|
2395
2056
|
timeout_ms: Optional[int] = None,
|
|
2396
2057
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2397
|
-
) -> models.
|
|
2058
|
+
) -> models.TransactionResponse:
|
|
2398
2059
|
r"""Withdraw Collateral from Market
|
|
2399
2060
|
|
|
2400
2061
|
Withdraw collateral that has been supplied to a Morpho Market.
|
|
@@ -2403,6 +2064,14 @@ class Morpho(BaseSDK):
|
|
|
2403
2064
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2404
2065
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2405
2066
|
as long as the blockchain it is deployed on is live.
|
|
2067
|
+
<Info>
|
|
2068
|
+
**Required Allowances**
|
|
2069
|
+
|
|
2070
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2071
|
+
|
|
2072
|
+
- `MorphoMarket`
|
|
2073
|
+
</Info>
|
|
2074
|
+
|
|
2406
2075
|
|
|
2407
2076
|
:param amount: Amount of the token to supply to the market as collateral.
|
|
2408
2077
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2410,6 +2079,7 @@ class Morpho(BaseSDK):
|
|
|
2410
2079
|
:param sender: The address of the transaction sender.
|
|
2411
2080
|
:param on_behalf_of: The address on behalf of whom the withdraw is made. Defaults to sender.
|
|
2412
2081
|
:param receiver: The address where the withdrawn collateral will be received. Defaults to sender.
|
|
2082
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2413
2083
|
:param retries: Override the default retry configuration for this method
|
|
2414
2084
|
:param server_url: Override the default server URL for this method
|
|
2415
2085
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2432,11 +2102,12 @@ class Morpho(BaseSDK):
|
|
|
2432
2102
|
receiver=receiver,
|
|
2433
2103
|
chain=chain,
|
|
2434
2104
|
sender=sender,
|
|
2105
|
+
estimate_gas=estimate_gas,
|
|
2435
2106
|
)
|
|
2436
2107
|
|
|
2437
2108
|
req = self._build_request_async(
|
|
2438
2109
|
method="POST",
|
|
2439
|
-
path="/
|
|
2110
|
+
path="/v1/morpho/withdraw_collateral",
|
|
2440
2111
|
base_url=base_url,
|
|
2441
2112
|
url_variables=url_variables,
|
|
2442
2113
|
request=request,
|
|
@@ -2450,6 +2121,7 @@ class Morpho(BaseSDK):
|
|
|
2450
2121
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2451
2122
|
request, False, False, "json", models.MorphoWithdrawCollateralRequest
|
|
2452
2123
|
),
|
|
2124
|
+
allow_empty_value=None,
|
|
2453
2125
|
timeout_ms=timeout_ms,
|
|
2454
2126
|
)
|
|
2455
2127
|
|
|
@@ -2465,8 +2137,8 @@ class Morpho(BaseSDK):
|
|
|
2465
2137
|
hook_ctx=HookContext(
|
|
2466
2138
|
config=self.sdk_configuration,
|
|
2467
2139
|
base_url=base_url or "",
|
|
2468
|
-
operation_id="
|
|
2469
|
-
oauth2_scopes=
|
|
2140
|
+
operation_id="v1_morpho_withdraw_collateral",
|
|
2141
|
+
oauth2_scopes=None,
|
|
2470
2142
|
security_source=self.sdk_configuration.security,
|
|
2471
2143
|
),
|
|
2472
2144
|
request=req,
|
|
@@ -2476,33 +2148,22 @@ class Morpho(BaseSDK):
|
|
|
2476
2148
|
|
|
2477
2149
|
response_data: Any = None
|
|
2478
2150
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2479
|
-
return
|
|
2151
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2480
2152
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2481
|
-
response_data =
|
|
2482
|
-
|
|
2153
|
+
response_data = unmarshal_json_response(
|
|
2154
|
+
errors.HTTPValidationErrorData, http_res
|
|
2483
2155
|
)
|
|
2484
|
-
raise errors.HTTPValidationError(
|
|
2156
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2485
2157
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2486
2158
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2487
|
-
raise errors.APIError(
|
|
2488
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2489
|
-
)
|
|
2159
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2490
2160
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2491
2161
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2492
|
-
raise errors.APIError(
|
|
2493
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2494
|
-
)
|
|
2162
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2495
2163
|
|
|
2496
|
-
|
|
2497
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2498
|
-
raise errors.APIError(
|
|
2499
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2500
|
-
http_res.status_code,
|
|
2501
|
-
http_res_text,
|
|
2502
|
-
http_res,
|
|
2503
|
-
)
|
|
2164
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2504
2165
|
|
|
2505
|
-
def
|
|
2166
|
+
def morpho_borrow(
|
|
2506
2167
|
self,
|
|
2507
2168
|
*,
|
|
2508
2169
|
amount: Union[
|
|
@@ -2513,11 +2174,12 @@ class Morpho(BaseSDK):
|
|
|
2513
2174
|
sender: str,
|
|
2514
2175
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2515
2176
|
receiver: OptionalNullable[str] = UNSET,
|
|
2177
|
+
estimate_gas: Optional[bool] = None,
|
|
2516
2178
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2517
2179
|
server_url: Optional[str] = None,
|
|
2518
2180
|
timeout_ms: Optional[int] = None,
|
|
2519
2181
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2520
|
-
) -> models.
|
|
2182
|
+
) -> models.TransactionResponse:
|
|
2521
2183
|
r"""Borrow from Market
|
|
2522
2184
|
|
|
2523
2185
|
Borrow tokens from a Morpho Market against supplied collateral.
|
|
@@ -2529,6 +2191,14 @@ class Morpho(BaseSDK):
|
|
|
2529
2191
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2530
2192
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2531
2193
|
as long as the blockchain it is deployed on is live.
|
|
2194
|
+
<Info>
|
|
2195
|
+
**Required Allowances**
|
|
2196
|
+
|
|
2197
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2198
|
+
|
|
2199
|
+
- `MorphoMarket`
|
|
2200
|
+
</Info>
|
|
2201
|
+
|
|
2532
2202
|
|
|
2533
2203
|
:param amount: Amount of the token to borrow from the market.
|
|
2534
2204
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2536,6 +2206,7 @@ class Morpho(BaseSDK):
|
|
|
2536
2206
|
:param sender: The address of the transaction sender.
|
|
2537
2207
|
:param on_behalf_of: The address where the collateral is borrowed against. Defaults to sender.
|
|
2538
2208
|
:param receiver: The address of the receiver of the tokens borrowed. Defaults to the transaction sender.
|
|
2209
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2539
2210
|
:param retries: Override the default retry configuration for this method
|
|
2540
2211
|
:param server_url: Override the default server URL for this method
|
|
2541
2212
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2558,11 +2229,12 @@ class Morpho(BaseSDK):
|
|
|
2558
2229
|
receiver=receiver,
|
|
2559
2230
|
chain=chain,
|
|
2560
2231
|
sender=sender,
|
|
2232
|
+
estimate_gas=estimate_gas,
|
|
2561
2233
|
)
|
|
2562
2234
|
|
|
2563
2235
|
req = self._build_request(
|
|
2564
2236
|
method="POST",
|
|
2565
|
-
path="/
|
|
2237
|
+
path="/v1/morpho/borrow",
|
|
2566
2238
|
base_url=base_url,
|
|
2567
2239
|
url_variables=url_variables,
|
|
2568
2240
|
request=request,
|
|
@@ -2576,6 +2248,7 @@ class Morpho(BaseSDK):
|
|
|
2576
2248
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2577
2249
|
request, False, False, "json", models.MorphoBorrowRequest
|
|
2578
2250
|
),
|
|
2251
|
+
allow_empty_value=None,
|
|
2579
2252
|
timeout_ms=timeout_ms,
|
|
2580
2253
|
)
|
|
2581
2254
|
|
|
@@ -2591,8 +2264,8 @@ class Morpho(BaseSDK):
|
|
|
2591
2264
|
hook_ctx=HookContext(
|
|
2592
2265
|
config=self.sdk_configuration,
|
|
2593
2266
|
base_url=base_url or "",
|
|
2594
|
-
operation_id="
|
|
2595
|
-
oauth2_scopes=
|
|
2267
|
+
operation_id="v1_morpho_borrow",
|
|
2268
|
+
oauth2_scopes=None,
|
|
2596
2269
|
security_source=self.sdk_configuration.security,
|
|
2597
2270
|
),
|
|
2598
2271
|
request=req,
|
|
@@ -2602,33 +2275,22 @@ class Morpho(BaseSDK):
|
|
|
2602
2275
|
|
|
2603
2276
|
response_data: Any = None
|
|
2604
2277
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2605
|
-
return
|
|
2278
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2606
2279
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2607
|
-
response_data =
|
|
2608
|
-
|
|
2280
|
+
response_data = unmarshal_json_response(
|
|
2281
|
+
errors.HTTPValidationErrorData, http_res
|
|
2609
2282
|
)
|
|
2610
|
-
raise errors.HTTPValidationError(
|
|
2283
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2611
2284
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2612
2285
|
http_res_text = utils.stream_to_text(http_res)
|
|
2613
|
-
raise errors.APIError(
|
|
2614
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2615
|
-
)
|
|
2286
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2616
2287
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2617
2288
|
http_res_text = utils.stream_to_text(http_res)
|
|
2618
|
-
raise errors.APIError(
|
|
2619
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2620
|
-
)
|
|
2289
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2621
2290
|
|
|
2622
|
-
|
|
2623
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2624
|
-
raise errors.APIError(
|
|
2625
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2626
|
-
http_res.status_code,
|
|
2627
|
-
http_res_text,
|
|
2628
|
-
http_res,
|
|
2629
|
-
)
|
|
2291
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2630
2292
|
|
|
2631
|
-
async def
|
|
2293
|
+
async def morpho_borrow_async(
|
|
2632
2294
|
self,
|
|
2633
2295
|
*,
|
|
2634
2296
|
amount: Union[
|
|
@@ -2639,11 +2301,12 @@ class Morpho(BaseSDK):
|
|
|
2639
2301
|
sender: str,
|
|
2640
2302
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2641
2303
|
receiver: OptionalNullable[str] = UNSET,
|
|
2304
|
+
estimate_gas: Optional[bool] = None,
|
|
2642
2305
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2643
2306
|
server_url: Optional[str] = None,
|
|
2644
2307
|
timeout_ms: Optional[int] = None,
|
|
2645
2308
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2646
|
-
) -> models.
|
|
2309
|
+
) -> models.TransactionResponse:
|
|
2647
2310
|
r"""Borrow from Market
|
|
2648
2311
|
|
|
2649
2312
|
Borrow tokens from a Morpho Market against supplied collateral.
|
|
@@ -2655,6 +2318,14 @@ class Morpho(BaseSDK):
|
|
|
2655
2318
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2656
2319
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2657
2320
|
as long as the blockchain it is deployed on is live.
|
|
2321
|
+
<Info>
|
|
2322
|
+
**Required Allowances**
|
|
2323
|
+
|
|
2324
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2325
|
+
|
|
2326
|
+
- `MorphoMarket`
|
|
2327
|
+
</Info>
|
|
2328
|
+
|
|
2658
2329
|
|
|
2659
2330
|
:param amount: Amount of the token to borrow from the market.
|
|
2660
2331
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2662,6 +2333,7 @@ class Morpho(BaseSDK):
|
|
|
2662
2333
|
:param sender: The address of the transaction sender.
|
|
2663
2334
|
:param on_behalf_of: The address where the collateral is borrowed against. Defaults to sender.
|
|
2664
2335
|
:param receiver: The address of the receiver of the tokens borrowed. Defaults to the transaction sender.
|
|
2336
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2665
2337
|
:param retries: Override the default retry configuration for this method
|
|
2666
2338
|
:param server_url: Override the default server URL for this method
|
|
2667
2339
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2684,11 +2356,12 @@ class Morpho(BaseSDK):
|
|
|
2684
2356
|
receiver=receiver,
|
|
2685
2357
|
chain=chain,
|
|
2686
2358
|
sender=sender,
|
|
2359
|
+
estimate_gas=estimate_gas,
|
|
2687
2360
|
)
|
|
2688
2361
|
|
|
2689
2362
|
req = self._build_request_async(
|
|
2690
2363
|
method="POST",
|
|
2691
|
-
path="/
|
|
2364
|
+
path="/v1/morpho/borrow",
|
|
2692
2365
|
base_url=base_url,
|
|
2693
2366
|
url_variables=url_variables,
|
|
2694
2367
|
request=request,
|
|
@@ -2702,6 +2375,7 @@ class Morpho(BaseSDK):
|
|
|
2702
2375
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2703
2376
|
request, False, False, "json", models.MorphoBorrowRequest
|
|
2704
2377
|
),
|
|
2378
|
+
allow_empty_value=None,
|
|
2705
2379
|
timeout_ms=timeout_ms,
|
|
2706
2380
|
)
|
|
2707
2381
|
|
|
@@ -2717,8 +2391,8 @@ class Morpho(BaseSDK):
|
|
|
2717
2391
|
hook_ctx=HookContext(
|
|
2718
2392
|
config=self.sdk_configuration,
|
|
2719
2393
|
base_url=base_url or "",
|
|
2720
|
-
operation_id="
|
|
2721
|
-
oauth2_scopes=
|
|
2394
|
+
operation_id="v1_morpho_borrow",
|
|
2395
|
+
oauth2_scopes=None,
|
|
2722
2396
|
security_source=self.sdk_configuration.security,
|
|
2723
2397
|
),
|
|
2724
2398
|
request=req,
|
|
@@ -2728,33 +2402,22 @@ class Morpho(BaseSDK):
|
|
|
2728
2402
|
|
|
2729
2403
|
response_data: Any = None
|
|
2730
2404
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2731
|
-
return
|
|
2405
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2732
2406
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2733
|
-
response_data =
|
|
2734
|
-
|
|
2407
|
+
response_data = unmarshal_json_response(
|
|
2408
|
+
errors.HTTPValidationErrorData, http_res
|
|
2735
2409
|
)
|
|
2736
|
-
raise errors.HTTPValidationError(
|
|
2410
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2737
2411
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2738
2412
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2739
|
-
raise errors.APIError(
|
|
2740
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2741
|
-
)
|
|
2413
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2742
2414
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2743
2415
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2744
|
-
raise errors.APIError(
|
|
2745
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2746
|
-
)
|
|
2416
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2747
2417
|
|
|
2748
|
-
|
|
2749
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2750
|
-
raise errors.APIError(
|
|
2751
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2752
|
-
http_res.status_code,
|
|
2753
|
-
http_res_text,
|
|
2754
|
-
http_res,
|
|
2755
|
-
)
|
|
2418
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2756
2419
|
|
|
2757
|
-
def
|
|
2420
|
+
def morpho_repay(
|
|
2758
2421
|
self,
|
|
2759
2422
|
*,
|
|
2760
2423
|
amount: Any,
|
|
@@ -2763,11 +2426,12 @@ class Morpho(BaseSDK):
|
|
|
2763
2426
|
sender: str,
|
|
2764
2427
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2765
2428
|
callback_data: OptionalNullable[bytes] = UNSET,
|
|
2429
|
+
estimate_gas: Optional[bool] = None,
|
|
2766
2430
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2767
2431
|
server_url: Optional[str] = None,
|
|
2768
2432
|
timeout_ms: Optional[int] = None,
|
|
2769
2433
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2770
|
-
) -> models.
|
|
2434
|
+
) -> models.TransactionResponse:
|
|
2771
2435
|
r"""Repay to Market
|
|
2772
2436
|
|
|
2773
2437
|
Repay borrowed tokens to a market in order to reduce or eliminate debt.
|
|
@@ -2776,6 +2440,14 @@ class Morpho(BaseSDK):
|
|
|
2776
2440
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2777
2441
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2778
2442
|
as long as the blockchain it is deployed on is live.
|
|
2443
|
+
<Info>
|
|
2444
|
+
**Required Allowances**
|
|
2445
|
+
|
|
2446
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2447
|
+
|
|
2448
|
+
- `MorphoMarket`
|
|
2449
|
+
</Info>
|
|
2450
|
+
|
|
2779
2451
|
|
|
2780
2452
|
:param amount: 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.
|
|
2781
2453
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2783,6 +2455,7 @@ class Morpho(BaseSDK):
|
|
|
2783
2455
|
:param sender: The address of the transaction sender.
|
|
2784
2456
|
:param on_behalf_of: The address on behalf of whom the repayment is made. Defaults to sender.
|
|
2785
2457
|
:param callback_data: An optional field for callback byte data that will be triggered upon successful repaying of debt.
|
|
2458
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2786
2459
|
:param retries: Override the default retry configuration for this method
|
|
2787
2460
|
:param server_url: Override the default server URL for this method
|
|
2788
2461
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2805,11 +2478,12 @@ class Morpho(BaseSDK):
|
|
|
2805
2478
|
callback_data=callback_data,
|
|
2806
2479
|
chain=chain,
|
|
2807
2480
|
sender=sender,
|
|
2481
|
+
estimate_gas=estimate_gas,
|
|
2808
2482
|
)
|
|
2809
2483
|
|
|
2810
2484
|
req = self._build_request(
|
|
2811
2485
|
method="POST",
|
|
2812
|
-
path="/
|
|
2486
|
+
path="/v1/morpho/repay",
|
|
2813
2487
|
base_url=base_url,
|
|
2814
2488
|
url_variables=url_variables,
|
|
2815
2489
|
request=request,
|
|
@@ -2823,6 +2497,7 @@ class Morpho(BaseSDK):
|
|
|
2823
2497
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2824
2498
|
request, False, False, "json", models.MorphoRepayRequest
|
|
2825
2499
|
),
|
|
2500
|
+
allow_empty_value=None,
|
|
2826
2501
|
timeout_ms=timeout_ms,
|
|
2827
2502
|
)
|
|
2828
2503
|
|
|
@@ -2838,8 +2513,8 @@ class Morpho(BaseSDK):
|
|
|
2838
2513
|
hook_ctx=HookContext(
|
|
2839
2514
|
config=self.sdk_configuration,
|
|
2840
2515
|
base_url=base_url or "",
|
|
2841
|
-
operation_id="
|
|
2842
|
-
oauth2_scopes=
|
|
2516
|
+
operation_id="v1_morpho_repay",
|
|
2517
|
+
oauth2_scopes=None,
|
|
2843
2518
|
security_source=self.sdk_configuration.security,
|
|
2844
2519
|
),
|
|
2845
2520
|
request=req,
|
|
@@ -2849,33 +2524,22 @@ class Morpho(BaseSDK):
|
|
|
2849
2524
|
|
|
2850
2525
|
response_data: Any = None
|
|
2851
2526
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2852
|
-
return
|
|
2527
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2853
2528
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2854
|
-
response_data =
|
|
2855
|
-
|
|
2529
|
+
response_data = unmarshal_json_response(
|
|
2530
|
+
errors.HTTPValidationErrorData, http_res
|
|
2856
2531
|
)
|
|
2857
|
-
raise errors.HTTPValidationError(
|
|
2532
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2858
2533
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2859
2534
|
http_res_text = utils.stream_to_text(http_res)
|
|
2860
|
-
raise errors.APIError(
|
|
2861
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2862
|
-
)
|
|
2535
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2863
2536
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2864
2537
|
http_res_text = utils.stream_to_text(http_res)
|
|
2865
|
-
raise errors.APIError(
|
|
2866
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2867
|
-
)
|
|
2538
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2868
2539
|
|
|
2869
|
-
|
|
2870
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2871
|
-
raise errors.APIError(
|
|
2872
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2873
|
-
http_res.status_code,
|
|
2874
|
-
http_res_text,
|
|
2875
|
-
http_res,
|
|
2876
|
-
)
|
|
2540
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2877
2541
|
|
|
2878
|
-
async def
|
|
2542
|
+
async def morpho_repay_async(
|
|
2879
2543
|
self,
|
|
2880
2544
|
*,
|
|
2881
2545
|
amount: Any,
|
|
@@ -2884,11 +2548,12 @@ class Morpho(BaseSDK):
|
|
|
2884
2548
|
sender: str,
|
|
2885
2549
|
on_behalf_of: OptionalNullable[str] = UNSET,
|
|
2886
2550
|
callback_data: OptionalNullable[bytes] = UNSET,
|
|
2551
|
+
estimate_gas: Optional[bool] = None,
|
|
2887
2552
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2888
2553
|
server_url: Optional[str] = None,
|
|
2889
2554
|
timeout_ms: Optional[int] = None,
|
|
2890
2555
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2891
|
-
) -> models.
|
|
2556
|
+
) -> models.TransactionResponse:
|
|
2892
2557
|
r"""Repay to Market
|
|
2893
2558
|
|
|
2894
2559
|
Repay borrowed tokens to a market in order to reduce or eliminate debt.
|
|
@@ -2897,6 +2562,14 @@ class Morpho(BaseSDK):
|
|
|
2897
2562
|
loan asset. Each market is isolated (meaning risks are contained within each
|
|
2898
2563
|
individual market), immutable (cannot be changed after deployment), and will persist
|
|
2899
2564
|
as long as the blockchain it is deployed on is live.
|
|
2565
|
+
<Info>
|
|
2566
|
+
**Required Allowances**
|
|
2567
|
+
|
|
2568
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2569
|
+
|
|
2570
|
+
- `MorphoMarket`
|
|
2571
|
+
</Info>
|
|
2572
|
+
|
|
2900
2573
|
|
|
2901
2574
|
:param amount: 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.
|
|
2902
2575
|
:param unique_market_key: The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
|
|
@@ -2904,6 +2577,7 @@ class Morpho(BaseSDK):
|
|
|
2904
2577
|
:param sender: The address of the transaction sender.
|
|
2905
2578
|
:param on_behalf_of: The address on behalf of whom the repayment is made. Defaults to sender.
|
|
2906
2579
|
:param callback_data: An optional field for callback byte data that will be triggered upon successful repaying of debt.
|
|
2580
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2907
2581
|
:param retries: Override the default retry configuration for this method
|
|
2908
2582
|
:param server_url: Override the default server URL for this method
|
|
2909
2583
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2926,11 +2600,12 @@ class Morpho(BaseSDK):
|
|
|
2926
2600
|
callback_data=callback_data,
|
|
2927
2601
|
chain=chain,
|
|
2928
2602
|
sender=sender,
|
|
2603
|
+
estimate_gas=estimate_gas,
|
|
2929
2604
|
)
|
|
2930
2605
|
|
|
2931
2606
|
req = self._build_request_async(
|
|
2932
2607
|
method="POST",
|
|
2933
|
-
path="/
|
|
2608
|
+
path="/v1/morpho/repay",
|
|
2934
2609
|
base_url=base_url,
|
|
2935
2610
|
url_variables=url_variables,
|
|
2936
2611
|
request=request,
|
|
@@ -2944,6 +2619,7 @@ class Morpho(BaseSDK):
|
|
|
2944
2619
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
2945
2620
|
request, False, False, "json", models.MorphoRepayRequest
|
|
2946
2621
|
),
|
|
2622
|
+
allow_empty_value=None,
|
|
2947
2623
|
timeout_ms=timeout_ms,
|
|
2948
2624
|
)
|
|
2949
2625
|
|
|
@@ -2959,8 +2635,8 @@ class Morpho(BaseSDK):
|
|
|
2959
2635
|
hook_ctx=HookContext(
|
|
2960
2636
|
config=self.sdk_configuration,
|
|
2961
2637
|
base_url=base_url or "",
|
|
2962
|
-
operation_id="
|
|
2963
|
-
oauth2_scopes=
|
|
2638
|
+
operation_id="v1_morpho_repay",
|
|
2639
|
+
oauth2_scopes=None,
|
|
2964
2640
|
security_source=self.sdk_configuration.security,
|
|
2965
2641
|
),
|
|
2966
2642
|
request=req,
|
|
@@ -2970,28 +2646,17 @@ class Morpho(BaseSDK):
|
|
|
2970
2646
|
|
|
2971
2647
|
response_data: Any = None
|
|
2972
2648
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2973
|
-
return
|
|
2649
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2974
2650
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2975
|
-
response_data =
|
|
2976
|
-
|
|
2651
|
+
response_data = unmarshal_json_response(
|
|
2652
|
+
errors.HTTPValidationErrorData, http_res
|
|
2977
2653
|
)
|
|
2978
|
-
raise errors.HTTPValidationError(
|
|
2654
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2979
2655
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2980
2656
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2981
|
-
raise errors.APIError(
|
|
2982
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2983
|
-
)
|
|
2657
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2984
2658
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2985
2659
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2986
|
-
raise errors.APIError(
|
|
2987
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2988
|
-
)
|
|
2660
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2989
2661
|
|
|
2990
|
-
|
|
2991
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2992
|
-
raise errors.APIError(
|
|
2993
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2994
|
-
http_res.status_code,
|
|
2995
|
-
http_res_text,
|
|
2996
|
-
http_res,
|
|
2997
|
-
)
|
|
2662
|
+
raise errors.APIError("Unexpected response received", http_res)
|