Skip to content

Commit

Permalink
Added listAccounts to JsonRpcProvider (#3778).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Mar 4, 2023
1 parent fe1f04c commit 287d94f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src.ts/providers/provider-jsonrpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 287d94f

Please sign in to comment.