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? delegatingSpender = 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 | delegatingSpender | Optional. An account with a pre-existing |
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 nft, EntityId owner, EntityId spender, EntityId? delegatingSpender = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Nft | nft | 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 | delegatingSpender | Optional. An account with a pre-existing |
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 SourceDelegatingSpender
Optional. The account, previously granted an
approved_for_all allowance over this NFT
class by the Owner, that is granting
this specific-serial sub-allowance to
Spender without requiring the owner
to sign. When set, this account must sign the
allowance transaction and Owner
must not. Maps to the proto delegating_spender
field on an NFT allowance.
Declaration
public EntityId DelegatingSpender { get; }
Property Value
| Type | Description |
|---|---|
| EntityId |
Owner
The account holding the NFT(s) that may be spent by the spender.
Declaration
public EntityId Owner { 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 |