Skip to main content

Overview

The useAssets hook fetches the list of available assets (tokens) that can be used for swaps and transfers. Assets are automatically loaded when the component mounts and include metadata like symbol, name, decimals, and aggregated entities.

Import

Signature

Return Values

Asset[]
Array of available assets. Each asset includes aggregated information across multiple chains.
boolean
Indicates if assets are currently being fetched. true on initial load, false after data is loaded or error occurs.
string | null
Error message if asset fetching fails. null when no errors.

Usage Examples

Basic Usage

Asset Selector Component

Asset Search with Filtering

Get Asset by ID

Asset Pair Selection for Swaps

Display Asset with Icon

Types

Asset

AggregatedAssetEntity

Notes

  • Assets are fetched automatically when the component mounts
  • The hook only fetches assets once per mount (no automatic refetching)
  • Asset IDs use the format ob:<symbol> (e.g., ob:eth, ob:usdc)
  • Individual entities use CAIP-19 format for assetType
  • The demo may have limited assets; production has 14M+ assets

See Also