From e19c11c2945648dc050624f6921495ecc5c7c1de Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 8 Aug 2025 12:22:18 -0700 Subject: [PATCH] Fix wallet accounts return. --- src/lib/wallet.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index 79d9474..840e9be 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -277,13 +277,14 @@ export class Wallet { })) } const publicKeys: KeyPair[] = await Promise.all(promises) - if (publicKeys.length === 0) return [] - const publicAccounts = Account.import(publicKeys) - for (const a of publicAccounts) { - if (a.index == null) { - throw new RangeError('Index missing for Account') + if (publicKeys.length > 0) { + const publicAccounts = Account.import(publicKeys) + for (const a of publicAccounts) { + if (a.index == null) { + throw new RangeError('Index missing for Account') + } + output[a.index] = this.#accounts[a.index] = a } - output[a.index] = this.#accounts[a.index] = a } } return output -- 2.47.3