Skip to content

getApprovalBasedPaymasterInput

Returns encoded formatted approval-based paymaster params.

Import

import { getApprovalBasedPaymasterInput } from 'viem/zksync'

Usage

import { getApprovalBasedPaymasterInput } from 'viem/zksync'
 
const data = getApprovalBasedPaymasterInput({
  innerInput: '0x',
  minAllowance: 1n,
  token: "0x65C899B5fb8Eb9ae4da51D67E1fc417c7CB7e964",
})

Returns

EncodeFunctionDataReturnType

The Hex value of the provided approval-based paymaster inputs.

Parameters

token

  • Type: Address

The token address.

const data = getApprovalBasedPaymasterInput({
  innerInput: '0x',
  minAllowance: 1n,
  token: "0x65C899B5fb8Eb9ae4da51D67E1fc417c7CB7e964", 
})

minAllowance

  • Type: bigint

Minimum allowance (in wei) of token that can be sent towards the paymaster.

const data = getApprovalBasedPaymasterInput({
  innerInput: new Uint8Array(),
  minAllowance: 1n, 
  token: "0x65C899B5fb8Eb9ae4da51D67E1fc417c7CB7e964",
})

innerInput

  • Type: Hex | ByteArray

Additional payload that can be sent to the paymaster to implement any logic .

const data = getApprovalBasedPaymasterInput({
  innerInput: "0x0005040302010", 
  minAllowance: 1n, 
  token: "0x65C899B5fb8Eb9ae4da51D67E1fc417c7CB7e964",
})