From 0c6abb5d759a7dfc47a8ec85d19e74232d72bb3d Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 20 Nov 2024 21:07:35 -0800 Subject: [PATCH] Import Pool and add relevant private property to wallet subclasses. --- src/lib/wallet.ts | 5 +++++ 1 file changed, 5 insertions(+) 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 } -- 2.34.1