compass_api_sdk 0.9.51__py3-none-any.whl → 0.9.52__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.
Potentially problematic release.
This version of compass_api_sdk might be problematic. Click here for more details.
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/aave_v3.py +314 -260
- compass_api_sdk/aerodrome_slipstream.py +186 -184
- compass_api_sdk/erc_4626_vaults.py +82 -58
- compass_api_sdk/errors/__init__.py +3 -2
- compass_api_sdk/models/__init__.py +1736 -1528
- compass_api_sdk/models/aavereserveoverviewresponse.py +34 -3
- compass_api_sdk/models/{chain.py → compass_api_backend_config_chain_chain.py} +4 -4
- compass_api_sdk/models/compass_api_backend_models_aave_read_response_historical_transactions_aavehistoricaltransactionsresponse.py +115 -0
- compass_api_sdk/models/{borrow.py → compass_api_backend_models_aave_read_response_historical_transactions_borrow.py} +4 -2
- compass_api_sdk/models/{liquidationcall.py → compass_api_backend_models_aave_read_response_historical_transactions_liquidationcall.py} +6 -2
- compass_api_sdk/models/{redeemunderlying.py → compass_api_backend_models_aave_read_response_historical_transactions_redeemunderlying.py} +6 -2
- compass_api_sdk/models/{repay.py → compass_api_backend_models_aave_read_response_historical_transactions_repay.py} +4 -2
- compass_api_sdk/models/{supply.py → compass_api_backend_models_aave_read_response_historical_transactions_supply.py} +4 -2
- compass_api_sdk/models/{swapborrowrate.py → compass_api_backend_models_aave_read_response_historical_transactions_swapborrowrate.py} +6 -2
- compass_api_sdk/models/{usageascollateral.py → compass_api_backend_models_aave_read_response_historical_transactions_usageascollateral.py} +6 -2
- compass_api_sdk/models/{aaveborrowrequest.py → compass_api_backend_models_aave_transact_request_borrow_aaveborrowrequest.py} +24 -12
- compass_api_sdk/models/{aaverepayrequest.py → compass_api_backend_models_aave_transact_request_repay_aaverepayrequest.py} +24 -12
- compass_api_sdk/models/{aavesupplyrequest.py → compass_api_backend_models_aave_transact_request_supply_aavesupplyrequest.py} +24 -12
- compass_api_sdk/models/{aavewithdrawrequest.py → compass_api_backend_models_aave_transact_request_withdraw_aavewithdrawrequest.py} +25 -13
- compass_api_sdk/models/{aerodromelppositionsresponse.py → compass_api_backend_models_aerodrome_slipstream_read_response_positions_aerodromelppositionsresponse.py} +6 -2
- compass_api_sdk/models/compass_api_backend_models_aerodrome_slipstream_transact_request_liquidity_provision_increase_aerodromeslipstreamincreaseliquidityprovisionrequest.py +125 -0
- compass_api_sdk/models/{aerodromeslipstreammintliquidityprovisionrequest.py → compass_api_backend_models_aerodrome_slipstream_transact_request_liquidity_provision_mint_aerodromeslipstreammintliquidityprovisionrequest.py} +43 -35
- compass_api_sdk/models/compass_api_backend_models_aerodrome_slipstream_transact_request_liquidity_provision_withdraw_aerodromeslipstreamwithdrawliquidityprovisionrequest.py +68 -0
- compass_api_sdk/models/compass_api_backend_models_aerodrome_slipstream_transact_request_swap_buy_exactly_aerodromeslipstreambuyexactlyrequest.py +116 -0
- compass_api_sdk/models/{aerodromeslipstreamsellexactlyrequest.py → compass_api_backend_models_aerodrome_slipstream_transact_request_swap_sell_exactly_aerodromeslipstreamsellexactlyrequest.py} +31 -19
- compass_api_sdk/models/compass_api_backend_models_generic_read_response_chains_supportedchaininfo.py +21 -0
- compass_api_sdk/models/{portfolio.py → compass_api_backend_models_generic_read_response_portfolio_portfolio.py} +2 -2
- compass_api_sdk/models/compass_api_backend_models_generic_transact_request_allowance_setallowancerequest.py +139 -0
- compass_api_sdk/models/compass_api_backend_models_generic_transact_request_unwrap_weth_unwrapwethrequest.py +69 -0
- compass_api_sdk/models/compass_api_backend_models_generic_transact_request_wrap_eth_wrapethrequest.py +66 -0
- compass_api_sdk/models/{marketposition.py → compass_api_backend_models_morpho_read_response_check_user_position_marketposition.py} +6 -2
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_check_user_position_morphocheckuserpositionresponse.py +48 -0
- compass_api_sdk/models/{vault.py → compass_api_backend_models_morpho_read_response_check_user_position_vault.py} +4 -2
- compass_api_sdk/models/{vaultposition.py → compass_api_backend_models_morpho_read_response_check_user_position_vaultposition.py} +12 -5
- compass_api_sdk/models/{morphogetmarketresponse.py → compass_api_backend_models_morpho_read_response_get_market_morphogetmarketresponse.py} +6 -2
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_markets_morphogetmarketsresponse.py +26 -0
- compass_api_sdk/models/{morphomarket.py → compass_api_backend_models_morpho_read_response_get_markets_morphomarket.py} +4 -2
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_morphogetvaultsresponse.py +24 -0
- compass_api_sdk/models/{morphovault.py → compass_api_backend_models_morpho_read_response_get_vaults_morphovault.py} +2 -2
- compass_api_sdk/models/{morphoborrowrequest.py → compass_api_backend_models_morpho_transact_request_borrow_morphoborrowrequest.py} +22 -13
- compass_api_sdk/models/{morphodepositrequest.py → compass_api_backend_models_morpho_transact_request_deposit_morphodepositrequest.py} +26 -13
- compass_api_sdk/models/{morphorepayrequest.py → compass_api_backend_models_morpho_transact_request_repay_morphorepayrequest.py} +12 -7
- compass_api_sdk/models/{morphosupplycollateralrequest.py → compass_api_backend_models_morpho_transact_request_supply_collateral_morphosupplycollateralrequest.py} +22 -13
- compass_api_sdk/models/{morphowithdrawcollateralrequest.py → compass_api_backend_models_morpho_transact_request_withdraw_collateral_morphowithdrawcollateralrequest.py} +22 -13
- compass_api_sdk/models/{morphowithdrawrequest.py → compass_api_backend_models_morpho_transact_request_withdraw_morphowithdrawrequest.py} +18 -7
- compass_api_sdk/models/{multicallauthorizationrequest.py → compass_api_backend_models_multicall_read_request_get_authorization_multicallauthorizationrequest.py} +17 -7
- compass_api_sdk/models/{aavelooprequest.py → compass_api_backend_models_multicall_transact_request_aave_loop_request_aavelooprequest.py} +67 -13
- compass_api_sdk/models/compass_api_backend_models_multicall_transact_request_multicall_execution_request_multicallexecuterequest.py +92 -0
- compass_api_sdk/models/{useroperation.py → compass_api_backend_models_multicall_transact_request_multicall_execution_request_useroperation.py} +40 -42
- compass_api_sdk/models/{pendlegetmarketresponse.py → compass_api_backend_models_pendle_read_response_market_pendlegetmarketresponse.py} +4 -2
- compass_api_sdk/models/compass_api_backend_models_pendle_read_response_markets_pendlelistmarketsresponse.py +24 -0
- compass_api_sdk/models/{pendlemarket.py → compass_api_backend_models_pendle_read_response_markets_pendlemarket.py} +2 -2
- compass_api_sdk/models/{openposition.py → compass_api_backend_models_pendle_read_response_positions_openposition.py} +4 -2
- compass_api_sdk/models/compass_api_backend_models_pendle_read_response_positions_pendlelistuserpositionsresponse.py +24 -0
- compass_api_sdk/models/{position.py → compass_api_backend_models_pendle_read_response_positions_position.py} +18 -7
- compass_api_sdk/models/{pendleredeemyieldrequest.py → compass_api_backend_models_pendle_transact_request_redeem_yield_pendleredeemyieldrequest.py} +17 -7
- compass_api_sdk/models/{skybuyrequest.py → compass_api_backend_models_sky_transact_request_buy_skybuyrequest.py} +22 -19
- compass_api_sdk/models/{skydepositrequest.py → compass_api_backend_models_sky_transact_request_deposit_skydepositrequest.py} +26 -15
- compass_api_sdk/models/compass_api_backend_models_sky_transact_request_sell_skysellrequest.py +70 -0
- compass_api_sdk/models/{skywithdrawrequest.py → compass_api_backend_models_sky_transact_request_withdraw_skywithdrawrequest.py} +17 -10
- compass_api_sdk/models/compass_api_backend_models_smart_account_transact_request_user_operations_batcheduseroperationsrequest.py +49 -0
- compass_api_sdk/models/compass_api_backend_models_swap_transact_request_odos_odosswaprequest.py +108 -0
- compass_api_sdk/models/compass_api_backend_models_token_transact_request_transfer_tokentransferrequest.py +98 -0
- compass_api_sdk/models/compass_api_backend_models_uniswap_transact_liquidity_provision_request_increase_uniswapincreaseliquidityprovisionrequest.py +129 -0
- compass_api_sdk/models/{uniswapmintliquidityprovisionrequest.py → compass_api_backend_models_uniswap_transact_liquidity_provision_request_mint_uniswapmintliquidityprovisionrequest.py} +49 -31
- compass_api_sdk/models/compass_api_backend_models_uniswap_transact_liquidity_provision_request_withdraw_uniswapwithdrawliquidityprovisionrequest.py +68 -0
- compass_api_sdk/models/compass_api_backend_models_uniswap_transact_swap_request_buy_exactly_uniswapbuyexactlyrequest.py +123 -0
- compass_api_sdk/models/compass_api_backend_models_uniswap_transact_swap_request_sell_exactly_uniswapsellexactlyrequest.py +123 -0
- compass_api_sdk/models/{vaultgetvaultresponse.py → compass_api_backend_models_vaults_read_response_vault_vaultgetvaultresponse.py} +4 -2
- compass_api_sdk/models/compass_api_backend_models_vaults_transact_request_deposit_vaultdepositrequest.py +110 -0
- compass_api_sdk/models/compass_api_backend_models_vaults_transact_request_withdraw_vaultwithdrawrequest.py +96 -0
- compass_api_sdk/models/details.py +44 -7
- compass_api_sdk/models/movement10percent.py +65 -10
- compass_api_sdk/models/pendlemanageliquidityparams.py +81 -0
- compass_api_sdk/models/pendlemanageliquidityrequest.py +95 -0
- compass_api_sdk/models/pendletradeptparams.py +81 -0
- compass_api_sdk/models/pendletradeptrequest.py +95 -0
- compass_api_sdk/models/pendletradeytparams.py +81 -0
- compass_api_sdk/models/pendletradeytrequest.py +95 -0
- compass_api_sdk/models/pendletxresponse.py +45 -0
- compass_api_sdk/models/token_enum.py +17 -0
- compass_api_sdk/models/{tokentransferrequest.py → tokentransferparams.py} +16 -27
- compass_api_sdk/models/transactionresponse.py +40 -0
- compass_api_sdk/models/uniswapbuyexactlyparams.py +19 -24
- compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +45 -0
- compass_api_sdk/models/uniswapsellexactlyparams.py +43 -40
- compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +45 -0
- compass_api_sdk/models/{aave_aave_supported_tokensop.py → v1_aave_aave_supported_tokensop.py} +9 -13
- compass_api_sdk/models/{aave_avg_rateop.py → v1_aave_avg_rateop.py} +32 -19
- compass_api_sdk/models/{aave_historical_transactionsop.py → v1_aave_historical_transactionsop.py} +9 -13
- compass_api_sdk/models/{aave_liquidity_changeop.py → v1_aave_liquidity_changeop.py} +30 -17
- compass_api_sdk/models/{aave_rateop.py → v1_aave_rateop.py} +32 -19
- compass_api_sdk/models/{aave_reserve_overviewop.py → v1_aave_reserve_overviewop.py} +32 -19
- compass_api_sdk/models/{aave_std_rateop.py → v1_aave_std_rateop.py} +32 -19
- compass_api_sdk/models/{aave_token_priceop.py → v1_aave_token_priceop.py} +32 -19
- compass_api_sdk/models/{aave_user_position_per_tokenop.py → v1_aave_user_position_per_tokenop.py} +32 -19
- compass_api_sdk/models/{aave_user_position_summaryop.py → v1_aave_user_position_summaryop.py} +9 -13
- compass_api_sdk/models/{uniswap_liquidity_provision_positionsop.py → v1_aerodrome_slipstream_liquidity_provision_positionsop.py} +7 -13
- compass_api_sdk/models/{aerodrome_slipstream_pool_priceop.py → v1_aerodrome_slipstream_pool_priceop.py} +53 -25
- compass_api_sdk/models/{generic_allowanceop.py → v1_generic_allowanceop.py} +24 -25
- compass_api_sdk/models/{generic_ensop.py → v1_generic_ensop.py} +7 -13
- compass_api_sdk/models/{generic_portfolioop.py → v1_generic_portfolioop.py} +9 -13
- compass_api_sdk/models/{generic_supported_chainsop.py → v1_generic_supported_chainsop.py} +2 -2
- compass_api_sdk/models/v1_generic_supported_tokensop.py +24 -0
- compass_api_sdk/models/{morpho_market_positionop.py → v1_morpho_market_positionop.py} +9 -8
- compass_api_sdk/models/{morpho_marketop.py → v1_morpho_marketop.py} +9 -8
- compass_api_sdk/models/{morpho_marketsop.py → v1_morpho_marketsop.py} +9 -8
- compass_api_sdk/models/{morpho_user_positionop.py → v1_morpho_user_positionop.py} +9 -8
- compass_api_sdk/models/{morpho_vaultop.py → v1_morpho_vaultop.py} +9 -13
- compass_api_sdk/models/{morpho_vaultsop.py → v1_morpho_vaultsop.py} +9 -8
- compass_api_sdk/models/{pendle_marketop.py → v1_pendle_marketop.py} +9 -13
- 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/{sky_positionop.py → v1_sky_positionop.py} +14 -15
- compass_api_sdk/models/{token_addressop.py → v1_token_addressop.py} +30 -17
- compass_api_sdk/models/{token_balanceop.py → v1_token_balanceop.py} +14 -18
- compass_api_sdk/models/{token_priceop.py → v1_token_priceop.py} +14 -18
- compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +24 -0
- compass_api_sdk/models/{uniswap_liquidity_provision_in_rangeop.py → v1_uniswap_liquidity_provision_in_rangeop.py} +9 -13
- compass_api_sdk/models/{aerodrome_slipstream_liquidity_provision_positionsop.py → v1_uniswap_liquidity_provision_positionsop.py} +9 -13
- compass_api_sdk/models/{uniswap_pool_priceop.py → v1_uniswap_pool_priceop.py} +59 -29
- compass_api_sdk/models/{uniswap_quote_buy_exactlyop.py → v1_uniswap_quote_buy_exactlyop.py} +65 -35
- compass_api_sdk/models/{uniswap_quote_sell_exactlyop.py → v1_uniswap_quote_sell_exactlyop.py} +65 -35
- compass_api_sdk/models/{vaults_vaultop.py → v1_vaults_vaultop.py} +9 -13
- compass_api_sdk/models/{vaultdepositrequest.py → vaultdepositparams.py} +7 -20
- compass_api_sdk/models/{vaultwithdrawrequest.py → vaultwithdrawparams.py} +2 -13
- compass_api_sdk/morpho.py +310 -222
- compass_api_sdk/pendle.py +307 -1081
- compass_api_sdk/sky.py +186 -94
- compass_api_sdk/smart_account.py +46 -18
- compass_api_sdk/swap.py +40 -26
- compass_api_sdk/token_sdk.py +76 -66
- compass_api_sdk/transaction_bundler.py +126 -76
- compass_api_sdk/uniswap_v3.py +302 -278
- compass_api_sdk/universal.py +189 -329
- compass_api_sdk/utils/__init__.py +3 -2
- {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-0.9.52.dist-info}/METADATA +83 -88
- compass_api_sdk-0.9.52.dist-info/RECORD +263 -0
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +0 -65
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +0 -104
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +0 -123
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +0 -64
- compass_api_sdk/models/batcheduseroperationsrequest.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/morphocheckuserpositionresponse.py +0 -32
- compass_api_sdk/models/morphogetmarketsresponse.py +0 -17
- compass_api_sdk/models/morphogetvaultsresponse.py +0 -17
- compass_api_sdk/models/multicallexecuterequest.py +0 -36
- compass_api_sdk/models/odosswaprequest.py +0 -86
- compass_api_sdk/models/pendle_marketsop.py +0 -28
- compass_api_sdk/models/pendle_quoteop.py +0 -128
- 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/pendlegetquoteresponse.py +0 -15
- compass_api_sdk/models/pendlelistmarketsresponse.py +0 -17
- compass_api_sdk/models/pendlelistuserpositionsresponse.py +0 -17
- 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/setallowancerequest.py +0 -109
- compass_api_sdk/models/skysellrequest.py +0 -64
- compass_api_sdk/models/supportedchaininfo.py +0 -19
- compass_api_sdk/models/txresponse.py +0 -27
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +0 -112
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +0 -111
- compass_api_sdk/models/uniswapsellexactlyrequest.py +0 -104
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +0 -63
- compass_api_sdk/models/unwrapwethrequest.py +0 -53
- compass_api_sdk/models/wrapethrequest.py +0 -52
- compass_api_sdk-0.9.51.dist-info/RECORD +0 -266
- {compass_api_sdk-0.9.51.dist-info → compass_api_sdk-0.9.52.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .feeenum import FeeEnum
|
|
5
|
+
from .token_enum import TokenEnum
|
|
6
|
+
from compass_api_sdk.types import BaseModel
|
|
7
|
+
from compass_api_sdk.utils import validate_const
|
|
8
|
+
from enum import Enum
|
|
9
|
+
import pydantic
|
|
10
|
+
from pydantic.functional_validators import AfterValidator
|
|
11
|
+
from typing import Literal, Optional, Union
|
|
12
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenInTypedDict = TypeAliasType(
|
|
16
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenInTypedDict",
|
|
17
|
+
Union[TokenEnum, str],
|
|
18
|
+
)
|
|
19
|
+
r"""The symbol or address of the token to swap from."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenIn = TypeAliasType(
|
|
23
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenIn",
|
|
24
|
+
Union[TokenEnum, str],
|
|
25
|
+
)
|
|
26
|
+
r"""The symbol or address of the token to swap from."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenOutTypedDict = TypeAliasType(
|
|
30
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenOutTypedDict",
|
|
31
|
+
Union[TokenEnum, str],
|
|
32
|
+
)
|
|
33
|
+
r"""The symbol or address of the token to swap to."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenOut = TypeAliasType(
|
|
37
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenOut",
|
|
38
|
+
Union[TokenEnum, str],
|
|
39
|
+
)
|
|
40
|
+
r"""The symbol or address of the token to swap to."""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestAmountOutTypedDict = TypeAliasType(
|
|
44
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestAmountOutTypedDict",
|
|
45
|
+
Union[float, str],
|
|
46
|
+
)
|
|
47
|
+
r"""The amount of 'token_out' to buy."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestAmountOut = TypeAliasType(
|
|
51
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestAmountOut",
|
|
52
|
+
Union[float, str],
|
|
53
|
+
)
|
|
54
|
+
r"""The amount of 'token_out' to buy."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestChain(
|
|
58
|
+
str, Enum
|
|
59
|
+
):
|
|
60
|
+
ARBITRUM = "arbitrum"
|
|
61
|
+
BASE = "base"
|
|
62
|
+
ETHEREUM = "ethereum"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTypedDict(
|
|
66
|
+
TypedDict
|
|
67
|
+
):
|
|
68
|
+
r"""Request model for buying an exact amount of tokens."""
|
|
69
|
+
|
|
70
|
+
token_in: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenInTypedDict
|
|
71
|
+
r"""The symbol or address of the token to swap from."""
|
|
72
|
+
token_out: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenOutTypedDict
|
|
73
|
+
r"""The symbol or address of the token to swap to."""
|
|
74
|
+
fee: FeeEnum
|
|
75
|
+
r"""The transaction fee of a Uniswap pool in bips.
|
|
76
|
+
|
|
77
|
+
Uniswap supports 4 different fee levels.
|
|
78
|
+
"""
|
|
79
|
+
amount_out: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestAmountOutTypedDict
|
|
80
|
+
r"""The amount of 'token_out' to buy."""
|
|
81
|
+
max_slippage_percent: float
|
|
82
|
+
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
83
|
+
chain: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestChain
|
|
84
|
+
sender: str
|
|
85
|
+
r"""The address of the transaction sender."""
|
|
86
|
+
action_type: Literal["UNISWAP_BUY_EXACTLY"]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequest(
|
|
90
|
+
BaseModel
|
|
91
|
+
):
|
|
92
|
+
r"""Request model for buying an exact amount of tokens."""
|
|
93
|
+
|
|
94
|
+
token_in: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenIn
|
|
95
|
+
r"""The symbol or address of the token to swap from."""
|
|
96
|
+
|
|
97
|
+
token_out: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestTokenOut
|
|
98
|
+
r"""The symbol or address of the token to swap to."""
|
|
99
|
+
|
|
100
|
+
fee: FeeEnum
|
|
101
|
+
r"""The transaction fee of a Uniswap pool in bips.
|
|
102
|
+
|
|
103
|
+
Uniswap supports 4 different fee levels.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
amount_out: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestAmountOut
|
|
107
|
+
r"""The amount of 'token_out' to buy."""
|
|
108
|
+
|
|
109
|
+
max_slippage_percent: float
|
|
110
|
+
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
111
|
+
|
|
112
|
+
chain: CompassAPIBackendModelsUniswapTransactSwapRequestBuyExactlyUniswapBuyExactlyRequestChain
|
|
113
|
+
|
|
114
|
+
sender: str
|
|
115
|
+
r"""The address of the transaction sender."""
|
|
116
|
+
|
|
117
|
+
ACTION_TYPE: Annotated[
|
|
118
|
+
Annotated[
|
|
119
|
+
Optional[Literal["UNISWAP_BUY_EXACTLY"]],
|
|
120
|
+
AfterValidator(validate_const("UNISWAP_BUY_EXACTLY")),
|
|
121
|
+
],
|
|
122
|
+
pydantic.Field(alias="action_type"),
|
|
123
|
+
] = "UNISWAP_BUY_EXACTLY"
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .feeenum import FeeEnum
|
|
5
|
+
from .token_enum import TokenEnum
|
|
6
|
+
from compass_api_sdk.types import BaseModel
|
|
7
|
+
from compass_api_sdk.utils import validate_const
|
|
8
|
+
from enum import Enum
|
|
9
|
+
import pydantic
|
|
10
|
+
from pydantic.functional_validators import AfterValidator
|
|
11
|
+
from typing import Literal, Optional, Union
|
|
12
|
+
from typing_extensions import Annotated, TypeAliasType, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenInTypedDict = TypeAliasType(
|
|
16
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenInTypedDict",
|
|
17
|
+
Union[TokenEnum, str],
|
|
18
|
+
)
|
|
19
|
+
r"""The symbol or address of the token to sell.."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenIn = TypeAliasType(
|
|
23
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenIn",
|
|
24
|
+
Union[TokenEnum, str],
|
|
25
|
+
)
|
|
26
|
+
r"""The symbol or address of the token to sell.."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenOutTypedDict = TypeAliasType(
|
|
30
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenOutTypedDict",
|
|
31
|
+
Union[TokenEnum, str],
|
|
32
|
+
)
|
|
33
|
+
r"""The symbol or address of the token to buy.."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenOut = TypeAliasType(
|
|
37
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenOut",
|
|
38
|
+
Union[TokenEnum, str],
|
|
39
|
+
)
|
|
40
|
+
r"""The symbol or address of the token to buy.."""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestAmountInTypedDict = TypeAliasType(
|
|
44
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestAmountInTypedDict",
|
|
45
|
+
Union[float, str],
|
|
46
|
+
)
|
|
47
|
+
r"""The amount of the `token_in` to sell"""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestAmountIn = TypeAliasType(
|
|
51
|
+
"CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestAmountIn",
|
|
52
|
+
Union[float, str],
|
|
53
|
+
)
|
|
54
|
+
r"""The amount of the `token_in` to sell"""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestChain(
|
|
58
|
+
str, Enum
|
|
59
|
+
):
|
|
60
|
+
ARBITRUM = "arbitrum"
|
|
61
|
+
BASE = "base"
|
|
62
|
+
ETHEREUM = "ethereum"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTypedDict(
|
|
66
|
+
TypedDict
|
|
67
|
+
):
|
|
68
|
+
r"""Request model for selling exactly an amount of tokens."""
|
|
69
|
+
|
|
70
|
+
token_in: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenInTypedDict
|
|
71
|
+
r"""The symbol or address of the token to sell.."""
|
|
72
|
+
token_out: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenOutTypedDict
|
|
73
|
+
r"""The symbol or address of the token to buy.."""
|
|
74
|
+
fee: FeeEnum
|
|
75
|
+
r"""The transaction fee of a Uniswap pool in bips.
|
|
76
|
+
|
|
77
|
+
Uniswap supports 4 different fee levels.
|
|
78
|
+
"""
|
|
79
|
+
amount_in: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestAmountInTypedDict
|
|
80
|
+
r"""The amount of the `token_in` to sell"""
|
|
81
|
+
max_slippage_percent: float
|
|
82
|
+
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
83
|
+
chain: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestChain
|
|
84
|
+
sender: str
|
|
85
|
+
r"""The address of the transaction sender."""
|
|
86
|
+
action_type: Literal["UNISWAP_SELL_EXACTLY"]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequest(
|
|
90
|
+
BaseModel
|
|
91
|
+
):
|
|
92
|
+
r"""Request model for selling exactly an amount of tokens."""
|
|
93
|
+
|
|
94
|
+
token_in: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenIn
|
|
95
|
+
r"""The symbol or address of the token to sell.."""
|
|
96
|
+
|
|
97
|
+
token_out: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestTokenOut
|
|
98
|
+
r"""The symbol or address of the token to buy.."""
|
|
99
|
+
|
|
100
|
+
fee: FeeEnum
|
|
101
|
+
r"""The transaction fee of a Uniswap pool in bips.
|
|
102
|
+
|
|
103
|
+
Uniswap supports 4 different fee levels.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
amount_in: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestAmountIn
|
|
107
|
+
r"""The amount of the `token_in` to sell"""
|
|
108
|
+
|
|
109
|
+
max_slippage_percent: float
|
|
110
|
+
r"""The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed."""
|
|
111
|
+
|
|
112
|
+
chain: CompassAPIBackendModelsUniswapTransactSwapRequestSellExactlyUniswapSellExactlyRequestChain
|
|
113
|
+
|
|
114
|
+
sender: str
|
|
115
|
+
r"""The address of the transaction sender."""
|
|
116
|
+
|
|
117
|
+
ACTION_TYPE: Annotated[
|
|
118
|
+
Annotated[
|
|
119
|
+
Optional[Literal["UNISWAP_SELL_EXACTLY"]],
|
|
120
|
+
AfterValidator(validate_const("UNISWAP_SELL_EXACTLY")),
|
|
121
|
+
],
|
|
122
|
+
pydantic.Field(alias="action_type"),
|
|
123
|
+
] = "UNISWAP_SELL_EXACTLY"
|
|
@@ -21,7 +21,9 @@ from pydantic import model_serializer
|
|
|
21
21
|
from typing_extensions import NotRequired, TypedDict
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class CompassAPIBackendModelsVaultsReadResponseVaultVaultGetVaultResponseTypedDict(
|
|
25
|
+
TypedDict
|
|
26
|
+
):
|
|
25
27
|
name: str
|
|
26
28
|
r"""Name of the vault."""
|
|
27
29
|
symbol: str
|
|
@@ -42,7 +44,7 @@ class VaultGetVaultResponseTypedDict(TypedDict):
|
|
|
42
44
|
r"""The user's position in the vault."""
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
class
|
|
47
|
+
class CompassAPIBackendModelsVaultsReadResponseVaultVaultGetVaultResponse(BaseModel):
|
|
46
48
|
name: str
|
|
47
49
|
r"""Name of the vault."""
|
|
48
50
|
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
11
|
+
from compass_api_sdk.utils import validate_const
|
|
12
|
+
from enum import Enum
|
|
13
|
+
import pydantic
|
|
14
|
+
from pydantic import model_serializer
|
|
15
|
+
from pydantic.functional_validators import AfterValidator
|
|
16
|
+
from typing import Literal, Optional, Union
|
|
17
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestAmountTypedDict = TypeAliasType(
|
|
21
|
+
"CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestAmountTypedDict",
|
|
22
|
+
Union[float, str],
|
|
23
|
+
)
|
|
24
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestAmount = (
|
|
28
|
+
TypeAliasType(
|
|
29
|
+
"CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestAmount",
|
|
30
|
+
Union[float, str],
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestChain(
|
|
37
|
+
str, Enum
|
|
38
|
+
):
|
|
39
|
+
ARBITRUM = "arbitrum"
|
|
40
|
+
BASE = "base"
|
|
41
|
+
ETHEREUM = "ethereum"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestTypedDict(
|
|
45
|
+
TypedDict
|
|
46
|
+
):
|
|
47
|
+
vault_address: str
|
|
48
|
+
r"""The vault address you are depositing to."""
|
|
49
|
+
amount: CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestAmountTypedDict
|
|
50
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
51
|
+
chain: CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestChain
|
|
52
|
+
sender: str
|
|
53
|
+
r"""The address of the transaction sender."""
|
|
54
|
+
action_type: Literal["VAULT_DEPOSIT"]
|
|
55
|
+
receiver: NotRequired[Nullable[str]]
|
|
56
|
+
r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequest(BaseModel):
|
|
60
|
+
vault_address: str
|
|
61
|
+
r"""The vault address you are depositing to."""
|
|
62
|
+
|
|
63
|
+
amount: CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestAmount
|
|
64
|
+
r"""The amount of tokens to deposit into the vault."""
|
|
65
|
+
|
|
66
|
+
chain: CompassAPIBackendModelsVaultsTransactRequestDepositVaultDepositRequestChain
|
|
67
|
+
|
|
68
|
+
sender: str
|
|
69
|
+
r"""The address of the transaction sender."""
|
|
70
|
+
|
|
71
|
+
ACTION_TYPE: Annotated[
|
|
72
|
+
Annotated[
|
|
73
|
+
Optional[Literal["VAULT_DEPOSIT"]],
|
|
74
|
+
AfterValidator(validate_const("VAULT_DEPOSIT")),
|
|
75
|
+
],
|
|
76
|
+
pydantic.Field(alias="action_type"),
|
|
77
|
+
] = "VAULT_DEPOSIT"
|
|
78
|
+
|
|
79
|
+
receiver: OptionalNullable[str] = UNSET
|
|
80
|
+
r"""The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender."""
|
|
81
|
+
|
|
82
|
+
@model_serializer(mode="wrap")
|
|
83
|
+
def serialize_model(self, handler):
|
|
84
|
+
optional_fields = ["action_type", "receiver"]
|
|
85
|
+
nullable_fields = ["receiver"]
|
|
86
|
+
null_default_fields = []
|
|
87
|
+
|
|
88
|
+
serialized = handler(self)
|
|
89
|
+
|
|
90
|
+
m = {}
|
|
91
|
+
|
|
92
|
+
for n, f in type(self).model_fields.items():
|
|
93
|
+
k = f.alias or n
|
|
94
|
+
val = serialized.get(k)
|
|
95
|
+
serialized.pop(k, None)
|
|
96
|
+
|
|
97
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
98
|
+
is_set = (
|
|
99
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
100
|
+
or k in null_default_fields
|
|
101
|
+
) # pylint: disable=no-member
|
|
102
|
+
|
|
103
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
104
|
+
m[k] = val
|
|
105
|
+
elif val != UNSET_SENTINEL and (
|
|
106
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
107
|
+
):
|
|
108
|
+
m[k] = val
|
|
109
|
+
|
|
110
|
+
return m
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
11
|
+
from compass_api_sdk.utils import validate_const
|
|
12
|
+
from enum import Enum
|
|
13
|
+
import pydantic
|
|
14
|
+
from pydantic import model_serializer
|
|
15
|
+
from pydantic.functional_validators import AfterValidator
|
|
16
|
+
from typing import Any, Literal, Optional
|
|
17
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class CompassAPIBackendModelsVaultsTransactRequestWithdrawVaultWithdrawRequestChain(
|
|
21
|
+
str, Enum
|
|
22
|
+
):
|
|
23
|
+
ARBITRUM = "arbitrum"
|
|
24
|
+
BASE = "base"
|
|
25
|
+
ETHEREUM = "ethereum"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class CompassAPIBackendModelsVaultsTransactRequestWithdrawVaultWithdrawRequestTypedDict(
|
|
29
|
+
TypedDict
|
|
30
|
+
):
|
|
31
|
+
vault_address: str
|
|
32
|
+
r"""The vault address you are withdrawing from."""
|
|
33
|
+
amount: Any
|
|
34
|
+
r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
|
|
35
|
+
chain: CompassAPIBackendModelsVaultsTransactRequestWithdrawVaultWithdrawRequestChain
|
|
36
|
+
sender: str
|
|
37
|
+
r"""The address of the transaction sender."""
|
|
38
|
+
action_type: Literal["VAULT_WITHDRAW"]
|
|
39
|
+
receiver: NotRequired[Nullable[str]]
|
|
40
|
+
r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class CompassAPIBackendModelsVaultsTransactRequestWithdrawVaultWithdrawRequest(
|
|
44
|
+
BaseModel
|
|
45
|
+
):
|
|
46
|
+
vault_address: str
|
|
47
|
+
r"""The vault address you are withdrawing from."""
|
|
48
|
+
|
|
49
|
+
amount: Any
|
|
50
|
+
r"""The amount of tokens to withdraw from the vault. If set to 'ALL', your total deposited token amount will be withdrawn."""
|
|
51
|
+
|
|
52
|
+
chain: CompassAPIBackendModelsVaultsTransactRequestWithdrawVaultWithdrawRequestChain
|
|
53
|
+
|
|
54
|
+
sender: str
|
|
55
|
+
r"""The address of the transaction sender."""
|
|
56
|
+
|
|
57
|
+
ACTION_TYPE: Annotated[
|
|
58
|
+
Annotated[
|
|
59
|
+
Optional[Literal["VAULT_WITHDRAW"]],
|
|
60
|
+
AfterValidator(validate_const("VAULT_WITHDRAW")),
|
|
61
|
+
],
|
|
62
|
+
pydantic.Field(alias="action_type"),
|
|
63
|
+
] = "VAULT_WITHDRAW"
|
|
64
|
+
|
|
65
|
+
receiver: OptionalNullable[str] = UNSET
|
|
66
|
+
r"""The address which will receive the tokens withdrawn. Defaults to the sender."""
|
|
67
|
+
|
|
68
|
+
@model_serializer(mode="wrap")
|
|
69
|
+
def serialize_model(self, handler):
|
|
70
|
+
optional_fields = ["action_type", "receiver"]
|
|
71
|
+
nullable_fields = ["receiver"]
|
|
72
|
+
null_default_fields = []
|
|
73
|
+
|
|
74
|
+
serialized = handler(self)
|
|
75
|
+
|
|
76
|
+
m = {}
|
|
77
|
+
|
|
78
|
+
for n, f in type(self).model_fields.items():
|
|
79
|
+
k = f.alias or n
|
|
80
|
+
val = serialized.get(k)
|
|
81
|
+
serialized.pop(k, None)
|
|
82
|
+
|
|
83
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
84
|
+
is_set = (
|
|
85
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
86
|
+
or k in null_default_fields
|
|
87
|
+
) # pylint: disable=no-member
|
|
88
|
+
|
|
89
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
90
|
+
m[k] = val
|
|
91
|
+
elif val != UNSET_SENTINEL and (
|
|
92
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
93
|
+
):
|
|
94
|
+
m[k] = val
|
|
95
|
+
|
|
96
|
+
return m
|
|
@@ -3,9 +3,16 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .movement10percent import Movement10Percent, Movement10PercentTypedDict
|
|
5
5
|
from .yieldrange import YieldRange, YieldRangeTypedDict
|
|
6
|
-
from compass_api_sdk.types import
|
|
6
|
+
from compass_api_sdk.types import (
|
|
7
|
+
BaseModel,
|
|
8
|
+
Nullable,
|
|
9
|
+
OptionalNullable,
|
|
10
|
+
UNSET,
|
|
11
|
+
UNSET_SENTINEL,
|
|
12
|
+
)
|
|
7
13
|
import pydantic
|
|
8
|
-
from
|
|
14
|
+
from pydantic import model_serializer
|
|
15
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
16
|
|
|
10
17
|
|
|
11
18
|
class DetailsTypedDict(TypedDict):
|
|
@@ -13,10 +20,10 @@ class DetailsTypedDict(TypedDict):
|
|
|
13
20
|
pendle_apy: float
|
|
14
21
|
implied_apy: float
|
|
15
22
|
fee_rate: float
|
|
16
|
-
movement10_percent: Movement10PercentTypedDict
|
|
17
23
|
yield_range: YieldRangeTypedDict
|
|
18
24
|
aggregated_apy: float
|
|
19
25
|
max_boosted_apy: float
|
|
26
|
+
movement10_percent: NotRequired[Nullable[Movement10PercentTypedDict]]
|
|
20
27
|
|
|
21
28
|
|
|
22
29
|
class Details(BaseModel):
|
|
@@ -28,12 +35,42 @@ class Details(BaseModel):
|
|
|
28
35
|
|
|
29
36
|
fee_rate: Annotated[float, pydantic.Field(alias="feeRate")]
|
|
30
37
|
|
|
31
|
-
movement10_percent: Annotated[
|
|
32
|
-
Movement10Percent, pydantic.Field(alias="movement10Percent")
|
|
33
|
-
]
|
|
34
|
-
|
|
35
38
|
yield_range: Annotated[YieldRange, pydantic.Field(alias="yieldRange")]
|
|
36
39
|
|
|
37
40
|
aggregated_apy: Annotated[float, pydantic.Field(alias="aggregatedApy")]
|
|
38
41
|
|
|
39
42
|
max_boosted_apy: Annotated[float, pydantic.Field(alias="maxBoostedApy")]
|
|
43
|
+
|
|
44
|
+
movement10_percent: Annotated[
|
|
45
|
+
OptionalNullable[Movement10Percent], pydantic.Field(alias="movement10Percent")
|
|
46
|
+
] = UNSET
|
|
47
|
+
|
|
48
|
+
@model_serializer(mode="wrap")
|
|
49
|
+
def serialize_model(self, handler):
|
|
50
|
+
optional_fields = ["movement10Percent"]
|
|
51
|
+
nullable_fields = ["movement10Percent"]
|
|
52
|
+
null_default_fields = []
|
|
53
|
+
|
|
54
|
+
serialized = handler(self)
|
|
55
|
+
|
|
56
|
+
m = {}
|
|
57
|
+
|
|
58
|
+
for n, f in type(self).model_fields.items():
|
|
59
|
+
k = f.alias or n
|
|
60
|
+
val = serialized.get(k)
|
|
61
|
+
serialized.pop(k, None)
|
|
62
|
+
|
|
63
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
64
|
+
is_set = (
|
|
65
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
66
|
+
or k in null_default_fields
|
|
67
|
+
) # pylint: disable=no-member
|
|
68
|
+
|
|
69
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
70
|
+
m[k] = val
|
|
71
|
+
elif val != UNSET_SENTINEL and (
|
|
72
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
73
|
+
):
|
|
74
|
+
m[k] = val
|
|
75
|
+
|
|
76
|
+
return m
|
|
@@ -1,23 +1,78 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from compass_api_sdk.types import
|
|
4
|
+
from compass_api_sdk.types import (
|
|
5
|
+
BaseModel,
|
|
6
|
+
Nullable,
|
|
7
|
+
OptionalNullable,
|
|
8
|
+
UNSET,
|
|
9
|
+
UNSET_SENTINEL,
|
|
10
|
+
)
|
|
5
11
|
import pydantic
|
|
6
|
-
from
|
|
12
|
+
from pydantic import model_serializer
|
|
13
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
7
14
|
|
|
8
15
|
|
|
9
16
|
class Movement10PercentTypedDict(TypedDict):
|
|
10
|
-
pt_movement_up_usd: float
|
|
11
|
-
pt_movement_down_usd: float
|
|
12
|
-
yt_movement_up_usd: float
|
|
13
|
-
yt_movement_down_usd: float
|
|
17
|
+
pt_movement_up_usd: NotRequired[Nullable[float]]
|
|
18
|
+
pt_movement_down_usd: NotRequired[Nullable[float]]
|
|
19
|
+
yt_movement_up_usd: NotRequired[Nullable[float]]
|
|
20
|
+
yt_movement_down_usd: NotRequired[Nullable[float]]
|
|
14
21
|
|
|
15
22
|
|
|
16
23
|
class Movement10Percent(BaseModel):
|
|
17
|
-
pt_movement_up_usd: Annotated[
|
|
24
|
+
pt_movement_up_usd: Annotated[
|
|
25
|
+
OptionalNullable[float], pydantic.Field(alias="ptMovementUpUsd")
|
|
26
|
+
] = UNSET
|
|
18
27
|
|
|
19
|
-
pt_movement_down_usd: Annotated[
|
|
28
|
+
pt_movement_down_usd: Annotated[
|
|
29
|
+
OptionalNullable[float], pydantic.Field(alias="ptMovementDownUsd")
|
|
30
|
+
] = UNSET
|
|
20
31
|
|
|
21
|
-
yt_movement_up_usd: Annotated[
|
|
32
|
+
yt_movement_up_usd: Annotated[
|
|
33
|
+
OptionalNullable[float], pydantic.Field(alias="ytMovementUpUsd")
|
|
34
|
+
] = UNSET
|
|
22
35
|
|
|
23
|
-
yt_movement_down_usd: Annotated[
|
|
36
|
+
yt_movement_down_usd: Annotated[
|
|
37
|
+
OptionalNullable[float], pydantic.Field(alias="ytMovementDownUsd")
|
|
38
|
+
] = UNSET
|
|
39
|
+
|
|
40
|
+
@model_serializer(mode="wrap")
|
|
41
|
+
def serialize_model(self, handler):
|
|
42
|
+
optional_fields = [
|
|
43
|
+
"ptMovementUpUsd",
|
|
44
|
+
"ptMovementDownUsd",
|
|
45
|
+
"ytMovementUpUsd",
|
|
46
|
+
"ytMovementDownUsd",
|
|
47
|
+
]
|
|
48
|
+
nullable_fields = [
|
|
49
|
+
"ptMovementUpUsd",
|
|
50
|
+
"ptMovementDownUsd",
|
|
51
|
+
"ytMovementUpUsd",
|
|
52
|
+
"ytMovementDownUsd",
|
|
53
|
+
]
|
|
54
|
+
null_default_fields = []
|
|
55
|
+
|
|
56
|
+
serialized = handler(self)
|
|
57
|
+
|
|
58
|
+
m = {}
|
|
59
|
+
|
|
60
|
+
for n, f in type(self).model_fields.items():
|
|
61
|
+
k = f.alias or n
|
|
62
|
+
val = serialized.get(k)
|
|
63
|
+
serialized.pop(k, None)
|
|
64
|
+
|
|
65
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
66
|
+
is_set = (
|
|
67
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
68
|
+
or k in null_default_fields
|
|
69
|
+
) # pylint: disable=no-member
|
|
70
|
+
|
|
71
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
72
|
+
m[k] = val
|
|
73
|
+
elif val != UNSET_SENTINEL and (
|
|
74
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
75
|
+
):
|
|
76
|
+
m[k] = val
|
|
77
|
+
|
|
78
|
+
return m
|