Class: EvmNftMetadata
moralis-monorepo / @moralisweb3/common-evm-utils / EvmNftMetadata
Class: EvmNftMetadata
@moralisweb3/common-evm-utils.EvmNftMetadata
The EvmNftMetadata contains metadata of an NFT.
Implements
MoralisDataObject
Table of contents
Methods
Accessors
Constructors
Methods
create
▸ Static create(data): EvmNftMetadata
Create a new instance of EvmNftMetadata from any valid EvmNftMetadata input
Example
const token = EvmNftMetadataish.create(value);
Parameters
| Name | Type | Description |
|---|---|---|
data | EvmNftMetadataish | the EvmNftMetadataish type |
Returns
equals
▸ Static equals(dataA, dataB): boolean
Compares two EvmNftMetadata instances. This checks if the chain and tokenAddress of both meatdatas are equal.
Example
EvmNftMetadata.equals(dataA, dataB);
Parameters
| Name | Type | Description |
|---|---|---|
dataA | EvmNftMetadataish | the first EvmNftMetadataish to compare |
dataB | EvmNftMetadataish | the second EvmNftMetadataish to compare |
Returns
boolean
true if the two EvmNftMetadataData are equal
parse
▸ Static parse(data): EvmNftMetadataData
Parameters
| Name | Type |
|---|---|
data | EvmNftMetadataInput |
Returns
equals
▸ equals(data): boolean
Compares EvmNftMetadata instance to current instance
Example
metadata.equals(data);
Parameters
| Name | Type | Description |
|---|---|---|
data | EvmNftMetadataish | the EvmNftMetadataish to compare |
Returns
boolean
true if the EvmNftMetadataish is equals given metadata
Implementation of
MoralisDataObject.equals
format
▸ format(): Object
Deprecated
This method will be removed soon. To format the value, use one of the properties.
Returns
Object
| Name | Type |
|---|---|
chain | string |
contractType? | string |
name | string |
symbol | string |
syncedAt? | Date |
tokenAddress | string |
Implementation of
MoralisDataObject.format
toJSON
▸ toJSON(): Object
Example
metadata.toJSON();
Returns
Object
the data as JSON.
| Name | Type |
|---|---|
chain | string |
contractType? | string |
name | string |
symbol | string |
syncedAt? | Date |
tokenAddress | string |
Implementation of
MoralisDataObject.toJSON
Accessors
chain
• get chain(): EvmChain
Example
metadata.chain; // EvmChain
Returns
the chain in the metadata.
contractType
• get contractType(): undefined | string
Example
metadata.contractType; // "ERC721"
Returns
undefined | string
the contract type of the NFT.
name
• get name(): string
Example
metadata.name; // "Baby Ape Mutant Club"
Returns
string
the name in the metadata.
result
• get result(): EvmNftMetadataData
Example
metadata.result;
Returns
all the data without casting it to JSON.
symbol
• get symbol(): string
Example
metadata.symbol; // "BAMC"
Returns
string
the symbol in the metadata.
syncedAt
• get syncedAt(): undefined | Date
Example
metadata.syncedAt; // Date
Returns
undefined | Date
the date the metadata was synced.
tokenAddress
• get tokenAddress(): EvmAddress
Example
metadata.tokenAddress; // EvmAddress
Returns
the token address in the metadata.
Constructors
constructor
• new EvmNftMetadata(data)
Parameters
| Name | Type |
|---|---|
data | EvmNftMetadataInput |