π§βπ³ Examples
This page provides examples of how to use the Paymaster class and its associated functionality for interacting with Paymaster contracts on the ZKsync network.
Preparation
import { getPaymaster, createExtension } from "@txfusion/txsync-viem";
import { createWalletClient, custom } from 'viem';
import { zkSync } from 'viem/chains';
import { eip712WalletActions } from 'viem/zksync';
const [account] = await window.ethereum!.request({ method: "eth_requestAccounts" });
const walletClient = createWalletClient({
account,
chain: zkSync,
transport: custom(window.ethereum),
}).extend(eip712WalletActions());
const publicClient = createPublicClient({
chain: zkSync,
transport: http(),
});Obtaining the Paymaster Instance
Sending a Transaction through the Paymaster
Estimating Gas for Paymaster Transactions
Creating a Extension
Handling Extensions
Managing Extensions on Paymaster
Last updated