kernel-rpc-client/dist/index.d.ts

59 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-08-31 01:39:52 +00:00
/// <reference types="node" />
2022-07-20 07:36:21 +00:00
import { ErrTuple } from "libskynet";
2023-03-23 16:59:48 +00:00
import type {
RPCRequest,
RPCResponse,
ClientRPCRequest,
} from "@lumeweb/interface-relay";
import { RpcQueryOptions } from "@lumeweb/rpc-client";
2022-08-31 01:39:52 +00:00
import { Buffer } from "buffer";
2023-03-23 16:59:48 +00:00
import { Client } from "@lumeweb/libkernel-universal";
export declare class RpcNetwork extends Client {
2022-08-31 18:42:49 +00:00
private _def;
constructor(def?: boolean);
private _networkId;
get networkId(): number;
2022-08-31 01:49:59 +00:00
get ready(): Promise<ErrTuple>;
2023-03-24 17:20:57 +00:00
simpleQuery({
relay,
query,
options,
}: {
relay?: Buffer | string;
query: ClientRPCRequest;
2023-03-24 17:29:17 +00:00
options?: RpcQueryOptions;
2023-03-24 17:20:57 +00:00
}): SimpleRpcQuery;
2022-07-20 07:36:21 +00:00
}
2023-03-23 16:59:48 +00:00
export declare abstract class RpcQueryBase extends Client {
2022-08-31 01:49:59 +00:00
protected _promise?: Promise<any>;
protected _network: RpcNetwork;
protected _query: RPCRequest;
protected _options: RpcQueryOptions;
protected _queryType: string;
constructor(
network: RpcNetwork,
query: RPCRequest,
options: RpcQueryOptions | undefined,
queryType: string
);
2022-08-31 02:18:07 +00:00
get result(): Promise<RPCResponse>;
2022-08-31 18:42:49 +00:00
run(): this;
2022-07-20 07:36:21 +00:00
}
2022-08-31 01:39:52 +00:00
export declare class SimpleRpcQuery extends RpcQueryBase {
2023-03-24 17:20:57 +00:00
protected _relay?: string | Buffer;
2023-03-23 16:59:48 +00:00
constructor({
network,
relay,
query,
options,
}: {
network: RpcNetwork;
2023-03-24 17:20:57 +00:00
relay?: string | Buffer;
2023-03-23 16:59:48 +00:00
query: RPCRequest;
2023-03-24 17:29:17 +00:00
options?: RpcQueryOptions;
2023-03-23 16:59:48 +00:00
});
2022-08-31 01:49:59 +00:00
run(): this;
2022-08-31 01:39:52 +00:00
}
2023-03-23 17:03:01 +00:00
export declare const createClient: (...args: any) => RpcNetwork;
2022-08-31 01:49:59 +00:00
//# sourceMappingURL=index.d.ts.map