Class NftAllowance
Represents an allowance allocation permitting a spender account privileges of spending the specified NFT(s) from the owning account.
Implements
Inherited Members
Namespace: Hiero
Assembly: Hiero.dll
Syntax
public sealed record NftAllowance : IEquatable<NftAllowance>
Constructors
| Edit this page View SourceNftAllowance(EntityId, EntityId, EntityId, IReadOnlyList<long>?, EntityId?)
Represents an allowance allocation permitting a spender account privileges of spending the specified amount assets from the owning account.
Declaration
public NftAllowance(EntityId token, EntityId owner, EntityId spender, IReadOnlyList<long>? serialNumbers = null, EntityId? ownersDelegate = null)
Parameters
| Type | Name | Description |
|---|---|---|
| EntityId | token | The address of the NFT's token definition having the allocated allowance. |
| EntityId | owner | The Address owner holding the NFT(s) that may be spent by the spender. |
| EntityId | spender | The account that may spend the allocated allowance of NFT(s). |
| IReadOnlyList<long> | serialNumbers |
then all NFTs of the token class may be spent. |
| EntityId | ownersDelegate | The optional delegating account controlling NFTs for the owner. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If any of the addresses are null or empty. |
NftAllowance(Nft, EntityId, EntityId, EntityId?)
Represents an allowance allocation permitting a spender account privileges of spending the specified NFT instance from the owning account.
Declaration
public NftAllowance(Nft asset, EntityId owner, EntityId spender, EntityId? ownersDelegate = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Nft | asset | Single NFT instance to grant the allowance. |
| EntityId | owner | The Address owner holding the NFT that may be spent by the spender. |
| EntityId | spender | The account that may spend the allocated allowance of NFT. |
| EntityId | ownersDelegate | The optional delegating account controlling NFTs for the owner. |
Remarks
Convenience constructor for a singular NFT allowance.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If any of the addresses are null or empty. |
Properties
| Edit this page View SourceOwner
The account holding the NFT(s) that may be spent by the delegate spender.
Declaration
public EntityId Owner { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
OwnersDelegate
An account, approved by the owner, that is given access to all of the Owner's NFTs of this class, and can therefore in turn allocate a specific NFT instance to a 3rd party to sell on behalf of the original owner.
Declaration
public EntityId OwnersDelegate { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
SerialNumbers
The explicit list of serial numbers that
can be spent by the delegate. If the value
is
null
then all assets of the token class may be spent. If the list is empty, it means all of the identified assets with specific serial numbers have already been removed from the account.
Declaration
public IReadOnlyList<long>? SerialNumbers { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<long> |
Spender
The account that may spend the allocated allowance of NFT(s).
Declaration
public EntityId Spender { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
Token
The address of the NFT's token definition having the allocated allowance.
Declaration
public EntityId Token { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |