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
Name | Type | Description |
---|---|---|
data | EvmNftCollectionish | the EvmNftCollectionish type |
Returns
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
Name | Type | Description |
---|---|---|
dataA | EvmNftCollectionish | The first collection to compare |
dataB | EvmNftCollectionish | The second collection to compare |
Returns
boolean
parse
▸ Static
parse(data
): EvmNftCollectionData
Parameters
Name | Type |
---|---|
data | EvmNftCollectionInput |
Returns
equals
▸ equals(data
): boolean
Checks the equality of the current collection with another evm collection
Example
collection.equals(data)
Parameters
Name | Type | Description |
---|---|---|
data | EvmNftCollectionish | the 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
Name | Type |
---|---|
chain | string |
contractType? | string |
name | string |
symbol | string |
tokenAddress | string |
Implementation of
MoralisDataObject.format
toJSON
▸ toJSON(): Object
Example
collection.toJSON()
Returns
Object
a JSON represention of the collection.
Name | Type |
---|---|
chain | string |
contractType? | string |
name | string |
symbol | string |
tokenAddress | string |
Implementation of
MoralisDataObject.toJSON
Accessors
chain
• get
chain(): EvmChain
Example
collection.chain // EvmChain
Returns
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
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
the token address of collection.
Constructors
constructor
• new EvmNftCollection(data
)
Parameters
Name | Type |
---|---|
data | EvmNftCollectionInput |