Learn how to retrieve Universal Account addresses and check balances across multiple blockchains.
In this lesson, you’ll learn how to fetch addresses and balances from a Universal Account. This is a critical step in building chain-agnostic applications, as it enables users to interact with their assets across different blockchains through a single interface.
Before getting started, make sure you followed Lesson 1 and initialized a Universal Account instance.
A Universal Account references multiple address types:
Owner Address: The EOA that owns the Universal Account and signs transactions.
EVM Universal Address: The address used for interactions on EVM-compatible chains.
Solana Universal Address: The address used for interactions on Solana.
You can retrieve all relevant addresses from an initialized Universal Account instance as follows:
Copy
Ask AI
const smartAccountOptions = await ua.getSmartAccountOptions();const accountInfo = { ownerAddress: smartAccountOptions.ownerAddress, // EOA that owns the Universal Account evmUaAddress: smartAccountOptions.smartAccountAddress!, // EVM UA solanaUaAddress: smartAccountOptions.solanaSmartAccountAddress!, // SOL UA};console.log("Smart Account info:", accountInfo);
The EVM and Solana Universal Addresses are distinct due to the way deposits work on each network. EVM tokens should be sent to the EVM UA, while Solana tokens should be sent to the Solana UA. However, the SDK abstracts this complexity, providing a unified balance view.
Universal Accounts can hold assets across multiple chains, but Primary Assets are the most critical as they are the assets spent across chains.You can fetch the Primary Assets balance from a Universal Account instance with a single call: