kernel-handshake-client/src/index.ts

22 lines
564 B
TypeScript
Raw Normal View History

2023-02-19 19:42:15 +00:00
import { Client, factory } from "@lumeweb/libkernel-universal";
2023-04-17 02:49:00 +00:00
const MODULE = "AABCDWpcbyCkTWy5ZP6qZWZ5eiFe--CRJSMKxRYLE4usfQ";
2023-02-19 19:42:15 +00:00
export interface Response {
id?: number;
error?: string;
result: any;
}
export class HandshakeClient extends Client {
public async ready(): Promise<void> {
return this.callModuleReturn("ready");
}
public async query(method: string, params: any): Promise<Response> {
return this.callModuleReturn("query", { method, params });
}
}
export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE);