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.

22 lines (21 loc) 687 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TxKey = void 0; const blsct_1 = require("../../blsct"); const scalar_1 = require("../../scalar"); const spendingKey_1 = require("./txKeyDesc/spendingKey"); const viewKey_1 = require("./txKeyDesc/viewKey"); class TxKey extends scalar_1.Scalar { constructor(obj) { super(obj); } toSpendingKey() { const obj = (0, blsct_1.fromTxKeyToSpendingKey)(this.value()); return new spendingKey_1.SpendingKey(obj); } toViewKey() { const obj = (0, blsct_1.fromTxKeyToViewKey)(this.value()); return new viewKey_1.ViewKey(obj); } } exports.TxKey = TxKey;