Skip to Content
Avail Nexus is now live! Check out our docs to get started.

Unified Balance

Display the user’s unified token balances across chains with per-token and per-chain breakdown.

MAIN POINTS TO NOTE:

  1. This widget reads balances from the Nexus context which is populated via getUnifiedBalances(true) in the provider; it does not perform network calls by itself.
  2. The widget filters out zero balances, groups by token, and shows per-chain breakdown with formatted amounts and approximate fiat.
  3. To refresh balances after actions, call fetchUnifiedBalance() from the provider; the widget will re-render with updated context.
  4. You can find a quickstart example for using nexus-elements in Nexus Elements Quickstart.

Install

You can find the source code for the Unified Balance Widget here:

To install the Unified Balance Widget into your project, you can use the following command:

Terminal
pnpm dlx shadcn@latest add https://elements.nexus.availproject.org/r/unified-balance.json

Props

TypeScript
interface UnifiedBalanceProps { className?: string; }
  • className (optional): Style override for the outer container.

Usage

tsx
"use client"; import UnifiedBalance from "@/components/unified-balance/unified-balance"; function App() { return <UnifiedBalance />; }
Last updated on