Skip to content

alchemyGasManagerMiddleware

Paymaster middleware factory that uses Alchemy's Gas Manager for sponsoring transactions.

Import

import { alchemyGasManagerMiddleware } from "@account-kit/infra";

Usage

import { sepolia, alchemyErc7677Middleware } from "@account-kit/infra";
import { http } from "viem";
 
const client = createSmartAccountClient({
  transport: http("rpc-url"),
  chain: sepolia,
  ...alchemyErc7677Middleware("policyId"),
});

Parameters

policyId

string the policyId for Alchemy's gas manager

Returns

Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData"> partial client middleware configuration containing dummyPaymasterAndData and paymasterAndData