remove @noble/curves. people are not ready for it, causes BigInt issues.

This commit is contained in:
fiatjaf
2023-04-18 15:07:10 -03:00
parent 56fe3dd5dd
commit ef3184a6e0
10 changed files with 125 additions and 121 deletions

View File

@@ -1,4 +1,4 @@
import {bytesToHex} from '@noble/hashes/utils'
import * as secp256k1 from '@noble/secp256k1'
import {wordlist} from '@scure/bip39/wordlists/english.js'
import {
generateMnemonic,
@@ -14,7 +14,7 @@ export function privateKeyFromSeedWords(
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')
return bytesToHex(privateKey)
return secp256k1.utils.bytesToHex(privateKey)
}
export function generateSeedWords(): string {