Skip to main content
Version: v3.0.0-nightly.20251114

Aztec.js API Reference (TypeDoc)

This documentation is auto-generated from the Aztec.js TypeScript source code using TypeDoc.

info

This is an auto-generated reference using TypeDoc. For tutorials and guides, see the Aztec.js Guide.

Package: @aztec/aztec.js

Generated: 2025-11-05T19:31:53.805Z

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 / Account

account/account

Classes

Type Aliases


BaseAccount

Defined in: account/account.ts:34

An account implementation that uses authwits as an authentication mechanism and can assemble transaction execution requests for an entrypoint.

Extended by
Implements
Constructors
Constructor

new BaseAccount(account): BaseAccount

Defined in: account/account.ts:35

Parameters
account

AccountInterface

Returns

BaseAccount

Properties
account

protected account: AccountInterface

Defined in: account/account.ts:35

Methods
createTxExecutionRequest()

createTxExecutionRequest(exec, gasSettings, options): Promise<TxExecutionRequest>

Defined in: account/account.ts:37

Parameters
exec

ExecutionPayload

gasSettings

GasSettings

options

DefaultAccountEntrypointOptions

Returns

Promise<TxExecutionRequest>


getChainId()

getChainId(): Fr

Defined in: account/account.ts:45

Returns the chain id for this account

Returns

Fr

Implementation of

Account.getChainId


getVersion()

getVersion(): Fr

Defined in: account/account.ts:49

Returns the rollup version for this account

Returns

Fr

Implementation of

Account.getVersion


getCompleteAddress()

getCompleteAddress(): CompleteAddress

Defined in: account/account.ts:54

Returns the complete address of the account that implements this wallet.

Returns

CompleteAddress

Implementation of

Account.getCompleteAddress


getAddress()

getAddress(): any

Defined in: account/account.ts:59

Returns the address of the account that implements this wallet.

Returns

any

Implementation of

Account.getAddress


createAuthWit()

createAuthWit(messageHashOrIntent): Promise<AuthWitness>

Defined in: account/account.ts:73

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.

Parameters
messageHashOrIntent

any

The message hash of the intent to approve

Returns

Promise<AuthWitness>

The authentication witness

Implementation of

Account.createAuthWit

Account

Account = AccountInterface & AuthwitnessIntentProvider

Defined in: account/account.ts:28

A type defining an account, capable of both creating authwits and using them to authenticate transaction execution requests.

Account / Account contract

account/account_contract

Interfaces

Functions


getAccountContractAddress()

getAccountContractAddress(accountContract, secret, salt): Promise<any>

Defined in: account/account_contract.ts:53

Compute the address of an account contract from secret and salt.

Parameters
accountContract

AccountContract

secret

Fr

salt

Fr

Returns

Promise<any>

AccountContract

Defined in: account/account_contract.ts:14

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()

getContractArtifact(): Promise<ContractArtifact>

Defined in: account/account_contract.ts:18

Returns the artifact of this account contract.

Returns

Promise<ContractArtifact>


getInitializationFunctionAndArgs()

getInitializationFunctionAndArgs(): Promise<{ constructorName: string; constructorArgs: any[]; } | undefined>

Defined in: account/account_contract.ts:23

Returns the initializer function name and arguments for this instance, or undefined if this contract does not require initialization.

Returns

Promise<{ constructorName: string; constructorArgs: any[]; } | undefined>


getInterface()

getInterface(address, chainInfo): AccountInterface

Defined in: account/account_contract.ts:41

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).

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()

getAuthWitnessProvider(address): AuthWitnessProvider

Defined in: account/account_contract.ts:47

Returns the auth witness provider for the given address.

Parameters
address

CompleteAddress

Address for which to create auth witnesses.

Returns

AuthWitnessProvider

Account / Account with secret key

account/account_with_secret_key

Classes


AccountWithSecretKey

Defined in: account/account_with_secret_key.ts:13

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
Constructors
Constructor

new AccountWithSecretKey(account, secretKey, salt): AccountWithSecretKey

Defined in: account/account_with_secret_key.ts:14

Parameters
account

AccountInterface

secretKey

Fr

salt

any

Deployment salt for this account contract.

Returns

AccountWithSecretKey

Overrides

BaseAccount.constructor

Properties
account

protected account: AccountInterface

Defined in: account/account.ts:35

Inherited from

BaseAccount.account


salt

readonly salt: any

Defined in: account/account_with_secret_key.ts:18

Deployment salt for this account contract.

Methods
createTxExecutionRequest()

createTxExecutionRequest(exec, gasSettings, options): Promise<TxExecutionRequest>

Defined in: account/account.ts:37

Parameters
exec

ExecutionPayload

gasSettings

GasSettings

options

DefaultAccountEntrypointOptions

Returns

Promise<TxExecutionRequest>

Inherited from

BaseAccount.createTxExecutionRequest


getChainId()

getChainId(): Fr

Defined in: account/account.ts:45

Returns the chain id for this account

Returns

Fr

Inherited from

BaseAccount.getChainId


getVersion()

getVersion(): Fr

Defined in: account/account.ts:49

Returns the rollup version for this account

Returns

Fr

Inherited from

BaseAccount.getVersion


getCompleteAddress()

getCompleteAddress(): CompleteAddress

Defined in: account/account.ts:54

Returns the complete address of the account that implements this wallet.

Returns

CompleteAddress

Inherited from

BaseAccount.getCompleteAddress


getAddress()

getAddress(): any

Defined in: account/account.ts:59

Returns the address of the account that implements this wallet.

Returns

any

Inherited from

BaseAccount.getAddress


createAuthWit()

createAuthWit(messageHashOrIntent): Promise<AuthWitness>

Defined in: account/account.ts:73

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.

Parameters
messageHashOrIntent

any

The message hash of the intent to approve

Returns

Promise<AuthWitness>

The authentication witness

Inherited from

BaseAccount.createAuthWit


getSecretKey()

getSecretKey(): Fr

Defined in: account/account_with_secret_key.ts:24

Returns the encryption private key associated with this account.

Returns

Fr


getEncryptionSecret()

getEncryptionSecret(): Promise<any>

Defined in: account/account_with_secret_key.ts:32

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

Returns

Promise<any>

Account / Interface

account/interface

Interfaces


AccountInterface

Defined in: account/interface.ts:12

Handler for interfacing with an account. Knows how to create transaction execution requests and authorize actions for its corresponding account.

Extends
Methods
getCompleteAddress()

getCompleteAddress(): CompleteAddress

Defined in: account/interface.ts:14

Returns the complete address for this account.

Returns

CompleteAddress


getAddress()

getAddress(): AztecAddress

Defined in: account/interface.ts:17

Returns the address for this account.

Returns

AztecAddress


getChainId()

getChainId(): Fr

Defined in: account/interface.ts:20

Returns the chain id for this account

Returns

Fr


getVersion()

getVersion(): Fr

Defined in: account/interface.ts:23

Returns the rollup version for this account

Returns

Fr

Account / Signerless account

account/signerless_account

Classes


SignerlessAccount

Defined in: account/signerless_account.ts:17

Account implementation which creates a transaction using the multicall protocol contract as entrypoint.

Implements
Constructors
Constructor

new SignerlessAccount(chainInfo): SignerlessAccount

Defined in: account/signerless_account.ts:19

Parameters
chainInfo

ChainInfo

Returns

SignerlessAccount

Methods
createTxExecutionRequest()

createTxExecutionRequest(exec, gasSettings): Promise<TxExecutionRequest>

Defined in: account/signerless_account.ts:23

Parameters
exec

ExecutionPayload

gasSettings

GasSettings

Returns

Promise<TxExecutionRequest>


getChainId()

getChainId(): Fr

Defined in: account/signerless_account.ts:27

Returns the chain id for this account

Returns

Fr

Implementation of

Account.getChainId


getVersion()

getVersion(): Fr

Defined in: account/signerless_account.ts:31

Returns the rollup version for this account

Returns

Fr

Implementation of

Account.getVersion


getCompleteAddress()

getCompleteAddress(): CompleteAddress

Defined in: account/signerless_account.ts:35

Returns the complete address for this account.

Returns

CompleteAddress

Implementation of

Account.getCompleteAddress


getAddress()

getAddress(): AztecAddress

Defined in: account/signerless_account.ts:39

Returns the address for this account.

Returns

AztecAddress

Implementation of

Account.getAddress


createAuthWit()

createAuthWit(_intent): Promise<AuthWitness>

Defined in: account/signerless_account.ts:43

Creates a private authwit from an intent or inner hash, to be provided during function execution

Parameters
_intent

any

Returns

Promise<AuthWitness>

Implementation of

Account.createAuthWit

Authorization / Call authorization request

authorization/call_authorization_request

Classes


CallAuthorizationRequest

Defined in: authorization/call_authorization_request.ts:10

An authwit request for a function call. Includes the preimage of the data to be signed, as opposed of just the inner hash.

Constructors
Constructor

new CallAuthorizationRequest(selector, innerHash, msgSender, functionSelector, argsHash, args): CallAuthorizationRequest

Defined in: authorization/call_authorization_request.ts:11

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())

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.

Returns

CallAuthorizationRequest

Properties
selector

selector: AuthorizationSelector

Defined in: authorization/call_authorization_request.ts:17

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())


innerHash

innerHash: Fr

Defined in: authorization/call_authorization_request.ts:22

The inner hash of the authwit, computed as poseidon2([msg_sender, selector, args_hash])


msgSender

msgSender: AztecAddress

Defined in: authorization/call_authorization_request.ts:26

The address performing the call


functionSelector

functionSelector: FunctionSelector

Defined in: authorization/call_authorization_request.ts:30

The selector of the function that is to be authorized


argsHash

argsHash: Fr

Defined in: authorization/call_authorization_request.ts:34

The hash of the arguments to the function call,


args

args: Fr[]

Defined in: authorization/call_authorization_request.ts:38

The arguments to the function call.

Methods
getSelector()

static getSelector(): Promise<AuthorizationSelector>

Defined in: authorization/call_authorization_request.ts:41

Returns

Promise<AuthorizationSelector>


fromFields()

static fromFields(fields): Promise<CallAuthorizationRequest>

Defined in: authorization/call_authorization_request.ts:45

Parameters
fields

Fr[]

Returns

Promise<CallAuthorizationRequest>

Contract / Base contract interaction

contract/base_contract_interaction

Classes


BaseContractInteraction

Defined in: contract/base_contract_interaction.ts:14

Base class for an interaction with a contract, be it a deployment, a function call, or a batch. Implements the sequence create/simulate/send.

Extended by
Constructors
Constructor

new BaseContractInteraction(wallet, authWitnesses, capsules): BaseContractInteraction

Defined in: contract/base_contract_interaction.ts:17

Parameters
wallet

Wallet

authWitnesses

AuthWitness[] = []

capsules

Capsule[] = []

Returns

BaseContractInteraction

Properties
log

protected log: any

Defined in: contract/base_contract_interaction.ts:15


wallet

protected wallet: Wallet

Defined in: contract/base_contract_interaction.ts:18


authWitnesses

protected authWitnesses: AuthWitness[] = []

Defined in: contract/base_contract_interaction.ts:19


capsules

protected capsules: Capsule[] = []

Defined in: contract/base_contract_interaction.ts:20

Methods
request()

abstract request(options?): Promise<ExecutionPayload>

Defined in: contract/base_contract_interaction.ts:29

Returns an execution request that represents this operation. Can be used as a building block for constructing batch requests.

Parameters
options?

RequestInteractionOptions

An optional object containing additional configuration for the transaction.

Returns

Promise<ExecutionPayload>

An execution request wrapped in promise.


send()

send(options): SentTx

Defined in: contract/base_contract_interaction.ts:41

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.

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

contract/batch_call

Classes


BatchCall

Defined in: contract/batch_call.ts:13

A batch of function calls to be sent as a single transaction through a wallet.

Extends
Constructors
Constructor

new BatchCall(wallet, interactions): BatchCall

Defined in: contract/batch_call.ts:14

Parameters
wallet

Wallet

interactions

any[]

Returns

BatchCall

Overrides

BaseContractInteraction.constructor

Properties
log

protected log: any

Defined in: contract/base_contract_interaction.ts:15

Inherited from

BaseContractInteraction.log


wallet

protected wallet: Wallet

Defined in: contract/base_contract_interaction.ts:18

Inherited from

BaseContractInteraction.wallet


authWitnesses

protected authWitnesses: AuthWitness[] = []

Defined in: contract/base_contract_interaction.ts:19

Inherited from

BaseContractInteraction.authWitnesses


capsules

protected capsules: Capsule[] = []

Defined in: contract/base_contract_interaction.ts:20

Inherited from

BaseContractInteraction.capsules


interactions

protected interactions: any[]

Defined in: contract/batch_call.ts:16

Methods
send()

send(options): SentTx

Defined in: contract/base_contract_interaction.ts:41

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.

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.

Inherited from

BaseContractInteraction.send


request()

request(options): Promise<ExecutionPayload>

Defined in: contract/batch_call.ts:26

Returns an execution request that represents this operation.

Parameters
options

RequestInteractionOptions = {}

An optional object containing additional configuration for the request generation.

Returns

Promise<ExecutionPayload>

An execution payload wrapped in promise.

Overrides

BaseContractInteraction.request


simulate()

simulate(options): Promise<any>

Defined in: contract/batch_call.ts:46

Simulate a transaction and get its return values Differs from prove in a few important ways:

  1. It returns the values of the function execution
  2. It supports utility, private and public functions
Parameters
options

SimulateInteractionOptions

An optional object containing additional configuration for the transaction.

Returns

Promise<any>

The result of the transaction as returned by the contract function.


getExecutionPayloads()

protected getExecutionPayloads(): Promise<ExecutionPayload[]>

Defined in: contract/batch_call.ts:124

Returns

Promise<ExecutionPayload[]>

Contract / Checker

contract/checker

Functions


abiChecker()

abiChecker(artifact): boolean

Defined in: contract/checker.ts:23

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.

Parameters
artifact

ContractArtifact

The ContractArtifact object to be validated.

Returns

boolean

A boolean value indicating whether the artifact is valid or not.

Contract / Contract

