Skip to main content

Class: EvmTransactionLog

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

Class: EvmTransactionLog

@moralisweb3/common-evm-utils.EvmTransactionLog

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

Hierarchy

Implements

  • MoralisDataObject

Table of contents

Methods

Accessors

Constructors

Properties

Methods

create

Static create(value): EvmTransactionLog

Create a new instance of EvmTransactionLog from any valid address input

Example

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

Parameters

NameTypeDescription
valueEvmTransactionLogishA valid EvmTransactionLogish

Returns

EvmTransactionLog


parse

Static parse(value): EvmTransactionLogData

Parameters

NameType
valueEvmTransactionLogInput

Returns

EvmTransactionLogData


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


format

format(): Object

Deprecated

This method will be removed soon. To format the value, use one of the properties.

Returns

Object

NameType
addressstring
blockHashstring
blockNumbernumber
blockTimestamp?string
chainstring
datastring
logIndex?number
topics(null | string)[]
transactionHashstring
transactionIndex?number

Implementation of

MoralisDataObject.format


toJSON

toJSON(): Object

Converts the log to a JSON object.

Example

log.toJSON();

Returns

Object

the EvmTransactionLog as a JSON object

NameType
addressstring
blockHashstring
blockNumbernumber
blockTimestamp?string
chainstring
datastring
logIndex?number
topics(null | string)[]
transactionHashstring
transactionIndex?number

Implementation of

MoralisDataObject.toJSON

Accessors

address

get address(): EvmAddress

Returns the address of the log.

Example

log.address; // EvmAddress

Returns

EvmAddress


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.


chain

get chain(): EvmChain

Returns the chain of the log.

Example

log.chain; // EvmChain

Returns

EvmChain


data

get data(): string

Example

log.data; // "0x00000000000000000000000000000000000000000000000de05239bccd4d537400000000000000000000000000024dbc80a9f80e3d5fc0a0ee30e2693781a443"

Returns

string

the data of the log.


logIndex

get logIndex(): undefined | number

Example

log.logIndex; // 273

Returns

undefined | number

the log index of the log.


result

get result(): EvmTransactionLogData

Returns the processed Erc20Token.

Example

log.result;

Returns

EvmTransactionLogData

the EvmTransactionLog value


topics

get topics(): (null | string)[]

Example

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

Returns

(null | string)[]

the topics of the log.


transactionHash

get transactionHash(): string

Example

log.transactionHash; // "0xdd9006489e46670e0e85d1fb88823099e7f596b08aeaac023e9da0851f26fdd5"

Returns

string

the transaction hash of the log.

Constructors

constructor

new EvmTransactionLog(value)

Parameters

NameType
valueEvmTransactionLogInput

Properties

_value

Protected _value: EvmTransactionLogData