chore(dx): add format script 💅 (#128)

This commit is contained in:
Fernando López Guevara
2023-02-28 12:19:10 -03:00
committed by GitHub
parent 4c415280aa
commit 0d77013aab
5 changed files with 17 additions and 5 deletions

View File

@@ -7,7 +7,10 @@ import {
} from '@scure/bip39'
import {HDKey} from '@scure/bip32'
export function privateKeyFromSeedWords(mnemonic: string, passphrase?: string): string {
export function privateKeyFromSeedWords(
mnemonic: string,
passphrase?: string
): string {
let root = HDKey.fromMasterSeed(mnemonicToSeedSync(mnemonic, passphrase))
let privateKey = root.derive(`m/44'/1237'/0'/0/0`).privateKey
if (!privateKey) throw new Error('could not derive private key')