UNPKG

@account-kit/infra

Version:

adapters for @aa-sdk/core for interacting with alchemy services

27 lines (26 loc) 1.08 kB
import type { ClientMiddlewareFn } from "@aa-sdk/core"; import type { AlchemyTransport } from "../alchemyTransport"; /** * Function that estimates the transaction fees using Alchemy methods for a given client. * It fetches the latest block and estimates the max priority fee per gas, applying any overrides or fee options provided. * * @example * ```ts * import { alchemyFeeEstimator, alchemy } from "@account-kit/infra"; * import { createSmartAccountClient } from "@aa-sdk/core"; * * const alchemyTransport = alchemy({ * chain: sepolia, * apiKey: "your-api-key" * }); * * const client = createSmartAccountClient({ * feeEstimator: alchemyFeeEstimator(alchemyTransport), * ...otherParams * }); * ``` * * @param {AlchemyTransport} transport An alchemy transport for making Alchemy specific RPC calls * @returns {ClientMiddlewareFn} A middleware function that takes a transaction structure and fee options, and returns the augmented structure with estimated fees */ export declare const alchemyFeeEstimator: (transport: AlchemyTransport) => ClientMiddlewareFn;