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.

51 lines (50 loc) 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CTxIn = void 0; const blsct_1 = require("./blsct"); const script_1 = require("./script"); const ctxId_1 = require("./ctxId"); /** Represents a transaction input in a constructed confidential transaction. Also known as `CTxIn` on the C++ side. * * For code examples, see the `ctx.ts` class documentation. */ class CTxIn { obj; constructor(obj) { this.obj = obj; } /** Returns the transaction ID of the previous output being spent. * @returns The transaction ID of the previous output. */ getPrevOutHash() { const obj = (0, blsct_1.getCTxInPrevOutHash)(this.obj); return ctxId_1.CTxId.fromObj(obj); } /** Returns the index of the previous output being spent. * @returns The index of the previous output. */ getPrevOutN() { return (0, blsct_1.getCTxInPrevOutN)(this.obj); } /** Returns the `scriptSig` of the input. * @returns The `scriptSig`. */ getScriptSig() { const obj = (0, blsct_1.getCTxInScriptSig)(this.obj); return script_1.Script.fromObj(obj); } /** Returns the sequence number of the input. * @returns The sequence number. */ getSequence() { return (0, blsct_1.getCTxInSequence)(this.obj); } /** Returns the `scriptWitness` of the input. * @returns The `scriptWitness`. */ getScriptWitness() { const obj = (0, blsct_1.getCTxInScriptWitness)(this.obj); return script_1.Script.fromObj(obj); } } exports.CTxIn = CTxIn;