Skip to main content

Class: EvmTransactionVerbose

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

Class: EvmTransactionVerbose

@moralisweb3/common-evm-utils.EvmTransactionVerbose

The EvmTransactionVerbose is a representation of a published transaction.

Use this class any time you work with a transaction.

Hierarchy

Table of contents

Methods

Accessors

Constructors

Properties

Methods

create

Static create(data): EvmTransactionVerbose

Create a new instance of EvmTransactionVerbose from any valid transaction input

Example

const transaction = EvmTransactionVerbose.create(data);

Parameters

NameTypeDescription
dataEvmTransactionVerboseishthe EvmTransactionVerboseish type

Returns

EvmTransactionVerbose

Overrides

EvmTransaction.create


equals

Static equals(dataA, dataB): boolean

Check the equality between two Evm transactions

Example

EvmTransaction.equals(dataA, dataB)

Parameters

NameTypeDescription
dataAEvmTransactionishThe first transaction
dataBEvmTransactionishThe second transaction

Returns

boolean

Inherited from

EvmTransaction.equals


parse

Static parse(data): EvmTransactionVerboseData

Parameters

NameType
dataEvmTransactionVerboseInput

Returns

EvmTransactionVerboseData

Overrides

EvmTransaction.parse


equals

equals(data): boolean

Checks the equality of the current transaction with another evm transaction

Example

transaction.equals(data)

Parameters

NameTypeDescription
dataEvmTransactionishthe transaction to compare with

Returns

boolean

Inherited from

EvmTransaction.equals


format

format(): Object

Deprecated

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

Returns

Object

NameType
blockHashstring
blockNumberstring
blockTimestampstring
chainstring
contractAddressundefined | string
cumulativeGasUsedstring
data?string
fromstring
gasundefined | string
gasPricestring
gasUsedstring
hashstring
indexstring | number
internalTransactionsEvmInternalTransactionJSON[]
logs{ address: string ; blockHash: string ; blockNumber: number ; blockTimestamp?: string ; chain: string ; data: string ; logIndex?: number ; topics: (null | string)[] ; transactionHash: string ; transactionIndex?: number }[]
nonceundefined | string
receiptRoot?string
receiptStatus?number
signatureundefined | MoralisDataObjectValue
toundefined | string
valueundefined | string

Inherited from

EvmTransaction.format


toJSON

toJSON(): Object

Returns

Object

NameType
blockHashstring
blockNumberstring
blockTimestampstring
chainstring
contractAddressundefined | string
cumulativeGasUsedstring
data?string
fromstring
gasundefined | string
gasPricestring
gasUsedstring
hashstring
indexstring | number
internalTransactionsEvmInternalTransactionJSON[]
logs{ address: string ; blockHash: string ; blockNumber: number ; blockTimestamp?: string ; chain: string ; data: string ; logIndex?: number ; topics: (null | string)[] ; transactionHash: string ; transactionIndex?: number }[]
nonceundefined | string
receiptRoot?string
receiptStatus?number
signatureundefined | MoralisDataObjectValue
toundefined | string
valueundefined | string

Inherited from

EvmTransaction.toJSON

Accessors

blockHash

get blockHash(): string

Example

transaction.blockHash // 0x0372c302e3c52e8f2e15d155e2c545e6d802e479236564af052759253b20fd86

Returns

string

the transaction black hash

Inherited from

EvmTransaction.blockHash


blockNumber

get blockNumber(): BigNumber

Example

transaction.blockNumber // 12526958

Returns

BigNumber

the transaction block number

Inherited from

EvmTransaction.blockNumber


blockTimestamp

get blockTimestamp(): Date

Example

transaction.blockTimestamp // Date

Returns

Date

the transaction block timestamp

Inherited from

EvmTransaction.blockTimestamp


chain

get chain(): EvmChain

Example

transaction.chain // EvmChain

Returns

EvmChain

the transaction chain

Inherited from

EvmTransaction.chain


contractAddress

get contractAddress(): undefined | EvmAddress

Example

transaction.contractAddress // EvmAddress

