Function Signature
Description
Retrieves both native token balance and ERC-20/token balances for the wallet on the specified chain.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | String | Yes | The chain ID in CAIP-2 format |
Returns
PortalAssetsResponse - An object containing:
| Property | Type | Description |
|---|---|---|
nativeBalance | List<PortalAsset?> | List of native token balances |
tokenBalances | List<PortalAsset?> | List of token balances |
PortalAsset
| Property | Type | Description |
|---|---|---|
symbol | String | Token symbol (e.g., “ETH”, “USDC”) |
name | String | Token name |
balance | String | The formatted balance amount |
decimals | int | Token decimals |
tokenAddress | String? | Token contract address (null for native) |
rawBalance | String? | Raw balance in smallest unit |
metadata | PortalAssetMetadata? | Additional token metadata |
PortalAssetMetadata
| Property | Type | Description |
|---|---|---|
logoUri | String? | Token logo URL |
tokenType | String? | Type of token |
Example
Errors
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
FETCH_FAILED | Failed to fetch assets |