Template
1
0

feat: convert to rpc pattern

This commit is contained in:
2025-04-21 00:18:46 +00:00
parent e5f2be1995
commit 3b9a5cb456
15 changed files with 489 additions and 806 deletions

View File

@@ -1,12 +1,20 @@
import type { RouteMethod } from "./route.ts";
export type RelayAdapter = {
fetch(input: RequestInput): Promise<unknown>;
send(input: RelayRequestInput): Promise<RelayResponse>;
};
export type RequestInput = {
method: RouteMethod;
url: string;
search: string;
body?: string;
export type RelayRequestInput = {
method: string;
params: any;
};
export type RelayResponse =
| {
result: unknown;
id: string;
}
| {
error: {
message: string;
};
id: string;
};