A ContractTransactionReceipt includes the parsed logs from a TransactionReceipt.

Extends

Properties

PropertyModifierTypeDescriptionInherited from
#logsprivatereadonly Log[]The root hash of this transaction.

This is no present and was only included in pre-byzantium blocks, but could be used to validate certain parts of
the receipt.
TransactionReceipt.#logs
blockHashreadonlystringThe block hash of the Block this transaction was included in.TransactionReceipt.blockHash
blockNumberreadonlynumberThe block number of the Block this transaction was included in.TransactionReceipt.blockNumber
contractAddressreadonlynull | stringThe address of the contract if the transaction was directly responsible for deploying one.

This is non-null only if the to is empty and the data was successfully executed as initcode.
TransactionReceipt.contractAddress
cumulativeGasUsedreadonlybigintThe amount of gas used by all transactions within the block for this and all transactions with a lower index.

This is generally not useful for developers but can be used to validate certain aspects of execution.
TransactionReceipt.cumulativeGasUsed
fromreadonlystringThe sender of the transaction.TransactionReceipt.from
gasPricereadonlybigintThe actual gas price used during execution.

Due to the complexity of EIP-1559 this value can only be caluclated
after the transaction has been mined, snce the base fee is protocol-enforced.
TransactionReceipt.gasPrice
gasUsedreadonlybigintThe actual amount of gas used by this transaction.

When creating a transaction, the amount of gas that will be used can only be approximated, but the sender must
pay the gas fee for the entire gas limit. After the transaction, the difference is refunded.
TransactionReceipt.gasUsed
hashreadonlystringThe transaction hash.TransactionReceipt.hash
indexreadonlynumberThe index of this transaction within the block transactions.TransactionReceipt.index
logsBloomreadonlystringThe bloom filter bytes that represent all logs that occurred within this transaction. This is generally not
useful for most developers, but can be used to validate the included logs.
TransactionReceipt.logsBloom
providerreadonlyProviderThe provider connected to the log used to fetch additional details if necessary.TransactionReceipt.provider
statusreadonlynull | numberThe status of this transaction, indicating success (i.e. 1) or a revert (i.e. 0).

This is available in post-byzantium blocks, but some backends may backfill this value.
TransactionReceipt.status
toreadonlynull | stringThe address the transaction was sent to.TransactionReceipt.to
typereadonlynumberThe EIP-2718 transaction type.TransactionReceipt.type

Accessors

fee

get fee(): bigint

The total fee for this transaction, in wei.

Returns

bigint

Source

providers/provider.ts:1394


logs

get logs(): (EventLog | Log)[]

The parsed logs for any Log which has a matching event in the Contract ABI.

Returns

(EventLog | Log)[]

Source

contract/wrappers.ts:98

Methods

confirmations()

confirmations(): Promise<number>

Resolves to the number of confirmations this transaction has.

Returns

Promise<number>

A promise resolving to the number of confirmations.

Inherited from

TransactionReceipt.confirmations

Throws

If the block is not found.

Source

providers/provider.ts:1445


getBlock()

getBlock(shard): Promise<Block>

Resolves to the block this transaction occurred in.

Parameters

ParameterTypeDescription
shardShardThe shard to fetch the block from.

Returns

Promise<Block>

A promise resolving to the block.

Inherited from

TransactionReceipt.getBlock

Throws

If the block is not found.

Source

providers/provider.ts:1405


getResult()

getResult(): Promise<string>

Resolves to the return value of the execution of this transaction.

Support for this feature is limited, as it requires an archive node with the debug_ or trace_ API enabled.

Returns

Promise<string>

A promise resolving to the return value of the transaction.

Inherited from

TransactionReceipt.getResult

Throws

If the transaction is not found.

Source

providers/provider.ts:1435


getTransaction()

getTransaction(): Promise<TransactionResponse>

Resolves to the transaction this transaction occurred in.

Returns

Promise<TransactionResponse>

A promise resolving to the transaction.

Inherited from

TransactionReceipt.getTransaction

Throws

If the transaction is not found.

Source

providers/provider.ts:1419


toJSON()

toJSON(): any

Returns a JSON-compatible representation.

Returns

any

Inherited from

TransactionReceipt.toJSON

Source

providers/provider.ts:1338