Using SDK

Required SDK version: ^v4.59.1

Using the @account-kit/infra Library for UserOperation Management

The @account-kit/infra library enables direct interaction with Alchemy’s ERC-4337 bundler for advanced UserOperation management. The alchemyFeeEstimator function leverages underlying APIs, including rundler_maxPriorityFeePerGas and eth_estimateUserOperation, to estimate gas fees for UserOperations. Below are examples demonstrating how to estimate and send a UserOperation and how to retrieve a UserOperation by its hash using low-level Bundler APIs.

1import { alchemy, sepolia } from "@account-kit/infra";
2
3const YOUR_API_KEY = "<YOUR_API_KEY>";
4export const YOUR_PRIVATE_KEY = "<YOUR_PRIVATE_KEY>";
5export const chain = sepolia;
6
7export const transport = alchemy({
8 apiKey: YOUR_API_KEY,
9});

Make sure that you environment is set with your correct ALCHEMY_API_KEY and PRIVATE_KEY. These examples assume familiarity with ERC-4337 and proper configuration of the EntryPoint contract (entryPoint07Address).