mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Co-authored-by: Tyler Longwell <tlongwell@squareup.com>
22 lines
610 B
TypeScript
22 lines
610 B
TypeScript
import type { RelayEvent } from "@/shared/api/types";
|
|
import { invokeTauri } from "./tauri";
|
|
|
|
export async function decryptObserverEvent(
|
|
event: RelayEvent,
|
|
): Promise<unknown> {
|
|
return invokeTauri<unknown>("decrypt_observer_event", {
|
|
eventJson: JSON.stringify(event),
|
|
});
|
|
}
|
|
|
|
export async function buildObserverControlEvent(input: {
|
|
agentPubkey: string;
|
|
payload: unknown;
|
|
}): Promise<RelayEvent> {
|
|
const eventJson = await invokeTauri<string>("build_observer_control_event", {
|
|
agentPubkey: input.agentPubkey,
|
|
payload: input.payload,
|
|
});
|
|
return JSON.parse(eventJson) as RelayEvent;
|
|
}
|