import type { Account, Address, Chain, Client, ContractFunctionReturnType, DeriveChain, GetChainParameter, Hash, Hex, Transport } from 'viem'; import { crossDomainMessengerAbi } from '../abis/index.js'; import type { BaseWriteContractActionParameters } from '../core/baseWriteAction.js'; /** * Withdraw a cross-domain message from the child chain (L2). * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawCrossDomainMessageParameters} * @returns The transaction hash. {@link WithdrawCrossDomainMessageReturnType} * @example * import { withdrawCrossDomainMessage } from '@eth-optimism/viem' * import { op } from '@eth-optimism/viem/chains' * * const hash = await withdrawCrossDomainMessage(client, { * target: '0x0000000000000000000000000000000000000000', * message: '0x', * targetChain: op, * }) */ export type WithdrawCrossDomainMessageParameters> = GetChainParameter & BaseWriteContractActionParameters & { /** The address of the target contract */ target: Address; /** The calldata to invoke the target with */ message: Hex; /** The value to send with the transaction */ value: bigint; /** The minimum gas limit for the transaction */ minGasLimit?: bigint; /** The address of the CrossDomainMessenger to use. Defaults to the L2CrossDomainMessenger Predeploy */ crossDomainMessengerAddress?: Address; }; export type WithdrawCrossDomainMessageReturnType = Hash; export type WithdrawCrossDomainMessageContractReturnType = ContractFunctionReturnType; /** * Withdraw a cross-domain message from the child chain (L2). * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawCrossDomainMessageParameters} * @returns The transaction hash. {@link WithdrawCrossDomainMessageReturnType} */ export declare function withdrawCrossDomainMessage(client: Client, parameters: WithdrawCrossDomainMessageParameters): Promise; /** * Simulate the {@link withdrawCrossDomainMessage} action. * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawCrossDomainMessageParameters} * @returns The contract functions return value. {@link WithdrawCrossDomainMessageContractReturnType} */ export declare function simulateWithdrawCrossDomainMessage(client: Client, parameters: WithdrawCrossDomainMessageParameters): Promise; /** * Estimate the gas cost of the {@link withdrawCrossDomainMessage} action. * @category Actions * @param client - Client for the withdrawing chain * @param parameters - {@link WithdrawCrossDomainMessageParameters} * @returns The gas cost */ export declare function estimateWithdrawCrossDomainMessageGas(client: Client, parameters: WithdrawCrossDomainMessageParameters): Promise;