Class: EvmNftMetadata

moralis-monorepo / @moralisweb3/evm-utils / EvmNftMetadata

Class: EvmNftMetadata

@moralisweb3/evm-utils.EvmNftMetadata

The EvmNftMetadata contains metadata of an NFT.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

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


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


toJSON

toJSON(): Object

Example

metadata.toJSON();

Returns

Object

the data as JSON.

NameType
chainstring | number
tokenAddressstring
namestring
symbolstring
contractType?EvmNftContractType
syncedAt?Date

Implementation of

MoralisDataObject.toJSON


format

format(): Object

Example

metadata.format();

Returns

Object

the data as JSON.

NameType
chainstring | number
tokenAddressstring
namestring
symbolstring
contractType?EvmNftContractType
syncedAt?Date

Implementation of

MoralisDataObject.format

Accessors

result

get result(): EvmNftMetadataData

Example

metadata.result;

Returns

EvmNftMetadataData

all the data without casting it to JSON.


name

get name(): string

Example

metadata.name; // "Baby Ape Mutant Club"

Returns

string

the name in the metadata.


symbol

get symbol(): string

Example

metadata.symbol; // "BAMC"

Returns

string

the symbol in the metadata.


contractType

get contractType(): undefined | EvmNftContractType

Example

metadata.contractType; // "ERC721"

Returns

undefined | EvmNftContractType

the contract type of the NFT.


chain

get chain(): EvmChain

Example

metadata.chain; // EvmChain

Returns

EvmChain

the chain in the metadata.


tokenAddress

get tokenAddress(): EvmAddress

Example

metadata.tokenAddress; // EvmAddress

Returns

EvmAddress

the token address in the metadata.


syncedAt

get syncedAt(): undefined | Date

Example

metadata.syncedAt; // Date

Returns

undefined | Date

the date the metadata was synced.


Did this page help you?