AccountSigner

Creates a new AccountSigner with the given ethers Provider and Smart Contract Account

AccountSigner extends Signer, see the docs for Signer for all supported methods.

Import

1import { AccountSigner } from "@aa-sdk/ethers";

Usage

1import { AccountSigner, EthersProviderAdapter } from "@aa-sdk/ethers";
2import { LocalAccountSigner } from "@aa-sdk/core";
3import { sepolia } from "@account-kit/infra";
4import { createLightAccount } from "@account-kit/smart-contracts";
5import { http } from "viem";
6
7const account = await createLightAccount({
8 transport: http("https://rpc.testnet.aepps.com"),
9 chain: sepolia,
10 signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),
11});
12
13const provider = new EthersProviderAdapter();
14const signer = new AccountSigner(provider, account);

Parameters

provider

EthersProviderAdapter the ethers provider to use

account

TAccount the smart contract account that will be used to sign user ops and send them