Skip to content

mnemonicToAccountSigner

Creates a LocalAccountSigner using the provided mnemonic key and optional HD options.

Import

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

Usage

import { LocalAccountSigner } from "@aa-sdk/core";
import { generateMnemonic } from "viem";
 
const signer = LocalAccountSigner.mnemonicToAccountSigner(generateMnemonic());

Parameters

key

string The mnemonic key to derive the account from.

opts

HDOptions Optional HD options for deriving the account.

Returns

LocalAccountSigner<HDAccount> A LocalAccountSigner object for the derived account.