Skip to content

Commit

Permalink
feat(rest): add getAccounts method
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Aug 28, 2020
1 parent dccd6a7 commit f002abf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ export class RestClient {
}
}

/**
* Get the list of user accounts and their statuses
*/
public async getAccounts({ version = "2.0" }: IVersion = {}): Promise<
IUserAccount[]
> {
const url = new URL(`/md/${version}/accounts`, this.url);
const accounts = (await this.fetch(url)) as IUserAccount[];
return accounts;
}

private get token(): string {
const header = RestClient.base64URL({ alg: "HS256", typ: "JWT" });

Expand Down

0 comments on commit f002abf

Please sign in to comment.