From b509c6e6dbc4ff7a8f5fc202c3956d01b63efe3d Mon Sep 17 00:00:00 2001 From: jxom Date: Wed, 18 Sep 2024 07:37:13 +1000 Subject: [PATCH] fix: resolves #2731 --- .changeset/pretty-glasses-sniff.md | 5 +++++ src/accounts/mnemonicToAccount.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/pretty-glasses-sniff.md diff --git a/.changeset/pretty-glasses-sniff.md b/.changeset/pretty-glasses-sniff.md new file mode 100644 index 0000000000..00ac609c05 --- /dev/null +++ b/.changeset/pretty-glasses-sniff.md @@ -0,0 +1,5 @@ +--- +"viem": patch +--- + +Fixed \`mnemonicToAccount\` options type. diff --git a/src/accounts/mnemonicToAccount.ts b/src/accounts/mnemonicToAccount.ts index 4b8446af14..190c05852b 100644 --- a/src/accounts/mnemonicToAccount.ts +++ b/src/accounts/mnemonicToAccount.ts @@ -7,7 +7,7 @@ import { type HDKeyToAccountOptions, hdKeyToAccount, } from './hdKeyToAccount.js' -import type { HDAccount, HDOptions } from './types.js' +import type { HDAccount } from './types.js' export type MnemonicToAccountOptions = HDKeyToAccountOptions @@ -20,7 +20,7 @@ export type MnemonicToAccountErrorType = HDKeyToAccountErrorType | ErrorType */ export function mnemonicToAccount( mnemonic: string, - opts: HDOptions = {}, + opts: MnemonicToAccountOptions = {}, ): HDAccount { const seed = mnemonicToSeedSync(mnemonic) return hdKeyToAccount(HDKey.fromMasterSeed(seed), opts)