Class: EvmNftTrade

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

Class: EvmNftTrade

@moralisweb3/evm-utils.EvmNftTrade

The EvmNftTrade is a representation of a published trade.

Use this class any time you work with a transaction.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Methods

create

Static create(data): EvmNftTrade

Create a new instance of EvmNftTrade from any valid transaction input

Example

const trade = EvmNftTrade.create(data);

Parameters

NameTypeDescription
dataEvmNftTradeishthe EvmNftTradeish type

Returns

EvmNftTrade


equals

Static equals(dataA, dataB): boolean

Check the equality between two Evm trades. It compares the chain, blockNumber, transactionIndex and transactionHash

Example

EvmNftTrade.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAEvmNftTradeishThe first trade
dataBEvmNftTradeishThe second trade

Returns

boolean

true if the trades are equal, false otherwise


equals

equals(data): boolean

Checks the equality of the current trade instance with another evm trade

Example

trade.equals(data)

Parameters

NameTypeDescription
dataEvmNftTradeishthe trade to compare with

Returns

boolean

true if the trades are equal, false otherwise

Implementation of

MoralisDataObject.equals


toJSON

toJSON(): Object

Example

trade.toJSON()

Returns

Object

a JSON represention of the trade.

NameType
chainstring | number
sellerAddressstring
buyerAddressstring
marketplaceAddressstring
tokenAddressstring
priceTokenAddressundefined | string
blockNumberstring
pricestring
blockTimestampstring
transactionHashstring
transactionIndexnumber
tokenIdsstring[]
blockHashstring

Implementation of

MoralisDataObject.toJSON


format

format(): Object

Example

trade.format()

Returns

Object

a JSON represention of the trade.

NameType
chainstring | number
sellerAddressstring
buyerAddressstring
marketplaceAddressstring
tokenAddressstring
priceTokenAddressundefined | string
blockNumberstring
pricestring
blockTimestampstring
transactionHashstring
transactionIndexnumber
tokenIdsstring[]
blockHashstring

Implementation of

MoralisDataObject.format

Accessors

result

get result(): EvmNftTradeData

Example

trade.result

Returns

EvmNftTradeData

all the data without casting it to JSON.


sellerAddress

get sellerAddress(): EvmAddress

Example

trade.sellerAddress // EvmAddress

Returns

EvmAddress

the trade seller address


buyerAddress

get buyerAddress(): EvmAddress

Example

trade.buyerAddress // EvmAddress

Returns

EvmAddress

the trade buyer address


marketplaceAddress

get marketplaceAddress(): EvmAddress

Example

trade.marketplaceAddress // EvmAddress

Returns

EvmAddress

the trade marketplace address


tokenAddress

get tokenAddress(): EvmAddress

Example

trade.tokenAddress // EvmAddress

Returns

EvmAddress

the trade token address


priceTokenAddress

get priceTokenAddress(): undefined | EvmAddress

Example

trade.priceTokenAddress // EvmAddress

Returns

undefined | EvmAddress

the trade price token address


price

get price(): EvmNative

Example

trade.price // EvmNative

Returns

EvmNative

the trade price


blockNumber

get blockNumber(): BigNumber

Example

trade.blockNumber // BigNumber

Returns

BigNumber

the trade block number


transactionIndex

get transactionIndex(): number

Example

trade.transactionIndex // 164

Returns

number

the trade transaction index


transactionHash

get transactionHash(): string

Example

trade.transactionHash // "0x4de0bcef1450492bd5c2e7693cf644c40005868d0dcc8a7a50a80ef2efa88d1e"

Returns

string

the trade transaction hash


chain

get chain(): EvmChain

Example

trade.chain // EvmChain

Returns

EvmChain

the trade chain


tokenIds

get tokenIds(): string[]

Example

trade.tokenIds // ["16404"]

Returns

string[]

the trade token Ids


blockHash

get blockHash(): string

Example

trade.blockHash // "0x4de0bcef1450492bd5c2e7693cf644c40005868d0dcc8a7a50a80ef2efa88d1e"

Returns

string

the trade block hash


blockTimestamp

get blockTimestamp(): Date

Example

trade.blockTimestamp // Date

Returns

Date

the trade block timestamp


Did this page help you?