Class: SentTx
contract.SentTx
The SentTx class represents a sent transaction through the PXE, providing methods to fetch its hash, receipt, and mining status.
Hierarchy
-
SentTx
Constructors
constructor
• new SentTx(pxe
, txHashPromise
): SentTx
Parameters
Name | Type |
---|---|
pxe | PXE |
txHashPromise | Promise <TxHash > |
Returns
Properties
pxe
• Protected
pxe: PXE
txHashPromise
• Protected
txHashPromise: Promise
<TxHash
>
Methods
getReceipt
▸ getReceipt(): Promise
<TxReceipt
>
Retrieve the transaction receipt associated with the current SentTx instance. The function fetches the transaction hash using 'getTxHash' and then queries the PXE to get the corresponding transaction receipt.
Returns
Promise
<TxReceipt
>
A promise that resolves to a TxReceipt object representing the fetched transaction receipt.
getTxHash
▸ getTxHash(): Promise
<TxHash
>
Retrieves the transaction hash of the SentTx instance. The function internally awaits for the 'txHashPromise' to resolve, and then returns the resolved transaction hash.
Returns
Promise
<TxHash
>
A promise that resolves to the transaction hash of the SentTx instance. TODO(#7717): Don't throw here.
getUnencryptedLogs
▸ getUnencryptedLogs(): Promise
<GetUnencryptedLogsResponse
>
Gets unencrypted logs emitted by this tx.
Returns
Promise
<GetUnencryptedLogsResponse
>
The requested logs.
Remarks
This function will wait for the tx to be mined if it hasn't been already.
wait
▸ wait(opts?
): Promise
<FieldsOf
<TxReceipt
>>
Awaits for a tx to be mined and returns the receipt. Throws if tx is not mined.
Parameters
Name | Type | Description |
---|---|---|
opts? | WaitOpts | Options for configuring the waiting for the tx to be mined. |
Returns
Promise
<FieldsOf
<TxReceipt
>>
The transaction receipt.
waitForProven
▸ waitForProven(minedBlock
, opts?
): Promise
<number
>
Parameters
Name | Type |
---|---|
minedBlock | number |
opts? | WaitOpts |
Returns
Promise
<number
>
waitForReceipt
▸ waitForReceipt(opts?
): Promise
<TxReceipt
>
Parameters
Name | Type |
---|---|
opts? | WaitOpts |
Returns
Promise
<TxReceipt
>