Added listAccounts to JsonRpcProvider (#3778).

This commit is contained in:
Richard Moore 2023-03-03 17:59:05 -07:00
parent fe1f04c6e5
commit 287d94fc45

@ -940,6 +940,11 @@ export abstract class JsonRpcApiProvider extends AbstractProvider {
throw new Error("invalid account");
}
async listAccounts(): Promise<Array<JsonRpcSigner>> {
const accounts: Array<string> = await this.send("eth_accounts", [ ]);
return accounts.map((a) => new JsonRpcSigner(this, a));
}
}
export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider {