Class Nft
Represents a unique Hedera Non-Fungible Token (NFT) identified by its token ID and serial number.
Implements
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
[JsonConverter(typeof(NftConverter))]
public sealed record Nft : IEquatable<Nft>
Remarks
This class consists of both an EntityId representing the token of the underlying non fungible token definition and a serial number representing this instance of the nft token. This class is immutable once created.
Constructors
| Edit this page View SourceNft(EntityId, long)
Public Constructor, an
Nft
is immutable after creation.
Declaration
public Nft(EntityId token, long serialNum)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityId | token | The NFT Token Type Address |
| long | serialNum | The serial number of this specific NFT instance (as assigned on mint). |
Properties
| Edit this page View SourceNone
A sentinel value representing an uninitialized or non-existent NFT. It represents the absence of a valid token and serial number.
Declaration
public static Nft None { get; }
Property Value
| Type | Description |
|---|---|
| Nft |
SerialNumber
Serial number representing the unique instance of the NFT.
Declaration
public long SerialNumber { get; }
Property Value
| Type | Description |
|---|---|
| long |
Token
The Hedera Non-Fungible Token Type Address
Declaration
public EntityId Token { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
Methods
| Edit this page View SourceToString()
Outputs a string representation of the nft in
shard.realm.num#serial
form.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | String representation of this nft identifier in its token#serial format (or "None" for None). |
Overrides
| Edit this page View SourceTryParse(ReadOnlySpan<char>, out Nft?)
Attempts to parse a string representation of an NFT
Declaration
public static bool TryParse(ReadOnlySpan<char> value, out Nft? nft)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | value | Sequence of Chars (string value) to Parse |
| Nft | nft | Output variable containing a NFT if parsing was successful. |
Returns
| Type | Description |
|---|---|
| bool | True if parsing was successful, false if not. |
TryParse(string?, out Nft?)
Attempts to parse a string representation of an NFT
Declaration
public static bool TryParse(string? value, out Nft? nft)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | String Value to Parse |
| Nft | nft | Output variable containing a NFT if parsing was successful. |
Returns
| Type | Description |
|---|---|
| bool | True if parsing was successful, false if not. |
Operators
| Edit this page View Sourceimplicit operator EntityId(Nft)
Implicit operator for converting an Nft to an EntityId representing the token portion of this identification.
Declaration
public static implicit operator EntityId(Nft nft)
Parameters
| Type | Name | Description |
|---|---|---|
| Nft | nft | The NFT to convert to an EntityId. |
Returns
| Type | Description |
|---|---|
| EntityId |