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

39 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,
2023-03-23 16:48:48 +00:00
} from "@lumeweb/interface-relay";
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;
2023-03-18 16:11:41 +00:00
constructor({
network,
query,
options,
}: {
network: RpcNetwork;
query: ClientRPCRequest | RPCRequest;
options: RpcQueryOptions;
});
2022-08-28 06:33:49 +00:00
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