An `async` function always returns a promise. `await` pauses that function until the awaited promise settles, without blocking the thread. Errors surface as exceptions, so `try/catch` works normally.
async function getBalance(client, addr) {
try {
return await client.getBalance(addr);
} catch (err) {
console.error("rpc failed", err);
return 0n;
}
}Awaiting inside a loop serialises the calls; use `Promise.all` when the requests are independent.