UNPKG

@pokt-network/pocket-js

Version:

Pocket-js core package with the main functionalities to interact with the Pocket Network.

49 lines (48 loc) 1.32 kB
import { Hex } from "../../utils/hex"; /** * * * @class SimpleProof */ export declare class SimpleProof { /** * * Creates a SimpleProof object using a JSON string * @param {string} json - JSON string. * @returns {SimpleProof} - SimpleProof object. * @memberof SimpleProof */ static fromJSON(json: string): SimpleProof; readonly total: BigInt; readonly index: BigInt; readonly leafHash: Hex | null; readonly aunts: Hex[] | null; /** * SimpleProof. * @constructor * @param {BigInt} total - Total number of items. * @param {BigInt} index - Index of item to prove. * @param {Hex} leafHash - Hash of item value. * @param {Hex[]} aunts - Hashes from leaf's sibling to a root's child. */ constructor(total: BigInt, index: BigInt, leafHash: Hex | null, aunts: Hex[] | null); /** * * Creates a JSON object with the SimpleProof properties * @returns {JSON} - JSON Object. * @memberof SimpleProof */ toJSON(): { aunts: Hex[] | null; index: number; leaf_hash: Hex | null; total: number; }; /** * * Check if the SimpleProof object is valid * @returns {boolean} - True or false. * @memberof SimpleProof */ isValid(): boolean; }