UNPKG

pharos-agent-kit

Version:
37 lines 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDebridgeTokensInfoSchema = exports.chainIdSchema = exports.EVM_ADDRESS_REGEX = void 0; const zod_1 = require("zod"); // Regular expressions for validating addresses exports.EVM_ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/; // Chain ID validation schema exports.chainIdSchema = zod_1.z.string().refine((val) => { const num = Number.parseInt(val, 10); // Regular chain IDs (1-99999) if (num > 0 && num < 100000) { return true; } // Special chain IDs (100000000+) if (num >= 100000000) { return true; } return false; }, { message: "Chain ID must be either 1-99999, or 100000000+", }); // Token info parameters schema exports.getDebridgeTokensInfoSchema = zod_1.z.object({ /** Chain ID to query tokens for */ chainId: exports.chainIdSchema.describe("Chain ID to get token information for. Examples: '1' (Ethereum), '56' (BNB Chain)"), /** Optional token address to filter results */ tokenAddress: zod_1.z .string() .optional() .describe("Token address to query information for. For Pharos chain: use 0x-prefixed address"), /** Optional search term to filter tokens by name or symbol */ search: zod_1.z .string() .optional() .describe("Search term to filter tokens by name or symbol (e.g., 'USDC', 'Ethereum')"), }); //# sourceMappingURL=index.js.map