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
EvmTransactionLog
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
| Name | Type | Description |
|---|---|---|
value | EvmTransactionLogish | A valid EvmTransactionLogish |
Returns
parse
▸ Static parse(value): EvmTransactionLogData
Parameters
| Name | Type |
|---|---|
value | EvmTransactionLogInput |
Returns
equals
▸ equals(value): boolean
Compares the log to another log for equality.
Example
log.equals(log);
Parameters
| Name | Type | Description |
|---|---|---|
value | EvmTransactionLog | The 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
| Name | Type |
|---|---|
address | string |
blockHash | string |
blockNumber | number |
blockTimestamp? | string |
chain | string |
data | string |
logIndex? | number |
topics | (null | string)[] |
transactionHash | string |
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
| Name | Type |
|---|---|
address | string |
blockHash | string |
blockNumber | number |
blockTimestamp? | string |
chain | string |
data | string |
logIndex? | number |
topics | (null | string)[] |
transactionHash | string |
transactionIndex? | number |
Implementation of
MoralisDataObject.toJSON
Accessors
address
• get address(): EvmAddress
Returns the address of the log.
Example
log.address; // EvmAddress
Returns
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
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
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
| Name | Type |
|---|---|
value | EvmTransactionLogInput |
Properties
_value
• Protected _value: EvmTransactionLogData