From: Chris Duncan Date: Mon, 7 Jul 2025 15:31:53 +0000 (-0700) Subject: Update account method overrides for Ledger wallet. X-Git-Tag: v0.10.5~94 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=99b05b0c86ea28670f4dd5ec28e8090e513b9318;p=libnemo.git Update account method overrides for Ledger wallet. --- diff --git a/src/lib/wallets/ledger-wallet.ts b/src/lib/wallets/ledger-wallet.ts index 94f02e6..4c6f295 100644 --- a/src/lib/wallets/ledger-wallet.ts +++ b/src/lib/wallets/ledger-wallet.ts @@ -266,7 +266,9 @@ export class LedgerWallet extends Wallet { } /** - * Request an account at a specific BIP-44 index. + * Since the Ledger device can only return one account per request, this + * overrides the default behavior of calling `accounts()` to instead + * directly derive and return a single account at the specified index. * * @returns Account */ @@ -279,6 +281,17 @@ export class LedgerWallet extends Wallet { return account } + /** + * Since the Ledger device can only return one account per request, this + * overrides the default behavior of returning multiple accounts to instead + * return a single account at the specified index. + * + * @returns Account + */ + async accounts (): Promise { + throw new Error(`Ledger device only supports 'account()' calls`) + } + /** * Sign a block with the Ledger device. *