Skip to main content

Read balances

const { balances } = await client.getBalances();
Filter by token:
const { balances } = await client.getBalances({ token: "0xTokenAddress" });

Read transactions

const { transactions } = await client.getTransactions({
  status: "processed", // optional
  type: "transfer", // optional: "deposit" | "transfer" | "withdraw"
  limit: 20, // optional
  cursor: "...", // optional, for pagination
});

Transaction status

deposit(), transfer(), and withdraw() return a TransactionHandle with txId, status, txHash, and wait(). Call wait() to block until the transaction reaches a terminal status (processed or failed).
const tx = await client.transfer({ recipientAddress, token, amount });
const confirmed = await tx.wait({
  intervalMs: 2000, // optional, default 2s
  timeoutMs: 60000, // optional, default 60s
  signal: ac.signal, // optional AbortSignal
  onStatus: (s) => log(s), // optional progress callback
});
If you already have a transaction ID, poll directly:
const result = await client.pollTransactionStatus(txId, {
  intervalMs: 2000,
  timeoutMs: 60000,
  signal: ac.signal,
});
Polling throws TimeoutError if the timeout elapses before a terminal status. See Error handling.

Backend reads

Use admin reads for backend dashboards and support tooling, and the user client for signed actions.
const user = await admin.users.get({ address: unlinkAddress });

const { balances } = await admin.users.getBalances({
  address: unlinkAddress,
});

const { transactions } = await admin.users.getTransactions({
  address: unlinkAddress,
  type: "transfer",
  status: "processed",
  limit: 20,
});

const auth = await admin.authorizationTokens.issue({
  unlinkAddress,
  expiresInSeconds: 900,
});
Call admin.users.register(payload) from your backend when a browser or server client registers. See Custody models for how the admin client is wired.