@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
32 lines (31 loc) • 1.23 kB
TypeScript
import { IRPCProvider } from "./i-rpc-provider";
import { RpcError } from "../errors";
/**
* @author Luis C. de León <luis@pokt.network>
* @description The HttpRpcProvider class implements the IRCProvider interface.
*/
export declare class HttpRpcProvider implements IRPCProvider {
readonly baseURL: URL;
/**
* Utility function to send requests.
* @param {URL} baseURL - Base URL.
*/
constructor(baseURL: URL);
/**
* Utility function to send a request.
* @param {string} path - Request path
* @param {string} payload - Request payload to send.
* @param {number} timeout - Request timeout.
* @param {boolean} rejectSelfSignedCertificates - force certificates to come from CAs
* @returns {string | RpcError} Response string or RpcError
* @memberof HttpRpcProvider
*/
send(path: string, payload: string, timeout?: number, rejectSelfSignedCertificates?: boolean): Promise<string | RpcError>;
/**
* Utility function to handle any response error.
* @param {any} response - Http request response object.
* @returns {RpcError} - RpcError object.
* @memberof HttpRpcProvider
*/
handleResponseError(response: any): RpcError;
}