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'; import type { GetContractAddressParameter } from '../types/utils.js'; /** * Deposit a cross-domain message from the root chain (L1). * @category Actions * @param client - Client for the depositing chain * @param parameters - {@link DepositCrossDomainMessageParameters} * @returns The transaction hash. {@link DepositCrossDomainMessageReturnType} * @example * import { depositCrossDomainMessage } from '@eth-optimism/viem' * import { op } from '@eth-optimism/viem/chains' * * const hash = await depositCrossDomainMessage(client, { * target: '0x0000000000000000000000000000000000000000', * message: '0x', * targetChain: op, * }) */ export type DepositCrossDomainMessageParameters> = GetChainParameter & GetContractAddressParameter & 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; }; export type DepositCrossDomainMessageReturnType = Hash; export type DepositCrossDomainMessageContractReturnType = ContractFunctionReturnType; /** * Deposit a cross-domain message from the root chain (L1). * @category Actions * @param client - Client for the depositing chain * @param parameters - {@link DepositCrossDomainMessageParameters} * @returns The transaction hash. {@link DepositCrossDomainMessageReturnType} */ export declare function depositCrossDomainMessage(client: Client, parameters: DepositCrossDomainMessageParameters): Promise; /** * Simulate the {@link depositCrossDomainMessage} action. * @category Actions * @param client - Client for the depositing chain * @param parameters - {@link DepositCrossDomainMessageParameters} * @returns The contract functions return value. {@link DepositCrossDomainMessageContractReturnType} */ export declare function simulateDepositCrossDomainMessage(client: Client, parameters: DepositCrossDomainMessageParameters): Promise; /** * Estimate the gas cost of the {@link depositCrossDomainMessage} action. * @category Actions * @param client - Client for the depositing chain * @param parameters - {@link DepositCrossDomainMessageParameters} * @returns The gas cost */ export declare function estimateDepositCrossDomainMessageGas(client: Client, parameters: DepositCrossDomainMessageParameters): Promise;