contract/contract

Classes


Contract

Defined in: contract/contract.ts:16

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
Constructors
Constructor

protected new Contract(instance, artifact, wallet): Contract

Defined in: contract/contract_base.ts:40

Parameters
instance

ContractInstanceWithAddress

The deployed contract instance definition.

artifact

ContractArtifact

The Application Binary Interface for the contract.

wallet

Wallet

The wallet used for interacting with this contract.

Returns

Contract

Inherited from

ContractBase.constructor

Properties
methods

methods: object = {}

Defined in: contract/contract_base.ts:38

An object containing contract methods mapped to their respective names.

Index Signature

[name: string]: ContractMethod

Inherited from

ContractBase.methods


instance

readonly instance: ContractInstanceWithAddress

Defined in: contract/contract_base.ts:42

The deployed contract instance definition.

Inherited from

ContractBase.instance


artifact

readonly artifact: ContractArtifact

Defined in: contract/contract_base.ts:44

The Application Binary Interface for the contract.

Inherited from

ContractBase.artifact


wallet

wallet: Wallet

Defined in: contract/contract_base.ts:46

The wallet used for interacting with this contract.

Inherited from

ContractBase.wallet

Accessors
address
Get Signature

get address(): any

Defined in: contract/contract_base.ts:66

Address of the contract.

Returns

any

Inherited from

ContractBase.address


partialAddress
Get Signature

get partialAddress(): any

Defined in: contract/contract_base.ts:71

Partial address of the contract.

Returns

any

Inherited from

ContractBase.partialAddress

Methods
at()

static at(address, artifact, wallet): Promise<Contract>

Defined in: contract/contract.ts:24

Gets a contract instance.

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

Promise<Contract>

A promise that resolves to a new Contract instance.


deploy()

static deploy(wallet, artifact, args, constructorName?): DeployMethod<Contract>

Defined in: contract/contract.ts:36

Creates a tx to deploy (initialize and/or publish) a new instance of a contract.

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?

string

The name of the constructor function to call.

Returns

DeployMethod<Contract>


deployWithPublicKeys()

static deployWithPublicKeys(publicKeys, wallet, artifact, args, constructorName?): DeployMethod<Contract>

Defined in: contract/contract.ts:50

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.

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?

string

The name of the constructor function to call.

Returns

DeployMethod<Contract>


withWallet()

withWallet(wallet): this

Defined in: contract/contract_base.ts:80

Creates a new instance of the contract wrapper attached to a different wallet.

Parameters
wallet

Wallet

Wallet to use for sending txs.

Returns

this

A new contract instance.

Inherited from

ContractBase.withWallet

Contract / Contract base

contract/contract_base

Classes

Type Aliases


ContractBase

Defined in: contract/contract_base.ts:34

Abstract implementation of a contract extended by the Contract class and generated contract types.

Extended by
Constructors
Constructor

protected new ContractBase(instance, artifact, wallet): ContractBase

Defined in: contract/contract_base.ts:40

Parameters
instance

ContractInstanceWithAddress

The deployed contract instance definition.

artifact

ContractArtifact

The Application Binary Interface for the contract.

wallet

Wallet

The wallet used for interacting with this contract.

Returns

ContractBase

Properties
methods

methods: object = {}

Defined in: contract/contract_base.ts:38

An object containing contract methods mapped to their respective names.

Index Signature

[name: string]: ContractMethod


instance

readonly instance: ContractInstanceWithAddress

Defined in: contract/contract_base.ts:42

The deployed contract instance definition.


artifact

readonly artifact: ContractArtifact

Defined in: contract/contract_base.ts:44

The Application Binary Interface for the contract.


wallet

wallet: Wallet

Defined in: contract/contract_base.ts:46

The wallet used for interacting with this contract.

Accessors
address
Get Signature

get address(): any

Defined in: contract/contract_base.ts:66

Address of the contract.

Returns

any


partialAddress
Get Signature

get partialAddress(): any

Defined in: contract/contract_base.ts:71

Partial address of the contract.

Returns

any

Methods
withWallet()

withWallet(wallet): this

Defined in: contract/contract_base.ts:80

Creates a new instance of the contract wrapper attached to a different wallet.

Parameters
wallet

Wallet

Wallet to use for sending txs.

Returns

this

A new contract instance.

ContractMethod

ContractMethod = (...args) => ContractFunctionInteraction & object

Defined in: contract/contract_base.ts:17

Type representing a contract method that returns a ContractFunctionInteraction instance and has a readonly 'selector' property of type Buffer. Takes any number of arguments.

Type Declaration
selector()

selector: () => Promise<createAztecNodeClient>

The unique identifier for a contract function in bytecode.

Returns

Promise<createAztecNodeClient>

ContractStorageLayout<T>

ContractStorageLayout<T> = { [K in T]: createAztecNodeClient }

Defined in: contract/contract_base.ts:27

Type representing the storage layout of a contract.

Type Parameters
T

T extends string

Contract / Contract function interaction

contract/contract_function_interaction

Classes


ContractFunctionInteraction

Defined in: contract/contract_function_interaction.ts:23

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
Extended by
Constructors
Constructor

new ContractFunctionInteraction(wallet, contractAddress, functionDao, args, authWitnesses, capsules, extraHashedArgs): ContractFunctionInteraction

Defined in: contract/contract_function_interaction.ts:24

Parameters
wallet

Wallet

contractAddress

AztecAddress

functionDao

FunctionAbi

args

any[]

authWitnesses

AuthWitness[] = []

capsules

Capsule[] = []

extraHashedArgs

HashedValues[] = []

Returns

ContractFunctionInteraction

Overrides

BaseContractInteraction.constructor

Properties
log

protected log: any

Defined in: contract/base_contract_interaction.ts:15

Inherited from

BaseContractInteraction.log


wallet

protected wallet: Wallet

Defined in: contract/base_contract_interaction.ts:18

Inherited from

BaseContractInteraction.wallet


authWitnesses

protected authWitnesses: AuthWitness[] = []

Defined in: contract/base_contract_interaction.ts:19

Inherited from

BaseContractInteraction.authWitnesses


capsules

protected capsules: Capsule[] = []

Defined in: contract/base_contract_interaction.ts:20

Inherited from

BaseContractInteraction.capsules


contractAddress

protected contractAddress: AztecAddress

Defined in: contract/contract_function_interaction.ts:26


functionDao

protected functionDao: FunctionAbi

Defined in: contract/contract_function_interaction.ts:27


args

protected args: any[]

Defined in: contract/contract_function_interaction.ts:28

Methods
send()

send(options): SentTx

Defined in: contract/base_contract_interaction.ts:41

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.

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.

Inherited from

BaseContractInteraction.send


getFunctionCall()

getFunctionCall(): Promise<{ name: any; args: any; selector: any; type: any; to: AztecAddress; isStatic: any; hideMsgSender: boolean; returnTypes: any; }>

Defined in: contract/contract_function_interaction.ts:44

Returns the encoded function call wrapped by this interaction Useful when generating authwits

Returns

Promise<{ name: any; args: any; selector: any; type: any; to: AztecAddress; isStatic: any; hideMsgSender: boolean; returnTypes: any; }>

An encoded function call


request()

request(options): Promise<ExecutionPayload>

Defined in: contract/contract_function_interaction.ts:63

Returns the execution payload that allows this operation to happen on chain.

Parameters
options

RequestInteractionOptions = {}

Configuration options.

Returns

Promise<ExecutionPayload>

The execution payload for this operation

Overrides

BaseContractInteraction.request


simulate()
Call Signature

simulate<T>(options): Promise<SimulationReturn<Exclude<T["fee"], undefined>["estimateGas"]>>

Defined in: contract/contract_function_interaction.ts:93

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
Type Parameters
T

T extends SimulateInteractionOptions

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

Call Signature

simulate<T>(options): Promise<SimulationReturn<T["includeMetadata"]>>

Defined in: contract/contract_function_interaction.ts:97

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
Type Parameters
T

T extends SimulateInteractionOptions

Parameters
options

T

An optional object containing additional configuration for the simulation.

Returns

Promise<SimulationReturn<T["includeMetadata"]>>

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


profile()

profile(options): Promise<TxProfileResult>

Defined in: contract/contract_function_interaction.ts:165

Simulate a transaction and profile the gate count for each function in the transaction.

Parameters
options

ProfileInteractionOptions

Same options as simulate, plus profiling method

Returns

Promise<TxProfileResult>

An object containing the function return value and profile result.


with()

with(options): ContractFunctionInteraction

Defined in: contract/contract_function_interaction.ts:181

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.

Parameters
options

An object containing the metadata to add to the interaction

authWitnesses?

AuthWitness[] = []

The authWitnesses to add to the interaction

capsules?

Capsule[] = []

The capsules to add to the interaction

extraHashedArgs?

HashedValues[] = []

The extra hashed args to add to the interaction

Returns

ContractFunctionInteraction

A new ContractFunctionInteraction with the added metadata, but calling the same original function in the same manner

Contract / Deploy method

contract/deploy_method

Classes

Type Aliases


DeployMethod<TContract>

Defined in: contract/deploy_method.ts:99

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
Extended by
Type Parameters
TContract

TContract extends ContractBase = Contract

Constructors
Constructor

new DeployMethod<TContract>(publicKeys, wallet, artifact, postDeployCtor, args, constructorNameOrArtifact?, authWitnesses?, capsules?): DeployMethod<TContract>

Defined in: contract/deploy_method.ts:106

Parameters
publicKeys

PublicKeys

wallet

Wallet

artifact

ContractArtifact

postDeployCtor

(address, wallet) => Promise<TContract>

args

any[] = []

constructorNameOrArtifact?

any

authWitnesses?

AuthWitness[] = []

capsules?

Capsule[] = []

Returns

DeployMethod<TContract>

Overrides

BaseContractInteraction.constructor

Properties
log

protected log: any

Defined in: contract/base_contract_interaction.ts:15

Inherited from

BaseContractInteraction.log


wallet

protected wallet: Wallet

Defined in: contract/base_contract_interaction.ts:18

Inherited from

BaseContractInteraction.wallet


authWitnesses

protected authWitnesses: AuthWitness[] = []

Defined in: contract/base_contract_interaction.ts:19

Inherited from

BaseContractInteraction.authWitnesses


capsules

protected capsules: Capsule[] = []

Defined in: contract/base_contract_interaction.ts:20

Inherited from

BaseContractInteraction.capsules


artifact

protected artifact: ContractArtifact

Defined in: contract/deploy_method.ts:109


postDeployCtor()

protected postDeployCtor: (address, wallet) => Promise<TContract>

Defined in: contract/deploy_method.ts:110

Parameters
address

AztecAddress

wallet

Wallet

Returns

Promise<TContract>

Accessors
address
Get Signature

get address(): any

Defined in: contract/deploy_method.ts:307

Return this deployment address.

Returns

any


partialAddress
Get Signature

get partialAddress(): any

Defined in: contract/deploy_method.ts:312

Returns the partial address for this deployment.

Returns

any

Methods
request()

request(options?): Promise<ExecutionPayload>

Defined in: contract/deploy_method.ts:125

Returns the execution payload that allows this operation to happen on chain.

Parameters
options?

RequestDeployOptions

Configuration options.

Returns

Promise<ExecutionPayload>

The execution payload for this operation

Overrides

BaseContractInteraction.request


convertDeployOptionsToRequestOptions()

convertDeployOptionsToRequestOptions(options): RequestDeployOptions

Defined in: contract/deploy_method.ts:144

Parameters
options

DeployOptions

Returns

RequestDeployOptions


register()

register(options?): Promise<TContract>

Defined in: contract/deploy_method.ts:155

Adds this contract to the wallet and returns the Contract object.

Parameters
options?

RequestDeployOptions

Deployment options.

Returns

Promise<TContract>


getPublicationExecutionPayload()

protected getPublicationExecutionPayload(options?): Promise<ExecutionPayload>

Defined in: contract/deploy_method.ts:169

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.
Parameters
options?

RequestDeployOptions

Contract creation options.

Returns

Promise<ExecutionPayload>

An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.


getInitializationExecutionPayload()

protected getInitializationExecutionPayload(options?): Promise<ExecutionPayload>

Defined in: contract/deploy_method.ts:216

Returns the calls necessary to initialize the contract.

Parameters
options?

RequestDeployOptions

Deployment options.

Returns

Promise<ExecutionPayload>

  • An array of function calls.

send()

send(options): DeploySentTx<TContract>

Defined in: contract/deploy_method.ts:239

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.

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.

Overrides

BaseContractInteraction.send


getInstance()

getInstance(options?): Promise<ContractInstanceWithAddress>

Defined in: contract/deploy_method.ts:255

Builds the contract instance and returns it.

Parameters
options?

RequestDeployOptions

An object containing various initialization and publication options.

Returns

Promise<ContractInstanceWithAddress>

An instance object.


simulate()

simulate(options): Promise<{ stats: SimulationStats; offchainEffects: OffchainEffect[]; result: any; estimatedGas: Pick<createAztecNodeClient, "gasLimits" | "teardownGasLimits">; }>

Defined in: contract/deploy_method.ts:275

Simulate the deployment

Parameters
options

SimulateDeployOptions

An optional object containing additional configuration for the simulation.

Returns

Promise<{ stats: SimulationStats; offchainEffects: OffchainEffect[]; result: any; estimatedGas: Pick<createAztecNodeClient, "gasLimits" | "teardownGasLimits">; }>

A simulation result object containing metadata of the execution, including gas estimations (if requested via options), execution statistics and emitted offchain effects


profile()

profile(options): Promise<TxProfileResult>

Defined in: contract/deploy_method.ts:297

Simulate a deployment and profile the gate count for each function in the transaction.

Parameters
options

Omit<RequestDeployOptions, "deployer"> & object & Pick<SendInteractionOptions, "fee" | "from"> & Omit<SendInteractionOptions, "fee"> & object & object

Same options as send, plus extra profiling options.

Returns

Promise<TxProfileResult>

An object containing the function return value and profile result.


with()

with(options): DeployMethod

Defined in: contract/deploy_method.ts:321

Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.

Parameters
options

An object containing the metadata to add to the interaction

authWitnesses?

