function erc7677Middleware<TContext>(
params?,
): Required<
Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">
>;Defined in: aa-sdk/core/src/middleware/erc7677middleware.ts:97
Middleware function for interacting with ERC-7677 enabled clients. It supports resolving paymaster and data fields for user operations. This middleware assumes that your RPC provider supports the ERC-7677 methods (pm_getPaymasterStubData and pm_getPaymasterData).
import { createSmartAccountClient, erc7677Middleware } from "@aa-sdk/core";
import { http } from "viem";
import { sepolia } from "viem/chains";
const client = createSmartAccountClient({
transport: http("rpc-url"),
chain: sepolia,
// this assumes that your RPC provider supports the ERC-7677 methods AND takes no context
...erc7677Middleware(),
});| Type Parameter | Default type |
|---|---|
|
|
| Parameter | Type | Description |
|---|---|---|
|
| Middleware parameters including context function or object. Context can be resolved dynamically by passing in a function which takes in the context at the time of sending a user op |
Required<Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">>
An object containing middleware functions dummyPaymasterAndData and paymasterAndData for processing user operations with the paymaster data