From 287d94fc454d03f1b3086ea98745131cdf40129a Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Fri, 3 Mar 2023 17:59:05 -0700 Subject: [PATCH] Added listAccounts to JsonRpcProvider (#3778). --- src.ts/providers/provider-jsonrpc.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src.ts/providers/provider-jsonrpc.ts b/src.ts/providers/provider-jsonrpc.ts index 7aca1145ba..7eac244e12 100644 --- a/src.ts/providers/provider-jsonrpc.ts +++ b/src.ts/providers/provider-jsonrpc.ts @@ -940,6 +940,11 @@ export abstract class JsonRpcApiProvider extends AbstractProvider { throw new Error("invalid account"); } + + async listAccounts(): Promise> { + const accounts: Array = await this.send("eth_accounts", [ ]); + return accounts.map((a) => new JsonRpcSigner(this, a)); + } } export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider {