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/uniswap_v3.py
CHANGED
|
@@ -4,20 +4,21 @@ 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 UniswapV3(BaseSDK):
|
|
11
|
-
def
|
|
12
|
+
def uniswap_quote_buy_exactly(
|
|
12
13
|
self,
|
|
13
14
|
*,
|
|
14
|
-
chain: models.
|
|
15
|
-
token_in:
|
|
16
|
-
token_out:
|
|
17
|
-
fee: models.
|
|
15
|
+
chain: models.V1UniswapQuoteBuyExactlyChain,
|
|
16
|
+
token_in: str,
|
|
17
|
+
token_out: str,
|
|
18
|
+
fee: models.V1UniswapQuoteBuyExactlyFeeEnum,
|
|
18
19
|
amount_out: Union[
|
|
19
|
-
models.
|
|
20
|
-
models.
|
|
20
|
+
models.V1UniswapQuoteBuyExactlyAmountOut,
|
|
21
|
+
models.V1UniswapQuoteBuyExactlyAmountOutTypedDict,
|
|
21
22
|
],
|
|
22
23
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
23
24
|
server_url: Optional[str] = None,
|
|
@@ -32,9 +33,9 @@ class UniswapV3(BaseSDK):
|
|
|
32
33
|
It also provides the resulting price after the transaction. The calculation takes
|
|
33
34
|
into account the current pool state and the specified fee tier.
|
|
34
35
|
|
|
35
|
-
:param chain:
|
|
36
|
-
:param token_in: The symbol of the token to swap from.
|
|
37
|
-
:param token_out: The symbol of the token to swap to.
|
|
36
|
+
:param chain:
|
|
37
|
+
:param token_in: The symbol or address of the token to swap from.
|
|
38
|
+
:param token_out: The symbol or address of the token to swap to.
|
|
38
39
|
:param fee: The fee to pay for the swap
|
|
39
40
|
:param amount_out: The amount of the token to swap to
|
|
40
41
|
:param retries: Override the default retry configuration for this method
|
|
@@ -52,7 +53,7 @@ class UniswapV3(BaseSDK):
|
|
|
52
53
|
else:
|
|
53
54
|
base_url = self._get_url(base_url, url_variables)
|
|
54
55
|
|
|
55
|
-
request = models.
|
|
56
|
+
request = models.V1UniswapQuoteBuyExactlyRequest(
|
|
56
57
|
chain=chain,
|
|
57
58
|
token_in=token_in,
|
|
58
59
|
token_out=token_out,
|
|
@@ -62,7 +63,7 @@ class UniswapV3(BaseSDK):
|
|
|
62
63
|
|
|
63
64
|
req = self._build_request(
|
|
64
65
|
method="GET",
|
|
65
|
-
path="/
|
|
66
|
+
path="/v1/uniswap/quote/buy_exactly",
|
|
66
67
|
base_url=base_url,
|
|
67
68
|
url_variables=url_variables,
|
|
68
69
|
request=request,
|
|
@@ -73,6 +74,7 @@ class UniswapV3(BaseSDK):
|
|
|
73
74
|
accept_header_value="application/json",
|
|
74
75
|
http_headers=http_headers,
|
|
75
76
|
security=self.sdk_configuration.security,
|
|
77
|
+
allow_empty_value=None,
|
|
76
78
|
timeout_ms=timeout_ms,
|
|
77
79
|
)
|
|
78
80
|
|
|
@@ -88,8 +90,8 @@ class UniswapV3(BaseSDK):
|
|
|
88
90
|
hook_ctx=HookContext(
|
|
89
91
|
config=self.sdk_configuration,
|
|
90
92
|
base_url=base_url or "",
|
|
91
|
-
operation_id="
|
|
92
|
-
oauth2_scopes=
|
|
93
|
+
operation_id="v1_uniswap_quote_buy_exactly",
|
|
94
|
+
oauth2_scopes=None,
|
|
93
95
|
security_source=self.sdk_configuration.security,
|
|
94
96
|
),
|
|
95
97
|
request=req,
|
|
@@ -99,44 +101,31 @@ class UniswapV3(BaseSDK):
|
|
|
99
101
|
|
|
100
102
|
response_data: Any = None
|
|
101
103
|
if utils.match_response(http_res, "200", "application/json"):
|
|
102
|
-
return
|
|
103
|
-
http_res.text, models.UniswapBuyQuoteInfoResponse
|
|
104
|
-
)
|
|
104
|
+
return unmarshal_json_response(models.UniswapBuyQuoteInfoResponse, http_res)
|
|
105
105
|
if utils.match_response(http_res, "422", "application/json"):
|
|
106
|
-
response_data =
|
|
107
|
-
|
|
106
|
+
response_data = unmarshal_json_response(
|
|
107
|
+
errors.HTTPValidationErrorData, http_res
|
|
108
108
|
)
|
|
109
|
-
raise errors.HTTPValidationError(
|
|
109
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
110
110
|
if utils.match_response(http_res, "4XX", "*"):
|
|
111
111
|
http_res_text = utils.stream_to_text(http_res)
|
|
112
|
-
raise errors.APIError(
|
|
113
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
114
|
-
)
|
|
112
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
115
113
|
if utils.match_response(http_res, "5XX", "*"):
|
|
116
114
|
http_res_text = utils.stream_to_text(http_res)
|
|
117
|
-
raise errors.APIError(
|
|
118
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
119
|
-
)
|
|
115
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
120
116
|
|
|
121
|
-
|
|
122
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
123
|
-
raise errors.APIError(
|
|
124
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
125
|
-
http_res.status_code,
|
|
126
|
-
http_res_text,
|
|
127
|
-
http_res,
|
|
128
|
-
)
|
|
117
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
129
118
|
|
|
130
|
-
async def
|
|
119
|
+
async def uniswap_quote_buy_exactly_async(
|
|
131
120
|
self,
|
|
132
121
|
*,
|
|
133
|
-
chain: models.
|
|
134
|
-
token_in:
|
|
135
|
-
token_out:
|
|
136
|
-
fee: models.
|
|
122
|
+
chain: models.V1UniswapQuoteBuyExactlyChain,
|
|
123
|
+
token_in: str,
|
|
124
|
+
token_out: str,
|
|
125
|
+
fee: models.V1UniswapQuoteBuyExactlyFeeEnum,
|
|
137
126
|
amount_out: Union[
|
|
138
|
-
models.
|
|
139
|
-
models.
|
|
127
|
+
models.V1UniswapQuoteBuyExactlyAmountOut,
|
|
128
|
+
models.V1UniswapQuoteBuyExactlyAmountOutTypedDict,
|
|
140
129
|
],
|
|
141
130
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
142
131
|
server_url: Optional[str] = None,
|
|
@@ -151,9 +140,9 @@ class UniswapV3(BaseSDK):
|
|
|
151
140
|
It also provides the resulting price after the transaction. The calculation takes
|
|
152
141
|
into account the current pool state and the specified fee tier.
|
|
153
142
|
|
|
154
|
-
:param chain:
|
|
155
|
-
:param token_in: The symbol of the token to swap from.
|
|
156
|
-
:param token_out: The symbol of the token to swap to.
|
|
143
|
+
:param chain:
|
|
144
|
+
:param token_in: The symbol or address of the token to swap from.
|
|
145
|
+
:param token_out: The symbol or address of the token to swap to.
|
|
157
146
|
:param fee: The fee to pay for the swap
|
|
158
147
|
:param amount_out: The amount of the token to swap to
|
|
159
148
|
:param retries: Override the default retry configuration for this method
|
|
@@ -171,7 +160,7 @@ class UniswapV3(BaseSDK):
|
|
|
171
160
|
else:
|
|
172
161
|
base_url = self._get_url(base_url, url_variables)
|
|
173
162
|
|
|
174
|
-
request = models.
|
|
163
|
+
request = models.V1UniswapQuoteBuyExactlyRequest(
|
|
175
164
|
chain=chain,
|
|
176
165
|
token_in=token_in,
|
|
177
166
|
token_out=token_out,
|
|
@@ -181,7 +170,7 @@ class UniswapV3(BaseSDK):
|
|
|
181
170
|
|
|
182
171
|
req = self._build_request_async(
|
|
183
172
|
method="GET",
|
|
184
|
-
path="/
|
|
173
|
+
path="/v1/uniswap/quote/buy_exactly",
|
|
185
174
|
base_url=base_url,
|
|
186
175
|
url_variables=url_variables,
|
|
187
176
|
request=request,
|
|
@@ -192,6 +181,7 @@ class UniswapV3(BaseSDK):
|
|
|
192
181
|
accept_header_value="application/json",
|
|
193
182
|
http_headers=http_headers,
|
|
194
183
|
security=self.sdk_configuration.security,
|
|
184
|
+
allow_empty_value=None,
|
|
195
185
|
timeout_ms=timeout_ms,
|
|
196
186
|
)
|
|
197
187
|
|
|
@@ -207,8 +197,8 @@ class UniswapV3(BaseSDK):
|
|
|
207
197
|
hook_ctx=HookContext(
|
|
208
198
|
config=self.sdk_configuration,
|
|
209
199
|
base_url=base_url or "",
|
|
210
|
-
operation_id="
|
|
211
|
-
oauth2_scopes=
|
|
200
|
+
operation_id="v1_uniswap_quote_buy_exactly",
|
|
201
|
+
oauth2_scopes=None,
|
|
212
202
|
security_source=self.sdk_configuration.security,
|
|
213
203
|
),
|
|
214
204
|
request=req,
|
|
@@ -218,44 +208,31 @@ class UniswapV3(BaseSDK):
|
|
|
218
208
|
|
|
219
209
|
response_data: Any = None
|
|
220
210
|
if utils.match_response(http_res, "200", "application/json"):
|
|
221
|
-
return
|
|
222
|
-
http_res.text, models.UniswapBuyQuoteInfoResponse
|
|
223
|
-
)
|
|
211
|
+
return unmarshal_json_response(models.UniswapBuyQuoteInfoResponse, http_res)
|
|
224
212
|
if utils.match_response(http_res, "422", "application/json"):
|
|
225
|
-
response_data =
|
|
226
|
-
|
|
213
|
+
response_data = unmarshal_json_response(
|
|
214
|
+
errors.HTTPValidationErrorData, http_res
|
|
227
215
|
)
|
|
228
|
-
raise errors.HTTPValidationError(
|
|
216
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
229
217
|
if utils.match_response(http_res, "4XX", "*"):
|
|
230
218
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
231
|
-
raise errors.APIError(
|
|
232
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
233
|
-
)
|
|
219
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
234
220
|
if utils.match_response(http_res, "5XX", "*"):
|
|
235
221
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
236
|
-
raise errors.APIError(
|
|
237
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
238
|
-
)
|
|
222
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
239
223
|
|
|
240
|
-
|
|
241
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
242
|
-
raise errors.APIError(
|
|
243
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
244
|
-
http_res.status_code,
|
|
245
|
-
http_res_text,
|
|
246
|
-
http_res,
|
|
247
|
-
)
|
|
224
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
248
225
|
|
|
249
|
-
def
|
|
226
|
+
def uniswap_quote_sell_exactly(
|
|
250
227
|
self,
|
|
251
228
|
*,
|
|
252
|
-
chain: models.
|
|
253
|
-
token_in:
|
|
254
|
-
token_out:
|
|
255
|
-
fee: models.
|
|
229
|
+
chain: models.V1UniswapQuoteSellExactlyChain,
|
|
230
|
+
token_in: str,
|
|
231
|
+
token_out: str,
|
|
232
|
+
fee: models.V1UniswapQuoteSellExactlyFeeEnum,
|
|
256
233
|
amount_in: Union[
|
|
257
|
-
models.
|
|
258
|
-
models.
|
|
234
|
+
models.V1UniswapQuoteSellExactlyAmountIn,
|
|
235
|
+
models.V1UniswapQuoteSellExactlyAmountInTypedDict,
|
|
259
236
|
],
|
|
260
237
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
261
238
|
server_url: Optional[str] = None,
|
|
@@ -270,9 +247,9 @@ class UniswapV3(BaseSDK):
|
|
|
270
247
|
It also provides the resulting price after the transaction. The calculation takes
|
|
271
248
|
into account the current pool state and the specified fee tier.
|
|
272
249
|
|
|
273
|
-
:param chain:
|
|
274
|
-
:param token_in: The symbol of the token to swap from.
|
|
275
|
-
:param token_out: The symbol of the token to swap to.
|
|
250
|
+
:param chain:
|
|
251
|
+
:param token_in: The symbol or address of the token to swap from.
|
|
252
|
+
:param token_out: The symbol or address of the token to swap to.
|
|
276
253
|
:param fee: The fee to pay for the swap
|
|
277
254
|
:param amount_in: The amount of the token to swap from
|
|
278
255
|
:param retries: Override the default retry configuration for this method
|
|
@@ -290,7 +267,7 @@ class UniswapV3(BaseSDK):
|
|
|
290
267
|
else:
|
|
291
268
|
base_url = self._get_url(base_url, url_variables)
|
|
292
269
|
|
|
293
|
-
request = models.
|
|
270
|
+
request = models.V1UniswapQuoteSellExactlyRequest(
|
|
294
271
|
chain=chain,
|
|
295
272
|
token_in=token_in,
|
|
296
273
|
token_out=token_out,
|
|
@@ -300,7 +277,7 @@ class UniswapV3(BaseSDK):
|
|
|
300
277
|
|
|
301
278
|
req = self._build_request(
|
|
302
279
|
method="GET",
|
|
303
|
-
path="/
|
|
280
|
+
path="/v1/uniswap/quote/sell_exactly",
|
|
304
281
|
base_url=base_url,
|
|
305
282
|
url_variables=url_variables,
|
|
306
283
|
request=request,
|
|
@@ -311,6 +288,7 @@ class UniswapV3(BaseSDK):
|
|
|
311
288
|
accept_header_value="application/json",
|
|
312
289
|
http_headers=http_headers,
|
|
313
290
|
security=self.sdk_configuration.security,
|
|
291
|
+
allow_empty_value=None,
|
|
314
292
|
timeout_ms=timeout_ms,
|
|
315
293
|
)
|
|
316
294
|
|
|
@@ -326,8 +304,8 @@ class UniswapV3(BaseSDK):
|
|
|
326
304
|
hook_ctx=HookContext(
|
|
327
305
|
config=self.sdk_configuration,
|
|
328
306
|
base_url=base_url or "",
|
|
329
|
-
operation_id="
|
|
330
|
-
oauth2_scopes=
|
|
307
|
+
operation_id="v1_uniswap_quote_sell_exactly",
|
|
308
|
+
oauth2_scopes=None,
|
|
331
309
|
security_source=self.sdk_configuration.security,
|
|
332
310
|
),
|
|
333
311
|
request=req,
|
|
@@ -337,44 +315,33 @@ class UniswapV3(BaseSDK):
|
|
|
337
315
|
|
|
338
316
|
response_data: Any = None
|
|
339
317
|
if utils.match_response(http_res, "200", "application/json"):
|
|
340
|
-
return
|
|
341
|
-
|
|
318
|
+
return unmarshal_json_response(
|
|
319
|
+
models.UniswapSellQuoteInfoResponse, http_res
|
|
342
320
|
)
|
|
343
321
|
if utils.match_response(http_res, "422", "application/json"):
|
|
344
|
-
response_data =
|
|
345
|
-
|
|
322
|
+
response_data = unmarshal_json_response(
|
|
323
|
+
errors.HTTPValidationErrorData, http_res
|
|
346
324
|
)
|
|
347
|
-
raise errors.HTTPValidationError(
|
|
325
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
348
326
|
if utils.match_response(http_res, "4XX", "*"):
|
|
349
327
|
http_res_text = utils.stream_to_text(http_res)
|
|
350
|
-
raise errors.APIError(
|
|
351
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
352
|
-
)
|
|
328
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
353
329
|
if utils.match_response(http_res, "5XX", "*"):
|
|
354
330
|
http_res_text = utils.stream_to_text(http_res)
|
|
355
|
-
raise errors.APIError(
|
|
356
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
357
|
-
)
|
|
331
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
358
332
|
|
|
359
|
-
|
|
360
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
361
|
-
raise errors.APIError(
|
|
362
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
363
|
-
http_res.status_code,
|
|
364
|
-
http_res_text,
|
|
365
|
-
http_res,
|
|
366
|
-
)
|
|
333
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
367
334
|
|
|
368
|
-
async def
|
|
335
|
+
async def uniswap_quote_sell_exactly_async(
|
|
369
336
|
self,
|
|
370
337
|
*,
|
|
371
|
-
chain: models.
|
|
372
|
-
token_in:
|
|
373
|
-
token_out:
|
|
374
|
-
fee: models.
|
|
338
|
+
chain: models.V1UniswapQuoteSellExactlyChain,
|
|
339
|
+
token_in: str,
|
|
340
|
+
token_out: str,
|
|
341
|
+
fee: models.V1UniswapQuoteSellExactlyFeeEnum,
|
|
375
342
|
amount_in: Union[
|
|
376
|
-
models.
|
|
377
|
-
models.
|
|
343
|
+
models.V1UniswapQuoteSellExactlyAmountIn,
|
|
344
|
+
models.V1UniswapQuoteSellExactlyAmountInTypedDict,
|
|
378
345
|
],
|
|
379
346
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
380
347
|
server_url: Optional[str] = None,
|
|
@@ -389,9 +356,9 @@ class UniswapV3(BaseSDK):
|
|
|
389
356
|
It also provides the resulting price after the transaction. The calculation takes
|
|
390
357
|
into account the current pool state and the specified fee tier.
|
|
391
358
|
|
|
392
|
-
:param chain:
|
|
393
|
-
:param token_in: The symbol of the token to swap from.
|
|
394
|
-
:param token_out: The symbol of the token to swap to.
|
|
359
|
+
:param chain:
|
|
360
|
+
:param token_in: The symbol or address of the token to swap from.
|
|
361
|
+
:param token_out: The symbol or address of the token to swap to.
|
|
395
362
|
:param fee: The fee to pay for the swap
|
|
396
363
|
:param amount_in: The amount of the token to swap from
|
|
397
364
|
:param retries: Override the default retry configuration for this method
|
|
@@ -409,7 +376,7 @@ class UniswapV3(BaseSDK):
|
|
|
409
376
|
else:
|
|
410
377
|
base_url = self._get_url(base_url, url_variables)
|
|
411
378
|
|
|
412
|
-
request = models.
|
|
379
|
+
request = models.V1UniswapQuoteSellExactlyRequest(
|
|
413
380
|
chain=chain,
|
|
414
381
|
token_in=token_in,
|
|
415
382
|
token_out=token_out,
|
|
@@ -419,7 +386,7 @@ class UniswapV3(BaseSDK):
|
|
|
419
386
|
|
|
420
387
|
req = self._build_request_async(
|
|
421
388
|
method="GET",
|
|
422
|
-
path="/
|
|
389
|
+
path="/v1/uniswap/quote/sell_exactly",
|
|
423
390
|
base_url=base_url,
|
|
424
391
|
url_variables=url_variables,
|
|
425
392
|
request=request,
|
|
@@ -430,6 +397,7 @@ class UniswapV3(BaseSDK):
|
|
|
430
397
|
accept_header_value="application/json",
|
|
431
398
|
http_headers=http_headers,
|
|
432
399
|
security=self.sdk_configuration.security,
|
|
400
|
+
allow_empty_value=None,
|
|
433
401
|
timeout_ms=timeout_ms,
|
|
434
402
|
)
|
|
435
403
|
|
|
@@ -445,8 +413,8 @@ class UniswapV3(BaseSDK):
|
|
|
445
413
|
hook_ctx=HookContext(
|
|
446
414
|
config=self.sdk_configuration,
|
|
447
415
|
base_url=base_url or "",
|
|
448
|
-
operation_id="
|
|
449
|
-
oauth2_scopes=
|
|
416
|
+
operation_id="v1_uniswap_quote_sell_exactly",
|
|
417
|
+
oauth2_scopes=None,
|
|
450
418
|
security_source=self.sdk_configuration.security,
|
|
451
419
|
),
|
|
452
420
|
request=req,
|
|
@@ -456,41 +424,30 @@ class UniswapV3(BaseSDK):
|
|
|
456
424
|
|
|
457
425
|
response_data: Any = None
|
|
458
426
|
if utils.match_response(http_res, "200", "application/json"):
|
|
459
|
-
return
|
|
460
|
-
|
|
427
|
+
return unmarshal_json_response(
|
|
428
|
+
models.UniswapSellQuoteInfoResponse, http_res
|
|
461
429
|
)
|
|
462
430
|
if utils.match_response(http_res, "422", "application/json"):
|
|
463
|
-
response_data =
|
|
464
|
-
|
|
431
|
+
response_data = unmarshal_json_response(
|
|
432
|
+
errors.HTTPValidationErrorData, http_res
|
|
465
433
|
)
|
|
466
|
-
raise errors.HTTPValidationError(
|
|
434
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
467
435
|
if utils.match_response(http_res, "4XX", "*"):
|
|
468
436
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
469
|
-
raise errors.APIError(
|
|
470
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
471
|
-
)
|
|
437
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
472
438
|
if utils.match_response(http_res, "5XX", "*"):
|
|
473
439
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
474
|
-
raise errors.APIError(
|
|
475
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
476
|
-
)
|
|
440
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
477
441
|
|
|
478
|
-
|
|
479
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
480
|
-
raise errors.APIError(
|
|
481
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
482
|
-
http_res.status_code,
|
|
483
|
-
http_res_text,
|
|
484
|
-
http_res,
|
|
485
|
-
)
|
|
442
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
486
443
|
|
|
487
|
-
def
|
|
444
|
+
def uniswap_pool_price(
|
|
488
445
|
self,
|
|
489
446
|
*,
|
|
490
|
-
chain: models.
|
|
491
|
-
token_in:
|
|
492
|
-
token_out:
|
|
493
|
-
fee: models.
|
|
447
|
+
chain: models.V1UniswapPoolPriceChain,
|
|
448
|
+
token_in: str,
|
|
449
|
+
token_out: str,
|
|
450
|
+
fee: models.V1UniswapPoolPriceFeeEnum,
|
|
494
451
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
495
452
|
server_url: Optional[str] = None,
|
|
496
453
|
timeout_ms: Optional[int] = None,
|
|
@@ -502,9 +459,9 @@ class UniswapV3(BaseSDK):
|
|
|
502
459
|
|
|
503
460
|
The price is calculated based on the current pool state and the specified fee tier.
|
|
504
461
|
|
|
505
|
-
:param chain:
|
|
506
|
-
:param token_in: The symbol of a token in the pool
|
|
507
|
-
:param token_out: The symbol of a token in the pool
|
|
462
|
+
:param chain:
|
|
463
|
+
:param token_in: The symbol or address of a token in the pool
|
|
464
|
+
:param token_out: The symbol or address of a token in the pool
|
|
508
465
|
:param fee: The fee of the pool
|
|
509
466
|
:param retries: Override the default retry configuration for this method
|
|
510
467
|
:param server_url: Override the default server URL for this method
|
|
@@ -521,7 +478,7 @@ class UniswapV3(BaseSDK):
|
|
|
521
478
|
else:
|
|
522
479
|
base_url = self._get_url(base_url, url_variables)
|
|
523
480
|
|
|
524
|
-
request = models.
|
|
481
|
+
request = models.V1UniswapPoolPriceRequest(
|
|
525
482
|
chain=chain,
|
|
526
483
|
token_in=token_in,
|
|
527
484
|
token_out=token_out,
|
|
@@ -530,7 +487,7 @@ class UniswapV3(BaseSDK):
|
|
|
530
487
|
|
|
531
488
|
req = self._build_request(
|
|
532
489
|
method="GET",
|
|
533
|
-
path="/
|
|
490
|
+
path="/v1/uniswap/pool_price",
|
|
534
491
|
base_url=base_url,
|
|
535
492
|
url_variables=url_variables,
|
|
536
493
|
request=request,
|
|
@@ -541,6 +498,7 @@ class UniswapV3(BaseSDK):
|
|
|
541
498
|
accept_header_value="application/json",
|
|
542
499
|
http_headers=http_headers,
|
|
543
500
|
security=self.sdk_configuration.security,
|
|
501
|
+
allow_empty_value=None,
|
|
544
502
|
timeout_ms=timeout_ms,
|
|
545
503
|
)
|
|
546
504
|
|
|
@@ -556,8 +514,8 @@ class UniswapV3(BaseSDK):
|
|
|
556
514
|
hook_ctx=HookContext(
|
|
557
515
|
config=self.sdk_configuration,
|
|
558
516
|
base_url=base_url or "",
|
|
559
|
-
operation_id="
|
|
560
|
-
oauth2_scopes=
|
|
517
|
+
operation_id="v1_uniswap_pool_price",
|
|
518
|
+
oauth2_scopes=None,
|
|
561
519
|
security_source=self.sdk_configuration.security,
|
|
562
520
|
),
|
|
563
521
|
request=req,
|
|
@@ -567,39 +525,28 @@ class UniswapV3(BaseSDK):
|
|
|
567
525
|
|
|
568
526
|
response_data: Any = None
|
|
569
527
|
if utils.match_response(http_res, "200", "application/json"):
|
|
570
|
-
return
|
|
528
|
+
return unmarshal_json_response(models.UniswapPoolPriceResponse, http_res)
|
|
571
529
|
if utils.match_response(http_res, "422", "application/json"):
|
|
572
|
-
response_data =
|
|
573
|
-
|
|
530
|
+
response_data = unmarshal_json_response(
|
|
531
|
+
errors.HTTPValidationErrorData, http_res
|
|
574
532
|
)
|
|
575
|
-
raise errors.HTTPValidationError(
|
|
533
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
576
534
|
if utils.match_response(http_res, "4XX", "*"):
|
|
577
535
|
http_res_text = utils.stream_to_text(http_res)
|
|
578
|
-
raise errors.APIError(
|
|
579
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
580
|
-
)
|
|
536
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
581
537
|
if utils.match_response(http_res, "5XX", "*"):
|
|
582
538
|
http_res_text = utils.stream_to_text(http_res)
|
|
583
|
-
raise errors.APIError(
|
|
584
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
585
|
-
)
|
|
539
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
586
540
|
|
|
587
|
-
|
|
588
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
589
|
-
raise errors.APIError(
|
|
590
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
591
|
-
http_res.status_code,
|
|
592
|
-
http_res_text,
|
|
593
|
-
http_res,
|
|
594
|
-
)
|
|
541
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
595
542
|
|
|
596
|
-
async def
|
|
543
|
+
async def uniswap_pool_price_async(
|
|
597
544
|
self,
|
|
598
545
|
*,
|
|
599
|
-
chain: models.
|
|
600
|
-
token_in:
|
|
601
|
-
token_out:
|
|
602
|
-
fee: models.
|
|
546
|
+
chain: models.V1UniswapPoolPriceChain,
|
|
547
|
+
token_in: str,
|
|
548
|
+
token_out: str,
|
|
549
|
+
fee: models.V1UniswapPoolPriceFeeEnum,
|
|
603
550
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
604
551
|
server_url: Optional[str] = None,
|
|
605
552
|
timeout_ms: Optional[int] = None,
|
|
@@ -611,9 +558,9 @@ class UniswapV3(BaseSDK):
|
|
|
611
558
|
|
|
612
559
|
The price is calculated based on the current pool state and the specified fee tier.
|
|
613
560
|
|
|
614
|
-
:param chain:
|
|
615
|
-
:param token_in: The symbol of a token in the pool
|
|
616
|
-
:param token_out: The symbol of a token in the pool
|
|
561
|
+
:param chain:
|
|
562
|
+
:param token_in: The symbol or address of a token in the pool
|
|
563
|
+
:param token_out: The symbol or address of a token in the pool
|
|
617
564
|
:param fee: The fee of the pool
|
|
618
565
|
:param retries: Override the default retry configuration for this method
|
|
619
566
|
:param server_url: Override the default server URL for this method
|
|
@@ -630,7 +577,7 @@ class UniswapV3(BaseSDK):
|
|
|
630
577
|
else:
|
|
631
578
|
base_url = self._get_url(base_url, url_variables)
|
|
632
579
|
|
|
633
|
-
request = models.
|
|
580
|
+
request = models.V1UniswapPoolPriceRequest(
|
|
634
581
|
chain=chain,
|
|
635
582
|
token_in=token_in,
|
|
636
583
|
token_out=token_out,
|
|
@@ -639,7 +586,7 @@ class UniswapV3(BaseSDK):
|
|
|
639
586
|
|
|
640
587
|
req = self._build_request_async(
|
|
641
588
|
method="GET",
|
|
642
|
-
path="/
|
|
589
|
+
path="/v1/uniswap/pool_price",
|
|
643
590
|
base_url=base_url,
|
|
644
591
|
url_variables=url_variables,
|
|
645
592
|
request=request,
|
|
@@ -650,6 +597,7 @@ class UniswapV3(BaseSDK):
|
|
|
650
597
|
accept_header_value="application/json",
|
|
651
598
|
http_headers=http_headers,
|
|
652
599
|
security=self.sdk_configuration.security,
|
|
600
|
+
allow_empty_value=None,
|
|
653
601
|
timeout_ms=timeout_ms,
|
|
654
602
|
)
|
|
655
603
|
|
|
@@ -665,8 +613,8 @@ class UniswapV3(BaseSDK):
|
|
|
665
613
|
hook_ctx=HookContext(
|
|
666
614
|
config=self.sdk_configuration,
|
|
667
615
|
base_url=base_url or "",
|
|
668
|
-
operation_id="
|
|
669
|
-
oauth2_scopes=
|
|
616
|
+
operation_id="v1_uniswap_pool_price",
|
|
617
|
+
oauth2_scopes=None,
|
|
670
618
|
security_source=self.sdk_configuration.security,
|
|
671
619
|
),
|
|
672
620
|
request=req,
|
|
@@ -676,37 +624,26 @@ class UniswapV3(BaseSDK):
|
|
|
676
624
|
|
|
677
625
|
response_data: Any = None
|
|
678
626
|
if utils.match_response(http_res, "200", "application/json"):
|
|
679
|
-
return
|
|
627
|
+
return unmarshal_json_response(models.UniswapPoolPriceResponse, http_res)
|
|
680
628
|
if utils.match_response(http_res, "422", "application/json"):
|
|
681
|
-
response_data =
|
|
682
|
-
|
|
629
|
+
response_data = unmarshal_json_response(
|
|
630
|
+
errors.HTTPValidationErrorData, http_res
|
|
683
631
|
)
|
|
684
|
-
raise errors.HTTPValidationError(
|
|
632
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
685
633
|
if utils.match_response(http_res, "4XX", "*"):
|
|
686
634
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
687
|
-
raise errors.APIError(
|
|
688
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
689
|
-
)
|
|
635
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
690
636
|
if utils.match_response(http_res, "5XX", "*"):
|
|
691
637
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
692
|
-
raise errors.APIError(
|
|
693
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
694
|
-
)
|
|
638
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
695
639
|
|
|
696
|
-
|
|
697
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
698
|
-
raise errors.APIError(
|
|
699
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
700
|
-
http_res.status_code,
|
|
701
|
-
http_res_text,
|
|
702
|
-
http_res,
|
|
703
|
-
)
|
|
640
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
704
641
|
|
|
705
|
-
def
|
|
642
|
+
def uniswap_liquidity_provision_in_range(
|
|
706
643
|
self,
|
|
707
644
|
*,
|
|
708
|
-
chain: models.
|
|
709
|
-
token_id: int
|
|
645
|
+
chain: models.V1UniswapLiquidityProvisionInRangeChain,
|
|
646
|
+
token_id: int,
|
|
710
647
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
711
648
|
server_url: Optional[str] = None,
|
|
712
649
|
timeout_ms: Optional[int] = None,
|
|
@@ -723,7 +660,7 @@ class UniswapV3(BaseSDK):
|
|
|
723
660
|
they are actively participating in the trading activities within the liquidity pool
|
|
724
661
|
and earning trading fees.
|
|
725
662
|
|
|
726
|
-
:param chain:
|
|
663
|
+
:param chain:
|
|
727
664
|
:param token_id: Token ID of the NFT representing the liquidity provisioned position.
|
|
728
665
|
:param retries: Override the default retry configuration for this method
|
|
729
666
|
:param server_url: Override the default server URL for this method
|
|
@@ -740,14 +677,14 @@ class UniswapV3(BaseSDK):
|
|
|
740
677
|
else:
|
|
741
678
|
base_url = self._get_url(base_url, url_variables)
|
|
742
679
|
|
|
743
|
-
request = models.
|
|
680
|
+
request = models.V1UniswapLiquidityProvisionInRangeRequest(
|
|
744
681
|
chain=chain,
|
|
745
682
|
token_id=token_id,
|
|
746
683
|
)
|
|
747
684
|
|
|
748
685
|
req = self._build_request(
|
|
749
686
|
method="GET",
|
|
750
|
-
path="/
|
|
687
|
+
path="/v1/uniswap/liquidity_provision/in_range",
|
|
751
688
|
base_url=base_url,
|
|
752
689
|
url_variables=url_variables,
|
|
753
690
|
request=request,
|
|
@@ -758,6 +695,7 @@ class UniswapV3(BaseSDK):
|
|
|
758
695
|
accept_header_value="application/json",
|
|
759
696
|
http_headers=http_headers,
|
|
760
697
|
security=self.sdk_configuration.security,
|
|
698
|
+
allow_empty_value=None,
|
|
761
699
|
timeout_ms=timeout_ms,
|
|
762
700
|
)
|
|
763
701
|
|
|
@@ -773,8 +711,8 @@ class UniswapV3(BaseSDK):
|
|
|
773
711
|
hook_ctx=HookContext(
|
|
774
712
|
config=self.sdk_configuration,
|
|
775
713
|
base_url=base_url or "",
|
|
776
|
-
operation_id="
|
|
777
|
-
oauth2_scopes=
|
|
714
|
+
operation_id="v1_uniswap_liquidity_provision_in_range",
|
|
715
|
+
oauth2_scopes=None,
|
|
778
716
|
security_source=self.sdk_configuration.security,
|
|
779
717
|
),
|
|
780
718
|
request=req,
|
|
@@ -784,39 +722,26 @@ class UniswapV3(BaseSDK):
|
|
|
784
722
|
|
|
785
723
|
response_data: Any = None
|
|
786
724
|
if utils.match_response(http_res, "200", "application/json"):
|
|
787
|
-
return
|
|
788
|
-
http_res.text, models.UniswapCheckInRangeResponse
|
|
789
|
-
)
|
|
725
|
+
return unmarshal_json_response(models.UniswapCheckInRangeResponse, http_res)
|
|
790
726
|
if utils.match_response(http_res, "422", "application/json"):
|
|
791
|
-
response_data =
|
|
792
|
-
|
|
727
|
+
response_data = unmarshal_json_response(
|
|
728
|
+
errors.HTTPValidationErrorData, http_res
|
|
793
729
|
)
|
|
794
|
-
raise errors.HTTPValidationError(
|
|
730
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
795
731
|
if utils.match_response(http_res, "4XX", "*"):
|
|
796
732
|
http_res_text = utils.stream_to_text(http_res)
|
|
797
|
-
raise errors.APIError(
|
|
798
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
799
|
-
)
|
|
733
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
800
734
|
if utils.match_response(http_res, "5XX", "*"):
|
|
801
735
|
http_res_text = utils.stream_to_text(http_res)
|
|
802
|
-
raise errors.APIError(
|
|
803
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
804
|
-
)
|
|
736
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
805
737
|
|
|
806
|
-
|
|
807
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
808
|
-
raise errors.APIError(
|
|
809
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
810
|
-
http_res.status_code,
|
|
811
|
-
http_res_text,
|
|
812
|
-
http_res,
|
|
813
|
-
)
|
|
738
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
814
739
|
|
|
815
|
-
async def
|
|
740
|
+
async def uniswap_liquidity_provision_in_range_async(
|
|
816
741
|
self,
|
|
817
742
|
*,
|
|
818
|
-
chain: models.
|
|
819
|
-
token_id: int
|
|
743
|
+
chain: models.V1UniswapLiquidityProvisionInRangeChain,
|
|
744
|
+
token_id: int,
|
|
820
745
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
821
746
|
server_url: Optional[str] = None,
|
|
822
747
|
timeout_ms: Optional[int] = None,
|
|
@@ -833,7 +758,7 @@ class UniswapV3(BaseSDK):
|
|
|
833
758
|
they are actively participating in the trading activities within the liquidity pool
|
|
834
759
|
and earning trading fees.
|
|
835
760
|
|
|
836
|
-
:param chain:
|
|
761
|
+
:param chain:
|
|
837
762
|
:param token_id: Token ID of the NFT representing the liquidity provisioned position.
|
|
838
763
|
:param retries: Override the default retry configuration for this method
|
|
839
764
|
:param server_url: Override the default server URL for this method
|
|
@@ -850,14 +775,14 @@ class UniswapV3(BaseSDK):
|
|
|
850
775
|
else:
|
|
851
776
|
base_url = self._get_url(base_url, url_variables)
|
|
852
777
|
|
|
853
|
-
request = models.
|
|
778
|
+
request = models.V1UniswapLiquidityProvisionInRangeRequest(
|
|
854
779
|
chain=chain,
|
|
855
780
|
token_id=token_id,
|
|
856
781
|
)
|
|
857
782
|
|
|
858
783
|
req = self._build_request_async(
|
|
859
784
|
method="GET",
|
|
860
|
-
path="/
|
|
785
|
+
path="/v1/uniswap/liquidity_provision/in_range",
|
|
861
786
|
base_url=base_url,
|
|
862
787
|
url_variables=url_variables,
|
|
863
788
|
request=request,
|
|
@@ -868,6 +793,7 @@ class UniswapV3(BaseSDK):
|
|
|
868
793
|
accept_header_value="application/json",
|
|
869
794
|
http_headers=http_headers,
|
|
870
795
|
security=self.sdk_configuration.security,
|
|
796
|
+
allow_empty_value=None,
|
|
871
797
|
timeout_ms=timeout_ms,
|
|
872
798
|
)
|
|
873
799
|
|
|
@@ -883,8 +809,8 @@ class UniswapV3(BaseSDK):
|
|
|
883
809
|
hook_ctx=HookContext(
|
|
884
810
|
config=self.sdk_configuration,
|
|
885
811
|
base_url=base_url or "",
|
|
886
|
-
operation_id="
|
|
887
|
-
oauth2_scopes=
|
|
812
|
+
operation_id="v1_uniswap_liquidity_provision_in_range",
|
|
813
|
+
oauth2_scopes=None,
|
|
888
814
|
security_source=self.sdk_configuration.security,
|
|
889
815
|
),
|
|
890
816
|
request=req,
|
|
@@ -894,39 +820,26 @@ class UniswapV3(BaseSDK):
|
|
|
894
820
|
|
|
895
821
|
response_data: Any = None
|
|
896
822
|
if utils.match_response(http_res, "200", "application/json"):
|
|
897
|
-
return
|
|
898
|
-
http_res.text, models.UniswapCheckInRangeResponse
|
|
899
|
-
)
|
|
823
|
+
return unmarshal_json_response(models.UniswapCheckInRangeResponse, http_res)
|
|
900
824
|
if utils.match_response(http_res, "422", "application/json"):
|
|
901
|
-
response_data =
|
|
902
|
-
|
|
825
|
+
response_data = unmarshal_json_response(
|
|
826
|
+
errors.HTTPValidationErrorData, http_res
|
|
903
827
|
)
|
|
904
|
-
raise errors.HTTPValidationError(
|
|
828
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
905
829
|
if utils.match_response(http_res, "4XX", "*"):
|
|
906
830
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
907
|
-
raise errors.APIError(
|
|
908
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
909
|
-
)
|
|
831
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
910
832
|
if utils.match_response(http_res, "5XX", "*"):
|
|
911
833
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
912
|
-
raise errors.APIError(
|
|
913
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
914
|
-
)
|
|
834
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
915
835
|
|
|
916
|
-
|
|
917
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
918
|
-
raise errors.APIError(
|
|
919
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
920
|
-
http_res.status_code,
|
|
921
|
-
http_res_text,
|
|
922
|
-
http_res,
|
|
923
|
-
)
|
|
836
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
924
837
|
|
|
925
|
-
def
|
|
838
|
+
def uniswap_liquidity_provision_positions(
|
|
926
839
|
self,
|
|
927
840
|
*,
|
|
928
|
-
chain: models.
|
|
929
|
-
user: Optional[str] =
|
|
841
|
+
chain: models.V1UniswapLiquidityProvisionPositionsChain,
|
|
842
|
+
user: Optional[str] = None,
|
|
930
843
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
931
844
|
server_url: Optional[str] = None,
|
|
932
845
|
timeout_ms: Optional[int] = None,
|
|
@@ -942,7 +855,7 @@ class UniswapV3(BaseSDK):
|
|
|
942
855
|
information is crucial for users to manage and analyze their liquidity provision
|
|
943
856
|
activities effectively.
|
|
944
857
|
|
|
945
|
-
:param chain:
|
|
858
|
+
:param chain:
|
|
946
859
|
:param user: The user to get positions for.
|
|
947
860
|
:param retries: Override the default retry configuration for this method
|
|
948
861
|
:param server_url: Override the default server URL for this method
|
|
@@ -959,14 +872,14 @@ class UniswapV3(BaseSDK):
|
|
|
959
872
|
else:
|
|
960
873
|
base_url = self._get_url(base_url, url_variables)
|
|
961
874
|
|
|
962
|
-
request = models.
|
|
875
|
+
request = models.V1UniswapLiquidityProvisionPositionsRequest(
|
|
963
876
|
chain=chain,
|
|
964
877
|
user=user,
|
|
965
878
|
)
|
|
966
879
|
|
|
967
880
|
req = self._build_request(
|
|
968
881
|
method="GET",
|
|
969
|
-
path="/
|
|
882
|
+
path="/v1/uniswap/liquidity_provision/positions",
|
|
970
883
|
base_url=base_url,
|
|
971
884
|
url_variables=url_variables,
|
|
972
885
|
request=request,
|
|
@@ -977,6 +890,7 @@ class UniswapV3(BaseSDK):
|
|
|
977
890
|
accept_header_value="application/json",
|
|
978
891
|
http_headers=http_headers,
|
|
979
892
|
security=self.sdk_configuration.security,
|
|
893
|
+
allow_empty_value=None,
|
|
980
894
|
timeout_ms=timeout_ms,
|
|
981
895
|
)
|
|
982
896
|
|
|
@@ -992,8 +906,8 @@ class UniswapV3(BaseSDK):
|
|
|
992
906
|
hook_ctx=HookContext(
|
|
993
907
|
config=self.sdk_configuration,
|
|
994
908
|
base_url=base_url or "",
|
|
995
|
-
operation_id="
|
|
996
|
-
oauth2_scopes=
|
|
909
|
+
operation_id="v1_uniswap_liquidity_provision_positions",
|
|
910
|
+
oauth2_scopes=None,
|
|
997
911
|
security_source=self.sdk_configuration.security,
|
|
998
912
|
),
|
|
999
913
|
request=req,
|
|
@@ -1003,39 +917,28 @@ class UniswapV3(BaseSDK):
|
|
|
1003
917
|
|
|
1004
918
|
response_data: Any = None
|
|
1005
919
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1006
|
-
return
|
|
1007
|
-
|
|
920
|
+
return unmarshal_json_response(
|
|
921
|
+
models.UniswapLPPositionsInfoResponse, http_res
|
|
1008
922
|
)
|
|
1009
923
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1010
|
-
response_data =
|
|
1011
|
-
|
|
924
|
+
response_data = unmarshal_json_response(
|
|
925
|
+
errors.HTTPValidationErrorData, http_res
|
|
1012
926
|
)
|
|
1013
|
-
raise errors.HTTPValidationError(
|
|
927
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1014
928
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1015
929
|
http_res_text = utils.stream_to_text(http_res)
|
|
1016
|
-
raise errors.APIError(
|
|
1017
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1018
|
-
)
|
|
930
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1019
931
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1020
932
|
http_res_text = utils.stream_to_text(http_res)
|
|
1021
|
-
raise errors.APIError(
|
|
1022
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1023
|
-
)
|
|
933
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1024
934
|
|
|
1025
|
-
|
|
1026
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1027
|
-
raise errors.APIError(
|
|
1028
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1029
|
-
http_res.status_code,
|
|
1030
|
-
http_res_text,
|
|
1031
|
-
http_res,
|
|
1032
|
-
)
|
|
935
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1033
936
|
|
|
1034
|
-
async def
|
|
937
|
+
async def uniswap_liquidity_provision_positions_async(
|
|
1035
938
|
self,
|
|
1036
939
|
*,
|
|
1037
|
-
chain: models.
|
|
1038
|
-
user: Optional[str] =
|
|
940
|
+
chain: models.V1UniswapLiquidityProvisionPositionsChain,
|
|
941
|
+
user: Optional[str] = None,
|
|
1039
942
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1040
943
|
server_url: Optional[str] = None,
|
|
1041
944
|
timeout_ms: Optional[int] = None,
|
|
@@ -1051,7 +954,7 @@ class UniswapV3(BaseSDK):
|
|
|
1051
954
|
information is crucial for users to manage and analyze their liquidity provision
|
|
1052
955
|
activities effectively.
|
|
1053
956
|
|
|
1054
|
-
:param chain:
|
|
957
|
+
:param chain:
|
|
1055
958
|
:param user: The user to get positions for.
|
|
1056
959
|
:param retries: Override the default retry configuration for this method
|
|
1057
960
|
:param server_url: Override the default server URL for this method
|
|
@@ -1068,14 +971,14 @@ class UniswapV3(BaseSDK):
|
|
|
1068
971
|
else:
|
|
1069
972
|
base_url = self._get_url(base_url, url_variables)
|
|
1070
973
|
|
|
1071
|
-
request = models.
|
|
974
|
+
request = models.V1UniswapLiquidityProvisionPositionsRequest(
|
|
1072
975
|
chain=chain,
|
|
1073
976
|
user=user,
|
|
1074
977
|
)
|
|
1075
978
|
|
|
1076
979
|
req = self._build_request_async(
|
|
1077
980
|
method="GET",
|
|
1078
|
-
path="/
|
|
981
|
+
path="/v1/uniswap/liquidity_provision/positions",
|
|
1079
982
|
base_url=base_url,
|
|
1080
983
|
url_variables=url_variables,
|
|
1081
984
|
request=request,
|
|
@@ -1086,6 +989,7 @@ class UniswapV3(BaseSDK):
|
|
|
1086
989
|
accept_header_value="application/json",
|
|
1087
990
|
http_headers=http_headers,
|
|
1088
991
|
security=self.sdk_configuration.security,
|
|
992
|
+
allow_empty_value=None,
|
|
1089
993
|
timeout_ms=timeout_ms,
|
|
1090
994
|
)
|
|
1091
995
|
|
|
@@ -1101,8 +1005,8 @@ class UniswapV3(BaseSDK):
|
|
|
1101
1005
|
hook_ctx=HookContext(
|
|
1102
1006
|
config=self.sdk_configuration,
|
|
1103
1007
|
base_url=base_url or "",
|
|
1104
|
-
operation_id="
|
|
1105
|
-
oauth2_scopes=
|
|
1008
|
+
operation_id="v1_uniswap_liquidity_provision_positions",
|
|
1009
|
+
oauth2_scopes=None,
|
|
1106
1010
|
security_source=self.sdk_configuration.security,
|
|
1107
1011
|
),
|
|
1108
1012
|
request=req,
|
|
@@ -1112,53 +1016,42 @@ class UniswapV3(BaseSDK):
|
|
|
1112
1016
|
|
|
1113
1017
|
response_data: Any = None
|
|
1114
1018
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1115
|
-
return
|
|
1116
|
-
|
|
1019
|
+
return unmarshal_json_response(
|
|
1020
|
+
models.UniswapLPPositionsInfoResponse, http_res
|
|
1117
1021
|
)
|
|
1118
1022
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1119
|
-
response_data =
|
|
1120
|
-
|
|
1023
|
+
response_data = unmarshal_json_response(
|
|
1024
|
+
errors.HTTPValidationErrorData, http_res
|
|
1121
1025
|
)
|
|
1122
|
-
raise errors.HTTPValidationError(
|
|
1026
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1123
1027
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1124
1028
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1125
|
-
raise errors.APIError(
|
|
1126
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1127
|
-
)
|
|
1029
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1128
1030
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1129
1031
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1130
|
-
raise errors.APIError(
|
|
1131
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1132
|
-
)
|
|
1032
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1133
1033
|
|
|
1134
|
-
|
|
1135
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1136
|
-
raise errors.APIError(
|
|
1137
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1138
|
-
http_res.status_code,
|
|
1139
|
-
http_res_text,
|
|
1140
|
-
http_res,
|
|
1141
|
-
)
|
|
1034
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1142
1035
|
|
|
1143
|
-
def
|
|
1036
|
+
def uniswap_swap_buy_exactly(
|
|
1144
1037
|
self,
|
|
1145
1038
|
*,
|
|
1146
|
-
token_in:
|
|
1147
|
-
token_out:
|
|
1039
|
+
token_in: str,
|
|
1040
|
+
token_out: str,
|
|
1148
1041
|
fee: models.FeeEnum,
|
|
1149
|
-
|
|
1150
|
-
models.
|
|
1151
|
-
models.
|
|
1042
|
+
amount_out: Union[
|
|
1043
|
+
models.UniswapBuyExactlyRequestAmountOut,
|
|
1044
|
+
models.UniswapBuyExactlyRequestAmountOutTypedDict,
|
|
1152
1045
|
],
|
|
1153
1046
|
max_slippage_percent: float,
|
|
1154
|
-
chain: models.
|
|
1047
|
+
chain: models.UniswapBuyExactlyRequestChain,
|
|
1155
1048
|
sender: str,
|
|
1156
|
-
|
|
1049
|
+
estimate_gas: Optional[bool] = None,
|
|
1157
1050
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1158
1051
|
server_url: Optional[str] = None,
|
|
1159
1052
|
timeout_ms: Optional[int] = None,
|
|
1160
1053
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1161
|
-
) -> models.
|
|
1054
|
+
) -> models.UniswapBuyExactlyTransactionResponse:
|
|
1162
1055
|
r"""Buy exact amount
|
|
1163
1056
|
|
|
1164
1057
|
This endpoint allows users to trade a variable amount of one token to receive an
|
|
@@ -1166,17 +1059,27 @@ class UniswapV3(BaseSDK):
|
|
|
1166
1059
|
|
|
1167
1060
|
The transaction is executed on the specified blockchain network, and the user must
|
|
1168
1061
|
provide the necessary transaction details, including the token to buy, the token to
|
|
1169
|
-
pay with, and the exact amount to receive. If the token being paid with is
|
|
1062
|
+
pay with, and the exact amount to receive. If the token being paid with is ETH and
|
|
1170
1063
|
needs to be wrapped, the appropriate amount will be wrapped automatically.
|
|
1064
|
+
<Info>
|
|
1065
|
+
**Required Allowances**
|
|
1066
|
+
|
|
1067
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1068
|
+
|
|
1069
|
+
- `UniswapV3Router`
|
|
1070
|
+
</Info>
|
|
1071
|
+
|
|
1171
1072
|
|
|
1172
|
-
:param token_in:
|
|
1173
|
-
:param token_out:
|
|
1174
|
-
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1175
|
-
|
|
1073
|
+
:param token_in: The symbol or address of the token to swap from..
|
|
1074
|
+
:param token_out: The symbol or address of the token to swap to..
|
|
1075
|
+
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1076
|
+
|
|
1077
|
+
Uniswap supports 4 different fee levels.
|
|
1078
|
+
:param amount_out: The amount of 'token_out' to buy.
|
|
1176
1079
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
|
|
1177
|
-
:param chain:
|
|
1080
|
+
:param chain:
|
|
1178
1081
|
:param sender: The address of the transaction sender.
|
|
1179
|
-
:param
|
|
1082
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1180
1083
|
:param retries: Override the default retry configuration for this method
|
|
1181
1084
|
:param server_url: Override the default server URL for this method
|
|
1182
1085
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1196,16 +1099,16 @@ class UniswapV3(BaseSDK):
|
|
|
1196
1099
|
token_in=token_in,
|
|
1197
1100
|
token_out=token_out,
|
|
1198
1101
|
fee=fee,
|
|
1199
|
-
|
|
1102
|
+
amount_out=amount_out,
|
|
1200
1103
|
max_slippage_percent=max_slippage_percent,
|
|
1201
|
-
wrap_eth=wrap_eth,
|
|
1202
1104
|
chain=chain,
|
|
1203
1105
|
sender=sender,
|
|
1106
|
+
estimate_gas=estimate_gas,
|
|
1204
1107
|
)
|
|
1205
1108
|
|
|
1206
1109
|
req = self._build_request(
|
|
1207
1110
|
method="POST",
|
|
1208
|
-
path="/
|
|
1111
|
+
path="/v1/uniswap/swap/buy_exactly",
|
|
1209
1112
|
base_url=base_url,
|
|
1210
1113
|
url_variables=url_variables,
|
|
1211
1114
|
request=request,
|
|
@@ -1219,6 +1122,7 @@ class UniswapV3(BaseSDK):
|
|
|
1219
1122
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1220
1123
|
request, False, False, "json", models.UniswapBuyExactlyRequest
|
|
1221
1124
|
),
|
|
1125
|
+
allow_empty_value=None,
|
|
1222
1126
|
timeout_ms=timeout_ms,
|
|
1223
1127
|
)
|
|
1224
1128
|
|
|
@@ -1234,8 +1138,8 @@ class UniswapV3(BaseSDK):
|
|
|
1234
1138
|
hook_ctx=HookContext(
|
|
1235
1139
|
config=self.sdk_configuration,
|
|
1236
1140
|
base_url=base_url or "",
|
|
1237
|
-
operation_id="
|
|
1238
|
-
oauth2_scopes=
|
|
1141
|
+
operation_id="v1_uniswap_swap_buy_exactly",
|
|
1142
|
+
oauth2_scopes=None,
|
|
1239
1143
|
security_source=self.sdk_configuration.security,
|
|
1240
1144
|
),
|
|
1241
1145
|
request=req,
|
|
@@ -1245,51 +1149,42 @@ class UniswapV3(BaseSDK):
|
|
|
1245
1149
|
|
|
1246
1150
|
response_data: Any = None
|
|
1247
1151
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1248
|
-
return
|
|
1152
|
+
return unmarshal_json_response(
|
|
1153
|
+
models.UniswapBuyExactlyTransactionResponse, http_res
|
|
1154
|
+
)
|
|
1249
1155
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1250
|
-
response_data =
|
|
1251
|
-
|
|
1156
|
+
response_data = unmarshal_json_response(
|
|
1157
|
+
errors.HTTPValidationErrorData, http_res
|
|
1252
1158
|
)
|
|
1253
|
-
raise errors.HTTPValidationError(
|
|
1159
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1254
1160
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1255
1161
|
http_res_text = utils.stream_to_text(http_res)
|
|
1256
|
-
raise errors.APIError(
|
|
1257
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1258
|
-
)
|
|
1162
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1259
1163
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1260
1164
|
http_res_text = utils.stream_to_text(http_res)
|
|
1261
|
-
raise errors.APIError(
|
|
1262
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1263
|
-
)
|
|
1165
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1264
1166
|
|
|
1265
|
-
|
|
1266
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1267
|
-
raise errors.APIError(
|
|
1268
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1269
|
-
http_res.status_code,
|
|
1270
|
-
http_res_text,
|
|
1271
|
-
http_res,
|
|
1272
|
-
)
|
|
1167
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1273
1168
|
|
|
1274
|
-
async def
|
|
1169
|
+
async def uniswap_swap_buy_exactly_async(
|
|
1275
1170
|
self,
|
|
1276
1171
|
*,
|
|
1277
|
-
token_in:
|
|
1278
|
-
token_out:
|
|
1172
|
+
token_in: str,
|
|
1173
|
+
token_out: str,
|
|
1279
1174
|
fee: models.FeeEnum,
|
|
1280
|
-
|
|
1281
|
-
models.
|
|
1282
|
-
models.
|
|
1175
|
+
amount_out: Union[
|
|
1176
|
+
models.UniswapBuyExactlyRequestAmountOut,
|
|
1177
|
+
models.UniswapBuyExactlyRequestAmountOutTypedDict,
|
|
1283
1178
|
],
|
|
1284
1179
|
max_slippage_percent: float,
|
|
1285
|
-
chain: models.
|
|
1180
|
+
chain: models.UniswapBuyExactlyRequestChain,
|
|
1286
1181
|
sender: str,
|
|
1287
|
-
|
|
1182
|
+
estimate_gas: Optional[bool] = None,
|
|
1288
1183
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1289
1184
|
server_url: Optional[str] = None,
|
|
1290
1185
|
timeout_ms: Optional[int] = None,
|
|
1291
1186
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1292
|
-
) -> models.
|
|
1187
|
+
) -> models.UniswapBuyExactlyTransactionResponse:
|
|
1293
1188
|
r"""Buy exact amount
|
|
1294
1189
|
|
|
1295
1190
|
This endpoint allows users to trade a variable amount of one token to receive an
|
|
@@ -1297,17 +1192,27 @@ class UniswapV3(BaseSDK):
|
|
|
1297
1192
|
|
|
1298
1193
|
The transaction is executed on the specified blockchain network, and the user must
|
|
1299
1194
|
provide the necessary transaction details, including the token to buy, the token to
|
|
1300
|
-
pay with, and the exact amount to receive. If the token being paid with is
|
|
1195
|
+
pay with, and the exact amount to receive. If the token being paid with is ETH and
|
|
1301
1196
|
needs to be wrapped, the appropriate amount will be wrapped automatically.
|
|
1197
|
+
<Info>
|
|
1198
|
+
**Required Allowances**
|
|
1199
|
+
|
|
1200
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1201
|
+
|
|
1202
|
+
- `UniswapV3Router`
|
|
1203
|
+
</Info>
|
|
1204
|
+
|
|
1302
1205
|
|
|
1303
|
-
:param token_in:
|
|
1304
|
-
:param token_out:
|
|
1305
|
-
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1306
|
-
|
|
1206
|
+
:param token_in: The symbol or address of the token to swap from..
|
|
1207
|
+
:param token_out: The symbol or address of the token to swap to..
|
|
1208
|
+
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1209
|
+
|
|
1210
|
+
Uniswap supports 4 different fee levels.
|
|
1211
|
+
:param amount_out: The amount of 'token_out' to buy.
|
|
1307
1212
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
|
|
1308
|
-
:param chain:
|
|
1213
|
+
:param chain:
|
|
1309
1214
|
:param sender: The address of the transaction sender.
|
|
1310
|
-
:param
|
|
1215
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1311
1216
|
:param retries: Override the default retry configuration for this method
|
|
1312
1217
|
:param server_url: Override the default server URL for this method
|
|
1313
1218
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1327,16 +1232,16 @@ class UniswapV3(BaseSDK):
|
|
|
1327
1232
|
token_in=token_in,
|
|
1328
1233
|
token_out=token_out,
|
|
1329
1234
|
fee=fee,
|
|
1330
|
-
|
|
1235
|
+
amount_out=amount_out,
|
|
1331
1236
|
max_slippage_percent=max_slippage_percent,
|
|
1332
|
-
wrap_eth=wrap_eth,
|
|
1333
1237
|
chain=chain,
|
|
1334
1238
|
sender=sender,
|
|
1239
|
+
estimate_gas=estimate_gas,
|
|
1335
1240
|
)
|
|
1336
1241
|
|
|
1337
1242
|
req = self._build_request_async(
|
|
1338
1243
|
method="POST",
|
|
1339
|
-
path="/
|
|
1244
|
+
path="/v1/uniswap/swap/buy_exactly",
|
|
1340
1245
|
base_url=base_url,
|
|
1341
1246
|
url_variables=url_variables,
|
|
1342
1247
|
request=request,
|
|
@@ -1350,6 +1255,7 @@ class UniswapV3(BaseSDK):
|
|
|
1350
1255
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1351
1256
|
request, False, False, "json", models.UniswapBuyExactlyRequest
|
|
1352
1257
|
),
|
|
1258
|
+
allow_empty_value=None,
|
|
1353
1259
|
timeout_ms=timeout_ms,
|
|
1354
1260
|
)
|
|
1355
1261
|
|
|
@@ -1365,8 +1271,8 @@ class UniswapV3(BaseSDK):
|
|
|
1365
1271
|
hook_ctx=HookContext(
|
|
1366
1272
|
config=self.sdk_configuration,
|
|
1367
1273
|
base_url=base_url or "",
|
|
1368
|
-
operation_id="
|
|
1369
|
-
oauth2_scopes=
|
|
1274
|
+
operation_id="v1_uniswap_swap_buy_exactly",
|
|
1275
|
+
oauth2_scopes=None,
|
|
1370
1276
|
security_source=self.sdk_configuration.security,
|
|
1371
1277
|
),
|
|
1372
1278
|
request=req,
|
|
@@ -1376,51 +1282,42 @@ class UniswapV3(BaseSDK):
|
|
|
1376
1282
|
|
|
1377
1283
|
response_data: Any = None
|
|
1378
1284
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1379
|
-
return
|
|
1285
|
+
return unmarshal_json_response(
|
|
1286
|
+
models.UniswapBuyExactlyTransactionResponse, http_res
|
|
1287
|
+
)
|
|
1380
1288
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1381
|
-
response_data =
|
|
1382
|
-
|
|
1289
|
+
response_data = unmarshal_json_response(
|
|
1290
|
+
errors.HTTPValidationErrorData, http_res
|
|
1383
1291
|
)
|
|
1384
|
-
raise errors.HTTPValidationError(
|
|
1292
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1385
1293
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1386
1294
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1387
|
-
raise errors.APIError(
|
|
1388
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1389
|
-
)
|
|
1295
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1390
1296
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1391
1297
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1392
|
-
raise errors.APIError(
|
|
1393
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1394
|
-
)
|
|
1298
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1395
1299
|
|
|
1396
|
-
|
|
1397
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1398
|
-
raise errors.APIError(
|
|
1399
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1400
|
-
http_res.status_code,
|
|
1401
|
-
http_res_text,
|
|
1402
|
-
http_res,
|
|
1403
|
-
)
|
|
1300
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1404
1301
|
|
|
1405
|
-
def
|
|
1302
|
+
def uniswap_swap_sell_exactly(
|
|
1406
1303
|
self,
|
|
1407
1304
|
*,
|
|
1408
|
-
token_in:
|
|
1409
|
-
token_out:
|
|
1305
|
+
token_in: str,
|
|
1306
|
+
token_out: str,
|
|
1410
1307
|
fee: models.FeeEnum,
|
|
1411
|
-
|
|
1412
|
-
models.
|
|
1413
|
-
models.
|
|
1308
|
+
amount_in: Union[
|
|
1309
|
+
models.UniswapSellExactlyRequestAmountIn,
|
|
1310
|
+
models.UniswapSellExactlyRequestAmountInTypedDict,
|
|
1414
1311
|
],
|
|
1415
1312
|
max_slippage_percent: float,
|
|
1416
|
-
chain: models.
|
|
1313
|
+
chain: models.UniswapSellExactlyRequestChain,
|
|
1417
1314
|
sender: str,
|
|
1418
|
-
|
|
1315
|
+
estimate_gas: Optional[bool] = None,
|
|
1419
1316
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1420
1317
|
server_url: Optional[str] = None,
|
|
1421
1318
|
timeout_ms: Optional[int] = None,
|
|
1422
1319
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1423
|
-
) -> models.
|
|
1320
|
+
) -> models.UniswapSellExactlyTransactionResponse:
|
|
1424
1321
|
r"""Sell exact amount
|
|
1425
1322
|
|
|
1426
1323
|
This endpoint allows users to trade a specific amount of one token into another
|
|
@@ -1428,17 +1325,27 @@ class UniswapV3(BaseSDK):
|
|
|
1428
1325
|
|
|
1429
1326
|
The transaction is executed on the specified blockchain network, and the user must
|
|
1430
1327
|
provide the necessary transaction details, including the token to sell, the token to
|
|
1431
|
-
receive, and the amount to sell. If the token being sold is
|
|
1328
|
+
receive, and the amount to sell. If the token being sold is ETH and needs to be
|
|
1432
1329
|
wrapped, the appropriate amount will be wrapped automatically.
|
|
1330
|
+
<Info>
|
|
1331
|
+
**Required Allowances**
|
|
1433
1332
|
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1333
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1334
|
+
|
|
1335
|
+
- `UniswapV3Router`
|
|
1336
|
+
</Info>
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
:param token_in: The symbol or address of the token to sell..
|
|
1340
|
+
:param token_out: The symbol or address of the token to buy..
|
|
1341
|
+
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1342
|
+
|
|
1343
|
+
Uniswap supports 4 different fee levels.
|
|
1344
|
+
:param amount_in: The amount of the `token_in` to sell
|
|
1438
1345
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
|
|
1439
|
-
:param chain:
|
|
1346
|
+
:param chain:
|
|
1440
1347
|
:param sender: The address of the transaction sender.
|
|
1441
|
-
:param
|
|
1348
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1442
1349
|
:param retries: Override the default retry configuration for this method
|
|
1443
1350
|
:param server_url: Override the default server URL for this method
|
|
1444
1351
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1458,16 +1365,16 @@ class UniswapV3(BaseSDK):
|
|
|
1458
1365
|
token_in=token_in,
|
|
1459
1366
|
token_out=token_out,
|
|
1460
1367
|
fee=fee,
|
|
1461
|
-
|
|
1368
|
+
amount_in=amount_in,
|
|
1462
1369
|
max_slippage_percent=max_slippage_percent,
|
|
1463
|
-
wrap_eth=wrap_eth,
|
|
1464
1370
|
chain=chain,
|
|
1465
1371
|
sender=sender,
|
|
1372
|
+
estimate_gas=estimate_gas,
|
|
1466
1373
|
)
|
|
1467
1374
|
|
|
1468
1375
|
req = self._build_request(
|
|
1469
1376
|
method="POST",
|
|
1470
|
-
path="/
|
|
1377
|
+
path="/v1/uniswap/swap/sell_exactly",
|
|
1471
1378
|
base_url=base_url,
|
|
1472
1379
|
url_variables=url_variables,
|
|
1473
1380
|
request=request,
|
|
@@ -1481,6 +1388,7 @@ class UniswapV3(BaseSDK):
|
|
|
1481
1388
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1482
1389
|
request, False, False, "json", models.UniswapSellExactlyRequest
|
|
1483
1390
|
),
|
|
1391
|
+
allow_empty_value=None,
|
|
1484
1392
|
timeout_ms=timeout_ms,
|
|
1485
1393
|
)
|
|
1486
1394
|
|
|
@@ -1496,8 +1404,8 @@ class UniswapV3(BaseSDK):
|
|
|
1496
1404
|
hook_ctx=HookContext(
|
|
1497
1405
|
config=self.sdk_configuration,
|
|
1498
1406
|
base_url=base_url or "",
|
|
1499
|
-
operation_id="
|
|
1500
|
-
oauth2_scopes=
|
|
1407
|
+
operation_id="v1_uniswap_swap_sell_exactly",
|
|
1408
|
+
oauth2_scopes=None,
|
|
1501
1409
|
security_source=self.sdk_configuration.security,
|
|
1502
1410
|
),
|
|
1503
1411
|
request=req,
|
|
@@ -1507,51 +1415,42 @@ class UniswapV3(BaseSDK):
|
|
|
1507
1415
|
|
|
1508
1416
|
response_data: Any = None
|
|
1509
1417
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1510
|
-
return
|
|
1418
|
+
return unmarshal_json_response(
|
|
1419
|
+
models.UniswapSellExactlyTransactionResponse, http_res
|
|
1420
|
+
)
|
|
1511
1421
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1512
|
-
response_data =
|
|
1513
|
-
|
|
1422
|
+
response_data = unmarshal_json_response(
|
|
1423
|
+
errors.HTTPValidationErrorData, http_res
|
|
1514
1424
|
)
|
|
1515
|
-
raise errors.HTTPValidationError(
|
|
1425
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1516
1426
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1517
1427
|
http_res_text = utils.stream_to_text(http_res)
|
|
1518
|
-
raise errors.APIError(
|
|
1519
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1520
|
-
)
|
|
1428
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1521
1429
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1522
1430
|
http_res_text = utils.stream_to_text(http_res)
|
|
1523
|
-
raise errors.APIError(
|
|
1524
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1525
|
-
)
|
|
1431
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1526
1432
|
|
|
1527
|
-
|
|
1528
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1529
|
-
raise errors.APIError(
|
|
1530
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1531
|
-
http_res.status_code,
|
|
1532
|
-
http_res_text,
|
|
1533
|
-
http_res,
|
|
1534
|
-
)
|
|
1433
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1535
1434
|
|
|
1536
|
-
async def
|
|
1435
|
+
async def uniswap_swap_sell_exactly_async(
|
|
1537
1436
|
self,
|
|
1538
1437
|
*,
|
|
1539
|
-
token_in:
|
|
1540
|
-
token_out:
|
|
1438
|
+
token_in: str,
|
|
1439
|
+
token_out: str,
|
|
1541
1440
|
fee: models.FeeEnum,
|
|
1542
|
-
|
|
1543
|
-
models.
|
|
1544
|
-
models.
|
|
1441
|
+
amount_in: Union[
|
|
1442
|
+
models.UniswapSellExactlyRequestAmountIn,
|
|
1443
|
+
models.UniswapSellExactlyRequestAmountInTypedDict,
|
|
1545
1444
|
],
|
|
1546
1445
|
max_slippage_percent: float,
|
|
1547
|
-
chain: models.
|
|
1446
|
+
chain: models.UniswapSellExactlyRequestChain,
|
|
1548
1447
|
sender: str,
|
|
1549
|
-
|
|
1448
|
+
estimate_gas: Optional[bool] = None,
|
|
1550
1449
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1551
1450
|
server_url: Optional[str] = None,
|
|
1552
1451
|
timeout_ms: Optional[int] = None,
|
|
1553
1452
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1554
|
-
) -> models.
|
|
1453
|
+
) -> models.UniswapSellExactlyTransactionResponse:
|
|
1555
1454
|
r"""Sell exact amount
|
|
1556
1455
|
|
|
1557
1456
|
This endpoint allows users to trade a specific amount of one token into another
|
|
@@ -1559,17 +1458,27 @@ class UniswapV3(BaseSDK):
|
|
|
1559
1458
|
|
|
1560
1459
|
The transaction is executed on the specified blockchain network, and the user must
|
|
1561
1460
|
provide the necessary transaction details, including the token to sell, the token to
|
|
1562
|
-
receive, and the amount to sell. If the token being sold is
|
|
1461
|
+
receive, and the amount to sell. If the token being sold is ETH and needs to be
|
|
1563
1462
|
wrapped, the appropriate amount will be wrapped automatically.
|
|
1463
|
+
<Info>
|
|
1464
|
+
**Required Allowances**
|
|
1465
|
+
|
|
1466
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1467
|
+
|
|
1468
|
+
- `UniswapV3Router`
|
|
1469
|
+
</Info>
|
|
1564
1470
|
|
|
1565
|
-
|
|
1566
|
-
:param
|
|
1567
|
-
:param
|
|
1568
|
-
:param
|
|
1471
|
+
|
|
1472
|
+
:param token_in: The symbol or address of the token to sell..
|
|
1473
|
+
:param token_out: The symbol or address of the token to buy..
|
|
1474
|
+
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1475
|
+
|
|
1476
|
+
Uniswap supports 4 different fee levels.
|
|
1477
|
+
:param amount_in: The amount of the `token_in` to sell
|
|
1569
1478
|
:param max_slippage_percent: The maximum slippage allowed in percent. e.g. `1` means `1 %` slippage allowed.
|
|
1570
|
-
:param chain:
|
|
1479
|
+
:param chain:
|
|
1571
1480
|
:param sender: The address of the transaction sender.
|
|
1572
|
-
:param
|
|
1481
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1573
1482
|
:param retries: Override the default retry configuration for this method
|
|
1574
1483
|
:param server_url: Override the default server URL for this method
|
|
1575
1484
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1589,16 +1498,16 @@ class UniswapV3(BaseSDK):
|
|
|
1589
1498
|
token_in=token_in,
|
|
1590
1499
|
token_out=token_out,
|
|
1591
1500
|
fee=fee,
|
|
1592
|
-
|
|
1501
|
+
amount_in=amount_in,
|
|
1593
1502
|
max_slippage_percent=max_slippage_percent,
|
|
1594
|
-
wrap_eth=wrap_eth,
|
|
1595
1503
|
chain=chain,
|
|
1596
1504
|
sender=sender,
|
|
1505
|
+
estimate_gas=estimate_gas,
|
|
1597
1506
|
)
|
|
1598
1507
|
|
|
1599
1508
|
req = self._build_request_async(
|
|
1600
1509
|
method="POST",
|
|
1601
|
-
path="/
|
|
1510
|
+
path="/v1/uniswap/swap/sell_exactly",
|
|
1602
1511
|
base_url=base_url,
|
|
1603
1512
|
url_variables=url_variables,
|
|
1604
1513
|
request=request,
|
|
@@ -1612,6 +1521,7 @@ class UniswapV3(BaseSDK):
|
|
|
1612
1521
|
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1613
1522
|
request, False, False, "json", models.UniswapSellExactlyRequest
|
|
1614
1523
|
),
|
|
1524
|
+
allow_empty_value=None,
|
|
1615
1525
|
timeout_ms=timeout_ms,
|
|
1616
1526
|
)
|
|
1617
1527
|
|
|
@@ -1627,8 +1537,8 @@ class UniswapV3(BaseSDK):
|
|
|
1627
1537
|
hook_ctx=HookContext(
|
|
1628
1538
|
config=self.sdk_configuration,
|
|
1629
1539
|
base_url=base_url or "",
|
|
1630
|
-
operation_id="
|
|
1631
|
-
oauth2_scopes=
|
|
1540
|
+
operation_id="v1_uniswap_swap_sell_exactly",
|
|
1541
|
+
oauth2_scopes=None,
|
|
1632
1542
|
security_source=self.sdk_configuration.security,
|
|
1633
1543
|
),
|
|
1634
1544
|
request=req,
|
|
@@ -1638,37 +1548,28 @@ class UniswapV3(BaseSDK):
|
|
|
1638
1548
|
|
|
1639
1549
|
response_data: Any = None
|
|
1640
1550
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1641
|
-
return
|
|
1551
|
+
return unmarshal_json_response(
|
|
1552
|
+
models.UniswapSellExactlyTransactionResponse, http_res
|
|
1553
|
+
)
|
|
1642
1554
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1643
|
-
response_data =
|
|
1644
|
-
|
|
1555
|
+
response_data = unmarshal_json_response(
|
|
1556
|
+
errors.HTTPValidationErrorData, http_res
|
|
1645
1557
|
)
|
|
1646
|
-
raise errors.HTTPValidationError(
|
|
1558
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1647
1559
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1648
1560
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1649
|
-
raise errors.APIError(
|
|
1650
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1651
|
-
)
|
|
1561
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1652
1562
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1653
1563
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1654
|
-
raise errors.APIError(
|
|
1655
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1656
|
-
)
|
|
1564
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1657
1565
|
|
|
1658
|
-
|
|
1659
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1660
|
-
raise errors.APIError(
|
|
1661
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1662
|
-
http_res.status_code,
|
|
1663
|
-
http_res_text,
|
|
1664
|
-
http_res,
|
|
1665
|
-
)
|
|
1566
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1666
1567
|
|
|
1667
|
-
def
|
|
1568
|
+
def uniswap_liquidity_provision_mint(
|
|
1668
1569
|
self,
|
|
1669
1570
|
*,
|
|
1670
|
-
token0:
|
|
1671
|
-
token1:
|
|
1571
|
+
token0: str,
|
|
1572
|
+
token1: str,
|
|
1672
1573
|
fee: models.FeeEnum,
|
|
1673
1574
|
tick_lower: int,
|
|
1674
1575
|
tick_upper: int,
|
|
@@ -1688,14 +1589,15 @@ class UniswapV3(BaseSDK):
|
|
|
1688
1589
|
models.UniswapMintLiquidityProvisionRequestAmount1Min,
|
|
1689
1590
|
models.UniswapMintLiquidityProvisionRequestAmount1MinTypedDict,
|
|
1690
1591
|
],
|
|
1691
|
-
chain: models.
|
|
1592
|
+
chain: models.UniswapMintLiquidityProvisionRequestChain,
|
|
1692
1593
|
sender: str,
|
|
1693
1594
|
recipient: OptionalNullable[str] = UNSET,
|
|
1595
|
+
estimate_gas: Optional[bool] = None,
|
|
1694
1596
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1695
1597
|
server_url: Optional[str] = None,
|
|
1696
1598
|
timeout_ms: Optional[int] = None,
|
|
1697
1599
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1698
|
-
) -> models.
|
|
1600
|
+
) -> models.TransactionResponse:
|
|
1699
1601
|
r"""Open a new LP position
|
|
1700
1602
|
|
|
1701
1603
|
This endpoint allows users to open a new Liquidity Provider (LP) position on the
|
|
@@ -1707,19 +1609,30 @@ class UniswapV3(BaseSDK):
|
|
|
1707
1609
|
enabling them to earn fees from trades that occur within the pool. The endpoint
|
|
1708
1610
|
requires details such as the token pair, amount, and any additional parameters
|
|
1709
1611
|
needed for the minting process.
|
|
1612
|
+
<Info>
|
|
1613
|
+
**Required Allowances**
|
|
1614
|
+
|
|
1615
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1616
|
+
|
|
1617
|
+
- `UniswapV3NFTPositionManager`
|
|
1618
|
+
</Info>
|
|
1619
|
+
|
|
1710
1620
|
|
|
1711
|
-
:param token0:
|
|
1712
|
-
:param token1:
|
|
1713
|
-
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1621
|
+
:param token0: The symbol or address of the first token in the pair.
|
|
1622
|
+
:param token1: The symbol or address of the second token in the pair.
|
|
1623
|
+
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1624
|
+
|
|
1625
|
+
Uniswap supports 4 different fee levels.
|
|
1714
1626
|
:param tick_lower: The lower tick of the range to mint the position in
|
|
1715
1627
|
:param tick_upper: The upper tick of the range to mint the position in
|
|
1716
1628
|
:param amount0_desired: The desired amount of the first token to deposit
|
|
1717
1629
|
:param amount1_desired: The desired amount of the second token to deposit
|
|
1718
1630
|
:param amount0_min: The minimum amount of the first token to deposit
|
|
1719
1631
|
:param amount1_min: The minimum amount of the second token to deposit
|
|
1720
|
-
:param chain:
|
|
1632
|
+
:param chain:
|
|
1721
1633
|
:param sender: The address of the transaction sender.
|
|
1722
1634
|
:param recipient: The address that will receive the LP tokens
|
|
1635
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1723
1636
|
:param retries: Override the default retry configuration for this method
|
|
1724
1637
|
:param server_url: Override the default server URL for this method
|
|
1725
1638
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1748,11 +1661,12 @@ class UniswapV3(BaseSDK):
|
|
|
1748
1661
|
recipient=recipient,
|
|
1749
1662
|
chain=chain,
|
|
1750
1663
|
sender=sender,
|
|
1664
|
+
estimate_gas=estimate_gas,
|
|
1751
1665
|
)
|
|
1752
1666
|
|
|
1753
1667
|
req = self._build_request(
|
|
1754
1668
|
method="POST",
|
|
1755
|
-
path="/
|
|
1669
|
+
path="/v1/uniswap/liquidity_provision/mint",
|
|
1756
1670
|
base_url=base_url,
|
|
1757
1671
|
url_variables=url_variables,
|
|
1758
1672
|
request=request,
|
|
@@ -1770,6 +1684,7 @@ class UniswapV3(BaseSDK):
|
|
|
1770
1684
|
"json",
|
|
1771
1685
|
models.UniswapMintLiquidityProvisionRequest,
|
|
1772
1686
|
),
|
|
1687
|
+
allow_empty_value=None,
|
|
1773
1688
|
timeout_ms=timeout_ms,
|
|
1774
1689
|
)
|
|
1775
1690
|
|
|
@@ -1785,8 +1700,8 @@ class UniswapV3(BaseSDK):
|
|
|
1785
1700
|
hook_ctx=HookContext(
|
|
1786
1701
|
config=self.sdk_configuration,
|
|
1787
1702
|
base_url=base_url or "",
|
|
1788
|
-
operation_id="
|
|
1789
|
-
oauth2_scopes=
|
|
1703
|
+
operation_id="v1_uniswap_liquidity_provision_mint",
|
|
1704
|
+
oauth2_scopes=None,
|
|
1790
1705
|
security_source=self.sdk_configuration.security,
|
|
1791
1706
|
),
|
|
1792
1707
|
request=req,
|
|
@@ -1796,37 +1711,26 @@ class UniswapV3(BaseSDK):
|
|
|
1796
1711
|
|
|
1797
1712
|
response_data: Any = None
|
|
1798
1713
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1799
|
-
return
|
|
1714
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1800
1715
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1801
|
-
response_data =
|
|
1802
|
-
|
|
1716
|
+
response_data = unmarshal_json_response(
|
|
1717
|
+
errors.HTTPValidationErrorData, http_res
|
|
1803
1718
|
)
|
|
1804
|
-
raise errors.HTTPValidationError(
|
|
1719
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1805
1720
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1806
1721
|
http_res_text = utils.stream_to_text(http_res)
|
|
1807
|
-
raise errors.APIError(
|
|
1808
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1809
|
-
)
|
|
1722
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1810
1723
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1811
1724
|
http_res_text = utils.stream_to_text(http_res)
|
|
1812
|
-
raise errors.APIError(
|
|
1813
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1814
|
-
)
|
|
1725
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1815
1726
|
|
|
1816
|
-
|
|
1817
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
1818
|
-
raise errors.APIError(
|
|
1819
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1820
|
-
http_res.status_code,
|
|
1821
|
-
http_res_text,
|
|
1822
|
-
http_res,
|
|
1823
|
-
)
|
|
1727
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1824
1728
|
|
|
1825
|
-
async def
|
|
1729
|
+
async def uniswap_liquidity_provision_mint_async(
|
|
1826
1730
|
self,
|
|
1827
1731
|
*,
|
|
1828
|
-
token0:
|
|
1829
|
-
token1:
|
|
1732
|
+
token0: str,
|
|
1733
|
+
token1: str,
|
|
1830
1734
|
fee: models.FeeEnum,
|
|
1831
1735
|
tick_lower: int,
|
|
1832
1736
|
tick_upper: int,
|
|
@@ -1846,14 +1750,15 @@ class UniswapV3(BaseSDK):
|
|
|
1846
1750
|
models.UniswapMintLiquidityProvisionRequestAmount1Min,
|
|
1847
1751
|
models.UniswapMintLiquidityProvisionRequestAmount1MinTypedDict,
|
|
1848
1752
|
],
|
|
1849
|
-
chain: models.
|
|
1753
|
+
chain: models.UniswapMintLiquidityProvisionRequestChain,
|
|
1850
1754
|
sender: str,
|
|
1851
1755
|
recipient: OptionalNullable[str] = UNSET,
|
|
1756
|
+
estimate_gas: Optional[bool] = None,
|
|
1852
1757
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1853
1758
|
server_url: Optional[str] = None,
|
|
1854
1759
|
timeout_ms: Optional[int] = None,
|
|
1855
1760
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
1856
|
-
) -> models.
|
|
1761
|
+
) -> models.TransactionResponse:
|
|
1857
1762
|
r"""Open a new LP position
|
|
1858
1763
|
|
|
1859
1764
|
This endpoint allows users to open a new Liquidity Provider (LP) position on the
|
|
@@ -1865,19 +1770,30 @@ class UniswapV3(BaseSDK):
|
|
|
1865
1770
|
enabling them to earn fees from trades that occur within the pool. The endpoint
|
|
1866
1771
|
requires details such as the token pair, amount, and any additional parameters
|
|
1867
1772
|
needed for the minting process.
|
|
1773
|
+
<Info>
|
|
1774
|
+
**Required Allowances**
|
|
1775
|
+
|
|
1776
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1777
|
+
|
|
1778
|
+
- `UniswapV3NFTPositionManager`
|
|
1779
|
+
</Info>
|
|
1780
|
+
|
|
1868
1781
|
|
|
1869
|
-
:param token0:
|
|
1870
|
-
:param token1:
|
|
1871
|
-
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1782
|
+
:param token0: The symbol or address of the first token in the pair.
|
|
1783
|
+
:param token1: The symbol or address of the second token in the pair.
|
|
1784
|
+
:param fee: The transaction fee of a Uniswap pool in bips.
|
|
1785
|
+
|
|
1786
|
+
Uniswap supports 4 different fee levels.
|
|
1872
1787
|
:param tick_lower: The lower tick of the range to mint the position in
|
|
1873
1788
|
:param tick_upper: The upper tick of the range to mint the position in
|
|
1874
1789
|
:param amount0_desired: The desired amount of the first token to deposit
|
|
1875
1790
|
:param amount1_desired: The desired amount of the second token to deposit
|
|
1876
1791
|
:param amount0_min: The minimum amount of the first token to deposit
|
|
1877
1792
|
:param amount1_min: The minimum amount of the second token to deposit
|
|
1878
|
-
:param chain:
|
|
1793
|
+
:param chain:
|
|
1879
1794
|
:param sender: The address of the transaction sender.
|
|
1880
1795
|
:param recipient: The address that will receive the LP tokens
|
|
1796
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
1881
1797
|
:param retries: Override the default retry configuration for this method
|
|
1882
1798
|
:param server_url: Override the default server URL for this method
|
|
1883
1799
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -1906,11 +1822,12 @@ class UniswapV3(BaseSDK):
|
|
|
1906
1822
|
recipient=recipient,
|
|
1907
1823
|
chain=chain,
|
|
1908
1824
|
sender=sender,
|
|
1825
|
+
estimate_gas=estimate_gas,
|
|
1909
1826
|
)
|
|
1910
1827
|
|
|
1911
1828
|
req = self._build_request_async(
|
|
1912
1829
|
method="POST",
|
|
1913
|
-
path="/
|
|
1830
|
+
path="/v1/uniswap/liquidity_provision/mint",
|
|
1914
1831
|
base_url=base_url,
|
|
1915
1832
|
url_variables=url_variables,
|
|
1916
1833
|
request=request,
|
|
@@ -1928,6 +1845,7 @@ class UniswapV3(BaseSDK):
|
|
|
1928
1845
|
"json",
|
|
1929
1846
|
models.UniswapMintLiquidityProvisionRequest,
|
|
1930
1847
|
),
|
|
1848
|
+
allow_empty_value=None,
|
|
1931
1849
|
timeout_ms=timeout_ms,
|
|
1932
1850
|
)
|
|
1933
1851
|
|
|
@@ -1943,8 +1861,8 @@ class UniswapV3(BaseSDK):
|
|
|
1943
1861
|
hook_ctx=HookContext(
|
|
1944
1862
|
config=self.sdk_configuration,
|
|
1945
1863
|
base_url=base_url or "",
|
|
1946
|
-
operation_id="
|
|
1947
|
-
oauth2_scopes=
|
|
1864
|
+
operation_id="v1_uniswap_liquidity_provision_mint",
|
|
1865
|
+
oauth2_scopes=None,
|
|
1948
1866
|
security_source=self.sdk_configuration.security,
|
|
1949
1867
|
),
|
|
1950
1868
|
request=req,
|
|
@@ -1954,33 +1872,22 @@ class UniswapV3(BaseSDK):
|
|
|
1954
1872
|
|
|
1955
1873
|
response_data: Any = None
|
|
1956
1874
|
if utils.match_response(http_res, "200", "application/json"):
|
|
1957
|
-
return
|
|
1875
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
1958
1876
|
if utils.match_response(http_res, "422", "application/json"):
|
|
1959
|
-
response_data =
|
|
1960
|
-
|
|
1877
|
+
response_data = unmarshal_json_response(
|
|
1878
|
+
errors.HTTPValidationErrorData, http_res
|
|
1961
1879
|
)
|
|
1962
|
-
raise errors.HTTPValidationError(
|
|
1880
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1963
1881
|
if utils.match_response(http_res, "4XX", "*"):
|
|
1964
1882
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1965
|
-
raise errors.APIError(
|
|
1966
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1967
|
-
)
|
|
1883
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1968
1884
|
if utils.match_response(http_res, "5XX", "*"):
|
|
1969
1885
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1970
|
-
raise errors.APIError(
|
|
1971
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
1972
|
-
)
|
|
1886
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1973
1887
|
|
|
1974
|
-
|
|
1975
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1976
|
-
raise errors.APIError(
|
|
1977
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
1978
|
-
http_res.status_code,
|
|
1979
|
-
http_res_text,
|
|
1980
|
-
http_res,
|
|
1981
|
-
)
|
|
1888
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1982
1889
|
|
|
1983
|
-
def
|
|
1890
|
+
def uniswap_liquidity_provision_increase(
|
|
1984
1891
|
self,
|
|
1985
1892
|
*,
|
|
1986
1893
|
token_id: int,
|
|
@@ -2000,13 +1907,14 @@ class UniswapV3(BaseSDK):
|
|
|
2000
1907
|
models.UniswapIncreaseLiquidityProvisionRequestAmount1Min,
|
|
2001
1908
|
models.UniswapIncreaseLiquidityProvisionRequestAmount1MinTypedDict,
|
|
2002
1909
|
],
|
|
2003
|
-
chain: models.
|
|
1910
|
+
chain: models.UniswapIncreaseLiquidityProvisionRequestChain,
|
|
2004
1911
|
sender: str,
|
|
1912
|
+
estimate_gas: Optional[bool] = None,
|
|
2005
1913
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2006
1914
|
server_url: Optional[str] = None,
|
|
2007
1915
|
timeout_ms: Optional[int] = None,
|
|
2008
1916
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2009
|
-
) -> models.
|
|
1917
|
+
) -> models.TransactionResponse:
|
|
2010
1918
|
r"""Increase an LP position
|
|
2011
1919
|
|
|
2012
1920
|
This endpoint allows users to increase their existing Liquidity Provider (LP)
|
|
@@ -2018,14 +1926,23 @@ class UniswapV3(BaseSDK):
|
|
|
2018
1926
|
within the pool. The endpoint requires details such as the token pair, additional
|
|
2019
1927
|
amount to be added, and any other parameters necessary for the liquidity increase
|
|
2020
1928
|
process.
|
|
1929
|
+
<Info>
|
|
1930
|
+
**Required Allowances**
|
|
1931
|
+
|
|
1932
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
1933
|
+
|
|
1934
|
+
- `AerodromeSlipstreamRouter`
|
|
1935
|
+
</Info>
|
|
1936
|
+
|
|
2021
1937
|
|
|
2022
1938
|
:param token_id: Token ID of the NFT representing the liquidity provisioned position.
|
|
2023
1939
|
:param amount0_desired: The desired amount of the first token to deposit
|
|
2024
1940
|
:param amount1_desired: The desired amount of the second token to deposit
|
|
2025
1941
|
:param amount0_min: The minimum amount of the first token to deposit
|
|
2026
1942
|
:param amount1_min: The minimum amount of the second token to deposit
|
|
2027
|
-
:param chain:
|
|
1943
|
+
:param chain:
|
|
2028
1944
|
:param sender: The address of the transaction sender.
|
|
1945
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2029
1946
|
:param retries: Override the default retry configuration for this method
|
|
2030
1947
|
:param server_url: Override the default server URL for this method
|
|
2031
1948
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2049,11 +1966,12 @@ class UniswapV3(BaseSDK):
|
|
|
2049
1966
|
amount1_min=amount1_min,
|
|
2050
1967
|
chain=chain,
|
|
2051
1968
|
sender=sender,
|
|
1969
|
+
estimate_gas=estimate_gas,
|
|
2052
1970
|
)
|
|
2053
1971
|
|
|
2054
1972
|
req = self._build_request(
|
|
2055
1973
|
method="POST",
|
|
2056
|
-
path="/
|
|
1974
|
+
path="/v1/uniswap/liquidity_provision/increase",
|
|
2057
1975
|
base_url=base_url,
|
|
2058
1976
|
url_variables=url_variables,
|
|
2059
1977
|
request=request,
|
|
@@ -2071,6 +1989,7 @@ class UniswapV3(BaseSDK):
|
|
|
2071
1989
|
"json",
|
|
2072
1990
|
models.UniswapIncreaseLiquidityProvisionRequest,
|
|
2073
1991
|
),
|
|
1992
|
+
allow_empty_value=None,
|
|
2074
1993
|
timeout_ms=timeout_ms,
|
|
2075
1994
|
)
|
|
2076
1995
|
|
|
@@ -2086,8 +2005,8 @@ class UniswapV3(BaseSDK):
|
|
|
2086
2005
|
hook_ctx=HookContext(
|
|
2087
2006
|
config=self.sdk_configuration,
|
|
2088
2007
|
base_url=base_url or "",
|
|
2089
|
-
operation_id="
|
|
2090
|
-
oauth2_scopes=
|
|
2008
|
+
operation_id="v1_uniswap_liquidity_provision_increase",
|
|
2009
|
+
oauth2_scopes=None,
|
|
2091
2010
|
security_source=self.sdk_configuration.security,
|
|
2092
2011
|
),
|
|
2093
2012
|
request=req,
|
|
@@ -2097,33 +2016,22 @@ class UniswapV3(BaseSDK):
|
|
|
2097
2016
|
|
|
2098
2017
|
response_data: Any = None
|
|
2099
2018
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2100
|
-
return
|
|
2019
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2101
2020
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2102
|
-
response_data =
|
|
2103
|
-
|
|
2021
|
+
response_data = unmarshal_json_response(
|
|
2022
|
+
errors.HTTPValidationErrorData, http_res
|
|
2104
2023
|
)
|
|
2105
|
-
raise errors.HTTPValidationError(
|
|
2024
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2106
2025
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2107
2026
|
http_res_text = utils.stream_to_text(http_res)
|
|
2108
|
-
raise errors.APIError(
|
|
2109
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2110
|
-
)
|
|
2027
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2111
2028
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2112
2029
|
http_res_text = utils.stream_to_text(http_res)
|
|
2113
|
-
raise errors.APIError(
|
|
2114
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2115
|
-
)
|
|
2030
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2116
2031
|
|
|
2117
|
-
|
|
2118
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2119
|
-
raise errors.APIError(
|
|
2120
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2121
|
-
http_res.status_code,
|
|
2122
|
-
http_res_text,
|
|
2123
|
-
http_res,
|
|
2124
|
-
)
|
|
2032
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2125
2033
|
|
|
2126
|
-
async def
|
|
2034
|
+
async def uniswap_liquidity_provision_increase_async(
|
|
2127
2035
|
self,
|
|
2128
2036
|
*,
|
|
2129
2037
|
token_id: int,
|
|
@@ -2143,13 +2051,14 @@ class UniswapV3(BaseSDK):
|
|
|
2143
2051
|
models.UniswapIncreaseLiquidityProvisionRequestAmount1Min,
|
|
2144
2052
|
models.UniswapIncreaseLiquidityProvisionRequestAmount1MinTypedDict,
|
|
2145
2053
|
],
|
|
2146
|
-
chain: models.
|
|
2054
|
+
chain: models.UniswapIncreaseLiquidityProvisionRequestChain,
|
|
2147
2055
|
sender: str,
|
|
2056
|
+
estimate_gas: Optional[bool] = None,
|
|
2148
2057
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2149
2058
|
server_url: Optional[str] = None,
|
|
2150
2059
|
timeout_ms: Optional[int] = None,
|
|
2151
2060
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2152
|
-
) -> models.
|
|
2061
|
+
) -> models.TransactionResponse:
|
|
2153
2062
|
r"""Increase an LP position
|
|
2154
2063
|
|
|
2155
2064
|
This endpoint allows users to increase their existing Liquidity Provider (LP)
|
|
@@ -2161,14 +2070,23 @@ class UniswapV3(BaseSDK):
|
|
|
2161
2070
|
within the pool. The endpoint requires details such as the token pair, additional
|
|
2162
2071
|
amount to be added, and any other parameters necessary for the liquidity increase
|
|
2163
2072
|
process.
|
|
2073
|
+
<Info>
|
|
2074
|
+
**Required Allowances**
|
|
2075
|
+
|
|
2076
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2077
|
+
|
|
2078
|
+
- `AerodromeSlipstreamRouter`
|
|
2079
|
+
</Info>
|
|
2080
|
+
|
|
2164
2081
|
|
|
2165
2082
|
:param token_id: Token ID of the NFT representing the liquidity provisioned position.
|
|
2166
2083
|
:param amount0_desired: The desired amount of the first token to deposit
|
|
2167
2084
|
:param amount1_desired: The desired amount of the second token to deposit
|
|
2168
2085
|
:param amount0_min: The minimum amount of the first token to deposit
|
|
2169
2086
|
:param amount1_min: The minimum amount of the second token to deposit
|
|
2170
|
-
:param chain:
|
|
2087
|
+
:param chain:
|
|
2171
2088
|
:param sender: The address of the transaction sender.
|
|
2089
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2172
2090
|
:param retries: Override the default retry configuration for this method
|
|
2173
2091
|
:param server_url: Override the default server URL for this method
|
|
2174
2092
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2192,11 +2110,12 @@ class UniswapV3(BaseSDK):
|
|
|
2192
2110
|
amount1_min=amount1_min,
|
|
2193
2111
|
chain=chain,
|
|
2194
2112
|
sender=sender,
|
|
2113
|
+
estimate_gas=estimate_gas,
|
|
2195
2114
|
)
|
|
2196
2115
|
|
|
2197
2116
|
req = self._build_request_async(
|
|
2198
2117
|
method="POST",
|
|
2199
|
-
path="/
|
|
2118
|
+
path="/v1/uniswap/liquidity_provision/increase",
|
|
2200
2119
|
base_url=base_url,
|
|
2201
2120
|
url_variables=url_variables,
|
|
2202
2121
|
request=request,
|
|
@@ -2214,6 +2133,7 @@ class UniswapV3(BaseSDK):
|
|
|
2214
2133
|
"json",
|
|
2215
2134
|
models.UniswapIncreaseLiquidityProvisionRequest,
|
|
2216
2135
|
),
|
|
2136
|
+
allow_empty_value=None,
|
|
2217
2137
|
timeout_ms=timeout_ms,
|
|
2218
2138
|
)
|
|
2219
2139
|
|
|
@@ -2229,8 +2149,8 @@ class UniswapV3(BaseSDK):
|
|
|
2229
2149
|
hook_ctx=HookContext(
|
|
2230
2150
|
config=self.sdk_configuration,
|
|
2231
2151
|
base_url=base_url or "",
|
|
2232
|
-
operation_id="
|
|
2233
|
-
oauth2_scopes=
|
|
2152
|
+
operation_id="v1_uniswap_liquidity_provision_increase",
|
|
2153
|
+
oauth2_scopes=None,
|
|
2234
2154
|
security_source=self.sdk_configuration.security,
|
|
2235
2155
|
),
|
|
2236
2156
|
request=req,
|
|
@@ -2240,33 +2160,22 @@ class UniswapV3(BaseSDK):
|
|
|
2240
2160
|
|
|
2241
2161
|
response_data: Any = None
|
|
2242
2162
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2243
|
-
return
|
|
2163
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2244
2164
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2245
|
-
response_data =
|
|
2246
|
-
|
|
2165
|
+
response_data = unmarshal_json_response(
|
|
2166
|
+
errors.HTTPValidationErrorData, http_res
|
|
2247
2167
|
)
|
|
2248
|
-
raise errors.HTTPValidationError(
|
|
2168
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2249
2169
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2250
2170
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2251
|
-
raise errors.APIError(
|
|
2252
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2253
|
-
)
|
|
2171
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2254
2172
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2255
2173
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2256
|
-
raise errors.APIError(
|
|
2257
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2258
|
-
)
|
|
2174
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2259
2175
|
|
|
2260
|
-
|
|
2261
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2262
|
-
raise errors.APIError(
|
|
2263
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2264
|
-
http_res.status_code,
|
|
2265
|
-
http_res_text,
|
|
2266
|
-
http_res,
|
|
2267
|
-
)
|
|
2176
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2268
2177
|
|
|
2269
|
-
def
|
|
2178
|
+
def uniswap_liquidity_provision_withdraw(
|
|
2270
2179
|
self,
|
|
2271
2180
|
*,
|
|
2272
2181
|
token_id: int,
|
|
@@ -2274,13 +2183,14 @@ class UniswapV3(BaseSDK):
|
|
|
2274
2183
|
models.UniswapWithdrawLiquidityProvisionRequestPercentageForWithdrawal,
|
|
2275
2184
|
models.UniswapWithdrawLiquidityProvisionRequestPercentageForWithdrawalTypedDict,
|
|
2276
2185
|
],
|
|
2277
|
-
chain: models.
|
|
2186
|
+
chain: models.UniswapWithdrawLiquidityProvisionRequestChain,
|
|
2278
2187
|
sender: str,
|
|
2188
|
+
estimate_gas: Optional[bool] = None,
|
|
2279
2189
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2280
2190
|
server_url: Optional[str] = None,
|
|
2281
2191
|
timeout_ms: Optional[int] = None,
|
|
2282
2192
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2283
|
-
) -> models.
|
|
2193
|
+
) -> models.TransactionResponse:
|
|
2284
2194
|
r"""Withdraw an LP position
|
|
2285
2195
|
|
|
2286
2196
|
This endpoint allows users to withdraw their Liquidity Provider (LP) positions
|
|
@@ -2293,11 +2203,20 @@ class UniswapV3(BaseSDK):
|
|
|
2293
2203
|
amount to be withdrawn, and any additional parameters needed for the withdrawal
|
|
2294
2204
|
process. Users should ensure they meet any protocol requirements or conditions
|
|
2295
2205
|
before initiating a withdrawal to avoid potential issues or penalties.
|
|
2206
|
+
<Info>
|
|
2207
|
+
**Required Allowances**
|
|
2208
|
+
|
|
2209
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2210
|
+
|
|
2211
|
+
- `UniswapV3NFTPositionManager`
|
|
2212
|
+
</Info>
|
|
2213
|
+
|
|
2296
2214
|
|
|
2297
2215
|
:param token_id: Token ID of the NFT representing the liquidity provisioned position.
|
|
2298
2216
|
:param percentage_for_withdrawal: How much liquidity to take out in percentage.
|
|
2299
|
-
:param chain:
|
|
2217
|
+
:param chain:
|
|
2300
2218
|
:param sender: The address of the transaction sender.
|
|
2219
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2301
2220
|
:param retries: Override the default retry configuration for this method
|
|
2302
2221
|
:param server_url: Override the default server URL for this method
|
|
2303
2222
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2318,11 +2237,12 @@ class UniswapV3(BaseSDK):
|
|
|
2318
2237
|
percentage_for_withdrawal=percentage_for_withdrawal,
|
|
2319
2238
|
chain=chain,
|
|
2320
2239
|
sender=sender,
|
|
2240
|
+
estimate_gas=estimate_gas,
|
|
2321
2241
|
)
|
|
2322
2242
|
|
|
2323
2243
|
req = self._build_request(
|
|
2324
2244
|
method="POST",
|
|
2325
|
-
path="/
|
|
2245
|
+
path="/v1/uniswap/liquidity_provision/withdraw",
|
|
2326
2246
|
base_url=base_url,
|
|
2327
2247
|
url_variables=url_variables,
|
|
2328
2248
|
request=request,
|
|
@@ -2340,6 +2260,7 @@ class UniswapV3(BaseSDK):
|
|
|
2340
2260
|
"json",
|
|
2341
2261
|
models.UniswapWithdrawLiquidityProvisionRequest,
|
|
2342
2262
|
),
|
|
2263
|
+
allow_empty_value=None,
|
|
2343
2264
|
timeout_ms=timeout_ms,
|
|
2344
2265
|
)
|
|
2345
2266
|
|
|
@@ -2355,8 +2276,8 @@ class UniswapV3(BaseSDK):
|
|
|
2355
2276
|
hook_ctx=HookContext(
|
|
2356
2277
|
config=self.sdk_configuration,
|
|
2357
2278
|
base_url=base_url or "",
|
|
2358
|
-
operation_id="
|
|
2359
|
-
oauth2_scopes=
|
|
2279
|
+
operation_id="v1_uniswap_liquidity_provision_withdraw",
|
|
2280
|
+
oauth2_scopes=None,
|
|
2360
2281
|
security_source=self.sdk_configuration.security,
|
|
2361
2282
|
),
|
|
2362
2283
|
request=req,
|
|
@@ -2366,33 +2287,22 @@ class UniswapV3(BaseSDK):
|
|
|
2366
2287
|
|
|
2367
2288
|
response_data: Any = None
|
|
2368
2289
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2369
|
-
return
|
|
2290
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2370
2291
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2371
|
-
response_data =
|
|
2372
|
-
|
|
2292
|
+
response_data = unmarshal_json_response(
|
|
2293
|
+
errors.HTTPValidationErrorData, http_res
|
|
2373
2294
|
)
|
|
2374
|
-
raise errors.HTTPValidationError(
|
|
2295
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2375
2296
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2376
2297
|
http_res_text = utils.stream_to_text(http_res)
|
|
2377
|
-
raise errors.APIError(
|
|
2378
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2379
|
-
)
|
|
2298
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2380
2299
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2381
2300
|
http_res_text = utils.stream_to_text(http_res)
|
|
2382
|
-
raise errors.APIError(
|
|
2383
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2384
|
-
)
|
|
2301
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2385
2302
|
|
|
2386
|
-
|
|
2387
|
-
http_res_text = utils.stream_to_text(http_res)
|
|
2388
|
-
raise errors.APIError(
|
|
2389
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2390
|
-
http_res.status_code,
|
|
2391
|
-
http_res_text,
|
|
2392
|
-
http_res,
|
|
2393
|
-
)
|
|
2303
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
2394
2304
|
|
|
2395
|
-
async def
|
|
2305
|
+
async def uniswap_liquidity_provision_withdraw_async(
|
|
2396
2306
|
self,
|
|
2397
2307
|
*,
|
|
2398
2308
|
token_id: int,
|
|
@@ -2400,13 +2310,14 @@ class UniswapV3(BaseSDK):
|
|
|
2400
2310
|
models.UniswapWithdrawLiquidityProvisionRequestPercentageForWithdrawal,
|
|
2401
2311
|
models.UniswapWithdrawLiquidityProvisionRequestPercentageForWithdrawalTypedDict,
|
|
2402
2312
|
],
|
|
2403
|
-
chain: models.
|
|
2313
|
+
chain: models.UniswapWithdrawLiquidityProvisionRequestChain,
|
|
2404
2314
|
sender: str,
|
|
2315
|
+
estimate_gas: Optional[bool] = None,
|
|
2405
2316
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
2406
2317
|
server_url: Optional[str] = None,
|
|
2407
2318
|
timeout_ms: Optional[int] = None,
|
|
2408
2319
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
2409
|
-
) -> models.
|
|
2320
|
+
) -> models.TransactionResponse:
|
|
2410
2321
|
r"""Withdraw an LP position
|
|
2411
2322
|
|
|
2412
2323
|
This endpoint allows users to withdraw their Liquidity Provider (LP) positions
|
|
@@ -2419,11 +2330,20 @@ class UniswapV3(BaseSDK):
|
|
|
2419
2330
|
amount to be withdrawn, and any additional parameters needed for the withdrawal
|
|
2420
2331
|
process. Users should ensure they meet any protocol requirements or conditions
|
|
2421
2332
|
before initiating a withdrawal to avoid potential issues or penalties.
|
|
2333
|
+
<Info>
|
|
2334
|
+
**Required Allowances**
|
|
2335
|
+
|
|
2336
|
+
In order to make this transaction, token allowances need to be set for the following contracts.
|
|
2337
|
+
|
|
2338
|
+
- `UniswapV3NFTPositionManager`
|
|
2339
|
+
</Info>
|
|
2340
|
+
|
|
2422
2341
|
|
|
2423
2342
|
:param token_id: Token ID of the NFT representing the liquidity provisioned position.
|
|
2424
2343
|
:param percentage_for_withdrawal: How much liquidity to take out in percentage.
|
|
2425
|
-
:param chain:
|
|
2344
|
+
:param chain:
|
|
2426
2345
|
:param sender: The address of the transaction sender.
|
|
2346
|
+
:param estimate_gas: Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.
|
|
2427
2347
|
:param retries: Override the default retry configuration for this method
|
|
2428
2348
|
:param server_url: Override the default server URL for this method
|
|
2429
2349
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -2444,11 +2364,12 @@ class UniswapV3(BaseSDK):
|
|
|
2444
2364
|
percentage_for_withdrawal=percentage_for_withdrawal,
|
|
2445
2365
|
chain=chain,
|
|
2446
2366
|
sender=sender,
|
|
2367
|
+
estimate_gas=estimate_gas,
|
|
2447
2368
|
)
|
|
2448
2369
|
|
|
2449
2370
|
req = self._build_request_async(
|
|
2450
2371
|
method="POST",
|
|
2451
|
-
path="/
|
|
2372
|
+
path="/v1/uniswap/liquidity_provision/withdraw",
|
|
2452
2373
|
base_url=base_url,
|
|
2453
2374
|
url_variables=url_variables,
|
|
2454
2375
|
request=request,
|
|
@@ -2466,6 +2387,7 @@ class UniswapV3(BaseSDK):
|
|
|
2466
2387
|
"json",
|
|
2467
2388
|
models.UniswapWithdrawLiquidityProvisionRequest,
|
|
2468
2389
|
),
|
|
2390
|
+
allow_empty_value=None,
|
|
2469
2391
|
timeout_ms=timeout_ms,
|
|
2470
2392
|
)
|
|
2471
2393
|
|
|
@@ -2481,8 +2403,8 @@ class UniswapV3(BaseSDK):
|
|
|
2481
2403
|
hook_ctx=HookContext(
|
|
2482
2404
|
config=self.sdk_configuration,
|
|
2483
2405
|
base_url=base_url or "",
|
|
2484
|
-
operation_id="
|
|
2485
|
-
oauth2_scopes=
|
|
2406
|
+
operation_id="v1_uniswap_liquidity_provision_withdraw",
|
|
2407
|
+
oauth2_scopes=None,
|
|
2486
2408
|
security_source=self.sdk_configuration.security,
|
|
2487
2409
|
),
|
|
2488
2410
|
request=req,
|
|
@@ -2492,28 +2414,17 @@ class UniswapV3(BaseSDK):
|
|
|
2492
2414
|
|
|
2493
2415
|
response_data: Any = None
|
|
2494
2416
|
if utils.match_response(http_res, "200", "application/json"):
|
|
2495
|
-
return
|
|
2417
|
+
return unmarshal_json_response(models.TransactionResponse, http_res)
|
|
2496
2418
|
if utils.match_response(http_res, "422", "application/json"):
|
|
2497
|
-
response_data =
|
|
2498
|
-
|
|
2419
|
+
response_data = unmarshal_json_response(
|
|
2420
|
+
errors.HTTPValidationErrorData, http_res
|
|
2499
2421
|
)
|
|
2500
|
-
raise errors.HTTPValidationError(
|
|
2422
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
2501
2423
|
if utils.match_response(http_res, "4XX", "*"):
|
|
2502
2424
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2503
|
-
raise errors.APIError(
|
|
2504
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2505
|
-
)
|
|
2425
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2506
2426
|
if utils.match_response(http_res, "5XX", "*"):
|
|
2507
2427
|
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2508
|
-
raise errors.APIError(
|
|
2509
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
|
2510
|
-
)
|
|
2428
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
2511
2429
|
|
|
2512
|
-
|
|
2513
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2514
|
-
raise errors.APIError(
|
|
2515
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
|
2516
|
-
http_res.status_code,
|
|
2517
|
-
http_res_text,
|
|
2518
|
-
http_res,
|
|
2519
|
-
)
|
|
2430
|
+
raise errors.APIError("Unexpected response received", http_res)
|