Component for selecting assets from the Compound III protocol
AssetSelector
component provides a user-friendly dropdown interface for selecting assets available in the Compound III protocol. It displays asset icons, symbols, and optional balance information.
Prop | Type | Description |
---|---|---|
provider | Provider | The Ethereum provider to use for fetching asset data |
chainId | number | The chain ID of the network to connect to |
value | string | The currently selected asset symbol |
onChange | (asset: string) => void | Callback function called when an asset is selected |
showBalances | boolean | Whether to show user balances next to assets (default: false) |
userAddress | string | Optional user address to check balances for (defaults to connected wallet) |
filterFn | (asset: AssetInfo) => boolean | Optional function to filter which assets are displayed |
className | string | Optional CSS class name to apply to the component |
disabled | boolean | Whether the selector is disabled (default: false) |
AssetSelector
component includes the following features:
className
prop: