import type { Address } from 'abitype'; import { type GetBlockErrorType } from '../../actions/public/getBlock.js'; import type { Client } from '../../clients/createClient.js'; import type { Transport } from '../../clients/transports/createTransport.js'; import type { ErrorType } from '../../errors/utils.js'; import type { Account, DeriveAccount, GetAccountParameter } from '../../types/account.js'; import type { Chain, DeriveChain, GetChainParameter } from '../../types/chain.js'; import type { Hex } from '../../types/misc.js'; import type { TransactionReceipt } from '../../types/transaction.js'; import type { Prettify } from '../../types/utils.js'; import type { Withdrawal } from '../types/withdrawal.js'; import type { GetWithdrawalsErrorType } from '../utils/getWithdrawals.js'; import type { ProveWithdrawalParameters } from './proveWithdrawal.js'; export type BuildProveZircuitWithdrawalParameters> = GetAccountParameter & GetChainParameter & { receipt: TransactionReceipt; withdrawal?: Withdrawal; l1Client?: Client; l2OutputOracleAddress?: Address; }; export type BuildProveZircuitWithdrawalReturnType = Prettify & { account: DeriveAccount; targetChain: DeriveChain; }>; export type BuildProveZircuitWithdrawalErrorType = GetBlockErrorType | GetWithdrawalsErrorType | ErrorType; /** * Builds the transaction that proves a withdrawal was initiated on an L2. Used in the Withdrawal flow. * * @param client - Client to use * @param parameters - {@link BuildProveZircuitWithdrawalParameters} * @returns The prove withdraw transaction request. {@link BuildProveZircuitWithdrawalReturnType} * * @example * import { createPublicClient, http } from '@zircuit/zircuit-viem' * import { zircuit } from '@zircuit/zircuit-viem/chains' * import { buildProveZircuitWithdrawal } from '@zircuit/zircuit-viem/op-stack' * * const publicClientL2 = createPublicClient({ * chain: zircuit, * transport: http(), * }) * const receipt = await getTransactionReceipt(zircuitClient, { * hash: , * }) * const withdrawal = getWithdrawals(receipt)[1] * const args = await buildProveZircuitWithdrawal(publicClientL2, { * account: accounts[0].address, * receipt : { ... }, * withdrawal, * l1Client: exampleSepoliaClient, * l2OutputOracleAddress: '0xd69D3AC5CA686cCF94b258291772bc520FEAf211', * }) */ export declare function buildProveZircuitWithdrawal(client: Client, args: BuildProveZircuitWithdrawalParameters): Promise>; /** @internal */ export declare function initializeRightHashes(): Hex[]; /** @internal */ export declare function computeHeightFromMsgNonce(msgNonceBigInt: bigint): number; /** @internal */ export declare function initializeLeftHashes(client: Client, l2TxBlockNumber: bigint): Promise; /** @internal */ export declare function fetchIntermediateWithdrawals(client: Client, fromBlockNumber: bigint, toBlockNumber: bigint): Promise<[number, Hex][]>; /** @internal */ export declare function buildWithdrawalProof(withdrawalHash: Hex, merkleTree: Record[], treeHeight: number): Hex; /** @internal */ interface MerkleTreeBuildResult { merkleTree: Record[]; treeHeight: number; withdrawalRoot: Hex; } /** @internal */ export declare function buildMerkleTree(client: Client, intermediateWithdrawals: [number, Hex][], leftHashes: Hex[], rightHashes: Hex[], l2OutputRootBlockNumber: bigint): Promise; /** * Extracts the nonce and version from a withdrawal message log * @param withdrawalLog The withdrawal message log to extract from * @returns Object containing the nonce and version * @internal */ export declare function extractNonceAndVersion(withdrawalLog: { args: { nonce: bigint; }; }): { nonce: number; version: number; }; export {}; //# sourceMappingURL=buildProveZircuitWithdrawal.d.ts.map