From: Chris Duncan Date: Thu, 3 Jul 2025 03:13:00 +0000 (-0700) Subject: Move wallets into their own directory. X-Git-Tag: v0.10.5~139 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=5c40299b7b283b0c61d3dee784b11add25d41082;p=libnemo.git Move wallets into their own directory. --- diff --git a/src/lib/tools.ts b/src/lib/tools.ts index d1f0ce4..694091d 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -7,7 +7,7 @@ import { SendBlock } from './block' import { UNITS } from './constants' import { hex } from './convert' import { Rpc } from './rpc' -import { Bip44Wallet, Blake2bWallet, LedgerWallet } from './wallet' +import { Bip44Wallet, Blake2bWallet, LedgerWallet } from './wallets' import { NanoNaCl } from '#workers' type SweepResult = { diff --git a/src/lib/wallet.ts b/src/lib/wallets/index.ts similarity index 95% rename from src/lib/wallet.ts rename to src/lib/wallets/index.ts index 1e1852b..79dfc57 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallets/index.ts @@ -1,16 +1,16 @@ // SPDX-FileCopyrightText: 2024 Chris Duncan // SPDX-License-Identifier: GPL-3.0-or-later -import { Account, AccountList } from './account' -import { Bip39Mnemonic } from './bip39-mnemonic' -import { Blake2b } from './blake2b' -import { ADDRESS_GAP, SEED_LENGTH_BIP44, SEED_LENGTH_BLAKE2B } from './constants' -import { hex } from './convert' -import { Entropy } from './entropy' -import { Ledger } from './ledger' -import { Pool } from './pool' -import { Rpc } from './rpc' -import { Safe } from './safe' +import { Account, AccountList } from '#src/lib/account.js' +import { Bip39Mnemonic } from '#src/lib/bip39-mnemonic.js' +import { Blake2b } from '#src/lib/blake2b.js' +import { ADDRESS_GAP, SEED_LENGTH_BIP44, SEED_LENGTH_BLAKE2B } from '#src/lib/constants.js' +import { hex } from '#src/lib/convert.js' +import { Entropy } from '#src/lib/entropy.js' +import { Ledger } from '#src/lib/ledger.js' +import { Pool } from '#src/lib/pool.js' +import { Rpc } from '#src/lib/rpc.js' +import { Safe } from '#src/lib/safe.js' import { Bip44CkdWorker, NanoNaClWorker } from '#workers' type KeyPair = { @@ -684,7 +684,7 @@ export class LedgerWallet extends Wallet { * @returns {LedgerWallet} A wallet containing accounts and a Ledger device communication object */ static async create (): Promise { - const { Ledger } = await import('./ledger') + const { Ledger } = await import('../ledger') const l = await Ledger.init() const id = await Entropy.create(16) LedgerWallet.#isInternal = true @@ -701,7 +701,7 @@ export class LedgerWallet extends Wallet { if (typeof id !== 'string' || id === '') { throw new TypeError('Wallet ID is required to restore') } - const { Ledger } = await import('./ledger') + const { Ledger } = await import('../ledger') const l = await Ledger.init() LedgerWallet.#isInternal = true return new this(await Entropy.import(id), l) diff --git a/src/main.ts b/src/main.ts index 0db2b25..44aa887 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,6 @@ import { Rolodex } from './lib/rolodex' import { Rpc } from './lib/rpc' import { Safe } from './lib/safe' import { Tools } from './lib/tools' -import { Bip44Wallet, Blake2bWallet, LedgerWallet } from './lib/wallet' +import { Bip44Wallet, Blake2bWallet, LedgerWallet } from './lib/wallets' export { Account, Blake2b, SendBlock, ReceiveBlock, ChangeBlock, Rpc, Rolodex, Safe, Tools, Bip44Wallet, Blake2bWallet, LedgerWallet }