throw new TypeError('Wallet ID is required to restore')\r
}\r
Bip44Wallet.#isInternal = true\r
- id = id.replace('libnemo_', '')\r
return new this(await Entropy.import(id))\r
}\r
\r
throw new TypeError('Wallet ID is required to restore')\r
}\r
Blake2bWallet.#isInternal = true\r
- id = id.replace('libnemo_', '')\r
return new this(await Entropy.import(id))\r
}\r
\r
#m?: Bip39Mnemonic\r
#s?: Uint8Array<ArrayBuffer>\r
\r
- get id () { return `libnemo_${this.#id.hex}` }\r
+ get id () { return this.#id.hex }\r
get isLocked () { return this.#locked }\r
get isUnlocked () { return !this.#locked }\r
get mnemonic () {\r
if (id == null) {\r
throw new Error('ID is null')\r
}\r
- id = await Entropy.import(id.replace('libnemo_', ''))\r
+ id = await Entropy.import(id)\r
if (id.hex !== this.#id.hex) {\r
throw new Error('ID does not match')\r
}\r
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
\r
assert.ok('id' in wallet)\r
- assert.ok(/^libnemo_[A-Fa-f0-9]{32,64}$/.test(wallet.id))\r
+ assert.ok(/^[A-Fa-f0-9]{32,64}$/.test(wallet.id))\r
assert.ok('mnemonic' in wallet)\r
assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic))\r
assert.ok('seed' in wallet)\r
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
\r
assert.ok('id' in wallet)\r
- assert.ok(/^libnemo_[A-Fa-f0-9]{32,64}$/.test(wallet.id))\r
+ assert.ok(/^[A-Fa-f0-9]{32,64}$/.test(wallet.id))\r
assert.ok('mnemonic' in wallet)\r
assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic))\r
assert.ok('seed' in wallet)\r