AuthWitness[] = []

The authWitnesses to add to the deployment

capsules?

Capsule[] = []

The capsules to add to the deployment

Returns

DeployMethod

A new DeployMethod with the added metadata, but calling the same original function in the same manner

DeployOptions

DeployOptions = Omit<RequestDeployOptions, "deployer"> & object & Pick<SendInteractionOptions, "from" | "fee">

Defined in: contract/deploy_method.ts:59

Extends the deployment options with the required parameters to send the transaction

Type Declaration
universalDeploy?

optional universalDeploy: boolean

Set to true to not include the sender in the address computation. This option is mutually exclusive with "deployer"

RequestDeployOptions

RequestDeployOptions = RequestInteractionOptions & object

Defined in: contract/deploy_method.ts:40

Options for deploying a contract on the Aztec network. Allows specifying a contract address salt and different options to tweak contract publication and initialization

Type Declaration
contractAddressSalt?

optional contractAddressSalt: createAztecNodeClient

An optional salt value used to deterministically calculate the contract address.

deployer?

optional deployer: createAztecNodeClient

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

skipClassPublication?

optional skipClassPublication: boolean

Skip contract class publication.

skipInstancePublication?

optional skipInstancePublication: boolean

Skip publication, instead just privately initialize the contract.

skipInitialization?

optional skipInitialization: boolean

Skip contract initialization.

SimulateDeployOptions

SimulateDeployOptions = Omit<DeployOptions, "fee"> & object

Defined in: contract/deploy_method.ts:73

Options for simulating the deployment of a contract Allows skipping certain validations and computing gas estimations

Type Declaration
fee?

optional fee: SimulationInteractionFeeOptions

The fee options for the transaction.

skipTxValidation?

optional skipTxValidation: boolean

Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers.

skipFeeEnforcement?

optional skipFeeEnforcement: boolean

Whether to ensure the fee payer is not empty and has enough balance to pay for the fee.

includeMetadata?

optional includeMetadata: boolean

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

Contract / Deploy sent tx

contract/deploy_sent_tx

Classes

Type Aliases


DeploySentTx<TContract>

Defined in: contract/deploy_sent_tx.ts:27

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

Extends
Type Parameters
TContract

TContract extends Contract = Contract

Constructors
Constructor

new DeploySentTx<TContract>(wallet, sendTx, postDeployCtor, instanceGetter): DeploySentTx<TContract>

Defined in: contract/deploy_sent_tx.ts:30

Parameters
wallet

Wallet

sendTx

() => Promise<TxHash>

postDeployCtor

(address, wallet) => Promise<TContract>

instanceGetter

() => Promise<ContractInstanceWithAddress>

A getter for the deployed contract instance

Returns

DeploySentTx<TContract>

Overrides

SentTx.constructor

Properties
instanceGetter()

instanceGetter: () => Promise<ContractInstanceWithAddress>

Defined in: contract/deploy_sent_tx.ts:35

A getter for the deployed contract instance

Returns

Promise<ContractInstanceWithAddress>


sendTxPromise

protected sendTxPromise: Promise<void>

Defined in: contract/sent_tx.ts:32

Inherited from

SentTx.sendTxPromise


sendTxError?

protected optional sendTxError: Error

Defined in: contract/sent_tx.ts:33

Inherited from

SentTx.sendTxError


txHash?

protected optional txHash: any

Defined in: contract/sent_tx.ts:34

Inherited from

SentTx.txHash


walletOrNode

protected walletOrNode: any

Defined in: contract/sent_tx.ts:37

Inherited from

SentTx.walletOrNode

Methods
deployed()

deployed(opts?): Promise<TContract>

Defined in: contract/deploy_sent_tx.ts:45

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

Parameters
opts?

DeployedWaitOpts

Options for configuring the waiting for the tx to be mined.

Returns

Promise<TContract>

The deployed contract instance.


wait()

wait(opts?): Promise<any>

Defined in: contract/deploy_sent_tx.ts:57

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

Parameters
opts?

DeployedWaitOpts

Options for configuring the waiting for the tx to be mined.

Returns

Promise<any>

The transaction receipt with the deployed contract instance.

Overrides

SentTx.wait


getTxHash()

getTxHash(): Promise<TxHash>

Defined in: contract/sent_tx.ts:61

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


getReceipt()

getReceipt(): Promise<TxReceipt>

Defined in: contract/sent_tx.ts:81

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


waitForReceipt()

protected waitForReceipt(opts?): Promise<TxReceipt>

Defined in: contract/sent_tx.ts:101

Parameters
opts?

WaitOpts

Returns

Promise<TxReceipt>

Inherited from

SentTx.waitForReceipt

DeployedWaitOpts

DeployedWaitOpts = WaitOpts & object

Defined in: contract/deploy_sent_tx.ts:13

Options related to waiting for a deployment tx.

Type Declaration
wallet?

optional wallet: Wallet

Wallet to use for creating a contract instance. Uses the one set in the deployer constructor if not set.

DeployTxReceipt<TContract>

DeployTxReceipt<TContract> = createAztecNodeClient<createAztecNodeClient> & object

Defined in: contract/deploy_sent_tx.ts:19

Extends a transaction receipt with a contract instance that represents the newly deployed contract.

Type Declaration
contract

contract: TContract

Instance of the newly deployed contract.

Type Parameters
TContract

TContract extends ContractBase = Contract

Contract / Get gas limits

contract/get_gas_limits

Functions


getGasLimits()

getGasLimits(simulationResult, pad): object

Defined in: contract/get_gas_limits.ts:9

Returns suggested total and teardown gas limits for a simulated tx.

Parameters
simulationResult

TxSimulationResult

pad

number = 0.1

Percentage to pad the suggested gas limits by, (as decimal, e.g., 0.10 for 10%).

Returns
gasLimits

gasLimits: Gas

Gas limit for the tx, excluding teardown gas

teardownGasLimits

teardownGasLimits: Gas

Gas limit for the teardown phase

Contract / Interaction options

contract/interaction_options

Type Aliases

Functions


toProfileOptions()

toProfileOptions(options): Promise<ProfileOptions>

Defined in: contract/interaction_options.ts:163

Transforms and cleans up the higher level ProfileInteractionOptions defined by the interaction into ProfileOptions, which are the ones that can be serialized and forwarded to the wallet

Parameters
options

ProfileInteractionOptions

Returns

Promise<ProfileOptions>

toSendOptions()

toSendOptions(options): Promise<SendOptions>

Defined in: contract/interaction_options.ts:117

Transforms and cleans up the higher level SendInteractionOptions defined by the interaction into SendOptions, which are the ones that can be serialized and forwarded to the wallet

Parameters
options

SendInteractionOptions

Returns

Promise<SendOptions>

toSimulateOptions()

toSimulateOptions(options): Promise<SimulateOptions>

Defined in: contract/interaction_options.ts:139

Transforms and cleans up the higher level SimulateInteractionOptions defined by the interaction into SimulateOptions, which are the ones that can be serialized and forwarded to the wallet

Parameters
options

SimulateInteractionOptions

Returns

Promise<SimulateOptions>

FeeEstimationOptions

FeeEstimationOptions = object

Defined in: contract/interaction_options.ts:13

Options used to tweak the simulation and add gas estimation capabilities

Properties
estimateGas?

optional estimateGas: boolean

Defined in: contract/interaction_options.ts:15

Whether to modify the fee settings of the simulation with high gas limit to figure out actual gas settings.


estimatedGasPadding?

optional estimatedGasPadding: number

Defined in: contract/interaction_options.ts:17

Percentage to pad the estimated gas limits by, if empty, defaults to 0.1. Only relevant if estimateGas is set.

FeePaymentMethodOption

FeePaymentMethodOption = object

Defined in: contract/interaction_options.ts:24

Interactions allow configuring a custom fee payment method that gets bundled with the transaction before sending it to the wallet

Properties
paymentMethod?

optional paymentMethod: FeePaymentMethod

Defined in: contract/interaction_options.ts:26

Fee payment method to embed in the interaction

GasSettingsOption

GasSettingsOption = object

Defined in: contract/interaction_options.ts:33

User-defined partial gas settings for the interaction. This type is completely optional since the wallet will fill in the missing options

Properties
gasSettings?

optional gasSettings: Partial<createAztecNodeClient<createAztecNodeClient>>

Defined in: contract/interaction_options.ts:35

The gas settings

InteractionFeeOptions

InteractionFeeOptions = GasSettingsOption & FeePaymentMethodOption

Defined in: contract/interaction_options.ts:39

Fee options as set by a user.

ProfileInteractionOptions

ProfileInteractionOptions = SimulateInteractionOptions & object

Defined in: contract/interaction_options.ts:87

Represents the options for profiling an interaction.

Type Declaration
profileMode

profileMode: "gates" | "execution-steps" | "full"

Whether to return gates information or the bytecode/witnesses.

skipProofGeneration?

optional skipProofGeneration: boolean

Whether to generate a Chonk proof or not

RequestInteractionOptions

RequestInteractionOptions = object

Defined in: contract/interaction_options.ts:48

Represents the options to configure a request from a contract interaction. Allows specifying additional auth witnesses and capsules to use during execution

Properties
authWitnesses?

optional authWitnesses: createAztecNodeClient[]

Defined in: contract/interaction_options.ts:50

Extra authwits to use during execution


capsules?

optional capsules: createAztecNodeClient[]

Defined in: contract/interaction_options.ts:52

Extra capsules to use during execution


fee?

optional fee: FeePaymentMethodOption

Defined in: contract/interaction_options.ts:54

Fee payment method to embed in the interaction request

SendInteractionOptions

SendInteractionOptions = RequestInteractionOptions & object

Defined in: contract/interaction_options.ts:60

Represents options for calling a (constrained) function in a contract.

Type Declaration
from

from: createAztecNodeClient

The sender's Aztec address.

fee?

optional fee: InteractionFeeOptions

The fee options for the transaction.

SimulateInteractionOptions

SimulateInteractionOptions = Omit<SendInteractionOptions, "fee"> & object

Defined in: contract/interaction_options.ts:72

Represents the options for simulating a contract function interaction. Allows specifying the address from which the method should be called. Disregarded for simulation of public functions

Type Declaration
fee?

optional fee: SimulationInteractionFeeOptions

The fee options for the transaction.

skipTxValidation?

optional skipTxValidation: boolean

Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers.

skipFeeEnforcement?

optional skipFeeEnforcement: boolean

Whether to ensure the fee payer is not empty and has enough balance to pay for the fee.

includeMetadata?

optional includeMetadata: boolean

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

SimulationInteractionFeeOptions

SimulationInteractionFeeOptions = InteractionFeeOptions & FeeEstimationOptions

Defined in: contract/interaction_options.ts:42

Fee options that can be set for simulation only

SimulationReturn<T>

SimulationReturn<T> = T extends true ? object : any

Defined in: contract/interaction_options.ts:100

Represents the result type of a simulation. By default, it will just be the return value of the simulated function If includeMetadata is set to true in SimulateInteractionOptions on the input of simulate(...), it will provide extra information.

Type Parameters
T

T extends boolean | undefined

Contract / Protocol contracts

contract/protocol_contracts

Functions


getClassRegistryContract()

getClassRegistryContract(wallet): Promise<UnsafeContract>

Defined in: contract/protocol_contracts.ts:7

Returns a Contract wrapper for the contract class registry.

Parameters
wallet

Wallet

Returns

Promise<UnsafeContract>

getFeeJuice()

getFeeJuice(wallet): Promise<UnsafeContract>

Defined in: contract/protocol_contracts.ts:28

Returns a Contract wrapper for the fee juice contract

Parameters
wallet

Wallet

Returns

Promise<UnsafeContract>

getInstanceRegistryContract()

getInstanceRegistryContract(wallet): Promise<UnsafeContract>

Defined in: contract/protocol_contracts.ts:18

Returns a Contract wrapper for the contract instance registry.

Parameters
wallet

Wallet

Returns

Promise<UnsafeContract>

Contract / Sent tx

contract/sent_tx

Classes

Type Aliases

Variables


SentTx

Defined in: contract/sent_tx.ts:31

The SentTx class represents a sent transaction through the PXE (or directly to a node) providing methods to fetch its hash, receipt, and mining status.

Extended by
Constructors
Constructor

new SentTx(walletOrNode, sendTx): SentTx

Defined in: contract/sent_tx.ts:36

Parameters
walletOrNode

any

sendTx

() => Promise<TxHash>

Returns

SentTx

Properties
sendTxPromise

protected sendTxPromise: Promise<void>

Defined in: contract/sent_tx.ts:32


sendTxError?

protected optional sendTxError: Error

Defined in: contract/sent_tx.ts:33


txHash?

protected optional txHash: any

Defined in: contract/sent_tx.ts:34


walletOrNode

protected walletOrNode: any

Defined in: contract/sent_tx.ts:37

Methods
getTxHash()

getTxHash(): Promise<TxHash>

Defined in: contract/sent_tx.ts:61

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.


getReceipt()

getReceipt(): Promise<TxReceipt>

Defined in: contract/sent_tx.ts:81

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.


wait()

wait(opts?): Promise<FieldsOf<TxReceipt>>

Defined in: contract/sent_tx.ts:91

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

Parameters
opts?

WaitOpts

Options for configuring the waiting for the tx to be mined.

Returns

Promise<FieldsOf<TxReceipt>>

The transaction receipt.


waitForReceipt()

protected waitForReceipt(opts?): Promise<TxReceipt>

Defined in: contract/sent_tx.ts:101

Parameters
opts?

WaitOpts

Returns

Promise<TxReceipt>

WaitOpts

WaitOpts = object

Defined in: contract/sent_tx.ts:10

Options related to waiting for a tx.

Properties
ignoreDroppedReceiptsFor?

optional ignoreDroppedReceiptsFor: number

Defined in: contract/sent_tx.ts:12

The amount of time to ignore TxStatus.DROPPED receipts (in seconds) due to the presumption that it is being propagated by the p2p network. Defaults to 5.


timeout?

optional timeout: number

Defined in: contract/sent_tx.ts:14

The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 60.


interval?

optional interval: number

Defined in: contract/sent_tx.ts:16

