UNPKG

@pokt-network/pocket-js

Version:

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

41 lines (40 loc) 2.2 kB
/// <reference types="node" /> import { IRPCProvider } from "../providers"; import { RawTxResponse, RpcError, RelayRequest, RelayResponse, DispatchRequest, DispatchResponse } from ".."; export declare class ClientNamespace { readonly rpcProvider: IRPCProvider; /** * @description Client namespace class * @param {IRPCProvider} rpcProvider - RPC Provider interface object. */ constructor(rpcProvider: IRPCProvider); /** * Method to call the v1/client/rawtx endpoint of a given node * @param {Buffer | string} fromAddress - The address of the sender * @param {Buffer | string} tx - The amino encoded transaction bytes * @param {number} timeout - Request timeout. * @param {boolean} rejectSelfSignedCertificates - force certificates to come from CAs * @returns {Promise<RawTxResponse | RpcError>} - A Raw transaction Response object or Rpc error. * @memberof ClientNamespace */ rawtx(fromAddress: Buffer | string, tx: Buffer | string, timeout?: number, rejectSelfSignedCertificates?: boolean): Promise<RawTxResponse | RpcError>; /** * * Sends a relay * @param {RelayRequest} request - Payload object containing the needed parameters. * @param {number} timeout - Request timeout. * @param {boolean} rejectSelfSignedCertificates - force certificates to come from CAs * @returns {Promise<RelayResponse | RpcError>} - A Relay Response object or Rpc error * @memberof ClientNamespace */ relay(request: RelayRequest, validateResponse: boolean, timeout?: number, rejectSelfSignedCertificates?: boolean): Promise<RelayResponse | RpcError>; /** * Sends a dispatch request * @param {DispatchRequest} request - Request object containing the needed parameters. * @param {number} timeout - Request timeout. * @param {boolean} rejectSelfSignedCertificates - force certificates to come from CAs * @returns {Promise<DispatchResponse | RpcError>} - A Dispatch Response object or Rpc error * @memberof ClientNamespace */ dispatch(request: DispatchRequest, timeout?: number, rejectSelfSignedCertificates?: boolean): Promise<DispatchResponse | RpcError>; }