UNPKG

@pokt-network/pocket-js

Version:

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

94 lines (93 loc) 3.08 kB
/// <reference types="node" /> import { PocketAAT } from "@pokt-network/aat-js"; import { RequestHash } from "./input/request-hash"; /** * * * @class Proof */ export declare class RelayProof { /** * * Creates a Proof object using a JSON string * @param {string} json - JSON string. * @returns {RelayProof} - Proof object. * @memberof Proof */ static fromJSON(json: string): RelayProof; /** * * Creates a Proof object using a JSON string * @param {BigInt} entropy - Entropy big int value. * @param {BigInt} sessionBlockHeight - Session Block Height. * @param {string} servicerPubKey - Servicer Public Key. * @param {string} blockchain - Blockchain hash. * @param {PocketAAT} token - PocketAAT token. * @param {RequestHash} requestHash - RequestHash object. * @returns {Buffer} - Buffer. * @memberof RelayProof */ static bytes(entropy: BigInt, sessionBlockHeight: BigInt, servicerPubKey: string, blockchain: string, token: PocketAAT, requestHash: RequestHash): Buffer; /** * * Creates a hash using the PocketAAT object * @param {PocketAAT} aat - PocketAAT token. * @returns {string} - PocketAAT Hash string. * @memberof RelayProof */ private static hashAAT; /** * * Creates a hash using the RequestHash object * @param {RequestHash} request - RequestHash object. * @returns {string} - RequestHash string. * @memberof RelayProof */ private static hashRequest; readonly entropy: BigInt; readonly sessionBlockHeight: BigInt; readonly servicerPubKey: string; readonly blockchain: string; readonly token: PocketAAT; readonly signature: string; readonly requestHash: RequestHash; /** * Proof. * @constructor * @param {BigInt} entropy - Index entropy value. * @param {BigInt} sessionBlockHeight - Session Block Height. * @param {string} servicerPubKey - Service PublicKey. * @param {string} blockchain - Blockchain hash. * @param {PocketAAT} token - Application Authentication Token object. * @param {string} signature - Proof's signature. * @param {RequestHash} requestHash - RequestHash object. */ constructor(entropy: BigInt, sessionBlockHeight: BigInt, servicerPubKey: string, blockchain: string, token: PocketAAT, signature: string, requestHash: RequestHash); /** * * Creates a JSON object with the Proof properties * @returns {JSON} - JSON Object. * @memberof Proof */ toJSON(): { entropy: number; session_block_height: number; servicer_pub_key: string; blockchain: string; aat: { version: string; app_pub_key: string; client_pub_key: string; signature: string; }; signature: string; request_hash: string; }; /** * * Check if the Proof object is valid * @returns {boolean} - True or false. * @memberof Proof */ isValid(): boolean; }