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.

50 lines (49 loc) 1.91 kB
import { BlsctRetVal } from './blsct'; import * as util from 'util'; export type FinalizerInfo = { cls: string; obj: any; deleteMethod?: () => void; }; export declare abstract class ManagedObj { protected obj: any; protected objSize: number; protected fi: FinalizerInfo; /** Constructs a new instance of the class using the C++ object. * @param obj - The C++ object to use for the new instance. */ constructor(obj: any, deleteMethod?: () => void); /** Returnsthe underlying C++ object. * @returns The underlying C++ object. */ abstract value(): any; /** Returns the size of the underlying C++ object. * @returns The size of the underlying C++ object in bytes. */ size(): number; /** Constucts a new instance using the provided object. * * @param obj - The object to use for the new instance. * @return A new instance of the class. */ static fromObj<T extends ManagedObj>(this: new (obj: any, objSize?: number) => T, obj: any): T; /** Constructs a new instance using the provided object and size. * * @param obj - The object to use for the new instance. * @param objSize - The size of the object. * @return A new instance of the class. */ static fromObjAndSize<T extends ManagedObj>(this: new (obj: any) => T, obj: any, objSize: number): T; /** Returns a string representation of the instance. * @returns A string representation of the instance. */ toString(): string; /** @hidden */ [util.inspect.custom](): string; /** Serializes the instance to a hexadecimal string. * @returns A hexadecimal string representation of the instance. */ serialize(): string; /** @hidden */ protected static _deserialize<T extends ManagedObj>(this: new (obj: any) => T, hex: string, deserializer: (hex: string) => BlsctRetVal): T; }