feat(api): Add support for batch account data API

This commit is contained in:
Jesse Wierzbinski 2025-05-26 18:41:45 +02:00
parent 287f428a83
commit 7bd07801f2
No known key found for this signature in database
6 changed files with 141 additions and 8 deletions

View file

@ -703,6 +703,28 @@ export class Client extends BaseClient {
);
}
/**
* GET /api/v1/accounts
*
* @param ids The account IDs.
* @return An array of accounts.
*/
public getAccounts(
ids: string[],
extra?: RequestInit,
): Promise<Output<z.infer<typeof Account>[]>> {
const params = new URLSearchParams();
for (const id of ids) {
params.append("id[]", id);
}
return this.get<z.infer<typeof Account>[]>(
`/api/v1/accounts?${params.toString()}`,
extra,
);
}
/**
* GET /api/v1/accounts/id
*