import { ChainMetadataSchema, } from '@hyperlane-xyz/sdk';
import { z } from 'zod';
import { WARP_ROUTE_ID_REGEX } from './consts.js';
export const ChainAddressesSchema = z.record(z.string());
/**
 * Schema for warp route filter parameters.
 * This serves as the single source of truth for both TypeScript types and validation.
 */
export const WarpRouteFilterSchema = z
    .object({
    symbol: z.string().optional(),
    label: z.string().optional(),
})
    .strict();
export const UpdateChainSchema = z.object({
    metadata: ChainMetadataSchema.optional(),
    addresses: ChainAddressesSchema.optional(),
});
export const WarpRouteIdSchema = z
    .string()
    .regex(WARP_ROUTE_ID_REGEX, 'Must be in the format SYMBOL/label (e.g., ETH/ethereum-base, USDC.e/arbitrum-polygon)');
export const AddWarpRouteConfigOptionsSchema = z.union([
    z.object({ symbol: z.string() }),
    z.object({ warpRouteId: WarpRouteIdSchema }),
]);
