Function Signature
Description
Retrieves all NFTs owned by the wallet on the specified chain.Parameters
Returns
List<PortalNftAsset> - A list of NFT assets.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get NFT assets for a chain.
Future<List<PortalNftAsset>> getNftAssets(String chainId)
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | String | Yes | The chain ID in CAIP-2 format |
List<PortalNftAsset> - A list of NFT assets.
| Property | Type | Description |
|---|---|---|
tokenId | String? | The NFT token ID |
contractAddress | String? | The NFT contract address |
name | String? | NFT name |
description | String? | NFT description |
imageUrl | String? | NFT image URL |
tokenType | String? | Token type (e.g., “ERC721”, “ERC1155”) |
metadata | PortalNftMetadata? | Additional NFT metadata |
| Property | Type | Description |
|---|---|---|
name | String? | NFT name from metadata |
description | String? | NFT description from metadata |
image | String? | NFT image URL from metadata |
import 'package:portal_flutter/portal_flutter.dart';
final portal = Portal();
final nfts = await portal.getNftAssets('eip155:1');
for (final nft in nfts) {
print('NFT: ${nft.name ?? nft.metadata?.name}');
print('Token ID: ${nft.tokenId}');
print('Contract: ${nft.contractAddress}');
print('Image: ${nft.imageUrl ?? nft.metadata?.image}');
print('Type: ${nft.tokenType}');
}
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
FETCH_FAILED | Failed to fetch NFT assets |
Was this page helpful?