Skip to content
Alchemy Logo

alchemyGasManagerMiddleware

function alchemyGasManagerMiddleware(
  policyId,
  policyToken?,
  webhookData?,
): Required<
  Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">
>;

Defined in: account-kit/infra/src/middleware/gasManager.ts:92

Paymaster middleware factory that uses Alchemy's Gas Manager for sponsoring transactions. Adheres to the ERC-7677 standardized communication protocol.

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

ParameterTypeDescription

policyId

string | string[]

The policyId (or list of policyIds) for Alchemy's gas manager

policyToken?

PolicyToken

The policy token configuration

webhookData?

string

The webhook data to include in the request

Required<Pick<ClientMiddlewareConfig, "dummyPaymasterAndData" | "paymasterAndData">>

Partial client middleware configuration containing dummyPaymasterAndData and paymasterAndData

Was this page helpful?