]> git.codecow.com Git - libnemo.git/commitdiff
Move Ledger wallet ckd implementation to end of class to be consistent with other...
authorChris Duncan <chris@zoso.dev>
Sun, 6 Jul 2025 05:07:48 +0000 (22:07 -0700)
committerChris Duncan <chris@zoso.dev>
Sun, 6 Jul 2025 05:07:48 +0000 (22:07 -0700)
src/lib/wallets/ledger-wallet.ts

index ed5e324f145044da6383ee574a4467ed71981bf8..e0a5436c4f7c517de009a9e71612cc24b9afe37e 100644 (file)
@@ -84,25 +84,6 @@ export class LedgerWallet extends Wallet {
                return wallet\r
        }\r
 \r
-       /**\r
-       * Gets the public key for an account from the Ledger device.\r
-       *\r
-       * @param {number[]} indexes - Indexes of the accounts\r
-       * @returns {Promise<Account>}\r
-       */\r
-       async ckd (indexes: number[]): Promise<KeyPair[]> {\r
-               const results: KeyPair[] = []\r
-               for (const index of indexes) {\r
-                       const { status, publicKey } = await this.#account(index)\r
-                       if (status === 'OK' && publicKey != null) {\r
-                               results.push({ publicKey, index })\r
-                       } else {\r
-                               throw new Error(`Error getting Ledger account: ${status}`)\r
-                       }\r
-               }\r
-               return results\r
-       }\r
-\r
        /**\r
        * Attempts to close the current process on the Ledger device.\r
        *\r
@@ -473,4 +454,23 @@ export class LedgerWallet extends Wallet {
                        return { status: 'ERROR_PARSING_ACCOUNT', publicKey: null, address: null }\r
                }\r
        }\r
+\r
+       /**\r
+       * Gets the public key for an account from the Ledger device.\r
+       *\r
+       * @param {number[]} indexes - Indexes of the accounts\r
+       * @returns {Promise<Account>}\r
+       */\r
+       async ckd (indexes: number[]): Promise<KeyPair[]> {\r
+               const results: KeyPair[] = []\r
+               for (const index of indexes) {\r
+                       const { status, publicKey } = await this.#account(index)\r
+                       if (status === 'OK' && publicKey != null) {\r
+                               results.push({ publicKey, index })\r
+                       } else {\r
+                               throw new Error(`Error getting Ledger account: ${status}`)\r
+                       }\r
+               }\r
+               return results\r
+       }\r
 }\r