Class: EvmNftTransfer

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

Class: EvmNftTransfer

@moralisweb3/evm-utils.EvmNftTransfer

The EvmNftTransfer is a representation of a completed NFT transfer.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Methods

create

Static create(data): EvmNftTransfer

Create a new instance of EvmNftTransfer from any valid transfer input

Example

const transfer = EvmNftTransfer.create(data);

Parameters

NameTypeDescription
dataEvmNftTransferishthe EvmNftTransferish type

Returns

EvmNftTransfer


equals

Static equals(dataA, dataB): boolean

Check the equality between two NFT transfers. The compares the chain, blockHash, tokenId and logIndex.

Example

EvmNftTransfer.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAEvmNftTransferishThe first transfer to compare
dataBEvmNftTransferishThe second transfer to compare

Returns

boolean

true if the transfers are equal, false otherwise


equals

equals(data): boolean

Checks the equality of the current transfer instance with another nft transfer

Example

transaction.equals(data)

Parameters

NameTypeDescription
dataEvmNftTransferishthe transfer to compare with

Returns

boolean

true if the transfers are equal, false otherwise

Implementation of

MoralisDataObject.equals


toJSON

toJSON(): Object

Example

transfer.toJSON()

Returns

Object

a JSON represention of the transfer.

NameType
chainstring | number
blockNumberstring
fromAddressundefined | string
toAddressstring
tokenAddressstring
valueundefined | string
operatorundefined | string
amount?number
blockHashstring
blockTimestampDate
contractTypestring
logIndexnumber
tokenIdstring
transactionHashstring
transactionIndex?number
transactionType?string

Implementation of

MoralisDataObject.toJSON


format

format(): Object

Example

transfer.format()

Returns

Object

a JSON represention of the transfer.

NameType
chainstring | number
blockNumberstring
fromAddressundefined | string
toAddressstring
tokenAddressstring
valueundefined | string
operatorundefined | string
amount?number
blockHashstring
blockTimestampDate
contractTypestring
logIndexnumber
tokenIdstring
transactionHashstring
transactionIndex?number
transactionType?string

Implementation of

MoralisDataObject.format

Accessors

result

get result(): EvmNftTransferData

Example

transfer.result

Returns

EvmNftTransferData

all the data without casting it to JSON.


chain

get chain(): EvmChain

Example

transfer.chain // EvmChain

Returns

EvmChain

the chain of the transfer.


blockHash

get blockHash(): string

Example

transfer.blockHash // "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e"

Returns

string

the block hash of the transfer.


blockNumber

get blockNumber(): BigNumber

Example

transfer.blockNumber // BigNumber

Returns

BigNumber

the block number of the transfer.


blockTimestamp

get blockTimestamp(): Date

Example

transfer.blockTimestamp // Date

Returns

Date

the block timestamp of the transfer.


fromAddress

get fromAddress(): undefined | EvmAddress

Example

transfer.fromAddress // EvmAddress

Returns

undefined | EvmAddress

the from address of the transfer.


toAddress

get toAddress(): EvmAddress

Example

transfer.toAddress // EvmAddress

Returns

EvmAddress

the to address of the transfer.


tokenAddress

get tokenAddress(): EvmAddress

Example

transfer.tokenAddress // EvmAddress

Returns

EvmAddress

the token address of the transfer.


tokenId

get tokenId(): string

Example

transfer.tokenId // "15"

Returns

string

the token id of the transfer.


amount

get amount(): undefined | number

Example

transfer.amount // 1

Returns

undefined | number

the amount of the transfer.


value

get value(): undefined | EvmNative

Example

transfer.value // EvmNative

Returns

undefined | EvmNative

the value of the transfer.


logIndex

get logIndex(): number

Example

transfer.logIndex // 0

Returns

number

the log index of the transfer.


transactionHash

get transactionHash(): string

Example

transfer.transactionHash // "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e"

Returns

string

the transaction hash of the transfer.


transactionIndex

get transactionIndex(): undefined | number

Example

transfer.transactionIndex // 123

Returns

undefined | number

the transaction index of the transfer.


transactionType

get transactionType(): undefined | string

Example

transfer.transactionType // "1"

Returns

undefined | string

the transaction type of the transfer.


operator

get operator(): undefined | EvmAddress

Example

transfer.operator // EvmAddress

Returns

undefined | EvmAddress

the operator of the transfer.


contractType

get contractType(): string

Example

transfer.contractType // "ERC721"

Returns

string

the contract type of the transfer.


Did this page help you?