"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validRoute = void 0;
const express_1 = __importDefault(require("express"));
const logger_1 = __importDefault(require("../../logger"));
const chain_state_1 = require("../../providers/chain-state");
const router = express_1.default.Router({ mergeParams: true });
router.get('/:input', async function (req, res) {
    const { chain, network, input } = req.params;
    try {
        const isValid = await chain_state_1.ChainStateProvider.isValid({
            chain,
            network,
            input
        });
        return res.send(isValid);
    }
    catch (err) {
        logger_1.default.error('Error checking network validity: %o', err.stack || err.message || err);
        return res.status(500).send(err.message || err);
    }
});
exports.validRoute = {
    router,
    path: '/valid'
};
//# sourceMappingURL=valid.js.map