import { IPC_EVENTS } from './constants'; import { invokeIpc, onIpc } from './host-api'; import type { GatewayEvent } from '../types/runtime'; export async function gatewayRpc(method: string, params?: unknown): Promise { return invokeIpc(IPC_EVENTS.GATEWAY_RPC, method, params); } export function onGatewayEvent(callback: (event: GatewayEvent) => void): () => void { return onIpc(IPC_EVENTS.GATEWAY_EVENT, callback as (...args: any[]) => void); }