Reference
This documentation is auto-generated from the Aztec.js TypeScript source code.
This is an auto-generated reference. For tutorials and guides, see the Aztec.js Guide.
Package: @aztec/aztec.js
Generated: 2025-12-10T22:27:41.987Z
This document provides a comprehensive reference for all public APIs in the Aztec.js library.
Each section is organized by module, with classes, interfaces, types, and functions documented with their full signatures, parameters, and return types.
Table of Contents
- Account
- Authorization
- Contract
- BaseContractInteraction
- BatchCall
- abiChecker
- ContractMethod
- ContractStorageLayout
- ContractBase
- ContractFunctionInteraction
- Contract
- RequestDeployOptions
- DeployOptions
- SimulateDeployOptions
- DeployMethod
- DeployedWaitOpts
- DeployTxReceipt
- DeploySentTx
- getGasLimits
- FeeEstimationOptions
- FeePaymentMethodOption
- GasSettingsOption
- InteractionFeeOptions
- SimulationInteractionFeeOptions
- RequestInteractionOptions
- SendInteractionOptions
- SimulateInteractionOptions
- ProfileInteractionOptions
- SimulationReturn
- toSendOptions
- toSimulateOptions
- toProfileOptions
- getClassRegistryContract
- getInstanceRegistryContract
- getFeeJuice
- WaitOpts
- DefaultWaitOpts
- SentTx
- UnsafeContract
- WaitForProvenOpts
- DefaultWaitForProvenOpts
- waitForProven
- Deployment
- Ethereum
- Fee
- Utils
- FieldLike
- EthAddressLike
- AztecAddressLike
- FunctionSelectorLike
- EventSelectorLike
- U128Like
- WrappedFieldLike
- IntentInnerHash
- CallIntent
- ContractFunctionInteractionCallIntent
- computeAuthWitMessageHash
- getMessageHashFromIntent
- computeInnerAuthWitHashFromAction
- lookupValidity
- SetPublicAuthwitContractInteraction
- waitForL1ToL2MessageReady
- isL1ToL2MessageReady
- getFeeJuiceBalance
- readFieldCompressedString
- waitForNode
- createAztecNodeClient
- AztecNode
- generatePublicKey
- Wallet
- AccountEntrypointMetaPaymentMethod
- AccountManager
- RequestDeployAccountOptions
- DeployAccountOptions
- SimulateDeployAccountOptions
- DeployAccountMethod
- Aliased
- SimulateOptions
- ProfileOptions
- SendOptions
- BatchableMethods
- BatchedMethod
- BatchedMethodResult
- BatchedMethodResultWrapper
- BatchResults
- PrivateEventFilter
- PrivateEvent
- Wallet
- FunctionCallSchema
- ExecutionPayloadSchema
- GasSettingsOptionSchema
- WalletSimulationFeeOptionSchema
- SendOptionsSchema
- SimulateOptionsSchema
- ProfileOptionsSchema
- MessageHashOrIntentSchema
- BatchedMethodSchema
- ContractMetadataSchema
- ContractClassMetadataSchema
- EventMetadataDefinitionSchema
- PrivateEventSchema
- PrivateEventFilterSchema
- WalletSchema
Account
account/account_contract.ts
AccountContract
Type: Interface
An account contract instance. Knows its artifact, deployment arguments, how to create transaction execution requests out of function calls, and how to authorize actions.
Methods
getContractArtifact
Returns the artifact of this account contract.
Signature:
getContractArtifact(): Promise<ContractArtifact>
Returns:
Promise<ContractArtifact>
getInitializationFunctionAndArgs
Returns the initializer function name and arguments for this instance, or undefined if this contract does not require initialization.
Signature:
getInitializationFunctionAndArgs(): Promise<{
constructorName: string;
constructorArgs: any[];
} | undefined>
Returns:
Promise<
| {
/** The name of the function used to initialize the contract */
constructorName: string;
/** The args to the function used to initialize the contract */
constructorArgs: any[];
}
| undefined
>
getInterface
Returns the account interface for this account contract given an instance at the provided address. The account interface is responsible for assembling tx requests given requested function calls, and for creating signed auth witnesses given action identifiers (message hashes).
Signature:
getInterface(
address: CompleteAddress,
chainInfo: ChainInfo
): AccountInterface
Parameters:
address:CompleteAddress- Address of this account contract.
chainInfo:ChainInfo- Chain id and version of the rollup where the account contract is initialized / published.
Returns:
AccountInterface - An account interface instance for creating tx requests and authorizing actions.
getAuthWitnessProvider
Returns the auth witness provider for the given address.
Signature:
getAuthWitnessProvider(address: CompleteAddress): AuthWitnessProvider
Parameters:
address:CompleteAddress- Address for which to create auth witnesses.
Returns:
AuthWitnessProvider
getAccountContractAddress
Type: Function
Compute the address of an account contract from secret and salt.
Signature:
export async getAccountContractAddress(
accountContract: AccountContract,
secret: Fr,
salt: Fr
)
Parameters:
accountContract:AccountContractsecret:Frsalt:Fr
Returns:
Promise<any>
account/account_with_secret_key.ts
AccountWithSecretKey
Type: Class
Extends Account with the encryption private key. Not required for implementing the wallet interface but useful for testing purposes or exporting an account to another pxe.
Extends: BaseAccount
Constructor
Signature:
constructor(
account: AccountInterface,
private secretKey: Fr,
public readonly salt: Salt
)
Parameters:
account:AccountInterfacesecretKey:Frsalt:Salt- Deployment salt for this account contract.
Methods
getSecretKey
Returns the encryption private key associated with this account.
Signature:
public getSecretKey()
Returns:
Fr
getEncryptionSecret
Returns the encryption secret, the secret of the encryption point—the point that others use to encrypt messages to this account note - this ensures that the address secret always corresponds to an address point with y being positive dev - this is also referred to as the address secret, which decrypts payloads encrypted to an address point
Signature:
public async getEncryptionSecret()
Returns:
Promise<any>
account/account.ts
Account
Type: Type Alias
A type defining an account, capable of both creating authwits and using them to authenticate transaction execution requests.
Signature:
export type Account = AccountInterface & AuthwitnessIntentProvider;
BaseAccount
Type: Class
An account implementation that uses authwits as an authentication mechanism and can assemble transaction execution requests for an entrypoint.
Implements: Account
Constructor
Signature:
constructor(protected account: AccountInterface)
Parameters:
account:AccountInterface
Methods
createTxExecutionRequest
Signature:
createTxExecutionRequest(
exec: ExecutionPayload,
gasSettings: GasSettings,
options: DefaultAccountEntrypointOptions
): Promise<TxExecutionRequest>
Parameters:
exec:ExecutionPayloadgasSettings:GasSettingsoptions:DefaultAccountEntrypointOptions
Returns:
Promise<TxExecutionRequest>
getChainId
Signature:
getChainId(): Fr
Returns:
Fr
getVersion
Signature:
getVersion(): Fr
Returns:
Fr
getCompleteAddress
Returns the complete address of the account that implements this wallet.
Signature:
public getCompleteAddress()
Returns:
CompleteAddress
getAddress
Returns the address of the account that implements this wallet.
Signature:
public getAddress()
Returns:
any
createAuthWit
Computes an authentication witness from either a message hash or an intent. If a message hash is provided, it will create a witness for the hash directly. Otherwise, it will compute the message hash using the intent, along with the chain id and the version values provided by the wallet.
Signature:
async createAuthWit(messageHashOrIntent: Fr | Buffer | CallIntent | IntentInnerHash): Promise<AuthWitness>
Parameters:
messageHashOrIntent:Fr | Buffer | CallIntent | IntentInnerHash- The message hash of the intent to approve
Returns:
Promise<AuthWitness> - The authentication witness
account/interface.ts
AccountInterface
Type: Interface
Handler for interfacing with an account. Knows how to create transaction execution requests and authorize actions for its corresponding account.
Extends: EntrypointInterface, AuthWitnessProvider
Methods
getCompleteAddress
Returns the complete address for this account.
Signature:
getCompleteAddress(): CompleteAddress
Returns:
CompleteAddress
getAddress
Returns the address for this account.
Signature:
getAddress(): AztecAddress
Returns:
AztecAddress
getChainId
Returns the chain id for this account
Signature:
getChainId(): Fr
Returns:
Fr
getVersion
Returns the rollup version for this account
Signature:
getVersion(): Fr
Returns:
Fr
account/signerless_account.ts
SignerlessAccount
Type: Class
Account implementation which creates a transaction using the multicall protocol contract as entrypoint.
Implements: Account
Constructor
Signature:
constructor(chainInfo: ChainInfo)
Parameters:
chainInfo:ChainInfo
Methods
createTxExecutionRequest
Signature:
createTxExecutionRequest(
exec: ExecutionPayload,
gasSettings: GasSettings
): Promise<TxExecutionRequest>
Parameters:
exec:ExecutionPayloadgasSettings:GasSettings
Returns:
Promise<TxExecutionRequest>
getChainId
Signature:
getChainId(): Fr
Returns:
Fr
getVersion
Signature:
getVersion(): Fr
Returns:
Fr
getCompleteAddress
Signature:
getCompleteAddress(): CompleteAddress
Returns:
CompleteAddress
getAddress
Signature:
getAddress(): AztecAddress
Returns:
AztecAddress
createAuthWit
Signature:
createAuthWit(_intent: Fr | Buffer | IntentInnerHash | CallIntent): Promise<AuthWitness>
Parameters:
_intent:Fr | Buffer | IntentInnerHash | CallIntent
Returns:
Promise<AuthWitness>
Authorization
authorization/call_authorization_request.ts
CallAuthorizationRequest
Type: Class
An authwit request for a function call. Includes the preimage of the data to be signed, as opposed of just the inner hash.
Constructor
Signature:
constructor(
public selector: AuthorizationSelector,
public innerHash: Fr,
public msgSender: AztecAddress,
public functionSelector: FunctionSelector,
public argsHash: Fr,
public args: Fr[]
)
Parameters:
selector:AuthorizationSelector- The selector of the authwit type, used to identify it when emitted from
emit_offchain_effectoracle. Computed as poseidon2("CallAuthwit((Field),(u32),Field)".to_bytes())
- The selector of the authwit type, used to identify it when emitted from
innerHash:Fr- The inner hash of the authwit, computed as poseidon2([msg_sender, selector, args_hash])
msgSender:AztecAddress- The address performing the call
functionSelector:FunctionSelector- The selector of the function that is to be authorized
argsHash:Fr- The hash of the arguments to the function call,
args:Fr[]- The arguments to the function call.
Methods
getSelector
Signature:
static getSelector(): Promise<AuthorizationSelector>
Returns:
Promise<AuthorizationSelector>
fromFields
Signature:
static async fromFields(fields: Fr[]): Promise<CallAuthorizationRequest>
Parameters:
fields:Fr[]
Returns:
Promise<CallAuthorizationRequest>
Contract
contract/base_contract_interaction.ts
BaseContractInteraction
Type: Class
Base class for an interaction with a contract, be it a deployment, a function call, or a batch. Implements the sequence create/simulate/send.
Constructor
Signature:
constructor(
protected wallet: Wallet,
protected authWitnesses: AuthWitness[] = [],
protected capsules: Capsule[] = []
)
Parameters:
wallet:WalletauthWitnesses(optional):AuthWitness[]capsules(optional):Capsule[]
Properties
log
Type: any
Methods
request
Returns an execution request that represents this operation. Can be used as a building block for constructing batch requests.
Signature:
public abstract request(options?: RequestInteractionOptions): Promise<ExecutionPayload>
Parameters:
options(optional):RequestInteractionOptions- An optional object containing additional configuration for the transaction.
Returns:
Promise<ExecutionPayload> - An execution request wrapped in promise.
send
Sends a transaction to the contract function with the specified options. This function throws an error if called on a utility function. It creates and signs the transaction if necessary, and returns a SentTx instance, which can be used to track the transaction status, receipt, and events.
Signature:
public send(options: SendInteractionOptions): SentTx
Parameters:
options:SendInteractionOptions- An object containing 'from' property representing the AztecAddress of the sender and optional fee configuration
Returns:
SentTx - A SentTx instance for tracking the transaction status and information.
contract/batch_call.ts
BatchCall
Type: Class
A batch of function calls to be sent as a single transaction through a wallet.
Extends: BaseContractInteraction
Constructor
Signature:
constructor(
wallet: Wallet,
protected interactions: (BaseContractInteraction | ExecutionPayload)[]
)
Parameters:
wallet:Walletinteractions:(BaseContractInteraction | ExecutionPayload)[]
Methods
request
Returns an execution request that represents this operation.
Signature:
public async request(options: RequestInteractionOptions = {}): Promise<ExecutionPayload>
Parameters:
options(optional):RequestInteractionOptions- An optional object containing additional configuration for the request generation.
Returns:
Promise<ExecutionPayload> - An execution payload wrapped in promise.
simulate
Simulates the batch, supporting private, public and utility functions. Although this is a single interaction with the wallet, private and public functions will be grouped into a single ExecutionPayload that the wallet will simulate as a single transaction. Utility function calls will simply be executed one by one.
Signature:
public async simulate(options: SimulateInteractionOptions): Promise<any>
Parameters:
options:SimulateInteractionOptions- An optional object containing additional configuration for the interaction.
Returns:
Promise<any> - The results of all the interactions that make up the batch
getExecutionPayloads
Signature:
protected async getExecutionPayloads(): Promise<ExecutionPayload[]>
Returns:
Promise<ExecutionPayload[]>
contract/checker.ts
abiChecker
Type: Function
Validates the given ContractArtifact object by checking its functions and their parameters. Ensures that the ABI has at least one function, a constructor, valid bytecode, and correct parameter types. Throws an error if any inconsistency is detected during the validation process.
Signature:
export abiChecker(artifact: ContractArtifact)
Parameters:
artifact:ContractArtifact- The ContractArtifact object to be validated.
Returns:
boolean - A boolean value indicating whether the artifact is valid or not.
contract/contract_base.ts
ContractMethod
Type: Type Alias
Type representing a contract method that returns a ContractFunctionInteraction instance and has a readonly 'selector' property of type Buffer. Takes any number of arguments.
Signature:
export type ContractMethod = ((...args: any[]) => ContractFunctionInteraction) & {
selector: () => Promise<FunctionSelector>;
};
Type Members:
selector
The unique identifier for a contract function in bytecode.
Type: () => Promise<FunctionSelector>
ContractStorageLayout
Type: Type Alias
Type representing the storage layout of a contract.
Signature:
export type ContractStorageLayout<T extends string> = {
[K in T]: FieldLayout;
};
Type Members:
[K in T]
Signature: [K in T]: FieldLayout
Key Type: T
Value Type: FieldLayout
ContractBase
Type: Class
Abstract implementation of a contract extended by the Contract class and generated contract types.
Constructor
Signature:
protected constructor(
public readonly address: AztecAddress,
public readonly artifact: ContractArtifact,
public wallet: Wallet
)
Parameters:
address:AztecAddress- The contract's address.
artifact:ContractArtifact- The Application Binary Interface for the contract.
wallet:Wallet- The wallet used for interacting with this contract.
Properties
methods
An object containing contract methods mapped to their respective names.
Type: { [name: string]: ContractMethod }
Methods
withWallet
Creates a new instance of the contract wrapper attached to a different wallet.
Signature:
public withWallet(wallet: Wallet): this
Parameters:
wallet:Wallet- Wallet to use for sending txs.
Returns:
this - A new contract instance.
contract/contract_function_interaction.ts
ContractFunctionInteraction
Type: Class
This is the class that is returned when calling e.g. contract.methods.myMethod(arg0, arg1). It contains available interactions one can call on a method, including view.
Extends: BaseContractInteraction
Constructor
Signature:
constructor(
wallet: Wallet,
protected contractAddress: AztecAddress,
protected functionDao: FunctionAbi,
protected args: any[],
authWitnesses: AuthWitness[] = [],
capsules: Capsule[] = [],
private extraHashedArgs: HashedValues[] = []
)
Parameters:
wallet:WalletcontractAddress:AztecAddressfunctionDao:FunctionAbiargs:any[]authWitnesses(optional):AuthWitness[]capsules(optional):Capsule[]extraHashedArgs(optional):HashedValues[]
Methods
getFunctionCall
Returns the encoded function call wrapped by this interaction Useful when generating authwits
Signature:
public async getFunctionCall()
Returns:
Promise<{ name: any; args: any; selector: any; type: any; to: AztecAddress; isStatic: any; hideMsgSender: boolean; returnTypes: any; }> - An encoded function call
request
Returns the execution payload that allows this operation to happen on chain.
Signature:
public override async request(options: RequestInteractionOptions = {}): Promise<ExecutionPayload>
Parameters:
options(optional):RequestInteractionOptions- Configuration options.
Returns:
Promise<ExecutionPayload> - The execution payload for this operation
simulate
Simulate a transaction and get information from its execution. Differs from prove in a few important ways: 1. It returns the values of the function execution, plus additional metadata if requested 2. It supports utility, private and public functions
Signature:
public async simulate<T extends SimulateInteractionOptions>(options: T): Promise<SimulationReturn<Exclude<T['fee'], undefined>['estimateGas']>>
Parameters:
options:T- An optional object containing additional configuration for the simulation.
Returns:
Promise<SimulationReturn<Exclude<T['fee'], undefined>['estimateGas']>> - Depending on the simulation options, this method directly returns the result value of the executed function or a rich object containing extra metadata, such as estimated gas costs (if requested via options), execution statistics and emitted offchain effects
simulate
Signature:
public async simulate<T extends SimulateInteractionOptions>(options: T): Promise<SimulationReturn<T['includeMetadata']>>
Parameters:
options:T
Returns:
Promise<SimulationReturn<T['includeMetadata']>>
simulate
Signature:
public async simulate(options: SimulateInteractionOptions): Promise<SimulationReturn<typeof options.includeMetadata>>
Parameters:
options:SimulateInteractionOptions
Returns:
Promise<SimulationReturn<typeof options.includeMetadata>>
profile
Simulate a transaction and profile the gate count for each function in the transaction.
Signature:
public async profile(options: ProfileInteractionOptions): Promise<TxProfileResult>
Parameters:
options:ProfileInteractionOptions- Same options as
simulate, plus profiling method
- Same options as
Returns:
Promise<TxProfileResult> - An object containing the function return value and profile result.
with
Augments this ContractFunctionInteraction with additional metadata, such as authWitnesses, capsules, and extraHashedArgs. This is useful when creating a "batteries included" interaction, such as registering a contract class with its associated capsule instead of having the user provide them externally.
Signature:
public with({ authWitnesses = [], capsules = [], extraHashedArgs = [], }: {
authWitnesses?: AuthWitness[];
capsules?: Capsule[];
extraHashedArgs?: HashedValues[];
}): ContractFunctionInteraction
Parameters:
{ authWitnesses = [], capsules = [], extraHashedArgs = [], }:{ /** The authWitnesses to add to the interaction */ authWitnesses?: AuthWitness[]; /** The capsules to add to the interaction */ capsules?: Capsule[]; /** The extra hashed args to add to the interaction */ extraHashedArgs?: HashedValues[]; }
Returns:
ContractFunctionInteraction - A new ContractFunctionInteraction with the added metadata, but calling the same original function in the same manner
contract/contract.ts
Contract
Type: Class
The Contract class represents a contract and provides utility methods for interacting with it. It enables the creation of ContractFunctionInteraction instances for each function in the contract's ABI, allowing users to call or send transactions to these functions. Additionally, the Contract class can be used to attach the contract instance to a deployed contract onchain through the PXE, which facilitates interaction with Aztec's privacy protocol.
Extends: ContractBase
Methods
at
Gets a contract instance.
Signature:
public static at(
address: AztecAddress,
artifact: ContractArtifact,
wallet: Wallet
): Contract
Parameters:
address:AztecAddress- The address of the contract instance.
artifact:ContractArtifact- Build artifact of the contract.
wallet:Wallet- The wallet to use when interacting with the contract.
Returns:
Contract - A promise that resolves to a new Contract instance.
deploy
Creates a tx to deploy (initialize and/or publish) a new instance of a contract.
Signature:
public static deploy(
wallet: Wallet,
artifact: ContractArtifact,
args: any[],
constructorName?: string
)
Parameters:
wallet:Wallet- The wallet for executing the deployment.
artifact:ContractArtifact- Build artifact of the contract to deploy
args:any[]- Arguments for the constructor.
constructorName(optional):string- The name of the constructor function to call.
Returns:
DeployMethod<Contract>
deployWithPublicKeys
Creates a tx to deploy (initialize and/or publish) a new instance of a contract using the specified public keys hash to derive the address.
Signature:
public static deployWithPublicKeys(
publicKeys: PublicKeys,
wallet: Wallet,
artifact: ContractArtifact,
args: any[],
constructorName?: string
)
Parameters:
publicKeys:PublicKeys- Hash of public keys to use for deriving the address.
wallet:Wallet- The wallet for executing the deployment.
artifact:ContractArtifact- Build artifact of the contract.
args:any[]- Arguments for the constructor.
constructorName(optional):string- The name of the constructor function to call.
Returns:
DeployMethod<Contract>
contract/deploy_method.ts
RequestDeployOptions
Type: Type Alias
Options for deploying a contract on the Aztec network. Allows specifying a contract address salt and different options to tweak contract publication and initialization
Signature:
export type RequestDeployOptions = RequestInteractionOptions & {
contractAddressSalt?: Fr;
deployer?: AztecAddress;
skipClassPublication?: boolean;
skipInstancePublication?: boolean;
skipInitialization?: boolean;
skipRegistration?: boolean;
};
Type Members:
contractAddressSalt
An optional salt value used to deterministically calculate the contract address.
Type: Fr
deployer
Deployer address that will be used for the deployed contract's address computation. If set to 0, the sender's address won't be mixed in
Type: AztecAddress
skipClassPublication
Skip contract class publication.
Type: boolean
skipInstancePublication
Skip publication, instead just privately initialize the contract.
Type: boolean
skipInitialization
Skip contract initialization.
Type: boolean
skipRegistration
Skip contract registration in the wallet
Type: boolean
DeployOptions
Type: Type Alias
Extends the deployment options with the required parameters to send the transaction
Signature:
export type DeployOptions = Omit<RequestDeployOptions, 'deployer'> & {
universalDeploy?: boolean;
} & Pick<SendInteractionOptions, 'from' | 'fee'>;
Type Members:
universalDeploy
Set to true to not include the sender in the address computation. This option is mutually exclusive with "deployer"
Type: boolean
SimulateDeployOptions
Type: Type Alias
Options for simulating the deployment of a contract Allows skipping certain validations and computing gas estimations
Signature:
export type SimulateDeployOptions = Omit<DeployOptions, 'fee'> & {
fee?: SimulationInteractionFeeOptions;
skipTxValidation?: boolean;
skipFeeEnforcement?: boolean;
includeMetadata?: boolean;
};
Type Members:
fee
The fee options for the transaction.
Type: SimulationInteractionFeeOptions
skipTxValidation
Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers.
Type: boolean
skipFeeEnforcement
Whether to ensure the fee payer is not empty and has enough balance to pay for the fee.
Type: boolean
includeMetadata
Whether to include metadata such as offchain effects and performance statistics (e.g. timing information of the different circuits and oracles) in the simulation result, instead of just the return value of the function
Type: boolean
DeployMethod
Type: Class
Contract interaction for deployment. Handles class publication, instance publication, and initialization of the contract. Note that for some contracts, a tx is not required as part of its "creation": If there are no public functions, and if there are no initialization functions, then technically the contract has already been "created", and all of the contract's functions (private and utility) can be interacted-with immediately, without any "deployment tx". Extends the BaseContractInteraction class.
Extends: BaseContractInteraction
Constructor
Signature:
constructor(
private publicKeys: PublicKeys,
wallet: Wallet,
protected artifact: ContractArtifact,
protected postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract,
private args: any[] = [],
constructorNameOrArtifact?: string | FunctionArtifact,
authWitnesses: AuthWitness[] = [],
capsules: Capsule[] = []
)
Parameters:
publicKeys:PublicKeyswallet:Walletartifact:ContractArtifactpostDeployCtor:(instance: ContractInstanceWithAddress, wallet: Wallet) => TContractargs(optional):any[]constructorNameOrArtifact(optional):string | FunctionArtifactauthWitnesses(optional):AuthWitness[]capsules(optional):Capsule[]
Methods
request
Returns the execution payload that allows this operation to happen on chain.
Signature:
public async request(options?: RequestDeployOptions): Promise<ExecutionPayload>
Parameters:
options(optional):RequestDeployOptions- Configuration options.
Returns:
Promise<ExecutionPayload> - The execution payload for this operation
convertDeployOptionsToRequestOptions
Signature:
convertDeployOptionsToRequestOptions(options: DeployOptions): RequestDeployOptions
Parameters:
options:DeployOptions
Returns:
RequestDeployOptions
register
Adds this contract to the wallet and returns the Contract object.
Signature:
public async register(options?: RequestDeployOptions): Promise<TContract>
Parameters:
options(optional):RequestDeployOptions- Deployment options.
Returns:
Promise<TContract>
getPublicationExecutionPayload
Returns an execution payload for: - publication of the contract class and - publication of the contract instance to enable public execution depending on the provided options.
Signature:
protected async getPublicationExecutionPayload(options?: RequestDeployOptions): Promise<ExecutionPayload>
Parameters:
options(optional):RequestDeployOptions- Contract creation options.
Returns:
Promise<ExecutionPayload> - An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.
getInitializationExecutionPayload
Returns the calls necessary to initialize the contract.
Signature:
protected async getInitializationExecutionPayload(options?: RequestDeployOptions): Promise<ExecutionPayload>
Parameters:
options(optional):RequestDeployOptions- Deployment options.
Returns:
Promise<ExecutionPayload> - An array of function calls.
send
Send a contract deployment transaction (initialize and/or publish) using the provided options. This function extends the 'send' method from the ContractFunctionInteraction class, allowing us to send a transaction specifically for contract deployment.
Signature:
public override send(options: DeployOptions): DeploySentTx<TContract>
Parameters:
options:DeployOptions- An object containing various deployment options such as contractAddressSalt and from.
Returns:
DeploySentTx<TContract> - A SentTx object that returns the receipt and the deployed contract instance.
getInstance
Builds the contract instance and returns it.
Signature:
public async getInstance(options?: RequestDeployOptions): Promise<ContractInstanceWithAddress>
Parameters:
options(optional):RequestDeployOptions- An object containing various initialization and publication options.
Returns:
Promise<ContractInstanceWithAddress> - An instance object.
simulate
Simulate the deployment
Signature:
public async simulate(options: SimulateDeployOptions): Promise<SimulationReturn<true>>
Parameters:
options:SimulateDeployOptions- An optional object containing additional configuration for the simulation.
Returns:
Promise<SimulationReturn<true>> - A simulation result object containing metadata of the execution, including gas estimations (if requested via options), execution statistics and emitted offchain effects
profile
Simulate a deployment and profile the gate count for each function in the transaction.
Signature:
public async profile(options: DeployOptions & ProfileInteractionOptions): Promise<TxProfileResult>
Parameters:
options:DeployOptions & ProfileInteractionOptions- Same options as
send, plus extra profiling options.
- Same options as
Returns:
Promise<TxProfileResult> - An object containing the function return value and profile result.
with
Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.
Signature:
public with({ authWitnesses = [], capsules = [], }: {
authWitnesses?: AuthWitness[];
capsules?: Capsule[];
}): DeployMethod
Parameters:
{ authWitnesses = [], capsules = [], }:{ /** The authWitnesses to add to the deployment */ authWitnesses?: AuthWitness[]; /** The capsules to add to the deployment */ capsules?: Capsule[]; }
Returns:
DeployMethod - A new DeployMethod with the added metadata, but calling the same original function in the same manner
Getters
address (getter)
Return this deployment address.
Signature:
public get address() {
Returns: any
partialAddress (getter)
Returns the partial address for this deployment.
Signature:
public get partialAddress() {
Returns: any
contract/deploy_sent_tx.ts
DeployedWaitOpts
Type: Type Alias
Options related to waiting for a deployment tx.
Signature:
export type DeployedWaitOpts = WaitOpts & {
wallet?: Wallet;
};
Type Members:
wallet
Wallet to use for creating a contract instance. Uses the one set in the deployer constructor if not set.
Type: Wallet
DeployTxReceipt
Type: Type Alias
Extends a transaction receipt with a contract instance that represents the newly deployed contract.
Signature:
export type DeployTxReceipt<TContract extends ContractBase = ContractBase> = FieldsOf<TxReceipt> & {
contract: TContract;
instance: ContractInstanceWithAddress;
};
Type Members:
contract
Instance of the newly deployed contract.
Type: TContract
instance
The deployed contract instance with address and metadata.
Type: ContractInstanceWithAddress
DeploySentTx
Type: Class
A contract deployment transaction sent to the network, extending SentTx with methods to publish a contract instance.
Extends: SentTx
Constructor
Signature:
constructor(
wallet: Wallet,
sendTx: () => Promise<TxHash>,
private postDeployCtor: (instance: ContractInstanceWithAddress, wallet: Wallet) => TContract,
private instanceGetter: () => Promise<ContractInstanceWithAddress>
)
Parameters:
wallet:WalletsendTx:() => Promise<TxHash>postDeployCtor:(instance: ContractInstanceWithAddress, wallet: Wallet) => TContractinstanceGetter:() => Promise<ContractInstanceWithAddress>- A getter for the deployed contract instance
Methods
getInstance
Returns the contract instance for this deployment.
Signature:
public async getInstance(): Promise<ContractInstanceWithAddress>
Returns:
Promise<ContractInstanceWithAddress> - The deployed contract instance with address and metadata.
deployed
Awaits for the tx to be mined and returns the contract instance. Throws if tx is not mined.
Signature:
public async deployed(opts?: DeployedWaitOpts): Promise<TContract>
Parameters:
opts(optional):DeployedWaitOpts- Options for configuring the waiting for the tx to be mined.
Returns:
Promise<TContract> - The deployed contract instance.
wait
Awaits for the tx to be mined and returns the receipt along with a contract instance. Throws if tx is not mined.
Signature:
public override async wait(opts?: DeployedWaitOpts): Promise<DeployTxReceipt<TContract>>
Parameters:
opts(optional):DeployedWaitOpts- Options for configuring the waiting for the tx to be mined.
Returns:
Promise<DeployTxReceipt<TContract>> - The transaction receipt with the deployed contract instance.
contract/get_gas_limits.ts
getGasLimits
Type: Function
Returns suggested total and teardown gas limits for a simulated tx.
Signature:
export getGasLimits(
simulationResult: TxSimulationResult,
pad = 0.1
): {
gasLimits: Gas;
teardownGasLimits: Gas;
}
Parameters:
simulationResult:TxSimulationResultpad(optional):any- Percentage to pad the suggested gas limits by, (as decimal, e.g., 0.10 for 10%).
Returns:
{
/**
* Gas limit for the tx, excluding teardown gas
*/
gasLimits: Gas;
/**
* Gas limit for the teardown phase
*/
teardownGasLimits: Gas;
}
contract/interaction_options.ts
FeeEstimationOptions
Type: Type Alias
Options used to tweak the simulation and add gas estimation capabilities
Signature:
export type FeeEstimationOptions = {
estimateGas?: boolean;
estimatedGasPadding?: number;
};
Type Members:
estimateGas
Whether to modify the fee settings of the simulation with high gas limit to figure out actual gas settings.
Type: boolean