Types
Networkish
A Networkish may be any of the following:
a Network object
the name of a common network as a string (e.g.
"mainnet"
)the chain ID a network as a number; if the chain ID is that of a common network, the
name
will be populated, otherwise, the default name"unknown"
is used
Network
A Network represents a Hedera network.
network.name ⇒ string
The human-readable name of the network, such as mainnet
. If the network name is unknown, this will be "unknown"
.
network.chainId ⇒ number
The Chain ID of the network.
AccountLike
Used thoroughly in the hethers library to represent accounts/contracts/addresses in various forms.
Events and Logs
EventFilter
filter.address ⇒ accountLike
The address to filter by, or null
to match any address.
filter.topics ⇒ Array< string< Data< 32 > > | Array< string< Data< 32 > > > >
The topics to filter by or null
to match any topics.
Each entry represents an AND condition that must match, or may be null
to match anything. If a given entry is an Array, then that entry is treated as an OR for any value in the entry.
See Filters for more details and examples on specifying complex filters.
Filter (inherits EventFilter)
filter.fromTimestamp ⇒ string | number
The starting timestamp (inclusive) to search for logs matching the filter criteria.
filter.toTimestamp ⇒ string | number
The end timestamp (inclusive) to search for logs matching the filter criteria.
Log
log.transactionLogIndex ⇒ number
The index of this log in the transaction.
log.address ⇒ accountLike
The address of the contract that generated this log.
log.data ⇒ string< DataHexString >
The data included in this log.
log.topics ⇒ Array< string< DataHexString< 32 > > >
The list of topics (indexed properties) for this log.
log.transactionHash ⇒ string< DataHexString< 48 > >
The transaction hash of the transaction of this log.
log.transactionIndex ⇒ number
The index of this log in the transaction.
log.logIndex ⇒ number
The index of this log in the transaction.
Transactions
TransactionRequest
A transaction request describes a transaction that is to be sent to the network or otherwise processed.
All fields are optional and may be a promise which resolves to the required type.
transactionRequest.to ⇒ accountLike | Promise< accountLike >
The address this transaction it to.
transactionRequest.from ⇒ accountLike | Promise< accountLike >
The address this transaction is from.
transactionRequest.data ⇒ DataHexString | Promise< DataHexString >
The transaction data.
The amount (in tinybars) this transaction is sending.
The maximum amount of gas this transaction is permitted to use.
transactionRequest.chainId ⇒ number | Promise< number >
The chain ID this transaction is authorized on.
transactionRequest.type ⇒ null | number
Types will always be 0
in Hedera since envelope types are not supported as of now.
transactionRequest.accessList ⇒ AccessListish
Currently not supported in Hedera.
transactionRequest.customData ⇒ Record<string, any>
Any custom data as key-value pairs.
TransactionResponse
inherits Transaction
A TransactionResponse includes all properties of a Transaction as well as several properties that are useful once it has been mined.
transaction.timestamp ⇒ string
The timestamp of the transaction. If the transaction has not been mined, this is null
.
transaction.raw ⇒ string< DataHexString >
The serialized transaction. This may be null as some backends do not rpopulate it. If this is required, it can be computed from a TransactionResponse.
transaction.wait( [ timeout ] ) ⇒ Promise< TransactionReceipt >
Resolves to the TransactionReceipt once the transaction has been mined. If timeout is not provided, and the transaction has not been mined, null
is returned.
If the transaction execution failed (i.e. the receipt status is 0
), a CALL_EXCEPTION
error will be rejected with the following properties:
error.transaction
- the original transactionerror.transactionHash
- the hash of the transactionerror.receipt
- the actual receipt, with the status of0
TransactionReceipt
receipt.to ⇒ string < Address >
The address this transaction is to. This is null
if the transaction was an init transaction, used to deploy a contract.
receipt.from ⇒ string < Address >
The address this transaction is from.
receipt.contractAddress ⇒ string < Address >
If this transaction has a null
to address, it is an init transaction used to deploy a contract, in which case this is the address created by that contract.
To compute a contract address, the getContractAddress utility function can also be used with a TransactionResponse object, which requires the transaction nonce and the address of the sender.
receipt.type ⇒ number
Types will always be 0
in Hedera since envelope types are not supported as of now.
receipt.gasUsed ⇒ BigNumber
The amount of gas actually used by this transaction.
receipt.logsBloom ⇒ string< DataHexString >
A bloom-filter, which includes all the addresses and topics included in any log in this transaction.
receipt.transactionHash ⇒ string< DataHexString< 48 > >
The transaction hash of this transaction.
receipt.logs ⇒ Array< Log >
All the logs emitted by this transaction.
receipt.cumulativeGasUsed ⇒ BigNumber
This is the sum of the gas used by the transaction, equals the gasUsed
property.
This is generally of little interest to developers.
receipt.byzantium ⇒ boolean
This is true if the block is in a post-Byzantium Hard Fork block.
receipt.status ⇒ number
The status of a transaction is 1 is successful or 0 if it was reverted. Only transactions included in blocks post-Byzantium Hard Fork have this property.
Last updated