From: Chris Duncan Date: Sun, 6 Jul 2025 05:07:48 +0000 (-0700) Subject: Move Ledger wallet ckd implementation to end of class to be consistent with other... X-Git-Tag: v0.10.5~109 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=87ad51dad212a39f4a374c5d82116532081cee77;p=libnemo.git Move Ledger wallet ckd implementation to end of class to be consistent with other wallet classes. --- 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 + } }