Skip to main content

Class: EvmNftCollection

moralis-monorepo / @moralisweb3/common-evm-utils / EvmNftCollection

Class: EvmNftCollection

@moralisweb3/common-evm-utils.EvmNftCollection

The EvmNftCollection is a representation of an nft collection.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Constructors

Methods

create

Static create(data): EvmNftCollection

Create a new instance of EvmNftCollection from any valid transaction input

Example

const collection = EvmNftCollection.create(data);

Parameters

NameTypeDescription
dataEvmNftCollectionishthe EvmNftCollectionish type

Returns

EvmNftCollection


equals

Static equals(dataA, dataB): boolean

Check the equality between two Evm collections. It compares their hashes and collections.

Example

EvmNftCollection.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAEvmNftCollectionishThe first collection to compare
dataBEvmNftCollectionishThe second collection to compare

Returns

boolean


parse

Static parse(data): EvmNftCollectionData

Parameters

NameType
dataEvmNftCollectionInput

Returns

EvmNftCollectionData


equals

equals(data): boolean

Checks the equality of the current collection with another evm collection

Example

collection.equals(data)

Parameters

NameTypeDescription
dataEvmNftCollectionishthe collection to compare with

Returns

boolean

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
tokenAddressstring

Implementation of

MoralisDataObject.format


toJSON

toJSON(): Object

Example

collection.toJSON()

Returns

Object

a JSON represention of the collection.

NameType
chainstring
contractType?string
namestring
symbolstring
tokenAddressstring

Implementation of

MoralisDataObject.toJSON

Accessors

chain

get chain(): EvmChain

Example

collection.chain // EvmChain

Returns

EvmChain

the chain where the collection is deployed.


contractType

get contractType(): undefined | string

Example

collection.tokenAddress // 'ERC721'

Returns

undefined | string

the token type of collection.


name

get name(): string

Example

collection.tokenAddress // 'Test NFT'

Returns

string

the token name of collection.


result

get result(): EvmNftCollectionData

Example

collection.result

Returns

EvmNftCollectionData

all the data without casting it to JSON.


symbol

get symbol(): string

Example

collection.symbol // 'TEST'

Returns

string

the token symbol of collection.


tokenAddress

get tokenAddress(): EvmAddress

Example

collection.tokenAddress // EvmAddress

Returns

EvmAddress

the token address of collection.

Constructors

constructor

new EvmNftCollection(data)

Parameters

NameType
dataEvmNftCollectionInput