jsonld-signatures-merkleproof2019
Version:
A jsonld signature implementation to support MerkleProof2019 verification in Verifiable Credential context
16 lines (15 loc) • 511 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = getTransactionId;
function getTransactionId(proof = null) {
if (!proof) {
throw new Error('DecodedProof is not set');
}
const { anchors } = proof;
const anchor = anchors[0];
if (typeof anchor === 'string') {
const dataArray = anchor.split(':');
return dataArray.pop();
}
throw new Error('Could not retrieve transaction id as was provided an unexpected format');
}