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

Allow to pass password when creating a new account #37

Open
sdaveas opened this issue Sep 17, 2024 · 0 comments
Open

Allow to pass password when creating a new account #37

sdaveas opened this issue Sep 17, 2024 · 0 comments

Comments

@sdaveas
Copy link
Contributor

sdaveas commented Sep 17, 2024

NewAccountWithMnemonic function does now accept a password to forward to bip39.NewSeedWithErrorChecking. Please take a look at #36 which adds this option.

func NewAccountWithMnemonic(mnemonic string) (*Account, error) {
seed, err := bip39.NewSeedWithErrorChecking(mnemonic, "")
if err != nil {
return nil, err
}
key, err := derivation.DeriveForPath("m/44'/784'/0'/0'/0'", seed)
if err != nil {
return nil, err
}
scheme, err := sui_types.NewSignatureScheme(0)
if err != nil {
return nil, err
}
return NewAccount(scheme, key.Key), nil
}

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