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.
37 lines (36 loc) • 1.38 kB
TypeScript
import { ManagedObj } from './managedObj';
import { CTxId } from './ctxId';
/** Represents an outpoint of a confidential transaction. Also known as `COutPoint` on the C++ side.
*
* Examples:
* ```ts
* const { OutPoint, CTxId, CTX_ID_SIZE } = require('navio-blsct')
* const { randomBytes } = require('crypto')
* const cTxIdHex = randomBytes(CTX_ID_SIZE).toString('hex')
* const cTxId = CTxId.deserialize(cTxIdHex)
* const outIndex = 0
* const outPoint = OutPoint.generate(cTxId, outIndex)
* outPoint
* const ser = outPoint.serialize()
* const deser = OutPoint.deserialize(ser)
* ser === deser.serialize() // true
* ```
*/
export declare class OutPoint extends ManagedObj {
constructor(obj: any);
/** Generates a new `OutPoint` instance.
*
* @param ctxId - The transaction ID of the outpoint.
* @param outIndex - The output index of the outpoint.
* @return A new `OutPoint` instance with the specified transaction ID and output index.
*/
static generate(ctxId: CTxId, outIndex: number): OutPoint;
value(): any;
serialize(): string;
/** Deserializes an `OutPoint` from its hexadecimal representation.
*
* @param hex - The hexadecimal string to deserialize.
* @returns A new `OutPoint` instance.
*/
static deserialize(this: new (obj: any) => OutPoint, hex: string): OutPoint;
}