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/universal.py
CHANGED
|
@@ -4,15 +4,16 @@ from .basesdk import BaseSDK
|
|
|
4
4
|
from compass_api_sdk import errors, models, utils
|
|
5
5
|
from compass_api_sdk._hooks import HookContext
|
|
6
6
|
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
7
8
|
from typing import Any, Mapping, Optional, Union
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class Universal(BaseSDK):
|
|
11
|
-
def
|
|
12
|
+
def generic_portfolio(
|
|
12
13
|
self,
|
|
13
14
|
*,
|
|
14
|
-
chain: models.
|
|
15
|
-
user: Optional[str] =
|
|
15
|
+
chain: models.V1GenericPortfolioChain,
|
|
16
|
+
user: Optional[str] = None,
|
|
16
17
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
17
18
|
server_url: Optional[str] = None,
|
|
18
19
|
timeout_ms: Optional[int] = None,
|
|
@@ -25,7 +26,7 @@ class Universal(BaseSDK):
|
|
|
25
26
|
This includes the total value of the portfolio in USD and a breakdown of token
|
|
26
27
|
balances, including their respective values and quantities.
|
|
27
28
|
|
|
28
|
-
:param chain:
|
|
29
|
+
:param chain:
|
|
29
30
|
:param user: The user to get portfolio for.
|
|
30
31
|
:param retries: Override the default retry configuration for this method
|
|
31
32
|
:param server_url: Override the default server URL for this method
|
|
@@ -42,14 +43,14 @@ class Universal(BaseSDK):
|
|
|
42
43
|
else:
|
|
43
44
|
base_url = self._get_url(base_url, url_variables)
|
|
44
45
|
|
|
45
|
-
request = models.
|
|
46
|
+
request = models.V1GenericPortfolioRequest(
|
|
46
47
|
chain=chain,
|
|
47
48
|
user=user,
|
|
48
49
|
)
|
|
49
50
|
|
|
50
51
|
req = self._build_request(
|
|
51
52
|
method="GET",
|
|
52
|
-
path="/
|
|
53
|
+
path="/v1/generic/portfolio",
|
|
53
54
|
base_url=base_url,
|
|
54
55
|
url_variables=url_variables,
|
|
55
56
|
request=request,
|
|
@@ -60,6 +61,7 @@ class Universal(BaseSDK):
|
|
|
60
61
|
accept_header_value="application/json",
|
|
61
62
|
http_headers=http_headers,
|
|
62
63
|
security=self.sdk_configuration.security,
|
|
64
|
+
allow_empty_value=None,
|
|
63
65
|
timeout_ms=timeout_ms,
|
|
64
66
|
)
|
|
65
67
|
|
|
@@ -75,8 +77,8 @@ class Universal(BaseSDK):
|
|
|
75
77
|
hook_ctx=HookContext(
|
|
76
78
|
config=self.sdk_configuration,
|
|
77
79
|
base_url=base_url or "",
|
|
78
|
-
operation_id="
|
|
79
|
-
oauth2_scopes=
|
|
80
|
+
operation_id="v1_generic_portfolio",
|
|
81
|
+
oauth2_scopes=None,
|
|
80
82
|
security_source=self.sdk_configuration.security,
|
|
81
83
|
),
|
|
82
84
|
request=req,
|
|
@@ -86,37 +88,26 @@ class Universal(BaseSDK):
|
|
|
86
88
|
|
|
87
89
|
response_data: Any = None
|
|
88
90
|
if utils.match_response(http_res, "200", "application/json"):
|
|
89
|
-
return
|
|
91
|
+
return unmarshal_json_response(models.Portfolio, http_res)
|
|
90
92
|
if utils.match_response(http_res, "422", "application/json"):
|
|
91
|
-
response_data =
|
|
92
|
-
|
|
93
|
+
response_data = unmarshal_json_response(
|
|
94
|
+
errors.HTTPValidationErrorData, http_res
|
|
93
95
|
)
|
|
94
|
-
raise errors.HTTPValidationError(
|
|
96
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
95
97
|
if utils.match_response(http_res, "4XX", "*"):
|
|
96
98
|
http_res_text = utils.stream_to_text(http_res)
|
|
97
|
-
raise errors.APIError(
|
|
98
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
99
|
-
)
|
|
99
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
100
100
|
if utils.match_response(http_res, "5XX", "*"):
|
|
101
101
|
http_res_text = utils.stream_to_text(http_res)
|
|
102
|
-
raise errors.APIError(
|
|
103
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
104
|
-
)
|
|
102
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
105
103
|
|
|
106
|
-
|
|
107
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
108
|
-
raise errors.APIError(
|
|
109
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
110
|
-
http_res.status_code,
|
|
111
|
-
http_res_text,
|
|
112
|
-
http_res,
|
|
113
|
-
)
|
|
104
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
114
105
|
|
|
115
|
-
async def
|
|
106
|
+
async def generic_portfolio_async(
|
|
116
107
|
self,
|
|
117
108
|
*,
|
|
118
|
-
chain: models.
|
|
119
|
-
user: Optional[str] =
|
|
109
|
+
chain: models.V1GenericPortfolioChain,
|
|
110
|
+
user: Optional[str] = None,
|
|
120
111
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
121
112
|
server_url: Optional[str] = None,
|
|
122
113
|
timeout_ms: Optional[int] = None,
|
|
@@ -129,217 +120,7 @@ class Universal(BaseSDK):
|
|
|
129
120
|
This includes the total value of the portfolio in USD and a breakdown of token
|
|
130
121
|
balances, including their respective values and quantities.
|
|
131
122
|
|
|
132
|
-
:param chain:
|
|
133
|
-
:param user: The user to get portfolio for.
|
|
134
|
-
:param retries: Override the default retry configuration for this method
|
|
135
|
-
:param server_url: Override the default server URL for this method
|
|
136
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
137
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
138
|
-
"""
|
|
139
|
-
base_url = None
|
|
140
|
-
url_variables = None
|
|
141
|
-
if timeout_ms is None:
|
|
142
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
143
|
-
|
|
144
|
-
if server_url is not None:
|
|
145
|
-
base_url = server_url
|
|
146
|
-
else:
|
|
147
|
-
base_url = self._get_url(base_url, url_variables)
|
|
148
|
-
|
|
149
|
-
request = models.GenericPortfolioRequest(
|
|
150
|
-
chain=chain,
|
|
151
|
-
user=user,
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
req = self._build_request_async(
|
|
155
|
-
method="GET",
|
|
156
|
-
path="/v0/generic/portfolio/get",
|
|
157
|
-
base_url=base_url,
|
|
158
|
-
url_variables=url_variables,
|
|
159
|
-
request=request,
|
|
160
|
-
request_body_required=False,
|
|
161
|
-
request_has_path_params=False,
|
|
162
|
-
request_has_query_params=True,
|
|
163
|
-
user_agent_header="user-agent",
|
|
164
|
-
accept_header_value="application/json",
|
|
165
|
-
http_headers=http_headers,
|
|
166
|
-
security=self.sdk_configuration.security,
|
|
167
|
-
timeout_ms=timeout_ms,
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
if retries == UNSET:
|
|
171
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
172
|
-
retries = self.sdk_configuration.retry_config
|
|
173
|
-
|
|
174
|
-
retry_config = None
|
|
175
|
-
if isinstance(retries, utils.RetryConfig):
|
|
176
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
177
|
-
|
|
178
|
-
http_res = await self.do_request_async(
|
|
179
|
-
hook_ctx=HookContext(
|
|
180
|
-
config=self.sdk_configuration,
|
|
181
|
-
base_url=base_url or "",
|
|
182
|
-
operation_id="generic_portfolio",
|
|
183
|
-
oauth2_scopes=[],
|
|
184
|
-
security_source=self.sdk_configuration.security,
|
|
185
|
-
),
|
|
186
|
-
request=req,
|
|
187
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
188
|
-
retry_config=retry_config,
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
response_data: Any = None
|
|
192
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
193
|
-
return utils.unmarshal_json(http_res.text, models.Portfolio)
|
|
194
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
195
|
-
response_data = utils.unmarshal_json(
|
|
196
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
197
|
-
)
|
|
198
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
199
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
200
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
201
|
-
raise errors.APIError(
|
|
202
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
203
|
-
)
|
|
204
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
205
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
206
|
-
raise errors.APIError(
|
|
207
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
content_type = http_res.headers.get("Content-Type")
|
|
211
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
212
|
-
raise errors.APIError(
|
|
213
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
214
|
-
http_res.status_code,
|
|
215
|
-
http_res_text,
|
|
216
|
-
http_res,
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
def visualize_portfolio(
|
|
220
|
-
self,
|
|
221
|
-
*,
|
|
222
|
-
chain: models.GenericVisualizePortfolioChain = models.GenericVisualizePortfolioChain.ARBITRUM_MAINNET,
|
|
223
|
-
user: Optional[str] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
224
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
225
|
-
server_url: Optional[str] = None,
|
|
226
|
-
timeout_ms: Optional[int] = None,
|
|
227
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
228
|
-
) -> models.Image:
|
|
229
|
-
r"""Visualize User Portfolio
|
|
230
|
-
|
|
231
|
-
Generate a visual representation of the token portfolio for a wallet address.
|
|
232
|
-
|
|
233
|
-
The response is an SVG image of a pie chart depicting the relative distribution of
|
|
234
|
-
tokens held, colored and labeled with token symbols, percentages and token values in
|
|
235
|
-
USD.
|
|
236
|
-
|
|
237
|
-
:param chain: The chain to use.
|
|
238
|
-
:param user: The user to get portfolio for.
|
|
239
|
-
:param retries: Override the default retry configuration for this method
|
|
240
|
-
:param server_url: Override the default server URL for this method
|
|
241
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
242
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
243
|
-
"""
|
|
244
|
-
base_url = None
|
|
245
|
-
url_variables = None
|
|
246
|
-
if timeout_ms is None:
|
|
247
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
248
|
-
|
|
249
|
-
if server_url is not None:
|
|
250
|
-
base_url = server_url
|
|
251
|
-
else:
|
|
252
|
-
base_url = self._get_url(base_url, url_variables)
|
|
253
|
-
|
|
254
|
-
request = models.GenericVisualizePortfolioRequest(
|
|
255
|
-
chain=chain,
|
|
256
|
-
user=user,
|
|
257
|
-
)
|
|
258
|
-
|
|
259
|
-
req = self._build_request(
|
|
260
|
-
method="GET",
|
|
261
|
-
path="/v0/generic/visualize_portfolio/get",
|
|
262
|
-
base_url=base_url,
|
|
263
|
-
url_variables=url_variables,
|
|
264
|
-
request=request,
|
|
265
|
-
request_body_required=False,
|
|
266
|
-
request_has_path_params=False,
|
|
267
|
-
request_has_query_params=True,
|
|
268
|
-
user_agent_header="user-agent",
|
|
269
|
-
accept_header_value="application/json",
|
|
270
|
-
http_headers=http_headers,
|
|
271
|
-
security=self.sdk_configuration.security,
|
|
272
|
-
timeout_ms=timeout_ms,
|
|
273
|
-
)
|
|
274
|
-
|
|
275
|
-
if retries == UNSET:
|
|
276
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
277
|
-
retries = self.sdk_configuration.retry_config
|
|
278
|
-
|
|
279
|
-
retry_config = None
|
|
280
|
-
if isinstance(retries, utils.RetryConfig):
|
|
281
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
282
|
-
|
|
283
|
-
http_res = self.do_request(
|
|
284
|
-
hook_ctx=HookContext(
|
|
285
|
-
config=self.sdk_configuration,
|
|
286
|
-
base_url=base_url or "",
|
|
287
|
-
operation_id="generic_visualize_portfolio",
|
|
288
|
-
oauth2_scopes=[],
|
|
289
|
-
security_source=self.sdk_configuration.security,
|
|
290
|
-
),
|
|
291
|
-
request=req,
|
|
292
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
293
|
-
retry_config=retry_config,
|
|
294
|
-
)
|
|
295
|
-
|
|
296
|
-
response_data: Any = None
|
|
297
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
298
|
-
return utils.unmarshal_json(http_res.text, models.Image)
|
|
299
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
300
|
-
response_data = utils.unmarshal_json(
|
|
301
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
302
|
-
)
|
|
303
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
304
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
305
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
306
|
-
raise errors.APIError(
|
|
307
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
308
|
-
)
|
|
309
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
310
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
311
|
-
raise errors.APIError(
|
|
312
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
313
|
-
)
|
|
314
|
-
|
|
315
|
-
content_type = http_res.headers.get("Content-Type")
|
|
316
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
317
|
-
raise errors.APIError(
|
|
318
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
319
|
-
http_res.status_code,
|
|
320
|
-
http_res_text,
|
|
321
|
-
http_res,
|
|
322
|
-
)
|
|
323
|
-
|
|
324
|
-
async def visualize_portfolio_async(
|
|
325
|
-
self,
|
|
326
|
-
*,
|
|
327
|
-
chain: models.GenericVisualizePortfolioChain = models.GenericVisualizePortfolioChain.ARBITRUM_MAINNET,
|
|
328
|
-
user: Optional[str] = "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
|
|
329
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
330
|
-
server_url: Optional[str] = None,
|
|
331
|
-
timeout_ms: Optional[int] = None,
|
|
332
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
333
|
-
) -> models.Image:
|
|
334
|
-
r"""Visualize User Portfolio
|
|
335
|
-
|
|
336
|
-
Generate a visual representation of the token portfolio for a wallet address.
|
|
337
|
-
|
|
338
|
-
The response is an SVG image of a pie chart depicting the relative distribution of
|
|
339
|
-
tokens held, colored and labeled with token symbols, percentages and token values in
|
|
340
|
-
USD.
|
|
341
|
-
|
|
342
|
-
:param chain: The chain to use.
|
|
123
|
+
:param chain:
|
|
343
124
|
:param user: The user to get portfolio for.
|
|
344
125
|
:param retries: Override the default retry configuration for this method
|
|
345
126
|
:param server_url: Override the default server URL for this method
|
|
@@ -356,14 +137,14 @@ class Universal(BaseSDK):
|
|
|
356
137
|
else:
|
|
357
138
|
base_url = self._get_url(base_url, url_variables)
|
|
358
139
|
|
|
359
|
-
request = models.
|
|
140
|
+
request = models.V1GenericPortfolioRequest(
|
|
360
141
|
chain=chain,
|
|
361
142
|
user=user,
|
|
362
143
|
)
|
|
363
144
|
|
|
364
145
|
req = self._build_request_async(
|
|
365
146
|
method="GET",
|
|
366
|
-
path="/
|
|
147
|
+
path="/v1/generic/portfolio",
|
|
367
148
|
base_url=base_url,
|
|
368
149
|
url_variables=url_variables,
|
|
369
150
|
request=request,
|
|
@@ -374,6 +155,7 @@ class Universal(BaseSDK):
|
|
|
374
155
|
accept_header_value="application/json",
|
|
375
156
|
http_headers=http_headers,
|
|
376
157
|
security=self.sdk_configuration.security,
|
|
158
|
+
allow_empty_value=None,
|
|
377
159
|
timeout_ms=timeout_ms,
|
|
378
160
|
)
|
|
379
161
|
|
|
@@ -389,8 +171,8 @@ class Universal(BaseSDK):
|
|
|
389
171
|
hook_ctx=HookContext(
|
|
390
172
|
config=self.sdk_configuration,
|
|
391
173
|
base_url=base_url or "",
|
|
392
|
-
operation_id="
|
|
393
|
-
oauth2_scopes=
|
|
174
|
+
operation_id="v1_generic_portfolio",
|
|
175
|
+
oauth2_scopes=None,
|
|
394
176
|
security_source=self.sdk_configuration.security,
|
|
395
177
|
),
|
|
396
178
|
request=req,
|
|
@@ -400,46 +182,35 @@ class Universal(BaseSDK):
|
|
|
400
182
|
|
|
401
183
|
response_data: Any = None
|
|
402
184
|
if utils.match_response(http_res, "200", "application/json"):
|
|
403
|
-
return
|
|
185
|
+
return unmarshal_json_response(models.Portfolio, http_res)
|
|
404
186
|
if utils.match_response(http_res, "422", "application/json"):
|
|
405
|
-
response_data =
|
|
406
|
-
|
|
187
|
+
response_data = unmarshal_json_response(
|
|
188
|
+
errors.HTTPValidationErrorData, http_res
|
|
407
189
|
)
|
|
408
|
-
raise errors.HTTPValidationError(
|
|
190
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
409
191
|
if utils.match_response(http_res, "4XX", "*"):
|
|
410
192
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
411
|
-
raise errors.APIError(
|
|
412
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
413
|
-
)
|
|
193
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
414
194
|
if utils.match_response(http_res, "5XX", "*"):
|
|
415
195
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
416
|
-
raise errors.APIError(
|
|
417
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
418
|
-
)
|
|
196
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
419
197
|
|
|
420
|
-
|
|
421
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
422
|
-
raise errors.APIError(
|
|
423
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
424
|
-
http_res.status_code,
|
|
425
|
-
http_res_text,
|
|
426
|
-
http_res,
|
|
427
|
-
)
|
|
198
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
428
199
|
|
|
429
|
-
def
|
|
200
|
+
def generic_supported_chains(
|
|
430
201
|
self,
|
|
431
202
|
*,
|
|
432
|
-
|
|
203
|
+
protocol: OptionalNullable[models.Protocol] = UNSET,
|
|
433
204
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
434
205
|
server_url: Optional[str] = None,
|
|
435
206
|
timeout_ms: Optional[int] = None,
|
|
436
207
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
437
|
-
) -> models.
|
|
438
|
-
r"""List Supported
|
|
208
|
+
) -> models.SupportedChainInfo:
|
|
209
|
+
r"""List Supported Chains
|
|
439
210
|
|
|
440
|
-
Get the list of supported
|
|
211
|
+
Get the list of supported chains by the Compass API.
|
|
441
212
|
|
|
442
|
-
:param
|
|
213
|
+
:param protocol: The protocol to get the supported chains for.
|
|
443
214
|
:param retries: Override the default retry configuration for this method
|
|
444
215
|
:param server_url: Override the default server URL for this method
|
|
445
216
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -455,13 +226,13 @@ class Universal(BaseSDK):
|
|
|
455
226
|
else:
|
|
456
227
|
base_url = self._get_url(base_url, url_variables)
|
|
457
228
|
|
|
458
|
-
request = models.
|
|
459
|
-
|
|
229
|
+
request = models.V1GenericSupportedChainsRequest(
|
|
230
|
+
protocol=protocol,
|
|
460
231
|
)
|
|
461
232
|
|
|
462
233
|
req = self._build_request(
|
|
463
234
|
method="GET",
|
|
464
|
-
path="/
|
|
235
|
+
path="/v1/generic/supported_chains",
|
|
465
236
|
base_url=base_url,
|
|
466
237
|
url_variables=url_variables,
|
|
467
238
|
request=request,
|
|
@@ -472,6 +243,7 @@ class Universal(BaseSDK):
|
|
|
472
243
|
accept_header_value="application/json",
|
|
473
244
|
http_headers=http_headers,
|
|
474
245
|
security=self.sdk_configuration.security,
|
|
246
|
+
allow_empty_value=None,
|
|
475
247
|
timeout_ms=timeout_ms,
|
|
476
248
|
)
|
|
477
249
|
|
|
@@ -487,8 +259,8 @@ class Universal(BaseSDK):
|
|
|
487
259
|
hook_ctx=HookContext(
|
|
488
260
|
config=self.sdk_configuration,
|
|
489
261
|
base_url=base_url or "",
|
|
490
|
-
operation_id="
|
|
491
|
-
oauth2_scopes=
|
|
262
|
+
operation_id="v1_generic_supported_chains",
|
|
263
|
+
oauth2_scopes=None,
|
|
492
264
|
security_source=self.sdk_configuration.security,
|
|
493
265
|
),
|
|
494
266
|
request=req,
|
|
@@ -498,46 +270,35 @@ class Universal(BaseSDK):
|
|
|
498
270
|
|
|
499
271
|
response_data: Any = None
|
|
500
272
|
if utils.match_response(http_res, "200", "application/json"):
|
|
501
|
-
return
|
|
273
|
+
return unmarshal_json_response(models.SupportedChainInfo, http_res)
|
|
502
274
|
if utils.match_response(http_res, "422", "application/json"):
|
|
503
|
-
response_data =
|
|
504
|
-
|
|
275
|
+
response_data = unmarshal_json_response(
|
|
276
|
+
errors.HTTPValidationErrorData, http_res
|
|
505
277
|
)
|
|
506
|
-
raise errors.HTTPValidationError(
|
|
278
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
507
279
|
if utils.match_response(http_res, "4XX", "*"):
|
|
508
280
|
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
|
-
)
|
|
281
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
512
282
|
if utils.match_response(http_res, "5XX", "*"):
|
|
513
283
|
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
|
-
)
|
|
284
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
517
285
|
|
|
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
|
-
)
|
|
286
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
526
287
|
|
|
527
|
-
async def
|
|
288
|
+
async def generic_supported_chains_async(
|
|
528
289
|
self,
|
|
529
290
|
*,
|
|
530
|
-
|
|
291
|
+
protocol: OptionalNullable[models.Protocol] = UNSET,
|
|
531
292
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
532
293
|
server_url: Optional[str] = None,
|
|
533
294
|
timeout_ms: Optional[int] = None,
|
|
534
295
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
535
|
-
) -> models.
|
|
536
|
-
r"""List Supported
|
|
296
|
+
) -> models.SupportedChainInfo:
|
|
297
|
+
r"""List Supported Chains
|
|
537
298
|
|
|
538
|
-
Get the list of supported
|
|
299
|
+
Get the list of supported chains by the Compass API.
|
|
539
300
|
|
|
540
|
-
:param
|
|
301
|
+
:param protocol: The protocol to get the supported chains for.
|
|
541
302
|
:param retries: Override the default retry configuration for this method
|
|
542
303
|
:param server_url: Override the default server URL for this method
|
|
543
304
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -553,13 +314,13 @@ class Universal(BaseSDK):
|
|
|
553
314
|
else:
|
|
554
315
|
base_url = self._get_url(base_url, url_variables)
|
|
555
316
|
|
|
556
|
-
request = models.
|
|
557
|
-
|
|
317
|
+
request = models.V1GenericSupportedChainsRequest(
|
|
318
|
+
protocol=protocol,
|
|
558
319
|
)
|
|
559
320
|
|
|
560
321
|
req = self._build_request_async(
|
|
561
322
|
method="GET",
|
|
562
|
-
path="/
|
|
323
|
+
path="/v1/generic/supported_chains",
|
|
563
324
|
base_url=base_url,
|
|
564
325
|
url_variables=url_variables,
|
|
565
326
|
request=request,
|
|
@@ -570,6 +331,7 @@ class Universal(BaseSDK):
|
|
|
570
331
|
accept_header_value="application/json",
|
|
571
332
|
http_headers=http_headers,
|
|
572
333
|
security=self.sdk_configuration.security,
|
|
334
|
+
allow_empty_value=None,
|
|
573
335
|
timeout_ms=timeout_ms,
|
|
574
336
|
)
|
|
575
337
|
|
|
@@ -585,8 +347,8 @@ class Universal(BaseSDK):
|
|
|
585
347
|
hook_ctx=HookContext(
|
|
586
348
|
config=self.sdk_configuration,
|
|
587
349
|
base_url=base_url or "",
|
|
588
|
-
operation_id="
|
|
589
|
-
oauth2_scopes=
|
|
350
|
+
operation_id="v1_generic_supported_chains",
|
|
351
|
+
oauth2_scopes=None,
|
|
590
352
|
security_source=self.sdk_configuration.security,
|
|
591
353
|
),
|
|
592
354
|
request=req,
|
|
@@ -596,44 +358,31 @@ class Universal(BaseSDK):
|
|
|
596
358
|
|
|
597
359
|
response_data: Any = None
|
|
598
360
|
if utils.match_response(http_res, "200", "application/json"):
|
|
599
|
-
return
|
|
361
|
+
return unmarshal_json_response(models.SupportedChainInfo, http_res)
|
|
600
362
|
if utils.match_response(http_res, "422", "application/json"):
|
|
601
|
-
response_data =
|
|
602
|
-
|
|
363
|
+
response_data = unmarshal_json_response(
|
|
364
|
+
errors.HTTPValidationErrorData, http_res
|
|
603
365
|
)
|
|
604
|
-
raise errors.HTTPValidationError(
|
|
366
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
605
367
|
if utils.match_response(http_res, "4XX", "*"):
|
|
606
368
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
607
|
-
raise errors.APIError(
|
|
608
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
609
|
-
)
|
|
369
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
610
370
|
if utils.match_response(http_res, "5XX", "*"):
|
|
611
371
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
612
|
-
raise errors.APIError(
|
|
613
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
614
|
-
)
|
|
372
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
615
373
|
|
|
616
|
-
|
|
617
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
618
|
-
raise errors.APIError(
|
|
619
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
620
|
-
http_res.status_code,
|
|
621
|
-
http_res_text,
|
|
622
|
-
http_res,
|
|
623
|
-
)
|
|
374
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
624
375
|
|
|
625
|
-
def
|
|
376
|
+
def generic_allowance(
|
|
626
377
|
self,
|
|
627
378
|
*,
|
|
628
|
-
chain: models.
|
|
629
|
-
token:
|
|
630
|
-
models.GenericAllowanceToken, models.GenericAllowanceTokenTypedDict
|
|
631
|
-
],
|
|
379
|
+
chain: models.V1GenericAllowanceChain,
|
|
380
|
+
token: str,
|
|
632
381
|
contract: Union[
|
|
633
|
-
models.
|
|
634
|
-
models.
|
|
382
|
+
models.V1GenericAllowanceContractUnion,
|
|
383
|
+
models.V1GenericAllowanceContractUnionTypedDict,
|
|
635
384
|
],
|
|
636
|
-
user: Optional[str] =
|
|
385
|
+
user: Optional[str] = None,
|
|
637
386
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
638
387
|
server_url: Optional[str] = None,
|
|
639
388
|
timeout_ms: Optional[int] = None,
|
|
@@ -649,8 +398,8 @@ class Universal(BaseSDK):
|
|
|
649
398
|
these protocols, ensuring that the protocol has the necessary permissions to manage
|
|
650
399
|
the user's tokens securely and efficiently.
|
|
651
400
|
|
|
652
|
-
:param chain:
|
|
653
|
-
:param token: The symbol or address of the token for which the allowance is checked
|
|
401
|
+
:param chain:
|
|
402
|
+
:param token: The symbol or address of the token for which the allowance is checked.
|
|
654
403
|
:param contract: The name or address of the contract to check allowance for.
|
|
655
404
|
:param user: The user to get the ERC20 allowance of.
|
|
656
405
|
:param retries: Override the default retry configuration for this method
|
|
@@ -668,7 +417,7 @@ class Universal(BaseSDK):
|
|
|
668
417
|
else:
|
|
669
418
|
base_url = self._get_url(base_url, url_variables)
|
|
670
419
|
|
|
671
|
-
request = models.
|
|
420
|
+
request = models.V1GenericAllowanceRequest(
|
|
672
421
|
chain=chain,
|
|
673
422
|
user=user,
|
|
674
423
|
token=token,
|
|
@@ -677,7 +426,7 @@ class Universal(BaseSDK):
|
|
|
677
426
|
|
|
678
427
|
req = self._build_request(
|
|
679
428
|
method="GET",
|
|
680
|
-
path="/
|
|
429
|
+
path="/v1/generic/allowance",
|
|
681
430
|
base_url=base_url,
|
|
682
431
|
url_variables=url_variables,
|
|
683
432
|
request=request,
|
|
@@ -688,6 +437,7 @@ class Universal(BaseSDK):
|
|
|
688
437
|
accept_header_value="application/json",
|
|
689
438
|
http_headers=http_headers,
|
|
690
439
|
security=self.sdk_configuration.security,
|
|
440
|
+
allow_empty_value=None,
|
|
691
441
|
timeout_ms=timeout_ms,
|
|
692
442
|
)
|
|
693
443
|
|
|
@@ -703,8 +453,8 @@ class Universal(BaseSDK):
|
|
|
703
453
|
hook_ctx=HookContext(
|
|
704
454
|
config=self.sdk_configuration,
|
|
705
455
|
base_url=base_url or "",
|
|
706
|
-
operation_id="
|
|
707
|
-
oauth2_scopes=
|
|
456
|
+
operation_id="v1_generic_allowance",
|
|
457
|
+
oauth2_scopes=None,
|
|
708
458
|
security_source=self.sdk_configuration.security,
|
|
709
459
|
),
|
|
710
460
|
request=req,
|
|
@@ -714,44 +464,31 @@ class Universal(BaseSDK):
|
|
|
714
464
|
|
|
715
465
|
response_data: Any = None
|
|
716
466
|
if utils.match_response(http_res, "200", "application/json"):
|
|
717
|
-
return
|
|
467
|
+
return unmarshal_json_response(models.AllowanceInfoResponse, http_res)
|
|
718
468
|
if utils.match_response(http_res, "422", "application/json"):
|
|
719
|
-
response_data =
|
|
720
|
-
|
|
469
|
+
response_data = unmarshal_json_response(
|
|
470
|
+
errors.HTTPValidationErrorData, http_res
|
|
721
471
|
)
|
|
722
|
-
raise errors.HTTPValidationError(
|
|
472
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
723
473
|
if utils.match_response(http_res, "4XX", "*"):
|
|
724
474
|
http_res_text = utils.stream_to_text(http_res)
|
|
725
|
-
raise errors.APIError(
|
|
726
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
727
|
-
)
|
|
475
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
728
476
|
if utils.match_response(http_res, "5XX", "*"):
|
|
729
477
|
http_res_text = utils.stream_to_text(http_res)
|
|
730
|
-
raise errors.APIError(
|
|
731
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
732
|
-
)
|
|
478
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
733
479
|
|
|
734
|
-
|
|
735
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
736
|
-
raise errors.APIError(
|
|
737
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
738
|
-
http_res.status_code,
|
|
739
|
-
http_res_text,
|
|
740
|
-
http_res,
|
|
741
|
-
)
|
|
480
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
742
481
|
|
|
743
|
-
async def
|
|
482
|
+
async def generic_allowance_async(
|
|
744
483
|
self,
|
|
745
484
|
*,
|
|
746
|
-
chain: models.
|
|
747
|
-
token:
|
|
748
|
-
models.GenericAllowanceToken, models.GenericAllowanceTokenTypedDict
|
|
749
|
-
],
|
|
485
|
+
chain: models.V1GenericAllowanceChain,
|
|
486
|
+
token: str,
|
|
750
487
|
contract: Union[
|
|
751
|
-
models.
|
|
752
|
-
models.
|
|
488
|
+
models.V1GenericAllowanceContractUnion,
|
|
489
|
+
models.V1GenericAllowanceContractUnionTypedDict,
|
|
753
490
|
],
|
|
754
|
-
user: Optional[str] =
|
|
491
|
+
user: Optional[str] = None,
|
|
755
492
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
756
493
|
server_url: Optional[str] = None,
|
|
757
494
|
timeout_ms: Optional[int] = None,
|
|
@@ -767,8 +504,8 @@ class Universal(BaseSDK):
|
|
|
767
504
|
these protocols, ensuring that the protocol has the necessary permissions to manage
|
|
768
505
|
the user's tokens securely and efficiently.
|
|
769
506
|
|
|
770
|
-
:param chain:
|
|
771
|
-
:param token: The symbol or address of the token for which the allowance is checked
|
|
507
|
+
:param chain:
|
|
508
|
+
:param token: The symbol or address of the token for which the allowance is checked.
|
|
772
509
|
:param contract: The name or address of the contract to check allowance for.
|
|
773
510
|
:param user: The user to get the ERC20 allowance of.
|
|
774
511
|
:param retries: Override the default retry configuration for this method
|
|
@@ -786,7 +523,7 @@ class Universal(BaseSDK):
|
|
|
786
523
|
else:
|
|
787
524
|
base_url = self._get_url(base_url, url_variables)
|
|
788
525
|
|
|
789
|
-
request = models.
|
|
526
|
+
request = models.V1GenericAllowanceRequest(
|
|
790
527
|
chain=chain,
|
|
791
528
|
user=user,
|
|
792
529
|
token=token,
|
|
@@ -795,7 +532,7 @@ class Universal(BaseSDK):
|
|
|
795
532
|
|
|
796
533
|
req = self._build_request_async(
|
|
797
534
|
method="GET",
|
|
798
|
-
path="/
|
|
535
|
+
path="/v1/generic/allowance",
|
|
799
536
|
base_url=base_url,
|
|
800
537
|
url_variables=url_variables,
|
|
801
538
|
request=request,
|
|
@@ -806,6 +543,7 @@ class Universal(BaseSDK):
|
|
|
806
543
|
accept_header_value="application/json",
|
|
807
544
|
http_headers=http_headers,
|
|
808
545
|
security=self.sdk_configuration.security,
|
|
546
|
+
allow_empty_value=None,
|
|
809
547
|
timeout_ms=timeout_ms,
|
|
810
548
|
)
|
|
811
549
|
|
|
@@ -821,8 +559,8 @@ class Universal(BaseSDK):
|
|
|
821
559
|
hook_ctx=HookContext(
|
|
822
560
|
config=self.sdk_configuration,
|
|
823
561
|
base_url=base_url or "",
|
|
824
|
-
operation_id="
|
|
825
|
-
oauth2_scopes=
|
|
562
|
+
operation_id="v1_generic_allowance",
|
|
563
|
+
oauth2_scopes=None,
|
|
826
564
|
security_source=self.sdk_configuration.security,
|
|
827
565
|
),
|
|
828
566
|
request=req,
|
|
@@ -832,37 +570,26 @@ class Universal(BaseSDK):
|
|
|
832
570
|
|
|
833
571
|
response_data: Any = None
|
|
834
572
|
if utils.match_response(http_res, "200", "application/json"):
|
|
835
|
-
return
|
|
573
|
+
return unmarshal_json_response(models.AllowanceInfoResponse, http_res)
|
|
836
574
|
if utils.match_response(http_res, "422", "application/json"):
|
|
837
|
-
response_data =
|
|
838
|
-
|
|
575
|
+
response_data = unmarshal_json_response(
|
|
576
|
+
errors.HTTPValidationErrorData, http_res
|
|
839
577
|
)
|
|
840
|
-
raise errors.HTTPValidationError(
|
|
578
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
841
579
|
if utils.match_response(http_res, "4XX", "*"):
|
|
842
580
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
843
|
-
raise errors.APIError(
|
|
844
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
845
|
-
)
|
|
581
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
846
582
|
if utils.match_response(http_res, "5XX", "*"):
|
|
847
583
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
848
|
-
raise errors.APIError(
|
|
849
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
850
|
-
)
|
|
584
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
851
585
|
|
|
852
|
-
|
|
853
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
854
|
-
raise errors.APIError(
|
|
855
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
856
|
-
http_res.status_code,
|
|
857
|
-
http_res_text,
|
|
858
|
-
http_res,
|
|
859
|
-
)
|
|
586
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
860
587
|
|
|
861
|
-
def
|
|
588
|
+
def generic_ens(
|
|
862
589
|
self,
|
|
863
590
|
*,
|
|
864
|
-
chain: models.
|
|
865
|
-
ens_name: Optional[str] =
|
|
591
|
+
chain: models.V1GenericEnsChain,
|
|
592
|
+
ens_name: Optional[str] = None,
|
|
866
593
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
867
594
|
server_url: Optional[str] = None,
|
|
868
595
|
timeout_ms: Optional[int] = None,
|
|
@@ -875,7 +602,7 @@ class Universal(BaseSDK):
|
|
|
875
602
|
E.g. `vitalik.eth`. This endpoint can be used to
|
|
876
603
|
query the actual ethereum wallet address behind the ENS name.
|
|
877
604
|
|
|
878
|
-
:param chain:
|
|
605
|
+
:param chain:
|
|
879
606
|
:param ens_name: The ENS name to resolve.
|
|
880
607
|
:param retries: Override the default retry configuration for this method
|
|
881
608
|
:param server_url: Override the default server URL for this method
|
|
@@ -892,14 +619,14 @@ class Universal(BaseSDK):
|
|
|
892
619
|
else:
|
|
893
620
|
base_url = self._get_url(base_url, url_variables)
|
|
894
621
|
|
|
895
|
-
request = models.
|
|
622
|
+
request = models.V1GenericEnsRequest(
|
|
896
623
|
chain=chain,
|
|
897
624
|
ens_name=ens_name,
|
|
898
625
|
)
|
|
899
626
|
|
|
900
627
|
req = self._build_request(
|
|
901
628
|
method="GET",
|
|
902
|
-
path="/
|
|
629
|
+
path="/v1/generic/ens",
|
|
903
630
|
base_url=base_url,
|
|
904
631
|
url_variables=url_variables,
|
|
905
632
|
request=request,
|
|
@@ -910,6 +637,7 @@ class Universal(BaseSDK):
|
|
|
910
637
|
accept_header_value="application/json",
|
|
911
638
|
http_headers=http_headers,
|
|
912
639
|
security=self.sdk_configuration.security,
|
|
640
|
+
allow_empty_value=None,
|
|
913
641
|
timeout_ms=timeout_ms,
|
|
914
642
|
)
|
|
915
643
|
|
|
@@ -925,8 +653,8 @@ class Universal(BaseSDK):
|
|
|
925
653
|
hook_ctx=HookContext(
|
|
926
654
|
config=self.sdk_configuration,
|
|
927
655
|
base_url=base_url or "",
|
|
928
|
-
operation_id="
|
|
929
|
-
oauth2_scopes=
|
|
656
|
+
operation_id="v1_generic_ens",
|
|
657
|
+
oauth2_scopes=None,
|
|
930
658
|
security_source=self.sdk_configuration.security,
|
|
931
659
|
),
|
|
932
660
|
request=req,
|
|
@@ -936,37 +664,26 @@ class Universal(BaseSDK):
|
|
|
936
664
|
|
|
937
665
|
response_data: Any = None
|
|
938
666
|
if utils.match_response(http_res, "200", "application/json"):
|
|
939
|
-
return
|
|
667
|
+
return unmarshal_json_response(models.EnsNameInfoResponse, http_res)
|
|
940
668
|
if utils.match_response(http_res, "422", "application/json"):
|
|
941
|
-
response_data =
|
|
942
|
-
|
|
669
|
+
response_data = unmarshal_json_response(
|
|
670
|
+
errors.HTTPValidationErrorData, http_res
|
|
943
671
|
)
|
|
944
|
-
raise errors.HTTPValidationError(
|
|
672
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
945
673
|
if utils.match_response(http_res, "4XX", "*"):
|
|
946
674
|
http_res_text = utils.stream_to_text(http_res)
|
|
947
|
-
raise errors.APIError(
|
|
948
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
949
|
-
)
|
|
675
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
950
676
|
if utils.match_response(http_res, "5XX", "*"):
|
|
951
677
|
http_res_text = utils.stream_to_text(http_res)
|
|
952
|
-
raise errors.APIError(
|
|
953
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
954
|
-
)
|
|
678
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
955
679
|
|
|
956
|
-
|
|
957
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
958
|
-
raise errors.APIError(
|
|
959
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
960
|
-
http_res.status_code,
|
|
961
|
-
http_res_text,
|
|
962
|
-
http_res,
|
|
963
|
-
)
|
|
680
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
964
681
|
|
|
965
|
-
async def
|
|
682
|
+
async def generic_ens_async(
|
|
966
683
|
self,
|
|
967
684
|
*,
|
|
968
|
-
chain: models.
|
|
969
|
-
ens_name: Optional[str] =
|
|
685
|
+
chain: models.V1GenericEnsChain,
|
|
686
|
+
ens_name: Optional[str] = None,
|
|
970
687
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
971
688
|
server_url: Optional[str] = None,
|
|
972
689
|
timeout_ms: Optional[int] = None,
|
|
@@ -979,7 +696,7 @@ class Universal(BaseSDK):
|
|
|
979
696
|
E.g. `vitalik.eth`. This endpoint can be used to
|
|
980
697
|
query the actual ethereum wallet address behind the ENS name.
|
|
981
698
|
|
|
982
|
-
:param chain:
|
|
699
|
+
:param chain:
|
|
983
700
|
:param ens_name: The ENS name to resolve.
|
|
984
701
|
:param retries: Override the default retry configuration for this method
|
|
985
702
|
:param server_url: Override the default server URL for this method
|
|
@@ -996,14 +713,14 @@ class Universal(BaseSDK):
|
|
|
996
713
|
else:
|
|
997
714
|
base_url = self._get_url(base_url, url_variables)
|
|
998
715
|
|
|
999
|
-
request = models.
|
|
716
|
+
request = models.V1GenericEnsRequest(
|
|
1000
717
|
chain=chain,
|
|
1001
718
|
ens_name=ens_name,
|
|
1002
719
|
)
|
|
1003
720
|
|
|
1004
721
|
req = self._build_request_async(
|
|
1005
722
|
method="GET",
|
|
1006
|
-
path="/
|
|
723
|
+
path="/v1/generic/ens",
|
|
1007
724
|
base_url=base_url,
|
|
1008
725
|
url_variables=url_variables,
|
|
1009
726
|
request=request,
|
|
@@ -1014,6 +731,7 @@ class Universal(BaseSDK):
|
|
|
1014
731
|
accept_header_value="application/json",
|
|
1015
732
|
http_headers=http_headers,
|
|
1016
733
|
security=self.sdk_configuration.security,
|
|
734
|
+
allow_empty_value=None,
|
|
1017
735
|
timeout_ms=timeout_ms,
|
|
1018
736
|
)
|
|
1019
737
|
|
|
@@ -1029,448 +747,8 @@ class Universal(BaseSDK):
|
|
|
1029
747
|
hook_ctx=HookContext(
|
|
1030
748
|
config=self.sdk_configuration,
|
|
1031
749
|
base_url=base_url or "",
|
|
1032
|
-
operation_id="
|
|
1033
|
-
oauth2_scopes=
|
|
1034
|
-
security_source=self.sdk_configuration.security,
|
|
1035
|
-
),
|
|
1036
|
-
request=req,
|
|
1037
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1038
|
-
retry_config=retry_config,
|
|
1039
|
-
)
|
|
1040
|
-
|
|
1041
|
-
response_data: Any = None
|
|
1042
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1043
|
-
return utils.unmarshal_json(http_res.text, models.EnsNameInfoResponse)
|
|
1044
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1045
|
-
response_data = utils.unmarshal_json(
|
|
1046
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
1047
|
-
)
|
|
1048
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
1049
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1050
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1051
|
-
raise errors.APIError(
|
|
1052
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1053
|
-
)
|
|
1054
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1055
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1056
|
-
raise errors.APIError(
|
|
1057
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1058
|
-
)
|
|
1059
|
-
|
|
1060
|
-
content_type = http_res.headers.get("Content-Type")
|
|
1061
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1062
|
-
raise errors.APIError(
|
|
1063
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1064
|
-
http_res.status_code,
|
|
1065
|
-
http_res_text,
|
|
1066
|
-
http_res,
|
|
1067
|
-
)
|
|
1068
|
-
|
|
1069
|
-
def wrap_eth(
|
|
1070
|
-
self,
|
|
1071
|
-
*,
|
|
1072
|
-
amount: Union[
|
|
1073
|
-
models.WrapEthRequestAmount, models.WrapEthRequestAmountTypedDict
|
|
1074
|
-
],
|
|
1075
|
-
chain: models.Chain,
|
|
1076
|
-
sender: str,
|
|
1077
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1078
|
-
server_url: Optional[str] = None,
|
|
1079
|
-
timeout_ms: Optional[int] = None,
|
|
1080
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1081
|
-
) -> models.TxResponse:
|
|
1082
|
-
r"""Wrap ETH
|
|
1083
|
-
|
|
1084
|
-
Wrapping ETH creates an ERC20 compliant form of ETH that is typically needed for
|
|
1085
|
-
it to be traded on DeFi protocols.
|
|
1086
|
-
|
|
1087
|
-
:param amount: The amount of ETH to wrap.
|
|
1088
|
-
:param chain: The chain to use.
|
|
1089
|
-
:param sender: The address of the transaction sender.
|
|
1090
|
-
:param retries: Override the default retry configuration for this method
|
|
1091
|
-
:param server_url: Override the default server URL for this method
|
|
1092
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1093
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1094
|
-
"""
|
|
1095
|
-
base_url = None
|
|
1096
|
-
url_variables = None
|
|
1097
|
-
if timeout_ms is None:
|
|
1098
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1099
|
-
|
|
1100
|
-
if server_url is not None:
|
|
1101
|
-
base_url = server_url
|
|
1102
|
-
else:
|
|
1103
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1104
|
-
|
|
1105
|
-
request = models.WrapEthRequest(
|
|
1106
|
-
amount=amount,
|
|
1107
|
-
chain=chain,
|
|
1108
|
-
sender=sender,
|
|
1109
|
-
)
|
|
1110
|
-
|
|
1111
|
-
req = self._build_request(
|
|
1112
|
-
method="POST",
|
|
1113
|
-
path="/v0/generic/wrap_eth",
|
|
1114
|
-
base_url=base_url,
|
|
1115
|
-
url_variables=url_variables,
|
|
1116
|
-
request=request,
|
|
1117
|
-
request_body_required=True,
|
|
1118
|
-
request_has_path_params=False,
|
|
1119
|
-
request_has_query_params=True,
|
|
1120
|
-
user_agent_header="user-agent",
|
|
1121
|
-
accept_header_value="application/json",
|
|
1122
|
-
http_headers=http_headers,
|
|
1123
|
-
security=self.sdk_configuration.security,
|
|
1124
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1125
|
-
request, False, False, "json", models.WrapEthRequest
|
|
1126
|
-
),
|
|
1127
|
-
timeout_ms=timeout_ms,
|
|
1128
|
-
)
|
|
1129
|
-
|
|
1130
|
-
if retries == UNSET:
|
|
1131
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1132
|
-
retries = self.sdk_configuration.retry_config
|
|
1133
|
-
|
|
1134
|
-
retry_config = None
|
|
1135
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1136
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1137
|
-
|
|
1138
|
-
http_res = self.do_request(
|
|
1139
|
-
hook_ctx=HookContext(
|
|
1140
|
-
config=self.sdk_configuration,
|
|
1141
|
-
base_url=base_url or "",
|
|
1142
|
-
operation_id="generic_wrap_eth",
|
|
1143
|
-
oauth2_scopes=[],
|
|
1144
|
-
security_source=self.sdk_configuration.security,
|
|
1145
|
-
),
|
|
1146
|
-
request=req,
|
|
1147
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1148
|
-
retry_config=retry_config,
|
|
1149
|
-
)
|
|
1150
|
-
|
|
1151
|
-
response_data: Any = None
|
|
1152
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1153
|
-
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
1154
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1155
|
-
response_data = utils.unmarshal_json(
|
|
1156
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
1157
|
-
)
|
|
1158
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
1159
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1160
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1161
|
-
raise errors.APIError(
|
|
1162
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1163
|
-
)
|
|
1164
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1165
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1166
|
-
raise errors.APIError(
|
|
1167
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1168
|
-
)
|
|
1169
|
-
|
|
1170
|
-
content_type = http_res.headers.get("Content-Type")
|
|
1171
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1172
|
-
raise errors.APIError(
|
|
1173
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1174
|
-
http_res.status_code,
|
|
1175
|
-
http_res_text,
|
|
1176
|
-
http_res,
|
|
1177
|
-
)
|
|
1178
|
-
|
|
1179
|
-
async def wrap_eth_async(
|
|
1180
|
-
self,
|
|
1181
|
-
*,
|
|
1182
|
-
amount: Union[
|
|
1183
|
-
models.WrapEthRequestAmount, models.WrapEthRequestAmountTypedDict
|
|
1184
|
-
],
|
|
1185
|
-
chain: models.Chain,
|
|
1186
|
-
sender: str,
|
|
1187
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1188
|
-
server_url: Optional[str] = None,
|
|
1189
|
-
timeout_ms: Optional[int] = None,
|
|
1190
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1191
|
-
) -> models.TxResponse:
|
|
1192
|
-
r"""Wrap ETH
|
|
1193
|
-
|
|
1194
|
-
Wrapping ETH creates an ERC20 compliant form of ETH that is typically needed for
|
|
1195
|
-
it to be traded on DeFi protocols.
|
|
1196
|
-
|
|
1197
|
-
:param amount: The amount of ETH to wrap.
|
|
1198
|
-
:param chain: The chain to use.
|
|
1199
|
-
:param sender: The address of the transaction sender.
|
|
1200
|
-
:param retries: Override the default retry configuration for this method
|
|
1201
|
-
:param server_url: Override the default server URL for this method
|
|
1202
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1203
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1204
|
-
"""
|
|
1205
|
-
base_url = None
|
|
1206
|
-
url_variables = None
|
|
1207
|
-
if timeout_ms is None:
|
|
1208
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1209
|
-
|
|
1210
|
-
if server_url is not None:
|
|
1211
|
-
base_url = server_url
|
|
1212
|
-
else:
|
|
1213
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1214
|
-
|
|
1215
|
-
request = models.WrapEthRequest(
|
|
1216
|
-
amount=amount,
|
|
1217
|
-
chain=chain,
|
|
1218
|
-
sender=sender,
|
|
1219
|
-
)
|
|
1220
|
-
|
|
1221
|
-
req = self._build_request_async(
|
|
1222
|
-
method="POST",
|
|
1223
|
-
path="/v0/generic/wrap_eth",
|
|
1224
|
-
base_url=base_url,
|
|
1225
|
-
url_variables=url_variables,
|
|
1226
|
-
request=request,
|
|
1227
|
-
request_body_required=True,
|
|
1228
|
-
request_has_path_params=False,
|
|
1229
|
-
request_has_query_params=True,
|
|
1230
|
-
user_agent_header="user-agent",
|
|
1231
|
-
accept_header_value="application/json",
|
|
1232
|
-
http_headers=http_headers,
|
|
1233
|
-
security=self.sdk_configuration.security,
|
|
1234
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1235
|
-
request, False, False, "json", models.WrapEthRequest
|
|
1236
|
-
),
|
|
1237
|
-
timeout_ms=timeout_ms,
|
|
1238
|
-
)
|
|
1239
|
-
|
|
1240
|
-
if retries == UNSET:
|
|
1241
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1242
|
-
retries = self.sdk_configuration.retry_config
|
|
1243
|
-
|
|
1244
|
-
retry_config = None
|
|
1245
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1246
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1247
|
-
|
|
1248
|
-
http_res = await self.do_request_async(
|
|
1249
|
-
hook_ctx=HookContext(
|
|
1250
|
-
config=self.sdk_configuration,
|
|
1251
|
-
base_url=base_url or "",
|
|
1252
|
-
operation_id="generic_wrap_eth",
|
|
1253
|
-
oauth2_scopes=[],
|
|
1254
|
-
security_source=self.sdk_configuration.security,
|
|
1255
|
-
),
|
|
1256
|
-
request=req,
|
|
1257
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1258
|
-
retry_config=retry_config,
|
|
1259
|
-
)
|
|
1260
|
-
|
|
1261
|
-
response_data: Any = None
|
|
1262
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1263
|
-
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
1264
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1265
|
-
response_data = utils.unmarshal_json(
|
|
1266
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
1267
|
-
)
|
|
1268
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
1269
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1270
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1271
|
-
raise errors.APIError(
|
|
1272
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1273
|
-
)
|
|
1274
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1275
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1276
|
-
raise errors.APIError(
|
|
1277
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1278
|
-
)
|
|
1279
|
-
|
|
1280
|
-
content_type = http_res.headers.get("Content-Type")
|
|
1281
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1282
|
-
raise errors.APIError(
|
|
1283
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1284
|
-
http_res.status_code,
|
|
1285
|
-
http_res_text,
|
|
1286
|
-
http_res,
|
|
1287
|
-
)
|
|
1288
|
-
|
|
1289
|
-
def unwrap_weth(
|
|
1290
|
-
self,
|
|
1291
|
-
*,
|
|
1292
|
-
amount: Union[
|
|
1293
|
-
models.UnwrapWethRequestAmount, models.UnwrapWethRequestAmountTypedDict
|
|
1294
|
-
],
|
|
1295
|
-
chain: models.Chain,
|
|
1296
|
-
sender: str,
|
|
1297
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1298
|
-
server_url: Optional[str] = None,
|
|
1299
|
-
timeout_ms: Optional[int] = None,
|
|
1300
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1301
|
-
) -> models.TxResponse:
|
|
1302
|
-
r"""Unwrap WETH
|
|
1303
|
-
|
|
1304
|
-
Unwrapping WETH converts the ERC-20 compliant form of ETH back to native ETH that
|
|
1305
|
-
can be used for gas and other native purposes.
|
|
1306
|
-
|
|
1307
|
-
:param amount: The amount of WETH to unwrap.
|
|
1308
|
-
:param chain: The chain to use.
|
|
1309
|
-
:param sender: The address of the transaction sender.
|
|
1310
|
-
:param retries: Override the default retry configuration for this method
|
|
1311
|
-
:param server_url: Override the default server URL for this method
|
|
1312
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1313
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1314
|
-
"""
|
|
1315
|
-
base_url = None
|
|
1316
|
-
url_variables = None
|
|
1317
|
-
if timeout_ms is None:
|
|
1318
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1319
|
-
|
|
1320
|
-
if server_url is not None:
|
|
1321
|
-
base_url = server_url
|
|
1322
|
-
else:
|
|
1323
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1324
|
-
|
|
1325
|
-
request = models.UnwrapWethRequest(
|
|
1326
|
-
amount=amount,
|
|
1327
|
-
chain=chain,
|
|
1328
|
-
sender=sender,
|
|
1329
|
-
)
|
|
1330
|
-
|
|
1331
|
-
req = self._build_request(
|
|
1332
|
-
method="POST",
|
|
1333
|
-
path="/v0/generic/unwrap_weth",
|
|
1334
|
-
base_url=base_url,
|
|
1335
|
-
url_variables=url_variables,
|
|
1336
|
-
request=request,
|
|
1337
|
-
request_body_required=True,
|
|
1338
|
-
request_has_path_params=False,
|
|
1339
|
-
request_has_query_params=True,
|
|
1340
|
-
user_agent_header="user-agent",
|
|
1341
|
-
accept_header_value="application/json",
|
|
1342
|
-
http_headers=http_headers,
|
|
1343
|
-
security=self.sdk_configuration.security,
|
|
1344
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1345
|
-
request, False, False, "json", models.UnwrapWethRequest
|
|
1346
|
-
),
|
|
1347
|
-
timeout_ms=timeout_ms,
|
|
1348
|
-
)
|
|
1349
|
-
|
|
1350
|
-
if retries == UNSET:
|
|
1351
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1352
|
-
retries = self.sdk_configuration.retry_config
|
|
1353
|
-
|
|
1354
|
-
retry_config = None
|
|
1355
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1356
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1357
|
-
|
|
1358
|
-
http_res = self.do_request(
|
|
1359
|
-
hook_ctx=HookContext(
|
|
1360
|
-
config=self.sdk_configuration,
|
|
1361
|
-
base_url=base_url or "",
|
|
1362
|
-
operation_id="generic_unwrap_weth",
|
|
1363
|
-
oauth2_scopes=[],
|
|
1364
|
-
security_source=self.sdk_configuration.security,
|
|
1365
|
-
),
|
|
1366
|
-
request=req,
|
|
1367
|
-
error_status_codes=["422", "4XX", "5XX"],
|
|
1368
|
-
retry_config=retry_config,
|
|
1369
|
-
)
|
|
1370
|
-
|
|
1371
|
-
response_data: Any = None
|
|
1372
|
-
if utils.match_response(http_res, "200", "application/json"):
|
|
1373
|
-
return utils.unmarshal_json(http_res.text, models.TxResponse)
|
|
1374
|
-
if utils.match_response(http_res, "422", "application/json"):
|
|
1375
|
-
response_data = utils.unmarshal_json(
|
|
1376
|
-
http_res.text, errors.HTTPValidationErrorData
|
|
1377
|
-
)
|
|
1378
|
-
raise errors.HTTPValidationError(data=response_data)
|
|
1379
|
-
if utils.match_response(http_res, "4XX", "*"):
|
|
1380
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1381
|
-
raise errors.APIError(
|
|
1382
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1383
|
-
)
|
|
1384
|
-
if utils.match_response(http_res, "5XX", "*"):
|
|
1385
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1386
|
-
raise errors.APIError(
|
|
1387
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1388
|
-
)
|
|
1389
|
-
|
|
1390
|
-
content_type = http_res.headers.get("Content-Type")
|
|
1391
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1392
|
-
raise errors.APIError(
|
|
1393
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1394
|
-
http_res.status_code,
|
|
1395
|
-
http_res_text,
|
|
1396
|
-
http_res,
|
|
1397
|
-
)
|
|
1398
|
-
|
|
1399
|
-
async def unwrap_weth_async(
|
|
1400
|
-
self,
|
|
1401
|
-
*,
|
|
1402
|
-
amount: Union[
|
|
1403
|
-
models.UnwrapWethRequestAmount, models.UnwrapWethRequestAmountTypedDict
|
|
1404
|
-
],
|
|
1405
|
-
chain: models.Chain,
|
|
1406
|
-
sender: str,
|
|
1407
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1408
|
-
server_url: Optional[str] = None,
|
|
1409
|
-
timeout_ms: Optional[int] = None,
|
|
1410
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
|
1411
|
-
) -> models.TxResponse:
|
|
1412
|
-
r"""Unwrap WETH
|
|
1413
|
-
|
|
1414
|
-
Unwrapping WETH converts the ERC-20 compliant form of ETH back to native ETH that
|
|
1415
|
-
can be used for gas and other native purposes.
|
|
1416
|
-
|
|
1417
|
-
:param amount: The amount of WETH to unwrap.
|
|
1418
|
-
:param chain: The chain to use.
|
|
1419
|
-
:param sender: The address of the transaction sender.
|
|
1420
|
-
:param retries: Override the default retry configuration for this method
|
|
1421
|
-
:param server_url: Override the default server URL for this method
|
|
1422
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1423
|
-
:param http_headers: Additional headers to set or replace on requests.
|
|
1424
|
-
"""
|
|
1425
|
-
base_url = None
|
|
1426
|
-
url_variables = None
|
|
1427
|
-
if timeout_ms is None:
|
|
1428
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1429
|
-
|
|
1430
|
-
if server_url is not None:
|
|
1431
|
-
base_url = server_url
|
|
1432
|
-
else:
|
|
1433
|
-
base_url = self._get_url(base_url, url_variables)
|
|
1434
|
-
|
|
1435
|
-
request = models.UnwrapWethRequest(
|
|
1436
|
-
amount=amount,
|
|
1437
|
-
chain=chain,
|
|
1438
|
-
sender=sender,
|
|
1439
|
-
)
|
|
1440
|
-
|
|
1441
|
-
req = self._build_request_async(
|
|
1442
|
-
method="POST",
|
|
1443
|
-
path="/v0/generic/unwrap_weth",
|
|
1444
|
-
base_url=base_url,
|
|
1445
|
-
url_variables=url_variables,
|
|
1446
|
-
request=request,
|
|
1447
|
-
request_body_required=True,
|
|
1448
|
-
request_has_path_params=False,
|
|
1449
|
-
request_has_query_params=True,
|
|
1450
|
-
user_agent_header="user-agent",
|
|
1451
|
-
accept_header_value="application/json",
|
|
1452
|
-
http_headers=http_headers,
|
|
1453
|
-
security=self.sdk_configuration.security,
|
|
1454
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1455
|
-
request, False, False, "json", models.UnwrapWethRequest
|
|
1456
|
-
),
|
|
1457
|
-
timeout_ms=timeout_ms,
|
|
1458
|
-
)
|
|
1459
|
-
|
|
1460
|
-
if retries == UNSET:
|
|
1461
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
|
1462
|
-
retries = self.sdk_configuration.retry_config
|
|
1463
|
-
|
|
1464
|
-
retry_config = None
|
|
1465
|
-
if isinstance(retries, utils.RetryConfig):
|
|
1466
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1467
|
-
|
|
1468
|
-
http_res = await self.do_request_async(
|
|
1469
|
-
hook_ctx=HookContext(
|
|
1470
|
-
config=self.sdk_configuration,
|
|
1471
|
-
base_url=base_url or "",
|
|
1472
|
-
operation_id="generic_unwrap_weth",
|
|
1473
|
-
oauth2_scopes=[],
|
|
750
|
+
operation_id="v1_generic_ens",
|
|
751
|
+
oauth2_scopes=None,
|
|
1474
752
|
security_source=self.sdk_configuration.security,
|
|
1475
753
|
),
|
|
1476
754
|
request=req,
|
|
@@ -1480,38 +758,25 @@ class Universal(BaseSDK):
|
|
|
1480
758
|
|
|
1481
759
|
response_data: Any = None
|
|
1482
760
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1483
|
-
return
|
|
761
|
+
return unmarshal_json_response(models.EnsNameInfoResponse, http_res)
|
|
1484
762
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1485
|
-
response_data =
|
|
1486
|
-
|
|
763
|
+
response_data = unmarshal_json_response(
|
|
764
|
+
errors.HTTPValidationErrorData, http_res
|
|
1487
765
|
)
|
|
1488
|
-
raise errors.HTTPValidationError(
|
|
766
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1489
767
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1490
768
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1491
|
-
raise errors.APIError(
|
|
1492
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1493
|
-
)
|
|
769
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1494
770
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1495
771
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1496
|
-
raise errors.APIError(
|
|
1497
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1498
|
-
)
|
|
772
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1499
773
|
|
|
1500
|
-
|
|
1501
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1502
|
-
raise errors.APIError(
|
|
1503
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1504
|
-
http_res.status_code,
|
|
1505
|
-
http_res_text,
|
|
1506
|
-
http_res,
|
|
1507
|
-
)
|
|
774
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1508
775
|
|
|
1509
|
-
def
|
|
776
|
+
def generic_allowance_set(
|
|
1510
777
|
self,
|
|
1511
778
|
*,
|
|
1512
|
-
token:
|
|
1513
|
-
models.SetAllowanceRequestToken, models.SetAllowanceRequestTokenTypedDict
|
|
1514
|
-
],
|
|
779
|
+
token: str,
|
|
1515
780
|
contract: Union[
|
|
1516
781
|
models.SetAllowanceRequestContractUnion,
|
|
1517
782
|
models.SetAllowanceRequestContractUnionTypedDict,
|
|
@@ -1519,13 +784,14 @@ class Universal(BaseSDK):
|
|
|
1519
784
|
amount: Union[
|
|
1520
785
|
models.SetAllowanceRequestAmount, models.SetAllowanceRequestAmountTypedDict
|
|
1521
786
|
],
|
|
1522
|
-
chain: models.
|
|
787
|
+
chain: models.SetAllowanceRequestChain,
|
|
1523
788
|
sender: str,
|
|
789
|
+
estimate_gas: Optional[bool] = None,
|
|
1524
790
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1525
791
|
server_url: Optional[str] = None,
|
|
1526
792
|
timeout_ms: Optional[int] = None,
|
|
1527
793
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1528
|
-
) -> models.
|
|
794
|
+
) -> models.TransactionResponse:
|
|
1529
795
|
r"""Set Allowance
|
|
1530
796
|
|
|
1531
797
|
This endpoint allows users to modify the token allowance on any ERC-20 token for
|
|
@@ -1540,8 +806,9 @@ class Universal(BaseSDK):
|
|
|
1540
806
|
:param token: The symbol or address of the token for which the allowance is set..
|
|
1541
807
|
:param contract: The name or address of the contract to set spending allowance for.
|
|
1542
808
|
:param amount: The amount to set the allowance to.
|
|
1543
|
-
:param chain:
|
|
809
|
+
:param chain:
|
|
1544
810
|
:param sender: The address of the transaction sender.
|
|
811
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1545
812
|
:param retries: Override the default retry configuration for this method
|
|
1546
813
|
:param server_url: Override the default server URL for this method
|
|
1547
814
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1563,11 +830,12 @@ class Universal(BaseSDK):
|
|
|
1563
830
|
amount=amount,
|
|
1564
831
|
chain=chain,
|
|
1565
832
|
sender=sender,
|
|
833
|
+
estimate_gas=estimate_gas,
|
|
1566
834
|
)
|
|
1567
835
|
|
|
1568
836
|
req = self._build_request(
|
|
1569
837
|
method="POST",
|
|
1570
|
-
path="/
|
|
838
|
+
path="/v1/generic/allowance/set",
|
|
1571
839
|
base_url=base_url,
|
|
1572
840
|
url_variables=url_variables,
|
|
1573
841
|
request=request,
|
|
@@ -1581,6 +849,7 @@ class Universal(BaseSDK):
|
|
|
1581
849
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1582
850
|
request, False, False, "json", models.SetAllowanceRequest
|
|
1583
851
|
),
|
|
852
|
+
allow_empty_value=None,
|
|
1584
853
|
timeout_ms=timeout_ms,
|
|
1585
854
|
)
|
|
1586
855
|
|
|
@@ -1596,8 +865,8 @@ class Universal(BaseSDK):
|
|
|
1596
865
|
hook_ctx=HookContext(
|
|
1597
866
|
config=self.sdk_configuration,
|
|
1598
867
|
base_url=base_url or "",
|
|
1599
|
-
operation_id="
|
|
1600
|
-
oauth2_scopes=
|
|
868
|
+
operation_id="v1_generic_allowance_set",
|
|
869
|
+
oauth2_scopes=None,
|
|
1601
870
|
security_source=self.sdk_configuration.security,
|
|
1602
871
|
),
|
|
1603
872
|
request=req,
|
|
@@ -1607,38 +876,25 @@ class Universal(BaseSDK):
|
|
|
1607
876
|
|
|
1608
877
|
response_data: Any = None
|
|
1609
878
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1610
|
-
return
|
|
879
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1611
880
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1612
|
-
response_data =
|
|
1613
|
-
|
|
881
|
+
response_data = unmarshal_json_response(
|
|
882
|
+
errors.HTTPValidationErrorData, http_res
|
|
1614
883
|
)
|
|
1615
|
-
raise errors.HTTPValidationError(
|
|
884
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1616
885
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1617
886
|
http_res_text = utils.stream_to_text(http_res)
|
|
1618
|
-
raise errors.APIError(
|
|
1619
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1620
|
-
)
|
|
887
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1621
888
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1622
889
|
http_res_text = utils.stream_to_text(http_res)
|
|
1623
|
-
raise errors.APIError(
|
|
1624
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1625
|
-
)
|
|
890
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1626
891
|
|
|
1627
|
-
|
|
1628
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1629
|
-
raise errors.APIError(
|
|
1630
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1631
|
-
http_res.status_code,
|
|
1632
|
-
http_res_text,
|
|
1633
|
-
http_res,
|
|
1634
|
-
)
|
|
892
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1635
893
|
|
|
1636
|
-
async def
|
|
894
|
+
async def generic_allowance_set_async(
|
|
1637
895
|
self,
|
|
1638
896
|
*,
|
|
1639
|
-
token:
|
|
1640
|
-
models.SetAllowanceRequestToken, models.SetAllowanceRequestTokenTypedDict
|
|
1641
|
-
],
|
|
897
|
+
token: str,
|
|
1642
898
|
contract: Union[
|
|
1643
899
|
models.SetAllowanceRequestContractUnion,
|
|
1644
900
|
models.SetAllowanceRequestContractUnionTypedDict,
|
|
@@ -1646,13 +902,14 @@ class Universal(BaseSDK):
|
|
|
1646
902
|
amount: Union[
|
|
1647
903
|
models.SetAllowanceRequestAmount, models.SetAllowanceRequestAmountTypedDict
|
|
1648
904
|
],
|
|
1649
|
-
chain: models.
|
|
905
|
+
chain: models.SetAllowanceRequestChain,
|
|
1650
906
|
sender: str,
|
|
907
|
+
estimate_gas: Optional[bool] = None,
|
|
1651
908
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1652
909
|
server_url: Optional[str] = None,
|
|
1653
910
|
timeout_ms: Optional[int] = None,
|
|
1654
911
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1655
|
-
) -> models.
|
|
912
|
+
) -> models.TransactionResponse:
|
|
1656
913
|
r"""Set Allowance
|
|
1657
914
|
|
|
1658
915
|
This endpoint allows users to modify the token allowance on any ERC-20 token for
|
|
@@ -1667,8 +924,9 @@ class Universal(BaseSDK):
|
|
|
1667
924
|
:param token: The symbol or address of the token for which the allowance is set..
|
|
1668
925
|
:param contract: The name or address of the contract to set spending allowance for.
|
|
1669
926
|
:param amount: The amount to set the allowance to.
|
|
1670
|
-
:param chain:
|
|
927
|
+
:param chain:
|
|
1671
928
|
:param sender: The address of the transaction sender.
|
|
929
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1672
930
|
:param retries: Override the default retry configuration for this method
|
|
1673
931
|
:param server_url: Override the default server URL for this method
|
|
1674
932
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1690,11 +948,12 @@ class Universal(BaseSDK):
|
|
|
1690
948
|
amount=amount,
|
|
1691
949
|
chain=chain,
|
|
1692
950
|
sender=sender,
|
|
951
|
+
estimate_gas=estimate_gas,
|
|
1693
952
|
)
|
|
1694
953
|
|
|
1695
954
|
req = self._build_request_async(
|
|
1696
955
|
method="POST",
|
|
1697
|
-
path="/
|
|
956
|
+
path="/v1/generic/allowance/set",
|
|
1698
957
|
base_url=base_url,
|
|
1699
958
|
url_variables=url_variables,
|
|
1700
959
|
request=request,
|
|
@@ -1708,6 +967,7 @@ class Universal(BaseSDK):
|
|
|
1708
967
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1709
968
|
request, False, False, "json", models.SetAllowanceRequest
|
|
1710
969
|
),
|
|
970
|
+
allow_empty_value=None,
|
|
1711
971
|
timeout_ms=timeout_ms,
|
|
1712
972
|
)
|
|
1713
973
|
|
|
@@ -1723,8 +983,8 @@ class Universal(BaseSDK):
|
|
|
1723
983
|
hook_ctx=HookContext(
|
|
1724
984
|
config=self.sdk_configuration,
|
|
1725
985
|
base_url=base_url or "",
|
|
1726
|
-
operation_id="
|
|
1727
|
-
oauth2_scopes=
|
|
986
|
+
operation_id="v1_generic_allowance_set",
|
|
987
|
+
oauth2_scopes=None,
|
|
1728
988
|
security_source=self.sdk_configuration.security,
|
|
1729
989
|
),
|
|
1730
990
|
request=req,
|
|
@@ -1734,28 +994,17 @@ class Universal(BaseSDK):
|
|
|
1734
994
|
|
|
1735
995
|
response_data: Any = None
|
|
1736
996
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1737
|
-
return
|
|
997
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1738
998
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1739
|
-
response_data =
|
|
1740
|
-
|
|
999
|
+
response_data = unmarshal_json_response(
|
|
1000
|
+
errors.HTTPValidationErrorData, http_res
|
|
1741
1001
|
)
|
|
1742
|
-
raise errors.HTTPValidationError(
|
|
1002
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1743
1003
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1744
1004
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1745
|
-
raise errors.APIError(
|
|
1746
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1747
|
-
)
|
|
1005
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1748
1006
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1749
1007
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1750
|
-
raise errors.APIError(
|
|
1751
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1752
|
-
)
|
|
1008
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1753
1009
|
|
|
1754
|
-
|
|
1755
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1756
|
-
raise errors.APIError(
|
|
1757
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1758
|
-
http_res.status_code,
|
|
1759
|
-
http_res_text,
|
|
1760
|
-
http_res,
|
|
1761
|
-
)
|
|
1010
|
+
raise errors.APIError("Unexpected response received", http_res)
|