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/smart_account.py
CHANGED
|
@@ -4,18 +4,20 @@ 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, List, Mapping, Optional, Union
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class SmartAccount(BaseSDK):
|
|
11
|
-
def
|
|
12
|
+
def smart_account_batched_user_operations(
|
|
12
13
|
self,
|
|
13
14
|
*,
|
|
14
|
-
chain: models.
|
|
15
|
+
chain: models.BatchedUserOperationsRequestChain,
|
|
15
16
|
sender: str,
|
|
16
17
|
operations: Union[
|
|
17
18
|
List[models.UserOperation], List[models.UserOperationTypedDict]
|
|
18
19
|
],
|
|
20
|
+
estimate_gas: Optional[bool] = None,
|
|
19
21
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
20
22
|
server_url: Optional[str] = None,
|
|
21
23
|
timeout_ms: Optional[int] = None,
|
|
@@ -25,9 +27,10 @@ class SmartAccount(BaseSDK):
|
|
|
25
27
|
|
|
26
28
|
Generate a list of user operations for smart account batching.
|
|
27
29
|
|
|
28
|
-
:param chain:
|
|
30
|
+
:param chain:
|
|
29
31
|
:param sender: The address of the transaction sender.
|
|
30
32
|
:param operations: List of possible user operations
|
|
33
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
31
34
|
:param retries: Override the default retry configuration for this method
|
|
32
35
|
:param server_url: Override the default server URL for this method
|
|
33
36
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -46,12 +49,13 @@ class SmartAccount(BaseSDK):
|
|
|
46
49
|
request = models.BatchedUserOperationsRequest(
|
|
47
50
|
chain=chain,
|
|
48
51
|
sender=sender,
|
|
52
|
+
estimate_gas=estimate_gas,
|
|
49
53
|
operations=utils.get_pydantic_model(operations, List[models.UserOperation]),
|
|
50
54
|
)
|
|
51
55
|
|
|
52
56
|
req = self._build_request(
|
|
53
57
|
method="POST",
|
|
54
|
-
path="/
|
|
58
|
+
path="/v1/smart_account/batched_user_operations",
|
|
55
59
|
base_url=base_url,
|
|
56
60
|
url_variables=url_variables,
|
|
57
61
|
request=request,
|
|
@@ -65,6 +69,7 @@ class SmartAccount(BaseSDK):
|
|
|
65
69
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
66
70
|
request, False, False, "json", models.BatchedUserOperationsRequest
|
|
67
71
|
),
|
|
72
|
+
allow_empty_value=None,
|
|
68
73
|
timeout_ms=timeout_ms,
|
|
69
74
|
)
|
|
70
75
|
|
|
@@ -80,8 +85,8 @@ class SmartAccount(BaseSDK):
|
|
|
80
85
|
hook_ctx=HookContext(
|
|
81
86
|
config=self.sdk_configuration,
|
|
82
87
|
base_url=base_url or "",
|
|
83
|
-
operation_id="
|
|
84
|
-
oauth2_scopes=
|
|
88
|
+
operation_id="v1_smart_account_batched_user_operations",
|
|
89
|
+
oauth2_scopes=None,
|
|
85
90
|
security_source=self.sdk_configuration.security,
|
|
86
91
|
),
|
|
87
92
|
request=req,
|
|
@@ -91,42 +96,32 @@ class SmartAccount(BaseSDK):
|
|
|
91
96
|
|
|
92
97
|
response_data: Any = None
|
|
93
98
|
if utils.match_response(http_res, "200", "application/json"):
|
|
94
|
-
return
|
|
95
|
-
|
|
99
|
+
return unmarshal_json_response(
|
|
100
|
+
models.BatchedUserOperationsResponse, http_res
|
|
96
101
|
)
|
|
97
102
|
if utils.match_response(http_res, "422", "application/json"):
|
|
98
|
-
response_data =
|
|
99
|
-
|
|
103
|
+
response_data = unmarshal_json_response(
|
|
104
|
+
errors.HTTPValidationErrorData, http_res
|
|
100
105
|
)
|
|
101
|
-
raise errors.HTTPValidationError(
|
|
106
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
102
107
|
if utils.match_response(http_res, "4XX", "*"):
|
|
103
108
|
http_res_text = utils.stream_to_text(http_res)
|
|
104
|
-
raise errors.APIError(
|
|
105
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
106
|
-
)
|
|
109
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
107
110
|
if utils.match_response(http_res, "5XX", "*"):
|
|
108
111
|
http_res_text = utils.stream_to_text(http_res)
|
|
109
|
-
raise errors.APIError(
|
|
110
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
111
|
-
)
|
|
112
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
112
113
|
|
|
113
|
-
|
|
114
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
115
|
-
raise errors.APIError(
|
|
116
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
117
|
-
http_res.status_code,
|
|
118
|
-
http_res_text,
|
|
119
|
-
http_res,
|
|
120
|
-
)
|
|
114
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
121
115
|
|
|
122
|
-
async def
|
|
116
|
+
async def smart_account_batched_user_operations_async(
|
|
123
117
|
self,
|
|
124
118
|
*,
|
|
125
|
-
chain: models.
|
|
119
|
+
chain: models.BatchedUserOperationsRequestChain,
|
|
126
120
|
sender: str,
|
|
127
121
|
operations: Union[
|
|
128
122
|
List[models.UserOperation], List[models.UserOperationTypedDict]
|
|
129
123
|
],
|
|
124
|
+
estimate_gas: Optional[bool] = None,
|
|
130
125
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
131
126
|
server_url: Optional[str] = None,
|
|
132
127
|
timeout_ms: Optional[int] = None,
|
|
@@ -136,9 +131,10 @@ class SmartAccount(BaseSDK):
|
|
|
136
131
|
|
|
137
132
|
Generate a list of user operations for smart account batching.
|
|
138
133
|
|
|
139
|
-
:param chain:
|
|
134
|
+
:param chain:
|
|
140
135
|
:param sender: The address of the transaction sender.
|
|
141
136
|
:param operations: List of possible user operations
|
|
137
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
142
138
|
:param retries: Override the default retry configuration for this method
|
|
143
139
|
:param server_url: Override the default server URL for this method
|
|
144
140
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -157,12 +153,13 @@ class SmartAccount(BaseSDK):
|
|
|
157
153
|
request = models.BatchedUserOperationsRequest(
|
|
158
154
|
chain=chain,
|
|
159
155
|
sender=sender,
|
|
156
|
+
estimate_gas=estimate_gas,
|
|
160
157
|
operations=utils.get_pydantic_model(operations, List[models.UserOperation]),
|
|
161
158
|
)
|
|
162
159
|
|
|
163
160
|
req = self._build_request_async(
|
|
164
161
|
method="POST",
|
|
165
|
-
path="/
|
|
162
|
+
path="/v1/smart_account/batched_user_operations",
|
|
166
163
|
base_url=base_url,
|
|
167
164
|
url_variables=url_variables,
|
|
168
165
|
request=request,
|
|
@@ -176,6 +173,7 @@ class SmartAccount(BaseSDK):
|
|
|
176
173
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
177
174
|
request, False, False, "json", models.BatchedUserOperationsRequest
|
|
178
175
|
),
|
|
176
|
+
allow_empty_value=None,
|
|
179
177
|
timeout_ms=timeout_ms,
|
|
180
178
|
)
|
|
181
179
|
|
|
@@ -191,8 +189,8 @@ class SmartAccount(BaseSDK):
|
|
|
191
189
|
hook_ctx=HookContext(
|
|
192
190
|
config=self.sdk_configuration,
|
|
193
191
|
base_url=base_url or "",
|
|
194
|
-
operation_id="
|
|
195
|
-
oauth2_scopes=
|
|
192
|
+
operation_id="v1_smart_account_batched_user_operations",
|
|
193
|
+
oauth2_scopes=None,
|
|
196
194
|
security_source=self.sdk_configuration.security,
|
|
197
195
|
),
|
|
198
196
|
request=req,
|
|
@@ -202,30 +200,19 @@ class SmartAccount(BaseSDK):
|
|
|
202
200
|
|
|
203
201
|
response_data: Any = None
|
|
204
202
|
if utils.match_response(http_res, "200", "application/json"):
|
|
205
|
-
return
|
|
206
|
-
|
|
203
|
+
return unmarshal_json_response(
|
|
204
|
+
models.BatchedUserOperationsResponse, http_res
|
|
207
205
|
)
|
|
208
206
|
if utils.match_response(http_res, "422", "application/json"):
|
|
209
|
-
response_data =
|
|
210
|
-
|
|
207
|
+
response_data = unmarshal_json_response(
|
|
208
|
+
errors.HTTPValidationErrorData, http_res
|
|
211
209
|
)
|
|
212
|
-
raise errors.HTTPValidationError(
|
|
210
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
213
211
|
if utils.match_response(http_res, "4XX", "*"):
|
|
214
212
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
215
|
-
raise errors.APIError(
|
|
216
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
217
|
-
)
|
|
213
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
218
214
|
if utils.match_response(http_res, "5XX", "*"):
|
|
219
215
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
220
|
-
raise errors.APIError(
|
|
221
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
222
|
-
)
|
|
216
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
223
217
|
|
|
224
|
-
|
|
225
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
226
|
-
raise errors.APIError(
|
|
227
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
228
|
-
http_res.status_code,
|
|
229
|
-
http_res_text,
|
|
230
|
-
http_res,
|
|
231
|
-
)
|
|
218
|
+
raise errors.APIError("Unexpected response received", http_res)
|
compass_api_sdk/swap.py
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from compass_api_sdk import errors, models, utils
|
|
5
|
+
from compass_api_sdk._hooks import HookContext
|
|
6
|
+
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
|
+
from typing import Any, Mapping, Optional, Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Swap(BaseSDK):
|
|
12
|
+
def swap_odos(
|
|
13
|
+
self,
|
|
14
|
+
*,
|
|
15
|
+
token_in: str,
|
|
16
|
+
token_out: str,
|
|
17
|
+
amount_in: Union[
|
|
18
|
+
models.OdosSwapRequestAmountIn, models.OdosSwapRequestAmountInTypedDict
|
|
19
|
+
],
|
|
20
|
+
max_slippage_percent: float,
|
|
21
|
+
chain: models.OdosSwapRequestChain,
|
|
22
|
+
sender: str,
|
|
23
|
+
estimate_gas: Optional[bool] = None,
|
|
24
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
25
|
+
server_url: Optional[str] = None,
|
|
26
|
+
timeout_ms: Optional[int] = None,
|
|
27
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
28
|
+
) -> models.OdosTransactionResponse:
|
|
29
|
+
r"""Odos Swap
|
|
30
|
+
|
|
31
|
+
Swap between two tokens using Odos Smart Order Routing.
|
|
32
|
+
<Info>
|
|
33
|
+
**Required Allowances**
|
|
34
|
+
|
|
35
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
36
|
+
|
|
37
|
+
- `OdosRouter`
|
|
38
|
+
</Info>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
:param token_in: The symbol or address of the token that is to be sold.
|
|
42
|
+
:param token_out: The symbol or address of the token that is to be bought.
|
|
43
|
+
:param amount_in: The amount of token_in to be sold.
|
|
44
|
+
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
45
|
+
:param chain:
|
|
46
|
+
:param sender: The address of the transaction sender.
|
|
47
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
48
|
+
:param retries: Override the default retry configuration for this method
|
|
49
|
+
:param server_url: Override the default server URL for this method
|
|
50
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
51
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
52
|
+
"""
|
|
53
|
+
base_url = None
|
|
54
|
+
url_variables = None
|
|
55
|
+
if timeout_ms is None:
|
|
56
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
57
|
+
|
|
58
|
+
if server_url is not None:
|
|
59
|
+
base_url = server_url
|
|
60
|
+
else:
|
|
61
|
+
base_url = self._get_url(base_url, url_variables)
|
|
62
|
+
|
|
63
|
+
request = models.OdosSwapRequest(
|
|
64
|
+
token_in=token_in,
|
|
65
|
+
token_out=token_out,
|
|
66
|
+
amount_in=amount_in,
|
|
67
|
+
max_slippage_percent=max_slippage_percent,
|
|
68
|
+
chain=chain,
|
|
69
|
+
sender=sender,
|
|
70
|
+
estimate_gas=estimate_gas,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
req = self._build_request(
|
|
74
|
+
method="POST",
|
|
75
|
+
path="/v1/swap/odos",
|
|
76
|
+
base_url=base_url,
|
|
77
|
+
url_variables=url_variables,
|
|
78
|
+
request=request,
|
|
79
|
+
request_body_required=True,
|
|
80
|
+
request_has_path_params=False,
|
|
81
|
+
request_has_query_params=True,
|
|
82
|
+
user_agent_header="user-agent",
|
|
83
|
+
accept_header_value="application/json",
|
|
84
|
+
http_headers=http_headers,
|
|
85
|
+
security=self.sdk_configuration.security,
|
|
86
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
87
|
+
request, False, False, "json", models.OdosSwapRequest
|
|
88
|
+
),
|
|
89
|
+
allow_empty_value=None,
|
|
90
|
+
timeout_ms=timeout_ms,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
if retries == UNSET:
|
|
94
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
95
|
+
retries = self.sdk_configuration.retry_config
|
|
96
|
+
|
|
97
|
+
retry_config = None
|
|
98
|
+
if isinstance(retries, utils.RetryConfig):
|
|
99
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
100
|
+
|
|
101
|
+
http_res = self.do_request(
|
|
102
|
+
hook_ctx=HookContext(
|
|
103
|
+
config=self.sdk_configuration,
|
|
104
|
+
base_url=base_url or "",
|
|
105
|
+
operation_id="v1_swap_odos",
|
|
106
|
+
oauth2_scopes=None,
|
|
107
|
+
security_source=self.sdk_configuration.security,
|
|
108
|
+
),
|
|
109
|
+
request=req,
|
|
110
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
111
|
+
retry_config=retry_config,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
response_data: Any = None
|
|
115
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
116
|
+
return unmarshal_json_response(models.OdosTransactionResponse, http_res)
|
|
117
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
118
|
+
response_data = unmarshal_json_response(
|
|
119
|
+
errors.HTTPValidationErrorData, http_res
|
|
120
|
+
)
|
|
121
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
122
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
123
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
124
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
125
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
126
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
127
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
128
|
+
|
|
129
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
130
|
+
|
|
131
|
+
async def swap_odos_async(
|
|
132
|
+
self,
|
|
133
|
+
*,
|
|
134
|
+
token_in: str,
|
|
135
|
+
token_out: str,
|
|
136
|
+
amount_in: Union[
|
|
137
|
+
models.OdosSwapRequestAmountIn, models.OdosSwapRequestAmountInTypedDict
|
|
138
|
+
],
|
|
139
|
+
max_slippage_percent: float,
|
|
140
|
+
chain: models.OdosSwapRequestChain,
|
|
141
|
+
sender: str,
|
|
142
|
+
estimate_gas: Optional[bool] = None,
|
|
143
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
144
|
+
server_url: Optional[str] = None,
|
|
145
|
+
timeout_ms: Optional[int] = None,
|
|
146
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
147
|
+
) -> models.OdosTransactionResponse:
|
|
148
|
+
r"""Odos Swap
|
|
149
|
+
|
|
150
|
+
Swap between two tokens using Odos Smart Order Routing.
|
|
151
|
+
<Info>
|
|
152
|
+
**Required Allowances**
|
|
153
|
+
|
|
154
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
155
|
+
|
|
156
|
+
- `OdosRouter`
|
|
157
|
+
</Info>
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
:param token_in: The symbol or address of the token that is to be sold.
|
|
161
|
+
:param token_out: The symbol or address of the token that is to be bought.
|
|
162
|
+
:param amount_in: The amount of token_in to be sold.
|
|
163
|
+
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
|
|
164
|
+
:param chain:
|
|
165
|
+
:param sender: The address of the transaction sender.
|
|
166
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
167
|
+
:param retries: Override the default retry configuration for this method
|
|
168
|
+
:param server_url: Override the default server URL for this method
|
|
169
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
170
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
171
|
+
"""
|
|
172
|
+
base_url = None
|
|
173
|
+
url_variables = None
|
|
174
|
+
if timeout_ms is None:
|
|
175
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
176
|
+
|
|
177
|
+
if server_url is not None:
|
|
178
|
+
base_url = server_url
|
|
179
|
+
else:
|
|
180
|
+
base_url = self._get_url(base_url, url_variables)
|
|
181
|
+
|
|
182
|
+
request = models.OdosSwapRequest(
|
|
183
|
+
token_in=token_in,
|
|
184
|
+
token_out=token_out,
|
|
185
|
+
amount_in=amount_in,
|
|
186
|
+
max_slippage_percent=max_slippage_percent,
|
|
187
|
+
chain=chain,
|
|
188
|
+
sender=sender,
|
|
189
|
+
estimate_gas=estimate_gas,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
req = self._build_request_async(
|
|
193
|
+
method="POST",
|
|
194
|
+
path="/v1/swap/odos",
|
|
195
|
+
base_url=base_url,
|
|
196
|
+
url_variables=url_variables,
|
|
197
|
+
request=request,
|
|
198
|
+
request_body_required=True,
|
|
199
|
+
request_has_path_params=False,
|
|
200
|
+
request_has_query_params=True,
|
|
201
|
+
user_agent_header="user-agent",
|
|
202
|
+
accept_header_value="application/json",
|
|
203
|
+
http_headers=http_headers,
|
|
204
|
+
security=self.sdk_configuration.security,
|
|
205
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
206
|
+
request, False, False, "json", models.OdosSwapRequest
|
|
207
|
+
),
|
|
208
|
+
allow_empty_value=None,
|
|
209
|
+
timeout_ms=timeout_ms,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
if retries == UNSET:
|
|
213
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
214
|
+
retries = self.sdk_configuration.retry_config
|
|
215
|
+
|
|
216
|
+
retry_config = None
|
|
217
|
+
if isinstance(retries, utils.RetryConfig):
|
|
218
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
219
|
+
|
|
220
|
+
http_res = await self.do_request_async(
|
|
221
|
+
hook_ctx=HookContext(
|
|
222
|
+
config=self.sdk_configuration,
|
|
223
|
+
base_url=base_url or "",
|
|
224
|
+
operation_id="v1_swap_odos",
|
|
225
|
+
oauth2_scopes=None,
|
|
226
|
+
security_source=self.sdk_configuration.security,
|
|
227
|
+
),
|
|
228
|
+
request=req,
|
|
229
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
230
|
+
retry_config=retry_config,
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
response_data: Any = None
|
|
234
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
235
|
+
return unmarshal_json_response(models.OdosTransactionResponse, http_res)
|
|
236
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
237
|
+
response_data = unmarshal_json_response(
|
|
238
|
+
errors.HTTPValidationErrorData, http_res
|
|
239
|
+
)
|
|
240
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
241
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
242
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
243
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
244
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
245
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
246
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
247
|
+
|
|
248
|
+
raise errors.APIError("Unexpected response received", http_res)
|