kernel-handshake-client/src/index.ts

22 lines
649 B
TypeScript
Raw Normal View History

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;
}
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);