import { z } from 'zod'; import { Address, WithAddress } from '@hyperlane-xyz/utils'; import { ChainMap, OwnableConfig } from '../types.js'; export declare enum OnchainHookType { UNUSED = 0, ROUTING = 1, AGGREGATION = 2, MERKLE_TREE = 3, INTERCHAIN_GAS_PAYMASTER = 4, FALLBACK_ROUTING = 5, ID_AUTH_ISM = 6, PAUSABLE = 7, PROTOCOL_FEE = 8, DEPRECATED = 9, RATE_LIMITED = 10, ARB_L2_TO_L1 = 11, OP_L2_TO_L1 = 12, MAILBOX_DEFAULT_HOOK = 13, AMOUNT_ROUTING = 14, CCTP = 15, TIMELOCK_ROUTING = 16, PREDICATE_ROUTER_WRAPPER = 17 } export declare const HookType: { /** * Retained for backwards compatibility with pre-deployed hooks that don't fit * a named type. Excluded from `DeployableHookType` — cannot be deployed via * `HyperlaneHookDeployer`. New code should use a specific named hook type. */ readonly CUSTOM: 'custom'; readonly MERKLE_TREE: 'merkleTreeHook'; readonly INTERCHAIN_GAS_PAYMASTER: 'interchainGasPaymaster'; readonly AGGREGATION: 'aggregationHook'; readonly PROTOCOL_FEE: 'protocolFee'; readonly OP_STACK: 'opStackHook'; readonly ROUTING: 'domainRoutingHook'; readonly FALLBACK_ROUTING: 'fallbackRoutingHook'; readonly AMOUNT_ROUTING: 'amountRoutingHook'; readonly PAUSABLE: 'pausableHook'; readonly ARB_L2_TO_L1: 'arbL2ToL1Hook'; readonly MAILBOX_DEFAULT: 'defaultHook'; readonly CCIP: 'ccipHook'; /** * References a pre-deployed CCTP hook by address. Excluded from * `DeployableHookType` — not deployed via `HyperlaneHookDeployer`; the * `EvmHookModule.deploy` path just connects to `config.address`. */ readonly CCTP: 'cctpHook'; /** * Rate-limits outbound token volume on the origin chain at dispatch time. * Warp-route only. Not valid for core required/default hooks. */ readonly RATE_LIMITED: 'rateLimitedHook'; /** * Hook view of the NetFlowRateLimitedHookIsm hybrid: one contract instance * is installed as BOTH the hook and the ISM of a single warp router. * Read-only on the hook side — deployed via the ISM config surface * (IsmType.NET_FLOW_RATE_LIMITED) and referenced by address as the hook. * Excluded from `DeployableHookType`. */ readonly NET_FLOW_RATE_LIMITED: 'netFlowRateLimitedHookIsm'; /** * Hook view of the DelayedFlowRouterHookIsm hybrid (see * NET_FLOW_RATE_LIMITED above; ISM-side type is * IsmType.DELAYED_FLOW_ROUTER). Excluded from `DeployableHookType`. */ readonly DELAYED_FLOW_ROUTER: 'delayedFlowRouterHookIsm'; readonly UNKNOWN: 'unknownHook'; readonly PREDICATE: 'predicateHook'; }; export type HookType = (typeof HookType)[keyof typeof HookType]; export type DeployableHookType = Exclude; export declare const HookTypeToContractNameMap: Record; export type MerkleTreeHookConfig = z.infer; export type IgpHookConfig = z.infer; export type ProtocolFeeHookConfig = z.infer; export type PausableHookConfig = z.infer; export type OpStackHookConfig = z.infer; export type ArbL2ToL1HookConfig = { type: typeof HookType.ARB_L2_TO_L1; arbSys: string; bridge?: string; destinationChain: string; childHook: HookConfig; }; export type MailboxDefaultHookConfig = z.infer; export type RateLimitedHookConfig = z.infer; export type CCIPHookConfig = z.infer; export type AggregationHookConfig = { type: typeof HookType.AGGREGATION; hooks: Array; address?: Address; }; export type RoutingHookConfig = OwnableConfig & { domains: ChainMap; address?: Address; }; export type DomainRoutingHookConfig = RoutingHookConfig & { type: typeof HookType.ROUTING; }; export type FallbackRoutingHookConfig = RoutingHookConfig & { type: typeof HookType.FALLBACK_ROUTING; fallback: HookConfig; }; export type AmountRoutingHookConfig = { type: typeof HookType.AMOUNT_ROUTING; threshold: number; lowerHook: HookConfig; upperHook: HookConfig; }; export type HookConfig = Address | ProtocolFeeHookConfig | PausableHookConfig | OpStackHookConfig | MerkleTreeHookConfig | IgpHookConfig | DomainRoutingHookConfig | FallbackRoutingHookConfig | AmountRoutingHookConfig | AggregationHookConfig | ArbL2ToL1HookConfig | MailboxDefaultHookConfig | CCIPHookConfig | CctpHookConfig | RateLimitedHookConfig | NetFlowRateLimitedHookConfig | DelayedFlowRouterHookConfig | UnknownHookConfig | PredicateHookConfig; export type DerivedHookConfig = WithAddress>; export declare enum IgpVersion { Legacy = "legacy", Latest = "latest" } export declare const OFFCHAIN_QUOTED_IGP_VERSION = "11.3.0"; export declare const MUTABLE_HOOK_TYPE: HookType[]; export declare const ProtocolFeeSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; type: z.ZodLiteral<"protocolFee">; beneficiary: z.ZodString; maxProtocolFee: z.ZodString; protocolFee: z.ZodString; }, z.core.$strip>; export declare const MerkleTreeSchema: z.ZodObject<{ type: z.ZodLiteral<"merkleTreeHook">; address: z.ZodOptional; }, z.core.$strip>; export declare const PredicateHookSchema: z.ZodObject<{ type: z.ZodLiteral<"predicateHook">; address: z.ZodString; }, z.core.$strip>; export type PredicateHookConfig = z.infer; export declare const PausableHookSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; paused: z.ZodBoolean; type: z.ZodLiteral<"pausableHook">; address: z.ZodOptional; }, z.core.$strip>; export declare const MailboxDefaultHookSchema: z.ZodObject<{ type: z.ZodLiteral<"defaultHook">; }, z.core.$strip>; export declare const OpStackHookSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; type: z.ZodLiteral<"opStackHook">; nativeBridge: z.ZodString; destinationChain: z.ZodString; }, z.core.$strip>; export declare const ArbL2ToL1HookSchema: z.ZodType; export declare const IgpSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; type: z.ZodLiteral<"interchainGasPaymaster">; beneficiary: z.ZodString; oracleKey: z.ZodString; overhead: z.ZodRecord; oracleConfig: z.ZodRecord; typicalCost: z.ZodOptional>; }, z.core.$strip>>; igpVersion: z.ZodOptional>; quoteSigners: z.ZodOptional>; contractVersion: z.ZodOptional; tokenOracleConfig: z.ZodOptional; }, z.core.$strip>>>>; }, z.core.$strip>; export declare const DomainRoutingHookConfigSchema: z.ZodType; export declare const FallbackRoutingHookConfigSchema: z.ZodType; export declare const AmountRoutingHookConfigSchema: z.ZodType; export declare const AggregationHookConfigSchema: z.ZodType; export declare const CCIPHookSchema: z.ZodObject<{ type: z.ZodLiteral<"ccipHook">; destinationChain: z.ZodString; }, z.core.$strip>; export declare const CctpHookSchema: z.ZodObject<{ type: z.ZodLiteral<"cctpHook">; address: z.ZodString; }, z.core.$strip>; export type CctpHookConfig = z.infer; export declare const UnknownHookSchema: z.ZodObject<{ type: z.ZodLiteral<"unknownHook">; }, z.core.$loose>; export type UnknownHookConfig = z.infer; export declare const RateLimitedHookSchema: z.ZodPipe>; type: z.ZodLiteral<"rateLimitedHook">; maxCapacity: z.ZodString; duration: z.ZodDefault, z.ZodString]>, z.ZodTransform>>; }, z.core.$strip>, z.ZodTransform<{ owner: string; ownerOverrides?: Record | undefined; type: "rateLimitedHook"; maxCapacity: string; duration: bigint; }, { owner: string; ownerOverrides?: Record | undefined; type: "rateLimitedHook"; maxCapacity: string; duration: bigint; }>>; export declare const NetFlowRateLimitedHookConfigSchema: z.ZodObject<{ type: z.ZodLiteral<"netFlowRateLimitedHookIsm">; warpRouter: z.ZodOptional; thresholdBps: z.ZodNumber; duration: z.ZodPipe, z.ZodString]>, z.ZodTransform>; owner: z.ZodOptional; }, z.core.$strip>; export type NetFlowRateLimitedHookConfig = z.infer; export declare const DelayedFlowRouterHookConfigSchema: z.ZodObject<{ owner: z.ZodString; ownerOverrides: z.ZodOptional>; type: z.ZodLiteral<"delayedFlowRouterHookIsm">; warpRouter: z.ZodOptional; thresholdBps: z.ZodNumber; maxDelay: z.ZodNumber; duration: z.ZodPipe, z.ZodString]>, z.ZodTransform>; remoteIsms: z.ZodOptional>>>; }, z.core.$strip>; export type DelayedFlowRouterHookConfig = z.infer; /** * Recursively normalizes unknown hook type values to HookType.UNKNOWN. * Use this before parsing with HookConfigSchema when configs may contain * hook types not yet known to this SDK version. * * Note: String address configs (e.g., "0x...") are passed through unchanged * since they represent deployed hook addresses, not hook type configs. */ export declare function normalizeUnknownHookTypes(config: T): T; export declare const HookConfigSchema: z.ZodType; /** * Forward-compatible hook config schema that normalizes unknown hook types. * Use this instead of HookConfigSchema when parsing configs that may contain * hook types added in newer registry versions. */ export declare const SafeParseHookConfigSchema: z.ZodPreprocess>, unknown>; export declare const HooksConfigSchema: z.ZodObject<{ default: z.ZodType>; required: z.ZodType>; }, z.core.$strip>; export type HooksConfig = z.infer; export declare const HooksConfigMapSchema: z.ZodRecord>; required: z.ZodType>; }, z.core.$strip>>; export type HooksConfigMap = z.infer; //# sourceMappingURL=types.d.ts.map