compass_api_sdk 1.1.1__py3-none-any.whl → 2.2.1rc3__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 +2026 -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 +458 -0
- compass_api_sdk/httpclient.py +0 -1
- compass_api_sdk/models/__init__.py +820 -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 +104 -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 +103 -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/depositevent.py +61 -0
- compass_api_sdk/models/depositforburnrequest.py +77 -0
- compass_api_sdk/models/depositforburnresponse.py +100 -0
- compass_api_sdk/models/earnmanageparams.py +76 -0
- compass_api_sdk/models/earnmanagerequest.py +132 -0
- compass_api_sdk/models/earnmanageresponse.py +52 -0
- compass_api_sdk/models/earnpositionsresponse.py +48 -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 +43 -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/pendledepositevent.py +49 -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/pendlemarketinfo.py +138 -0
- compass_api_sdk/models/pendlemarketsresponse.py +30 -0
- compass_api_sdk/models/pendleptposition.py +111 -0
- compass_api_sdk/models/pendleptvenue.py +78 -0
- 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/pendlewithdrawalevent.py +54 -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/positionpnl.py +52 -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 +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_pendle_marketsop.py +105 -0
- compass_api_sdk/models/v2_earn_positionsop.py +31 -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/withdrawalevent.py +61 -0
- 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/types/basemodel.py +41 -3
- compass_api_sdk/uniswap_v3.py +152 -114
- compass_api_sdk/universal.py +44 -606
- compass_api_sdk/utils/__init__.py +0 -3
- compass_api_sdk/utils/annotations.py +32 -8
- compass_api_sdk/utils/enums.py +60 -0
- compass_api_sdk/utils/forms.py +21 -10
- compass_api_sdk/utils/queryparams.py +14 -2
- compass_api_sdk/utils/requestbodies.py +3 -3
- compass_api_sdk/utils/retries.py +69 -5
- compass_api_sdk/utils/serializers.py +0 -20
- compass_api_sdk/utils/unmarshal_json_response.py +15 -1
- compass_api_sdk/wildcat.py +208 -0
- compass_api_sdk-2.2.1rc3.dist-info/METADATA +624 -0
- compass_api_sdk-2.2.1rc3.dist-info/RECORD +356 -0
- {compass_api_sdk-1.1.1.dist-info → compass_api_sdk-2.2.1rc3.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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .batchedsafeoperationsresponse_output import (
|
|
5
|
+
BatchedSafeOperationsResponseOutput,
|
|
6
|
+
BatchedSafeOperationsResponseOutputTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from .unsignedtransaction import UnsignedTransaction, UnsignedTransactionTypedDict
|
|
9
|
+
from compass_api_sdk.types import (
|
|
10
|
+
BaseModel,
|
|
11
|
+
Nullable,
|
|
12
|
+
OptionalNullable,
|
|
13
|
+
UNSET,
|
|
14
|
+
UNSET_SENTINEL,
|
|
15
|
+
)
|
|
16
|
+
from enum import Enum
|
|
17
|
+
from pydantic import model_serializer
|
|
18
|
+
from typing_extensions import NotRequired, TypedDict
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DepositForBurnResponseTransferMode(str, Enum):
|
|
22
|
+
r"""The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min)."""
|
|
23
|
+
|
|
24
|
+
FAST = "fast"
|
|
25
|
+
STANDARD = "standard"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DepositForBurnResponseTypedDict(TypedDict):
|
|
29
|
+
r"""Response model for CCTP depositForBurn transaction from a smart account.
|
|
30
|
+
|
|
31
|
+
Contains either an unsigned transaction for direct submission or EIP-712 typed data
|
|
32
|
+
for gas-sponsored transactions. Also includes a bridge_id for tracking the cross-
|
|
33
|
+
chain transfer.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
transaction: Nullable[UnsignedTransactionTypedDict]
|
|
37
|
+
eip_712: Nullable[BatchedSafeOperationsResponseOutputTypedDict]
|
|
38
|
+
transfer_mode: DepositForBurnResponseTransferMode
|
|
39
|
+
r"""The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min)."""
|
|
40
|
+
estimated_time_seconds: int
|
|
41
|
+
r"""Estimated time to complete the bridge in seconds."""
|
|
42
|
+
bridge_id: NotRequired[Nullable[str]]
|
|
43
|
+
r"""Unique bridge identifier for tracking this cross-chain transfer. Use this ID when calling /mint/prepare to complete the transfer. Only present when Redis is configured on the server."""
|
|
44
|
+
fee: NotRequired[Nullable[str]]
|
|
45
|
+
r"""Fee amount in USDC charged for this transfer. Only present for fast mode. Standard mode transfers are free (fee is None or 0)."""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class DepositForBurnResponse(BaseModel):
|
|
49
|
+
r"""Response model for CCTP depositForBurn transaction from a smart account.
|
|
50
|
+
|
|
51
|
+
Contains either an unsigned transaction for direct submission or EIP-712 typed data
|
|
52
|
+
for gas-sponsored transactions. Also includes a bridge_id for tracking the cross-
|
|
53
|
+
chain transfer.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
transaction: Nullable[UnsignedTransaction]
|
|
57
|
+
|
|
58
|
+
eip_712: Nullable[BatchedSafeOperationsResponseOutput]
|
|
59
|
+
|
|
60
|
+
transfer_mode: DepositForBurnResponseTransferMode
|
|
61
|
+
r"""The transfer speed mode used. 'fast' uses confirmed finality (~30s), 'standard' uses full finality (~15-19 min)."""
|
|
62
|
+
|
|
63
|
+
estimated_time_seconds: int
|
|
64
|
+
r"""Estimated time to complete the bridge in seconds."""
|
|
65
|
+
|
|
66
|
+
bridge_id: OptionalNullable[str] = UNSET
|
|
67
|
+
r"""Unique bridge identifier for tracking this cross-chain transfer. Use this ID when calling /mint/prepare to complete the transfer. Only present when Redis is configured on the server."""
|
|
68
|
+
|
|
69
|
+
fee: OptionalNullable[str] = UNSET
|
|
70
|
+
r"""Fee amount in USDC charged for this transfer. Only present for fast mode. Standard mode transfers are free (fee is None or 0)."""
|
|
71
|
+
|
|
72
|
+
@model_serializer(mode="wrap")
|
|
73
|
+
def serialize_model(self, handler):
|
|
74
|
+
optional_fields = ["bridge_id", "fee"]
|
|
75
|
+
nullable_fields = ["bridge_id", "transaction", "eip_712", "fee"]
|
|
76
|
+
null_default_fields = []
|
|
77
|
+
|
|
78
|
+
serialized = handler(self)
|
|
79
|
+
|
|
80
|
+
m = {}
|
|
81
|
+
|
|
82
|
+
for n, f in type(self).model_fields.items():
|
|
83
|
+
k = f.alias or n
|
|
84
|
+
val = serialized.get(k)
|
|
85
|
+
serialized.pop(k, None)
|
|
86
|
+
|
|
87
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
88
|
+
is_set = (
|
|
89
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
90
|
+
or k in null_default_fields
|
|
91
|
+
) # pylint: disable=no-member
|
|
92
|
+
|
|
93
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
94
|
+
m[k] = val
|
|
95
|
+
elif val != UNSET_SENTINEL and (
|
|
96
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
97
|
+
):
|
|
98
|
+
m[k] = val
|
|
99
|
+
|
|
100
|
+
return m
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .aavevenue import AaveVenue, AaveVenueTypedDict
|
|
5
|
+
from .pendleptvenue import PendlePTVenue, PendlePTVenueTypedDict
|
|
6
|
+
from .vaultvenue import VaultVenue, VaultVenueTypedDict
|
|
7
|
+
from compass_api_sdk.types import BaseModel
|
|
8
|
+
from compass_api_sdk.utils import validate_const
|
|
9
|
+
from enum import Enum
|
|
10
|
+
import pydantic
|
|
11
|
+
from pydantic import Field
|
|
12
|
+
from pydantic.functional_validators import AfterValidator
|
|
13
|
+
from typing import Any, Literal, Optional, Union
|
|
14
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
EarnManageParamsVenueTypedDict = TypeAliasType(
|
|
18
|
+
"EarnManageParamsVenueTypedDict",
|
|
19
|
+
Union[VaultVenueTypedDict, AaveVenueTypedDict, PendlePTVenueTypedDict],
|
|
20
|
+
)
|
|
21
|
+
r"""The earn venue."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
EarnManageParamsVenue = Annotated[
|
|
25
|
+
Union[AaveVenue, PendlePTVenue, VaultVenue], Field(discriminator="TYPE")
|
|
26
|
+
]
|
|
27
|
+
r"""The earn venue."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class EarnManageParamsAction(str, Enum):
|
|
31
|
+
r"""Whether you are depositing into or withdrawing from the given Earn `venue`."""
|
|
32
|
+
|
|
33
|
+
DEPOSIT = "DEPOSIT"
|
|
34
|
+
WITHDRAW = "WITHDRAW"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class EarnManageParamsTypedDict(TypedDict):
|
|
38
|
+
r"""Parameters for earn manage operations (deposit/withdraw to vault/Aave/Pendle PT).
|
|
39
|
+
|
|
40
|
+
Used by multicall/bundle endpoint to specify manage actions. EarnManageRequest
|
|
41
|
+
inherits from this class.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
venue: EarnManageParamsVenueTypedDict
|
|
45
|
+
r"""The earn venue."""
|
|
46
|
+
action: EarnManageParamsAction
|
|
47
|
+
r"""Whether you are depositing into or withdrawing from the given Earn `venue`."""
|
|
48
|
+
amount: Any
|
|
49
|
+
r"""Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0."""
|
|
50
|
+
action_type: Literal["V2_MANAGE"]
|
|
51
|
+
r"""Action type identifier for manage operations."""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class EarnManageParams(BaseModel):
|
|
55
|
+
r"""Parameters for earn manage operations (deposit/withdraw to vault/Aave/Pendle PT).
|
|
56
|
+
|
|
57
|
+
Used by multicall/bundle endpoint to specify manage actions. EarnManageRequest
|
|
58
|
+
inherits from this class.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
venue: EarnManageParamsVenue
|
|
62
|
+
r"""The earn venue."""
|
|
63
|
+
|
|
64
|
+
action: EarnManageParamsAction
|
|
65
|
+
r"""Whether you are depositing into or withdrawing from the given Earn `venue`."""
|
|
66
|
+
|
|
67
|
+
amount: Any
|
|
68
|
+
r"""Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0."""
|
|
69
|
+
|
|
70
|
+
ACTION_TYPE: Annotated[
|
|
71
|
+
Annotated[
|
|
72
|
+
Optional[Literal["V2_MANAGE"]], AfterValidator(validate_const("V2_MANAGE"))
|
|
73
|
+
],
|
|
74
|
+
pydantic.Field(alias="action_type"),
|
|
75
|
+
] = "V2_MANAGE"
|
|
76
|
+
r"""Action type identifier for manage operations."""
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .aavevenue import AaveVenue, AaveVenueTypedDict
|
|
5
|
+
from .chain import Chain
|
|
6
|
+
from .fee import Fee, FeeTypedDict
|
|
7
|
+
from .pendleptvenue import PendlePTVenue, PendlePTVenueTypedDict
|
|
8
|
+
from .vaultvenue import VaultVenue, VaultVenueTypedDict
|
|
9
|
+
from compass_api_sdk.types import (
|
|
10
|
+
BaseModel,
|
|
11
|
+
Nullable,
|
|
12
|
+
OptionalNullable,
|
|
13
|
+
UNSET,
|
|
14
|
+
UNSET_SENTINEL,
|
|
15
|
+
)
|
|
16
|
+
from compass_api_sdk.utils import validate_const
|
|
17
|
+
from enum import Enum
|
|
18
|
+
import pydantic
|
|
19
|
+
from pydantic import Field, model_serializer
|
|
20
|
+
from pydantic.functional_validators import AfterValidator
|
|
21
|
+
from typing import Any, Literal, Optional, Union
|
|
22
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
EarnManageRequestVenueTypedDict = TypeAliasType(
|
|
26
|
+
"EarnManageRequestVenueTypedDict",
|
|
27
|
+
Union[VaultVenueTypedDict, AaveVenueTypedDict, PendlePTVenueTypedDict],
|
|
28
|
+
)
|
|
29
|
+
r"""The earn venue."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
EarnManageRequestVenue = Annotated[
|
|
33
|
+
Union[AaveVenue, PendlePTVenue, VaultVenue], Field(discriminator="TYPE")
|
|
34
|
+
]
|
|
35
|
+
r"""The earn venue."""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class EarnManageRequestAction(str, Enum):
|
|
39
|
+
r"""Whether you are depositing into or withdrawing from the given Earn `venue`."""
|
|
40
|
+
|
|
41
|
+
DEPOSIT = "DEPOSIT"
|
|
42
|
+
WITHDRAW = "WITHDRAW"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class EarnManageRequestTypedDict(TypedDict):
|
|
46
|
+
r"""Request model for the unified manage endpoint.
|
|
47
|
+
|
|
48
|
+
Inherits from EarnManageParams and adds context fields (owner, chain, etc).
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
venue: EarnManageRequestVenueTypedDict
|
|
52
|
+
r"""The earn venue."""
|
|
53
|
+
action: EarnManageRequestAction
|
|
54
|
+
r"""Whether you are depositing into or withdrawing from the given Earn `venue`."""
|
|
55
|
+
amount: Any
|
|
56
|
+
r"""Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0."""
|
|
57
|
+
owner: str
|
|
58
|
+
r"""The primary wallet address that owns and controls the Earn Account."""
|
|
59
|
+
chain: Chain
|
|
60
|
+
r"""The chain to use."""
|
|
61
|
+
action_type: Literal["V2_MANAGE"]
|
|
62
|
+
r"""Action type identifier for manage operations."""
|
|
63
|
+
gas_sponsorship: NotRequired[bool]
|
|
64
|
+
r"""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`)."""
|
|
65
|
+
fee: NotRequired[Nullable[FeeTypedDict]]
|
|
66
|
+
r"""Optional fee configuration. If provided, a fee will be applied to the transaction amount and sent to the specified recipient address. The fee can be specified as a percentage of the transaction amount or as a fixed token amount."""
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class EarnManageRequest(BaseModel):
|
|
70
|
+
r"""Request model for the unified manage endpoint.
|
|
71
|
+
|
|
72
|
+
Inherits from EarnManageParams and adds context fields (owner, chain, etc).
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
venue: EarnManageRequestVenue
|
|
76
|
+
r"""The earn venue."""
|
|
77
|
+
|
|
78
|
+
action: EarnManageRequestAction
|
|
79
|
+
r"""Whether you are depositing into or withdrawing from the given Earn `venue`."""
|
|
80
|
+
|
|
81
|
+
amount: Any
|
|
82
|
+
r"""Amount of the underlying asset to act on (deposit or withdraw). For VAULT, this is the vault's underlying token; for AAVE, this is the Aave reserve asset; for PENDLE_PT, this is the amount of `token` to spend (DEPOSIT) or PT to sell (WITHDRAW). Provide as a decimal in token units (not wei); must be > 0."""
|
|
83
|
+
|
|
84
|
+
owner: str
|
|
85
|
+
r"""The primary wallet address that owns and controls the Earn Account."""
|
|
86
|
+
|
|
87
|
+
chain: Chain
|
|
88
|
+
r"""The chain to use."""
|
|
89
|
+
|
|
90
|
+
ACTION_TYPE: Annotated[
|
|
91
|
+
Annotated[
|
|
92
|
+
Optional[Literal["V2_MANAGE"]], AfterValidator(validate_const("V2_MANAGE"))
|
|
93
|
+
],
|
|
94
|
+
pydantic.Field(alias="action_type"),
|
|
95
|
+
] = "V2_MANAGE"
|
|
96
|
+
r"""Action type identifier for manage operations."""
|
|
97
|
+
|
|
98
|
+
gas_sponsorship: Optional[bool] = None
|
|
99
|
+
r"""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`)."""
|
|
100
|
+
|
|
101
|
+
fee: OptionalNullable[Fee] = UNSET
|
|
102
|
+
r"""Optional fee configuration. If provided, a fee will be applied to the transaction amount and sent to the specified recipient address. The fee can be specified as a percentage of the transaction amount or as a fixed token amount."""
|
|
103
|
+
|
|
104
|
+
@model_serializer(mode="wrap")
|
|
105
|
+
def serialize_model(self, handler):
|
|
106
|
+
optional_fields = ["action_type", "gas_sponsorship", "fee"]
|
|
107
|
+
nullable_fields = ["fee"]
|
|
108
|
+
null_default_fields = []
|
|
109
|
+
|
|
110
|
+
serialized = handler(self)
|
|
111
|
+
|
|
112
|
+
m = {}
|
|
113
|
+
|
|
114
|
+
for n, f in type(self).model_fields.items():
|
|
115
|
+
k = f.alias or n
|
|
116
|
+
val = serialized.get(k)
|
|
117
|
+
serialized.pop(k, None)
|
|
118
|
+
|
|
119
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
120
|
+
is_set = (
|
|
121
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
122
|
+
or k in null_default_fields
|
|
123
|
+
) # pylint: disable=no-member
|
|
124
|
+
|
|
125
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
126
|
+
m[k] = val
|
|
127
|
+
elif val != UNSET_SENTINEL and (
|
|
128
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
129
|
+
):
|
|
130
|
+
m[k] = val
|
|
131
|
+
|
|
132
|
+
return m
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .batchedsafeoperationsresponse_output import (
|
|
5
|
+
BatchedSafeOperationsResponseOutput,
|
|
6
|
+
BatchedSafeOperationsResponseOutputTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from .unsignedtransaction import UnsignedTransaction, UnsignedTransactionTypedDict
|
|
9
|
+
from compass_api_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
10
|
+
from pydantic import model_serializer
|
|
11
|
+
from typing_extensions import TypedDict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class EarnManageResponseTypedDict(TypedDict):
|
|
15
|
+
transaction: Nullable[UnsignedTransactionTypedDict]
|
|
16
|
+
eip_712: Nullable[BatchedSafeOperationsResponseOutputTypedDict]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class EarnManageResponse(BaseModel):
|
|
20
|
+
transaction: Nullable[UnsignedTransaction]
|
|
21
|
+
|
|
22
|
+
eip_712: Nullable[BatchedSafeOperationsResponseOutput]
|
|
23
|
+
|
|
24
|
+
@model_serializer(mode="wrap")
|
|
25
|
+
def serialize_model(self, handler):
|
|
26
|
+
optional_fields = []
|
|
27
|
+
nullable_fields = ["transaction", "eip_712"]
|
|
28
|
+
null_default_fields = []
|
|
29
|
+
|
|
30
|
+
serialized = handler(self)
|
|
31
|
+
|
|
32
|
+
m = {}
|
|
33
|
+
|
|
34
|
+
for n, f in type(self).model_fields.items():
|
|
35
|
+
k = f.alias or n
|
|
36
|
+
val = serialized.get(k)
|
|
37
|
+
serialized.pop(k, None)
|
|
38
|
+
|
|
39
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
40
|
+
is_set = (
|
|
41
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
42
|
+
or k in null_default_fields
|
|
43
|
+
) # pylint: disable=no-member
|
|
44
|
+
|
|
45
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
46
|
+
m[k] = val
|
|
47
|
+
elif val != UNSET_SENTINEL and (
|
|
48
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
49
|
+
):
|
|
50
|
+
m[k] = val
|
|
51
|
+
|
|
52
|
+
return m
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .aaveposition import AavePosition, AavePositionTypedDict
|
|
5
|
+
from .compass_api_backend_v2_models_earn_read_response_positions_vaultposition import (
|
|
6
|
+
CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition,
|
|
7
|
+
CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPositionTypedDict,
|
|
8
|
+
)
|
|
9
|
+
from .pendleptposition import PendlePTPosition, PendlePTPositionTypedDict
|
|
10
|
+
from compass_api_sdk.types import BaseModel
|
|
11
|
+
from typing import List, Optional
|
|
12
|
+
from typing_extensions import NotRequired, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class EarnPositionsResponseTypedDict(TypedDict):
|
|
16
|
+
r"""Grouped positions by protocol.
|
|
17
|
+
|
|
18
|
+
This new structure groups positions by protocol type for better organization and
|
|
19
|
+
removes the need for a discriminated union in SDK consumers.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
aave: NotRequired[List[AavePositionTypedDict]]
|
|
23
|
+
r"""Aave V3 lending positions."""
|
|
24
|
+
vaults: NotRequired[
|
|
25
|
+
List[CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPositionTypedDict]
|
|
26
|
+
]
|
|
27
|
+
r"""ERC-4626 vault positions."""
|
|
28
|
+
pendle_pt: NotRequired[List[PendlePTPositionTypedDict]]
|
|
29
|
+
r"""Pendle Principal Token positions."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class EarnPositionsResponse(BaseModel):
|
|
33
|
+
r"""Grouped positions by protocol.
|
|
34
|
+
|
|
35
|
+
This new structure groups positions by protocol type for better organization and
|
|
36
|
+
removes the need for a discriminated union in SDK consumers.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
aave: Optional[List[AavePosition]] = None
|
|
40
|
+
r"""Aave V3 lending positions."""
|
|
41
|
+
|
|
42
|
+
vaults: Optional[
|
|
43
|
+
List[CompassAPIBackendV2ModelsEarnReadResponsePositionsVaultPosition]
|
|
44
|
+
] = None
|
|
45
|
+
r"""ERC-4626 vault positions."""
|
|
46
|
+
|
|
47
|
+
pendle_pt: Optional[List[PendlePTPosition]] = None
|
|
48
|
+
r"""Pendle Principal Token positions."""
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import BaseModel
|
|
5
|
+
from compass_api_sdk.utils import validate_const
|
|
6
|
+
import pydantic
|
|
7
|
+
from pydantic.functional_validators import AfterValidator
|
|
8
|
+
from typing import Literal, Optional, Union
|
|
9
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
EarnSwapParamsAmountInTypedDict = TypeAliasType(
|
|
13
|
+
"EarnSwapParamsAmountInTypedDict", Union[float, str]
|
|
14
|
+
)
|
|
15
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
EarnSwapParamsAmountIn = TypeAliasType("EarnSwapParamsAmountIn", Union[float, str])
|
|
19
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
EarnSwapParamsSlippageTypedDict = TypeAliasType(
|
|
23
|
+
"EarnSwapParamsSlippageTypedDict", Union[float, str]
|
|
24
|
+
)
|
|
25
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
EarnSwapParamsSlippage = TypeAliasType("EarnSwapParamsSlippage", Union[float, str])
|
|
29
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class EarnSwapParamsTypedDict(TypedDict):
|
|
33
|
+
r"""Parameters for swap operations (without context like owner/chain).
|
|
34
|
+
|
|
35
|
+
Used by multicall/bundle endpoint to specify swap actions.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
token_in: str
|
|
39
|
+
r"""Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address."""
|
|
40
|
+
token_out: str
|
|
41
|
+
r"""Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address."""
|
|
42
|
+
amount_in: EarnSwapParamsAmountInTypedDict
|
|
43
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
44
|
+
action_type: Literal["V2_SWAP"]
|
|
45
|
+
r"""Action type identifier for swap operations."""
|
|
46
|
+
slippage: NotRequired[EarnSwapParamsSlippageTypedDict]
|
|
47
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class EarnSwapParams(BaseModel):
|
|
51
|
+
r"""Parameters for swap operations (without context like owner/chain).
|
|
52
|
+
|
|
53
|
+
Used by multicall/bundle endpoint to specify swap actions.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
token_in: str
|
|
57
|
+
r"""Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address."""
|
|
58
|
+
|
|
59
|
+
token_out: str
|
|
60
|
+
r"""Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address."""
|
|
61
|
+
|
|
62
|
+
amount_in: EarnSwapParamsAmountIn
|
|
63
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
64
|
+
|
|
65
|
+
ACTION_TYPE: Annotated[
|
|
66
|
+
Annotated[
|
|
67
|
+
Optional[Literal["V2_SWAP"]], AfterValidator(validate_const("V2_SWAP"))
|
|
68
|
+
],
|
|
69
|
+
pydantic.Field(alias="action_type"),
|
|
70
|
+
] = "V2_SWAP"
|
|
71
|
+
r"""Action type identifier for swap operations."""
|
|
72
|
+
|
|
73
|
+
slippage: Optional[EarnSwapParamsSlippage] = None
|
|
74
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .chain import Chain
|
|
5
|
+
from compass_api_sdk.types import BaseModel
|
|
6
|
+
from compass_api_sdk.utils import validate_const
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic.functional_validators import AfterValidator
|
|
9
|
+
from typing import Literal, Optional, Union
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
EarnSwapRequestAmountInTypedDict = TypeAliasType(
|
|
14
|
+
"EarnSwapRequestAmountInTypedDict", Union[float, str]
|
|
15
|
+
)
|
|
16
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
EarnSwapRequestAmountIn = TypeAliasType("EarnSwapRequestAmountIn", Union[float, str])
|
|
20
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
EarnSwapRequestSlippageTypedDict = TypeAliasType(
|
|
24
|
+
"EarnSwapRequestSlippageTypedDict", Union[float, str]
|
|
25
|
+
)
|
|
26
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
EarnSwapRequestSlippage = TypeAliasType("EarnSwapRequestSlippage", Union[float, str])
|
|
30
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class EarnSwapRequestTypedDict(TypedDict):
|
|
34
|
+
r"""Request model for swap endpoint.
|
|
35
|
+
|
|
36
|
+
Inherits swap params and adds context fields (owner, chain, gas_sponsorship).
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
token_in: str
|
|
40
|
+
r"""Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address."""
|
|
41
|
+
token_out: str
|
|
42
|
+
r"""Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address."""
|
|
43
|
+
amount_in: EarnSwapRequestAmountInTypedDict
|
|
44
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
45
|
+
owner: str
|
|
46
|
+
r"""The owner's wallet address."""
|
|
47
|
+
chain: Chain
|
|
48
|
+
r"""The chain to use."""
|
|
49
|
+
action_type: Literal["V2_SWAP"]
|
|
50
|
+
r"""Action type identifier for swap operations."""
|
|
51
|
+
slippage: NotRequired[EarnSwapRequestSlippageTypedDict]
|
|
52
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
53
|
+
gas_sponsorship: NotRequired[bool]
|
|
54
|
+
r"""Optionally request gas sponsorship. If `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`)."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class EarnSwapRequest(BaseModel):
|
|
58
|
+
r"""Request model for swap endpoint.
|
|
59
|
+
|
|
60
|
+
Inherits swap params and adds context fields (owner, chain, gas_sponsorship).
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
token_in: str
|
|
64
|
+
r"""Token to sell (input). Provide a token symbol from a limited set (e.g., 'USDC') or any token address."""
|
|
65
|
+
|
|
66
|
+
token_out: str
|
|
67
|
+
r"""Token to buy (output). Provide a token symbol from a limited set (e.g., 'USDT') or any token address."""
|
|
68
|
+
|
|
69
|
+
amount_in: EarnSwapRequestAmountIn
|
|
70
|
+
r"""Human-readable amount of `token_in` to swap (token units, not wei)."""
|
|
71
|
+
|
|
72
|
+
owner: str
|
|
73
|
+
r"""The owner's wallet address."""
|
|
74
|
+
|
|
75
|
+
chain: Chain
|
|
76
|
+
r"""The chain to use."""
|
|
77
|
+
|
|
78
|
+
ACTION_TYPE: Annotated[
|
|
79
|
+
Annotated[
|
|
80
|
+
Optional[Literal["V2_SWAP"]], AfterValidator(validate_const("V2_SWAP"))
|
|
81
|
+
],
|
|
82
|
+
pydantic.Field(alias="action_type"),
|
|
83
|
+
] = "V2_SWAP"
|
|
84
|
+
r"""Action type identifier for swap operations."""
|
|
85
|
+
|
|
86
|
+
slippage: Optional[EarnSwapRequestSlippage] = None
|
|
87
|
+
r"""Maximum slippage tolerance as a percentage (e.g., 0.5 = 0.5%)."""
|
|
88
|
+
|
|
89
|
+
gas_sponsorship: Optional[bool] = None
|
|
90
|
+
r"""Optionally request gas sponsorship. If `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`)."""
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .batchedsafeoperationsresponse_output import (
|
|
5
|
+
BatchedSafeOperationsResponseOutput,
|
|
6
|
+
BatchedSafeOperationsResponseOutputTypedDict,
|
|
7
|
+
)
|
|
8
|
+
from .unsignedtransaction import UnsignedTransaction, UnsignedTransactionTypedDict
|
|
9
|
+
from compass_api_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
10
|
+
from pydantic import model_serializer
|
|
11
|
+
from typing_extensions import TypedDict
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class EarnSwapResponseTypedDict(TypedDict):
|
|
15
|
+
transaction: Nullable[UnsignedTransactionTypedDict]
|
|
16
|
+
eip_712: Nullable[BatchedSafeOperationsResponseOutputTypedDict]
|
|
17
|
+
estimated_amount_out: str
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class EarnSwapResponse(BaseModel):
|
|
21
|
+
transaction: Nullable[UnsignedTransaction]
|
|
22
|
+
|
|
23
|
+
eip_712: Nullable[BatchedSafeOperationsResponseOutput]
|
|
24
|
+
|
|
25
|
+
estimated_amount_out: str
|
|
26
|
+
|
|
27
|
+
@model_serializer(mode="wrap")
|
|
28
|
+
def serialize_model(self, handler):
|
|
29
|
+
optional_fields = []
|
|
30
|
+
nullable_fields = ["transaction", "eip_712"]
|
|
31
|
+
null_default_fields = []
|
|
32
|
+
|
|
33
|
+
serialized = handler(self)
|
|
34
|
+
|
|
35
|
+
m = {}
|
|
36
|
+
|
|
37
|
+
for n, f in type(self).model_fields.items():
|
|
38
|
+
k = f.alias or n
|
|
39
|
+
val = serialized.get(k)
|
|
40
|
+
serialized.pop(k, None)
|
|
41
|
+
|
|
42
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
43
|
+
is_set = (
|
|
44
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
45
|
+
or k in null_default_fields
|
|
46
|
+
) # pylint: disable=no-member
|
|
47
|
+
|
|
48
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
49
|
+
m[k] = val
|
|
50
|
+
elif val != UNSET_SENTINEL and (
|
|
51
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
52
|
+
):
|
|
53
|
+
m[k] = val
|
|
54
|
+
|
|
55
|
+
return m
|