From: Chris Duncan Date: Thu, 21 Nov 2024 05:07:35 +0000 (-0800) Subject: Import Pool and add relevant private property to wallet subclasses. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=0c6abb5d759a7dfc47a8ec85d19e74232d72bb3d;p=libnemo.git Import Pool and add relevant private property to wallet subclasses. --- diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index a7736eb..723083f 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -8,6 +8,7 @@ import { Bip39Mnemonic } from './bip39-mnemonic.js' import { ADDRESS_GAP, SEED_LENGTH_BIP44, SEED_LENGTH_BLAKE2B } from './constants.js' import { dec, hex } from './convert.js' import { Entropy } from './entropy.js' +import { Pool } from './pool.js' import { Rpc } from './rpc.js' import { Safe } from './safe.js' import type { Ledger } from './ledger.js' @@ -245,12 +246,14 @@ abstract class Wallet { */ export class Bip44Wallet extends Wallet { static #isInternal: boolean = false + #pool: Pool constructor (seed: string, mnemonic?: Bip39Mnemonic, id?: string) { if (!Bip44Wallet.#isInternal) { throw new Error(`Bip44Wallet cannot be instantiated directly. Use 'await Bip44Wallet.create()' instead.`) } super(seed, mnemonic, id) + this.#pool = new Pool('./workers/ckdBip44.js') Bip44Wallet.#isInternal = false } @@ -428,12 +431,14 @@ export class Bip44Wallet extends Wallet { */ export class Blake2bWallet extends Wallet { static #isInternal: boolean = false + #pool: Pool constructor (seed: string, mnemonic?: Bip39Mnemonic, id?: string) { if (!Blake2bWallet.#isInternal) { throw new Error(`Blake2bWallet cannot be instantiated directly. Use 'await Blake2bWallet.create()' instead.`) } super(seed, mnemonic, id) + this.#pool = new Pool('./workers/ckdBlake2b.js') Blake2bWallet.#isInternal = false }