Skip to main content

Class: EvmNftMedia

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

Class: EvmNftMedia

@moralisweb3/common-evm-utils.EvmNftMedia

The EvmNftMedia is a representation of an processed NFT media.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Constructors

Methods

create

Static create(data): EvmNftMedia

Create a new instance of EvmNftMedia from any valid input

Example

const media = EvmNftMedia.create(data);

Parameters

NameTypeDescription
dataEvmNftMediaInputEvmNftMedia instance or valid EvmNftMediaInput

Returns

EvmNftMedia


equals

Static equals(dataA, dataB): boolean

Check the equality between two Erc20 medias

Example

EvmNftMedia.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAEvmNftMediaInput | EvmNftMediaThe first media to compare
dataBEvmNftMediaInput | EvmNftMediaThe second media to compare

Returns

boolean

true if the medias are equal, false otherwise


parse

Static parse(data): EvmNftMediaData

Parameters

NameType
dataEvmNftMediaInput

Returns

EvmNftMediaData


equals

equals(data): boolean

Checks the equality of the current media with another erc20 media

Example

media.equals(data)

Parameters

NameTypeDescription
dataEvmNftMediaInput | EvmNftMediathe media to compare with

Returns

boolean

true if the medias are equal, false otherwise

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
category?EvmNftMediaCategory
chainstring
mediaCollection?{ high: EvmNftMediaItem ; low: EvmNftMediaItem ; medium: EvmNftMediaItem }
mediaCollection.highEvmNftMediaItem
mediaCollection.lowEvmNftMediaItem
mediaCollection.mediumEvmNftMediaItem
mimetype?string
originalMediaUrl?string
parentHash?string
status?EvmNftMediaStatus
updatedAt?Date

Implementation of

MoralisDataObject.format


toJSON

toJSON(): Object

Example

media.toJSON()

Returns

Object

a JSON representation of the media.

NameType
category?EvmNftMediaCategory
chainstring
mediaCollection?{ high: EvmNftMediaItem ; low: EvmNftMediaItem ; medium: EvmNftMediaItem }
mediaCollection.highEvmNftMediaItem
mediaCollection.lowEvmNftMediaItem
mediaCollection.mediumEvmNftMediaItem
mimetype?string
originalMediaUrl?string
parentHash?string
status?EvmNftMediaStatus
updatedAt?Date

Implementation of

MoralisDataObject.toJSON

Accessors

category

get category(): undefined | EvmNftMediaCategory

Returns

undefined | EvmNftMediaCategory


chain

get chain(): EvmChain

Returns

EvmChain


mediaCollection

get mediaCollection(): undefined | { high: EvmNftMediaItem ; low: EvmNftMediaItem ; medium: EvmNftMediaItem }

Returns

undefined | { high: EvmNftMediaItem ; low: EvmNftMediaItem ; medium: EvmNftMediaItem }


mimetype

get mimetype(): undefined | string

Returns

undefined | string


originalMediaUrl

get originalMediaUrl(): undefined | string

Returns

undefined | string


parentHash

get parentHash(): undefined | string

Returns

undefined | string


result

get result(): EvmNftMediaData

Example

media.result

Returns

EvmNftMediaData

all the data without casting it to JSON.


status

get status(): undefined | EvmNftMediaStatus

Returns

undefined | EvmNftMediaStatus


updatedAt

get updatedAt(): undefined | Date

Returns

undefined | Date

Constructors

constructor

new EvmNftMedia(data)

Parameters

NameType
dataEvmNftMediaInput