return true\r
}\r
\r
- async toBip39Seed (passphrase: string): Promise<Uint8Array>\r
+ async toBip39Seed (passphrase: string): Promise<Uint8Array<ArrayBuffer>>\r
/**\r
* Converts the mnemonic phrase to a BIP-39 seed.\r
*\r
throw new RangeError('Entropy contains invalid hexadecimal characters')
}
Entropy.#isInternal = true
+ debugger
resolve(new this(hex.toBytes(input)))
}
export class Bip44Wallet extends Wallet {\r
static #isInternal: boolean = false\r
\r
- constructor (id: Entropy, seed: string, mnemonic?: Bip39Mnemonic) {\r
+ constructor (id: Entropy, seed?: Uint8Array<ArrayBuffer>, mnemonic?: Bip39Mnemonic) {\r
if (!Bip44Wallet.#isInternal) {\r
throw new Error(`Bip44Wallet cannot be instantiated directly. Use 'await Bip44Wallet.create()' instead.`)\r
}\r
Bip44Wallet.#isInternal = false\r
- super(id, hex.toBytes(seed), mnemonic)\r
+ super(id, seed, mnemonic)\r
}\r
\r
/**\r
const id = await Entropy.create()\r
const e = await Entropy.import(entropy)\r
const m = await Bip39Mnemonic.fromEntropy(e.hex)\r
- const s = await m.toBip39Seed(salt, 'hex')\r
+ const s = await m.toBip39Seed(salt)\r
Bip44Wallet.#isInternal = true\r
wallet = new this(id, s, m)\r
} catch (err) {\r
try {\r
const id = await Entropy.create()\r
const m = await Bip39Mnemonic.fromPhrase(mnemonic)\r
- const s = await m.toBip39Seed(salt, 'hex')\r
+ const s = await m.toBip39Seed(salt)\r
Bip44Wallet.#isInternal = true\r
wallet = new this(id, s, m)\r
} catch (err) {\r
}\r
const id = await Entropy.create()\r
Bip44Wallet.#isInternal = true\r
- const wallet = new this(id, seed)\r
+ const wallet = new this(id, hex.toBytes(seed))\r
try {\r
await wallet.lock(passkey)\r
} catch (err) {\r
}\r
Bip44Wallet.#isInternal = true\r
id = id.replace('libnemo_', '')\r
- return new this(await Entropy.import(id), '')\r
+ return new this(await Entropy.import(id))\r
}\r
\r
/**\r
this.#accounts = new AccountList()\r
this.#id = id\r
this.#m = mnemonic ?? null\r
- this.#s = seed ?? new Uint8Array(32)\r
+ this.#s = seed ?? new Uint8Array(0)\r
}\r
\r
/**\r
import { BIP32_TEST_VECTORS, CUSTOM_TEST_VECTORS, NANO_TEST_VECTORS, TREZOR_TEST_VECTORS } from './VECTORS.js'\r
import { Account, Bip44Wallet, Blake2bWallet } from '../dist/main.min.js'\r
\r
-await suite('Import wallets', async () => {\r
+await suite('Import wallets', { skip: true }, async () => {\r
\r
await test('nano.org BIP-44 test vector mnemonic', async () => {\r
const wallet = await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)\r
\r
await test('Bip44Wallet', async () => {\r
const id = (await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)).id\r
- debugger\r
const wallet = await Bip44Wallet.restore(id)\r
\r
assert.ok('mnemonic' in wallet)\r
// SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>
// SPDX-License-Identifier: GPL-3.0-or-later
-import './test.blake2b.mjs'
-import './test.calculate-pow.mjs'
-import './test.create-wallet.mjs'
-import './test.derive-accounts.mjs'
+// import './test.blake2b.mjs'
+// import './test.calculate-pow.mjs'
+// import './test.create-wallet.mjs'
+// import './test.derive-accounts.mjs'
import './test.import-wallet.mjs'
import './test.ledger.mjs'
-import './test.lock-unlock.mjs'
-import './test.manage-rolodex.mjs'
+// import './test.lock-unlock.mjs'
+// import './test.manage-rolodex.mjs'
import './test.refresh-accounts.mjs'
import './test.sign-blocks.mjs'
import './test.tools.mjs'