UNPKG

@govtechsg/open-attestation

Version:
15 lines (14 loc) 988 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProofPurpose = exports.ProofType = exports.SignatureAlgorithm = exports.OpenAttestationHexString = exports.SchemaId = void 0; var runtypes_1 = require("runtypes"); var bytes_1 = require("@ethersproject/bytes"); var SchemaId; (function (SchemaId) { SchemaId["v2"] = "https://schema.openattestation.com/2.0/schema.json"; SchemaId["v3"] = "https://schema.openattestation.com/3.0/schema.json"; })(SchemaId || (exports.SchemaId = SchemaId = {})); exports.OpenAttestationHexString = runtypes_1.String.withConstraint(function (value) { return (0, bytes_1.isHexString)("0x".concat(value), 32) || "".concat(value, " has not the expected length of 32 bytes"); }); exports.SignatureAlgorithm = (0, runtypes_1.Literal)("OpenAttestationMerkleProofSignature2018"); exports.ProofType = (0, runtypes_1.Literal)("OpenAttestationSignature2018"); exports.ProofPurpose = (0, runtypes_1.Literal)("assertionMethod");