UNPKG

postchain-client

Version:

Client library for accessing a Postchain node through REST.

23 lines (22 loc) 1.32 kB
/// <reference types="node" /> import { PostRequestObjects, ResponseObject, FailOverConfig, HandleRequestInputProps } from "./types"; import { Endpoint } from "../blockchainClient/types"; import { Method } from "./enums"; import { NodeManager } from "./nodeManager"; interface BlockchainRidFromIidPops { endpointPool: Endpoint[]; chainId: number; nodeManager: NodeManager; failOverConfig?: FailOverConfig; } export declare function getBlockchainRidFromIid({ endpointPool, chainId, failOverConfig, nodeManager, }: BlockchainRidFromIidPops): Promise<string>; export declare function requestWithFailoverStrategy(method: Method, path: string, config: HandleRequestInputProps["config"], postObject?: PostRequestObjects | Buffer): Promise<ResponseObject>; export declare function nextEndpoint(endpointPool: Endpoint[]): Endpoint; export declare const shuffle: <T>(array: T[]) => T[]; export declare const sleep: (ms: number) => Promise<unknown>; export declare function convertToPrintable(responseObject: any): any; export declare function filterReachableEndpoint(endpointPool: Endpoint[]): Endpoint[]; export declare function isReachable(endpoint: Endpoint): boolean; export declare const bftMajority: (n: number) => any; export declare const setEndpointAsReachable: (endpointPool: Endpoint[]) => void; export {};