Class NFTFactory
Main factory for creating the NFTs from hash of the transaction
Inheritance
Inherited Members
Namespace: VEDriversLite.NFT
Assembly: VEDriversLite.dll
Syntax
public static class NFTFactory
Methods
| Improve this Doc View SourceCloneNFT(INFT, Boolean, NFTTypes)
Clone the NFT
Declaration
public static async Task<INFT> CloneNFT(INFT NFT, bool asType = false, NFTTypes type = NFTTypes.Image)
Parameters
Type | Name | Description |
---|---|---|
INFT | NFT | input NFT to clone |
System.Boolean | asType | Force the type of the output NFT |
NFTTypes | type | specify the type - you must turn on asType flag |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<INFT> | INFT compatible object cloned from source |
GetEmptyNFT(NFTTypes)
Get Empty NFT based on the type
Declaration
public static async Task<INFT> GetEmptyNFT(NFTTypes type = NFTTypes.Image)
Parameters
Type | Name | Description |
---|---|---|
NFTTypes | type | specify the type - you must turn on asType flag |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<INFT> | INFT compatible object based on type |
GetNFT(String, String, Int32, Double, Boolean, Boolean, NFTTypes, Boolean, NFTTypes, String, GetTransactionInfoResponse, String)
Create and load the NFT from the transaction hash
Declaration
public static async Task<INFT> GetNFT(string tokenId, string utxo, int utxoindex = 0, double time = 0, bool wait = false, bool loadJustType = false, NFTTypes justType = NFTTypes.Image, bool skipTheType = false, NFTTypes skipType = NFTTypes.Image, string address = "", GetTransactionInfoResponse txinfo = null, string metadataString = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | tokenId | Optional. If you know please provide to speed up the loading. |
System.String | utxo | NFT transaction hash |
System.Int32 | utxoindex | Index of the NFT output. This is important for NFTs from multimint. |
System.Double | time | already parsed time |
System.Boolean | wait | await load - obsolete |
System.Boolean | loadJustType | load just specific type of NFT |
NFTTypes | justType | specify the type of the NFT which can be load - you must turn on justType flag |
System.Boolean | skipTheType | skip some type of NFT |
NFTTypes | skipType | specify the type of NFT which should be skipped - you must turn on skipTheType flag |
System.String | address | Specify address of owner |
GetTransactionInfoResponse | txinfo | if you have loaded txinfo provide it to speed up the loading |
System.String | metadataString |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<INFT> | INFT compatible object |
GetNFTFromCacheMetadata(IDictionary<String, String>, String, Int32, GetTransactionInfoResponse, Boolean, NFTTypes)
Load the NFT based on the data from the cache
Declaration
public static async Task<INFT> GetNFTFromCacheMetadata(IDictionary<string, string> metadata, string utxo, int utxoindex, GetTransactionInfoResponse txinfo = null, bool asType = false, NFTTypes type = NFTTypes.Image)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | metadata | Metadata from cache of NFTs |
System.String | utxo | Utxo of the NFT |
System.Int32 | utxoindex | Utxo Index of the NFT |
GetTransactionInfoResponse | txinfo | preloaded txinfo |
System.Boolean | asType | Force the output type |
NFTTypes | type | Specify the output type - you must set asType flag |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<INFT> | INFT compatible object |
ParseNFTType(IDictionary<String, String>)
Parse the type of the NFT from the transaction metadata
Declaration
public static NFTTypes ParseNFTType(IDictionary<string, string> metadata)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | metadata |
Returns
Type | Description |
---|---|
NFTTypes |
Exceptions
Type | Condition |
---|---|
System.Exception |