diff --git a/apps/hermes/client/js/src/examples/HermesClient.ts b/apps/hermes/client/js/src/examples/HermesClient.ts index 75974a922b..c1f3959ec8 100644 --- a/apps/hermes/client/js/src/examples/HermesClient.ts +++ b/apps/hermes/client/js/src/examples/HermesClient.ts @@ -1,7 +1,7 @@ import yargs from "yargs"; import { hideBin } from "yargs/helpers"; -import { HermesClient } from "../HermesClient"; +import { HermesClient, PriceUpdate } from "../HermesClient"; function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)); @@ -79,11 +79,12 @@ async function run() { benchmarksOnly: true, }); - eventSource.onmessage = (event) => { + eventSource.onmessage = (event: MessageEvent) => { console.log("Received price update:", event.data); + const _priceUpdate = JSON.parse(event.data) as PriceUpdate; }; - eventSource.onerror = (error) => { + eventSource.onerror = (error: Event) => { console.error("Error receiving updates:", error); eventSource.close(); };