Delegation Toolkit quickstart
This page demonstrates how to get started quickly with the MetaMask Delegation Toolkit, by creating a delegator account and completing the delegation lifecycle (creating, signing, and redeeming a delegation).
Prerequisites
Install and set up the Delegation Toolkit.
Steps
1. Set up a Public Client
Set up a Viem Public Client using Viem's createPublicClient
function.
This client will let the delegator account query the signer's account state and interact with smart contracts.
import { createPublicClient, http } from "viem";
import { lineaSepolia as chain } from "viem/chains";
const publicClient = createPublicClient({
chain,
transport: http(),
});