alchemyGasAndPaymasterAndDataMiddleware
Paymaster middleware factory that uses Alchemy’s Gas Manager for sponsoring
transactions. Uses Alchemy’s custom alchemy_requestGasAndPaymasterAndData
method instead of conforming to the standard ERC-7677 interface. Note that
if you use createAlchemySmartAccountClient
, this middleware is already
used by default and you do not need to manually include it.
Import
Usage
Parameters
params
AlchemyGasAndPaymasterAndDataMiddlewareParams
configuration params
params.policyId
AlchemyGasAndPaymasterAndDataMiddlewareParams.policyId
the policyId for Alchemy’s gas manager
params.transport
AlchemyGasAndPaymasterAndDataMiddlewareParams.transport
fallback transport to use for fee estimation when not using the paymaster
params.gasEstimatorOverride
AlchemyGasAndPaymasterAndDataMiddlewareParams.gasEstimatorOverride
custom gas estimator middleware
params.feeEstimatorOverride
AlchemyGasAndPaymasterAndDataMiddlewareParams.feeEstimatorOverride
custom fee estimator middleware
Returns
Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "feeEstimator" | "gasEstimator" | "paymasterAndData">
partial client middleware configuration containing dummyPaymasterAndData
, feeEstimator
, gasEstimator
, and paymasterAndData