import { z } from 'zod'; import { AbstractCcipReadIsm, ArbL2ToL1Ism, CCIPIsm, IAggregationIsm, IInterchainSecurityModule, IMultisigIsm, IRoutingIsm, IStaticWeightedMultisigIsm, InterchainAccountRouter, OPStackIsm, PausableIsm, TestIsm, TrustedRelayerIsm } from '@hyperlane-xyz/core'; import type { Address, Domain, ValueOf, WithAddress } from '@hyperlane-xyz/utils'; import { ChainMap, OwnableConfig } from '../types.js'; export declare enum ModuleType { UNUSED = 0, ROUTING = 1, AGGREGATION = 2, LEGACY_MULTISIG = 3,// DEPRECATED MERKLE_ROOT_MULTISIG = 4, MESSAGE_ID_MULTISIG = 5, NULL = 6, CCIP_READ = 7, ARB_L2_TO_L1 = 8, WEIGHTED_MERKLE_ROOT_MULTISIG = 9, WEIGHTED_MESSAGE_ID_MULTISIG = 10 } export declare const IsmType: { readonly CUSTOM: "custom"; readonly OP_STACK: "opStackIsm"; readonly ROUTING: "domainRoutingIsm"; readonly INCREMENTAL_ROUTING: "incrementalDomainRoutingIsm"; readonly FALLBACK_ROUTING: "defaultFallbackRoutingIsm"; readonly AMOUNT_ROUTING: "amountRoutingIsm"; readonly INTERCHAIN_ACCOUNT_ROUTING: "interchainAccountRouting"; readonly AGGREGATION: "staticAggregationIsm"; readonly STORAGE_AGGREGATION: "storageAggregationIsm"; readonly MERKLE_ROOT_MULTISIG: "merkleRootMultisigIsm"; readonly MESSAGE_ID_MULTISIG: "messageIdMultisigIsm"; readonly STORAGE_MERKLE_ROOT_MULTISIG: "storageMerkleRootMultisigIsm"; readonly STORAGE_MESSAGE_ID_MULTISIG: "storageMessageIdMultisigIsm"; readonly TEST_ISM: "testIsm"; readonly PAUSABLE: "pausableIsm"; readonly TRUSTED_RELAYER: "trustedRelayerIsm"; readonly ARB_L2_TO_L1: "arbL2ToL1Ism"; readonly WEIGHTED_MERKLE_ROOT_MULTISIG: "weightedMerkleRootMultisigIsm"; readonly WEIGHTED_MESSAGE_ID_MULTISIG: "weightedMessageIdMultisigIsm"; readonly CCIP: "ccipIsm"; readonly OFFCHAIN_LOOKUP: "offchainLookupIsm"; readonly UNKNOWN: "unknownIsm"; }; export type IsmType = (typeof IsmType)[keyof typeof IsmType]; export type DeployableIsmType = Exclude; export declare const MUTABLE_ISM_TYPE: IsmType[]; /** * @notice Statically deployed ISM types * @dev ISM types with immutable config embedded in contract bytecode via MetaProxy */ export declare const STATIC_ISM_TYPES: IsmType[]; export declare const DYNAMICALLY_ROUTED_ISM_TYPES: readonly ["amountRoutingIsm", "interchainAccountRouting"]; /** Type guard for dynamically routed ISM types */ export declare function isDynamicallyRoutedIsmType(type: IsmType): type is (typeof DYNAMICALLY_ROUTED_ISM_TYPES)[number]; export declare function ismTypeToModuleType(ismType: IsmType): ModuleType; export type ValidatorConfig = { address: Address; alias: string; }; export type MultisigConfig = { validators: Array; threshold: number; }; export type MultisigIsmConfig = z.infer; export type WeightedMultisigIsmConfig = z.infer; export type TestIsmConfig = z.infer; export type PausableIsmConfig = z.infer; export type OpStackIsmConfig = z.infer; export type TrustedRelayerIsmConfig = z.infer; export type CCIPIsmConfig = z.infer; export type ArbL2ToL1IsmConfig = z.infer; export type OffchainLookupIsmConfig = z.infer; export type NullIsmConfig = TestIsmConfig | PausableIsmConfig | OpStackIsmConfig | TrustedRelayerIsmConfig | CCIPIsmConfig; type BaseRoutingIsmConfig = { type: T; }; export type DomainRoutingIsmConfig = BaseRoutingIsmConfig & OwnableConfig & { domains: ChainMap; }; export declare const InterchainAccountRouterIsmSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; } & { type: z.ZodLiteral<"interchainAccountRouting">; isms: z.ZodRecord; }, "strip", z.ZodTypeAny, { type: "interchainAccountRouting"; owner: string; isms: Record; ownerOverrides?: Record | undefined; }, { type: "interchainAccountRouting"; owner: string; isms: Record; ownerOverrides?: Record | undefined; }>; export type InterchainAccountRouterIsm = z.infer; export type AmountRoutingIsmConfig = BaseRoutingIsmConfig & { lowerIsm: IsmConfig; upperIsm: IsmConfig; threshold: number; }; export type RoutingIsmConfig = DomainRoutingIsmConfig | AmountRoutingIsmConfig | InterchainAccountRouterIsm; export type AggregationIsmConfig = { type: typeof IsmType.AGGREGATION | typeof IsmType.STORAGE_AGGREGATION; modules: Array; threshold: number; }; export type IsmConfig = z.infer; export type DerivedIsmConfig = WithAddress>; export type DeployedIsmType = { [IsmType.CUSTOM]: IInterchainSecurityModule; [IsmType.ROUTING]: IRoutingIsm; [IsmType.FALLBACK_ROUTING]: IRoutingIsm; [IsmType.AMOUNT_ROUTING]: IRoutingIsm; [IsmType.INCREMENTAL_ROUTING]: IRoutingIsm; [IsmType.AGGREGATION]: IAggregationIsm; [IsmType.STORAGE_AGGREGATION]: IAggregationIsm; [IsmType.MERKLE_ROOT_MULTISIG]: IMultisigIsm; [IsmType.MESSAGE_ID_MULTISIG]: IMultisigIsm; [IsmType.STORAGE_MERKLE_ROOT_MULTISIG]: IMultisigIsm; [IsmType.STORAGE_MESSAGE_ID_MULTISIG]: IMultisigIsm; [IsmType.OP_STACK]: OPStackIsm; [IsmType.TEST_ISM]: TestIsm; [IsmType.PAUSABLE]: PausableIsm; [IsmType.TRUSTED_RELAYER]: TrustedRelayerIsm; [IsmType.CCIP]: CCIPIsm; [IsmType.ARB_L2_TO_L1]: ArbL2ToL1Ism; [IsmType.WEIGHTED_MERKLE_ROOT_MULTISIG]: IStaticWeightedMultisigIsm; [IsmType.WEIGHTED_MESSAGE_ID_MULTISIG]: IStaticWeightedMultisigIsm; [IsmType.OFFCHAIN_LOOKUP]: AbstractCcipReadIsm; [IsmType.INTERCHAIN_ACCOUNT_ROUTING]: InterchainAccountRouter; [IsmType.UNKNOWN]: IInterchainSecurityModule; }; export type DeployedIsm = ValueOf; export type RoutingIsmDelta = { domainsToUnenroll: Domain[]; domainsToEnroll: Domain[]; owner?: Address; mailbox?: Address; }; export declare const TestIsmConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"testIsm">; }, "strip", z.ZodTypeAny, { type: "testIsm"; }, { type: "testIsm"; }>; export declare const MultisigConfigSchema: z.ZodObject<{ validators: z.ZodArray; threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { threshold: number; validators: string[]; }, { threshold: number; validators: string[]; }>; export declare const WeightedMultisigConfigSchema: z.ZodObject<{ validators: z.ZodArray, "many">; thresholdWeight: z.ZodNumber; }, "strip", z.ZodTypeAny, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }>; export declare const TrustedRelayerIsmConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"trustedRelayerIsm">; relayer: z.ZodString; }, "strip", z.ZodTypeAny, { type: "trustedRelayerIsm"; relayer: string; }, { type: "trustedRelayerIsm"; relayer: string; }>; export declare const CCIPIsmConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"ccipIsm">; originChain: z.ZodString; }, "strip", z.ZodTypeAny, { type: "ccipIsm"; originChain: string; }, { type: "ccipIsm"; originChain: string; }>; export declare const OffchainLookupIsmConfigSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; } & { type: z.ZodLiteral<"offchainLookupIsm">; urls: z.ZodArray; }, "strip", z.ZodTypeAny, { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }, { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }>; export declare const isOffchainLookupIsmConfig: (config: unknown) => config is { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }; export declare const OpStackIsmConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"opStackIsm">; origin: z.ZodString; nativeBridge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "opStackIsm"; origin: string; nativeBridge: string; }, { type: "opStackIsm"; origin: string; nativeBridge: string; }>; export declare const ArbL2ToL1IsmConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"arbL2ToL1Ism">; bridge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "arbL2ToL1Ism"; bridge: string; }, { type: "arbL2ToL1Ism"; bridge: string; }>; export declare const PausableIsmConfigSchema: z.ZodIntersection>; } & { paused: z.ZodBoolean; }, "strip", z.ZodTypeAny, { owner: string; paused: boolean; ownerOverrides?: Record | undefined; }, { owner: string; paused: boolean; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"pausableIsm">; }, "strip", z.ZodTypeAny, { type: "pausableIsm"; }, { type: "pausableIsm"; }>>; export declare const MultisigIsmConfigSchema: z.ZodIntersection; threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { threshold: number; validators: string[]; }, { threshold: number; validators: string[]; }>, z.ZodObject<{ type: z.ZodUnion<[z.ZodLiteral<"merkleRootMultisigIsm">, z.ZodLiteral<"messageIdMultisigIsm">, z.ZodLiteral<"storageMerkleRootMultisigIsm">, z.ZodLiteral<"storageMessageIdMultisigIsm">]>; }, "strip", z.ZodTypeAny, { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }, { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }>>; export declare const WeightedMultisigIsmConfigSchema: z.ZodIntersection, "many">; thresholdWeight: z.ZodNumber; }, "strip", z.ZodTypeAny, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }>, z.ZodObject<{ type: z.ZodUnion<[z.ZodLiteral<"weightedMerkleRootMultisigIsm">, z.ZodLiteral<"weightedMessageIdMultisigIsm">]>; }, "strip", z.ZodTypeAny, { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }, { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }>>; export declare const RoutingIsmConfigSchema: z.ZodSchema; export declare const AggregationIsmConfigSchema: z.ZodSchema; export declare const UnknownIsmConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"unknownIsm">; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">>; export type UnknownIsmConfig = z.infer; /** * Recursively normalizes unknown ISM type values to IsmType.UNKNOWN. * Use this before parsing with IsmConfigSchema when configs may contain * ISM types not yet known to this SDK version. * * Note: String address configs (e.g., "0x...") are passed through unchanged * since they represent deployed ISM addresses, not ISM type configs. */ export declare function normalizeUnknownIsmTypes(config: T): T; export declare const IsmConfigSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{ type: z.ZodLiteral<"testIsm">; }, "strip", z.ZodTypeAny, { type: "testIsm"; }, { type: "testIsm"; }>, z.ZodObject<{ type: z.ZodLiteral<"opStackIsm">; origin: z.ZodString; nativeBridge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "opStackIsm"; origin: string; nativeBridge: string; }, { type: "opStackIsm"; origin: string; nativeBridge: string; }>, z.ZodIntersection>; } & { paused: z.ZodBoolean; }, "strip", z.ZodTypeAny, { owner: string; paused: boolean; ownerOverrides?: Record | undefined; }, { owner: string; paused: boolean; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"pausableIsm">; }, "strip", z.ZodTypeAny, { type: "pausableIsm"; }, { type: "pausableIsm"; }>>, z.ZodObject<{ type: z.ZodLiteral<"trustedRelayerIsm">; relayer: z.ZodString; }, "strip", z.ZodTypeAny, { type: "trustedRelayerIsm"; relayer: string; }, { type: "trustedRelayerIsm"; relayer: string; }>, z.ZodObject<{ type: z.ZodLiteral<"ccipIsm">; originChain: z.ZodString; }, "strip", z.ZodTypeAny, { type: "ccipIsm"; originChain: string; }, { type: "ccipIsm"; originChain: string; }>, z.ZodIntersection; threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { threshold: number; validators: string[]; }, { threshold: number; validators: string[]; }>, z.ZodObject<{ type: z.ZodUnion<[z.ZodLiteral<"merkleRootMultisigIsm">, z.ZodLiteral<"messageIdMultisigIsm">, z.ZodLiteral<"storageMerkleRootMultisigIsm">, z.ZodLiteral<"storageMessageIdMultisigIsm">]>; }, "strip", z.ZodTypeAny, { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }, { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }>>, z.ZodIntersection, "many">; thresholdWeight: z.ZodNumber; }, "strip", z.ZodTypeAny, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }>, z.ZodObject<{ type: z.ZodUnion<[z.ZodLiteral<"weightedMerkleRootMultisigIsm">, z.ZodLiteral<"weightedMessageIdMultisigIsm">]>; }, "strip", z.ZodTypeAny, { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }, { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }>>, z.ZodType, z.ZodType, z.ZodObject<{ type: z.ZodLiteral<"arbL2ToL1Ism">; bridge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "arbL2ToL1Ism"; bridge: string; }, { type: "arbL2ToL1Ism"; bridge: string; }>, z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; } & { type: z.ZodLiteral<"offchainLookupIsm">; urls: z.ZodArray; }, "strip", z.ZodTypeAny, { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }, { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; } & { type: z.ZodLiteral<"interchainAccountRouting">; isms: z.ZodRecord; }, "strip", z.ZodTypeAny, { type: "interchainAccountRouting"; owner: string; isms: Record; ownerOverrides?: Record | undefined; }, { type: "interchainAccountRouting"; owner: string; isms: Record; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"unknownIsm">; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">>]>; /** * Forward-compatible ISM config schema that normalizes unknown ISM types. * Use this instead of IsmConfigSchema when parsing configs that may contain * ISM types added in newer registry versions. */ export declare const SafeParseIsmConfigSchema: z.ZodEffects; }, "strip", z.ZodTypeAny, { type: "testIsm"; }, { type: "testIsm"; }>, z.ZodObject<{ type: z.ZodLiteral<"opStackIsm">; origin: z.ZodString; nativeBridge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "opStackIsm"; origin: string; nativeBridge: string; }, { type: "opStackIsm"; origin: string; nativeBridge: string; }>, z.ZodIntersection>; } & { paused: z.ZodBoolean; }, "strip", z.ZodTypeAny, { owner: string; paused: boolean; ownerOverrides?: Record | undefined; }, { owner: string; paused: boolean; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"pausableIsm">; }, "strip", z.ZodTypeAny, { type: "pausableIsm"; }, { type: "pausableIsm"; }>>, z.ZodObject<{ type: z.ZodLiteral<"trustedRelayerIsm">; relayer: z.ZodString; }, "strip", z.ZodTypeAny, { type: "trustedRelayerIsm"; relayer: string; }, { type: "trustedRelayerIsm"; relayer: string; }>, z.ZodObject<{ type: z.ZodLiteral<"ccipIsm">; originChain: z.ZodString; }, "strip", z.ZodTypeAny, { type: "ccipIsm"; originChain: string; }, { type: "ccipIsm"; originChain: string; }>, z.ZodIntersection; threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { threshold: number; validators: string[]; }, { threshold: number; validators: string[]; }>, z.ZodObject<{ type: z.ZodUnion<[z.ZodLiteral<"merkleRootMultisigIsm">, z.ZodLiteral<"messageIdMultisigIsm">, z.ZodLiteral<"storageMerkleRootMultisigIsm">, z.ZodLiteral<"storageMessageIdMultisigIsm">]>; }, "strip", z.ZodTypeAny, { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }, { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }>>, z.ZodIntersection, "many">; thresholdWeight: z.ZodNumber; }, "strip", z.ZodTypeAny, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }, { validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; }>, z.ZodObject<{ type: z.ZodUnion<[z.ZodLiteral<"weightedMerkleRootMultisigIsm">, z.ZodLiteral<"weightedMessageIdMultisigIsm">]>; }, "strip", z.ZodTypeAny, { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }, { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }>>, z.ZodType, z.ZodType, z.ZodObject<{ type: z.ZodLiteral<"arbL2ToL1Ism">; bridge: z.ZodString; }, "strip", z.ZodTypeAny, { type: "arbL2ToL1Ism"; bridge: string; }, { type: "arbL2ToL1Ism"; bridge: string; }>, z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; } & { type: z.ZodLiteral<"offchainLookupIsm">; urls: z.ZodArray; }, "strip", z.ZodTypeAny, { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }, { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; } & { type: z.ZodLiteral<"interchainAccountRouting">; isms: z.ZodRecord; }, "strip", z.ZodTypeAny, { type: "interchainAccountRouting"; owner: string; isms: Record; ownerOverrides?: Record | undefined; }, { type: "interchainAccountRouting"; owner: string; isms: Record; ownerOverrides?: Record | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"unknownIsm">; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">>]>, string | ({ threshold: number; validators: string[]; } & { type: "merkleRootMultisigIsm" | "messageIdMultisigIsm" | "storageMerkleRootMultisigIsm" | "storageMessageIdMultisigIsm"; }) | ({ validators: { signingAddress: string; weight: number; }[]; thresholdWeight: number; } & { type: "weightedMerkleRootMultisigIsm" | "weightedMessageIdMultisigIsm"; }) | { type: "testIsm"; } | ({ owner: string; paused: boolean; ownerOverrides?: Record | undefined; } & { type: "pausableIsm"; }) | { type: "opStackIsm"; origin: string; nativeBridge: string; } | { type: "trustedRelayerIsm"; relayer: string; } | { type: "ccipIsm"; originChain: string; } | { type: "arbL2ToL1Ism"; bridge: string; } | { type: "offchainLookupIsm"; owner: string; urls: string[]; ownerOverrides?: Record | undefined; } | RoutingIsmConfig | AggregationIsmConfig | z.objectOutputType<{ type: z.ZodLiteral<"unknownIsm">; }, z.ZodTypeAny, "passthrough">, unknown>; export {}; //# sourceMappingURL=types.d.ts.map