Paymaster utilities
Paymaster utilities
The paymaster utilities library contains essential utilities for using paymasters on zkSync Era.
Contract interfaces
IPaymasterFlow
Deprecated
Deprecated
- This method is deprecated in favor of utils.PAYMASTER_FLOW_ABI.
Constant ABI definition for the Paymaster Flow Interface.
export const IPaymasterFlow = new ethers.utils.Interface(require("../abi/IPaymasterFlow.json").abi);
Functions
getApprovalBasedPaymasterInput
Returns encoded input for an approval-based paymaster.
Inputs
Parameter | Type | Description |
---|---|---|
paymasterInput | ApprovalBasedPaymasterInput | The input data to the paymaster. |
export function getApprovalBasedPaymasterInput(paymasterInput: ApprovalBasedPaymasterInput): BytesLike;
getGeneralPaymasterInput
As above but for general-based paymaster.
Inputs
Parameter | Type | Description |
---|---|---|
paymasterInput | GeneralPaymasterInput | The input data to the paymaster. |
export function getGeneralPaymasterInput(paymasterInput: GeneralPaymasterInput): BytesLike;
getPaymasterParams
Returns a correctly-formed paymasterParams
object for common paymaster flows.
Inputs
Parameter | Type | Description |
---|---|---|
paymasterAddress | Address | The non-zero paymaster address. |
paymasterInput | PaymasterInput | The input data to the paymaster. |
export function getPaymasterParams(paymasterAddress: Address, paymasterInput: PaymasterInput): PaymasterParams;
Find out more about the PaymasterInput
type.