From 99b05b0c86ea28670f4dd5ec28e8090e513b9318 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 7 Jul 2025 08:31:53 -0700 Subject: [PATCH] Update account method overrides for Ledger wallet. --- src/lib/wallets/ledger-wallet.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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. * -- 2.47.3