}))\r
}\r
const publicKeys: KeyPair[] = await Promise.all(promises)\r
- if (publicKeys.length === 0) return []\r
- const publicAccounts = Account.import(publicKeys)\r
- for (const a of publicAccounts) {\r
- if (a.index == null) {\r
- throw new RangeError('Index missing for Account')\r
+ if (publicKeys.length > 0) {\r
+ const publicAccounts = Account.import(publicKeys)\r
+ for (const a of publicAccounts) {\r
+ if (a.index == null) {\r
+ throw new RangeError('Index missing for Account')\r
+ }\r
+ output[a.index] = this.#accounts[a.index] = a\r
}\r
- output[a.index] = this.#accounts[a.index] = a\r
}\r
}\r
return output\r