*Make relay optional.
*Have RpcNetwork.simpleQuery take an options bag
This commit is contained in:
parent
1d61ec5e55
commit
0a6d56572b
21
src/index.ts
21
src/index.ts
|
@ -37,12 +37,17 @@ export class RpcNetwork extends Client {
|
||||||
network: this._networkId,
|
network: this._networkId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public simpleQuery(
|
public simpleQuery({
|
||||||
relay: Buffer | string,
|
relay,
|
||||||
query: ClientRPCRequest,
|
query,
|
||||||
data: object | any[] = {},
|
data = {},
|
||||||
options: RpcQueryOptions = {}
|
options = {},
|
||||||
): SimpleRpcQuery {
|
}: {
|
||||||
|
relay?: Buffer | string;
|
||||||
|
query: ClientRPCRequest;
|
||||||
|
data: object | any[];
|
||||||
|
options: RpcQueryOptions;
|
||||||
|
}): SimpleRpcQuery {
|
||||||
return new SimpleRpcQuery({
|
return new SimpleRpcQuery({
|
||||||
network: this,
|
network: this,
|
||||||
relay,
|
relay,
|
||||||
|
@ -94,7 +99,7 @@ export abstract class RpcQueryBase extends Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SimpleRpcQuery extends RpcQueryBase {
|
export class SimpleRpcQuery extends RpcQueryBase {
|
||||||
protected _relay: string | Buffer;
|
protected _relay?: string | Buffer;
|
||||||
constructor({
|
constructor({
|
||||||
network,
|
network,
|
||||||
relay,
|
relay,
|
||||||
|
@ -102,7 +107,7 @@ export class SimpleRpcQuery extends RpcQueryBase {
|
||||||
options,
|
options,
|
||||||
}: {
|
}: {
|
||||||
network: RpcNetwork;
|
network: RpcNetwork;
|
||||||
relay: string | Buffer;
|
relay?: string | Buffer;
|
||||||
query: RPCRequest;
|
query: RPCRequest;
|
||||||
options: RpcQueryOptions;
|
options: RpcQueryOptions;
|
||||||
}) {
|
}) {
|
||||||
|
|
Loading…
Reference in New Issue