rpc-client/dist/query/base.d.ts

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2022-08-28 06:33:49 +00:00
/// <reference types="node" />
import RpcNetwork from "../network.js";
import { RpcQueryOptions } from "../types.js";
2022-12-04 07:42:04 +00:00
import type {
ClientRPCRequest,
RPCRequest,
RPCResponse,
} from "@lumeweb/relay-types";
2022-08-28 06:33:49 +00:00
export default abstract class RpcQueryBase {
protected _network: RpcNetwork;
protected _query: RPCRequest;
protected _options: RpcQueryOptions;
protected _promise?: Promise<any>;
protected _timeoutTimer?: any;
protected _timeout: boolean;
protected _completed: boolean;
2022-12-04 07:42:04 +00:00
protected _response?: RPCResponse;
protected _error?: string;
2022-08-28 06:33:49 +00:00
protected _promiseResolve?: (data: any) => void;
constructor(
network: RpcNetwork,
2022-12-04 07:42:04 +00:00
query: ClientRPCRequest | RPCRequest,
2022-08-28 06:33:49 +00:00
options?: RpcQueryOptions
);
get result(): Promise<RPCResponse>;
2022-12-04 07:42:04 +00:00
protected handeTimeout(): void;
2022-08-28 06:33:49 +00:00
protected resolve(data?: RPCResponse, timeout?: boolean): void;
run(): this;
2022-12-04 07:42:04 +00:00
private _doRun;
protected setupRelayTimeout(reject: Function): NodeJS.Timeout;
protected abstract _run(): void;
protected queryRpc(rpc: any, request: RPCRequest): Promise<unknown>;
2022-08-28 06:33:49 +00:00
}
//# sourceMappingURL=base.d.ts.map