Class: EvmTransactionLog

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

Class: EvmTransactionLog

@moralisweb3/evm-utils.EvmTransactionLog

The EvmTransactionLog class is a MoralisData that references an EVM transaction log.

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Methods

create

Static create(value, core?): EvmTransactionLog

Create a new instance of EvmTransactionLog from any valid address input

Example

const log = EvmTransactionLog.create(value, core);

Parameters

NameTypeDescription
valueEvmTransactionLogishA valid EvmTransactionLogish
core?MoralisCoreThe MoralisCore instance

Returns

EvmTransactionLog


equals

equals(value): boolean

Compares the log to another log for equality.

Example

log.equals(log);

Parameters

NameTypeDescription
valueEvmTransactionLogThe value to compare with

Returns

boolean

true if the logs are equal, otherwise false

Implementation of

MoralisDataObject.equals


toJSON

toJSON(): Object

Converts the log to a JSON object.

Example

log.toJSON();

Returns

Object

the EvmTransactionLog as a JSON object

NameType
addressstring
logIndex?number
transactionHashstring
transactionIndex?number
datastring
topicsstring[]
blockHashstring
blockNumbernumber
blockTimestamp?string

Implementation of

MoralisDataObject.toJSON


format

format(): Object

Converts the log to a JSON object.

Example

log.format();

Returns

Object

the EvmTransactionLog as a JSON object

NameType
addressstring
logIndex?number
transactionHashstring
transactionIndex?number
datastring
topicsstring[]
blockHashstring
blockNumbernumber
blockTimestamp?string

Implementation of

MoralisDataObject.format

Accessors

result

get result(): EvmTransactionLogData

Returns the processed Erc20Token.

Example

log.result;

Returns

EvmTransactionLogData

the EvmTransactionLog value


transactionHash

get transactionHash(): string

Example

log.transactionHash; // "0xdd9006489e46670e0e85d1fb88823099e7f596b08aeaac023e9da0851f26fdd5"

Returns

string

the transaction hash of the log.


address

get address(): EvmAddress

Returns the address of the log.

Example

log.address; // EvmAddress

Returns

EvmAddress


logIndex

get logIndex(): undefined | number

Example

log.logIndex; // 273

Returns

undefined | number

the log index of the log.


data

get data(): string

Example

log.data; // "0x00000000000000000000000000000000000000000000000de05239bccd4d537400000000000000000000000000024dbc80a9f80e3d5fc0a0ee30e2693781a443"

Returns

string

the data of the log.


topics

get topics(): string[]

Example

log.topics; // ["0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000002"]

Returns

string[]

the topics of the log.


blockHash

get blockHash(): string

Example

log.blockHash; // "0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171"

Returns

string

the block hash of the log.


blockNumber

get blockNumber(): number

Example

log.blockNumber; // 12386788

Returns

number

the block number of the log.


blockTimestamp

get blockTimestamp(): undefined | string

Example

log.blockTimestamp; // "2021-05-07T11:08:35.000Z"

Returns

undefined | string

the block timestamp of the log.


Did this page help you?