Paymaster utilities


Paymaster utilities

The paymaster utilities libraryopen in new window contains essential utilities for using paymasters on zkSync Era.

Contract interfaces

IPaymasterFlow Deprecated

Deprecated

Constant ABI definition for the Paymaster Flow Interfaceopen in new window.

export const IPaymasterFlow = new ethers.utils.Interface(require("../abi/IPaymasterFlow.json").abi);

Functions

getApprovalBasedPaymasterInput

Returns encoded input for an approval-based paymaster.

Inputs

ParameterTypeDescription
paymasterInputApprovalBasedPaymasterInputThe input data to the paymaster.
export function getApprovalBasedPaymasterInput(paymasterInput: ApprovalBasedPaymasterInput): BytesLike;

getGeneralPaymasterInput

As above but for general-based paymaster.

Inputs

ParameterTypeDescription
paymasterInputGeneralPaymasterInputThe input data to the paymaster.
export function getGeneralPaymasterInput(paymasterInput: GeneralPaymasterInput): BytesLike;

getPaymasterParams

Returns a correctly-formed paymasterParams object for common paymaster flows.

Inputs

ParameterTypeDescription
paymasterAddressAddressThe non-zero paymaster address.
paymasterInputPaymasterInputThe input data to the paymaster.
export function getPaymasterParams(paymasterAddress: Address, paymasterInput: PaymasterInput): PaymasterParams;

Find out more about the PaymasterInput type.