2023-07-05 17:08:38 +00:00
|
|
|
import { Client, factory } from "@lumeweb/libkernel/module";
|
2023-02-19 19:42:15 +00:00
|
|
|
|
2023-07-21 17:39:37 +00:00
|
|
|
export const MODULE = "zduGT37j8ctXVUvYgDD1BwAtTz5eUwbx6J9GvodAkKRHAsbU3ztqDcdTGb";
|
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 });
|
|
|
|
}
|
2023-07-19 16:29:30 +00:00
|
|
|
|
|
|
|
public async register(){
|
|
|
|
return this.callModuleReturn("register");
|
|
|
|
}
|
2023-02-19 19:42:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE);
|