bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 7쪽
``
**Returns:**
`Promise<AuthorizationSelector>`
##### fromFields[](#fromfields "Direct link to fromFields")
**Signature:**
```
static async fromFields(fields: Fr[]): Promise<CallAuthorizationRequest>
```
**Parameters:**
* `fields`: `Fr[]`
**Returns:**
`Promise<CallAuthorizationRequest>`
## Contract[](#contract "Direct link to Contract")
***
### `contract/base_contract_interaction.ts`[](#contractbase_contract_interactionts "Direct link to contractbase_contract_interactionts")
#### BaseContractInteraction[](#basecontractinteraction "Direct link to 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[](#constructor-2 "Direct link to Constructor")
**Signature:**
```
constructor(
protected wallet: Wallet,
protected authWitnesses: AuthWitness[] = [],
protected capsules: Capsule[] = []
)
```
**Parameters:**
* `wallet`: `Wallet`
* `authWitnesses` (optional): `AuthWitness[]`
* `capsules` (optional): `Capsule[]`
#### Properties[](#properties "Direct link to Properties")
##### log[](#log "Direct link to log")
**Type:** `any`
#### Methods[](#methods-4 "Direct link to Methods")
##### request[](#request "Direct link to 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[](#send "Direct link to send")
Sends a transaction to the contract function with the specified options. By default, waits for the transaction to be mined and returns the receipt (or custom type).
**Signature:**
```
public send<TReturn = TxReceipt>(options: SendInteractionOptionsWithoutWait): Promise<TxSendResultMined<TReturn>>
```
**Parameters:**
* `options`: `SendInteractionOptionsWithoutWait`
* An object containing 'from' property representing the AztecAddress of the sender, optional fee configuration, and optional wait settings
**Returns:**
`Promise<TxSendResultMined<TReturn>>` - TReturn (if wait is undefined/WaitOpts) or TxHash (if wait is NO\_WAIT)
##### send[](#send-1 "Direct link to send")
**Signature:**
```
public send<TReturn = TxReceipt, W extends InteractionWaitOptions = undefined>(options: SendInteractionOptions<W>): Promise<SendReturn<W, TReturn>>
```
**Parameters:**
* `options`: `SendInteractionOptions<W>`
**Returns:**
`Promise<SendReturn<W, TReturn>>`
##### send[](#send-2 "Direct link to send")
**Signature:**
```
public async send<TReturn = TxReceipt>(options: SendInteractionOptions<InteractionWaitOptions>): Promise<SendReturn<typeof options.wait, TReturn>>
```
**Parameters:**
* `options`: `SendInteractionOptions<InteractionWaitOptions>`
**Returns:**
`Promise<SendReturn<typeof options.wait, TReturn>>`
***
### `contract/batch_call.ts`[](#contractbatch_callts "Direct link to contractbatch_callts")
#### BatchCall[](#batchcall "Direct link to BatchCall")
**Type:** Class
A batch of function calls to be sent as a single transaction through a wallet.
**Extends:** `BaseContractInteraction`
#### Constructor[](#constructor-3 "Direct link to Constructor")
**Signature:**
```
constructor(
wallet: Wallet,
protected interactions: (BaseContractInteraction | ExecutionPayload)[],
private extraHashedArgs: HashedValues[] = []
)
```
**Parameters:**
* `wallet`: `Wallet`
* `interactions`: `(BaseContractInteraction | ExecutionPayload)[]`
* `extraHashedArgs` (optional): `HashedValues[]`
#### Methods[](#methods-5 "Direct link to Methods")
##### request[](#request-1 "Direct link to 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[](#simulate "Direct link to simulate")
Simulates/executes 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 be executed one by one.
**Signature:**
```
public async simulate(options: SimulateInteractionOptions): Promise<SimulationResult>
```
**Parameters:**
* `options`: `SimulateInteractionOptions`
* An optional object containing additional configuration for the interaction.
**Returns:**
`Promise<SimulationResult>` - The results of all the interactions that make up the batch
##### getExecutionPayloads[](#getexecutionpayloads "Direct link to getExecutionPayloads")
**Signature:**
```
protected async getExecutionPayloads(): Promise<ExecutionPayload[]>
```
**Returns:**
`Promise<ExecutionPayload[]>`
***
### `contract/checker.ts`[](#contractcheckerts "Direct link to contractcheckerts")
#### abiChecker[](#abichecker "Direct link to 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.ts`[](#contractcontractts "Direct link to contractcontractts")
#### Contract[](#contract-1 "Direct link to 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[](#methods-6 "Direct link to Methods")
##### at[](#at "Direct link to 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[](#deploy "Direct link to 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,
instantiation?: DeployInstantiationOptions
)
```
**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.
* `instantiation` (optional): `DeployInstantiationOptions`
* Other address-affecting parameters (salt, deployer / universalDeploy, publicKeys).
**Returns:**
`DeployMethod<Contract>`
***
### `contract/contract_base.ts`[](#contractcontract_basets "Direct link to contractcontract_basets")
#### ContractMethod[](#contractmethod "Direct link to 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[](#selector "Direct link to selector")
The unique identifier for a contract function in bytecode.
**Type:** `() => Promise<FunctionSelector>`
#### ContractStorageLayout[](#contractstoragelayout "Direct link to 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][](#k-in-t "Direct link to \[K in T]")
**Signature:** `[K in T]: FieldLayout`
**Key Type:** `T`
**Value Type:** `FieldLayout`
#### ContractBase[](#contractbase "Direct link to ContractBase")
**Type:** Class
Abstract implementation of a contract extended by the Contract class and generated contract types.
#### Constructor[](#constructor-4 "Direct link to 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[](#properties-1 "Direct link to Properties")
##### methods[](#methods-7 "Direct link to methods")
An object containing contract methods mapped to their respective names.
**Type:** `{ [name: string]: ContractMethod }`
#### Methods[](#methods-8 "Direct link to Methods")
##### withWallet[](#withwallet "Direct link to 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`[](#contractcontract_function_interactionts "Direct link to contractcontract_function_interactionts")
#### ContractFunctionInteraction[](#contractfunctioninteraction "Direct link to 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[](#constructor-5 "Direct link to Constructor")
**Signature:**
```
constructor(
wallet: Wallet,
protected contractAddress: AztecAddress,
protected functionDao: FunctionAbi,
protected args: any[],
authWitnesses: AuthWitness[] = [],
capsules: Capsule[] = [],
private extraHashedArgs: HashedValues[] = []
)
```
**Parameters:**
* `wallet`: `Wallet`
* `contractAddress`: `AztecAddress`
* `functionDao`: `FunctionAbi`
* `args`: `any[]`
* `authWitnesses` (optional): `AuthWitness[]`
* `capsules` (optional): `Capsule[]`
* `extraHashedArgs` (optional): `HashedValues[]`
#### Methods[](#methods-9 "Direct link to Methods")
##### getFunctionCall[](#getfunctioncall "Direct link to getFunctionCall")
Returns the encoded function call wrapped by this interaction Useful when generating authwits
**Signature:**
```
public async getFunctionCall(): Promise<FunctionCall>
```
**Returns:**
`Promise<FunctionCall>` - An encoded function call
##### request[](#request-2 "Direct link to 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-1 "Direct link to 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(options: SimulateInteractionOptions = {} as SimulateInteractionOptions): Promise<SimulationResult>
```
**Parameters:**
* `options` (optional): `SimulateInteractionOptions`
* An optional object containing additional configuration for the simulation.
**Returns:**
`Promise<SimulationResult>` - 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 "Direct link to 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
**Returns:**
`Promise<TxProfileResult>` - An object containing the function return value and profile result.
##### with[](#with "Direct link to 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/deploy_method.ts`[](#contractdeploy_methodts "Direct link to contractdeploy_methodts")
#### DeployInstantiationOptions[](#deployinstantiationoptions "Direct link to DeployInstantiationOptions")
**Type:** Type Alias
Inputs that determine the contract's deployment address. `salt` and `publicKeys` are optional and default to a random Fr and `PublicKeys.default()` respectively. `deployer` and `universalDeploy` are mutually exclusive and both optional: - If neither is supplied, the deployer is locked lazily on the first `send` / `simulate` / `profile` call from `options.from` (NO\_FROM/undefined → universal). This preserves the ergonomics of `MyContract.deploy(wallet, ...args).send({ from: alice })`. - If `deployer` or `universalDeploy: true` is supplied, the deployer is locked at construction. Once locked, the deployer cannot change. Subsequent calls with a `from` that would imply a different deployer throw — except when locked to `AztecAddress.ZERO` (universal), which is compatible with any sender.
**Signature:**
```
export type DeployInstantiationOptions = {
salt?: Fr;
deployer?: AztecAddress;
universalDeploy?: boolean;
publicKeys?: PublicKeys;
immutablesHash?: Fr;
};
```
**Type Members:**
##### salt[](#salt "Direct link to salt")
Salt used to derive the contract address. Defaults to a random Fr.
**Type:** `Fr`
##### deployer[](#deployer "Direct link to deployer")
Deployer address mixed into the address preimage. Mutually exclusive with `universalDeploy`.
**Type:** `AztecAddress`
##### universalDeploy[](#universaldeploy "Direct link to universalDeploy")
If true, the contract is deployed universally (deployer = AztecAddress.ZERO in the address preimage). Mutually exclusive with `deployer`.
**Type:** `boolean`
##### publicKeys[](#publickeys "Direct link to publicKeys")
Public keys mixed into the address. Defaults to PublicKeys.default().
**Type:** `PublicKeys`
##### immutablesHash[](#immutableshash "Direct link to immutablesHash")
Commitment to the contract's immutable storage values. Folded into the salted initialization hash, so a non-zero value affects the derived address. Defaults to `Fr.ZERO`.
**Type:** `Fr`
#### BoundInstantiationOptions[](#boundinstantiationoptions "Direct link to BoundInstantiationOptions")
**Type:** Type Alias
Narrowed `DeployInstantiationOptions` accepted by BoundDeployMethod: requires a concrete `deployer` and forbids `universalDeploy`. The runtime check that `deployer` is non-zero stays as defense in depth (it's a value-level invariant the type system can't model).
**Signature:**
```
export type BoundInstantiationOptions = SharedInstantiationOptions & {
deployer: AztecAddress;
universalDeploy?: never;
};
```
**Type Members:**
##### deployer[](#deployer-1 "Direct link to deployer")
Concrete deployer mixed into the address preimage. Required, must be non-zero.
**Type:** `AztecAddress`
##### universalDeploy[](#universaldeploy-1 "Direct link to universalDeploy")
Forbidden on `BoundDeployMethod`; use `UniversalDeployMethod` for universal deploys.
**Type:** `never`
#### UniversalInstantiationOptions[](#universalinstantiationoptions "Direct link to UniversalInstantiationOptions")
**Type:** Type Alias
Narrowed `DeployInstantiationOptions` accepted by UniversalDeployMethod: forbids `deployer` and requires `universalDeploy: true` (so the call site reads as a universal deploy).
**Signature:**
```
export type UniversalInstantiationOptions = SharedInstantiationOptions & {
deployer?: never;
universalDeploy: true;
};
```
**Type Members:**
##### deployer[](#deployer-2 "Direct link to deployer")
Forbidden on `UniversalDeployMethod`; use `BoundDeployMethod` if you need a concrete deployer.
**Type:** `never`
##### universalDeploy[](#universaldeploy-2 "Direct link to universalDeploy")
Marks this as a universal deploy. Required for clarity at the call site.
**Type:** `true`
#### PendingInstantiationOptions[](#pendinginstantiationoptions "Direct link to PendingInstantiationOptions")
**Type:** Type Alias
Narrowed `DeployInstantiationOptions` accepted by PendingDeployMethod: forbids both `deployer` and `universalDeploy`. The deploy is locked from the first send-time `from` instead.
**Signature:**
```
export type PendingInstantiationOptions = SharedInstantiationOptions & {
deployer?: never;
universalDeploy?: never;
};
```
**Type Members:**
##### deployer[](#deployer-3 "Direct link to deployer")
Forbidden on `PendingDeployMethod`; use `BoundDeployMethod` for a concrete deployer.
**Type:** `never`
##### universalDeploy[](#universaldeploy-3 "Direct link to universalDeploy")
Forbidden on `PendingDeployMethod`; use `UniversalDeployMethod` for a universal deploy.
**Type:** `never`
#### DeployMethodContract[](#deploymethodcontract "Direct link to DeployMethodContract")
**Type:** Type Alias
Identifies *which contract* is being deployed and *with what initializer*.
**Signature:**
```
export type DeployMethodContract<TContract extends ContractBase = ContractBase> = {
artifact: ContractArtifact;
프로젝트로 돌아가기