@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
56 lines (55 loc) • 1.61 kB
TypeScript
import { Session } from "./../models";
/**
* @class RpcError
*/
export declare class RpcError extends Error {
/**
* Creates a RpcError from an Error object
* @param {Error} error - Error object.
* @returns {RpcError} - RpcError object.
* @memberof RpcError
*/
static fromError(error: Error): RpcError;
/**
* Creates a RpcError from an Error object
* @param {string} code - Error code
* @param {string} data - Relay error data.
* @returns {RpcError} - RpcError object.
* @memberof RpcError
*/
static fromRelayError(code: string, data: string): RpcError;
/**
*
* Creates a RpcError object using a JSON string
* @param {string} json - JSON string.
* @returns {RpcError} - RpcError object.
* @memberof RpcError
*/
static fromJSON(json: string): RpcError;
readonly code: string;
readonly message: string;
readonly session?: Session;
readonly nodePubKey?: string;
/**
* RPC Error.
* @constructor
* @param {string} code - Error code.
* @param {string} message - Error message.
* @param {Session} session - Error message.
* @param {string} nodePubKey - Error message.
* @memberof RpcError
*/
constructor(code: string, message: string, session?: Session, nodePubKey?: string);
/**
*
* Creates a JSON object with the RpcError properties
* @returns {JSON} - JSON Object.
* @memberof RpcError
*/
toJSON(): {
code: string;
message: string;
session: {};
node_public_key: string;
};
}