2023-07-23 17:43:25 +00:00
|
|
|
import { factory, NetworkClient } from "@lumeweb/libkernel/module";
|
2023-02-19 19:42:15 +00:00
|
|
|
|
2023-07-23 17:43:25 +00:00
|
|
|
export const MODULE =
|
2023-09-03 01:03:24 +00:00
|
|
|
"z3o47XoNFTX76CAM8NHDHf6G41jdpMvY9Nt5SK9ZUfvGhBcjwuyeqdzpjjgb";
|
2023-02-19 19:42:15 +00:00
|
|
|
|
|
|
|
export interface Response {
|
|
|
|
id?: number;
|
|
|
|
error?: string;
|
|
|
|
result: any;
|
|
|
|
}
|
|
|
|
|
2023-07-23 17:42:43 +00:00
|
|
|
export class HandshakeClient extends NetworkClient {
|
2023-02-19 19:42:15 +00:00
|
|
|
public async query(method: string, params: any): Promise<Response> {
|
|
|
|
return this.callModuleReturn("query", { method, params });
|
|
|
|
}
|
2023-08-02 22:02:05 +00:00
|
|
|
public async dnsQuery(fqdn: string, type: string): Promise<Response> {
|
|
|
|
return this.callModuleReturn("dnsQuery", { fqdn, type });
|
2023-08-02 21:37:14 +00:00
|
|
|
}
|
2023-02-19 19:42:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE);
|