UNPKG

@hyperlane-xyz/sdk

Version:

The official SDK for the Hyperlane Network

36 lines 1.61 kB
import { z } from 'zod'; import { OffchainLookupIsmConfigSchema } from '../ism/types.js'; import { ZHash } from '../metadata/customZodTypes.js'; import { RouterConfigSchema } from '../router/types.js'; export var IcaRouterType; (function (IcaRouterType) { IcaRouterType["REGULAR"] = "regular"; IcaRouterType["MINIMAL"] = "minimal"; })(IcaRouterType || (IcaRouterType = {})); /** * Schema for fee token approval configuration. * Used to pre-approve ERC-20 fee tokens for hooks (e.g., IGP inside aggregation hooks). */ export const FeeTokenApprovalSchema = z.object({ /** ERC-20 fee token address */ feeToken: ZHash, /** Hook address to approve (e.g., IGP inside StaticAggregationHook) */ hook: ZHash, }); export const IcaRouterConfigSchema = RouterConfigSchema.extend({ /** Router variant. 'regular' (default) deploys full InterchainAccountRouter with commit-reveal; * 'minimal' deploys MinimalInterchainAccountRouter for size-constrained chains. */ routerType: z.nativeEnum(IcaRouterType).optional(), /** Commitment ISM config — required for regular routers, must be omitted for minimal. */ commitmentIsm: OffchainLookupIsmConfigSchema.optional(), /** * Optional: Pre-approve fee tokens for hooks. * Use this when the ICA router will be used with ERC-20 fee tokens and * aggregation hooks containing an IGP as a child hook. */ feeTokenApprovals: z.array(FeeTokenApprovalSchema).optional(), }); export const DerivedIcaRouterConfigSchema = IcaRouterConfigSchema.extend({ address: z.string(), }); //# sourceMappingURL=types.js.map