import {} from '../trust-kernel/route-contract.js';
import { ROUTE_COMPLETION_CONTRACT_SCHEMA, isTrustStatus } from '../trust-kernel/trust-kernel-schema.js';
import { ValidationError } from './validation-error.js';
export function parseRouteCompletionContract(value) {
    if (!value || typeof value !== 'object')
        throw new ValidationError(ROUTE_COMPLETION_CONTRACT_SCHEMA);
    const contract = value;
    if (contract.schema !== ROUTE_COMPLETION_CONTRACT_SCHEMA || !contract.required || typeof contract.required !== 'object') {
        throw new ValidationError(ROUTE_COMPLETION_CONTRACT_SCHEMA);
    }
    if (!contract.evidence || typeof contract.evidence !== 'object' || !isTrustStatus(contract.status)) {
        throw new ValidationError(ROUTE_COMPLETION_CONTRACT_SCHEMA);
    }
    return contract;
}
//# sourceMappingURL=route-contract-validator.js.map