]> zoso.dev Git - libnemo.git/commitdiff
Import Pool and add relevant private property to wallet subclasses.
authorChris Duncan <chris@zoso.dev>
Thu, 21 Nov 2024 05:07:35 +0000 (21:07 -0800)
committerChris Duncan <chris@zoso.dev>
Thu, 21 Nov 2024 05:07:35 +0000 (21:07 -0800)
src/lib/wallet.ts

index a7736eb6dc37ccd14a9db5ca014c9ce58c63e5d9..723083fbc6ad3380ef7cfbef7c01b0eeee6d83f9 100644 (file)
@@ -8,6 +8,7 @@ import { Bip39Mnemonic } from './bip39-mnemonic.js'
 import { ADDRESS_GAP, SEED_LENGTH_BIP44, SEED_LENGTH_BLAKE2B } from './constants.js'\r
 import { dec, hex } from './convert.js'\r
 import { Entropy } from './entropy.js'\r
+import { Pool } from './pool.js'\r
 import { Rpc } from './rpc.js'\r
 import { Safe } from './safe.js'\r
 import type { Ledger } from './ledger.js'\r
@@ -245,12 +246,14 @@ abstract class Wallet {
 */\r
 export class Bip44Wallet extends Wallet {\r
        static #isInternal: boolean = false\r
+       #pool: Pool\r
 \r
        constructor (seed: string, mnemonic?: Bip39Mnemonic, id?: string) {\r
                if (!Bip44Wallet.#isInternal) {\r
                        throw new Error(`Bip44Wallet cannot be instantiated directly. Use 'await Bip44Wallet.create()' instead.`)\r
                }\r
                super(seed, mnemonic, id)\r
+               this.#pool = new Pool('./workers/ckdBip44.js')\r
                Bip44Wallet.#isInternal = false\r
        }\r
 \r
@@ -428,12 +431,14 @@ export class Bip44Wallet extends Wallet {
 */\r
 export class Blake2bWallet extends Wallet {\r
        static #isInternal: boolean = false\r
+       #pool: Pool\r
 \r
        constructor (seed: string, mnemonic?: Bip39Mnemonic, id?: string) {\r
                if (!Blake2bWallet.#isInternal) {\r
                        throw new Error(`Blake2bWallet cannot be instantiated directly. Use 'await Blake2bWallet.create()' instead.`)\r
                }\r
                super(seed, mnemonic, id)\r
+               this.#pool = new Pool('./workers/ckdBlake2b.js')\r
                Blake2bWallet.#isInternal = false\r
        }\r
 \r