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