The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1.


dontThrowOnRevert?

optional dontThrowOnRevert: boolean

Defined in: contract/sent_tx.ts:18

Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts.

DefaultWaitOpts

const DefaultWaitOpts: WaitOpts

Defined in: contract/sent_tx.ts:21

Contract / Unsafe contract

contract/unsafe_contract

Classes


UnsafeContract

Defined in: contract/unsafe_contract.ts:8

Unsafe constructor for ContractBase that bypasses the check that the instance is registered in the wallet.

Extends
Constructors
Constructor

new UnsafeContract(instance, artifact, wallet): UnsafeContract

Defined in: contract/unsafe_contract.ts:9

Parameters
instance

ContractInstanceWithAddress

The deployed contract instance definition.

artifact

ContractArtifact

The Application Binary Interface for the contract.

wallet

Wallet

The wallet used for interacting with this contract.

Returns

UnsafeContract

Overrides

ContractBase.constructor

Properties
methods

methods: object = {}

Defined in: contract/contract_base.ts:38

An object containing contract methods mapped to their respective names.

Index Signature

[name: string]: ContractMethod

Inherited from

ContractBase.methods


instance

readonly instance: ContractInstanceWithAddress

Defined in: contract/contract_base.ts:42

The deployed contract instance definition.

Inherited from

ContractBase.instance


artifact

readonly artifact: ContractArtifact

Defined in: contract/contract_base.ts:44

The Application Binary Interface for the contract.

Inherited from

ContractBase.artifact


wallet

wallet: Wallet

Defined in: contract/contract_base.ts:46

The wallet used for interacting with this contract.

Inherited from

ContractBase.wallet

Accessors
address
Get Signature

get address(): any

Defined in: contract/contract_base.ts:66

Address of the contract.

Returns

any

Inherited from

ContractBase.address


partialAddress
Get Signature

get partialAddress(): any

Defined in: contract/contract_base.ts:71

Partial address of the contract.

Returns

any

Inherited from

ContractBase.partialAddress

Methods
withWallet()

withWallet(wallet): this

Defined in: contract/contract_base.ts:80

Creates a new instance of the contract wrapper attached to a different wallet.

Parameters
wallet

Wallet

Wallet to use for sending txs.

Returns

this

A new contract instance.

Inherited from

ContractBase.withWallet

Contract / Wait for proven

contract/wait_for_proven

Type Aliases

Variables

Functions


waitForProven()

waitForProven(node, receipt, opts?): Promise<any>

Defined in: contract/wait_for_proven.ts:25

Wait for a transaction to be proven by polling the node

Parameters
node

AztecNode

receipt

TxReceipt

opts?

WaitForProvenOpts

Returns

Promise<any>

WaitForProvenOpts

WaitForProvenOpts = object

Defined in: contract/wait_for_proven.ts:10

Options for waiting for a transaction to be proven.

Properties
provenTimeout?

optional provenTimeout: number

Defined in: contract/wait_for_proven.ts:12

Time to wait for the tx to be proven before timing out


interval?

optional interval: number

Defined in: contract/wait_for_proven.ts:14

Elapsed time between polls to the node

DefaultWaitForProvenOpts

const DefaultWaitForProvenOpts: WaitForProvenOpts

Defined in: contract/wait_for_proven.ts:17

Deployment / Broadcast function

deployment/broadcast_function

Functions


broadcastPrivateFunction()

broadcastPrivateFunction(wallet, artifact, selector): Promise<ContractFunctionInteraction>

Defined in: deployment/broadcast_function.ts:31

Sets up a call to broadcast a private function's bytecode via the ClassRegistry contract. Note that this is not required for users to call the function, but is rather a convenience to make this code publicly available so dapps or wallets do not need to redistribute it.

Parameters
wallet

Wallet

Wallet to send the transaction.

artifact

ContractArtifact

Contract artifact that contains the function to be broadcast.

selector

FunctionSelector

Selector of the function to be broadcast.

Returns

Promise<ContractFunctionInteraction>

A ContractFunctionInteraction object that can be used to send the transaction.

broadcastUtilityFunction()

broadcastUtilityFunction(wallet, artifact, selector): Promise<ContractFunctionInteraction>

Defined in: deployment/broadcast_function.ts:98

Sets up a call to broadcast a utility function's bytecode via the ClassRegistry contract. Note that this is not required for users to call the function, but is rather a convenience to make this code publicly available so dapps or wallets do not need to redistribute it.

Parameters
wallet

Wallet

Wallet to send the transaction.

artifact

ContractArtifact

Contract artifact that contains the function to be broadcast.

selector

FunctionSelector

Selector of the function to be broadcast.

Returns

Promise<ContractFunctionInteraction>

A ContractFunctionInteraction object that can be used to send the transaction.

Deployment / Contract deployer

deployment/contract_deployer

Classes


ContractDeployer

Defined in: deployment/contract_deployer.ts:13

A class for deploying contract.

Remarks

Keeping this around even though we have Aztec.nr contract types because it can be useful for non-TS users.

Constructors
Constructor

new ContractDeployer(artifact, wallet, publicKeys?, constructorName?): ContractDeployer

Defined in: deployment/contract_deployer.ts:14

Parameters
artifact

ContractArtifact

wallet

Wallet

publicKeys?

any

constructorName?

string

Returns

ContractDeployer

Methods
deploy()

deploy(...args): DeployMethod<Contract>

Defined in: deployment/contract_deployer.ts:30

Deploy a contract using the provided ABI and constructor arguments. This function creates a new DeployMethod instance that can be used to send deployment transactions and query deployment status. The method accepts any number of constructor arguments, which will be passed to the contract's constructor during deployment.

Parameters
args

...any[]

The constructor arguments for the contract being deployed.

Returns

DeployMethod<Contract>

A DeployMethod instance configured with the ABI, PXE, and constructor arguments.

Deployment / Publish class

deployment/publish_class

Functions


publishContractClass()

publishContractClass(wallet, artifact): Promise<ContractFunctionInteraction>

Defined in: deployment/publish_class.ts:16

Sets up a call to publish a contract class given its artifact.

Parameters
wallet

Wallet

artifact

ContractArtifact

Returns

Promise<ContractFunctionInteraction>

Deployment / Publish instance

deployment/publish_instance

Functions


publishInstance()

publishInstance(wallet, instance): Promise<ContractFunctionInteraction>

Defined in: deployment/publish_instance.ts:12

Sets up a call to the canonical contract instance registry to publish a contract instance.

Parameters
wallet

Wallet

The wallet to use for the publication (setup) tx.

instance

ContractInstanceWithAddress

The instance to publish.

Returns

Promise<ContractFunctionInteraction>

Ethereum / Portal manager

ethereum/portal_manager

Classes

Type Aliases

Functions


L1FeeJuicePortalManager

Defined in: ethereum/portal_manager.ts:128

Helper for interacting with the FeeJuicePortal on L1.

Constructors
Constructor

new L1FeeJuicePortalManager(portalAddress, tokenAddress, handlerAddress, extendedClient, logger): L1FeeJuicePortalManager

Defined in: ethereum/portal_manager.ts:132

Parameters
portalAddress

EthAddress

tokenAddress

EthAddress

handlerAddress

EthAddress

extendedClient

ExtendedViemWalletClient

logger

Logger

Returns

L1FeeJuicePortalManager

Methods
getTokenManager()

getTokenManager(): L1TokenManager

Defined in: ethereum/portal_manager.ts:148

Returns the associated token manager for the L1 ERC20.

Returns

L1TokenManager


bridgeTokensPublic()

bridgeTokensPublic(to, amount, mint): Promise<L2AmountClaim>

Defined in: ethereum/portal_manager.ts:158

Bridges fee juice from L1 to L2 publicly. Handles L1 ERC20 approvals. Returns once the tx has been mined.

Parameters
to

AztecAddress

Address to send the tokens to on L2.

amount

Amount of tokens to send.

bigint | undefined

mint

boolean = false

Whether to mint the tokens before sending (only during testing).

Returns

Promise<L2AmountClaim>


new()

static new(node, extendedClient, logger): Promise<L1FeeJuicePortalManager>

Defined in: ethereum/portal_manager.ts:209

Creates a new instance

Parameters
node

AztecNode

Aztec node client used for retrieving the L1 contract addresses.

extendedClient

ExtendedViemWalletClient

Wallet client, extended with public actions.

logger

Logger

Logger.

Returns

Promise<L1FeeJuicePortalManager>

L1TokenManager

Defined in: ethereum/portal_manager.ts:54

Helper for managing an ERC20 on L1.

Constructors
Constructor

new L1TokenManager(tokenAddress, handlerAddress, extendedClient, logger): L1TokenManager

Defined in: ethereum/portal_manager.ts:58

Parameters
tokenAddress

EthAddress

Address of the ERC20 contract.

handlerAddress

any

Address of the handler/faucet contract.

extendedClient

ExtendedViemWalletClient

logger

Logger

Returns

L1TokenManager

Properties
tokenAddress

readonly tokenAddress: EthAddress

Defined in: ethereum/portal_manager.ts:60

Address of the ERC20 contract.


handlerAddress

readonly handlerAddress: any

Defined in: ethereum/portal_manager.ts:62

Address of the handler/faucet contract.

Methods
getMintAmount()

getMintAmount(): Promise<any>

Defined in: ethereum/portal_manager.ts:83

Returns the amount of tokens available to mint via the handler.

Returns

Promise<any>

Throws

if the handler is not provided.


getL1TokenBalance()

getL1TokenBalance(address): Promise<any>

Defined in: ethereum/portal_manager.ts:94

Returns the balance of the given address.

Parameters
address

Hex

Address to get the balance of.

Returns

Promise<any>


mint()

mint(address, addressName?): Promise<void>

Defined in: ethereum/portal_manager.ts:103

Mints a fixed amount of tokens for the given address. Returns once the tx has been mined.

Parameters
address

Hex

Address to mint the tokens for.

addressName?

string

Optional name of the address for logging.

Returns

Promise<void>


approve()

approve(amount, address, addressName): Promise<void>

Defined in: ethereum/portal_manager.ts:119

Approves tokens for the given address. Returns once the tx has been mined.

Parameters
amount

bigint

Amount to approve.

address

Hex

Address to approve the tokens for.

addressName

string = ''

Optional name of the address for logging.

Returns

Promise<void>

L1TokenPortalManager

Defined in: ethereum/portal_manager.ts:358

Helper for interacting with a test TokenPortal on L1 for both withdrawing from and bridging to L2.

Extends
Constructors
Constructor

new L1TokenPortalManager(portalAddress, tokenAddress, handlerAddress, outboxAddress, extendedClient, logger): L1TokenPortalManager

Defined in: ethereum/portal_manager.ts:361

Parameters
portalAddress

EthAddress

tokenAddress

EthAddress

handlerAddress

any

outboxAddress

EthAddress

extendedClient

ExtendedViemWalletClient

logger

Logger

Returns

L1TokenPortalManager

Overrides

L1ToL2TokenPortalManager.constructor

Properties
portal

protected readonly portal: ViemContract<any>

Defined in: ethereum/portal_manager.ts:237

Inherited from

L1ToL2TokenPortalManager.portal


tokenManager

protected readonly tokenManager: L1TokenManager

Defined in: ethereum/portal_manager.ts:238

Inherited from

L1ToL2TokenPortalManager.tokenManager


extendedClient

protected extendedClient: ExtendedViemWalletClient

Defined in: ethereum/portal_manager.ts:244

Inherited from

L1ToL2TokenPortalManager.extendedClient


logger

protected logger: Logger

Defined in: ethereum/portal_manager.ts:245

Inherited from

L1ToL2TokenPortalManager.logger

Methods
getTokenManager()

getTokenManager(): L1TokenManager

Defined in: ethereum/portal_manager.ts:256

Returns the token manager for the underlying L1 token.

Returns

L1TokenManager

Inherited from

L1ToL2TokenPortalManager.getTokenManager


bridgeTokensPublic()

bridgeTokensPublic(to, amount, mint): Promise<L2AmountClaim>

Defined in: ethereum/portal_manager.ts:266

Bridges tokens from L1 to L2. Handles token approvals. Returns once the tx has been mined.

Parameters
to

AztecAddress

Address to send the tokens to on L2.

amount

bigint

Amount of tokens to send.

mint

boolean = false

Whether to mint the tokens before sending (only during testing).

Returns

Promise<L2AmountClaim>

Inherited from

L1ToL2TokenPortalManager.bridgeTokensPublic


bridgeTokensPrivate()

bridgeTokensPrivate(to, amount, mint): Promise<L2AmountClaimWithRecipient>

Defined in: ethereum/portal_manager.ts:307

Bridges tokens from L1 to L2 privately. Handles token approvals. Returns once the tx has been mined.

Parameters
to

AztecAddress

Address to send the tokens to on L2.

amount

bigint

Amount of tokens to send.

mint

boolean = false

Whether to mint the tokens before sending (only during testing).

Returns

Promise<L2AmountClaimWithRecipient>

Inherited from

L1ToL2TokenPortalManager.bridgeTokensPrivate


withdrawFunds()

withdrawFunds(amount, recipient, blockNumber, messageIndex, siblingPath): Promise<void>

Defined in: ethereum/portal_manager.ts:385

Withdraws funds from the portal by consuming an L2 to L1 message. Returns once the tx is mined on L1.

Parameters
amount

bigint

Amount to withdraw.

recipient

EthAddress

Who will receive the funds.

blockNumber

bigint

L2 block number of the message.

messageIndex

bigint

Index of the message.

siblingPath

SiblingPath<number>

Sibling path of the message.

Returns

Promise<void>


getL2ToL1MessageLeaf()

getL2ToL1MessageLeaf(amount, recipient, l2Bridge, callerOnL1): Promise<Fr>

Defined in: ethereum/portal_manager.ts:433

Computes the L2 to L1 message leaf for the given parameters.

Parameters
amount

bigint

Amount to bridge.

recipient

EthAddress

Recipient on L1.

l2Bridge

AztecAddress

Address of the L2 bridge.

callerOnL1

EthAddress = EthAddress.ZERO

Caller address on L1.

Returns

Promise<Fr>

L1ToL2TokenPortalManager

Defined in: ethereum/portal_manager.ts:236

Helper for interacting with a test TokenPortal on L1 for sending tokens to L2.

Extended by
Constructors
Constructor

new L1ToL2TokenPortalManager(portalAddress, tokenAddress, handlerAddress, extendedClient, logger): L1ToL2TokenPortalManager

Defined in: ethereum/portal_manager.ts:240

Parameters
portalAddress

EthAddress

tokenAddress

EthAddress

handlerAddress

any

extendedClient

ExtendedViemWalletClient

logger

Logger

Returns

L1ToL2TokenPortalManager

Properties
portal

protected readonly portal: ViemContract<any>

Defined in: ethereum/portal_manager.ts:237


tokenManager

protected readonly tokenManager: L1TokenManager

Defined in: ethereum/portal_manager.ts:238


extendedClient

protected extendedClient: ExtendedViemWalletClient

Defined in: ethereum/portal_manager.ts:244


logger

protected logger: Logger

Defined in: ethereum/portal_manager.ts:245

Methods
getTokenManager()

getTokenManager(): L1TokenManager

Defined in: ethereum/portal_manager.ts:256

Returns the token manager for the underlying L1 token.

Returns

L1TokenManager


bridgeTokensPublic()

bridgeTokensPublic(to, amount, mint): Promise<L2AmountClaim>

Defined in: ethereum/portal_manager.ts:266

Bridges tokens from L1 to L2. Handles token approvals. Returns once the tx has been mined.

Parameters
to

AztecAddress

Address to send the tokens to on L2.

amount

bigint

Amount of tokens to send.

mint

boolean = false

Whether to mint the tokens before sending (only during testing).

Returns

Promise<L2AmountClaim>


bridgeTokensPrivate()

bridgeTokensPrivate(to, amount, mint): Promise<L2AmountClaimWithRecipient>

Defined in: ethereum/portal_manager.ts:307

Bridges tokens from L1 to L2 privately. Handles token approvals. Returns once the tx has been mined.

Parameters
to

AztecAddress

Address to send the tokens to on L2.

amount

bigint

Amount of tokens to send.

mint

boolean = false

Whether to mint the tokens before sending (only during testing).

Returns

Promise<L2AmountClaimWithRecipient>

generateClaimSecret()

generateClaimSecret(logger?): Promise<[Fr, Fr]>

Defined in: ethereum/portal_manager.ts:46

Generates a pair secret and secret hash

Parameters
logger?

any

Returns

Promise<[Fr, Fr]>

L2AmountClaim

L2AmountClaim = L2Claim & object

Defined in: ethereum/portal_manager.ts:33

L1 to L2 message info that corresponds to an amount to claim.

Type Declaration
claimAmount

claimAmount: bigint

L2AmountClaimWithRecipient

L2AmountClaimWithRecipient = L2AmountClaim & object

Defined in: ethereum/portal_manager.ts:36

L1 to L2 message info that corresponds to an amount to claim with associated recipient.

Type Declaration
recipient

recipient: createAztecNodeClient

Address that will receive the newly minted notes.

L2Claim

L2Claim = object

Defined in: ethereum/portal_manager.ts:21

L1 to L2 message info to claim it on L2.

Properties
claimSecret

claimSecret: createAztecNodeClient

Defined in: ethereum/portal_manager.ts:23

Secret for claiming.


claimSecretHash

claimSecretHash: createAztecNodeClient

Defined in: ethereum/portal_manager.ts:25

Hash of the secret for claiming.


messageHash

messageHash: createAztecNodeClient

Defined in: ethereum/portal_manager.ts:27

Hash of the message.


messageLeafIndex

messageLeafIndex: bigint

Defined in: ethereum/portal_manager.ts:29

Leaf index in the L1 to L2 message tree.

Fee / Fee juice payment method with claim

fee/fee_juice_payment_method_with_claim

Classes


FeeJuicePaymentMethodWithClaim

Defined in: fee/fee_juice_payment_method_with_claim.ts:15

Pay fee directly with Fee Juice claimed in the same tx. Claiming consumes an L1 to L2 message that "contains" the fee juice bridged from L1.

Implements
Constructors
Constructor

new FeeJuicePaymentMethodWithClaim(sender, claim): FeeJuicePaymentMethodWithClaim

Defined in: fee/fee_juice_payment_method_with_claim.ts:16

Parameters
sender

AztecAddress

claim

Pick<L2AmountClaim, "claimAmount" | "claimSecret" | "messageLeafIndex">

Returns

FeeJuicePaymentMethodWithClaim

Methods
getExecutionPayload()

getExecutionPayload(): Promise<ExecutionPayload>

Defined in: fee/fee_juice_payment_method_with_claim.ts:25

Creates an execution payload to pay the fee in Fee Juice.

Returns

Promise<ExecutionPayload>

An execution payload that just contains the claim_and_end_setup function call.

Implementation of

FeePaymentMethod.getExecutionPayload


getAsset()

getAsset(): Promise<any>

Defined in: fee/fee_juice_payment_method_with_claim.ts:51

The asset used to pay the fee.

Returns

Promise<any>

Implementation of

FeePaymentMethod.getAsset


getFeePayer()

getFeePayer(): Promise<AztecAddress>

Defined in: fee/fee_juice_payment_method_with_claim.ts:55

The expected fee payer for this tx.

Returns

Promise<AztecAddress>

Implementation of

FeePaymentMethod.getFeePayer


getGasSettings()

getGasSettings(): any

Defined in: fee/fee_juice_payment_method_with_claim.ts:59

The gas settings (if any) used to compute the execution payload of the payment method

Returns

any

Implementation of

FeePaymentMethod.getGasSettings

Fee / Fee payment method

fee/fee_payment_method

Interfaces


FeePaymentMethod

Defined in: fee/fee_payment_method.ts:8

Holds information about how the fee for a transaction is to be paid.

Methods
getAsset()

getAsset(): Promise<AztecAddress>

Defined in: fee/fee_payment_method.ts:10

The asset used to pay the fee.

Returns

Promise<AztecAddress>


getExecutionPayload()

getExecutionPayload(): Promise<ExecutionPayload>

Defined in: fee/fee_payment_method.ts:16

Returns the data to be added to the final execution request to pay the fee in the given asset

Returns

Promise<ExecutionPayload>

The function calls to pay the fee.


getFeePayer()

getFeePayer(): Promise<AztecAddress>

Defined in: fee/fee_payment_method.ts:20

The expected fee payer for this tx.

Returns

Promise<AztecAddress>


getGasSettings()

getGasSettings(): any

Defined in: fee/fee_payment_method.ts:25

The gas settings (if any) used to compute the execution payload of the payment method

Returns

any

Fee / Private fee payment method

fee/private_fee_payment_method

Classes


PrivateFeePaymentMethod

Defined in: fee/private_fee_payment_method.ts:14

Holds information about how the fee for a transaction is to be paid.

Implements
Constructors
Constructor

new PrivateFeePaymentMethod(paymentContract, sender, wallet, gasSettings, setMaxFeeToOne): PrivateFeePaymentMethod

Defined in: fee/private_fee_payment_method.ts:17

Parameters
paymentContract

AztecAddress

Address which will hold the fee payment.

sender

AztecAddress

Address of the account that will pay the fee

wallet

Wallet

A wallet to perform the simulation to get the accepted asset

gasSettings

GasSettings

Gas settings used to compute the maximum fee the user is willing to pay

setMaxFeeToOne

boolean = false

