import { Artifact, ArtifactDeployed, ConfigOnChain, IArtifactManager } from './artifact.js'; import type { ChainLookup } from './chain.js'; import type { DerivedCoreConfig } from './core.js'; import type { DeployedHookAddress, DeployedHookArtifact, DerivedHookConfig, HookArtifactConfig } from './hook.js'; import type { DeployedIsmAddress, DeployedIsmArtifact, DerivedIsmConfig, IsmArtifactConfig } from './ism.js'; /** * Mailbox configuration for the Artifact API. * Defines the parameters needed to deploy or configure a mailbox. */ export interface MailboxArtifactConfig { owner: string; defaultIsm: Artifact; defaultHook: Artifact; requiredHook: Artifact; } /** * Deployment data returned after deploying a mailbox. * Contains the on-chain address and optionally the domain ID. */ export interface DeployedMailboxAddress { address: string; domainId?: number; } /** * Describes the configuration of a deployed mailbox */ export type DeployedMailboxArtifact = ArtifactDeployed, DeployedMailboxAddress>; /** * Mailbox artifact configs map */ export interface MailboxArtifactConfigs { mailbox: MailboxArtifactConfig; } export type MailboxType = keyof MailboxArtifactConfigs; /** * Should be used to implement an object/closure or class that is in charge of coordinating * deployment of a Mailbox config, including nested ISM and Hook deployments. */ export type IMailboxArtifactManager = IArtifactManager; /** * Raw mailbox config - uses ArtifactOnChain for nested artifacts instead of Artifact. * This is the format used by protocol implementations that work directly with on-chain state. */ export type MailboxOnChain = ConfigOnChain; /** * Raw mailbox artifact configs map */ export interface RawMailboxArtifactConfigs { mailbox: MailboxOnChain; } /** * Should be used for the specific artifact code that * deploys or reads a single mailbox artifact on chain */ export type RawMailboxArtifactConfig = RawMailboxArtifactConfigs[MailboxType]; /** * Describes the configuration of deployed mailbox without nested config expansion */ export type DeployedRawMailboxArtifact = ArtifactDeployed; /** * Should be used to implement an object/closure or class that individually deploys * Mailboxes on chain */ export interface IRawMailboxArtifactManager extends IArtifactManager { /** * Read a mailbox by its address. * This is the entry point for reading mailbox configuration from the chain. * @param address The on-chain address of the mailbox * @returns The artifact configuration and deployment data */ readMailbox(address: string): Promise; } /** * Converts a DeployedMailboxArtifact (with fully expanded nested ISM/hook artifacts) * to the DerivedCoreConfig format for backward compatibility. * * This function is used by CoreArtifactReader to provide the deriveCoreConfig() method * that existing code expects. The conversion functions for ISM and Hook artifacts * must be passed in to avoid circular dependencies. * * @param artifact The deployed mailbox artifact with expanded nested configs * @param chainLookup Chain lookup for converting domain IDs to chain names * @param converters Object containing ismArtifactToDerivedConfig and hookArtifactToDerivedConfig functions * @returns DerivedCoreConfig in the legacy format (from core.ts) */ export declare function mailboxArtifactToDerivedCoreConfig(artifact: DeployedMailboxArtifact, chainLookup: ChainLookup, converters: { ismArtifactToDerivedConfig: (artifact: DeployedIsmArtifact, chainLookup: ChainLookup) => DerivedIsmConfig; hookArtifactToDerivedConfig: (artifact: DeployedHookArtifact, chainLookup: ChainLookup) => DerivedHookConfig; }): DerivedCoreConfig; //# sourceMappingURL=mailbox.d.ts.map