Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript error: Missing nonceManager in mnemonicToAccount options type #2731

Closed
1 task done
mcoetzee opened this issue Sep 17, 2024 · 0 comments
Closed
1 task done

Comments

@mcoetzee
Copy link

Check existing issues

Viem Version

2.21.8

Current Behavior

When providing the nonceManager option, Typescript gives an error even though it's a valid option:

import { mnemonicToAccount, nonceManager } from 'viem/accounts';

const account = mnemonicToAccount('some mnemonic...', { nonceManager });
error TS2353: Object literal may only specify known properties, and 'nonceManager' does not exist in type 'HDOptions'.

Expected Behavior

Typescript should not give an error as hdKeyToAccount supports passing in a nonceManager:

export function mnemonicToAccount(
  mnemonic: string,
  opts: HDOptions = {},
): HDAccount {
  const seed = mnemonicToSeedSync(mnemonic)
  return hdKeyToAccount(HDKey.fromMasterSeed(seed), opts)
}

Steps To Reproduce

No response

Link to Minimal Reproducible Example

No response

Anything else?

No response

@jxom jxom closed this as completed in b509c6e Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant