From 87ad51dad212a39f4a374c5d82116532081cee77 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 5 Jul 2025 22:07:48 -0700 Subject: [PATCH] Move Ledger wallet ckd implementation to end of class to be consistent with other wallet classes. --- src/lib/wallets/ledger-wallet.ts | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/lib/wallets/ledger-wallet.ts b/src/lib/wallets/ledger-wallet.ts index ed5e324..e0a5436 100644 --- a/src/lib/wallets/ledger-wallet.ts +++ b/src/lib/wallets/ledger-wallet.ts @@ -84,25 +84,6 @@ export class LedgerWallet extends Wallet { return wallet } - /** - * Gets the public key for an account from the Ledger device. - * - * @param {number[]} indexes - Indexes of the accounts - * @returns {Promise} - */ - async ckd (indexes: number[]): Promise { - const results: KeyPair[] = [] - for (const index of indexes) { - const { status, publicKey } = await this.#account(index) - if (status === 'OK' && publicKey != null) { - results.push({ publicKey, index }) - } else { - throw new Error(`Error getting Ledger account: ${status}`) - } - } - return results - } - /** * Attempts to close the current process on the Ledger device. * @@ -473,4 +454,23 @@ export class LedgerWallet extends Wallet { return { status: 'ERROR_PARSING_ACCOUNT', publicKey: null, address: null } } } + + /** + * Gets the public key for an account from the Ledger device. + * + * @param {number[]} indexes - Indexes of the accounts + * @returns {Promise} + */ + async ckd (indexes: number[]): Promise { + const results: KeyPair[] = [] + for (const index of indexes) { + const { status, publicKey } = await this.#account(index) + if (status === 'OK' && publicKey != null) { + results.push({ publicKey, index }) + } else { + throw new Error(`Error getting Ledger account: ${status}`) + } + } + return results + } } -- 2.47.3