]> git.codecow.com Git - libnemo.git/commitdiff
Add type for wallet export. Remove references to "session" storage which is no longer...
authorChris Duncan <chris@zoso.dev>
Fri, 25 Jul 2025 12:39:06 +0000 (05:39 -0700)
committerChris Duncan <chris@zoso.dev>
Fri, 25 Jul 2025 12:39:06 +0000 (05:39 -0700)
src/lib/wallets/bip44-wallet.ts
src/lib/wallets/blake2b-wallet.ts
src/lib/wallets/ledger-wallet.ts
src/types.d.ts
test/test.import-wallet.mjs

index 4141334b64a4dbae2f440076093a2b02b4f9b0aa..1b1614e72e46a7ff1b40e6fb1104014a07d147d5 100644 (file)
@@ -191,7 +191,7 @@ export class Bip44Wallet extends Wallet {
        }\r
 \r
        /**\r
-       * Retrieves an existing HD wallet from session storage using its ID.\r
+       * Retrieves an existing HD wallet from storage using its ID.\r
        *\r
        * @param {string} id - Generated when the wallet was initially created\r
        * @returns {Bip44Wallet} Restored locked Bip44Wallet\r
index 3bfbe36a24ca9802da3dbe2b3bb1e38a66d03f81..4132cc0a015f6f6d6950f066afe291885c722a11 100644 (file)
@@ -140,7 +140,7 @@ export class Blake2bWallet extends Wallet {
        }\r
 \r
        /**\r
-       * Retrieves an existing BLAKE2b wallet from session storage using its ID.\r
+       * Retrieves an existing BLAKE2b wallet from storage using its ID.\r
        *\r
        * @param {string} id - Generated when the wallet was initially created\r
        * @returns {Blake2bWallet} Restored locked Blake2bWallet\r
index 24f882212517e9ee93c4f2c908514c6301e7c8bf..e10356bc6a3a594b6fa4b14dd89bcb4db047b388 100644 (file)
@@ -170,7 +170,7 @@ export class LedgerWallet extends Wallet {
        }\r
 \r
        /**\r
-       * Retrieves an existing Ledger wallet from session storage using its ID.\r
+       * Retrieves an existing Ledger wallet from storage using its ID.\r
        *\r
        * @param {string} id - Generated when the wallet was initially created\r
        * @returns {LedgerWallet} Restored LedgerWallet\r
index e3c0e25507086e310de7f83859d14fbdba980d93..6f0efeb4d2bf7fb4bfa1c6c6da2806a4b74fc7c8 100644 (file)
@@ -593,6 +593,12 @@ export declare const Tools: {
 export declare abstract class Wallet {
        #private
        abstract ckd (index: number[]): Promise<KeyPair[]>
+       /**
+       * Retrieves all wallet IDs from the Safe.
+       *
+       * @returns Array of hexadecimal-formatted wallet IDs
+       */
+       static export (): Promise<string[]>
        get id (): string
        get isLocked (): boolean
        get isUnlocked (): boolean
@@ -794,7 +800,7 @@ export declare class Bip44Wallet extends Wallet {
        */
        static fromSeed (key: Uint8Array<ArrayBuffer>, seed: string): Promise<Bip44Wallet>
        /**
-       * Retrieves an existing HD wallet from session storage using its ID.
+       * Retrieves an existing HD wallet from storage using its ID.
        *
        * @param {string} id - Generated when the wallet was initially created
        * @returns {Bip44Wallet} Restored locked Bip44Wallet
@@ -879,7 +885,7 @@ export declare class Blake2bWallet extends Wallet {
        */
        static fromMnemonic (key: Uint8Array<ArrayBuffer>, mnemonic: string): Promise<Blake2bWallet>
        /**
-       * Retrieves an existing BLAKE2b wallet from session storage using its ID.
+       * Retrieves an existing BLAKE2b wallet from storage using its ID.
        *
        * @param {string} id - Generated when the wallet was initially created
        * @returns {Blake2bWallet} Restored locked Blake2bWallet
@@ -972,7 +978,7 @@ export declare class LedgerWallet extends Wallet {
        onConnectUsb: (e: USBConnectionEvent) => Promise<void>
        onDisconnectUsb: (e: USBConnectionEvent) => Promise<void>
        /**
-       * Retrieves an existing Ledger wallet from session storage using its ID.
+       * Retrieves an existing Ledger wallet from storage using its ID.
        *
        * @param {string} id - Generated when the wallet was initially created
        * @returns {LedgerWallet} Restored LedgerWallet
index ef416127e4b03fe2097db7adb8e26cf50670a44b..af4ba407615e63aeabbc9104fc05ffb08467b6be 100644 (file)
@@ -262,7 +262,7 @@ await Promise.all([
                                'Seed contains invalid hexadecimal characters.')\r
                })\r
 \r
-               await test('Import BIP-44 wallet from session storage using a wallet-generated ID', async () => {\r
+               await test('Import BIP-44 wallet from storage using a wallet-generated ID', async () => {\r
                        const id = (await Bip44Wallet.fromMnemonic(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.MNEMONIC, NANO_TEST_VECTORS.PASSWORD)).id\r
                        const wallet = await Bip44Wallet.restore(id)\r
 \r
@@ -282,7 +282,7 @@ await Promise.all([
                        await assert.resolves(wallet.destroy())\r
                })\r
 \r
-               await test('Import BLAKE2B wallet from session storage using a wallet-generated ID', async () => {\r
+               await test('Import BLAKE2B wallet from storage using a wallet-generated ID', async () => {\r
                        const id = (await Blake2bWallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, TREZOR_TEST_VECTORS.ENTROPY_0)).id\r
                        const wallet = await Blake2bWallet.restore(id)\r
 \r