Class: Erc20Transfer

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

Class: Erc20Transfer

@moralisweb3/evm-utils.Erc20Transfer

The Erc20Transfer is a representation of an Erc20 token transfer.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Methods

create

Static create(data): Erc20Transfer

Create a new instance of Erc20Transfer from any valid input

Example

const transfer = Erc20Transfer.create(data);

Parameters

NameTypeDescription
dataErc20Transferishthe Erc20Transferish type

Returns

Erc20Transfer


equals

Static equals(dataA, dataB): boolean

Check the equality between two Erc20 transfers

Example

Erc20Transfer.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAErc20TransferishThe first transfer to compare
dataBErc20TransferishThe second transfer to compare

Returns

boolean

true if the transfers are equal, false otherwise


equals

equals(data): boolean

Checks the equality of the current trnasfer with another erc20 trnasfer

Example

transfer.equals(data)

Parameters

NameTypeDescription
dataErc20Transferishthe trnasfer 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
addressstring
blockNumberstring
toAddressstring
fromAddressstring
valuestring
transactionHashstring
blockTimestampDate
blockHashstring

Implementation of

MoralisDataObject.toJSON


format

format(): Object

Example

transfer.format()

Returns

Object

a JSON represention of the transfer.

NameType
chainstring | number
addressstring
blockNumberstring
toAddressstring
fromAddressstring
valuestring
transactionHashstring
blockTimestampDate
blockHashstring

Implementation of

MoralisDataObject.format

Accessors

result

get result(): Erc20TransferData

Example

transfer.result

Returns

Erc20TransferData

all the data without casting it to JSON.


address

get address(): EvmAddress

Example

transfer.address // EvmAddress

Returns

EvmAddress

the address of the tranfer


blockHash

get blockHash(): string

Example

transfer.blockHash // "0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86"

Returns

string

the block hash of the tranfer


blockNumber

get blockNumber(): BigNumber

Example

transfer.blockNumber // BigNumber

Returns

BigNumber

the block number of the tranfer


blockTimestamp

get blockTimestamp(): Date

Example

transfer.blockTimestamp // Date

Returns

Date

the block timestamp of the tranfer


chain

get chain(): EvmChain

Example

transfer.chain // EvmChain

Returns

EvmChain

the chain of the tranfer


fromAddress

get fromAddress(): EvmAddress

Example

transfer.fromAddress // EvmAddress

Returns

EvmAddress

the from address of the tranfer


toAddress

get toAddress(): EvmAddress

Example

transfer.toAddress // EvmAddress

Returns

EvmAddress

the to address of the tranfer


transactionHash

get transactionHash(): string

Example

transfer.transactionHash // "0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86"

Returns

string

the transaction hash of the tranfer


value

get value(): BigNumber

Example

transfer.value // BigNumber

Returns

BigNumber

the value of the tranfer


Did this page help you?