Show / Hide Table of Contents

Class Nft

Represents a unique Hedera Non-Fungible Token (NFT) identified by its token ID and serial number.

Inheritance
object
Nft
Implements
IEquatable<Nft>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
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 Source

Nft(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 Source

None

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
| Edit this page View Source

SerialNumber

Serial number representing the unique instance of the NFT.

Declaration
public long SerialNumber { get; }
Property Value
Type Description
long
| Edit this page View Source

Token

The Hedera Non-Fungible Token Type Address

Declaration
public EntityId Token { get; }
Property Value
Type Description
EntityId

Methods

| Edit this page View Source

ToString()

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
object.ToString()
| Edit this page View Source

TryParse(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.

| Edit this page View Source

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 Source

implicit 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

Implements

IEquatable<T>
  • Edit this page
  • View Source
In this article
Back to top .NET Client Library for Hiero Network and Hedera Hashgraph