Skip to main content

Class: DeploySentTx<TContract>

contract.DeploySentTx

A contract deployment transaction sent to the network, extending SentTx with methods to create a contract instance.

Type parameters

NameType
TContractextends Contract = Contract

Hierarchy

Constructors

constructor

new DeploySentTx<TContract>(wallet, txHashPromise, postDeployCtor, instance): DeploySentTx<TContract>

Type parameters

NameType
TContractextends Contract = Contract

Parameters

NameTypeDescription
walletPXE | Wallet-
txHashPromisePromise<TxHash>-
postDeployCtor(address: AztecAddress, wallet: Wallet) => Promise<TContract>-
instanceContractInstanceWithAddressThe deployed contract instance

Returns

DeploySentTx<TContract>

Overrides

SentTx.constructor

Properties

instance

instance: ContractInstanceWithAddress

The deployed contract instance


log

Private log: Logger


postDeployCtor

Private postDeployCtor: (address: AztecAddress, wallet: Wallet) => Promise<TContract>

Type declaration

▸ (address, wallet): Promise<TContract>

Parameters
NameType
addressAztecAddress
walletWallet
Returns

Promise<TContract>


pxe

Protected pxe: PXE

Inherited from

SentTx.pxe


txHashPromise

Protected txHashPromise: Promise<TxHash>

Inherited from

SentTx.txHashPromise

Methods

deployed

deployed(opts?): Promise<TContract>

Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined.

Parameters

NameTypeDescription
opts?DeployedWaitOptsOptions for configuring the waiting for the tx to be mined.

Returns

Promise<TContract>

The deployed contract instance.


getContractObject

getContractObject(wallet?): Promise<TContract>

Parameters

NameType
wallet?Wallet

Returns

Promise<TContract>


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.

Inherited from

SentTx.getReceipt


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.

Inherited from

SentTx.getTxHash


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.

Inherited from

SentTx.getUnencryptedLogs


getVisibleNotes

getVisibleNotes(): Promise<ExtendedNote[]>

Get notes of accounts registered in the provided PXE/Wallet created in this tx.

Returns

Promise<ExtendedNote[]>

The requested notes.

Remarks

This function will wait for the tx to be mined if it hasn't been already.

Inherited from

SentTx.getVisibleNotes


wait

wait(opts?): Promise<DeployTxReceipt<TContract>>

Awaits for the tx to be mined and returns the receipt along with a contract instance. Throws if tx is not mined.

Parameters

NameTypeDescription
opts?DeployedWaitOptsOptions for configuring the waiting for the tx to be mined.

Returns

Promise<DeployTxReceipt<TContract>>

The transaction receipt with the deployed contract instance.

Overrides

SentTx.wait


waitForProven

waitForProven(minedBlock, opts?): Promise<number>

Parameters

NameType
minedBlocknumber
opts?WaitOpts

Returns

Promise<number>

Inherited from

SentTx.waitForProven


waitForReceipt

waitForReceipt(opts?): Promise<TxReceipt>

Parameters

NameType
opts?WaitOpts

Returns

Promise<TxReceipt>

Inherited from

SentTx.waitForReceipt