]> git.codecow.com Git - libnemo.git/commitdiff
Update account method overrides for Ledger wallet.
authorChris Duncan <chris@zoso.dev>
Mon, 7 Jul 2025 15:31:53 +0000 (08:31 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 7 Jul 2025 15:31:53 +0000 (08:31 -0700)
src/lib/wallets/ledger-wallet.ts

index 94f02e685064117aa9e06562784a64fc01b5f985..4c6f295b0cee5b61f1b26ac065a7961f32bea651 100644 (file)
@@ -266,7 +266,9 @@ export class LedgerWallet extends Wallet {
        }\r
 \r
        /**\r
-       * Request an account at a specific BIP-44 index.\r
+       * Since the Ledger device can only return one account per request, this\r
+       * overrides the default behavior of calling `accounts()` to instead\r
+       * directly derive and return a single account at the specified index.\r
        *\r
        * @returns Account\r
        */\r
@@ -279,6 +281,17 @@ export class LedgerWallet extends Wallet {
                return account\r
        }\r
 \r
+       /**\r
+       * Since the Ledger device can only return one account per request, this\r
+       * overrides the default behavior of returning multiple accounts to instead\r
+       * return a single account at the specified index.\r
+       *\r
+       * @returns Account\r
+       */\r
+       async accounts (): Promise<never> {\r
+               throw new Error(`Ledger device only supports 'account()' calls`)\r
+       }\r
+\r
        /**\r
        * Sign a block with the Ledger device.\r
        *\r