From d0f4c4e5bba4903d8b7934fe4d8345970e6c4b67 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 7 Sep 2025 21:37:52 -0700 Subject: [PATCH] Fix invalid iteration of single account object. --- src/lib/wallet/accounts.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/wallet/accounts.ts b/src/lib/wallet/accounts.ts index d5331e2..1939c40 100644 --- a/src/lib/wallet/accounts.ts +++ b/src/lib/wallet/accounts.ts @@ -7,7 +7,9 @@ import { Vault } from '../vault' export async function _accounts (type: WalletType, accounts: Map, vault: Vault, index: number): Promise export async function _accounts (type: WalletType, accounts: Map, vault: Vault, from: number, to: number): Promise> -export async function _accounts (type: WalletType, accounts: Map, vault: Vault, from: unknown, to: unknown = from): Promise> { +export async function _accounts (type: WalletType, accounts: Map, vault: Vault, from: unknown, to?: unknown): Promise> { + const isSingle = to === undefined + to ??= from if (typeof from !== 'number' || typeof to !== 'number') { throw new TypeError('Invalid account range', { cause: `${from}-${to}` }) } @@ -54,7 +56,7 @@ export async function _accounts (type: WalletType, accounts: Map