kernel-handshake-client/src/index.ts

19 lines
508 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-07-29 18:24:41 +00:00
"zduKgJ3grSZvc4AnnCfiJUSLmizKzPByJ5ZeRU3pvo2LRf1DsVjQDdbFvw";
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 });
}
}
export const createClient = factory<HandshakeClient>(HandshakeClient, MODULE);