3. Fetch accounts balances
Now let's focus in listing all accounts in the workspace to retrieve their balances.
Types definition
Export Account & Paginated types
Import types in the main script
import "dotenv/config";
import axios from "axios";
import { Account, Paginated } from "./types";
async function main() {
...Fetch accounts
Call the /accounts endpoint
/accounts endpoint Run the script
Loop in all pages
Adapt the script to pagination
Verify that it works
Last updated