/** @module sendMessage */ import type { Account, Address, Chain, Client, ContractFunctionReturnType, DeriveChain, EstimateContractGasErrorType, Hash, Hex, Transport, WriteContractErrorType } from 'viem'; import { l2ToL2CrossDomainMessengerAbi } from '../../abis/index.js'; import type { BaseWriteContractActionParameters } from '../../core/baseWriteAction.js'; import type { ErrorType } from '../../types/utils.js'; /** * @category Types */ export type SendCrossDomainMessageParameters> = BaseWriteContractActionParameters & { /** Chain ID of the destination chain. */ destinationChainId: number; /** Target contract or wallet address. */ target: Address; /** Message payload to call target with. */ message: Hex; }; /** * @category Types */ export type SendCrossDomainMessageReturnType = Hash; /** * @category Types */ export type SendCrossDomainMessageContractReturnType = ContractFunctionReturnType; /** * @category Types */ export type SendCrossDomainMessageErrorType = EstimateContractGasErrorType | WriteContractErrorType | ErrorType; /** * Initiates the intent of sending a L2 to L2 message. Used in the interop flow. * @category Actions * @param client - L2 Client * @param parameters - {@link SendCrossDomainMessageParameters} * @returns transaction hash - {@link SendCrossDomainMessageReturnType} */ export declare function sendCrossDomainMessage(client: Client, parameters: SendCrossDomainMessageParameters): Promise; /** * Estimates gas for {@link sendMessage} * @category Actions * @param client - L2 Client * @param parameters - {@link SendCrossDomainMessageParameters} * @returns estimated gas value. */ export declare function estimateSendCrossDomainMessageGas(client: Client, parameters: SendCrossDomainMessageParameters): Promise; /** * Simulate contract call for {@link sendMessage} * @category Actions * @param client - L2 Client * @param parameters - {@link SendCrossDomainMessageParameters} * @returns contract return value - {@link SendCrossDomainMessageContractReturnType} */ export declare function simulateSendCrossDomainMessage(client: Client, parameters: SendCrossDomainMessageParameters): Promise;