compass_api_sdk 0.9.35__py3-none-any.whl → 2.0.21rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- compass_api_sdk/_hooks/sdkhooks.py +4 -4
- compass_api_sdk/_hooks/types.py +1 -2
- compass_api_sdk/_version.py +3 -3
- compass_api_sdk/aave_v3.py +971 -728
- compass_api_sdk/aerodrome_slipstream.py +367 -390
- compass_api_sdk/basesdk.py +21 -5
- compass_api_sdk/bridge.py +536 -0
- compass_api_sdk/earn.py +1780 -0
- compass_api_sdk/erc_4626_vaults.py +127 -154
- compass_api_sdk/errors/__init__.py +38 -4
- compass_api_sdk/errors/apierror.py +32 -14
- compass_api_sdk/errors/compassapierror.py +30 -0
- compass_api_sdk/errors/httpvalidationerror.py +15 -8
- compass_api_sdk/errors/mintpreparenotfoundresponse_error.py +49 -0
- compass_api_sdk/errors/no_response_error.py +17 -0
- compass_api_sdk/errors/responsevalidationerror.py +27 -0
- compass_api_sdk/{token_sdk.py → ethena.py} +318 -293
- compass_api_sdk/gas_sponsorship.py +446 -0
- compass_api_sdk/httpclient.py +0 -1
- compass_api_sdk/models/__init__.py +1701 -945
- compass_api_sdk/models/aaveborrowparams.py +4 -13
- compass_api_sdk/models/aaveborrowrequest.py +19 -19
- compass_api_sdk/models/aavehistoricaltransactionsresponse.py +8 -8
- compass_api_sdk/models/aavelooprequest.py +88 -36
- compass_api_sdk/models/aaveposition.py +49 -0
- compass_api_sdk/models/aaverepayparams.py +4 -13
- compass_api_sdk/models/aaverepayrequest.py +19 -19
- compass_api_sdk/models/aavereserveoverviewresponse.py +34 -3
- compass_api_sdk/models/aavesetuseremodeparams.py +28 -0
- compass_api_sdk/models/aavesetuseremoderequest.py +48 -0
- compass_api_sdk/models/aavesupplyparams.py +4 -13
- compass_api_sdk/models/aavesupplyrequest.py +19 -19
- compass_api_sdk/models/aavesupportedtokenmetadata.py +30 -0
- compass_api_sdk/models/aavesupportedtokensresponse.py +20 -0
- compass_api_sdk/models/aavevenue.py +27 -0
- compass_api_sdk/models/aavewithdrawparams.py +4 -13
- compass_api_sdk/models/aavewithdrawrequest.py +19 -19
- compass_api_sdk/models/aerodromeenrichedposition.py +109 -0
- compass_api_sdk/models/aerodromelppositionsresponse.py +10 -7
- compass_api_sdk/models/aerodromeslipstreambuyexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreambuyexactlyrequest.py +21 -31
- compass_api_sdk/models/aerodromeslipstreamincreaseliquidityprovisionrequest.py +13 -6
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreammintliquidityprovisionrequest.py +21 -31
- compass_api_sdk/models/aerodromeslipstreampoolpriceresponse.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyparams.py +8 -25
- compass_api_sdk/models/aerodromeslipstreamsellexactlyrequest.py +20 -30
- compass_api_sdk/models/aerodromeslipstreamwithdrawliquidityprovisionrequest.py +13 -6
- compass_api_sdk/models/approvetransferrequest.py +32 -0
- compass_api_sdk/models/{curator.py → approvetransferresponse.py} +12 -13
- compass_api_sdk/models/apy.py +3 -0
- compass_api_sdk/models/batchedsafeoperationsresponse_input.py +52 -0
- compass_api_sdk/models/batchedsafeoperationsresponse_output.py +52 -0
- compass_api_sdk/models/batcheduseroperationsrequest.py +24 -9
- compass_api_sdk/models/bundlertransactionresponse.py +17 -0
- compass_api_sdk/models/chain.py +3 -3
- compass_api_sdk/models/chainmarketinfo.py +29 -0
- compass_api_sdk/models/{compass_api_backend_models_generic_read_response_portfolio_tokenbalance.py → compass_api_backend_v1_models_generic_read_response_portfolio_tokenbalance.py} +6 -15
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_apydata.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_apydata.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_asset.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_asset.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_marketstate.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_marketstate.py} +4 -2
- compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultposition.py +30 -0
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_check_user_position_vaultstate.py → compass_api_backend_v1_models_morpho_read_response_check_user_position_vaultstate.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_apydata.py → compass_api_backend_v1_models_morpho_read_response_get_market_apydata.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vault_asset.py → compass_api_backend_v1_models_morpho_read_response_get_market_asset.py} +5 -5
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_marketstate.py → compass_api_backend_v1_models_morpho_read_response_get_market_marketstate.py} +4 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_asset.py → compass_api_backend_v1_models_morpho_read_response_get_markets_asset.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_markets_marketstate.py → compass_api_backend_v1_models_morpho_read_response_get_markets_marketstate.py} +2 -2
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_vaults_asset.py → compass_api_backend_v1_models_morpho_read_response_get_vaults_asset.py} +2 -2
- compass_api_sdk/models/compass_api_backend_v1_models_morpho_read_response_get_vaults_vaultstate.py +73 -0
- compass_api_sdk/models/compass_api_backend_v1_models_pendle_read_response_market_userposition.py +82 -0
- compass_api_sdk/models/{compass_api_backend_models_pendle_read_response_positions_tokenbalance.py → compass_api_backend_v1_models_pendle_read_response_positions_tokenbalance.py} +2 -2
- compass_api_sdk/models/compass_api_backend_v1_models_vaults_read_response_vault_userposition.py +20 -0
- compass_api_sdk/models/compass_api_backend_v1_models_wildcat_read_response_market_userposition.py +22 -0
- compass_api_sdk/models/compass_api_backend_v2_models_earn_read_response_positions_vaultposition.py +49 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712domain.py +36 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_2_typed_data_eip712types.py +36 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712domain.py +37 -0
- compass_api_sdk/models/compass_api_backend_v2_models_gas_sponsorship_permit_typed_data_eip712types.py +32 -0
- compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712domain.py +29 -0
- compass_api_sdk/models/compass_api_backend_v2_models_safe_transact_response_batched_safe_operations_eip712types.py +34 -0
- compass_api_sdk/models/cooldownposition.py +35 -0
- compass_api_sdk/models/createaccountrequest.py +40 -0
- compass_api_sdk/models/createaccountresponse.py +56 -0
- compass_api_sdk/models/depositforburnrequest.py +77 -0
- compass_api_sdk/models/depositforburnresponse.py +100 -0
- compass_api_sdk/models/details.py +44 -7
- compass_api_sdk/models/earnmanageparams.py +74 -0
- compass_api_sdk/models/earnmanagerequest.py +130 -0
- compass_api_sdk/models/{compass_api_backend_models_morpho_read_response_get_market_asset.py → earnmanageresponse.py} +13 -21
- compass_api_sdk/models/earnpositionsresponse.py +39 -0
- compass_api_sdk/models/earnswapparams.py +74 -0
- compass_api_sdk/models/earnswaprequest.py +90 -0
- compass_api_sdk/models/earnswapresponse.py +55 -0
- compass_api_sdk/models/earntransferrequest.py +104 -0
- compass_api_sdk/models/earntransferresponse.py +71 -0
- compass_api_sdk/models/eip712domainfield.py +20 -0
- compass_api_sdk/models/eip712field.py +20 -0
- compass_api_sdk/models/ethenadepositparams.py +82 -0
- compass_api_sdk/models/ethenadepositrequest.py +100 -0
- compass_api_sdk/models/ethenagetvaultresponse.py +109 -0
- compass_api_sdk/models/ethenarequesttowithdrawparams.py +28 -0
- compass_api_sdk/models/ethenarequesttowithdrawrequest.py +46 -0
- compass_api_sdk/models/ethenarequesttowithdrawtransactionresponse.py +37 -0
- compass_api_sdk/models/ethenaunstakeparams.py +65 -0
- compass_api_sdk/models/ethenaunstakerequest.py +83 -0
- compass_api_sdk/models/fee.py +42 -0
- compass_api_sdk/models/listaavemarketsresponse.py +21 -0
- compass_api_sdk/models/marketposition.py +5 -5
- compass_api_sdk/models/maxsupplyapyinfo.py +34 -0
- compass_api_sdk/models/mintpreparecompletedresponse.py +46 -0
- compass_api_sdk/models/mintpreparependingresponse.py +65 -0
- compass_api_sdk/models/mintpreparereadyresponse.py +43 -0
- compass_api_sdk/models/mintpreparerequest.py +25 -0
- compass_api_sdk/models/morphoborrowrequest.py +9 -3
- compass_api_sdk/models/morphocheckuserpositionresponse.py +9 -3
- compass_api_sdk/models/morphodepositrequest.py +9 -3
- compass_api_sdk/models/morphogetmarketresponse.py +72 -31
- compass_api_sdk/models/morphomarket.py +26 -20
- compass_api_sdk/models/morphorepayrequest.py +14 -3
- compass_api_sdk/models/morphosupplycollateralrequest.py +14 -3
- compass_api_sdk/models/morphovault.py +10 -10
- compass_api_sdk/models/morphowithdrawcollateralrequest.py +9 -3
- compass_api_sdk/models/morphowithdrawrequest.py +9 -3
- compass_api_sdk/models/movement10percent.py +65 -10
- compass_api_sdk/models/multicallauthorizationrequest.py +9 -9
- compass_api_sdk/models/multicallexecuterequest.py +59 -11
- compass_api_sdk/models/odosswapparams.py +52 -0
- compass_api_sdk/models/odosswaprequest.py +72 -0
- compass_api_sdk/models/odostransactionresponse.py +37 -0
- compass_api_sdk/models/oneinchswapparams.py +59 -0
- compass_api_sdk/models/openposition.py +7 -7
- compass_api_sdk/models/operationtype.py +11 -0
- compass_api_sdk/models/pendlegetmarketresponse.py +52 -2
- compass_api_sdk/models/pendlemanageliquidityparams.py +68 -0
- compass_api_sdk/models/pendlemanageliquidityrequest.py +87 -0
- compass_api_sdk/models/pendleredeemyieldrequest.py +15 -6
- compass_api_sdk/models/pendletradeptparams.py +68 -0
- compass_api_sdk/models/pendletradeptrequest.py +87 -0
- compass_api_sdk/models/pendletradeytparams.py +68 -0
- compass_api_sdk/models/pendletradeytrequest.py +87 -0
- compass_api_sdk/models/pendletxresponse.py +36 -0
- compass_api_sdk/models/permit2typeddata_input.py +46 -0
- compass_api_sdk/models/permit2typeddata_output.py +46 -0
- compass_api_sdk/models/permitfield.py +20 -0
- compass_api_sdk/models/permitmessage.py +39 -0
- compass_api_sdk/models/permittransferfrommessage.py +29 -0
- compass_api_sdk/models/permittypeddataresponse_input.py +50 -0
- compass_api_sdk/models/permittypeddataresponse_output.py +50 -0
- compass_api_sdk/models/portfolio.py +5 -5
- compass_api_sdk/models/protocol.py +13 -0
- compass_api_sdk/models/reserve.py +6 -15
- compass_api_sdk/models/safetransactionparams.py +78 -0
- compass_api_sdk/models/safetransactionresponse.py +28 -0
- compass_api_sdk/models/safetxfield.py +20 -0
- compass_api_sdk/models/safetxmessage.py +66 -0
- compass_api_sdk/models/setallowanceparams.py +5 -16
- compass_api_sdk/models/setallowancerequest.py +19 -22
- compass_api_sdk/models/skybuyrequest.py +12 -9
- compass_api_sdk/models/skydepositrequest.py +13 -9
- compass_api_sdk/models/skysellrequest.py +12 -9
- compass_api_sdk/models/skywithdrawrequest.py +13 -9
- compass_api_sdk/models/sponsorgasrequest.py +71 -0
- compass_api_sdk/models/sponsorgasresponse.py +14 -0
- compass_api_sdk/models/supportedchaininfo.py +19 -0
- compass_api_sdk/models/tokenbalanceresponse.py +5 -15
- compass_api_sdk/models/tokenconfig.py +30 -0
- compass_api_sdk/models/tokenlistresponse.py +21 -0
- compass_api_sdk/models/tokenmarketdata.py +27 -0
- compass_api_sdk/models/tokenpermissions.py +20 -0
- compass_api_sdk/models/tokentransferparams.py +54 -0
- compass_api_sdk/models/tokentransferrequest.py +23 -27
- compass_api_sdk/models/transactionresponse.py +31 -0
- compass_api_sdk/models/{compass_api_backend_models_vaults_read_response_vault_asset.py → underlyingtoken.py} +2 -2
- compass_api_sdk/models/uniswapbuyexactlyparams.py +19 -41
- compass_api_sdk/models/uniswapbuyexactlyrequest.py +31 -44
- compass_api_sdk/models/uniswapbuyexactlytransactionresponse.py +37 -0
- compass_api_sdk/models/uniswapincreaseliquidityprovisionrequest.py +15 -6
- compass_api_sdk/models/uniswapmintliquidityprovisionparams.py +8 -25
- compass_api_sdk/models/uniswapmintliquidityprovisionrequest.py +23 -31
- compass_api_sdk/models/uniswappoolpriceresponse.py +8 -25
- compass_api_sdk/models/uniswappositionssolidityresponse.py +42 -2
- compass_api_sdk/models/uniswapsellexactlyparams.py +19 -41
- compass_api_sdk/models/uniswapsellexactlyrequest.py +31 -44
- compass_api_sdk/models/uniswapsellexactlytransactionresponse.py +37 -0
- compass_api_sdk/models/uniswapwithdrawliquidityprovisionrequest.py +15 -6
- compass_api_sdk/models/unsignedmulticalltransaction.py +44 -13
- compass_api_sdk/models/unsignedtransaction.py +44 -13
- compass_api_sdk/models/unwrapwethrequest.py +15 -6
- compass_api_sdk/models/useroperation.py +61 -49
- compass_api_sdk/models/useroperationresponse.py +2 -2
- compass_api_sdk/models/userstate.py +3 -3
- compass_api_sdk/models/v1_aave_aave_supported_tokensop.py +69 -0
- compass_api_sdk/models/v1_aave_avg_rateop.py +83 -0
- compass_api_sdk/models/{aave_historical_transactionsop.py → v1_aave_historical_transactionsop.py} +21 -25
- compass_api_sdk/models/v1_aave_liquidity_changeop.py +45 -0
- compass_api_sdk/models/{pendle_marketop.py → v1_aave_rateop.py} +16 -20
- compass_api_sdk/models/v1_aave_reserve_overviewop.py +76 -0
- compass_api_sdk/models/v1_aave_std_rateop.py +83 -0
- compass_api_sdk/models/v1_aave_token_priceop.py +76 -0
- compass_api_sdk/models/v1_aave_user_position_per_tokenop.py +83 -0
- compass_api_sdk/models/{aave_user_position_summaryop.py → v1_aave_user_position_summaryop.py} +16 -20
- compass_api_sdk/models/v1_aerodrome_slipstream_liquidity_provision_positionsop.py +76 -0
- compass_api_sdk/models/v1_aerodrome_slipstream_pool_priceop.py +45 -0
- compass_api_sdk/models/v1_ethena_vaultop.py +75 -0
- compass_api_sdk/models/{generic_allowanceop.py → v1_generic_allowanceop.py} +28 -41
- compass_api_sdk/models/{generic_ensop.py → v1_generic_ensop.py} +8 -14
- compass_api_sdk/models/{generic_portfolioop.py → v1_generic_portfolioop.py} +10 -14
- compass_api_sdk/models/v1_generic_supported_chainsop.py +57 -0
- compass_api_sdk/models/{morpho_market_positionop.py → v1_morpho_market_positionop.py} +11 -10
- compass_api_sdk/models/{morpho_marketop.py → v1_morpho_marketop.py} +10 -9
- compass_api_sdk/models/{morpho_marketsop.py → v1_morpho_marketsop.py} +13 -12
- compass_api_sdk/models/{morpho_user_positionop.py → v1_morpho_user_positionop.py} +10 -9
- compass_api_sdk/models/{vaults_vaultop.py → v1_morpho_vaultop.py} +16 -20
- compass_api_sdk/models/{morpho_vaultsop.py → v1_morpho_vaultsop.py} +11 -10
- compass_api_sdk/models/{pendle_positionop.py → v1_pendle_marketop.py} +24 -27
- compass_api_sdk/models/v1_pendle_marketsop.py +24 -0
- compass_api_sdk/models/{pendle_positionsop.py → v1_pendle_positionsop.py} +10 -14
- compass_api_sdk/models/v1_sky_positionop.py +29 -0
- compass_api_sdk/models/v1_token_balanceop.py +38 -0
- compass_api_sdk/models/v1_token_listop.py +24 -0
- compass_api_sdk/models/v1_token_priceop.py +76 -0
- compass_api_sdk/models/v1_transaction_bundler_aave_loopop.py +27 -0
- compass_api_sdk/models/{uniswap_liquidity_provision_in_rangeop.py → v1_uniswap_liquidity_provision_in_rangeop.py} +10 -14
- compass_api_sdk/models/{uniswap_liquidity_provision_positionsop.py → v1_uniswap_liquidity_provision_positionsop.py} +10 -14
- compass_api_sdk/models/v1_uniswap_pool_priceop.py +58 -0
- compass_api_sdk/models/v1_uniswap_quote_buy_exactlyop.py +79 -0
- compass_api_sdk/models/v1_uniswap_quote_sell_exactlyop.py +79 -0
- compass_api_sdk/models/v1_vaults_vaultop.py +84 -0
- compass_api_sdk/models/v1_wildcat_marketop.py +82 -0
- compass_api_sdk/models/v2_cctp_mintop.py +47 -0
- compass_api_sdk/models/v2_earn_aave_marketsop.py +57 -0
- compass_api_sdk/models/v2_earn_positionsop.py +56 -0
- compass_api_sdk/models/v2_earn_vaultsop.py +105 -0
- compass_api_sdk/models/v2bundlerequest.py +33 -0
- compass_api_sdk/models/v2bundleresponse.py +67 -0
- compass_api_sdk/models/v2useroperation.py +37 -0
- compass_api_sdk/models/vault.py +14 -14
- compass_api_sdk/models/vaultdepositparams.py +85 -0
- compass_api_sdk/models/vaultdepositrequest.py +15 -6
- compass_api_sdk/models/vaultgetvaultresponse.py +21 -11
- compass_api_sdk/models/vaultinfo.py +129 -0
- compass_api_sdk/models/vaultsresponse.py +30 -0
- compass_api_sdk/models/vaultvenue.py +27 -0
- compass_api_sdk/models/vaultwithdrawparams.py +75 -0
- compass_api_sdk/models/vaultwithdrawrequest.py +15 -6
- compass_api_sdk/models/wildcatgetmarketresponse.py +151 -0
- compass_api_sdk/models/{redeemunderlying.py → withdraw.py} +2 -2
- compass_api_sdk/models/wrapethrequest.py +15 -6
- compass_api_sdk/morpho.py +481 -816
- compass_api_sdk/pendle.py +495 -1384
- compass_api_sdk/sdk.py +39 -13
- compass_api_sdk/sky.py +275 -240
- compass_api_sdk/smart_account.py +37 -50
- compass_api_sdk/swap.py +248 -0
- compass_api_sdk/token.py +1192 -0
- compass_api_sdk/transaction_bundler.py +151 -184
- compass_api_sdk/uniswap_v3.py +531 -620
- compass_api_sdk/universal.py +181 -932
- compass_api_sdk/utils/__init__.py +18 -5
- compass_api_sdk/utils/annotations.py +32 -8
- compass_api_sdk/utils/eventstreaming.py +10 -0
- compass_api_sdk/utils/forms.py +21 -10
- compass_api_sdk/utils/queryparams.py +14 -2
- compass_api_sdk/utils/retries.py +69 -5
- compass_api_sdk/utils/serializers.py +3 -2
- compass_api_sdk/utils/unmarshal_json_response.py +38 -0
- compass_api_sdk/wildcat.py +208 -0
- compass_api_sdk-2.0.21rc1.dist-info/METADATA +623 -0
- compass_api_sdk-2.0.21rc1.dist-info/RECORD +346 -0
- {compass_api_sdk-0.9.35.dist-info → compass_api_sdk-2.0.21rc1.dist-info}/WHEEL +1 -1
- compass_api_sdk/models/aave_avg_rateop.py +0 -141
- compass_api_sdk/models/aave_liquidity_changeop.py +0 -103
- compass_api_sdk/models/aave_rateop.py +0 -134
- compass_api_sdk/models/aave_reserve_overviewop.py +0 -134
- compass_api_sdk/models/aave_std_rateop.py +0 -141
- compass_api_sdk/models/aave_token_priceop.py +0 -134
- compass_api_sdk/models/aave_user_position_per_tokenop.py +0 -141
- compass_api_sdk/models/aerodrome_slipstream_liquidity_provision_positionsop.py +0 -37
- compass_api_sdk/models/aerodrome_slipstream_pool_priceop.py +0 -159
- compass_api_sdk/models/aerodromeposition.py +0 -70
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vault_vaultstate.py +0 -53
- compass_api_sdk/models/compass_api_backend_models_morpho_read_response_get_vaults_vaultstate.py +0 -32
- compass_api_sdk/models/generic_supported_tokensop.py +0 -28
- compass_api_sdk/models/generic_visualize_portfolioop.py +0 -37
- compass_api_sdk/models/image.py +0 -15
- compass_api_sdk/models/liquidity.py +0 -16
- compass_api_sdk/models/metadata.py +0 -50
- compass_api_sdk/models/morpho_vault_positionop.py +0 -37
- compass_api_sdk/models/morpho_vaultop.py +0 -30
- compass_api_sdk/models/morphocheckvaultpositionresponse.py +0 -20
- compass_api_sdk/models/morphogetvaultresponse.py +0 -86
- compass_api_sdk/models/pendle_marketsop.py +0 -28
- compass_api_sdk/models/pendleaddliquidityparams.py +0 -50
- compass_api_sdk/models/pendleaddliquidityrequest.py +0 -61
- compass_api_sdk/models/pendlebuyptparams.py +0 -48
- compass_api_sdk/models/pendlebuyptrequest.py +0 -59
- compass_api_sdk/models/pendlebuyytparams.py +0 -48
- compass_api_sdk/models/pendlebuyytrequest.py +0 -59
- compass_api_sdk/models/pendlegetuserpositionresponse.py +0 -56
- compass_api_sdk/models/pendleremoveliquidityparams.py +0 -50
- compass_api_sdk/models/pendleremoveliquidityrequest.py +0 -61
- compass_api_sdk/models/pendlesellptparams.py +0 -48
- compass_api_sdk/models/pendlesellptrequest.py +0 -61
- compass_api_sdk/models/pendlesellytparams.py +0 -48
- compass_api_sdk/models/pendlesellytrequest.py +0 -61
- compass_api_sdk/models/sky_positionop.py +0 -31
- compass_api_sdk/models/token_addressop.py +0 -89
- compass_api_sdk/models/token_balanceop.py +0 -55
- compass_api_sdk/models/token_enum.py +0 -57
- compass_api_sdk/models/token_priceop.py +0 -89
- compass_api_sdk/models/tokenaddressresponse.py +0 -15
- compass_api_sdk/models/tokeninfo.py +0 -17
- compass_api_sdk/models/tokentransfererc20params.py +0 -63
- compass_api_sdk/models/txresponse.py +0 -27
- compass_api_sdk/models/uniswap_pool_priceop.py +0 -170
- compass_api_sdk/models/uniswap_quote_buy_exactlyop.py +0 -191
- compass_api_sdk/models/uniswap_quote_sell_exactlyop.py +0 -191
- compass_api_sdk/models/userposition.py +0 -16
- compass_api_sdk/models/vaultposition.py +0 -24
- compass_api_sdk-0.9.35.dist-info/METADATA +0 -558
- compass_api_sdk-0.9.35.dist-info/RECORD +0 -260
compass_api_sdk/sky.py
CHANGED
|
@@ -4,14 +4,16 @@ from .basesdk import BaseSDK
|
|
|
4
4
|
from compass_api_sdk import errors, models, utils
|
|
5
5
|
from compass_api_sdk._hooks import HookContext
|
|
6
6
|
from compass_api_sdk.types import OptionalNullable, UNSET
|
|
7
|
+
from compass_api_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
7
8
|
from typing import Any, Mapping, Optional, Union
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class Sky(BaseSDK):
|
|
11
|
-
def
|
|
12
|
+
def sky_position(
|
|
12
13
|
self,
|
|
13
14
|
*,
|
|
14
|
-
|
|
15
|
+
chain: models.V1SkyPositionChain,
|
|
16
|
+
user_address: str,
|
|
15
17
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
16
18
|
server_url: Optional[str] = None,
|
|
17
19
|
timeout_ms: Optional[int] = None,
|
|
@@ -21,7 +23,8 @@ class Sky(BaseSDK):
|
|
|
21
23
|
|
|
22
24
|
Check the USDS overall position.
|
|
23
25
|
|
|
24
|
-
:param
|
|
26
|
+
:param chain:
|
|
27
|
+
:param user_address: The user-address of the desired position.
|
|
25
28
|
:param retries: Override the default retry configuration for this method
|
|
26
29
|
:param server_url: Override the default server URL for this method
|
|
27
30
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -37,13 +40,14 @@ class Sky(BaseSDK):
|
|
|
37
40
|
else:
|
|
38
41
|
base_url = self._get_url(base_url, url_variables)
|
|
39
42
|
|
|
40
|
-
request = models.
|
|
43
|
+
request = models.V1SkyPositionRequest(
|
|
44
|
+
chain=chain,
|
|
41
45
|
user_address=user_address,
|
|
42
46
|
)
|
|
43
47
|
|
|
44
48
|
req = self._build_request(
|
|
45
49
|
method="GET",
|
|
46
|
-
path="/
|
|
50
|
+
path="/v1/sky/position",
|
|
47
51
|
base_url=base_url,
|
|
48
52
|
url_variables=url_variables,
|
|
49
53
|
request=request,
|
|
@@ -54,6 +58,7 @@ class Sky(BaseSDK):
|
|
|
54
58
|
accept_header_value="application/json",
|
|
55
59
|
http_headers=http_headers,
|
|
56
60
|
security=self.sdk_configuration.security,
|
|
61
|
+
allow_empty_value=None,
|
|
57
62
|
timeout_ms=timeout_ms,
|
|
58
63
|
)
|
|
59
64
|
|
|
@@ -69,8 +74,8 @@ class Sky(BaseSDK):
|
|
|
69
74
|
hook_ctx=HookContext(
|
|
70
75
|
config=self.sdk_configuration,
|
|
71
76
|
base_url=base_url or "",
|
|
72
|
-
operation_id="
|
|
73
|
-
oauth2_scopes=
|
|
77
|
+
operation_id="v1_sky_position",
|
|
78
|
+
oauth2_scopes=None,
|
|
74
79
|
security_source=self.sdk_configuration.security,
|
|
75
80
|
),
|
|
76
81
|
request=req,
|
|
@@ -80,36 +85,26 @@ class Sky(BaseSDK):
|
|
|
80
85
|
|
|
81
86
|
response_data: Any = None
|
|
82
87
|
if utils.match_response(http_res, "200", "application/json"):
|
|
83
|
-
return
|
|
88
|
+
return unmarshal_json_response(models.SkyCheckPositionResponse, http_res)
|
|
84
89
|
if utils.match_response(http_res, "422", "application/json"):
|
|
85
|
-
response_data =
|
|
86
|
-
|
|
90
|
+
response_data = unmarshal_json_response(
|
|
91
|
+
errors.HTTPValidationErrorData, http_res
|
|
87
92
|
)
|
|
88
|
-
raise errors.HTTPValidationError(
|
|
93
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
89
94
|
if utils.match_response(http_res, "4XX", "*"):
|
|
90
95
|
http_res_text = utils.stream_to_text(http_res)
|
|
91
|
-
raise errors.APIError(
|
|
92
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
93
|
-
)
|
|
96
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
94
97
|
if utils.match_response(http_res, "5XX", "*"):
|
|
95
98
|
http_res_text = utils.stream_to_text(http_res)
|
|
96
|
-
raise errors.APIError(
|
|
97
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
98
|
-
)
|
|
99
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
102
|
-
raise errors.APIError(
|
|
103
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
104
|
-
http_res.status_code,
|
|
105
|
-
http_res_text,
|
|
106
|
-
http_res,
|
|
107
|
-
)
|
|
101
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
108
102
|
|
|
109
|
-
async def
|
|
103
|
+
async def sky_position_async(
|
|
110
104
|
self,
|
|
111
105
|
*,
|
|
112
|
-
|
|
106
|
+
chain: models.V1SkyPositionChain,
|
|
107
|
+
user_address: str,
|
|
113
108
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
114
109
|
server_url: Optional[str] = None,
|
|
115
110
|
timeout_ms: Optional[int] = None,
|
|
@@ -119,7 +114,8 @@ class Sky(BaseSDK):
|
|
|
119
114
|
|
|
120
115
|
Check the USDS overall position.
|
|
121
116
|
|
|
122
|
-
:param
|
|
117
|
+
:param chain:
|
|
118
|
+
:param user_address: The user-address of the desired position.
|
|
123
119
|
:param retries: Override the default retry configuration for this method
|
|
124
120
|
:param server_url: Override the default server URL for this method
|
|
125
121
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -135,13 +131,14 @@ class Sky(BaseSDK):
|
|
|
135
131
|
else:
|
|
136
132
|
base_url = self._get_url(base_url, url_variables)
|
|
137
133
|
|
|
138
|
-
request = models.
|
|
134
|
+
request = models.V1SkyPositionRequest(
|
|
135
|
+
chain=chain,
|
|
139
136
|
user_address=user_address,
|
|
140
137
|
)
|
|
141
138
|
|
|
142
139
|
req = self._build_request_async(
|
|
143
140
|
method="GET",
|
|
144
|
-
path="/
|
|
141
|
+
path="/v1/sky/position",
|
|
145
142
|
base_url=base_url,
|
|
146
143
|
url_variables=url_variables,
|
|
147
144
|
request=request,
|
|
@@ -152,6 +149,7 @@ class Sky(BaseSDK):
|
|
|
152
149
|
accept_header_value="application/json",
|
|
153
150
|
http_headers=http_headers,
|
|
154
151
|
security=self.sdk_configuration.security,
|
|
152
|
+
allow_empty_value=None,
|
|
155
153
|
timeout_ms=timeout_ms,
|
|
156
154
|
)
|
|
157
155
|
|
|
@@ -167,8 +165,8 @@ class Sky(BaseSDK):
|
|
|
167
165
|
hook_ctx=HookContext(
|
|
168
166
|
config=self.sdk_configuration,
|
|
169
167
|
base_url=base_url or "",
|
|
170
|
-
operation_id="
|
|
171
|
-
oauth2_scopes=
|
|
168
|
+
operation_id="v1_sky_position",
|
|
169
|
+
oauth2_scopes=None,
|
|
172
170
|
security_source=self.sdk_configuration.security,
|
|
173
171
|
),
|
|
174
172
|
request=req,
|
|
@@ -178,43 +176,34 @@ class Sky(BaseSDK):
|
|
|
178
176
|
|
|
179
177
|
response_data: Any = None
|
|
180
178
|
if utils.match_response(http_res, "200", "application/json"):
|
|
181
|
-
return
|
|
179
|
+
return unmarshal_json_response(models.SkyCheckPositionResponse, http_res)
|
|
182
180
|
if utils.match_response(http_res, "422", "application/json"):
|
|
183
|
-
response_data =
|
|
184
|
-
|
|
181
|
+
response_data = unmarshal_json_response(
|
|
182
|
+
errors.HTTPValidationErrorData, http_res
|
|
185
183
|
)
|
|
186
|
-
raise errors.HTTPValidationError(
|
|
184
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
187
185
|
if utils.match_response(http_res, "4XX", "*"):
|
|
188
186
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
189
|
-
raise errors.APIError(
|
|
190
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
191
|
-
)
|
|
187
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
192
188
|
if utils.match_response(http_res, "5XX", "*"):
|
|
193
189
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
194
|
-
raise errors.APIError(
|
|
195
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
196
|
-
)
|
|
190
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
197
191
|
|
|
198
|
-
|
|
199
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
200
|
-
raise errors.APIError(
|
|
201
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
202
|
-
http_res.status_code,
|
|
203
|
-
http_res_text,
|
|
204
|
-
http_res,
|
|
205
|
-
)
|
|
192
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
206
193
|
|
|
207
|
-
def
|
|
194
|
+
def sky_buy(
|
|
208
195
|
self,
|
|
209
196
|
*,
|
|
210
197
|
token_in: models.SkyBuyRequestTokenIn,
|
|
211
198
|
amount: Union[models.SkyBuyRequestAmount, models.SkyBuyRequestAmountTypedDict],
|
|
199
|
+
chain: models.SkyBuyRequestChain,
|
|
212
200
|
sender: str,
|
|
201
|
+
estimate_gas: Optional[bool] = None,
|
|
213
202
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
214
203
|
server_url: Optional[str] = None,
|
|
215
204
|
timeout_ms: Optional[int] = None,
|
|
216
205
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
217
|
-
) -> models.
|
|
206
|
+
) -> models.TransactionResponse:
|
|
218
207
|
r"""Buy USDS
|
|
219
208
|
|
|
220
209
|
Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
@@ -223,11 +212,22 @@ class Sky(BaseSDK):
|
|
|
223
212
|
'SkyDaiUsdsConverter' contract beforehand.
|
|
224
213
|
|
|
225
214
|
If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
226
|
-
'
|
|
215
|
+
'SkyUsdcUsdsConverter' contract beforehand.
|
|
216
|
+
<Info>
|
|
217
|
+
**Required Allowances**
|
|
218
|
+
|
|
219
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
220
|
+
|
|
221
|
+
- `SkyUsdcUsdsConverter`
|
|
222
|
+
- `SkyDaiUsdsConverter`
|
|
223
|
+
</Info>
|
|
224
|
+
|
|
227
225
|
|
|
228
226
|
:param token_in: The token you would like to swap 1:1 for USDS. Choose from DAI or USDC.
|
|
229
227
|
:param amount: The amount of USDS you would like to buy 1:1 with 'token_in'.
|
|
228
|
+
:param chain:
|
|
230
229
|
:param sender: The address of the transaction sender.
|
|
230
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
231
231
|
:param retries: Override the default retry configuration for this method
|
|
232
232
|
:param server_url: Override the default server URL for this method
|
|
233
233
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -246,12 +246,14 @@ class Sky(BaseSDK):
|
|
|
246
246
|
request = models.SkyBuyRequest(
|
|
247
247
|
token_in=token_in,
|
|
248
248
|
amount=amount,
|
|
249
|
+
chain=chain,
|
|
249
250
|
sender=sender,
|
|
251
|
+
estimate_gas=estimate_gas,
|
|
250
252
|
)
|
|
251
253
|
|
|
252
254
|
req = self._build_request(
|
|
253
255
|
method="POST",
|
|
254
|
-
path="/
|
|
256
|
+
path="/v1/sky/buy",
|
|
255
257
|
base_url=base_url,
|
|
256
258
|
url_variables=url_variables,
|
|
257
259
|
request=request,
|
|
@@ -265,6 +267,7 @@ class Sky(BaseSDK):
|
|
|
265
267
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
266
268
|
request, False, False, "json", models.SkyBuyRequest
|
|
267
269
|
),
|
|
270
|
+
allow_empty_value=None,
|
|
268
271
|
timeout_ms=timeout_ms,
|
|
269
272
|
)
|
|
270
273
|
|
|
@@ -280,8 +283,8 @@ class Sky(BaseSDK):
|
|
|
280
283
|
hook_ctx=HookContext(
|
|
281
284
|
config=self.sdk_configuration,
|
|
282
285
|
base_url=base_url or "",
|
|
283
|
-
operation_id="
|
|
284
|
-
oauth2_scopes=
|
|
286
|
+
operation_id="v1_sky_buy",
|
|
287
|
+
oauth2_scopes=None,
|
|
285
288
|
security_source=self.sdk_configuration.security,
|
|
286
289
|
),
|
|
287
290
|
request=req,
|
|
@@ -291,43 +294,34 @@ class Sky(BaseSDK):
|
|
|
291
294
|
|
|
292
295
|
response_data: Any = None
|
|
293
296
|
if utils.match_response(http_res, "200", "application/json"):
|
|
294
|
-
return
|
|
297
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
295
298
|
if utils.match_response(http_res, "422", "application/json"):
|
|
296
|
-
response_data =
|
|
297
|
-
|
|
299
|
+
response_data = unmarshal_json_response(
|
|
300
|
+
errors.HTTPValidationErrorData, http_res
|
|
298
301
|
)
|
|
299
|
-
raise errors.HTTPValidationError(
|
|
302
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
300
303
|
if utils.match_response(http_res, "4XX", "*"):
|
|
301
304
|
http_res_text = utils.stream_to_text(http_res)
|
|
302
|
-
raise errors.APIError(
|
|
303
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
304
|
-
)
|
|
305
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
305
306
|
if utils.match_response(http_res, "5XX", "*"):
|
|
306
307
|
http_res_text = utils.stream_to_text(http_res)
|
|
307
|
-
raise errors.APIError(
|
|
308
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
309
|
-
)
|
|
308
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
310
309
|
|
|
311
|
-
|
|
312
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
313
|
-
raise errors.APIError(
|
|
314
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
315
|
-
http_res.status_code,
|
|
316
|
-
http_res_text,
|
|
317
|
-
http_res,
|
|
318
|
-
)
|
|
310
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
319
311
|
|
|
320
|
-
async def
|
|
312
|
+
async def sky_buy_async(
|
|
321
313
|
self,
|
|
322
314
|
*,
|
|
323
315
|
token_in: models.SkyBuyRequestTokenIn,
|
|
324
316
|
amount: Union[models.SkyBuyRequestAmount, models.SkyBuyRequestAmountTypedDict],
|
|
317
|
+
chain: models.SkyBuyRequestChain,
|
|
325
318
|
sender: str,
|
|
319
|
+
estimate_gas: Optional[bool] = None,
|
|
326
320
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
327
321
|
server_url: Optional[str] = None,
|
|
328
322
|
timeout_ms: Optional[int] = None,
|
|
329
323
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
330
|
-
) -> models.
|
|
324
|
+
) -> models.TransactionResponse:
|
|
331
325
|
r"""Buy USDS
|
|
332
326
|
|
|
333
327
|
Buy USDS with DAI or USDC on a 1:1 basis. There are no fees.
|
|
@@ -336,11 +330,22 @@ class Sky(BaseSDK):
|
|
|
336
330
|
'SkyDaiUsdsConverter' contract beforehand.
|
|
337
331
|
|
|
338
332
|
If buying with USDC, user will need to set an allowance on the USDC contract for the
|
|
339
|
-
'
|
|
333
|
+
'SkyUsdcUsdsConverter' contract beforehand.
|
|
334
|
+
<Info>
|
|
335
|
+
**Required Allowances**
|
|
336
|
+
|
|
337
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
338
|
+
|
|
339
|
+
- `SkyUsdcUsdsConverter`
|
|
340
|
+
- `SkyDaiUsdsConverter`
|
|
341
|
+
</Info>
|
|
342
|
+
|
|
340
343
|
|
|
341
344
|
:param token_in: The token you would like to swap 1:1 for USDS. Choose from DAI or USDC.
|
|
342
345
|
:param amount: The amount of USDS you would like to buy 1:1 with 'token_in'.
|
|
346
|
+
:param chain:
|
|
343
347
|
:param sender: The address of the transaction sender.
|
|
348
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
344
349
|
:param retries: Override the default retry configuration for this method
|
|
345
350
|
:param server_url: Override the default server URL for this method
|
|
346
351
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -359,12 +364,14 @@ class Sky(BaseSDK):
|
|
|
359
364
|
request = models.SkyBuyRequest(
|
|
360
365
|
token_in=token_in,
|
|
361
366
|
amount=amount,
|
|
367
|
+
chain=chain,
|
|
362
368
|
sender=sender,
|
|
369
|
+
estimate_gas=estimate_gas,
|
|
363
370
|
)
|
|
364
371
|
|
|
365
372
|
req = self._build_request_async(
|
|
366
373
|
method="POST",
|
|
367
|
-
path="/
|
|
374
|
+
path="/v1/sky/buy",
|
|
368
375
|
base_url=base_url,
|
|
369
376
|
url_variables=url_variables,
|
|
370
377
|
request=request,
|
|
@@ -378,6 +385,7 @@ class Sky(BaseSDK):
|
|
|
378
385
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
379
386
|
request, False, False, "json", models.SkyBuyRequest
|
|
380
387
|
),
|
|
388
|
+
allow_empty_value=None,
|
|
381
389
|
timeout_ms=timeout_ms,
|
|
382
390
|
)
|
|
383
391
|
|
|
@@ -393,8 +401,8 @@ class Sky(BaseSDK):
|
|
|
393
401
|
hook_ctx=HookContext(
|
|
394
402
|
config=self.sdk_configuration,
|
|
395
403
|
base_url=base_url or "",
|
|
396
|
-
operation_id="
|
|
397
|
-
oauth2_scopes=
|
|
404
|
+
operation_id="v1_sky_buy",
|
|
405
|
+
oauth2_scopes=None,
|
|
398
406
|
security_source=self.sdk_configuration.security,
|
|
399
407
|
),
|
|
400
408
|
request=req,
|
|
@@ -404,45 +412,36 @@ class Sky(BaseSDK):
|
|
|
404
412
|
|
|
405
413
|
response_data: Any = None
|
|
406
414
|
if utils.match_response(http_res, "200", "application/json"):
|
|
407
|
-
return
|
|
415
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
408
416
|
if utils.match_response(http_res, "422", "application/json"):
|
|
409
|
-
response_data =
|
|
410
|
-
|
|
417
|
+
response_data = unmarshal_json_response(
|
|
418
|
+
errors.HTTPValidationErrorData, http_res
|
|
411
419
|
)
|
|
412
|
-
raise errors.HTTPValidationError(
|
|
420
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
413
421
|
if utils.match_response(http_res, "4XX", "*"):
|
|
414
422
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
415
|
-
raise errors.APIError(
|
|
416
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
417
|
-
)
|
|
423
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
418
424
|
if utils.match_response(http_res, "5XX", "*"):
|
|
419
425
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
420
|
-
raise errors.APIError(
|
|
421
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
422
|
-
)
|
|
426
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
423
427
|
|
|
424
|
-
|
|
425
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
426
|
-
raise errors.APIError(
|
|
427
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
428
|
-
http_res.status_code,
|
|
429
|
-
http_res_text,
|
|
430
|
-
http_res,
|
|
431
|
-
)
|
|
428
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
432
429
|
|
|
433
|
-
def
|
|
430
|
+
def sky_sell(
|
|
434
431
|
self,
|
|
435
432
|
*,
|
|
436
433
|
token_out: models.SkySellRequestTokenOut,
|
|
437
434
|
amount: Union[
|
|
438
435
|
models.SkySellRequestAmount, models.SkySellRequestAmountTypedDict
|
|
439
436
|
],
|
|
437
|
+
chain: models.SkySellRequestChain,
|
|
440
438
|
sender: str,
|
|
439
|
+
estimate_gas: Optional[bool] = None,
|
|
441
440
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
442
441
|
server_url: Optional[str] = None,
|
|
443
442
|
timeout_ms: Optional[int] = None,
|
|
444
443
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
445
|
-
) -> models.
|
|
444
|
+
) -> models.TransactionResponse:
|
|
446
445
|
r"""Sell USDS
|
|
447
446
|
|
|
448
447
|
Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
@@ -452,10 +451,21 @@ class Sky(BaseSDK):
|
|
|
452
451
|
|
|
453
452
|
If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
454
453
|
'SkyUsdcUsdsConverter' contract beforehand.
|
|
454
|
+
<Info>
|
|
455
|
+
**Required Allowances**
|
|
456
|
+
|
|
457
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
458
|
+
|
|
459
|
+
- `SkyUsdcUsdsConverter`
|
|
460
|
+
- `SkyDaiUsdsConverter`
|
|
461
|
+
</Info>
|
|
462
|
+
|
|
455
463
|
|
|
456
464
|
:param token_out: The token you would like to swap 1:1 with USDS. Choose from DAI or USDC.
|
|
457
465
|
:param amount: The amount of USDS you would like to sell 1:1 for 'token_out'.
|
|
466
|
+
:param chain:
|
|
458
467
|
:param sender: The address of the transaction sender.
|
|
468
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
459
469
|
:param retries: Override the default retry configuration for this method
|
|
460
470
|
:param server_url: Override the default server URL for this method
|
|
461
471
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -474,12 +484,14 @@ class Sky(BaseSDK):
|
|
|
474
484
|
request = models.SkySellRequest(
|
|
475
485
|
token_out=token_out,
|
|
476
486
|
amount=amount,
|
|
487
|
+
chain=chain,
|
|
477
488
|
sender=sender,
|
|
489
|
+
estimate_gas=estimate_gas,
|
|
478
490
|
)
|
|
479
491
|
|
|
480
492
|
req = self._build_request(
|
|
481
493
|
method="POST",
|
|
482
|
-
path="/
|
|
494
|
+
path="/v1/sky/sell",
|
|
483
495
|
base_url=base_url,
|
|
484
496
|
url_variables=url_variables,
|
|
485
497
|
request=request,
|
|
@@ -493,6 +505,7 @@ class Sky(BaseSDK):
|
|
|
493
505
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
494
506
|
request, False, False, "json", models.SkySellRequest
|
|
495
507
|
),
|
|
508
|
+
allow_empty_value=None,
|
|
496
509
|
timeout_ms=timeout_ms,
|
|
497
510
|
)
|
|
498
511
|
|
|
@@ -508,8 +521,8 @@ class Sky(BaseSDK):
|
|
|
508
521
|
hook_ctx=HookContext(
|
|
509
522
|
config=self.sdk_configuration,
|
|
510
523
|
base_url=base_url or "",
|
|
511
|
-
operation_id="
|
|
512
|
-
oauth2_scopes=
|
|
524
|
+
operation_id="v1_sky_sell",
|
|
525
|
+
oauth2_scopes=None,
|
|
513
526
|
security_source=self.sdk_configuration.security,
|
|
514
527
|
),
|
|
515
528
|
request=req,
|
|
@@ -519,45 +532,36 @@ class Sky(BaseSDK):
|
|
|
519
532
|
|
|
520
533
|
response_data: Any = None
|
|
521
534
|
if utils.match_response(http_res, "200", "application/json"):
|
|
522
|
-
return
|
|
535
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
523
536
|
if utils.match_response(http_res, "422", "application/json"):
|
|
524
|
-
response_data =
|
|
525
|
-
|
|
537
|
+
response_data = unmarshal_json_response(
|
|
538
|
+
errors.HTTPValidationErrorData, http_res
|
|
526
539
|
)
|
|
527
|
-
raise errors.HTTPValidationError(
|
|
540
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
528
541
|
if utils.match_response(http_res, "4XX", "*"):
|
|
529
542
|
http_res_text = utils.stream_to_text(http_res)
|
|
530
|
-
raise errors.APIError(
|
|
531
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
532
|
-
)
|
|
543
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
533
544
|
if utils.match_response(http_res, "5XX", "*"):
|
|
534
545
|
http_res_text = utils.stream_to_text(http_res)
|
|
535
|
-
raise errors.APIError(
|
|
536
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
537
|
-
)
|
|
546
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
538
547
|
|
|
539
|
-
|
|
540
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
541
|
-
raise errors.APIError(
|
|
542
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
543
|
-
http_res.status_code,
|
|
544
|
-
http_res_text,
|
|
545
|
-
http_res,
|
|
546
|
-
)
|
|
548
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
547
549
|
|
|
548
|
-
async def
|
|
550
|
+
async def sky_sell_async(
|
|
549
551
|
self,
|
|
550
552
|
*,
|
|
551
553
|
token_out: models.SkySellRequestTokenOut,
|
|
552
554
|
amount: Union[
|
|
553
555
|
models.SkySellRequestAmount, models.SkySellRequestAmountTypedDict
|
|
554
556
|
],
|
|
557
|
+
chain: models.SkySellRequestChain,
|
|
555
558
|
sender: str,
|
|
559
|
+
estimate_gas: Optional[bool] = None,
|
|
556
560
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
557
561
|
server_url: Optional[str] = None,
|
|
558
562
|
timeout_ms: Optional[int] = None,
|
|
559
563
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
560
|
-
) -> models.
|
|
564
|
+
) -> models.TransactionResponse:
|
|
561
565
|
r"""Sell USDS
|
|
562
566
|
|
|
563
567
|
Sell USDS for DAI or USDC on a 1:1 basis. There are no fees.
|
|
@@ -567,10 +571,21 @@ class Sky(BaseSDK):
|
|
|
567
571
|
|
|
568
572
|
If swapping to USDC, user will need to set an allowance on the USDS contract for the
|
|
569
573
|
'SkyUsdcUsdsConverter' contract beforehand.
|
|
574
|
+
<Info>
|
|
575
|
+
**Required Allowances**
|
|
576
|
+
|
|
577
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
578
|
+
|
|
579
|
+
- `SkyUsdcUsdsConverter`
|
|
580
|
+
- `SkyDaiUsdsConverter`
|
|
581
|
+
</Info>
|
|
582
|
+
|
|
570
583
|
|
|
571
584
|
:param token_out: The token you would like to swap 1:1 with USDS. Choose from DAI or USDC.
|
|
572
585
|
:param amount: The amount of USDS you would like to sell 1:1 for 'token_out'.
|
|
586
|
+
:param chain:
|
|
573
587
|
:param sender: The address of the transaction sender.
|
|
588
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
574
589
|
:param retries: Override the default retry configuration for this method
|
|
575
590
|
:param server_url: Override the default server URL for this method
|
|
576
591
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -589,12 +604,14 @@ class Sky(BaseSDK):
|
|
|
589
604
|
request = models.SkySellRequest(
|
|
590
605
|
token_out=token_out,
|
|
591
606
|
amount=amount,
|
|
607
|
+
chain=chain,
|
|
592
608
|
sender=sender,
|
|
609
|
+
estimate_gas=estimate_gas,
|
|
593
610
|
)
|
|
594
611
|
|
|
595
612
|
req = self._build_request_async(
|
|
596
613
|
method="POST",
|
|
597
|
-
path="/
|
|
614
|
+
path="/v1/sky/sell",
|
|
598
615
|
base_url=base_url,
|
|
599
616
|
url_variables=url_variables,
|
|
600
617
|
request=request,
|
|
@@ -608,6 +625,7 @@ class Sky(BaseSDK):
|
|
|
608
625
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
609
626
|
request, False, False, "json", models.SkySellRequest
|
|
610
627
|
),
|
|
628
|
+
allow_empty_value=None,
|
|
611
629
|
timeout_ms=timeout_ms,
|
|
612
630
|
)
|
|
613
631
|
|
|
@@ -623,8 +641,8 @@ class Sky(BaseSDK):
|
|
|
623
641
|
hook_ctx=HookContext(
|
|
624
642
|
config=self.sdk_configuration,
|
|
625
643
|
base_url=base_url or "",
|
|
626
|
-
operation_id="
|
|
627
|
-
oauth2_scopes=
|
|
644
|
+
operation_id="v1_sky_sell",
|
|
645
|
+
oauth2_scopes=None,
|
|
628
646
|
security_source=self.sdk_configuration.security,
|
|
629
647
|
),
|
|
630
648
|
request=req,
|
|
@@ -634,33 +652,22 @@ class Sky(BaseSDK):
|
|
|
634
652
|
|
|
635
653
|
response_data: Any = None
|
|
636
654
|
if utils.match_response(http_res, "200", "application/json"):
|
|
637
|
-
return
|
|
655
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
638
656
|
if utils.match_response(http_res, "422", "application/json"):
|
|
639
|
-
response_data =
|
|
640
|
-
|
|
657
|
+
response_data = unmarshal_json_response(
|
|
658
|
+
errors.HTTPValidationErrorData, http_res
|
|
641
659
|
)
|
|
642
|
-
raise errors.HTTPValidationError(
|
|
660
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
643
661
|
if utils.match_response(http_res, "4XX", "*"):
|
|
644
662
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
645
|
-
raise errors.APIError(
|
|
646
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
647
|
-
)
|
|
663
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
648
664
|
if utils.match_response(http_res, "5XX", "*"):
|
|
649
665
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
650
|
-
raise errors.APIError(
|
|
651
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
652
|
-
)
|
|
666
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
653
667
|
|
|
654
|
-
|
|
655
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
656
|
-
raise errors.APIError(
|
|
657
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
658
|
-
http_res.status_code,
|
|
659
|
-
http_res_text,
|
|
660
|
-
http_res,
|
|
661
|
-
)
|
|
668
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
662
669
|
|
|
663
|
-
def
|
|
670
|
+
def sky_deposit(
|
|
664
671
|
self,
|
|
665
672
|
*,
|
|
666
673
|
amount: Union[
|
|
@@ -668,20 +675,34 @@ class Sky(BaseSDK):
|
|
|
668
675
|
],
|
|
669
676
|
sender: str,
|
|
670
677
|
receiver: OptionalNullable[str] = UNSET,
|
|
678
|
+
chain: Optional[models.SkyDepositRequestChain] = None,
|
|
679
|
+
estimate_gas: Optional[bool] = None,
|
|
671
680
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
672
681
|
server_url: Optional[str] = None,
|
|
673
682
|
timeout_ms: Optional[int] = None,
|
|
674
683
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
675
|
-
) -> models.
|
|
684
|
+
) -> models.TransactionResponse:
|
|
676
685
|
r"""Deposit USDS
|
|
677
686
|
|
|
678
|
-
Deposit USDS
|
|
687
|
+
Deposit USDS to earn yield. Deposited USDS is represented as sUSDS.
|
|
688
|
+
|
|
689
|
+
Allowance must be set on USDS contract for UsdsVault.
|
|
679
690
|
|
|
680
691
|
There are no fees.
|
|
692
|
+
<Info>
|
|
693
|
+
**Required Allowances**
|
|
694
|
+
|
|
695
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
696
|
+
|
|
697
|
+
- `SkyUsdsVault`
|
|
698
|
+
</Info>
|
|
699
|
+
|
|
681
700
|
|
|
682
701
|
:param amount: The amount of USDS you would like to deposit for sUSDS to earn yield.
|
|
683
702
|
:param sender: The address of the transaction sender.
|
|
684
703
|
:param receiver: The address which will receive the sUSDS. Defaults to the sender.
|
|
704
|
+
:param chain:
|
|
705
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
685
706
|
:param retries: Override the default retry configuration for this method
|
|
686
707
|
:param server_url: Override the default server URL for this method
|
|
687
708
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -700,12 +721,14 @@ class Sky(BaseSDK):
|
|
|
700
721
|
request = models.SkyDepositRequest(
|
|
701
722
|
amount=amount,
|
|
702
723
|
receiver=receiver,
|
|
724
|
+
chain=chain,
|
|
703
725
|
sender=sender,
|
|
726
|
+
estimate_gas=estimate_gas,
|
|
704
727
|
)
|
|
705
728
|
|
|
706
729
|
req = self._build_request(
|
|
707
730
|
method="POST",
|
|
708
|
-
path="/
|
|
731
|
+
path="/v1/sky/deposit",
|
|
709
732
|
base_url=base_url,
|
|
710
733
|
url_variables=url_variables,
|
|
711
734
|
request=request,
|
|
@@ -719,6 +742,7 @@ class Sky(BaseSDK):
|
|
|
719
742
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
720
743
|
request, False, False, "json", models.SkyDepositRequest
|
|
721
744
|
),
|
|
745
|
+
allow_empty_value=None,
|
|
722
746
|
timeout_ms=timeout_ms,
|
|
723
747
|
)
|
|
724
748
|
|
|
@@ -734,8 +758,8 @@ class Sky(BaseSDK):
|
|
|
734
758
|
hook_ctx=HookContext(
|
|
735
759
|
config=self.sdk_configuration,
|
|
736
760
|
base_url=base_url or "",
|
|
737
|
-
operation_id="
|
|
738
|
-
oauth2_scopes=
|
|
761
|
+
operation_id="v1_sky_deposit",
|
|
762
|
+
oauth2_scopes=None,
|
|
739
763
|
security_source=self.sdk_configuration.security,
|
|
740
764
|
),
|
|
741
765
|
request=req,
|
|
@@ -745,33 +769,22 @@ class Sky(BaseSDK):
|
|
|
745
769
|
|
|
746
770
|
response_data: Any = None
|
|
747
771
|
if utils.match_response(http_res, "200", "application/json"):
|
|
748
|
-
return
|
|
772
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
749
773
|
if utils.match_response(http_res, "422", "application/json"):
|
|
750
|
-
response_data =
|
|
751
|
-
|
|
774
|
+
response_data = unmarshal_json_response(
|
|
775
|
+
errors.HTTPValidationErrorData, http_res
|
|
752
776
|
)
|
|
753
|
-
raise errors.HTTPValidationError(
|
|
777
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
754
778
|
if utils.match_response(http_res, "4XX", "*"):
|
|
755
779
|
http_res_text = utils.stream_to_text(http_res)
|
|
756
|
-
raise errors.APIError(
|
|
757
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
758
|
-
)
|
|
780
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
759
781
|
if utils.match_response(http_res, "5XX", "*"):
|
|
760
782
|
http_res_text = utils.stream_to_text(http_res)
|
|
761
|
-
raise errors.APIError(
|
|
762
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
763
|
-
)
|
|
783
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
764
784
|
|
|
765
|
-
|
|
766
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
767
|
-
raise errors.APIError(
|
|
768
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
769
|
-
http_res.status_code,
|
|
770
|
-
http_res_text,
|
|
771
|
-
http_res,
|
|
772
|
-
)
|
|
785
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
773
786
|
|
|
774
|
-
async def
|
|
787
|
+
async def sky_deposit_async(
|
|
775
788
|
self,
|
|
776
789
|
*,
|
|
777
790
|
amount: Union[
|
|
@@ -779,20 +792,34 @@ class Sky(BaseSDK):
|
|
|
779
792
|
],
|
|
780
793
|
sender: str,
|
|
781
794
|
receiver: OptionalNullable[str] = UNSET,
|
|
795
|
+
chain: Optional[models.SkyDepositRequestChain] = None,
|
|
796
|
+
estimate_gas: Optional[bool] = None,
|
|
782
797
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
783
798
|
server_url: Optional[str] = None,
|
|
784
799
|
timeout_ms: Optional[int] = None,
|
|
785
800
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
786
|
-
) -> models.
|
|
801
|
+
) -> models.TransactionResponse:
|
|
787
802
|
r"""Deposit USDS
|
|
788
803
|
|
|
789
|
-
Deposit USDS
|
|
804
|
+
Deposit USDS to earn yield. Deposited USDS is represented as sUSDS.
|
|
805
|
+
|
|
806
|
+
Allowance must be set on USDS contract for UsdsVault.
|
|
790
807
|
|
|
791
808
|
There are no fees.
|
|
809
|
+
<Info>
|
|
810
|
+
**Required Allowances**
|
|
811
|
+
|
|
812
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
813
|
+
|
|
814
|
+
- `SkyUsdsVault`
|
|
815
|
+
</Info>
|
|
816
|
+
|
|
792
817
|
|
|
793
818
|
:param amount: The amount of USDS you would like to deposit for sUSDS to earn yield.
|
|
794
819
|
:param sender: The address of the transaction sender.
|
|
795
820
|
:param receiver: The address which will receive the sUSDS. Defaults to the sender.
|
|
821
|
+
:param chain:
|
|
822
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
796
823
|
:param retries: Override the default retry configuration for this method
|
|
797
824
|
:param server_url: Override the default server URL for this method
|
|
798
825
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -811,12 +838,14 @@ class Sky(BaseSDK):
|
|
|
811
838
|
request = models.SkyDepositRequest(
|
|
812
839
|
amount=amount,
|
|
813
840
|
receiver=receiver,
|
|
841
|
+
chain=chain,
|
|
814
842
|
sender=sender,
|
|
843
|
+
estimate_gas=estimate_gas,
|
|
815
844
|
)
|
|
816
845
|
|
|
817
846
|
req = self._build_request_async(
|
|
818
847
|
method="POST",
|
|
819
|
-
path="/
|
|
848
|
+
path="/v1/sky/deposit",
|
|
820
849
|
base_url=base_url,
|
|
821
850
|
url_variables=url_variables,
|
|
822
851
|
request=request,
|
|
@@ -830,6 +859,7 @@ class Sky(BaseSDK):
|
|
|
830
859
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
831
860
|
request, False, False, "json", models.SkyDepositRequest
|
|
832
861
|
),
|
|
862
|
+
allow_empty_value=None,
|
|
833
863
|
timeout_ms=timeout_ms,
|
|
834
864
|
)
|
|
835
865
|
|
|
@@ -845,8 +875,8 @@ class Sky(BaseSDK):
|
|
|
845
875
|
hook_ctx=HookContext(
|
|
846
876
|
config=self.sdk_configuration,
|
|
847
877
|
base_url=base_url or "",
|
|
848
|
-
operation_id="
|
|
849
|
-
oauth2_scopes=
|
|
878
|
+
operation_id="v1_sky_deposit",
|
|
879
|
+
oauth2_scopes=None,
|
|
850
880
|
security_source=self.sdk_configuration.security,
|
|
851
881
|
),
|
|
852
882
|
request=req,
|
|
@@ -856,50 +886,55 @@ class Sky(BaseSDK):
|
|
|
856
886
|
|
|
857
887
|
response_data: Any = None
|
|
858
888
|
if utils.match_response(http_res, "200", "application/json"):
|
|
859
|
-
return
|
|
889
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
860
890
|
if utils.match_response(http_res, "422", "application/json"):
|
|
861
|
-
response_data =
|
|
862
|
-
|
|
891
|
+
response_data = unmarshal_json_response(
|
|
892
|
+
errors.HTTPValidationErrorData, http_res
|
|
863
893
|
)
|
|
864
|
-
raise errors.HTTPValidationError(
|
|
894
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
865
895
|
if utils.match_response(http_res, "4XX", "*"):
|
|
866
896
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
867
|
-
raise errors.APIError(
|
|
868
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
869
|
-
)
|
|
897
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
870
898
|
if utils.match_response(http_res, "5XX", "*"):
|
|
871
899
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
872
|
-
raise errors.APIError(
|
|
873
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
874
|
-
)
|
|
900
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
875
901
|
|
|
876
|
-
|
|
877
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
878
|
-
raise errors.APIError(
|
|
879
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
880
|
-
http_res.status_code,
|
|
881
|
-
http_res_text,
|
|
882
|
-
http_res,
|
|
883
|
-
)
|
|
902
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
884
903
|
|
|
885
|
-
def
|
|
904
|
+
def sky_withdraw(
|
|
886
905
|
self,
|
|
887
906
|
*,
|
|
888
907
|
amount: Any,
|
|
889
908
|
sender: str,
|
|
890
909
|
receiver: OptionalNullable[str] = UNSET,
|
|
910
|
+
chain: Optional[models.SkyWithdrawRequestChain] = None,
|
|
911
|
+
estimate_gas: Optional[bool] = None,
|
|
891
912
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
892
913
|
server_url: Optional[str] = None,
|
|
893
914
|
timeout_ms: Optional[int] = None,
|
|
894
915
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
895
|
-
) -> models.
|
|
916
|
+
) -> models.TransactionResponse:
|
|
896
917
|
r"""Withdraw USDS
|
|
897
918
|
|
|
898
|
-
Withdraw USDS
|
|
919
|
+
Withdraw USDS. Exchange yield-bearing sUSDS for USDS.
|
|
920
|
+
|
|
921
|
+
Allowance must be set on USDS contract for UsdsVault.
|
|
922
|
+
|
|
923
|
+
There are no fees.
|
|
924
|
+
<Info>
|
|
925
|
+
**Required Allowances**
|
|
926
|
+
|
|
927
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
928
|
+
|
|
929
|
+
- `SkyUsdsVault`
|
|
930
|
+
</Info>
|
|
931
|
+
|
|
899
932
|
|
|
900
933
|
:param amount: The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn.
|
|
901
934
|
:param sender: The address of the transaction sender.
|
|
902
935
|
:param receiver: The address which will receive the withdrawn USDS. Defaults to the sender.
|
|
936
|
+
:param chain:
|
|
937
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
903
938
|
:param retries: Override the default retry configuration for this method
|
|
904
939
|
:param server_url: Override the default server URL for this method
|
|
905
940
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -918,12 +953,14 @@ class Sky(BaseSDK):
|
|
|
918
953
|
request = models.SkyWithdrawRequest(
|
|
919
954
|
amount=amount,
|
|
920
955
|
receiver=receiver,
|
|
956
|
+
chain=chain,
|
|
921
957
|
sender=sender,
|
|
958
|
+
estimate_gas=estimate_gas,
|
|
922
959
|
)
|
|
923
960
|
|
|
924
961
|
req = self._build_request(
|
|
925
962
|
method="POST",
|
|
926
|
-
path="/
|
|
963
|
+
path="/v1/sky/withdraw",
|
|
927
964
|
base_url=base_url,
|
|
928
965
|
url_variables=url_variables,
|
|
929
966
|
request=request,
|
|
@@ -937,6 +974,7 @@ class Sky(BaseSDK):
|
|
|
937
974
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
938
975
|
request, False, False, "json", models.SkyWithdrawRequest
|
|
939
976
|
),
|
|
977
|
+
allow_empty_value=None,
|
|
940
978
|
timeout_ms=timeout_ms,
|
|
941
979
|
)
|
|
942
980
|
|
|
@@ -952,8 +990,8 @@ class Sky(BaseSDK):
|
|
|
952
990
|
hook_ctx=HookContext(
|
|
953
991
|
config=self.sdk_configuration,
|
|
954
992
|
base_url=base_url or "",
|
|
955
|
-
operation_id="
|
|
956
|
-
oauth2_scopes=
|
|
993
|
+
operation_id="v1_sky_withdraw",
|
|
994
|
+
oauth2_scopes=None,
|
|
957
995
|
security_source=self.sdk_configuration.security,
|
|
958
996
|
),
|
|
959
997
|
request=req,
|
|
@@ -963,50 +1001,55 @@ class Sky(BaseSDK):
|
|
|
963
1001
|
|
|
964
1002
|
response_data: Any = None
|
|
965
1003
|
if utils.match_response(http_res, "200", "application/json"):
|
|
966
|
-
return
|
|
1004
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
967
1005
|
if utils.match_response(http_res, "422", "application/json"):
|
|
968
|
-
response_data =
|
|
969
|
-
|
|
1006
|
+
response_data = unmarshal_json_response(
|
|
1007
|
+
errors.HTTPValidationErrorData, http_res
|
|
970
1008
|
)
|
|
971
|
-
raise errors.HTTPValidationError(
|
|
1009
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
972
1010
|
if utils.match_response(http_res, "4XX", "*"):
|
|
973
1011
|
http_res_text = utils.stream_to_text(http_res)
|
|
974
|
-
raise errors.APIError(
|
|
975
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
976
|
-
)
|
|
1012
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
977
1013
|
if utils.match_response(http_res, "5XX", "*"):
|
|
978
1014
|
http_res_text = utils.stream_to_text(http_res)
|
|
979
|
-
raise errors.APIError(
|
|
980
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
981
|
-
)
|
|
1015
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
982
1016
|
|
|
983
|
-
|
|
984
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
985
|
-
raise errors.APIError(
|
|
986
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
987
|
-
http_res.status_code,
|
|
988
|
-
http_res_text,
|
|
989
|
-
http_res,
|
|
990
|
-
)
|
|
1017
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
991
1018
|
|
|
992
|
-
async def
|
|
1019
|
+
async def sky_withdraw_async(
|
|
993
1020
|
self,
|
|
994
1021
|
*,
|
|
995
1022
|
amount: Any,
|
|
996
1023
|
sender: str,
|
|
997
1024
|
receiver: OptionalNullable[str] = UNSET,
|
|
1025
|
+
chain: Optional[models.SkyWithdrawRequestChain] = None,
|
|
1026
|
+
estimate_gas: Optional[bool] = None,
|
|
998
1027
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
999
1028
|
server_url: Optional[str] = None,
|
|
1000
1029
|
timeout_ms: Optional[int] = None,
|
|
1001
1030
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1002
|
-
) -> models.
|
|
1031
|
+
) -> models.TransactionResponse:
|
|
1003
1032
|
r"""Withdraw USDS
|
|
1004
1033
|
|
|
1005
|
-
Withdraw USDS
|
|
1034
|
+
Withdraw USDS. Exchange yield-bearing sUSDS for USDS.
|
|
1035
|
+
|
|
1036
|
+
Allowance must be set on USDS contract for UsdsVault.
|
|
1037
|
+
|
|
1038
|
+
There are no fees.
|
|
1039
|
+
<Info>
|
|
1040
|
+
**Required Allowances**
|
|
1041
|
+
|
|
1042
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1043
|
+
|
|
1044
|
+
- `SkyUsdsVault`
|
|
1045
|
+
</Info>
|
|
1046
|
+
|
|
1006
1047
|
|
|
1007
1048
|
:param amount: The amount of USDS you would like to withdraw. If set to 'ALL', your total deposited USDS amount will be withdrawn.
|
|
1008
1049
|
:param sender: The address of the transaction sender.
|
|
1009
1050
|
:param receiver: The address which will receive the withdrawn USDS. Defaults to the sender.
|
|
1051
|
+
:param chain:
|
|
1052
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1010
1053
|
:param retries: Override the default retry configuration for this method
|
|
1011
1054
|
:param server_url: Override the default server URL for this method
|
|
1012
1055
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1025,12 +1068,14 @@ class Sky(BaseSDK):
|
|
|
1025
1068
|
request = models.SkyWithdrawRequest(
|
|
1026
1069
|
amount=amount,
|
|
1027
1070
|
receiver=receiver,
|
|
1071
|
+
chain=chain,
|
|
1028
1072
|
sender=sender,
|
|
1073
|
+
estimate_gas=estimate_gas,
|
|
1029
1074
|
)
|
|
1030
1075
|
|
|
1031
1076
|
req = self._build_request_async(
|
|
1032
1077
|
method="POST",
|
|
1033
|
-
path="/
|
|
1078
|
+
path="/v1/sky/withdraw",
|
|
1034
1079
|
base_url=base_url,
|
|
1035
1080
|
url_variables=url_variables,
|
|
1036
1081
|
request=request,
|
|
@@ -1044,6 +1089,7 @@ class Sky(BaseSDK):
|
|
|
1044
1089
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1045
1090
|
request, False, False, "json", models.SkyWithdrawRequest
|
|
1046
1091
|
),
|
|
1092
|
+
allow_empty_value=None,
|
|
1047
1093
|
timeout_ms=timeout_ms,
|
|
1048
1094
|
)
|
|
1049
1095
|
|
|
@@ -1059,8 +1105,8 @@ class Sky(BaseSDK):
|
|
|
1059
1105
|
hook_ctx=HookContext(
|
|
1060
1106
|
config=self.sdk_configuration,
|
|
1061
1107
|
base_url=base_url or "",
|
|
1062
|
-
operation_id="
|
|
1063
|
-
oauth2_scopes=
|
|
1108
|
+
operation_id="v1_sky_withdraw",
|
|
1109
|
+
oauth2_scopes=None,
|
|
1064
1110
|
security_source=self.sdk_configuration.security,
|
|
1065
1111
|
),
|
|
1066
1112
|
request=req,
|
|
@@ -1070,28 +1116,17 @@ class Sky(BaseSDK):
|
|
|
1070
1116
|
|
|
1071
1117
|
response_data: Any = None
|
|
1072
1118
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1073
|
-
return
|
|
1119
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1074
1120
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1075
|
-
response_data =
|
|
1076
|
-
|
|
1121
|
+
response_data = unmarshal_json_response(
|
|
1122
|
+
errors.HTTPValidationErrorData, http_res
|
|
1077
1123
|
)
|
|
1078
|
-
raise errors.HTTPValidationError(
|
|
1124
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1079
1125
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1080
1126
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1081
|
-
raise errors.APIError(
|
|
1082
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1083
|
-
)
|
|
1127
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1084
1128
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1085
1129
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1086
|
-
raise errors.APIError(
|
|
1087
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1088
|
-
)
|
|
1130
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1089
1131
|
|
|
1090
|
-
|
|
1091
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1092
|
-
raise errors.APIError(
|
|
1093
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1094
|
-
http_res.status_code,
|
|
1095
|
-
http_res_text,
|
|
1096
|
-
http_res,
|
|
1097
|
-
)
|
|
1132
|
+
raise errors.APIError("Unexpected response received", http_res)
|