bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 10쪽
")
Anchor block timestamp at message emission.
**Type:** `bigint`
#### OffchainOutput[](#offchainoutput "Direct link to OffchainOutput")
**Type:** Type Alias
Groups all unproven outputs from private execution that are returned to the client.
**Signature:**
```
export type OffchainOutput = {
offchainEffects: OffchainEffect[];
offchainMessages: OffchainMessage[];
};
```
**Type Members:**
##### offchainEffects[](#offchaineffects "Direct link to offchainEffects")
Raw offchain effects emitted during execution.
**Type:** `OffchainEffect[]`
##### offchainMessages[](#offchainmessages "Direct link to offchainMessages")
Messages emitted during execution, to be delivered offchain.
**Type:** `OffchainMessage[]`
#### extractOffchainOutput[](#extractoffchainoutput "Direct link to extractOffchainOutput")
**Type:** Function
Splits an array of offchain effects into decoded offchain messages and remaining effects. Effects whose data starts with `OFFCHAIN_MESSAGE_IDENTIFIER` are parsed as messages and removed from the effects array.
**Signature:**
```
export extractOffchainOutput(
effects: OffchainEffect[],
anchorBlockTimestamp: bigint
): OffchainOutput
```
**Parameters:**
* `effects`: `OffchainEffect[]`
* `anchorBlockTimestamp`: `bigint`
**Returns:**
`OffchainOutput`
#### SimulationResult[](#simulationresult "Direct link to SimulationResult")
**Type:** Type Alias
Represents the result of a simulation. Always includes the return value and offchain output. When `includeMetadata` is set, also includes stats and the simulated gas usage.
**Signature:**
```
export type SimulationResult = {
result: any;
stats?: SimulationStats;
gasUsed?: GasUsed;
} & OffchainOutput;
```
**Type Members:**
##### result[](#result "Direct link to result")
Return value of the function
**Type:** `any`
##### stats[](#stats "Direct link to stats")
Additional stats about the simulation. Present when `includeMetadata` is set.
**Type:** `SimulationStats`
##### gasUsed[](#gasused "Direct link to gasUsed")
Raw gas consumed by the simulated transaction. Present when `includeMetadata` is set. Apps that want to declare explicit gas limits should derive their own from this (e.g. pad `totalGas`) and pass them via the fee options; otherwise the wallet fills in the network's per-tx admission limits automatically.
**Type:** `GasUsed`
#### TxSendResultImmediate[](#txsendresultimmediate "Direct link to TxSendResultImmediate")
**Type:** Type Alias
Result of sendTx when not waiting for mining.
**Signature:**
```
export type TxSendResultImmediate = {
txHash: TxHash;
} & OffchainOutput;
```
**Type Members:**
##### txHash[](#txhash "Direct link to txHash")
The hash of the sent transaction.
**Type:** `TxHash`
#### TxSendResultMined[](#txsendresultmined "Direct link to TxSendResultMined")
**Type:** Type Alias
Result of sendTx when waiting for mining.
**Signature:**
```
export type TxSendResultMined<TReturn = TxReceipt> = {
receipt: TReturn;
} & OffchainOutput;
```
**Type Members:**
##### receipt[](#receipt-1 "Direct link to receipt")
The transaction receipt.
**Type:** `TReturn`
#### SendReturn[](#sendreturn "Direct link to SendReturn")
**Type:** Type Alias
Represents the result type of sending a transaction. If `wait` is NO\_WAIT, returns TxSendResultImmediate. Otherwise returns TxSendResultMined.
**Signature:**
```
export type SendReturn<T extends InteractionWaitOptions, TReturn = TxReceipt> = T extends NoWait
? TxSendResultImmediate
: TxSendResultMined<TReturn>;
```
#### toSendOptions[](#tosendoptions "Direct link to toSendOptions")
**Type:** Function
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
**Signature:**
```
export toSendOptions<W extends InteractionWaitOptions = undefined>(options: SendInteractionOptions<W>): SendOptions<W>
```
**Parameters:**
* `options`: `SendInteractionOptions<W>`
* The send interaction options with optional wait parameter
**Returns:**
`SendOptions<W>` - The send options to forward to the wallet
#### toSimulateOptions[](#tosimulateoptions "Direct link to toSimulateOptions")
**Type:** Function
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
**Signature:**
```
export toSimulateOptions(options: SimulateInteractionOptions): SimulateOptions
```
**Parameters:**
* `options`: `SimulateInteractionOptions`
**Returns:**
`SimulateOptions`
#### toProfileOptions[](#toprofileoptions "Direct link to toProfileOptions")
**Type:** Function
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
**Signature:**
```
export toProfileOptions(options: ProfileInteractionOptions): ProfileOptions
```
**Parameters:**
* `options`: `ProfileInteractionOptions`
**Returns:**
`ProfileOptions`
***
### `contract/wait_for_proven.ts`[](#contractwait_for_provents "Direct link to contractwait_for_provents")
#### WaitForProvenOpts[](#waitforprovenopts "Direct link to WaitForProvenOpts")
**Type:** Type Alias
Options for waiting for a transaction to be proven.
**Signature:**
```
export type WaitForProvenOpts = {
provenTimeout?: number;
interval?: number;
};
```
**Type Members:**
##### provenTimeout[](#proventimeout "Direct link to provenTimeout")
Time to wait for the tx to be proven before timing out
**Type:** `number`
##### interval[](#interval "Direct link to interval")
Elapsed time between polls to the node
**Type:** `number`
#### DefaultWaitForProvenOpts[](#defaultwaitforprovenopts "Direct link to DefaultWaitForProvenOpts")
**Type:** Constant
**Value Type:** `WaitForProvenOpts`
#### waitForProven[](#waitforproven "Direct link to waitForProven")
**Type:** Function
Wait for a transaction to be proven by polling the node
**Signature:**
```
export async waitForProven(
node: AztecNode,
receipt: TxReceipt,
opts?: WaitForProvenOpts
): Promise<BlockNumber>
```
**Parameters:**
* `node`: `AztecNode`
* `receipt`: `TxReceipt`
* `opts` (optional): `WaitForProvenOpts`
**Returns:**
`Promise<BlockNumber>`
***
### `contract/wait_opts.ts`[](#contractwait_optsts "Direct link to contractwait_optsts")
#### WaitOpts[](#waitopts "Direct link to WaitOpts")
**Type:** Type Alias
Options related to waiting for a tx.
**Signature:**
```
export type WaitOpts = {
ignoreDroppedReceiptsFor?: number;
timeout?: number;
interval?: number;
dontThrowOnRevert?: boolean;
waitForStatus?: TxStatus;
initialDelay?: number;
};
```
**Type Members:**
##### ignoreDroppedReceiptsFor[](#ignoredroppedreceiptsfor "Direct link to ignoreDroppedReceiptsFor")
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.
**Type:** `number`
##### timeout[](#timeout "Direct link to timeout")
The maximum time (in seconds) to wait for the transaction to be mined. Defaults to 300 (5 min).
**Type:** `number`
##### interval[](#interval-1 "Direct link to interval")
The time interval (in seconds) between retries to fetch the transaction receipt. Defaults to 1.
**Type:** `number`
##### dontThrowOnRevert[](#dontthrowonrevert "Direct link to dontThrowOnRevert")
Whether to accept a revert as a status code for the tx when waiting for it. If false, will throw if the tx reverts.
**Type:** `boolean`
##### waitForStatus[](#waitforstatus "Direct link to waitForStatus")
The minimum inclusion status to wait for. If set, waits until the receipt reaches this status or higher. Defaults to CHECKPOINTED.
**Type:** `TxStatus`
##### initialDelay[](#initialdelay "Direct link to initialDelay")
The time (in seconds) to wait before the first receipt poll. Defaults to 0. Used to avoid checking for a receipt right after sending a tx, when we know it cannot have been mined yet. Counts against `timeout`.
**Type:** `number`
#### DefaultWaitOpts[](#defaultwaitopts "Direct link to DefaultWaitOpts")
**Type:** Constant
**Value Type:** `WaitOpts`
## Deployment[](#deployment "Direct link to Deployment")
***
### `deployment/contract_deployer.ts`[](#deploymentcontract_deployerts "Direct link to deploymentcontract_deployerts")
#### ContractDeployer[](#contractdeployer "Direct link to ContractDeployer")
**Type:** Class
A class for deploying contract.
#### Constructor[](#constructor-10 "Direct link to Constructor")
**Signature:**
```
constructor(
private artifact: ContractArtifact,
private wallet: Wallet,
private constructorName?: string
)
```
**Parameters:**
* `artifact`: `ContractArtifact`
* `wallet`: `Wallet`
* `constructorName` (optional): `string`
#### Methods[](#methods-14 "Direct link to Methods")
##### deploy[](#deploy-1 "Direct link to deploy")
Deploy a contract using the provided instantiation parameters and constructor arguments. Creates a new DeployMethod instance that can be used to send the deployment transaction. The first argument is the DeployInstantiationOptions (salt, deployer) — pass `{}` to accept defaults (random salt, deployer = AztecAddress.ZERO). The remaining arguments are the constructor arguments for the contract.
**Signature:**
```
public deploy(
args?: any[],
instantiation?: DeployInstantiationOptions
)
```
**Parameters:**
* `args` (optional): `any[]`
* The constructor arguments for the contract being deployed.
* `instantiation` (optional): `DeployInstantiationOptions`
* Salt and deployer to mix into the address derivation.
**Returns:**
`DeployMethod<Contract>` - A DeployMethod instance configured with the ABI, PXE, and constructor arguments.
***
### `deployment/publish_class.ts`[](#deploymentpublish_classts "Direct link to deploymentpublish_classts")
#### publishContractClass[](#publishcontractclass "Direct link to publishContractClass")
**Type:** Function
Sets up a call to publish a contract class given its artifact.
**Signature:**
```
export async publishContractClass(
wallet: Wallet,
artifact: ContractArtifact
): Promise<ContractFunctionInteraction>
```
**Parameters:**
* `wallet`: `Wallet`
* `artifact`: `ContractArtifact`
**Returns:**
`Promise<ContractFunctionInteraction>`
***
### `deployment/publish_instance.ts`[](#deploymentpublish_instancets "Direct link to deploymentpublish_instancets")
#### publishInstance[](#publishinstance "Direct link to publishInstance")
**Type:** Function
Sets up a call to the canonical contract instance registry to publish a contract instance.
**Signature:**
```
export publishInstance(
wallet: Wallet,
instance: ContractInstanceWithAddress
): ContractFunctionInteraction
```
**Parameters:**
* `wallet`: `Wallet`
* The wallet to use for the publication (setup) tx.
* `instance`: `ContractInstanceWithAddress`
* The instance to publish.
**Returns:**
`ContractFunctionInteraction`
## Ethereum[](#ethereum "Direct link to Ethereum")
***
### `ethereum/portal_manager.ts`[](#ethereumportal_managerts "Direct link to ethereumportal_managerts")
#### L2Claim[](#l2claim "Direct link to L2Claim")
**Type:** Type Alias
L1 to L2 message info to claim it on L2.
**Signature:**
```
export type L2Claim = {
claimSecret: Fr;
claimSecretHash: Fr;
messageHash: Hex;
messageLeafIndex: bigint;
};
```
**Type Members:**
##### claimSecret[](#claimsecret "Direct link to claimSecret")
Secret for claiming.
**Type:** `Fr`
##### claimSecretHash[](#claimsecrethash "Direct link to claimSecretHash")
Hash of the secret for claiming.
**Type:** `Fr`
##### messageHash[](#messagehash "Direct link to messageHash")
Hash of the message.
**Type:** `Hex`
##### messageLeafIndex[](#messageleafindex "Direct link to messageLeafIndex")
Leaf index in the L1 to L2 message tree.
**Type:** `bigint`
#### L2AmountClaim[](#l2amountclaim "Direct link to L2AmountClaim")
**Type:** Type Alias
L1 to L2 message info that corresponds to an amount to claim.
**Signature:**
```
export type L2AmountClaim = L2Claim & { claimAmount: bigint };
```
**Type Members:**
##### claimAmount[](#claimamount "Direct link to claimAmount")
**Type:** `bigint`
#### L2AmountClaimWithRecipient[](#l2amountclaimwithrecipient "Direct link to L2AmountClaimWithRecipient")
**Type:** Type Alias
L1 to L2 message info that corresponds to an amount to claim with associated recipient.
**Signature:**
```
export type L2AmountClaimWithRecipient = L2AmountClaim & {
recipient: AztecAddress;
};
```
**Type Members:**
##### recipient[](#recipient-1 "Direct link to recipient")
Address that will receive the newly minted notes.
**Type:** `AztecAddress`
#### generateClaimSecret[](#generateclaimsecret "Direct link to generateClaimSecret")
**Type:** Function
Generates a pair secret and secret hash
**Signature:**
```
export async generateClaimSecret(logger?: Logger): Promise<[
Fr,
Fr
]>
```
**Parameters:**
* `logger` (optional): `Logger`
**Returns:**
`Promise<[Fr, Fr]>`
#### L1TokenManager[](#l1tokenmanager "Direct link to L1TokenManager")
**Type:** Class
Helper for managing an ERC20 on L1.
#### Constructor[](#constructor-11 "Direct link to Constructor")
**Signature:**
```
public constructor(
public readonly tokenAddress: EthAddress,
public readonly handlerAddress: EthAddress | undefined,
private readonly extendedClient: ExtendedViemWalletClient,
private logger: Logger
)
```
**Parameters:**
* `tokenAddress`: `EthAddress`
* Address of the ERC20 contract.
* `handlerAddress`: `EthAddress | undefined`
* Address of the handler/faucet contract.
* `extendedClient`: `ExtendedViemWalletClient`
* `logger`: `Logger`
#### Methods[](#methods-15 "Direct link to Methods")
##### getMintAmount[](#getmintamount "Direct link to getMintAmount")
Returns the amount of tokens available to mint via the handler.
**Signature:**
```
public async getMintAmount()
```
**Returns:**
`Promise<any>`
##### getL1TokenBalance[](#getl1tokenbalance "Direct link to getL1TokenBalance")
Returns the balance of the given address.
**Signature:**
```
public async getL1TokenBalance(address: Hex)
```
**Parameters:**
* `address`: `Hex`
* Address to get the balance of.
**Returns:**
`Promise<any>`
##### mint[](#mint "Direct link to mint")
Mints a fixed amount of tokens for the given address. Returns once the tx has been mined.
**Signature:**
```
public async mint(
address: Hex,
addressName?: string
)
```
**Parameters:**
* `address`: `Hex`
* Address to mint the tokens for.
* `addressName` (optional): `string`
* Optional name of the address for logging.
**Returns:**
`Promise<void>`
##### approve[](#approve "Direct link to approve")
Approves tokens for the given address. Returns once the tx has been mined.
**Signature:**
```
public async approve(
amount: bigint,
address: Hex,
addressName = ''
)
```
**Parameters:**
* `amount`: `bigint`
* Amount to approve.
* `address`: `Hex`
* Address to approve the tokens for.
* `addressName` (optional): `any`
* Optional name of the address for logging.
**Returns:**
`Promise<void>`
#### L1FeeJuicePortalManager[](#l1feejuiceportalmanager "Direct link to L1FeeJuicePortalManager")
**Type:** Class
Helper for interacting with the FeeJuicePortal on L1.
#### Constructor[](#constructor-12 "Direct link to Constructor")
**Signature:**
```
constructor(
portalAddress: EthAddress,
tokenAddress: EthAddress,
handlerAddress: EthAddress | undefined,
private readonly extendedClient: ExtendedViemWalletClient,
private readonly logger: Logger
)
```
**Parameters:**
* `portalAddress`: `EthAddress`
* `tokenAddress`: `EthAddress`
* `handlerAddress`: `EthAddress | undefined`
* `extendedClient`: `ExtendedViemWalletClient`
* `logger`: `Logger`
#### Methods[](#methods-16 "Direct link to Methods")
##### getTokenManager[](#gettokenmanager "Direct link to getTokenManager")
Returns the associated token manager for the L1 ERC20.
**Signature:**
```
public getTokenManager()
```
**Returns:**
`L1TokenManager`
##### bridgeTokensPublic[](#bridgetokenspublic "Direct link to bridgeTokensPublic")
Bridges fee juice from L1 to L2 publicly. Handles L1 ERC20 approvals. Returns once the tx has been mined.
**Signature:**
```
public async bridgeTokensPublic(
to: AztecAddress,
amount: bigint | undefined,
mint = false
): Promise<L2AmountClaim>
```
**Parameters:**
* `to`: `AztecAddress`
* Address to send the tokens to on L2.
* `amount`: `bigint | undefined`
* Amount of tokens to send.
* `mint` (optional): `any`
* Whether to mint the tokens before sending (only during testing).
**Returns:**
`Promise<L2AmountClaim>`
##### new[](#new "Direct link to new")
Creates a new instance
**Signature:**
```
public static async new(
node: AztecNode,
extendedClient: ExtendedViemWalletClient,
logger: Logger
): Promise<L1FeeJuicePortalManager>
```
**Parameters:**
* `node`: `AztecNode`
* Aztec node client used for retrieving the L1 contract addresses.
* `extendedClient`: `ExtendedViemWalletClient`
* Wallet client, extended with public actions.
* `logger`: `Logger`
* Logger.
**Returns:**
`Promise<L1FeeJuicePortalManager>`
#### L1ToL2TokenPortalManager[](#l1tol2tokenportalmanager "Direct link to L1ToL2TokenPortalManager")
**Type:** Class
Helper for interacting with a test TokenPortal on L1 for sending tokens to L2.
#### Constructor[](#constructor-13 "Direct link to Constructor")
**Signature:**
```
constructor(
portalAddress: EthAddress,
tokenAddress: EthAddress,
handlerAddress: EthAddress | undefined,
protected extendedClient: ExtendedViemWalletClient,
protected logger: Logger
)
```
**Parameters:**
* `portalAddress`: `EthAddress`
* `tokenAddress`: `EthAddress`
* `handlerAddress`: `EthAddress | undefined`
* `extendedClient`: `ExtendedViemWalletClient`
* `logger`: `Logger`
#### Properties[](#properties-5 "Direct link to Properties")
##### portal[](#portal "Direct link to portal")
**Type:** `ViemContract<typeof TokenPortalAbi>`
##### tokenManager[](#tokenmanager "Direct link to tokenManager")
**Type:** `L1TokenManager`
##### l1TxUtils[](#l1txutils "Direct link to l1TxUtils")
**Type:** `L1TxUtils`
#### Methods[](#methods-17 "Direct link to Methods")
##### getTokenManager[](#gettokenmanager-1 "Direct link to getTokenManager")
Returns the token manager for the underlying L1 token.
**Signature:**
```
public getTokenManager()
```
**Returns:**
`L1TokenManager`
##### bridgeTokensPublic[](#bridgetokenspublic-1 "Direct link to bridgeTokensPublic")
Bridges tokens from L1 to L2. Handles token approvals. Returns once the tx has been mined.
**Signature:**
```
public async bridgeTokensPublic(
to: AztecAddress,
amount: bigint,
mint = false
): Promise<L2AmountClaim>
```
**Parameters:**
* `to`: `AztecAddress`
* Address to send the tokens to on L2.
* `amount`: `bigint`
* Amount of tokens to send.
* `mint` (optional): `any`
* Whether to mint the tokens before sending (only during testing).
**Returns:**
`Promise<L2AmountClaim>`
##### bridgeTokensPrivate[](#bridgetokensprivate "Direct link to bridgeTokensPrivate")
Bridges tokens from L1 to L2 privately. Handles token approvals. Returns once the tx has been mined.
**Signature:**
```
public async bridgeTokensPrivate(
to: AztecAddress,
amount: bigint,
mint = false
): Promise<L2AmountClaimWithRecipient>
```
**Parameters:**
* `to`: `AztecAddress`
* Address to send the tokens to on L2.
* `amount`: `bigint`
* Amount of tokens to send.
* `mint` (optional): `any`
* Whether to mint the tokens before sending (only during testing).
**Returns:**
`Promise<L2AmountClaimWithRecipient>`
#### L1TokenPortalManager[](#l1tokenportalmanager "Direct link to L1Token프로젝트로 돌아가기