import { RpcSchema } from "ox"; import * as Requests from "./request.js"; import { z } from "../zod.js"; type RpcWire = z.input; export const WalletServerRpcSchema = RpcSchema.from< | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire | RpcWire >(); export type WalletServerRpcSchemaType = typeof WalletServerRpcSchema; type MethodToViemRpcSchema = { [K in WalletServerRpcSchemaType["Request"]["method"]]: { Method: K; Parameters: Extract< WalletServerRpcSchemaType["Request"], { method: K } >["params"]; ReturnType: Extract< WalletServerRpcSchemaType, { Request: { method: K } } >["ReturnType"]; }; }; // TODO: figure out how we can do this without manually listing all the methods export type WalletServerViemRpcSchema = [ MethodToViemRpcSchema["wallet_prepareCalls"], MethodToViemRpcSchema["wallet_sendPreparedCalls"], MethodToViemRpcSchema["wallet_requestAccount"], MethodToViemRpcSchema["wallet_listAccounts"], MethodToViemRpcSchema["wallet_createSession"], MethodToViemRpcSchema["wallet_getCallsStatus"], MethodToViemRpcSchema["wallet_getCrossChainStatus_v0"], MethodToViemRpcSchema["wallet_prepareSign"], MethodToViemRpcSchema["wallet_formatSign"], MethodToViemRpcSchema["wallet_requestQuote_v0"], MethodToViemRpcSchema["wallet_getCapabilities"], ];