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.

33 lines (32 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ChildKey = void 0; const blsct_1 = require("../blsct"); const blindingKey_1 = require("./childKeyDesc/blindingKey"); const scalar_1 = require("../scalar"); const tokenKey_1 = require("./childKeyDesc/tokenKey"); const txKey_1 = require("./childKeyDesc/txKey"); class ChildKey extends scalar_1.Scalar { constructor(obj) { if (obj === undefined || obj === null) { super(obj); } else { const childKeyObj = (0, blsct_1.fromSeedToChildKey)(obj.value()); super(childKeyObj); } } toBlindingKey() { const obj = (0, blsct_1.fromChildKeyToBlindingKey)(this.value()); return blindingKey_1.BlindingKey.fromObj(obj); } toTokenKey() { const obj = (0, blsct_1.fromChildKeyToTokenKey)(this.value()); return tokenKey_1.TokenKey.fromObj(obj); } toTxKey() { const obj = (0, blsct_1.fromChildKeyToTxKey)(this.value()); return txKey_1.TxKey.fromObj(obj); } } exports.ChildKey = ChildKey;