Skip to content

WalletClientSigner

Initializes a signer with a given wallet client and signer type.

Import

import { WalletClientSigner } from "@aa-sdk/core";

Usage

import { WalletClientSigner } from "@aa-sdk/core";
import { createWalletClient, custom } from "viem";
import { mainnet } from "viem/chains";
 
const client = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!),
});
 
const signer = new WalletClientSigner(client, "wallet");

Parameters

client

WalletClient The wallet client to interact with

signerType

string The type of signer; must be a valid signer type, otherwise an error will be thrown