Class NftDataExtensions
Extension methods for querying NFT data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class NftDataExtensions
Methods
| Edit this page View SourceGetAccountNftsAsync(MirrorRestClient, EntityId, params IMirrorQueryParameter[])
Enumerates the NFTs held by the given account. The records
are returned newest-first by default (governed by
token.id then serialnumber); pass
Ascending to reverse.
Declaration
public static IAsyncEnumerable<NftData> GetAccountNftsAsync(this MirrorRestClient client, EntityId account, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | account | The account whose NFT holdings are requested. |
| IMirrorQueryParameter[] | filters | Additional query filters. The endpoint supports TokenFilter, SpenderFilter, and SerialNumberFilter, along with the usual PageLimit and OrderBy. The mirror node requires a TokenFilter to be present whenever SerialNumberFilter is used. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<NftData> | An async enumerable of NFT records. |
GetNftAsync(MirrorRestClient, Nft, params IMirrorQueryParameter[])
Retrieves the record for a specific NFT serial from
/api/v1/tokens/{tokenId}/nfts/{serialNumber}.
Declaration
public static Task<NftData?> GetNftAsync(this MirrorRestClient client, Nft nft, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| Nft | nft | The identifier of the NFT to retrieve, which includes the token address and the serial number of the NFT. |
| IMirrorQueryParameter[] | filters | Reserved for forward compatibility. The endpoint currently accepts no query parameters per the OpenAPI spec; any filters supplied here are included in the URL but ignored by the server. |
Returns
| Type | Description |
|---|---|
| Task<NftData> | The NFT record, or null if the token/serial pair is unknown to the mirror node. |
GetTokenNftsAsync(MirrorRestClient, EntityId, params IMirrorQueryParameter[])
Enumerates the individual NFT serials that have been minted under the given token. The records are returned newest-serial-first by default; pass Ascending to reverse.
Declaration
public static IAsyncEnumerable<NftData> GetTokenNftsAsync(this MirrorRestClient client, EntityId token, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | token | The NFT class whose individual serials are requested. |
| IMirrorQueryParameter[] | filters | Additional query filters. The endpoint supports AccountFilter (current holder), SerialNumberFilter, PageLimit, and OrderBy. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<NftData> | An async enumerable of NFT records. |