/** * @packageDocumentation * @module harmony-network * @ignore */ import { RPCMethod, RPCErrorCode } from './rpcMethod/rpc'; export type ReqMiddleware = Map; export type ResMiddleware = Map; export enum MiddlewareType { REQ, RES, } export enum SubscribeReturns { all = 'all', id = 'id', method = 'method', } export interface Middleware { request: object; response: object; } export interface RPCRequestPayload { id: number; jsonrpc: string; method: RPCMethod | string; params: T; } export interface RPCRequestOptions { headers: []; method: string; } export interface RPCRequest { url: string; payload: RPCRequestPayload; options: RPCRequestOptions; } export interface RPCResponseBase { jsonrpc: string; id: string; } export interface RPCResponseBody extends RPCResponseBase { result: R; error: E; } export interface RPCError { code: RPCErrorCode; message: string; data: any; } export interface RPCResult { resultString: string; resultMap: Map; resultList: any[]; raw: any; } export interface ShardingItem { current: boolean; shardID: number | string; http: string; ws: string; }