UNPKG

@pokt-network/pocket-js

Version:

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

34 lines (33 loc) 1.34 kB
import { IRPCProvider } from "./i-rpc-provider"; import { RpcError } from "../errors"; import { Pocket, PocketAAT } from "../../pocket"; /** * @author Pabel Nunez L. <pabel@pokt.network> * @description The PocketRpcProvider class implements the IRCProvider interface. */ export declare class PocketRpcProvider implements IRPCProvider { readonly pocket: Pocket; readonly aat: PocketAAT; readonly blockchain: string; readonly enableConsensusRelay: boolean; /** * Utility function to send requests. * @param {Pocket} pocket - Pocket Instance. * @param {PocketAAT} aat - Pocket AAT. * @param {string} blockchain - Blockchain Id. * @param {boolean} enableConsensusRelay - (Optional) True or false if the provider should so consensus relays or standard relays. */ constructor(pocket: Pocket, aat: PocketAAT, blockchain: string, enableConsensusRelay?: boolean); /** * Utility function to send a request to the pocket blockchain. * @param {string} path - Request path * @param {string} payload - Request payload to send. * @returns {string | RpcError} Response string or RpcError * @memberof PocketRpcProvider */ send(path: string, payload: string): Promise<string | RpcError>; /** * @memberof PocketRpcProvider */ private handleReponse; }