Skip to main content

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

NameTypeDescription
dataEvmNftMetadataishthe EvmNftMetadataish type

Returns

EvmNftMetadata


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

NameTypeDescription
dataAEvmNftMetadataishthe first EvmNftMetadataish to compare
dataBEvmNftMetadataishthe second EvmNftMetadataish to compare

Returns

boolean

true if the two EvmNftMetadataData are equal


parse

Static parse(data): EvmNftMetadataData

Parameters

NameType
dataEvmNftMetadataInput

Returns

EvmNftMetadataData


equals

equals(data): boolean

Compares EvmNftMetadata instance to current instance

Example

metadata.equals(data);

Parameters

NameTypeDescription
dataEvmNftMetadataishthe 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

NameType
chainstring
contractType?string
namestring
symbolstring
syncedAt?Date
tokenAddressstring

Implementation of

MoralisDataObject.format


toJSON

toJSON(): Object

Example

metadata.toJSON();

Returns

Object

the data as JSON.

NameType
chainstring
contractType?string
namestring
symbolstring
syncedAt?Date
tokenAddressstring

Implementation of

MoralisDataObject.toJSON

Accessors

chain

get chain(): EvmChain

Example

metadata.chain; // EvmChain

Returns

EvmChain

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

EvmNftMetadataData

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

EvmAddress

the token address in the metadata.

Constructors

constructor

new EvmNftMetadata(data)

Parameters

NameType
dataEvmNftMetadataInput