UNPKG

navio-blsct

Version:

TypeScript bindings for the `libblsct` library used by the [Navio](https://nav.io/) blockchain to construct confidential transactions based on the BLS12-381 curve.

27 lines (26 loc) 799 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OutPoint = void 0; const blsct_1 = require("./blsct"); const managedObj_1 = require("./managedObj"); class OutPoint extends managedObj_1.ManagedObj { constructor(obj) { super(obj); } static generate(ctxId, outIndex) { const rv = (0, blsct_1.genOutPoint)(ctxId.serialize(), outIndex); const obj = rv.value; (0, blsct_1.freeObj)(rv); return new OutPoint(obj); } value() { return (0, blsct_1.castToOutPoint)(this.obj); } serialize() { return (0, blsct_1.serializeOutPoint)(this.value()); } static deserialize(hex) { return OutPoint._deserialize(hex, blsct_1.deserializeOutPoint); } } exports.OutPoint = OutPoint;