if (type === 'BLAKE2b') {
seed = Bip39.fromEntropy(new Uint8Array(secret))
.then(bip39 => {
- this.#mnemonic = this.#encoder.encode(bip39.phrase ?? '').buffer
+ this.#mnemonic = new Uint8Array(this.#encoder.encode(bip39.phrase ?? '')).buffer
return secret
})
} else {
} else {
seed = Bip39.fromPhrase(secret)
.then(bip39 => {
- this.#mnemonic = this.#encoder.encode(bip39.phrase ?? '').buffer
+ this.#mnemonic = new Uint8Array(this.#encoder.encode(bip39.phrase ?? '')).buffer
const derive = type === 'BIP-44'
? bip39.toBip39Seed(mnemonicSalt ?? '')
: Promise.resolve(bip39.toBlake2bSeed())