Aztec.js API Reference (TypeDoc)
This documentation is auto-generated from the Aztec.js TypeScript source code using TypeDoc.
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 contract
- Account / Account with secret key
- Account / Interface
- Account / Signerless account
- Authorization / Call authorization request
- Contract / Base contract interaction
- Contract / Batch call
- Contract / Checker
- Contract / Contract
- Contract / Contract base
- Contract / Contract function interaction
- Contract / Deploy method
- Contract / Deploy sent tx
- Contract / Get gas limits
- Contract / Interaction options
- Contract / Protocol contracts
- Contract / Sent tx
- Contract / Unsafe contract
- Contract / Wait for proven
- Deployment / Broadcast function
- Deployment / Contract deployer
- Deployment / Publish class
- Deployment / Publish instance
- Ethereum / Portal manager
- Fee / Fee juice payment method with claim
- Fee / Fee payment method
- Fee / Private fee payment method
- Fee / Public fee payment method
- Fee / Sponsored fee payment
- Utils / Abi types
- Utils / Authwit
- Utils / Cross chain
- Utils / Fee juice
- Utils / Field compressed string
- Utils / Node
- Utils / Pub key
- Wallet / Account entrypoint meta payment method
- Wallet / Account manager
- Wallet / Base wallet
- Wallet / Deploy account method
- Wallet / Wallet
- Aliased
- BatchableMethods
- BatchedMethod
- BatchedMethodResult
- BatchedMethodResultWrapper
- BatchResults
- ContractInstanceAndArtifact
- ProfileOptions
- SendOptions
- SimulateOptions
- UserFeeOptions
- Wallet
- BatchedMethodSchema
- ContractClassMetadataSchema
- ContractInstantiationDataSchema
- ContractMetadataSchema
- EventMetadataDefinitionSchema
- ExecutionPayloadSchema
- FunctionCallSchema
- InstanceDataSchema
- MessageHashOrIntentSchema
- ProfileOptionsSchema
- SendOptionsSchema
- SimulateOptionsSchema
- UserFeeOptionsSchema
- WalletSchema
- WalletSimulationFeeOptionSchema
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
Returns
BaseAccount
Properties
account
protectedaccount: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
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
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
secretKey
Fr
salt
any
Deployment salt for this account contract.
Returns
AccountWithSecretKey
Overrides
Properties
account
protectedaccount:AccountInterface
Defined in: account/account.ts:35
Inherited from
salt
readonlysalt: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
getVersion()
getVersion():
Fr
Defined in: account/account.ts:49
Returns the rollup version for this account
Returns
Fr
Inherited from
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
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
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()
staticgetSelector():Promise<AuthorizationSelector>
Defined in: authorization/call_authorization_request.ts:41
Returns
Promise<AuthorizationSelector>
fromFields()
staticfromFields(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
authWitnesses
AuthWitness[] = []
capsules
Capsule[] = []
Returns
BaseContractInteraction
Properties
log
protectedlog:any
Defined in: contract/base_contract_interaction.ts:15
wallet
protectedwallet:Wallet
Defined in: contract/base_contract_interaction.ts:18
authWitnesses
protectedauthWitnesses:AuthWitness[] =[]
Defined in: contract/base_contract_interaction.ts:19
capsules
protectedcapsules:Capsule[] =[]
Defined in: contract/base_contract_interaction.ts:20
Methods
request()
abstractrequest(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?
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
An object containing 'from' property representing the AztecAddress of the sender and optional fee configuration
Returns
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
interactions
any[]
Returns
BatchCall
Overrides
BaseContractInteraction.constructor
Properties
log
protectedlog:any
Defined in: contract/base_contract_interaction.ts:15
Inherited from
wallet
protectedwallet:Wallet
Defined in: contract/base_contract_interaction.ts:18
Inherited from
BaseContractInteraction.wallet
authWitnesses
protectedauthWitnesses:AuthWitness[] =[]
Defined in: contract/base_contract_interaction.ts:19
Inherited from
BaseContractInteraction.authWitnesses
capsules
protectedcapsules:Capsule[] =[]
Defined in: contract/base_contract_interaction.ts:20
Inherited from
BaseContractInteraction.capsules
interactions
protectedinteractions: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
An object containing 'from' property representing the AztecAddress of the sender and optional fee configuration
Returns
A SentTx instance for tracking the transaction status and information.
Inherited from
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:
- It returns the values of the function execution
- It supports
utility,privateandpublicfunctions
Parameters
options
An optional object containing additional configuration for the transaction.
Returns
Promise<any>
The result of the transaction as returned by the contract function.
getExecutionPayloads()
protectedgetExecutionPayloads():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
protectednew 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
The wallet used for interacting with this contract.
Returns
Contract
Inherited from
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
instance
readonlyinstance:ContractInstanceWithAddress
Defined in: contract/contract_base.ts:42
The deployed contract instance definition.
Inherited from
artifact
readonlyartifact:ContractArtifact
Defined in: contract/contract_base.ts:44
The Application Binary Interface for the contract.
Inherited from
wallet
wallet:
Wallet
Defined in: contract/contract_base.ts:46
The wallet used for interacting with this contract.
Inherited from
Accessors
address
Get Signature
get address():
any
Defined in: contract/contract_base.ts:66
Address of the contract.
Returns
any
Inherited from
partialAddress
Get Signature
get partialAddress():
any
Defined in: contract/contract_base.ts:71
Partial address of the contract.
Returns
any
Inherited from
Methods
at()
staticat(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
The wallet to use when interacting with the contract.
Returns
Promise<Contract>
A promise that resolves to a new Contract instance.
deploy()
staticdeploy(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
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()
staticdeployWithPublicKeys(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
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 to use for sending txs.
Returns
this
A new contract instance.
Inherited from
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
protectednew 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
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
readonlyinstance:ContractInstanceWithAddress
Defined in: contract/contract_base.ts:42
The deployed contract instance definition.
artifact
readonlyartifact: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 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
contractAddress
AztecAddress
functionDao
FunctionAbi
args
any[]
authWitnesses
AuthWitness[] = []
capsules
Capsule[] = []
extraHashedArgs
HashedValues[] = []
Returns
ContractFunctionInteraction
Overrides
BaseContractInteraction.constructor
Properties
log
protectedlog:any
Defined in: contract/base_contract_interaction.ts:15
Inherited from
wallet
protectedwallet:Wallet
Defined in: contract/base_contract_interaction.ts:18
Inherited from
BaseContractInteraction.wallet
authWitnesses
protectedauthWitnesses:AuthWitness[] =[]
Defined in: contract/base_contract_interaction.ts:19
Inherited from
BaseContractInteraction.authWitnesses
capsules
protectedcapsules:Capsule[] =[]
Defined in: contract/base_contract_interaction.ts:20
Inherited from
BaseContractInteraction.capsules
contractAddress
protectedcontractAddress:AztecAddress
Defined in: contract/contract_function_interaction.ts:26
functionDao
protectedfunctionDao:FunctionAbi
Defined in: contract/contract_function_interaction.ts:27
args
protectedargs: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
An object containing 'from' property representing the AztecAddress of the sender and optional fee configuration
Returns
A SentTx instance for tracking the transaction status and information.
Inherited from
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:
- It returns the values of the function execution, plus additional metadata if requested
- It supports
utility,privateandpublicfunctions
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:
- It returns the values of the function execution, plus additional metadata if requested
- It supports
utility,privateandpublicfunctions
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
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
artifact
ContractArtifact
postDeployCtor
(address, wallet) => Promise<TContract>
args
any[] = []
constructorNameOrArtifact?
any
authWitnesses?
AuthWitness[] = []
capsules?
Capsule[] = []
Returns
DeployMethod<TContract>
Overrides
BaseContractInteraction.constructor
Properties
log
protectedlog:any
Defined in: contract/base_contract_interaction.ts:15
Inherited from
wallet
protectedwallet:Wallet
Defined in: contract/base_contract_interaction.ts:18
Inherited from
BaseContractInteraction.wallet
authWitnesses
protectedauthWitnesses:AuthWitness[] =[]
Defined in: contract/base_contract_interaction.ts:19
Inherited from
BaseContractInteraction.authWitnesses
capsules
protectedcapsules:Capsule[] =[]
Defined in: contract/base_contract_interaction.ts:20
Inherited from
BaseContractInteraction.capsules
artifact
protectedartifact:ContractArtifact
Defined in: contract/deploy_method.ts:109
postDeployCtor()
protectedpostDeployCtor: (address,wallet) =>Promise<TContract>
Defined in: contract/deploy_method.ts:110
Parameters
address
AztecAddress
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?
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
Returns
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?
Deployment options.
Returns
Promise<TContract>
getPublicationExecutionPayload()
protectedgetPublicationExecutionPayload(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?
Contract creation options.
Returns
Promise<ExecutionPayload>
An execution payload with potentially calls (and bytecode capsule) to the class registry and instance registry.
getInitializationExecutionPayload()
protectedgetInitializationExecutionPayload(options?):Promise<ExecutionPayload>
Defined in: contract/deploy_method.ts:216
Returns the calls necessary to initialize the contract.
Parameters
options?
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
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
getInstance()
getInstance(
options?):Promise<ContractInstanceWithAddress>
Defined in: contract/deploy_method.ts:255
Builds the contract instance and returns it.
Parameters
options?
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
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?
optionaluniversalDeploy: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?
optionalcontractAddressSalt:createAztecNodeClient
An optional salt value used to deterministically calculate the contract address.
deployer?
optionaldeployer: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?
optionalskipClassPublication:boolean
Skip contract class publication.
skipInstancePublication?
optionalskipInstancePublication:boolean
Skip publication, instead just privately initialize the contract.
skipInitialization?
optionalskipInitialization: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?
optionalfee:SimulationInteractionFeeOptions
The fee options for the transaction.
skipTxValidation?
optionalskipTxValidation:boolean
Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers.
skipFeeEnforcement?
optionalskipFeeEnforcement:boolean
Whether to ensure the fee payer is not empty and has enough balance to pay for the fee.
includeMetadata?
optionalincludeMetadata: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
sendTx
() => Promise<TxHash>
postDeployCtor
(address, wallet) => Promise<TContract>
instanceGetter
() => Promise<ContractInstanceWithAddress>
A getter for the deployed contract instance
Returns
DeploySentTx<TContract>
Overrides
Properties
instanceGetter()
instanceGetter: () =>
Promise<ContractInstanceWithAddress>
Defined in: contract/deploy_sent_tx.ts:35
A getter for the deployed contract instance
Returns
Promise<ContractInstanceWithAddress>
sendTxPromise
protectedsendTxPromise:Promise<void>
Defined in: contract/sent_tx.ts:32
Inherited from
sendTxError?
protectedoptionalsendTxError:Error
Defined in: contract/sent_tx.ts:33
Inherited from
txHash?
protectedoptionaltxHash:any
Defined in: contract/sent_tx.ts:34
Inherited from
walletOrNode
protectedwalletOrNode:any
Defined in: contract/sent_tx.ts:37
Inherited from
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?
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?
Options for configuring the waiting for the tx to be mined.
Returns
Promise<any>
The transaction receipt with the deployed contract instance.
Overrides
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
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
waitForReceipt()
protectedwaitForReceipt(opts?):Promise<TxReceipt>
Defined in: contract/sent_tx.ts:101
Parameters
opts?
Returns
Promise<TxReceipt>
Inherited from
DeployedWaitOpts
DeployedWaitOpts =
WaitOpts&object
Defined in: contract/deploy_sent_tx.ts:13
Options related to waiting for a deployment tx.
Type Declaration
wallet?
optionalwallet: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
- FeeEstimationOptions
- FeePaymentMethodOption
- GasSettingsOption
- InteractionFeeOptions
- SimulationInteractionFeeOptions
- RequestInteractionOptions
- SendInteractionOptions
- SimulateInteractionOptions
- ProfileInteractionOptions
- SimulationReturn
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
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
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
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?
optionalestimateGas: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?
optionalestimatedGasPadding: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?
optionalpaymentMethod: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?
optionalgasSettings: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?
optionalskipProofGeneration: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?
optionalauthWitnesses:createAztecNodeClient[]
Defined in: contract/interaction_options.ts:50
Extra authwits to use during execution
capsules?
optionalcapsules:createAztecNodeClient[]
Defined in: contract/interaction_options.ts:52
Extra capsules to use during execution
fee?
optionalfee: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?
optionalfee: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?
optionalfee:SimulationInteractionFeeOptions
The fee options for the transaction.
skipTxValidation?
optionalskipTxValidation:boolean
Simulate without checking for the validity of the resulting transaction, e.g. whether it emits any existing nullifiers.
skipFeeEnforcement?
optionalskipFeeEnforcement:boolean
Whether to ensure the fee payer is not empty and has enough balance to pay for the fee.
includeMetadata?
optionalincludeMetadata: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> =Textendstrue?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
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
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
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
protectedsendTxPromise:Promise<void>
Defined in: contract/sent_tx.ts:32
sendTxError?
protectedoptionalsendTxError:Error
Defined in: contract/sent_tx.ts:33
txHash?
protectedoptionaltxHash:any
Defined in: contract/sent_tx.ts:34
walletOrNode
protectedwalletOrNode: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?
Options for configuring the waiting for the tx to be mined.
Returns
Promise<FieldsOf<TxReceipt>>
The transaction receipt.
waitForReceipt()
protectedwaitForReceipt(opts?):Promise<TxReceipt>
Defined in: contract/sent_tx.ts:101
Parameters
opts?
Returns
Promise<TxReceipt>
WaitOpts
WaitOpts =
object
Defined in: contract/sent_tx.ts:10
Options related to waiting for a tx.
Properties
ignoreDroppedReceiptsFor?
optionalignoreDroppedReceiptsFor: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?
optionaltimeout: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?
optionalinterval:number
Defined in: contract/sent_tx.ts:16
The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1.
dontThrowOnRevert?
optionaldontThrowOnRevert: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
constDefaultWaitOpts: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
The wallet used for interacting with this contract.
Returns
UnsafeContract
Overrides
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
instance
readonlyinstance:ContractInstanceWithAddress
Defined in: contract/contract_base.ts:42
The deployed contract instance definition.
Inherited from
artifact
readonlyartifact:ContractArtifact
Defined in: contract/contract_base.ts:44
The Application Binary Interface for the contract.
Inherited from
wallet
wallet:
Wallet
Defined in: contract/contract_base.ts:46
The wallet used for interacting with this contract.
Inherited from
Accessors
address
Get Signature
get address():
any
Defined in: contract/contract_base.ts:66
Address of the contract.
Returns
any
Inherited from
partialAddress
Get Signature
get partialAddress():
any
Defined in: contract/contract_base.ts:71
Partial address of the contract.
Returns
any
Inherited from
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 to use for sending txs.
Returns
this
A new contract instance.
Inherited from
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?
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?
optionalprovenTimeout:number
Defined in: contract/wait_for_proven.ts:12
Time to wait for the tx to be proven before timing out
interval?
optionalinterval:number
Defined in: contract/wait_for_proven.ts:14
Elapsed time between polls to the node
DefaultWaitForProvenOpts
constDefaultWaitForProvenOpts: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 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 to send the transaction.