If true, the max fee will be set to 1. TODO(#7694): Remove this param once the lacking feature in TXE is implemented.

Returns

PrivateFeePaymentMethod

Properties
gasSettings

protected gasSettings: GasSettings

Defined in: fee/private_fee_payment_method.ts:35

Gas settings used to compute the maximum fee the user is willing to pay

Methods
getAsset()

getAsset(): Promise<AztecAddress>

Defined in: fee/private_fee_payment_method.ts:47

The asset used to pay the fee.

Returns

Promise<AztecAddress>

The asset used to pay the fee.

Implementation of

FeePaymentMethod.getAsset


getFeePayer()

getFeePayer(): Promise<AztecAddress>

Defined in: fee/private_fee_payment_method.ts:88

The expected fee payer for this tx.

Returns

Promise<AztecAddress>

Implementation of

FeePaymentMethod.getFeePayer


getExecutionPayload()

getExecutionPayload(): Promise<ExecutionPayload>

Defined in: fee/private_fee_payment_method.ts:97

Creates an execution payload to pay the fee using a private function through an FPC in the desired asset

Returns

Promise<ExecutionPayload>

An execution payload that contains the required function calls and auth witnesses.

Implementation of

FeePaymentMethod.getExecutionPayload


getGasSettings()

getGasSettings(): any

Defined in: fee/private_fee_payment_method.ts:135

The gas settings (if any) used to compute the execution payload of the payment method

Returns

any

Implementation of

FeePaymentMethod.getGasSettings

Fee / Public fee payment method

fee/public_fee_payment_method

Classes


PublicFeePaymentMethod

Defined in: fee/public_fee_payment_method.ts:15

Holds information about how the fee for a transaction is to be paid.

Implements
Constructors
Constructor

new PublicFeePaymentMethod(paymentContract, sender, wallet, gasSettings): PublicFeePaymentMethod

Defined in: fee/public_fee_payment_method.ts:18

Parameters
paymentContract

AztecAddress

Address which will hold the fee payment.

sender

AztecAddress

An auth witness provider to authorize fee payments

wallet

Wallet

A wallet to perform the simulation to get the accepted asset

gasSettings

GasSettings

Gas settings used to compute the maximum fee the user is willing to pay

Returns

PublicFeePaymentMethod

Properties
paymentContract

protected paymentContract: AztecAddress

Defined in: fee/public_fee_payment_method.ts:22

Address which will hold the fee payment.


sender

protected sender: AztecAddress

Defined in: fee/public_fee_payment_method.ts:26

An auth witness provider to authorize fee payments


wallet

protected wallet: Wallet

Defined in: fee/public_fee_payment_method.ts:30

A wallet to perform the simulation to get the accepted asset


gasSettings

protected gasSettings: GasSettings

Defined in: fee/public_fee_payment_method.ts:34

Gas settings used to compute the maximum fee the user is willing to pay

Methods
getAsset()

getAsset(): Promise<AztecAddress>

Defined in: fee/public_fee_payment_method.ts:41

The asset used to pay the fee.

Returns

Promise<AztecAddress>

The asset used to pay the fee.

Implementation of

FeePaymentMethod.getAsset


getFeePayer()

getFeePayer(): Promise<AztecAddress>

Defined in: fee/public_fee_payment_method.ts:82

The expected fee payer for this tx.

Returns

Promise<AztecAddress>

Implementation of

FeePaymentMethod.getFeePayer


getExecutionPayload()

getExecutionPayload(): Promise<ExecutionPayload>

Defined in: fee/public_fee_payment_method.ts:91

Creates an execution payload to pay the fee using a public function through an FPC in the desired asset

Returns

Promise<ExecutionPayload>

An execution payload that contains the required function calls.

Implementation of

FeePaymentMethod.getExecutionPayload


getGasSettings()

getGasSettings(): any

Defined in: fee/public_fee_payment_method.ts:135

The gas settings (if any) used to compute the execution payload of the payment method

Returns

any

Implementation of

FeePaymentMethod.getGasSettings

Fee / Sponsored fee payment

fee/sponsored_fee_payment

Classes


SponsoredFeePaymentMethod

Defined in: fee/sponsored_fee_payment.ts:11

A fee payment method that uses a contract that blindly sponsors transactions. This contract is expected to be prefunded in testing environments.

Implements
Constructors
Constructor

new SponsoredFeePaymentMethod(paymentContract): SponsoredFeePaymentMethod

Defined in: fee/sponsored_fee_payment.ts:12

Parameters
paymentContract

AztecAddress

Returns

SponsoredFeePaymentMethod

Methods
getAsset()

getAsset(): Promise<AztecAddress>

Defined in: fee/sponsored_fee_payment.ts:14

The asset used to pay the fee.

Returns

Promise<AztecAddress>

Implementation of

FeePaymentMethod.getAsset


getFeePayer()

getFeePayer(): Promise<any>

Defined in: fee/sponsored_fee_payment.ts:18

The expected fee payer for this tx.

Returns

Promise<any>

Implementation of

FeePaymentMethod.getFeePayer


getExecutionPayload()

getExecutionPayload(): Promise<ExecutionPayload>

Defined in: fee/sponsored_fee_payment.ts:22

Returns the data to be added to the final execution request to pay the fee in the given asset

Returns

Promise<ExecutionPayload>

The function calls to pay the fee.

Implementation of

FeePaymentMethod.getExecutionPayload


getGasSettings()

getGasSettings(): any

Defined in: fee/sponsored_fee_payment.ts:41

The gas settings (if any) used to compute the execution payload of the payment method

Returns

any

Implementation of

FeePaymentMethod.getGasSettings

Utils / Abi types

utils/abi_types

Type Aliases


AztecAddressLike

AztecAddressLike = { address: FieldLike; } | createAztecNodeClient

Defined in: utils/abi_types.ts:13

Any type that can be converted into an AztecAddress Aztec.nr struct.

EthAddressLike

EthAddressLike = { address: FieldLike; } | createAztecNodeClient

Defined in: utils/abi_types.ts:10

Any type that can be converted into an EthAddress Aztec.nr struct.

EventSelectorLike

EventSelectorLike = FieldLike | createAztecNodeClient

Defined in: utils/abi_types.ts:19

Any type that can be converted into an EventSelector Aztec.nr struct.

FieldLike

FieldLike = createAztecNodeClient | Buffer | bigint | number | { toField: () => createAztecNodeClient; }

Defined in: utils/abi_types.ts:7

Any type that can be converted into a field for a contract call.

FunctionSelectorLike

FunctionSelectorLike = FieldLike | createAztecNodeClient

Defined in: utils/abi_types.ts:16

Any type that can be converted into a FunctionSelector Aztec.nr struct.

U128Like

U128Like = bigint | number

Defined in: utils/abi_types.ts:22

Any type that can be converted into a U128.

WrappedFieldLike

WrappedFieldLike = { inner: FieldLike; } | FieldLike

Defined in: utils/abi_types.ts:25

Any type that can be converted into a struct with a single inner field.

Utils / Authwit

utils/authwit

Classes

Type Aliases

Functions


SetPublicAuthwitContractInteraction

Defined in: utils/authwit.ts:227

Convenience class designed to wrap the very common interaction of setting a public authwit in the AuthRegistry contract

Extends
Properties
log

protected log: any

Defined in: contract/base_contract_interaction.ts:15

Inherited from

ContractFunctionInteraction.log


wallet

protected wallet: Wallet

Defined in: contract/base_contract_interaction.ts:18

Inherited from

ContractFunctionInteraction.wallet


authWitnesses

protected authWitnesses: AuthWitness[] = []

Defined in: contract/base_contract_interaction.ts:19

Inherited from

ContractFunctionInteraction.authWitnesses


capsules

protected capsules: Capsule[] = []

Defined in: contract/base_contract_interaction.ts:20

Inherited from

ContractFunctionInteraction.capsules


contractAddress

protected contractAddress: AztecAddress

Defined in: contract/contract_function_interaction.ts:26

Inherited from

ContractFunctionInteraction.contractAddress


functionDao

protected functionDao: FunctionAbi

Defined in: contract/contract_function_interaction.ts:27

Inherited from

ContractFunctionInteraction.functionDao


args

protected args: any[]

Defined in: contract/contract_function_interaction.ts:28

Inherited from

ContractFunctionInteraction.args

Methods
getFunctionCall()

getFunctionCall(): Promise<{ name: any; args: any; selector: any; type: any; to: AztecAddress; isStatic: any; hideMsgSender: boolean; returnTypes: any; }>

Defined in: contract/contract_function_interaction.ts:44

Returns the encoded function call wrapped by this interaction Useful when generating authwits

Returns

Promise<{ name: any; args: any; selector: any; type: any; to: AztecAddress; isStatic: any; hideMsgSender: boolean; returnTypes: any; }>

An encoded function call

Inherited from

ContractFunctionInteraction.getFunctionCall


request()

request(options): Promise<ExecutionPayload>

Defined in: contract/contract_function_interaction.ts:63

Returns the execution payload that allows this operation to happen on chain.

Parameters
options

RequestInteractionOptions = {}

Configuration options.

Returns

Promise<ExecutionPayload>

The execution payload for this operation

Inherited from

ContractFunctionInteraction.request


with()

with(options): ContractFunctionInteraction

Defined in: contract/contract_function_interaction.ts:181

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.

Parameters
options

An object containing the metadata to add to the interaction

authWitnesses?

AuthWitness[] = []

The authWitnesses to add to the interaction

capsules?

Capsule[] = []

The capsules to add to the interaction

extraHashedArgs?

HashedValues[] = []

The extra hashed args to add to the interaction

Returns

ContractFunctionInteraction

A new ContractFunctionInteraction with the added metadata, but calling the same original function in the same manner

Inherited from

ContractFunctionInteraction.with


create()

static create(wallet, from, messageHashOrIntent, authorized): Promise<SetPublicAuthwitContractInteraction>

Defined in: utils/authwit.ts:240

Parameters
wallet

Wallet

from

AztecAddress

messageHashOrIntent

any

authorized

boolean

Returns

Promise<SetPublicAuthwitContractInteraction>


simulate()

simulate<T>(options): Promise<SimulationReturn<T["includeMetadata"]>>

Defined in: utils/authwit.ts:257

Overrides the simulate method, adding the sender of the authwit (authorizer) as from and preventing misuse

Type Parameters
T

T extends SimulateInteractionOptions

Parameters
options

Omit<T, "from">

An optional object containing additional configuration for the transaction.

Returns

Promise<SimulationReturn<T["includeMetadata"]>>

The result of the transaction as returned by the contract function.

Overrides

ContractFunctionInteraction.simulate


profile()

profile(options): Promise<TxProfileResult>

Defined in: utils/authwit.ts:273

Overrides the profile method, adding the sender of the authwit (authorizer) as from and preventing misuse

Parameters
options

Omit<ProfileInteractionOptions, "from"> = ...

Same options as simulate, plus profiling method

Returns

Promise<TxProfileResult>

An object containing the function return value and profile result.

Overrides

ContractFunctionInteraction.profile


send()

send(options): SentTx

Defined in: utils/authwit.ts:285

Overrides the send method, adding the sender of the authwit (authorizer) as from and preventing misuse

Parameters
options

Omit<SendInteractionOptions, "from"> = {}

An optional object containing 'fee' options information

Returns

SentTx

A SentTx instance for tracking the transaction status and information.

Overrides

ContractFunctionInteraction.send

computeAuthWitMessageHash()

computeAuthWitMessageHash(intent, metadata): Promise<any>

Defined in: utils/authwit.ts:76

Compute an authentication witness message hash from an intent and metadata

If using the IntentInnerHash, the consumer is the address that can "consume" the authwit, for token approvals it is the token contract itself. The innerHash itself will be the message that a contract is allowed to execute. At the point of "approval checking", the validating contract (account for private and registry for public) will be computing the message hash (H(consumer, chainid, version, inner_hash)) where the all but the inner_hash is injected from the context (consumer = msg_sender), and use it for the authentication check. Therefore, any allowed innerHash will therefore also have information around where it can be spent (version, chainId) and who can spend it (consumer).

If using the CallIntent, the caller is the address that is making the call, for a token approval from Alice to Bob, this would be Bob. The action is then used along with the caller to compute the innerHash and the consumer.

Parameters
intent

The intent to approve (consumer and innerHash or caller and action) The consumer is the address that can "consume" the authwit, for token approvals it is the token contract itself. The caller is the address that is making the call, for a token approval from Alice to Bob, this would be Bob. The caller becomes part of the inner_hash and is dealt with entirely in application logic.

CallIntent | IntentInnerHash | ContractFunctionInteractionCallIntent

metadata

ChainInfo

The metadata for the intent (chainId, version)

Returns

Promise<any>

The message hash for the action

computeInnerAuthWitHashFromAction()

computeInnerAuthWitHashFromAction(caller, action): Promise<any>

Defined in: utils/authwit.ts:127

Computes the inner authwitness hash for either a function call or an action, for it to later be combined with the metadata required for the outer hash and eventually the full AuthWitness.

Parameters
caller

AztecAddress

Who is going to be calling the function

action

any

The action to compute the inner hash from

Returns

Promise<any>

The inner hash for the action

getMessageHashFromIntent()

getMessageHashFromIntent(messageHashOrIntent, chainInfo): Promise<Fr>

Defined in: utils/authwit.ts:104

Compute an authentication witness message hash from an intent and metadata. This is just a wrapper around computeAuthwitMessageHash that allows receiving an already computed messageHash as input

Parameters
messageHashOrIntent

any

The precomputed messageHash or intent to approve (consumer and innerHash or caller and call/action)

chainInfo

ChainInfo

Returns

Promise<Fr>

The message hash for the intent

lookupValidity()

lookupValidity(wallet, onBehalfOf, intent, witness): Promise<{ isValidInPrivate: boolean; isValidInPublic: boolean; }>

Defined in: utils/authwit.ts:146

Lookup the validity of an authwit in private and public contexts.

Uses the chain id and version of the wallet.

Parameters
wallet

Wallet

The wallet use to simulate and read the public data

onBehalfOf

AztecAddress

The address of the "approver"

intent

The consumer and inner hash or the caller and action to lookup

CallIntent | IntentInnerHash | ContractFunctionInteractionCallIntent

witness

AuthWitness

The computed authentication witness to check

Returns

Promise<{ isValidInPrivate: boolean; isValidInPublic: boolean; }>

  • A struct containing the validity of the authwit in private and public contexts.

CallIntent

CallIntent = object

Defined in: utils/authwit.ts:29

Intent with a call

Properties
caller

caller: createAztecNodeClient

Defined in: utils/authwit.ts:31

The caller to approve


call

call: createAztecNodeClient

Defined in: utils/authwit.ts:33

The call to approve

ContractFunctionInteractionCallIntent

ContractFunctionInteractionCallIntent = object

Defined in: utils/authwit.ts:37

Intent with a ContractFunctionInteraction

Properties
caller

caller: createAztecNodeClient

Defined in: utils/authwit.ts:39

The caller to approve


action

action: ContractFunctionInteraction

Defined in: utils/authwit.ts:41

The action to approve

IntentInnerHash

IntentInnerHash = object

Defined in: utils/authwit.ts:21

Intent with an inner hash

Properties
consumer

consumer: createAztecNodeClient

Defined in: utils/authwit.ts:23

The consumer


innerHash

innerHash: Buffer<ArrayBuffer> | createAztecNodeClient

Defined in: utils/authwit.ts:25

The action to approve

Utils / Cross chain

utils/cross_chain

Functions


isL1ToL2MessageReady()

isL1ToL2MessageReady(node, l1ToL2MessageHash, opts): Promise<boolean>

Defined in: utils/cross_chain.ts:35

Returns whether the L1 to L2 message is ready to be consumed.

Parameters
node

Pick<createAztecNodeClient, "getBlockNumber" | "getL1ToL2MessageBlock">

Aztec node instance used to obtain the information about the message

l1ToL2MessageHash

Fr

Hash of the L1 to L2 message

opts

Options

forPublicConsumption

boolean

True if the message is meant to be consumed from a public function

messageBlockNumber?

number

Cached synced block number for the message (will be fetched from PXE otherwise)

Returns

Promise<boolean>

True if the message is ready to be consumed, false otherwise

waitForL1ToL2MessageReady()

waitForL1ToL2MessageReady(node, l1ToL2MessageHash, opts): Promise<any>

Defined in: utils/cross_chain.ts:11

Waits for the L1 to L2 message to be ready to be consumed.

Parameters
node

Pick<createAztecNodeClient, "getBlockNumber" | "getL1ToL2MessageBlock">

Aztec node instance used to obtain the information about the message

l1ToL2MessageHash

Fr

Hash of the L1 to L2 message

opts

Options

timeoutSeconds

number

Timeout for the operation in seconds

forPublicConsumption

boolean

True if the message is meant to be consumed from a public function

Returns

Promise<any>

Utils / Fee juice

utils/fee_juice

Functions


getFeeJuiceBalance()

getFeeJuiceBalance(owner, node): Promise<bigint>

Defined in: utils/fee_juice.ts:11

Returns the owner's fee juice balance. Note: This is used only e2e_local_network_example test. TODO: Consider nuking.

Parameters
owner

AztecAddress

node

AztecNode

Returns

Promise<bigint>

Utils / Field compressed string

utils/field_compressed_string

Functions


readFieldCompressedString()

readFieldCompressedString(field): string

Defined in: utils/field_compressed_string.ts:17

This turns

Parameters
field

NoirFieldCompressedString

The field that contains the string

Returns

string

  • the string that is decoded from the field

Utils / Node

utils/node

Variables

Functions

References

AztecNode

Renames and re-exports createAztecNodeClient


waitForNode()

waitForNode(node, logger?): Promise<void>

Defined in: utils/node.ts:5

Parameters
node

AztecNode

logger?

any

Returns

Promise<void>

createAztecNodeClient

createAztecNodeClient: any

Utils / Pub key

utils/pub_key

Functions


generatePublicKey()

generatePublicKey(privateKey): Promise<PublicKey>

Defined in: utils/pub_key.ts:10

Method for generating a public grumpkin key from a private key.

Parameters
privateKey

GrumpkinScalar

The private key.

Returns

Promise<PublicKey>

The generated public key.

Wallet / Account entrypoint meta payment method

wallet/account_entrypoint_meta_payment_method

Classes


AccountEntrypointMetaPaymentMethod

Defined in: wallet/account_entrypoint_meta_payment_method.ts:34

Fee payment method that allows an account contract to pay for its own deployment It works by rerouting the provided fee payment method through the account's entrypoint, which sets itself as fee payer. If no payment method is provided, it is assumed the account will pay with its own fee juice balance.

Usually, in order to pay fees it is necessary to obtain an ExecutionPayload that encodes the necessary information that is sent to the user's account entrypoint, that has plumbing to handle it. If there's no account contract yet (it's being deployed) a MultiCallContract is used, which doesn't have a concept of fees or how to handle this payload. HOWEVER, the account contract's entrypoint does, so this method reshapes that fee payload into a call to the account contract entrypoint being deployed with the original fee payload.

This class can be seen in action in DeployAccountMethod.ts#getSelfPaymentMethod

Implements
Constructors
Constructor

new AccountEntrypointMetaPaymentMethod(wallet, artifact, feePaymentNameOrArtifact, accountAddress, paymentMethod?): AccountEntrypointMetaPaymentMethod

Defined in: wallet/account_entrypoint_meta_payment_method.ts:35

Parameters
wallet

Wallet

artifact

ContractArtifact

feePaymentNameOrArtifact

any

accountAddress

AztecAddress

paymentMethod?

FeePaymentMethod

Returns

AccountEntrypointMetaPaymentMethod

Methods
getAsset()

getAsset(): Promise<AztecAddress>

Defined in: wallet/account_entrypoint_meta_payment_method.ts:43

The asset used to pay the fee.

Returns

Promise<AztecAddress>

Implementation of

FeePaymentMethod.getAsset


getExecutionPayload()

getExecutionPayload(): Promise<ExecutionPayload>

Defined in: wallet/account_entrypoint_meta_payment_method.ts:47

Returns the data to be added to the final execution request to pay the fee in the given asset

Returns

Promise<ExecutionPayload>

The function calls to pay the fee.

Implementation of

FeePaymentMethod.getExecutionPayload


getFeePayer()

getFeePayer(): Promise<AztecAddress>

Defined in: wallet/account_entrypoint_meta_payment_method.ts:98

The expected fee payer for this tx.

Returns

Promise<AztecAddress>

Implementation of

FeePaymentMethod.getFeePayer


getGasSettings()

getGasSettings(): any

Defined in: wallet/account_entrypoint_meta_payment_method.ts:102

The gas settings (if any) used to compute the execution payload of the payment method

Returns

any

Implementation of

FeePaymentMethod.getGasSettings

Wallet / Account manager

wallet/account_manager

Classes


AccountManager

Defined in: wallet/account_manager.ts:21

Manages a user account. Provides methods for calculating the account's address and other related data, plus a helper to return a preconfigured deploy method.

Properties
salt

readonly salt: any

Defined in: wallet/account_manager.ts:30

Contract instantiation salt for the account contract

Accessors
address
Get Signature

get address(): any

Defined in: wallet/account_manager.ts:87

Returns

any

Methods
create()

static create(wallet, secretKey, accountContract, salt?): Promise<AccountManager>

Defined in: wallet/account_manager.ts:33

Parameters
wallet

Wallet

secretKey

Fr

accountContract

AccountContract

salt?

any

Returns

Promise<AccountManager>


getPublicKeys()

protected getPublicKeys(): any

Defined in: wallet/account_manager.ts:53

Returns

any


getPublicKeysHash()

protected getPublicKeysHash(): any

Defined in: wallet/account_manager.ts:57

Returns

any


getAccountInterface()

getAccountInterface(): Promise<AccountInterface>

Defined in: wallet/account_manager.ts:65

Returns the entrypoint for this account as defined by its account contract.

Returns

Promise<AccountInterface>

An entrypoint.


getCompleteAddress()

getCompleteAddress(): Promise<CompleteAddress>

Defined in: wallet/account_manager.ts:76

Gets the calculated complete address associated with this account. Does not require the account to have been published for public execution.

Returns

Promise<CompleteAddress>

The address, partial address, and encryption public key.


getSecretKey()

getSecretKey(): Fr

Defined in: wallet/account_manager.ts:83

Returns the secret key used to derive the rest of the privacy keys for this contract

Returns

Fr


getInstance()

getInstance(): ContractInstanceWithAddress

Defined in: wallet/account_manager.ts:96

Returns the contract instance definition associated with this account. Does not require the account to have been published for public execution.

Returns

ContractInstanceWithAddress

ContractInstance instance.


getAccount()

getAccount(): Promise<AccountWithSecretKey>

Defined in: wallet/account_manager.ts:105

Returns a Wallet instance associated with this account. Use it to create Contract instances to be interacted with from this account.

Returns

Promise<AccountWithSecretKey>

A Wallet instance.


getAccountContract()

getAccountContract(): AccountContract

Defined in: wallet/account_manager.ts:114

Returns the account contract that backs this account.

Returns

AccountContract

The account contract


getDeployMethod()

getDeployMethod(): Promise<DeployAccountMethod<Contract>>

Defined in: wallet/account_manager.ts:122

Returns a preconfigured deploy method that contains all the necessary function calls to deploy the account contract.

Returns

Promise<DeployAccountMethod<Contract>>


hasInitializer()

hasInitializer(): Promise<boolean>

Defined in: wallet/account_manager.ts:151

Returns whether this account contract has an initializer function.

Returns

Promise<boolean>

Wallet / Base wallet

wallet/base_wallet

Classes

Type Aliases


BaseWallet

Defined in: wallet/base_wallet.ts:72

A base class for Wallet implementations

Implements
Constructors
Constructor

protected new BaseWallet(pxe, aztecNode): BaseWallet

Defined in: wallet/base_wallet.ts:79

Parameters
pxe

any

aztecNode

AztecNode

Returns

BaseWallet

Properties
log

protected log: any

Defined in: wallet/base_wallet.ts:73


baseFeePadding

protected baseFeePadding: number = 0.5

Defined in: wallet/base_wallet.ts:75


cancellableTransactions

protected cancellableTransactions: boolean = false

Defined in: wallet/base_wallet.ts:76


pxe

protected readonly pxe: any

Defined in: wallet/base_wallet.ts:82


aztecNode

protected readonly aztecNode: AztecNode

Defined in: wallet/base_wallet.ts:83

Methods
getAccountFromAddress()

abstract protected getAccountFromAddress(address): Promise<Account>

Defined in: wallet/base_wallet.ts:86

Parameters
address

AztecAddress

Returns

Promise<Account>


getAccounts()

abstract getAccounts(): Promise<Aliased<AztecAddress>[]>

Defined in: wallet/base_wallet.ts:88

Returns

Promise<Aliased<AztecAddress>[]>

Implementation of

Wallet.getAccounts


getAddressBook()

getAddressBook(): Promise<Aliased<AztecAddress>[]>

Defined in: wallet/base_wallet.ts:97

Returns the list of aliased contacts associated with the wallet. This base implementation directly returns PXE's senders, but note that in general contacts are a superset of senders.

  • Senders: Addresses we check during synching in case they sent us notes,
  • Contacts: more general concept akin to a phone's contact list.
Returns

Promise<Aliased<AztecAddress>[]>

The aliased collection of AztecAddresses that form this wallet's address book

Implementation of

Wallet.getAddressBook


getChainInfo()

getChainInfo(): Promise<ChainInfo>

Defined in: wallet/base_wallet.ts:102

Returns

Promise<ChainInfo>

Implementation of

Wallet.getChainInfo


createTxExecutionRequestFromPayloadAndFee()

protected createTxExecutionRequestFromPayloadAndFee(executionPayload, from, feeOptions): Promise<TxExecutionRequest>

Defined in: wallet/base_wallet.ts:107

Parameters
executionPayload

ExecutionPayload

from

AztecAddress

feeOptions

FeeOptions

Returns

Promise<TxExecutionRequest>


createAuthWit()

createAuthWit(from, messageHashOrIntent): Promise<AuthWitness>

Defined in: wallet/base_wallet.ts:125

Parameters
from

AztecAddress

messageHashOrIntent

any

Returns

Promise<AuthWitness>

Implementation of

Wallet.createAuthWit


batch()

batch<T>(methods): Promise<BatchResults<T>>

Defined in: wallet/base_wallet.ts:133

Type Parameters
T

T extends readonly BatchedMethod<"registerContract" | "sendTx" | "registerSender" | "simulateUtility">[]

Parameters
methods

T

Returns

Promise<BatchResults<T>>

Implementation of

Wallet.batch


getDefaultFeeOptions()

protected getDefaultFeeOptions(from, userFeeOptions?): Promise<FeeOptions>

Defined in: wallet/base_wallet.ts:160

Returns default values for the transaction fee options if they were omitted by the user.

Parameters
from

AztecAddress

The address where the transaction is being sent from

userFeeOptions?

UserFeeOptions

User-provided fee options, which might be incomplete

Returns

Promise<FeeOptions>

  • Populated fee options that can be used to create a transaction execution request

getFeeOptionsForGasEstimation()

protected getFeeOptionsForGasEstimation(from, userFeeOptions?): Promise<{ walletFeePaymentMethod?: FeePaymentMethod; accountFeePaymentMethodOptions: AccountFeePaymentMethodOptions; gasSettings: any; }>

Defined in: wallet/base_wallet.ts:192

Returns unreasonably high gas limits in order to execute a simulation with the goal of estimating its gas cost. It will otherwise try to respect the user-specified fee options, filling the gaps with default values as needed.

Parameters
from

AztecAddress

The address where the transaction is being sent from

userFeeOptions?

UserFeeOptions

User-provided fee options to use as a basis for the fully populated FeeOptions type.

Returns

Promise<{ walletFeePaymentMethod?: FeePaymentMethod; accountFeePaymentMethodOptions: AccountFeePaymentMethodOptions; gasSettings: any; }>


registerSender()

registerSender(address, _alias): Promise<AztecAddress>

Defined in: wallet/base_wallet.ts:211

Parameters
address

AztecAddress

_alias

string = ''

Returns

Promise<AztecAddress>

Implementation of

Wallet.registerSender


registerContract()

registerContract(instanceData, artifact?, secretKey?): Promise<ContractInstanceWithAddress>

Defined in: wallet/base_wallet.ts:215

Parameters
instanceData

any

artifact?

any

secretKey?

any

Returns

Promise<ContractInstanceWithAddress>

Implementation of

Wallet.registerContract


simulateTx()

simulateTx(executionPayload, opts): Promise<TxSimulationResult>

Defined in: wallet/base_wallet.ts:270

Parameters
executionPayload

ExecutionPayload

opts

SimulateOptions

Returns

Promise<TxSimulationResult>

Implementation of

Wallet.simulateTx


profileTx()

profileTx(executionPayload, opts): Promise<TxProfileResult>

Defined in: wallet/base_wallet.ts:283

Parameters
executionPayload

ExecutionPayload

opts

ProfileOptions

Returns

Promise<TxProfileResult>

Implementation of

Wallet.profileTx


sendTx()

sendTx(executionPayload, opts): Promise<TxHash>

Defined in: wallet/base_wallet.ts:289

Parameters
executionPayload

ExecutionPayload

opts

SendOptions

Returns

Promise<TxHash>

Implementation of

Wallet.sendTx


contextualizeError()

protected contextualizeError(err, ...context): Error

Defined in: wallet/base_wallet.ts:306

Parameters
err

Error

context

...string[]

Returns

Error


simulateUtility()

simulateUtility(functionName, args, to, authwits?, from?): Promise<UtilitySimulationResult>

Defined in: wallet/base_wallet.ts:320

Parameters
functionName

string

args

any[]

to

AztecAddress

authwits?

AuthWitness[]

from?

any

Returns

Promise<UtilitySimulationResult>

Implementation of

Wallet.simulateUtility


getContractClassMetadata()

getContractClassMetadata(id, includeArtifact): Promise<ContractClassMetadata>

Defined in: wallet/base_wallet.ts:330

Parameters
id

Fr

includeArtifact

boolean = false

Returns

Promise<ContractClassMetadata>

Implementation of

Wallet.getContractClassMetadata


getContractMetadata()

getContractMetadata(address): Promise<ContractMetadata>

Defined in: wallet/base_wallet.ts:333

Parameters
address

AztecAddress

Returns

Promise<ContractMetadata>

Implementation of

Wallet.getContractMetadata


getTxReceipt()

getTxReceipt(txHash): Promise<TxReceipt>

Defined in: wallet/base_wallet.ts:337

Parameters
txHash

TxHash

Returns

Promise<TxReceipt>

Implementation of

Wallet.getTxReceipt


getPrivateEvents()

getPrivateEvents<T>(contractAddress, event, from, limit, recipients): Promise<T[]>

Defined in: wallet/base_wallet.ts:341

Type Parameters
T

T

Parameters
contractAddress

AztecAddress

event

EventMetadataDefinition

from

number

limit

number

recipients

AztecAddress[] = []

Returns

Promise<T[]>

Implementation of

Wallet.getPrivateEvents

FeeOptions

FeeOptions = object

Defined in: wallet/base_wallet.ts:57

Options to configure fee payment for a transaction

Properties
walletFeePaymentMethod?

optional walletFeePaymentMethod: FeePaymentMethod

Defined in: wallet/base_wallet.ts:62

A wallet-provided fallback fee payment method that is used only if the transaction that is being constructed doesn't already include one


accountFeePaymentMethodOptions

accountFeePaymentMethodOptions: createAztecNodeClient

Defined in: wallet/base_wallet.ts:64

Configuration options for the account to properly handle the selected fee payment method


gasSettings

gasSettings: createAztecNodeClient

Defined in: wallet/base_wallet.ts:66

The gas settings to use for the transaction

Wallet / Deploy account method

wallet/deploy_account_method

Classes

Type Aliases


DeployAccountMethod<TContract>

Defined in: wallet/deploy_account_method.ts:42

Modified version of the DeployMethod used to deploy account contracts. Supports deploying contracts that can pay for their own fee, plus some preconfigured options to avoid errors.

Extends
Type Parameters
TContract

TContract extends ContractBase = Contract

Constructors
Constructor

new DeployAccountMethod<TContract>(publicKeys, wallet, artifact, postDeployCtor, salt, args, constructorNameOrArtifact?): DeployAccountMethod<TContract>

Defined in: wallet/deploy_account_method.ts:43

Parameters
publicKeys

PublicKeys

wallet

Wallet

artifact

ContractArtifact

postDeployCtor

(address, wallet) => Promise<TContract>

salt

Fr

args

any[] = []

constructorNameOrArtifact?

any

Returns

DeployAccountMethod<TContract>

Overrides

DeployMethod.constructor

Properties
log

protected log: any

Defined in: contract/base_contract_interaction.ts:15

Inherited from

DeployMethod.log


wallet

protected wallet: Wallet

Defined in: contract/base_contract_interaction.ts:18

Inherited from

DeployMethod.wallet


authWitnesses

protected authWitnesses: AuthWitness[] = []

Defined in: contract/base_contract_interaction.ts:19

Inherited from

DeployMethod.authWitnesses


capsules

protected capsules: Capsule[] = []

Defined in: contract/base_contract_interaction.ts:20

Inherited from

DeployMethod.capsules


artifact

protected artifact: ContractArtifact

Defined in: contract/deploy_method.ts:109

Inherited from

DeployMethod.artifact


postDeployCtor()

protected postDeployCtor: (address, wallet) => Promise<TContract>

Defined in: contract/deploy_method.ts:110

Parameters
address

AztecAddress

wallet

Wallet

Returns

Promise<TContract>

Inherited from

DeployMethod.postDeployCtor

Accessors
address
Get Signature

get address(): any

Defined in: contract/deploy_method.ts:307

Return this deployment address.

Returns

any

Inherited from

DeployMethod.address


partialAddress
Get Signature

get partialAddress(): any

Defined in: contract/deploy_method.ts:312

Returns the partial address for this deployment.

Returns

any

Inherited from

DeployMethod.partialAddress

Methods
register()

register(options?): Promise<TContract>

Defined in: contract/deploy_method.ts:155

Adds this contract to the wallet and returns the Contract object.

Parameters
options?

RequestDeployOptions

Deployment options.

Returns

Promise<TContract>

Inherited from

DeployMethod.register


getPublicationExecutionPayload()

protected getPublicationExecutionPayload(options?): Promise<ExecutionPayload>

Defined in: contract/deploy_method.ts:169

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.
Parameters
options?

RequestDeployOptions

Contract creation options.

Returns

Promise<ExecutionPayload>

An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.

Inherited from

DeployMethod.getPublicationExecutionPayload


getInitializationExecutionPayload()

protected getInitializationExecutionPayload(options?): Promise<ExecutionPayload>

Defined in: contract/deploy_method.ts:216

Returns the calls necessary to initialize the contract.

Parameters
options?

RequestDeployOptions

Deployment options.

Returns

Promise<ExecutionPayload>

  • An array of function calls.
Inherited from

DeployMethod.getInitializationExecutionPayload


send()

send(options): DeploySentTx<TContract>

Defined in: contract/deploy_method.ts:239

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.

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.

Inherited from

DeployMethod.send


getInstance()

getInstance(options?): Promise<ContractInstanceWithAddress>

Defined in: contract/deploy_method.ts:255

Builds the contract instance and returns it.

Parameters
options?

RequestDeployOptions

An object containing various initialization and publication options.

Returns

Promise<ContractInstanceWithAddress>

An instance object.

Inherited from

DeployMethod.getInstance


simulate()

simulate(options): Promise<{ stats: SimulationStats; offchainEffects: OffchainEffect[]; result: any; estimatedGas: Pick<createAztecNodeClient, "gasLimits" | "teardownGasLimits">; }>

Defined in: contract/deploy_method.ts:275

Simulate the deployment

Parameters
options

SimulateDeployOptions

An optional object containing additional configuration for the simulation.

Returns

Promise<{ stats: SimulationStats; offchainEffects: OffchainEffect[]; result: any; estimatedGas: Pick<createAztecNodeClient, "gasLimits" | "teardownGasLimits">; }>

A simulation result object containing metadata of the execution, including gas estimations (if requested via options), execution statistics and emitted offchain effects

Inherited from

DeployMethod.simulate


profile()

profile(options): Promise<TxProfileResult>

Defined in: contract/deploy_method.ts:297

Simulate a deployment and profile the gate count for each function in the transaction.

Parameters
options

Omit<RequestDeployOptions, "deployer"> & object & Pick<SendInteractionOptions, "fee" | "from"> & Omit<SendInteractionOptions, "fee"> & object & object

Same options as send, plus extra profiling options.

Returns

Promise<TxProfileResult>

An object containing the function return value and profile result.

Inherited from

DeployMethod.profile


with()

with(options): DeployMethod

Defined in: contract/deploy_method.ts:321

Augments this DeployMethod with additional metadata, such as authWitnesses and capsules.

Parameters
options

An object containing the metadata to add to the interaction

authWitnesses?

AuthWitness[] = []

The authWitnesses to add to the deployment

capsules?

Capsule[] = []

The capsules to add to the deployment

Returns

DeployMethod

A new DeployMethod with the added metadata, but calling the same original function in the same manner

Inherited from

DeployMethod.with


request()

request(opts?): Promise<ExecutionPayload>

Defined in: wallet/deploy_account_method.ts:83

Returns the execution payload that allows this operation to happen on chain.

Parameters
opts?

RequestDeployAccountOptions

Configuration options.

Returns

Promise<ExecutionPayload>

The execution payload for this operation

Overrides

DeployMethod.request


convertDeployOptionsToRequestOptions()

convertDeployOptionsToRequestOptions(options): RequestDeployOptions

Defined in: wallet/deploy_account_method.ts:115

Parameters
options

DeployOptions

Returns

RequestDeployOptions

Overrides

DeployMethod.convertDeployOptionsToRequestOptions

DeployAccountOptions

DeployAccountOptions = Omit<DeployOptions, "contractAddressSalt" | "universalDeploy">

Defined in: wallet/deploy_account_method.ts:30

The configuration options for the send/prove methods. Omits:

  • The contractAddressSalt, since for account contracts that is fixed in the constructor.
  • UniversalDeployment flag, since account contracts are always deployed with it set to true

RequestDeployAccountOptions

RequestDeployAccountOptions = Omit<RequestDeployOptions, "contractAddressSalt">

Defined in: wallet/deploy_account_method.ts:23

The configuration options for the request method. Omits the contractAddressSalt, since for account contracts that is fixed in the constructor

SimulateDeployAccountOptions

SimulateDeployAccountOptions = Omit<SimulateDeployOptions, "contractAddressSalt">

Defined in: wallet/deploy_account_method.ts:36

The configuration options for the simulate method. Omits the contractAddressSalt, since for account contracts that is fixed in the constructor

Wallet / Wallet

wallet/wallet

Type Aliases

Variables


Aliased<T>

Aliased<T> = object

Defined in: wallet/wallet.ts:50

A wrapper type that allows any item to be associated with an alias.

Type Parameters
T

T

Properties
alias

alias: string

Defined in: wallet/wallet.ts:54

The alias


item

item: T

Defined in: wallet/wallet.ts:58

The item being aliased.

BatchableMethods

BatchableMethods = Pick<Wallet, "registerContract" | "sendTx" | "registerSender" | "simulateUtility">

Defined in: wallet/wallet.ts:110

Helper type that represents all methods that can be batched.

BatchedMethod<T>

BatchedMethod<T> = object

Defined in: wallet/wallet.ts:116

From the batchable methods, we create a type that represents a method call with its name and arguments. This is what the wallet will accept as arguments to the batch method.

Type Parameters
T

T extends keyof BatchableMethods

Properties
name

name: T

Defined in: wallet/wallet.ts:118

The method name


args

args: Parameters<BatchableMethods[T]>

Defined in: wallet/wallet.ts:120

The method arguments

BatchedMethodResult<T>

BatchedMethodResult<T> = T extends BatchedMethod<infer K> ? Awaited<ReturnType<BatchableMethods[K]>> : never

Defined in: wallet/wallet.ts:126

Helper type to extract the return type of a batched method

Type Parameters
T

T

BatchedMethodResultWrapper<T>

BatchedMethodResultWrapper<T> = object

Defined in: wallet/wallet.ts:134

Wrapper type for batch results that includes the method name for discriminated union deserialization. Each result is wrapped as { name: 'methodName', result: ActualResult } to allow proper deserialization when AztecAddress and TxHash would otherwise be ambiguous (both are hex strings).

Type Parameters
T

T extends BatchedMethod<keyof BatchableMethods>

Properties
name

name: T["name"]

Defined in: wallet/wallet.ts:136

The method name


result

result: BatchedMethodResult<T>

Defined in: wallet/wallet.ts:138

The method result

BatchResults<T>

BatchResults<T> = { [K in keyof T]: BatchedMethodResultWrapper<T[K]> }

Defined in: wallet/wallet.ts:144

Maps a tuple of BatchedMethod to a tuple of their wrapped return types

Type Parameters
T

T extends readonly BatchedMethod<keyof BatchableMethods>[]

ContractInstanceAndArtifact

ContractInstanceAndArtifact = Pick<Contract, "artifact" | "instance">

Defined in: wallet/wallet.ts:64

A reduced representation of a Contract, only including its instance and artifact

ProfileOptions

ProfileOptions = Omit<ProfileInteractionOptions, "fee"> & object

Defined in: wallet/wallet.ts:92

Options for profiling interactions with the wallet. Overrides the fee settings of an interaction with a simplified version that only hints at the wallet wether the interaction contains a fee payment method or not

Type Declaration
fee?

optional fee: UserFeeOptions

The fee options

SendOptions

SendOptions = Omit<SendInteractionOptions, "fee"> & object

Defined in: wallet/wallet.ts:102

Options for sending/proving interactions with the wallet. Overrides the fee settings of an interaction with a simplified version that only hints at the wallet wether the interaction contains a fee payment method or not

Type Declaration
fee?

optional fee: UserFeeOptions

The fee options

SimulateOptions

SimulateOptions = Omit<SimulateInteractionOptions, "fee"> & object

Defined in: wallet/wallet.ts:82

Options for simulating interactions with the wallet. Overrides the fee settings of an interaction with a simplified version that only hints at the wallet wether the interaction contains a fee payment method or not

Type Declaration
fee?

optional fee: UserFeeOptions & FeeEstimationOptions

The fee options

UserFeeOptions

UserFeeOptions = object & GasSettingsOption

Defined in: wallet/wallet.ts:69

Options that can be provided to the wallet for configuration of the fee payment.

Type Declaration
embeddedPaymentMethodFeePayer?

optional embeddedPaymentMethodFeePayer: createAztecNodeClient

Informs the wallet that the crafted tx already contains the necessary calls to pay for its fee and who is paying

Wallet

Wallet = object

Defined in: wallet/wallet.ts:151

The wallet interface.

Methods
getContractClassMetadata()

getContractClassMetadata(id, includeArtifact?): Promise<ContractClassMetadata>

Defined in: wallet/wallet.ts:152

Parameters
id

Fr

includeArtifact?

boolean

Returns

Promise<ContractClassMetadata>


getContractMetadata()

getContractMetadata(address): Promise<ContractMetadata>

Defined in: wallet/wallet.ts:153

Parameters
address

AztecAddress

Returns

Promise<ContractMetadata>


getPrivateEvents()

getPrivateEvents<T>(contractAddress, eventMetadata, from, numBlocks, recipients): Promise<T[]>

Defined in: wallet/wallet.ts:154

Type Parameters
T

T

Parameters
contractAddress

AztecAddress

eventMetadata

EventMetadataDefinition

from

number

numBlocks

number

recipients

AztecAddress[]

Returns

Promise<T[]>


getChainInfo()

getChainInfo(): Promise<ChainInfo>

Defined in: wallet/wallet.ts:161

Returns

Promise<ChainInfo>


getTxReceipt()

getTxReceipt(txHash): Promise<TxReceipt>

Defined in: wallet/wallet.ts:162

Parameters
txHash

TxHash

Returns

Promise<TxReceipt>


registerSender()

registerSender(address, alias?): Promise<AztecAddress>

Defined in: wallet/wallet.ts:163

Parameters
address

AztecAddress

alias?

string

Returns

Promise<AztecAddress>


getAddressBook()

getAddressBook(): Promise<Aliased<AztecAddress>[]>

Defined in: wallet/wallet.ts:164

Returns

Promise<Aliased<AztecAddress>[]>


getAccounts()

getAccounts(): Promise<Aliased<AztecAddress>[]>

Defined in: wallet/wallet.ts:165

Returns

Promise<Aliased<AztecAddress>[]>


registerContract()
Call Signature

registerContract(instanceData): Promise<ContractInstanceWithAddress>

Defined in: wallet/wallet.ts:166

Parameters
instanceData

any

Returns

Promise<ContractInstanceWithAddress>

Call Signature

registerContract(instanceData, artifact): Promise<ContractInstanceWithAddress>

Defined in: wallet/wallet.ts:170

Parameters
instanceData

any

artifact

ContractArtifact

Returns

Promise<ContractInstanceWithAddress>

Call Signature

registerContract(instanceData, artifact, secretKey): Promise<ContractInstanceWithAddress>

Defined in: wallet/wallet.ts:174

Parameters
instanceData

any

artifact

any

secretKey

any

Returns

Promise<ContractInstanceWithAddress>


simulateTx()

simulateTx(exec, opts): Promise<TxSimulationResult>

Defined in: wallet/wallet.ts:179

Parameters
exec

ExecutionPayload

opts

SimulateOptions

Returns

Promise<TxSimulationResult>


simulateUtility()

simulateUtility(functionName, args, to, authwits?): Promise<UtilitySimulationResult>

Defined in: wallet/wallet.ts:180

Parameters
functionName

string

args

any[]

to

AztecAddress

authwits?

AuthWitness[]

Returns

Promise<UtilitySimulationResult>


profileTx()

profileTx(exec, opts): Promise<TxProfileResult>

Defined in: wallet/wallet.ts:186

Parameters
exec

ExecutionPayload

opts

ProfileOptions

Returns

Promise<TxProfileResult>


sendTx()

sendTx(exec, opts): Promise<TxHash>

Defined in: wallet/wallet.ts:187

Parameters
exec

ExecutionPayload

opts

SendOptions

Returns

Promise<TxHash>


createAuthWit()

createAuthWit(from, messageHashOrIntent): Promise<AuthWitness>

Defined in: wallet/wallet.ts:188

Parameters
from

AztecAddress

messageHashOrIntent

any

Returns

Promise<AuthWitness>


batch()

batch<T>(methods): Promise<BatchResults<T>>

Defined in: wallet/wallet.ts:192

Type Parameters
T

T extends readonly BatchedMethod<"registerContract" | "sendTx" | "registerSender" | "simulateUtility">[]

Parameters
methods

T

Returns

Promise<BatchResults<T>>

BatchedMethodSchema

const BatchedMethodSchema: any

Defined in: wallet/wallet.ts:278

ContractClassMetadataSchema

const ContractClassMetadataSchema: ZodFor<ContractClassMetadata>

Defined in: wallet/wallet.ts:303

ContractInstantiationDataSchema

const ContractInstantiationDataSchema: any

Defined in: wallet/wallet.ts:195

ContractMetadataSchema

const ContractMetadataSchema: ZodFor<ContractMetadata>

Defined in: wallet/wallet.ts:297

EventMetadataDefinitionSchema

const EventMetadataDefinitionSchema: any

Defined in: wallet/wallet.ts:309

ExecutionPayloadSchema

const ExecutionPayloadSchema: any

Defined in: wallet/wallet.ts:215

FunctionCallSchema

const FunctionCallSchema: any

Defined in: wallet/wallet.ts:204

InstanceDataSchema

const InstanceDataSchema: any

Defined in: wallet/wallet.ts:261

MessageHashOrIntentSchema

const MessageHashOrIntentSchema: any

Defined in: wallet/wallet.ts:268

ProfileOptionsSchema

const ProfileOptionsSchema: any

Defined in: wallet/wallet.ts:256

SendOptionsSchema

const SendOptionsSchema: any

Defined in: wallet/wallet.ts:239

SimulateOptionsSchema

const SimulateOptionsSchema: any

Defined in: wallet/wallet.ts:246

UserFeeOptionsSchema

const UserFeeOptionsSchema: any

Defined in: wallet/wallet.ts:222

WalletSchema

const WalletSchema: createAztecNodeClient<Wallet>

Defined in: wallet/wallet.ts:315

WalletSimulationFeeOptionSchema

const WalletSimulationFeeOptionSchema: any

Defined in: wallet/wallet.ts:234