jsonld-signatures-merkleproof2019
Version:
A jsonld signature implementation to support MerkleProof2019 verification in Verifiable Credential context
13 lines (12 loc) • 413 B
JavaScript
export default 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');
}