compass_api_sdk 1.1.1__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 +386 -114
- compass_api_sdk/aerodrome_slipstream.py +104 -54
- compass_api_sdk/basesdk.py +6 -0
- compass_api_sdk/bridge.py +536 -0
- compass_api_sdk/earn.py +1780 -0
- compass_api_sdk/erc_4626_vaults.py +28 -10
- compass_api_sdk/errors/__init__.py +8 -0
- compass_api_sdk/errors/apierror.py +1 -1
- compass_api_sdk/errors/compassapierror.py +1 -1
- compass_api_sdk/errors/httpvalidationerror.py +1 -1
- compass_api_sdk/errors/mintpreparenotfoundresponse_error.py +49 -0
- compass_api_sdk/errors/no_response_error.py +1 -1
- compass_api_sdk/errors/responsevalidationerror.py +1 -1
- compass_api_sdk/ethena.py +36 -10
- compass_api_sdk/gas_sponsorship.py +446 -0
- compass_api_sdk/httpclient.py +0 -1
- compass_api_sdk/models/__init__.py +764 -392
- compass_api_sdk/models/aaveborrowparams.py +4 -13
- compass_api_sdk/models/aaveborrowrequest.py +10 -14
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +3 -3
- compass_api_sdk/models/aavelooprequest.py +32 -28
- compass_api_sdk/models/aaveposition.py +49 -0
- compass_api_sdk/models/aaverepayparams.py +4 -13
- compass_api_sdk/models/aaverepayrequest.py +10 -14
- 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 +10 -14
- compass_api_sdk/models/aavevenue.py +27 -0
- compass_api_sdk/models/aavewithdrawparams.py +4 -13
- compass_api_sdk/models/aavewithdrawrequest.py +10 -14
- 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 +14 -26
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +14 -26
- compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +13 -25
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/approvetransferrequest.py +32 -0
- compass_api_sdk/models/approvetransferresponse.py +52 -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 +15 -4
- 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_market_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_models_morpho_read_response_get_vaults_vaultstate.py → compass_api_backend_v1_models_morpho_read_response_get_vaults_vaultstate.py} +4 -2
- compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_market_userposition.py → compass_api_backend_v1_models_pendle_read_response_market_userposition.py} +2 -2
- 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_models_vaults_read_response_vault_userposition.py → compass_api_backend_v1_models_vaults_read_response_vault_userposition.py} +2 -2
- 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/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/earnmanageparams.py +74 -0
- compass_api_sdk/models/earnmanagerequest.py +130 -0
- compass_api_sdk/models/earnmanageresponse.py +52 -0
- 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/ethenadepositrequest.py +6 -1
- compass_api_sdk/models/ethenagetvaultresponse.py +5 -5
- compass_api_sdk/models/ethenarequesttowithdrawrequest.py +6 -1
- compass_api_sdk/models/ethenaunstakerequest.py +6 -1
- 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 +6 -1
- compass_api_sdk/models/morphocheckuserpositionresponse.py +9 -3
- compass_api_sdk/models/morphodepositrequest.py +6 -1
- compass_api_sdk/models/morphogetmarketresponse.py +72 -31
- compass_api_sdk/models/morphomarket.py +26 -20
- compass_api_sdk/models/morphorepayrequest.py +11 -1
- compass_api_sdk/models/morphosupplycollateralrequest.py +11 -1
- compass_api_sdk/models/morphovault.py +10 -10
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +6 -1
- compass_api_sdk/models/morphowithdrawrequest.py +6 -1
- compass_api_sdk/models/multicallexecuterequest.py +7 -2
- compass_api_sdk/models/odosswapparams.py +9 -30
- compass_api_sdk/models/odosswaprequest.py +15 -33
- 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 +5 -5
- compass_api_sdk/models/pendlemanageliquidityparams.py +2 -15
- compass_api_sdk/models/pendlemanageliquidityrequest.py +8 -16
- compass_api_sdk/models/pendleredeemyieldrequest.py +6 -1
- compass_api_sdk/models/pendletradeptparams.py +2 -15
- compass_api_sdk/models/pendletradeptrequest.py +8 -16
- compass_api_sdk/models/pendletradeytparams.py +2 -15
- compass_api_sdk/models/pendletradeytrequest.py +8 -16
- 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/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 +3 -16
- compass_api_sdk/models/setallowancerequest.py +9 -17
- compass_api_sdk/models/skybuyrequest.py +6 -1
- compass_api_sdk/models/skydepositrequest.py +7 -2
- compass_api_sdk/models/skysellrequest.py +7 -2
- compass_api_sdk/models/skywithdrawrequest.py +7 -2
- compass_api_sdk/models/sponsorgasrequest.py +71 -0
- compass_api_sdk/models/sponsorgasresponse.py +14 -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 +2 -15
- compass_api_sdk/models/tokentransferrequest.py +8 -16
- compass_api_sdk/models/uniswapbuyexactlyparams.py +8 -33
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +14 -34
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +14 -26
- compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
- compass_api_sdk/models/uniswapsellexactlyparams.py +4 -29
- compass_api_sdk/models/uniswapsellexactlyrequest.py +10 -30
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +6 -1
- compass_api_sdk/models/unsignedmulticalltransaction.py +34 -3
- compass_api_sdk/models/unsignedtransaction.py +34 -3
- compass_api_sdk/models/unwrapwethrequest.py +6 -1
- compass_api_sdk/models/useroperation.py +33 -24
- compass_api_sdk/models/v1_aave_aave_supported_tokensop.py +1 -1
- compass_api_sdk/models/v1_aave_avg_rateop.py +15 -93
- compass_api_sdk/models/v1_aave_historical_transactionsop.py +15 -15
- compass_api_sdk/models/v1_aave_liquidity_changeop.py +8 -86
- compass_api_sdk/models/v1_aave_rateop.py +8 -86
- compass_api_sdk/models/v1_aave_reserve_overviewop.py +8 -86
- compass_api_sdk/models/v1_aave_std_rateop.py +15 -93
- compass_api_sdk/models/v1_aave_token_priceop.py +8 -86
- compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +14 -92
- compass_api_sdk/models/v1_aave_user_position_summaryop.py +8 -8
- compass_api_sdk/models/v1_aerodrome_slipstream_liquidity_provision_positionsop.py +48 -3
- compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +12 -168
- compass_api_sdk/models/v1_ethena_vaultop.py +1 -1
- compass_api_sdk/models/v1_generic_allowanceop.py +12 -26
- compass_api_sdk/models/v1_generic_ensop.py +2 -2
- compass_api_sdk/models/v1_generic_portfolioop.py +2 -2
- compass_api_sdk/models/v1_morpho_market_positionop.py +3 -3
- compass_api_sdk/models/v1_morpho_marketop.py +2 -2
- compass_api_sdk/models/v1_morpho_marketsop.py +10 -30
- compass_api_sdk/models/v1_morpho_user_positionop.py +2 -2
- compass_api_sdk/models/v1_morpho_vaultop.py +8 -8
- compass_api_sdk/models/v1_morpho_vaultsop.py +6 -16
- compass_api_sdk/models/v1_pendle_marketop.py +8 -8
- compass_api_sdk/models/v1_pendle_marketsop.py +1 -1
- compass_api_sdk/models/v1_pendle_positionsop.py +2 -2
- compass_api_sdk/models/v1_sky_positionop.py +5 -6
- compass_api_sdk/models/v1_token_balanceop.py +12 -25
- compass_api_sdk/models/{v1_generic_supported_tokensop.py → v1_token_listop.py} +6 -6
- compass_api_sdk/models/v1_token_priceop.py +8 -9
- compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +6 -6
- compass_api_sdk/models/v1_uniswap_liquidity_provision_in_rangeop.py +2 -2
- compass_api_sdk/models/v1_uniswap_liquidity_provision_positionsop.py +2 -2
- compass_api_sdk/models/v1_uniswap_pool_priceop.py +12 -168
- compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +20 -176
- compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +20 -176
- compass_api_sdk/models/v1_vaults_vaultop.py +8 -8
- 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/vaultdepositrequest.py +6 -1
- compass_api_sdk/models/vaultgetvaultresponse.py +5 -5
- 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/vaultwithdrawrequest.py +6 -1
- compass_api_sdk/models/wildcatgetmarketresponse.py +151 -0
- compass_api_sdk/models/{redeemunderlying.py → withdraw.py} +2 -2
- compass_api_sdk/models/wrapethrequest.py +6 -1
- compass_api_sdk/morpho.py +126 -78
- compass_api_sdk/pendle.py +68 -44
- compass_api_sdk/sdk.py +18 -11
- compass_api_sdk/sky.py +62 -38
- compass_api_sdk/smart_account.py +10 -2
- compass_api_sdk/swap.py +22 -22
- compass_api_sdk/{token_sdk.py → token.py} +511 -103
- compass_api_sdk/transaction_bundler.py +46 -16
- compass_api_sdk/uniswap_v3.py +152 -114
- compass_api_sdk/universal.py +44 -606
- compass_api_sdk/utils/annotations.py +32 -8
- 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/unmarshal_json_response.py +15 -1
- 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-1.1.1.dist-info → compass_api_sdk-2.0.21rc1.dist-info}/WHEEL +1 -1
- compass_api_sdk/models/aerodromeposition.py +0 -70
- compass_api_sdk/models/token_enum.py +0 -81
- compass_api_sdk/models/tokenaddressresponse.py +0 -15
- compass_api_sdk/models/tokeninfo.py +0 -17
- compass_api_sdk/models/v1_token_addressop.py +0 -109
- compass_api_sdk/models/vaultposition.py +0 -24
- compass_api_sdk-1.1.1.dist-info/METADATA +0 -592
- compass_api_sdk-1.1.1.dist-info/RECORD +0 -275
compass_api_sdk/basesdk.py
CHANGED
|
@@ -60,6 +60,7 @@ class BaseSDK:
|
|
|
60
60
|
] = None,
|
|
61
61
|
url_override: Optional[str] = None,
|
|
62
62
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
63
|
+
allow_empty_value: Optional[List[str]] = None,
|
|
63
64
|
) -> httpx.Request:
|
|
64
65
|
client = self.sdk_configuration.async_client
|
|
65
66
|
return self._build_request_with_client(
|
|
@@ -80,6 +81,7 @@ class BaseSDK:
|
|
|
80
81
|
get_serialized_body,
|
|
81
82
|
url_override,
|
|
82
83
|
http_headers,
|
|
84
|
+
allow_empty_value,
|
|
83
85
|
)
|
|
84
86
|
|
|
85
87
|
def _build_request(
|
|
@@ -102,6 +104,7 @@ class BaseSDK:
|
|
|
102
104
|
] = None,
|
|
103
105
|
url_override: Optional[str] = None,
|
|
104
106
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
107
|
+
allow_empty_value: Optional[List[str]] = None,
|
|
105
108
|
) -> httpx.Request:
|
|
106
109
|
client = self.sdk_configuration.client
|
|
107
110
|
return self._build_request_with_client(
|
|
@@ -122,6 +125,7 @@ class BaseSDK:
|
|
|
122
125
|
get_serialized_body,
|
|
123
126
|
url_override,
|
|
124
127
|
http_headers,
|
|
128
|
+
allow_empty_value,
|
|
125
129
|
)
|
|
126
130
|
|
|
127
131
|
def _build_request_with_client(
|
|
@@ -145,6 +149,7 @@ class BaseSDK:
|
|
|
145
149
|
] = None,
|
|
146
150
|
url_override: Optional[str] = None,
|
|
147
151
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
152
|
+
allow_empty_value: Optional[List[str]] = None,
|
|
148
153
|
) -> httpx.Request:
|
|
149
154
|
query_params = {}
|
|
150
155
|
|
|
@@ -160,6 +165,7 @@ class BaseSDK:
|
|
|
160
165
|
query_params = utils.get_query_params(
|
|
161
166
|
request if request_has_query_params else None,
|
|
162
167
|
_globals if request_has_query_params else None,
|
|
168
|
+
allow_empty_value,
|
|
163
169
|
)
|
|
164
170
|
else:
|
|
165
171
|
# Pick up the query parameter from the override so they can be
|
|
@@ -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)
|