defaultFeeEstimator

1function defaultFeeEstimator<C>(client): ClientMiddlewareFn;

Defined in: aa-sdk/core/src/middleware/defaults/feeEstimator.ts:26

Default fee estimator middleware function that estimates the maximum fee per gas and maximum priority fee per gas for a given client and applies the necessary overrides and fee options.

Example

1import { createSmartAccountClient, defaultFeeEstimator, createBundlerClient } from "@aa-sdk/core";
2
3const bundlerClient = createBundlerClient(...);
4
5// NOTE: this is already provided by the smart account client
6const client = createSmartAccountClient({
7 feeEstimator: defaultFeeEstimator(bundlerClient),
8 ...otherParams
9});

Type Parameters

Type ParameterDescription

C extends MiddlewareClient

The type of the client

Parameters

ParameterTypeDescription

client

C

The client to perform the fee estimation

Returns

ClientMiddlewareFn

A middleware function that takes in the struct and options, estimates the fees, and updates the struct with the estimated fees