@alchemy/aa-core
Version:
viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts
14 lines (12 loc) • 387 B
text/typescript
import type { UserOperationStruct } from "../../types";
import type { ClientMiddlewareFn } from "../types";
export const defaultPaymasterAndData: ClientMiddlewareFn = async (
struct,
{ account }
) => {
const entryPoint = account.getEntryPoint();
if (entryPoint.version === "0.6.0") {
(struct as UserOperationStruct<"0.6.0">).paymasterAndData = "0x";
}
return struct;
};