rpc-client/dist/query/index.js

31 lines
884 B
JavaScript
Raw Normal View History

2022-12-04 11:37:24 +00:00
import SimpleRpcQuery from "./simple.js";
import ClearCacheRpcQuery from "./clearCache.js";
import RpcNetwork from "../network.js";
import RpcQueryBase from "./base.js";
export default class RpcNetworkQueryFactory {
_network;
constructor(network) {
this._network = network;
}
simple({ relay, query, options = {}, }) {
2023-03-18 16:11:41 +00:00
return new SimpleRpcQuery({
network: this._network,
relay,
query: {
...query,
bypassCache: query?.bypassCache || this._network.bypassCache,
},
options,
}).run();
2022-12-04 11:37:24 +00:00
}
clearCache({ relays, query, options = {}, }) {
2023-03-18 16:11:41 +00:00
return new ClearCacheRpcQuery({
network: this._network,
query,
relays,
options,
}).run();
2022-12-04 11:37:24 +00:00
}
}
2023-03-18 16:11:41 +00:00
export { RpcNetwork, RpcQueryBase, SimpleRpcQuery };