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/basesdk.py
CHANGED
|
@@ -15,9 +15,19 @@ from urllib.parse import parse_qs, urlparse
|
|
|
15
15
|
|
|
16
16
|
class BaseSDK:
|
|
17
17
|
sdk_configuration: SDKConfiguration
|
|
18
|
+
parent_ref: Optional[object] = None
|
|
19
|
+
"""
|
|
20
|
+
Reference to the root SDK instance, if any. This will prevent it from
|
|
21
|
+
being garbage collected while there are active streams.
|
|
22
|
+
"""
|
|
18
23
|
|
|
19
|
-
def __init__(
|
|
24
|
+
def __init__(
|
|
25
|
+
self,
|
|
26
|
+
sdk_config: SDKConfiguration,
|
|
27
|
+
parent_ref: Optional[object] = None,
|
|
28
|
+
) -> None:
|
|
20
29
|
self.sdk_configuration = sdk_config
|
|
30
|
+
self.parent_ref = parent_ref
|
|
21
31
|
|
|
22
32
|
def _get_url(self, base_url, url_variables):
|
|
23
33
|
sdk_url, sdk_variables = self.sdk_configuration.get_server_details()
|
|
@@ -50,6 +60,7 @@ class BaseSDK:
|
|
|
50
60
|
] = None,
|
|
51
61
|
url_override: Optional[str] = None,
|
|
52
62
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
63
|
+
allow_empty_value: Optional[List[str]] = None,
|
|
53
64
|
) -> httpx.Request:
|
|
54
65
|
client = self.sdk_configuration.async_client
|
|
55
66
|
return self._build_request_with_client(
|
|
@@ -70,6 +81,7 @@ class BaseSDK:
|
|
|
70
81
|
get_serialized_body,
|
|
71
82
|
url_override,
|
|
72
83
|
http_headers,
|
|
84
|
+
allow_empty_value,
|
|
73
85
|
)
|
|
74
86
|
|
|
75
87
|
def _build_request(
|
|
@@ -92,6 +104,7 @@ class BaseSDK:
|
|
|
92
104
|
] = None,
|
|
93
105
|
url_override: Optional[str] = None,
|
|
94
106
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
107
|
+
allow_empty_value: Optional[List[str]] = None,
|
|
95
108
|
) -> httpx.Request:
|
|
96
109
|
client = self.sdk_configuration.client
|
|
97
110
|
return self._build_request_with_client(
|
|
@@ -112,6 +125,7 @@ class BaseSDK:
|
|
|
112
125
|
get_serialized_body,
|
|
113
126
|
url_override,
|
|
114
127
|
http_headers,
|
|
128
|
+
allow_empty_value,
|
|
115
129
|
)
|
|
116
130
|
|
|
117
131
|
def _build_request_with_client(
|
|
@@ -135,6 +149,7 @@ class BaseSDK:
|
|
|
135
149
|
] = None,
|
|
136
150
|
url_override: Optional[str] = None,
|
|
137
151
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
152
|
+
allow_empty_value: Optional[List[str]] = None,
|
|
138
153
|
) -> httpx.Request:
|
|
139
154
|
query_params = {}
|
|
140
155
|
|
|
@@ -150,6 +165,7 @@ class BaseSDK:
|
|
|
150
165
|
query_params = utils.get_query_params(
|
|
151
166
|
request if request_has_query_params else None,
|
|
152
167
|
_globals if request_has_query_params else None,
|
|
168
|
+
allow_empty_value,
|
|
153
169
|
)
|
|
154
170
|
else:
|
|
155
171
|
# Pick up the query parameter from the override so they can be
|
|
@@ -244,7 +260,7 @@ class BaseSDK:
|
|
|
244
260
|
|
|
245
261
|
if http_res is None:
|
|
246
262
|
logger.debug("Raising no response SDK error")
|
|
247
|
-
raise errors.
|
|
263
|
+
raise errors.NoResponseError("No response received")
|
|
248
264
|
|
|
249
265
|
logger.debug(
|
|
250
266
|
"Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
@@ -265,7 +281,7 @@ class BaseSDK:
|
|
|
265
281
|
http_res = result
|
|
266
282
|
else:
|
|
267
283
|
logger.debug("Raising unexpected SDK error")
|
|
268
|
-
raise errors.APIError("Unexpected error occurred")
|
|
284
|
+
raise errors.APIError("Unexpected error occurred", http_res)
|
|
269
285
|
|
|
270
286
|
return http_res
|
|
271
287
|
|
|
@@ -316,7 +332,7 @@ class BaseSDK:
|
|
|
316
332
|
|
|
317
333
|
if http_res is None:
|
|
318
334
|
logger.debug("Raising no response SDK error")
|
|
319
|
-
raise errors.
|
|
335
|
+
raise errors.NoResponseError("No response received")
|
|
320
336
|
|
|
321
337
|
logger.debug(
|
|
322
338
|
"Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
@@ -337,7 +353,7 @@ class BaseSDK:
|
|
|
337
353
|
http_res = result
|
|
338
354
|
else:
|
|
339
355
|
logger.debug("Raising unexpected SDK error")
|
|
340
|
-
raise errors.APIError("Unexpected error occurred")
|
|
356
|
+
raise errors.APIError("Unexpected error occurred", http_res)
|
|
341
357
|
|
|
342
358
|
return http_res
|
|
343
359
|
|
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from compass_api_sdk import errors, models, utils
|
|
5
|
+
from compass_api_sdk._hooks import HookContext
|
|
6
|
+
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
8
|
+
from typing import Any, Mapping, Optional, Union
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Bridge(BaseSDK):
|
|
12
|
+
def cctp_burn(
|
|
13
|
+
self,
|
|
14
|
+
*,
|
|
15
|
+
owner: str,
|
|
16
|
+
chain: models.DepositForBurnRequestChain,
|
|
17
|
+
amount: Union[
|
|
18
|
+
models.DepositForBurnRequestAmount,
|
|
19
|
+
models.DepositForBurnRequestAmountTypedDict,
|
|
20
|
+
],
|
|
21
|
+
destination_chain: models.DestinationChain,
|
|
22
|
+
gas_sponsorship: Optional[bool] = None,
|
|
23
|
+
transfer_mode: Optional[models.DepositForBurnRequestTransferMode] = None,
|
|
24
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
25
|
+
server_url: Optional[str] = None,
|
|
26
|
+
timeout_ms: Optional[int] = None,
|
|
27
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
28
|
+
) -> models.DepositForBurnResponse:
|
|
29
|
+
r"""Initiate USDC bridging
|
|
30
|
+
|
|
31
|
+
Bridge USDC to any chain for any Product account using Circle's CCTP Protocol.
|
|
32
|
+
|
|
33
|
+
**Transfer modes:**
|
|
34
|
+
- `standard` (default): ~15-19 minute transfers, **free** (no fee)
|
|
35
|
+
- `fast`: ~30 second transfers, requires a small fee (typically ~0.01%)
|
|
36
|
+
|
|
37
|
+
The fee for fast mode is automatically calculated based on Circle's current rates.
|
|
38
|
+
|
|
39
|
+
**Flow:**
|
|
40
|
+
1. Call this endpoint with `gas_sponsorship=false` to get an unsigned transaction,
|
|
41
|
+
or `gas_sponsorship=true` to get EIP-712 typed data for gas-sponsored execution
|
|
42
|
+
2. Owner signs the transaction or typed data
|
|
43
|
+
3. Broadcast the transaction on the source chain (or submit to `/gas_sponsorship/prepare`)
|
|
44
|
+
4. Wait for Circle's attestation service to attest the burn
|
|
45
|
+
5. Call the mint endpoint to receive USDC on the destination chain
|
|
46
|
+
|
|
47
|
+
**Supported chains:**
|
|
48
|
+
- Ethereum (domain 0)
|
|
49
|
+
- Arbitrum (domain 3)
|
|
50
|
+
- Base (domain 6)
|
|
51
|
+
|
|
52
|
+
**Note:** The USDC must already be deposited in the Product Account. If approval is needed
|
|
53
|
+
for the TokenMessengerV2 contract, it will be included in the transaction automatically.
|
|
54
|
+
|
|
55
|
+
:param owner: The primary wallet address that owns and controls the Product Account.
|
|
56
|
+
:param chain: The source chain where USDC will be burned.
|
|
57
|
+
:param amount: The amount of USDC to bridge (in token units, e.g., 100.5 for 100.5 USDC).
|
|
58
|
+
:param destination_chain: The destination chain where USDC will be minted.
|
|
59
|
+
:param gas_sponsorship: Optionally request gas sponsorship. If set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
|
|
60
|
+
:param transfer_mode: Transfer speed mode. 'fast': ~30 second transfers using confirmed finality (requires a small fee taken from transfer amount). 'standard': ~15-19 minute transfers using full finality (free, no fee). Default is 'standard'.
|
|
61
|
+
:param retries: Override the default retry configuration for this method
|
|
62
|
+
:param server_url: Override the default server URL for this method
|
|
63
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
64
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
65
|
+
"""
|
|
66
|
+
base_url = None
|
|
67
|
+
url_variables = None
|
|
68
|
+
if timeout_ms is None:
|
|
69
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
70
|
+
|
|
71
|
+
if server_url is not None:
|
|
72
|
+
base_url = server_url
|
|
73
|
+
else:
|
|
74
|
+
base_url = self._get_url(base_url, url_variables)
|
|
75
|
+
|
|
76
|
+
request = models.DepositForBurnRequest(
|
|
77
|
+
owner=owner,
|
|
78
|
+
chain=chain,
|
|
79
|
+
amount=amount,
|
|
80
|
+
destination_chain=destination_chain,
|
|
81
|
+
gas_sponsorship=gas_sponsorship,
|
|
82
|
+
transfer_mode=transfer_mode,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
req = self._build_request(
|
|
86
|
+
method="POST",
|
|
87
|
+
path="/v2/cctp/burn",
|
|
88
|
+
base_url=base_url,
|
|
89
|
+
url_variables=url_variables,
|
|
90
|
+
request=request,
|
|
91
|
+
request_body_required=True,
|
|
92
|
+
request_has_path_params=False,
|
|
93
|
+
request_has_query_params=True,
|
|
94
|
+
user_agent_header="user-agent",
|
|
95
|
+
accept_header_value="application/json",
|
|
96
|
+
http_headers=http_headers,
|
|
97
|
+
security=self.sdk_configuration.security,
|
|
98
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
99
|
+
request, False, False, "json", models.DepositForBurnRequest
|
|
100
|
+
),
|
|
101
|
+
allow_empty_value=None,
|
|
102
|
+
timeout_ms=timeout_ms,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
if retries == UNSET:
|
|
106
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
107
|
+
retries = self.sdk_configuration.retry_config
|
|
108
|
+
|
|
109
|
+
retry_config = None
|
|
110
|
+
if isinstance(retries, utils.RetryConfig):
|
|
111
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
112
|
+
|
|
113
|
+
http_res = self.do_request(
|
|
114
|
+
hook_ctx=HookContext(
|
|
115
|
+
config=self.sdk_configuration,
|
|
116
|
+
base_url=base_url or "",
|
|
117
|
+
operation_id="v2_cctp_burn",
|
|
118
|
+
oauth2_scopes=None,
|
|
119
|
+
security_source=self.sdk_configuration.security,
|
|
120
|
+
),
|
|
121
|
+
request=req,
|
|
122
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
123
|
+
retry_config=retry_config,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
response_data: Any = None
|
|
127
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
128
|
+
return unmarshal_json_response(models.DepositForBurnResponse, http_res)
|
|
129
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
130
|
+
response_data = unmarshal_json_response(
|
|
131
|
+
errors.HTTPValidationErrorData, http_res
|
|
132
|
+
)
|
|
133
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
134
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
135
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
136
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
137
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
138
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
139
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
140
|
+
|
|
141
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
142
|
+
|
|
143
|
+
async def cctp_burn_async(
|
|
144
|
+
self,
|
|
145
|
+
*,
|
|
146
|
+
owner: str,
|
|
147
|
+
chain: models.DepositForBurnRequestChain,
|
|
148
|
+
amount: Union[
|
|
149
|
+
models.DepositForBurnRequestAmount,
|
|
150
|
+
models.DepositForBurnRequestAmountTypedDict,
|
|
151
|
+
],
|
|
152
|
+
destination_chain: models.DestinationChain,
|
|
153
|
+
gas_sponsorship: Optional[bool] = None,
|
|
154
|
+
transfer_mode: Optional[models.DepositForBurnRequestTransferMode] = None,
|
|
155
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
156
|
+
server_url: Optional[str] = None,
|
|
157
|
+
timeout_ms: Optional[int] = None,
|
|
158
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
159
|
+
) -> models.DepositForBurnResponse:
|
|
160
|
+
r"""Initiate USDC bridging
|
|
161
|
+
|
|
162
|
+
Bridge USDC to any chain for any Product account using Circle's CCTP Protocol.
|
|
163
|
+
|
|
164
|
+
**Transfer modes:**
|
|
165
|
+
- `standard` (default): ~15-19 minute transfers, **free** (no fee)
|
|
166
|
+
- `fast`: ~30 second transfers, requires a small fee (typically ~0.01%)
|
|
167
|
+
|
|
168
|
+
The fee for fast mode is automatically calculated based on Circle's current rates.
|
|
169
|
+
|
|
170
|
+
**Flow:**
|
|
171
|
+
1. Call this endpoint with `gas_sponsorship=false` to get an unsigned transaction,
|
|
172
|
+
or `gas_sponsorship=true` to get EIP-712 typed data for gas-sponsored execution
|
|
173
|
+
2. Owner signs the transaction or typed data
|
|
174
|
+
3. Broadcast the transaction on the source chain (or submit to `/gas_sponsorship/prepare`)
|
|
175
|
+
4. Wait for Circle's attestation service to attest the burn
|
|
176
|
+
5. Call the mint endpoint to receive USDC on the destination chain
|
|
177
|
+
|
|
178
|
+
**Supported chains:**
|
|
179
|
+
- Ethereum (domain 0)
|
|
180
|
+
- Arbitrum (domain 3)
|
|
181
|
+
- Base (domain 6)
|
|
182
|
+
|
|
183
|
+
**Note:** The USDC must already be deposited in the Product Account. If approval is needed
|
|
184
|
+
for the TokenMessengerV2 contract, it will be included in the transaction automatically.
|
|
185
|
+
|
|
186
|
+
:param owner: The primary wallet address that owns and controls the Product Account.
|
|
187
|
+
:param chain: The source chain where USDC will be burned.
|
|
188
|
+
:param amount: The amount of USDC to bridge (in token units, e.g., 100.5 for 100.5 USDC).
|
|
189
|
+
:param destination_chain: The destination chain where USDC will be minted.
|
|
190
|
+
:param gas_sponsorship: Optionally request gas sponsorship. If set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
|
|
191
|
+
:param transfer_mode: Transfer speed mode. 'fast': ~30 second transfers using confirmed finality (requires a small fee taken from transfer amount). 'standard': ~15-19 minute transfers using full finality (free, no fee). Default is 'standard'.
|
|
192
|
+
:param retries: Override the default retry configuration for this method
|
|
193
|
+
:param server_url: Override the default server URL for this method
|
|
194
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
195
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
196
|
+
"""
|
|
197
|
+
base_url = None
|
|
198
|
+
url_variables = None
|
|
199
|
+
if timeout_ms is None:
|
|
200
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
201
|
+
|
|
202
|
+
if server_url is not None:
|
|
203
|
+
base_url = server_url
|
|
204
|
+
else:
|
|
205
|
+
base_url = self._get_url(base_url, url_variables)
|
|
206
|
+
|
|
207
|
+
request = models.DepositForBurnRequest(
|
|
208
|
+
owner=owner,
|
|
209
|
+
chain=chain,
|
|
210
|
+
amount=amount,
|
|
211
|
+
destination_chain=destination_chain,
|
|
212
|
+
gas_sponsorship=gas_sponsorship,
|
|
213
|
+
transfer_mode=transfer_mode,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
req = self._build_request_async(
|
|
217
|
+
method="POST",
|
|
218
|
+
path="/v2/cctp/burn",
|
|
219
|
+
base_url=base_url,
|
|
220
|
+
url_variables=url_variables,
|
|
221
|
+
request=request,
|
|
222
|
+
request_body_required=True,
|
|
223
|
+
request_has_path_params=False,
|
|
224
|
+
request_has_query_params=True,
|
|
225
|
+
user_agent_header="user-agent",
|
|
226
|
+
accept_header_value="application/json",
|
|
227
|
+
http_headers=http_headers,
|
|
228
|
+
security=self.sdk_configuration.security,
|
|
229
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
230
|
+
request, False, False, "json", models.DepositForBurnRequest
|
|
231
|
+
),
|
|
232
|
+
allow_empty_value=None,
|
|
233
|
+
timeout_ms=timeout_ms,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
if retries == UNSET:
|
|
237
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
238
|
+
retries = self.sdk_configuration.retry_config
|
|
239
|
+
|
|
240
|
+
retry_config = None
|
|
241
|
+
if isinstance(retries, utils.RetryConfig):
|
|
242
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
243
|
+
|
|
244
|
+
http_res = await self.do_request_async(
|
|
245
|
+
hook_ctx=HookContext(
|
|
246
|
+
config=self.sdk_configuration,
|
|
247
|
+
base_url=base_url or "",
|
|
248
|
+
operation_id="v2_cctp_burn",
|
|
249
|
+
oauth2_scopes=None,
|
|
250
|
+
security_source=self.sdk_configuration.security,
|
|
251
|
+
),
|
|
252
|
+
request=req,
|
|
253
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
254
|
+
retry_config=retry_config,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
response_data: Any = None
|
|
258
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
259
|
+
return unmarshal_json_response(models.DepositForBurnResponse, http_res)
|
|
260
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
261
|
+
response_data = unmarshal_json_response(
|
|
262
|
+
errors.HTTPValidationErrorData, http_res
|
|
263
|
+
)
|
|
264
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
265
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
266
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
267
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
268
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
269
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
270
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
271
|
+
|
|
272
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
273
|
+
|
|
274
|
+
def cctp_mint(
|
|
275
|
+
self,
|
|
276
|
+
*,
|
|
277
|
+
bridge_id: str,
|
|
278
|
+
burn_tx_hash: str,
|
|
279
|
+
sender: str,
|
|
280
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
281
|
+
server_url: Optional[str] = None,
|
|
282
|
+
timeout_ms: Optional[int] = None,
|
|
283
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
284
|
+
) -> models.V2CctpMintResponse:
|
|
285
|
+
r"""Complete USDC bridging
|
|
286
|
+
|
|
287
|
+
Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
288
|
+
destination chain.
|
|
289
|
+
|
|
290
|
+
**How it works:**
|
|
291
|
+
|
|
292
|
+
This endpoint uses the `bridge_id` from `/burn` to:
|
|
293
|
+
1. Look up the bridge session
|
|
294
|
+
2. Check if Circle's attestation is ready
|
|
295
|
+
3. Depending on the status of the attestation return the following:
|
|
296
|
+
- if attestation is still pending, return URLs for real-time updates
|
|
297
|
+
- if attestation is ready, return a transaction to complete the bridging process
|
|
298
|
+
- if the minting for a given `bridge_id` has been completed, informs with `completed` status
|
|
299
|
+
|
|
300
|
+
**Request parameters:**
|
|
301
|
+
|
|
302
|
+
- `bridge_id`: The bridge ID returned from `/burn`
|
|
303
|
+
- `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
304
|
+
|
|
305
|
+
**Response codes:**
|
|
306
|
+
|
|
307
|
+
- **200 OK**: Attestation is ready, mint transaction is included
|
|
308
|
+
- **202 Accepted**: Attestation is pending, SSE URL for real-time updates is included (The real-time update endpoints are in progress)
|
|
309
|
+
- **404 Not found**: Bridge not found
|
|
310
|
+
|
|
311
|
+
**After receiving 202:**
|
|
312
|
+
|
|
313
|
+
Either:
|
|
314
|
+
- Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event (The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team)
|
|
315
|
+
- Poll this endpoint periodically until you get 200
|
|
316
|
+
|
|
317
|
+
:param bridge_id: The bridge identifier returned from /burn endpoint. This is used to look up the bridge session.
|
|
318
|
+
:param burn_tx_hash: The transaction hash of the burn transaction on the source chain. This is used to find the DepositForBurn event and extract the CCTP message.
|
|
319
|
+
:param sender: The wallet address that will sign and send the mint transaction. This can be any wallet, the receiver of the minted USDC is not determined by this sender.
|
|
320
|
+
:param retries: Override the default retry configuration for this method
|
|
321
|
+
:param server_url: Override the default server URL for this method
|
|
322
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
323
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
324
|
+
"""
|
|
325
|
+
base_url = None
|
|
326
|
+
url_variables = None
|
|
327
|
+
if timeout_ms is None:
|
|
328
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
329
|
+
|
|
330
|
+
if server_url is not None:
|
|
331
|
+
base_url = server_url
|
|
332
|
+
else:
|
|
333
|
+
base_url = self._get_url(base_url, url_variables)
|
|
334
|
+
|
|
335
|
+
request = models.MintPrepareRequest(
|
|
336
|
+
bridge_id=bridge_id,
|
|
337
|
+
burn_tx_hash=burn_tx_hash,
|
|
338
|
+
sender=sender,
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
req = self._build_request(
|
|
342
|
+
method="POST",
|
|
343
|
+
path="/v2/cctp/mint",
|
|
344
|
+
base_url=base_url,
|
|
345
|
+
url_variables=url_variables,
|
|
346
|
+
request=request,
|
|
347
|
+
request_body_required=True,
|
|
348
|
+
request_has_path_params=False,
|
|
349
|
+
request_has_query_params=True,
|
|
350
|
+
user_agent_header="user-agent",
|
|
351
|
+
accept_header_value="application/json",
|
|
352
|
+
http_headers=http_headers,
|
|
353
|
+
security=self.sdk_configuration.security,
|
|
354
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
355
|
+
request, False, False, "json", models.MintPrepareRequest
|
|
356
|
+
),
|
|
357
|
+
allow_empty_value=None,
|
|
358
|
+
timeout_ms=timeout_ms,
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
if retries == UNSET:
|
|
362
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
363
|
+
retries = self.sdk_configuration.retry_config
|
|
364
|
+
|
|
365
|
+
retry_config = None
|
|
366
|
+
if isinstance(retries, utils.RetryConfig):
|
|
367
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
368
|
+
|
|
369
|
+
http_res = self.do_request(
|
|
370
|
+
hook_ctx=HookContext(
|
|
371
|
+
config=self.sdk_configuration,
|
|
372
|
+
base_url=base_url or "",
|
|
373
|
+
operation_id="v2_cctp_mint",
|
|
374
|
+
oauth2_scopes=None,
|
|
375
|
+
security_source=self.sdk_configuration.security,
|
|
376
|
+
),
|
|
377
|
+
request=req,
|
|
378
|
+
error_status_codes=["404", "422", "4XX", "5XX"],
|
|
379
|
+
retry_config=retry_config,
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
response_data: Any = None
|
|
383
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
384
|
+
return unmarshal_json_response(models.Response200V2CctpMint, http_res)
|
|
385
|
+
if utils.match_response(http_res, "202", "application/json"):
|
|
386
|
+
return unmarshal_json_response(models.MintPreparePendingResponse, http_res)
|
|
387
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
388
|
+
response_data = unmarshal_json_response(
|
|
389
|
+
errors.MintPrepareNotFoundResponseErrorData, http_res
|
|
390
|
+
)
|
|
391
|
+
raise errors.MintPrepareNotFoundResponseError(response_data, http_res)
|
|
392
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
393
|
+
response_data = unmarshal_json_response(
|
|
394
|
+
errors.HTTPValidationErrorData, http_res
|
|
395
|
+
)
|
|
396
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
397
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
398
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
399
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
400
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
401
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
402
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
403
|
+
|
|
404
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
405
|
+
|
|
406
|
+
async def cctp_mint_async(
|
|
407
|
+
self,
|
|
408
|
+
*,
|
|
409
|
+
bridge_id: str,
|
|
410
|
+
burn_tx_hash: str,
|
|
411
|
+
sender: str,
|
|
412
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
413
|
+
server_url: Optional[str] = None,
|
|
414
|
+
timeout_ms: Optional[int] = None,
|
|
415
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
416
|
+
) -> models.V2CctpMintResponse:
|
|
417
|
+
r"""Complete USDC bridging
|
|
418
|
+
|
|
419
|
+
Prepare a receiveMessage transaction to mint USDC to any Product Account on the
|
|
420
|
+
destination chain.
|
|
421
|
+
|
|
422
|
+
**How it works:**
|
|
423
|
+
|
|
424
|
+
This endpoint uses the `bridge_id` from `/burn` to:
|
|
425
|
+
1. Look up the bridge session
|
|
426
|
+
2. Check if Circle's attestation is ready
|
|
427
|
+
3. Depending on the status of the attestation return the following:
|
|
428
|
+
- if attestation is still pending, return URLs for real-time updates
|
|
429
|
+
- if attestation is ready, return a transaction to complete the bridging process
|
|
430
|
+
- if the minting for a given `bridge_id` has been completed, informs with `completed` status
|
|
431
|
+
|
|
432
|
+
**Request parameters:**
|
|
433
|
+
|
|
434
|
+
- `bridge_id`: The bridge ID returned from `/burn`
|
|
435
|
+
- `burn_tx_hash`: The transaction hash of the burn transaction on the source chain
|
|
436
|
+
|
|
437
|
+
**Response codes:**
|
|
438
|
+
|
|
439
|
+
- **200 OK**: Attestation is ready, mint transaction is included
|
|
440
|
+
- **202 Accepted**: Attestation is pending, SSE URL for real-time updates is included (The real-time update endpoints are in progress)
|
|
441
|
+
- **404 Not found**: Bridge not found
|
|
442
|
+
|
|
443
|
+
**After receiving 202:**
|
|
444
|
+
|
|
445
|
+
Either:
|
|
446
|
+
- Connect to the SSE stream at `sse_url` and wait for `attestation_ready` event (The SSE stream and status endpoint are in progress. Keep an eye on the updates from our team)
|
|
447
|
+
- Poll this endpoint periodically until you get 200
|
|
448
|
+
|
|
449
|
+
:param bridge_id: The bridge identifier returned from /burn endpoint. This is used to look up the bridge session.
|
|
450
|
+
:param burn_tx_hash: The transaction hash of the burn transaction on the source chain. This is used to find the DepositForBurn event and extract the CCTP message.
|
|
451
|
+
:param sender: The wallet address that will sign and send the mint transaction. This can be any wallet, the receiver of the minted USDC is not determined by this sender.
|
|
452
|
+
:param retries: Override the default retry configuration for this method
|
|
453
|
+
:param server_url: Override the default server URL for this method
|
|
454
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
455
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
456
|
+
"""
|
|
457
|
+
base_url = None
|
|
458
|
+
url_variables = None
|
|
459
|
+
if timeout_ms is None:
|
|
460
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
461
|
+
|
|
462
|
+
if server_url is not None:
|
|
463
|
+
base_url = server_url
|
|
464
|
+
else:
|
|
465
|
+
base_url = self._get_url(base_url, url_variables)
|
|
466
|
+
|
|
467
|
+
request = models.MintPrepareRequest(
|
|
468
|
+
bridge_id=bridge_id,
|
|
469
|
+
burn_tx_hash=burn_tx_hash,
|
|
470
|
+
sender=sender,
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
req = self._build_request_async(
|
|
474
|
+
method="POST",
|
|
475
|
+
path="/v2/cctp/mint",
|
|
476
|
+
base_url=base_url,
|
|
477
|
+
url_variables=url_variables,
|
|
478
|
+
request=request,
|
|
479
|
+
request_body_required=True,
|
|
480
|
+
request_has_path_params=False,
|
|
481
|
+
request_has_query_params=True,
|
|
482
|
+
user_agent_header="user-agent",
|
|
483
|
+
accept_header_value="application/json",
|
|
484
|
+
http_headers=http_headers,
|
|
485
|
+
security=self.sdk_configuration.security,
|
|
486
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
487
|
+
request, False, False, "json", models.MintPrepareRequest
|
|
488
|
+
),
|
|
489
|
+
allow_empty_value=None,
|
|
490
|
+
timeout_ms=timeout_ms,
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
if retries == UNSET:
|
|
494
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
495
|
+
retries = self.sdk_configuration.retry_config
|
|
496
|
+
|
|
497
|
+
retry_config = None
|
|
498
|
+
if isinstance(retries, utils.RetryConfig):
|
|
499
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
500
|
+
|
|
501
|
+
http_res = await self.do_request_async(
|
|
502
|
+
hook_ctx=HookContext(
|
|
503
|
+
config=self.sdk_configuration,
|
|
504
|
+
base_url=base_url or "",
|
|
505
|
+
operation_id="v2_cctp_mint",
|
|
506
|
+
oauth2_scopes=None,
|
|
507
|
+
security_source=self.sdk_configuration.security,
|
|
508
|
+
),
|
|
509
|
+
request=req,
|
|
510
|
+
error_status_codes=["404", "422", "4XX", "5XX"],
|
|
511
|
+
retry_config=retry_config,
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
response_data: Any = None
|
|
515
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
516
|
+
return unmarshal_json_response(models.Response200V2CctpMint, http_res)
|
|
517
|
+
if utils.match_response(http_res, "202", "application/json"):
|
|
518
|
+
return unmarshal_json_response(models.MintPreparePendingResponse, http_res)
|
|
519
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
520
|
+
response_data = unmarshal_json_response(
|
|
521
|
+
errors.MintPrepareNotFoundResponseErrorData, http_res
|
|
522
|
+
)
|
|
523
|
+
raise errors.MintPrepareNotFoundResponseError(response_data, http_res)
|
|
524
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
525
|
+
response_data = unmarshal_json_response(
|
|
526
|
+
errors.HTTPValidationErrorData, http_res
|
|
527
|
+
)
|
|
528
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
529
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
530
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
531
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
532
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
533
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
534
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
535
|
+
|
|
536
|
+
raise errors.APIError("Unexpected response received", http_res)
|