Returns

undefined | EvmAddress

the transaction contract address

Inherited from

EvmTransaction.contractAddress


cumulativeGasUsed

get cumulativeGasUsed(): BigNumber

Example

transaction.cumulativeGasUsed // 1340925

Returns

BigNumber

the transaction cumulative gas used

Inherited from

EvmTransaction.cumulativeGasUsed


data

get data(): undefined | string

Example

transaction.data // 0x000000000000000000000000000000000000000000000000000000000000002

Returns

undefined | string

the transaction data

Inherited from

EvmTransaction.data


decodedCall

get decodedCall(): EvmTransactionLogDecodedEvent

Returns

EvmTransactionLogDecodedEvent


from

get from(): EvmAddress

Example

transaction.address // EvmAddress

Returns

EvmAddress

the transaction from address

Inherited from

EvmTransaction.from


gas

get gas(): undefined | BigNumber

Example

transaction.gas // 6721975

Returns

undefined | BigNumber

the transaction gas

Inherited from

EvmTransaction.gas


gasPrice

get gasPrice(): BigNumber

Example

transaction.gasPrice // 20000000000

Returns

BigNumber

the transaction gas price

Inherited from

EvmTransaction.gasPrice


gasUsed

get gasUsed(): BigNumber

Example

transaction.gasUsed // 1340925

Returns

BigNumber

the transaction gas used

Inherited from

EvmTransaction.gasUsed


hash

get hash(): string

Example

transaction.hash // 0x057Ec652A4F150f7FF94f089A38008f49a0DF88e

Returns

string

the transaction hash

Inherited from

EvmTransaction.hash


index

get index(): string | number

Example

transaction.index // 1

Returns

string | number

the index

Inherited from

EvmTransaction.index


internalTransactions

get internalTransactions(): EvmInternalTransaction[]

Example

transaction.logs // EvmInternalTransaction[]

Returns

EvmInternalTransaction[]

the internal transactions

Inherited from

EvmTransaction.internalTransactions


logs

get logs(): EvmTransactionLogDecoded[]

Example

transaction.logs // EvmTransactionLog[]

Returns

EvmTransactionLogDecoded[]

the transaction logs

Overrides

EvmTransaction.logs


nonce

get nonce(): undefined | BigNumber

Example

transaction.nonce // 326595425

Returns

undefined | BigNumber

the transaction nonce

Inherited from

EvmTransaction.nonce


r

get r(): undefined | string

Returns

undefined | string

Inherited from

EvmTransaction.r


receiptRoot

get receiptRoot(): undefined | string

Example

transaction.receiptRoot // string

Returns

undefined | string

the transaction receipt root

Inherited from

EvmTransaction.receiptRoot


receiptStatus

get receiptStatus(): undefined | number

Example

transaction.receiptStatus // 1

Returns

undefined | number

the transaction receipt status

Inherited from

EvmTransaction.receiptStatus


result

get result(): EvmTransactionData

Example

transaction.result

Returns

EvmTransactionData

the transaction

Inherited from

EvmTransaction.result


s

get s(): undefined | string

Returns

undefined | string

Inherited from

EvmTransaction.s


signature

get signature(): undefined | EvmSignature

Example

transaction.signature // EvmSignature

Returns

undefined | EvmSignature

the signature (if available)

Inherited from

EvmTransaction.signature


to

get to(): undefined | EvmAddress

Example

transaction.to // EvmAddress

Returns

undefined | EvmAddress

the transaction to address

Inherited from

EvmTransaction.to


v

get v(): undefined | number

Returns

undefined | number

Inherited from

EvmTransaction.v


value

get value(): undefined | EvmNative

Example

transaction.value // EvmNative

Returns

undefined | EvmNative

the transaction value

Inherited from

EvmTransaction.value

Constructors

constructor

new EvmTransactionVerbose(data)

Parameters

NameType
dataEvmTransactionVerboseInput

Overrides

EvmTransaction.constructor

Properties

_data

Protected _data: EvmTransactionVerboseData

Overrides

EvmTransaction._data