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
|
@@ -4,26 +4,33 @@ 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
|
-
class
|
|
11
|
-
def
|
|
11
|
+
class Ethena(BaseSDK):
|
|
12
|
+
def ethena_vault(
|
|
12
13
|
self,
|
|
13
14
|
*,
|
|
14
|
-
chain: models.
|
|
15
|
-
|
|
15
|
+
chain: models.V1EthenaVaultChain,
|
|
16
|
+
block: OptionalNullable[int] = UNSET,
|
|
17
|
+
user_address: OptionalNullable[str] = UNSET,
|
|
16
18
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
19
|
server_url: Optional[str] = None,
|
|
18
20
|
timeout_ms: Optional[int] = None,
|
|
19
21
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
20
|
-
) -> models.
|
|
21
|
-
r"""
|
|
22
|
+
) -> models.EthenaGetVaultResponse:
|
|
23
|
+
r"""Get Vault & User Position
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
Get data & user Position for the Ethena vault on Ethereum.
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
Vault address: 0x9d39a5de30e57443bff2a8307a4256c8797a3497
|
|
28
|
+
|
|
29
|
+
The user position is only included in the response if 'user_address' parameter is included in the request.
|
|
30
|
+
|
|
31
|
+
:param chain:
|
|
32
|
+
:param block: Optional block number (defaults to latest).
|
|
33
|
+
: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`.
|
|
27
34
|
:param retries: Override the default retry configuration for this method
|
|
28
35
|
:param server_url: Override the default server URL for this method
|
|
29
36
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -39,14 +46,15 @@ class TokenSDK(BaseSDK):
|
|
|
39
46
|
else:
|
|
40
47
|
base_url = self._get_url(base_url, url_variables)
|
|
41
48
|
|
|
42
|
-
request = models.
|
|
49
|
+
request = models.V1EthenaVaultRequest(
|
|
43
50
|
chain=chain,
|
|
44
|
-
|
|
51
|
+
block=block,
|
|
52
|
+
user_address=user_address,
|
|
45
53
|
)
|
|
46
54
|
|
|
47
55
|
req = self._build_request(
|
|
48
56
|
method="GET",
|
|
49
|
-
path="/
|
|
57
|
+
path="/v1/ethena/vault",
|
|
50
58
|
base_url=base_url,
|
|
51
59
|
url_variables=url_variables,
|
|
52
60
|
request=request,
|
|
@@ -57,6 +65,7 @@ class TokenSDK(BaseSDK):
|
|
|
57
65
|
accept_header_value="application/json",
|
|
58
66
|
http_headers=http_headers,
|
|
59
67
|
security=self.sdk_configuration.security,
|
|
68
|
+
allow_empty_value=None,
|
|
60
69
|
timeout_ms=timeout_ms,
|
|
61
70
|
)
|
|
62
71
|
|
|
@@ -72,8 +81,8 @@ class TokenSDK(BaseSDK):
|
|
|
72
81
|
hook_ctx=HookContext(
|
|
73
82
|
config=self.sdk_configuration,
|
|
74
83
|
base_url=base_url or "",
|
|
75
|
-
operation_id="
|
|
76
|
-
oauth2_scopes=
|
|
84
|
+
operation_id="v1_ethena_vault",
|
|
85
|
+
oauth2_scopes=None,
|
|
77
86
|
security_source=self.sdk_configuration.security,
|
|
78
87
|
),
|
|
79
88
|
request=req,
|
|
@@ -83,48 +92,43 @@ class TokenSDK(BaseSDK):
|
|
|
83
92
|
|
|
84
93
|
response_data: Any = None
|
|
85
94
|
if utils.match_response(http_res, "200", "application/json"):
|
|
86
|
-
return
|
|
95
|
+
return unmarshal_json_response(models.EthenaGetVaultResponse, http_res)
|
|
87
96
|
if utils.match_response(http_res, "422", "application/json"):
|
|
88
|
-
response_data =
|
|
89
|
-
|
|
97
|
+
response_data = unmarshal_json_response(
|
|
98
|
+
errors.HTTPValidationErrorData, http_res
|
|
90
99
|
)
|
|
91
|
-
raise errors.HTTPValidationError(
|
|
100
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
92
101
|
if utils.match_response(http_res, "4XX", "*"):
|
|
93
102
|
http_res_text = utils.stream_to_text(http_res)
|
|
94
|
-
raise errors.APIError(
|
|
95
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
96
|
-
)
|
|
103
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
97
104
|
if utils.match_response(http_res, "5XX", "*"):
|
|
98
105
|
http_res_text = utils.stream_to_text(http_res)
|
|
99
|
-
raise errors.APIError(
|
|
100
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
101
|
-
)
|
|
106
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
105
|
-
raise errors.APIError(
|
|
106
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
107
|
-
http_res.status_code,
|
|
108
|
-
http_res_text,
|
|
109
|
-
http_res,
|
|
110
|
-
)
|
|
108
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
111
109
|
|
|
112
|
-
async def
|
|
110
|
+
async def ethena_vault_async(
|
|
113
111
|
self,
|
|
114
112
|
*,
|
|
115
|
-
chain: models.
|
|
116
|
-
|
|
113
|
+
chain: models.V1EthenaVaultChain,
|
|
114
|
+
block: OptionalNullable[int] = UNSET,
|
|
115
|
+
user_address: OptionalNullable[str] = UNSET,
|
|
117
116
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
118
117
|
server_url: Optional[str] = None,
|
|
119
118
|
timeout_ms: Optional[int] = None,
|
|
120
119
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
121
|
-
) -> models.
|
|
122
|
-
r"""
|
|
120
|
+
) -> models.EthenaGetVaultResponse:
|
|
121
|
+
r"""Get Vault & User Position
|
|
122
|
+
|
|
123
|
+
Get data & user Position for the Ethena vault on Ethereum.
|
|
124
|
+
|
|
125
|
+
Vault address: 0x9d39a5de30e57443bff2a8307a4256c8797a3497
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
The user position is only included in the response if 'user_address' parameter is included in the request.
|
|
125
128
|
|
|
126
|
-
:param chain:
|
|
127
|
-
:param
|
|
129
|
+
:param chain:
|
|
130
|
+
:param block: Optional block number (defaults to latest).
|
|
131
|
+
: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`.
|
|
128
132
|
:param retries: Override the default retry configuration for this method
|
|
129
133
|
:param server_url: Override the default server URL for this method
|
|
130
134
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -140,14 +144,15 @@ class TokenSDK(BaseSDK):
|
|
|
140
144
|
else:
|
|
141
145
|
base_url = self._get_url(base_url, url_variables)
|
|
142
146
|
|
|
143
|
-
request = models.
|
|
147
|
+
request = models.V1EthenaVaultRequest(
|
|
144
148
|
chain=chain,
|
|
145
|
-
|
|
149
|
+
block=block,
|
|
150
|
+
user_address=user_address,
|
|
146
151
|
)
|
|
147
152
|
|
|
148
153
|
req = self._build_request_async(
|
|
149
154
|
method="GET",
|
|
150
|
-
path="/
|
|
155
|
+
path="/v1/ethena/vault",
|
|
151
156
|
base_url=base_url,
|
|
152
157
|
url_variables=url_variables,
|
|
153
158
|
request=request,
|
|
@@ -158,6 +163,7 @@ class TokenSDK(BaseSDK):
|
|
|
158
163
|
accept_header_value="application/json",
|
|
159
164
|
http_headers=http_headers,
|
|
160
165
|
security=self.sdk_configuration.security,
|
|
166
|
+
allow_empty_value=None,
|
|
161
167
|
timeout_ms=timeout_ms,
|
|
162
168
|
)
|
|
163
169
|
|
|
@@ -173,8 +179,8 @@ class TokenSDK(BaseSDK):
|
|
|
173
179
|
hook_ctx=HookContext(
|
|
174
180
|
config=self.sdk_configuration,
|
|
175
181
|
base_url=base_url or "",
|
|
176
|
-
operation_id="
|
|
177
|
-
oauth2_scopes=
|
|
182
|
+
operation_id="v1_ethena_vault",
|
|
183
|
+
oauth2_scopes=None,
|
|
178
184
|
security_source=self.sdk_configuration.security,
|
|
179
185
|
),
|
|
180
186
|
request=req,
|
|
@@ -184,52 +190,56 @@ class TokenSDK(BaseSDK):
|
|
|
184
190
|
|
|
185
191
|
response_data: Any = None
|
|
186
192
|
if utils.match_response(http_res, "200", "application/json"):
|
|
187
|
-
return
|
|
193
|
+
return unmarshal_json_response(models.EthenaGetVaultResponse, http_res)
|
|
188
194
|
if utils.match_response(http_res, "422", "application/json"):
|
|
189
|
-
response_data =
|
|
190
|
-
|
|
195
|
+
response_data = unmarshal_json_response(
|
|
196
|
+
errors.HTTPValidationErrorData, http_res
|
|
191
197
|
)
|
|
192
|
-
raise errors.HTTPValidationError(
|
|
198
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
193
199
|
if utils.match_response(http_res, "4XX", "*"):
|
|
194
200
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
195
|
-
raise errors.APIError(
|
|
196
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
197
|
-
)
|
|
201
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
198
202
|
if utils.match_response(http_res, "5XX", "*"):
|
|
199
203
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
200
|
-
raise errors.APIError(
|
|
201
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
202
|
-
)
|
|
204
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
203
205
|
|
|
204
|
-
|
|
205
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
206
|
-
raise errors.APIError(
|
|
207
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
208
|
-
http_res.status_code,
|
|
209
|
-
http_res_text,
|
|
210
|
-
http_res,
|
|
211
|
-
)
|
|
206
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
212
207
|
|
|
213
|
-
def
|
|
208
|
+
def ethena_deposit(
|
|
214
209
|
self,
|
|
215
210
|
*,
|
|
216
|
-
|
|
217
|
-
|
|
211
|
+
amount: Union[
|
|
212
|
+
models.EthenaDepositRequestAmount,
|
|
213
|
+
models.EthenaDepositRequestAmountTypedDict,
|
|
214
|
+
],
|
|
215
|
+
chain: models.EthenaDepositRequestChain,
|
|
216
|
+
sender: str,
|
|
217
|
+
receiver: OptionalNullable[str] = UNSET,
|
|
218
|
+
estimate_gas: Optional[bool] = None,
|
|
218
219
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
219
220
|
server_url: Optional[str] = None,
|
|
220
221
|
timeout_ms: Optional[int] = None,
|
|
221
222
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
222
|
-
) -> models.
|
|
223
|
-
r"""
|
|
223
|
+
) -> models.TransactionResponse:
|
|
224
|
+
r"""Deposit USDe
|
|
224
225
|
|
|
225
|
-
|
|
226
|
+
Deposit USDe into a Ethena's Vault to earn passive yield.
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
The shares of a deposit are respresented as sUSDe.
|
|
229
|
+
<Info>
|
|
230
|
+
**Required Allowances**
|
|
230
231
|
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
233
|
+
|
|
234
|
+
- `EthenaVault`
|
|
235
|
+
</Info>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
:param amount: The amount of USDe to deposit into Ethena's vault.
|
|
239
|
+
:param chain:
|
|
240
|
+
:param sender: The address of the transaction sender.
|
|
241
|
+
:param receiver: The address which will receive the shares (sUSDe) from Ethena's vault representing their proportional ownership of the vault's assets. Defaults to the sender.
|
|
242
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
233
243
|
:param retries: Override the default retry configuration for this method
|
|
234
244
|
:param server_url: Override the default server URL for this method
|
|
235
245
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -245,24 +255,31 @@ class TokenSDK(BaseSDK):
|
|
|
245
255
|
else:
|
|
246
256
|
base_url = self._get_url(base_url, url_variables)
|
|
247
257
|
|
|
248
|
-
request = models.
|
|
258
|
+
request = models.EthenaDepositRequest(
|
|
259
|
+
amount=amount,
|
|
260
|
+
receiver=receiver,
|
|
249
261
|
chain=chain,
|
|
250
|
-
|
|
262
|
+
sender=sender,
|
|
263
|
+
estimate_gas=estimate_gas,
|
|
251
264
|
)
|
|
252
265
|
|
|
253
266
|
req = self._build_request(
|
|
254
|
-
method="
|
|
255
|
-
path="/
|
|
267
|
+
method="POST",
|
|
268
|
+
path="/v1/ethena/deposit",
|
|
256
269
|
base_url=base_url,
|
|
257
270
|
url_variables=url_variables,
|
|
258
271
|
request=request,
|
|
259
|
-
request_body_required=
|
|
272
|
+
request_body_required=True,
|
|
260
273
|
request_has_path_params=False,
|
|
261
274
|
request_has_query_params=True,
|
|
262
275
|
user_agent_header="user-agent",
|
|
263
276
|
accept_header_value="application/json",
|
|
264
277
|
http_headers=http_headers,
|
|
265
278
|
security=self.sdk_configuration.security,
|
|
279
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
280
|
+
request, False, False, "json", models.EthenaDepositRequest
|
|
281
|
+
),
|
|
282
|
+
allow_empty_value=None,
|
|
266
283
|
timeout_ms=timeout_ms,
|
|
267
284
|
)
|
|
268
285
|
|
|
@@ -278,8 +295,8 @@ class TokenSDK(BaseSDK):
|
|
|
278
295
|
hook_ctx=HookContext(
|
|
279
296
|
config=self.sdk_configuration,
|
|
280
297
|
base_url=base_url or "",
|
|
281
|
-
operation_id="
|
|
282
|
-
oauth2_scopes=
|
|
298
|
+
operation_id="v1_ethena_deposit",
|
|
299
|
+
oauth2_scopes=None,
|
|
283
300
|
security_source=self.sdk_configuration.security,
|
|
284
301
|
),
|
|
285
302
|
request=req,
|
|
@@ -289,52 +306,56 @@ class TokenSDK(BaseSDK):
|
|
|
289
306
|
|
|
290
307
|
response_data: Any = None
|
|
291
308
|
if utils.match_response(http_res, "200", "application/json"):
|
|
292
|
-
return
|
|
309
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
293
310
|
if utils.match_response(http_res, "422", "application/json"):
|
|
294
|
-
response_data =
|
|
295
|
-
|
|
311
|
+
response_data = unmarshal_json_response(
|
|
312
|
+
errors.HTTPValidationErrorData, http_res
|
|
296
313
|
)
|
|
297
|
-
raise errors.HTTPValidationError(
|
|
314
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
298
315
|
if utils.match_response(http_res, "4XX", "*"):
|
|
299
316
|
http_res_text = utils.stream_to_text(http_res)
|
|
300
|
-
raise errors.APIError(
|
|
301
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
302
|
-
)
|
|
317
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
303
318
|
if utils.match_response(http_res, "5XX", "*"):
|
|
304
319
|
http_res_text = utils.stream_to_text(http_res)
|
|
305
|
-
raise errors.APIError(
|
|
306
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
307
|
-
)
|
|
320
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
308
321
|
|
|
309
|
-
|
|
310
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
311
|
-
raise errors.APIError(
|
|
312
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
313
|
-
http_res.status_code,
|
|
314
|
-
http_res_text,
|
|
315
|
-
http_res,
|
|
316
|
-
)
|
|
322
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
317
323
|
|
|
318
|
-
async def
|
|
324
|
+
async def ethena_deposit_async(
|
|
319
325
|
self,
|
|
320
326
|
*,
|
|
321
|
-
|
|
322
|
-
|
|
327
|
+
amount: Union[
|
|
328
|
+
models.EthenaDepositRequestAmount,
|
|
329
|
+
models.EthenaDepositRequestAmountTypedDict,
|
|
330
|
+
],
|
|
331
|
+
chain: models.EthenaDepositRequestChain,
|
|
332
|
+
sender: str,
|
|
333
|
+
receiver: OptionalNullable[str] = UNSET,
|
|
334
|
+
estimate_gas: Optional[bool] = None,
|
|
323
335
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
324
336
|
server_url: Optional[str] = None,
|
|
325
337
|
timeout_ms: Optional[int] = None,
|
|
326
338
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
327
|
-
) -> models.
|
|
328
|
-
r"""
|
|
339
|
+
) -> models.TransactionResponse:
|
|
340
|
+
r"""Deposit USDe
|
|
341
|
+
|
|
342
|
+
Deposit USDe into a Ethena's Vault to earn passive yield.
|
|
343
|
+
|
|
344
|
+
The shares of a deposit are respresented as sUSDe.
|
|
345
|
+
<Info>
|
|
346
|
+
**Required Allowances**
|
|
329
347
|
|
|
330
|
-
|
|
348
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
331
349
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
with the update frequency of the oracle.
|
|
350
|
+
- `EthenaVault`
|
|
351
|
+
</Info>
|
|
335
352
|
|
|
336
|
-
|
|
337
|
-
:param
|
|
353
|
+
|
|
354
|
+
:param amount: The amount of USDe to deposit into Ethena's vault.
|
|
355
|
+
:param chain:
|
|
356
|
+
:param sender: The address of the transaction sender.
|
|
357
|
+
:param receiver: The address which will receive the shares (sUSDe) from Ethena's vault representing their proportional ownership of the vault's assets. Defaults to the sender.
|
|
358
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
338
359
|
:param retries: Override the default retry configuration for this method
|
|
339
360
|
:param server_url: Override the default server URL for this method
|
|
340
361
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -350,24 +371,31 @@ class TokenSDK(BaseSDK):
|
|
|
350
371
|
else:
|
|
351
372
|
base_url = self._get_url(base_url, url_variables)
|
|
352
373
|
|
|
353
|
-
request = models.
|
|
374
|
+
request = models.EthenaDepositRequest(
|
|
375
|
+
amount=amount,
|
|
376
|
+
receiver=receiver,
|
|
354
377
|
chain=chain,
|
|
355
|
-
|
|
378
|
+
sender=sender,
|
|
379
|
+
estimate_gas=estimate_gas,
|
|
356
380
|
)
|
|
357
381
|
|
|
358
382
|
req = self._build_request_async(
|
|
359
|
-
method="
|
|
360
|
-
path="/
|
|
383
|
+
method="POST",
|
|
384
|
+
path="/v1/ethena/deposit",
|
|
361
385
|
base_url=base_url,
|
|
362
386
|
url_variables=url_variables,
|
|
363
387
|
request=request,
|
|
364
|
-
request_body_required=
|
|
388
|
+
request_body_required=True,
|
|
365
389
|
request_has_path_params=False,
|
|
366
390
|
request_has_query_params=True,
|
|
367
391
|
user_agent_header="user-agent",
|
|
368
392
|
accept_header_value="application/json",
|
|
369
393
|
http_headers=http_headers,
|
|
370
394
|
security=self.sdk_configuration.security,
|
|
395
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
396
|
+
request, False, False, "json", models.EthenaDepositRequest
|
|
397
|
+
),
|
|
398
|
+
allow_empty_value=None,
|
|
371
399
|
timeout_ms=timeout_ms,
|
|
372
400
|
)
|
|
373
401
|
|
|
@@ -383,8 +411,8 @@ class TokenSDK(BaseSDK):
|
|
|
383
411
|
hook_ctx=HookContext(
|
|
384
412
|
config=self.sdk_configuration,
|
|
385
413
|
base_url=base_url or "",
|
|
386
|
-
operation_id="
|
|
387
|
-
oauth2_scopes=
|
|
414
|
+
operation_id="v1_ethena_deposit",
|
|
415
|
+
oauth2_scopes=None,
|
|
388
416
|
security_source=self.sdk_configuration.security,
|
|
389
417
|
),
|
|
390
418
|
request=req,
|
|
@@ -394,50 +422,52 @@ class TokenSDK(BaseSDK):
|
|
|
394
422
|
|
|
395
423
|
response_data: Any = None
|
|
396
424
|
if utils.match_response(http_res, "200", "application/json"):
|
|
397
|
-
return
|
|
425
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
398
426
|
if utils.match_response(http_res, "422", "application/json"):
|
|
399
|
-
response_data =
|
|
400
|
-
|
|
427
|
+
response_data = unmarshal_json_response(
|
|
428
|
+
errors.HTTPValidationErrorData, http_res
|
|
401
429
|
)
|
|
402
|
-
raise errors.HTTPValidationError(
|
|
430
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
403
431
|
if utils.match_response(http_res, "4XX", "*"):
|
|
404
432
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
405
|
-
raise errors.APIError(
|
|
406
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
407
|
-
)
|
|
433
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
408
434
|
if utils.match_response(http_res, "5XX", "*"):
|
|
409
435
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
410
|
-
raise errors.APIError(
|
|
411
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
412
|
-
)
|
|
436
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
413
437
|
|
|
414
|
-
|
|
415
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
416
|
-
raise errors.APIError(
|
|
417
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
418
|
-
http_res.status_code,
|
|
419
|
-
http_res_text,
|
|
420
|
-
http_res,
|
|
421
|
-
)
|
|
438
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
422
439
|
|
|
423
|
-
def
|
|
440
|
+
def ethena_request(
|
|
424
441
|
self,
|
|
425
442
|
*,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
443
|
+
amount: Any,
|
|
444
|
+
chain: models.EthenaRequestToWithdrawRequestChain,
|
|
445
|
+
sender: str,
|
|
446
|
+
estimate_gas: Optional[bool] = None,
|
|
429
447
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
430
448
|
server_url: Optional[str] = None,
|
|
431
449
|
timeout_ms: Optional[int] = None,
|
|
432
450
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
433
|
-
) -> models.
|
|
434
|
-
r"""
|
|
451
|
+
) -> models.EthenaRequestToWithdrawTransactionResponse:
|
|
452
|
+
r"""Request to Withdraw USDe
|
|
453
|
+
|
|
454
|
+
Request to withdraw deposited USDe from Ethena's vault.
|
|
455
|
+
|
|
456
|
+
The Ethena vault requires a cooldown period. Once a request to withdraw a specified
|
|
457
|
+
amount of USDe has been submitted, the alloted cooldown period must pass before the
|
|
458
|
+
withdraw USDe transaction can be submitted.
|
|
435
459
|
|
|
436
|
-
|
|
460
|
+
If an additional amount of USDe is requested to be withdrawn anytime before
|
|
461
|
+
withdrawing the originally requested amount, the cooldown period restarts.
|
|
437
462
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
463
|
+
Yield is not earned on USDe while in its cooldown period.
|
|
464
|
+
|
|
465
|
+
An allowance does not have to be set to initiate the cooldown period.
|
|
466
|
+
|
|
467
|
+
:param amount: The amount of USDe to request to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be requested to be withdrawn.
|
|
468
|
+
:param chain:
|
|
469
|
+
:param sender: The address of the transaction sender.
|
|
470
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
441
471
|
:param retries: Override the default retry configuration for this method
|
|
442
472
|
:param server_url: Override the default server URL for this method
|
|
443
473
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -453,25 +483,30 @@ class TokenSDK(BaseSDK):
|
|
|
453
483
|
else:
|
|
454
484
|
base_url = self._get_url(base_url, url_variables)
|
|
455
485
|
|
|
456
|
-
request = models.
|
|
486
|
+
request = models.EthenaRequestToWithdrawRequest(
|
|
487
|
+
amount=amount,
|
|
457
488
|
chain=chain,
|
|
458
|
-
|
|
459
|
-
|
|
489
|
+
sender=sender,
|
|
490
|
+
estimate_gas=estimate_gas,
|
|
460
491
|
)
|
|
461
492
|
|
|
462
493
|
req = self._build_request(
|
|
463
|
-
method="
|
|
464
|
-
path="/
|
|
494
|
+
method="POST",
|
|
495
|
+
path="/v1/ethena/request",
|
|
465
496
|
base_url=base_url,
|
|
466
497
|
url_variables=url_variables,
|
|
467
498
|
request=request,
|
|
468
|
-
request_body_required=
|
|
499
|
+
request_body_required=True,
|
|
469
500
|
request_has_path_params=False,
|
|
470
501
|
request_has_query_params=True,
|
|
471
502
|
user_agent_header="user-agent",
|
|
472
503
|
accept_header_value="application/json",
|
|
473
504
|
http_headers=http_headers,
|
|
474
505
|
security=self.sdk_configuration.security,
|
|
506
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
507
|
+
request, False, False, "json", models.EthenaRequestToWithdrawRequest
|
|
508
|
+
),
|
|
509
|
+
allow_empty_value=None,
|
|
475
510
|
timeout_ms=timeout_ms,
|
|
476
511
|
)
|
|
477
512
|
|
|
@@ -487,8 +522,8 @@ class TokenSDK(BaseSDK):
|
|
|
487
522
|
hook_ctx=HookContext(
|
|
488
523
|
config=self.sdk_configuration,
|
|
489
524
|
base_url=base_url or "",
|
|
490
|
-
operation_id="
|
|
491
|
-
oauth2_scopes=
|
|
525
|
+
operation_id="v1_ethena_request",
|
|
526
|
+
oauth2_scopes=None,
|
|
492
527
|
security_source=self.sdk_configuration.security,
|
|
493
528
|
),
|
|
494
529
|
request=req,
|
|
@@ -498,50 +533,54 @@ class TokenSDK(BaseSDK):
|
|
|
498
533
|
|
|
499
534
|
response_data: Any = None
|
|
500
535
|
if utils.match_response(http_res, "200", "application/json"):
|
|
501
|
-
return
|
|
536
|
+
return unmarshal_json_response(
|
|
537
|
+
models.EthenaRequestToWithdrawTransactionResponse, http_res
|
|
538
|
+
)
|
|
502
539
|
if utils.match_response(http_res, "422", "application/json"):
|
|
503
|
-
response_data =
|
|
504
|
-
|
|
540
|
+
response_data = unmarshal_json_response(
|
|
541
|
+
errors.HTTPValidationErrorData, http_res
|
|
505
542
|
)
|
|
506
|
-
raise errors.HTTPValidationError(
|
|
543
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
507
544
|
if utils.match_response(http_res, "4XX", "*"):
|
|
508
545
|
http_res_text = utils.stream_to_text(http_res)
|
|
509
|
-
raise errors.APIError(
|
|
510
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
511
|
-
)
|
|
546
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
512
547
|
if utils.match_response(http_res, "5XX", "*"):
|
|
513
548
|
http_res_text = utils.stream_to_text(http_res)
|
|
514
|
-
raise errors.APIError(
|
|
515
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
516
|
-
)
|
|
549
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
517
550
|
|
|
518
|
-
|
|
519
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
520
|
-
raise errors.APIError(
|
|
521
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
522
|
-
http_res.status_code,
|
|
523
|
-
http_res_text,
|
|
524
|
-
http_res,
|
|
525
|
-
)
|
|
551
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
526
552
|
|
|
527
|
-
async def
|
|
553
|
+
async def ethena_request_async(
|
|
528
554
|
self,
|
|
529
555
|
*,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
556
|
+
amount: Any,
|
|
557
|
+
chain: models.EthenaRequestToWithdrawRequestChain,
|
|
558
|
+
sender: str,
|
|
559
|
+
estimate_gas: Optional[bool] = None,
|
|
533
560
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
534
561
|
server_url: Optional[str] = None,
|
|
535
562
|
timeout_ms: Optional[int] = None,
|
|
536
563
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
537
|
-
) -> models.
|
|
538
|
-
r"""
|
|
564
|
+
) -> models.EthenaRequestToWithdrawTransactionResponse:
|
|
565
|
+
r"""Request to Withdraw USDe
|
|
539
566
|
|
|
540
|
-
|
|
567
|
+
Request to withdraw deposited USDe from Ethena's vault.
|
|
541
568
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
569
|
+
The Ethena vault requires a cooldown period. Once a request to withdraw a specified
|
|
570
|
+
amount of USDe has been submitted, the alloted cooldown period must pass before the
|
|
571
|
+
withdraw USDe transaction can be submitted.
|
|
572
|
+
|
|
573
|
+
If an additional amount of USDe is requested to be withdrawn anytime before
|
|
574
|
+
withdrawing the originally requested amount, the cooldown period restarts.
|
|
575
|
+
|
|
576
|
+
Yield is not earned on USDe while in its cooldown period.
|
|
577
|
+
|
|
578
|
+
An allowance does not have to be set to initiate the cooldown period.
|
|
579
|
+
|
|
580
|
+
:param amount: The amount of USDe to request to withdraw from Ethena's vault. If set to 'ALL', your total deposited USDe amount will be requested to be withdrawn.
|
|
581
|
+
:param chain:
|
|
582
|
+
:param sender: The address of the transaction sender.
|
|
583
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
545
584
|
:param retries: Override the default retry configuration for this method
|
|
546
585
|
:param server_url: Override the default server URL for this method
|
|
547
586
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -557,25 +596,30 @@ class TokenSDK(BaseSDK):
|
|
|
557
596
|
else:
|
|
558
597
|
base_url = self._get_url(base_url, url_variables)
|
|
559
598
|
|
|
560
|
-
request = models.
|
|
599
|
+
request = models.EthenaRequestToWithdrawRequest(
|
|
600
|
+
amount=amount,
|
|
561
601
|
chain=chain,
|
|
562
|
-
|
|
563
|
-
|
|
602
|
+
sender=sender,
|
|
603
|
+
estimate_gas=estimate_gas,
|
|
564
604
|
)
|
|
565
605
|
|
|
566
606
|
req = self._build_request_async(
|
|
567
|
-
method="
|
|
568
|
-
path="/
|
|
607
|
+
method="POST",
|
|
608
|
+
path="/v1/ethena/request",
|
|
569
609
|
base_url=base_url,
|
|
570
610
|
url_variables=url_variables,
|
|
571
611
|
request=request,
|
|
572
|
-
request_body_required=
|
|
612
|
+
request_body_required=True,
|
|
573
613
|
request_has_path_params=False,
|
|
574
614
|
request_has_query_params=True,
|
|
575
615
|
user_agent_header="user-agent",
|
|
576
616
|
accept_header_value="application/json",
|
|
577
617
|
http_headers=http_headers,
|
|
578
618
|
security=self.sdk_configuration.security,
|
|
619
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
620
|
+
request, False, False, "json", models.EthenaRequestToWithdrawRequest
|
|
621
|
+
),
|
|
622
|
+
allow_empty_value=None,
|
|
579
623
|
timeout_ms=timeout_ms,
|
|
580
624
|
)
|
|
581
625
|
|
|
@@ -591,8 +635,8 @@ class TokenSDK(BaseSDK):
|
|
|
591
635
|
hook_ctx=HookContext(
|
|
592
636
|
config=self.sdk_configuration,
|
|
593
637
|
base_url=base_url or "",
|
|
594
|
-
operation_id="
|
|
595
|
-
oauth2_scopes=
|
|
638
|
+
operation_id="v1_ethena_request",
|
|
639
|
+
oauth2_scopes=None,
|
|
596
640
|
security_source=self.sdk_configuration.security,
|
|
597
641
|
),
|
|
598
642
|
request=req,
|
|
@@ -602,59 +646,56 @@ class TokenSDK(BaseSDK):
|
|
|
602
646
|
|
|
603
647
|
response_data: Any = None
|
|
604
648
|
if utils.match_response(http_res, "200", "application/json"):
|
|
605
|
-
return
|
|
649
|
+
return unmarshal_json_response(
|
|
650
|
+
models.EthenaRequestToWithdrawTransactionResponse, http_res
|
|
651
|
+
)
|
|
606
652
|
if utils.match_response(http_res, "422", "application/json"):
|
|
607
|
-
response_data =
|
|
608
|
-
|
|
653
|
+
response_data = unmarshal_json_response(
|
|
654
|
+
errors.HTTPValidationErrorData, http_res
|
|
609
655
|
)
|
|
610
|
-
raise errors.HTTPValidationError(
|
|
656
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
611
657
|
if utils.match_response(http_res, "4XX", "*"):
|
|
612
658
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
613
|
-
raise errors.APIError(
|
|
614
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
615
|
-
)
|
|
659
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
616
660
|
if utils.match_response(http_res, "5XX", "*"):
|
|
617
661
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
618
|
-
raise errors.APIError(
|
|
619
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
620
|
-
)
|
|
662
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
621
663
|
|
|
622
|
-
|
|
623
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
624
|
-
raise errors.APIError(
|
|
625
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
626
|
-
http_res.status_code,
|
|
627
|
-
http_res_text,
|
|
628
|
-
http_res,
|
|
629
|
-
)
|
|
664
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
630
665
|
|
|
631
|
-
def
|
|
666
|
+
def ethena_unstake(
|
|
632
667
|
self,
|
|
633
668
|
*,
|
|
634
|
-
|
|
635
|
-
models.TokenTransferRequestAmount,
|
|
636
|
-
models.TokenTransferRequestAmountTypedDict,
|
|
637
|
-
],
|
|
638
|
-
token: Union[
|
|
639
|
-
models.TokenTransferRequestToken, models.TokenTransferRequestTokenTypedDict
|
|
640
|
-
],
|
|
641
|
-
to: str,
|
|
642
|
-
chain: models.Chain,
|
|
669
|
+
chain: models.EthenaUnstakeRequestChain,
|
|
643
670
|
sender: str,
|
|
671
|
+
receiver: OptionalNullable[str] = UNSET,
|
|
672
|
+
estimate_gas: Optional[bool] = None,
|
|
644
673
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
645
674
|
server_url: Optional[str] = None,
|
|
646
675
|
timeout_ms: Optional[int] = None,
|
|
647
676
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
648
|
-
) -> models.
|
|
649
|
-
r"""
|
|
677
|
+
) -> models.TransactionResponse:
|
|
678
|
+
r"""Unstake USDe
|
|
650
679
|
|
|
651
|
-
|
|
680
|
+
Unstake deposited USDe from Ethena's vault.
|
|
652
681
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
682
|
+
Verify that the USDe being unstaked has completed its mandatory cooldown period
|
|
683
|
+
using the Ethena 'Get Vault & User Position' endpoint.
|
|
684
|
+
|
|
685
|
+
This is an all or nothing action. All of the USDe that has completed its cooldown
|
|
686
|
+
period must be withdrawn.
|
|
687
|
+
|
|
688
|
+
The passive yield earned on USDe deposits is represented by the increased value of
|
|
689
|
+
the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
|
|
690
|
+
for the intial USDe deposited and any accrued yield since depositing.
|
|
691
|
+
|
|
692
|
+
An allowance does not have to be set to unstake USDe that has completed its cooldown
|
|
693
|
+
period.
|
|
694
|
+
|
|
695
|
+
:param chain:
|
|
657
696
|
:param sender: The address of the transaction sender.
|
|
697
|
+
:param receiver: The address which will receive the unstaked USDe. Defaults to the sender.
|
|
698
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
658
699
|
:param retries: Override the default retry configuration for this method
|
|
659
700
|
:param server_url: Override the default server URL for this method
|
|
660
701
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -670,17 +711,16 @@ class TokenSDK(BaseSDK):
|
|
|
670
711
|
else:
|
|
671
712
|
base_url = self._get_url(base_url, url_variables)
|
|
672
713
|
|
|
673
|
-
request = models.
|
|
674
|
-
|
|
675
|
-
token=token,
|
|
676
|
-
to=to,
|
|
714
|
+
request = models.EthenaUnstakeRequest(
|
|
715
|
+
receiver=receiver,
|
|
677
716
|
chain=chain,
|
|
678
717
|
sender=sender,
|
|
718
|
+
estimate_gas=estimate_gas,
|
|
679
719
|
)
|
|
680
720
|
|
|
681
721
|
req = self._build_request(
|
|
682
722
|
method="POST",
|
|
683
|
-
path="/
|
|
723
|
+
path="/v1/ethena/unstake",
|
|
684
724
|
base_url=base_url,
|
|
685
725
|
url_variables=url_variables,
|
|
686
726
|
request=request,
|
|
@@ -692,8 +732,9 @@ class TokenSDK(BaseSDK):
|
|
|
692
732
|
http_headers=http_headers,
|
|
693
733
|
security=self.sdk_configuration.security,
|
|
694
734
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
695
|
-
request, False, False, "json", models.
|
|
735
|
+
request, False, False, "json", models.EthenaUnstakeRequest
|
|
696
736
|
),
|
|
737
|
+
allow_empty_value=None,
|
|
697
738
|
timeout_ms=timeout_ms,
|
|
698
739
|
)
|
|
699
740
|
|
|
@@ -709,8 +750,8 @@ class TokenSDK(BaseSDK):
|
|
|
709
750
|
hook_ctx=HookContext(
|
|
710
751
|
config=self.sdk_configuration,
|
|
711
752
|
base_url=base_url or "",
|
|
712
|
-
operation_id="
|
|
713
|
-
oauth2_scopes=
|
|
753
|
+
operation_id="v1_ethena_unstake",
|
|
754
|
+
oauth2_scopes=None,
|
|
714
755
|
security_source=self.sdk_configuration.security,
|
|
715
756
|
),
|
|
716
757
|
request=req,
|
|
@@ -720,59 +761,54 @@ class TokenSDK(BaseSDK):
|
|
|
720
761
|
|
|
721
762
|
response_data: Any = None
|
|
722
763
|
if utils.match_response(http_res, "200", "application/json"):
|
|
723
|
-
return
|
|
764
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
724
765
|
if utils.match_response(http_res, "422", "application/json"):
|
|
725
|
-
response_data =
|
|
726
|
-
|
|
766
|
+
response_data = unmarshal_json_response(
|
|
767
|
+
errors.HTTPValidationErrorData, http_res
|
|
727
768
|
)
|
|
728
|
-
raise errors.HTTPValidationError(
|
|
769
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
729
770
|
if utils.match_response(http_res, "4XX", "*"):
|
|
730
771
|
http_res_text = utils.stream_to_text(http_res)
|
|
731
|
-
raise errors.APIError(
|
|
732
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
733
|
-
)
|
|
772
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
734
773
|
if utils.match_response(http_res, "5XX", "*"):
|
|
735
774
|
http_res_text = utils.stream_to_text(http_res)
|
|
736
|
-
raise errors.APIError(
|
|
737
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
738
|
-
)
|
|
775
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
739
776
|
|
|
740
|
-
|
|
741
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
742
|
-
raise errors.APIError(
|
|
743
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
744
|
-
http_res.status_code,
|
|
745
|
-
http_res_text,
|
|
746
|
-
http_res,
|
|
747
|
-
)
|
|
777
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
748
778
|
|
|
749
|
-
async def
|
|
779
|
+
async def ethena_unstake_async(
|
|
750
780
|
self,
|
|
751
781
|
*,
|
|
752
|
-
|
|
753
|
-
models.TokenTransferRequestAmount,
|
|
754
|
-
models.TokenTransferRequestAmountTypedDict,
|
|
755
|
-
],
|
|
756
|
-
token: Union[
|
|
757
|
-
models.TokenTransferRequestToken, models.TokenTransferRequestTokenTypedDict
|
|
758
|
-
],
|
|
759
|
-
to: str,
|
|
760
|
-
chain: models.Chain,
|
|
782
|
+
chain: models.EthenaUnstakeRequestChain,
|
|
761
783
|
sender: str,
|
|
784
|
+
receiver: OptionalNullable[str] = UNSET,
|
|
785
|
+
estimate_gas: Optional[bool] = None,
|
|
762
786
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
763
787
|
server_url: Optional[str] = None,
|
|
764
788
|
timeout_ms: Optional[int] = None,
|
|
765
789
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
766
|
-
) -> models.
|
|
767
|
-
r"""
|
|
790
|
+
) -> models.TransactionResponse:
|
|
791
|
+
r"""Unstake USDe
|
|
792
|
+
|
|
793
|
+
Unstake deposited USDe from Ethena's vault.
|
|
794
|
+
|
|
795
|
+
Verify that the USDe being unstaked has completed its mandatory cooldown period
|
|
796
|
+
using the Ethena 'Get Vault & User Position' endpoint.
|
|
768
797
|
|
|
769
|
-
|
|
798
|
+
This is an all or nothing action. All of the USDe that has completed its cooldown
|
|
799
|
+
period must be withdrawn.
|
|
770
800
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
801
|
+
The passive yield earned on USDe deposits is represented by the increased value of
|
|
802
|
+
the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
|
|
803
|
+
for the intial USDe deposited and any accrued yield since depositing.
|
|
804
|
+
|
|
805
|
+
An allowance does not have to be set to unstake USDe that has completed its cooldown
|
|
806
|
+
period.
|
|
807
|
+
|
|
808
|
+
:param chain:
|
|
775
809
|
:param sender: The address of the transaction sender.
|
|
810
|
+
:param receiver: The address which will receive the unstaked USDe. Defaults to the sender.
|
|
811
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
776
812
|
:param retries: Override the default retry configuration for this method
|
|
777
813
|
:param server_url: Override the default server URL for this method
|
|
778
814
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -788,17 +824,16 @@ class TokenSDK(BaseSDK):
|
|
|
788
824
|
else:
|
|
789
825
|
base_url = self._get_url(base_url, url_variables)
|
|
790
826
|
|
|
791
|
-
request = models.
|
|
792
|
-
|
|
793
|
-
token=token,
|
|
794
|
-
to=to,
|
|
827
|
+
request = models.EthenaUnstakeRequest(
|
|
828
|
+
receiver=receiver,
|
|
795
829
|
chain=chain,
|
|
796
830
|
sender=sender,
|
|
831
|
+
estimate_gas=estimate_gas,
|
|
797
832
|
)
|
|
798
833
|
|
|
799
834
|
req = self._build_request_async(
|
|
800
835
|
method="POST",
|
|
801
|
-
path="/
|
|
836
|
+
path="/v1/ethena/unstake",
|
|
802
837
|
base_url=base_url,
|
|
803
838
|
url_variables=url_variables,
|
|
804
839
|
request=request,
|
|
@@ -810,8 +845,9 @@ class TokenSDK(BaseSDK):
|
|
|
810
845
|
http_headers=http_headers,
|
|
811
846
|
security=self.sdk_configuration.security,
|
|
812
847
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
813
|
-
request, False, False, "json", models.
|
|
848
|
+
request, False, False, "json", models.EthenaUnstakeRequest
|
|
814
849
|
),
|
|
850
|
+
allow_empty_value=None,
|
|
815
851
|
timeout_ms=timeout_ms,
|
|
816
852
|
)
|
|
817
853
|
|
|
@@ -827,8 +863,8 @@ class TokenSDK(BaseSDK):
|
|
|
827
863
|
hook_ctx=HookContext(
|
|
828
864
|
config=self.sdk_configuration,
|
|
829
865
|
base_url=base_url or "",
|
|
830
|
-
operation_id="
|
|
831
|
-
oauth2_scopes=
|
|
866
|
+
operation_id="v1_ethena_unstake",
|
|
867
|
+
oauth2_scopes=None,
|
|
832
868
|
security_source=self.sdk_configuration.security,
|
|
833
869
|
),
|
|
834
870
|
request=req,
|
|
@@ -838,28 +874,17 @@ class TokenSDK(BaseSDK):
|
|
|
838
874
|
|
|
839
875
|
response_data: Any = None
|
|
840
876
|
if utils.match_response(http_res, "200", "application/json"):
|
|
841
|
-
return
|
|
877
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
842
878
|
if utils.match_response(http_res, "422", "application/json"):
|
|
843
|
-
response_data =
|
|
844
|
-
|
|
879
|
+
response_data = unmarshal_json_response(
|
|
880
|
+
errors.HTTPValidationErrorData, http_res
|
|
845
881
|
)
|
|
846
|
-
raise errors.HTTPValidationError(
|
|
882
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
847
883
|
if utils.match_response(http_res, "4XX", "*"):
|
|
848
884
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
849
|
-
raise errors.APIError(
|
|
850
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
851
|
-
)
|
|
885
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
852
886
|
if utils.match_response(http_res, "5XX", "*"):
|
|
853
887
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
854
|
-
raise errors.APIError(
|
|
855
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
856
|
-
)
|
|
888
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
857
889
|
|
|
858
|
-
|
|
859
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
860
|
-
raise errors.APIError(
|
|
861
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
862
|
-
http_res.status_code,
|
|
863
|
-
http_res_text,
|
|
864
|
-
http_res,
|
|
865
|
-
)
|
|
890
|
+
raise errors.APIError("Unexpected response received", http_res)
|