charms-js
Version:
TypeScript SDK for decoding Bitcoin transactions containing Charms data
10 lines (9 loc) • 363 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseSpellAndProof = parseSpellAndProof;
const cbor_1 = require("cbor");
// Parse spell and proof tuple from CBOR data
function parseSpellAndProof(spellData) {
const [spell, proofBuf] = (0, cbor_1.decode)(spellData);
return { spell, proof: new Uint8Array(proofBuf) };
}