From 05948b1f1408a80ff66d127f735c8ad4264a311f Mon Sep 17 00:00:00 2001 From: ymekuria Date: Thu, 19 Sep 2024 12:39:25 -0700 Subject: [PATCH] feat(zkappWorkerClient.ts): add remoteApi property to interact with worker's methods as if they were local --- .../ui/src/pages/zkappWorkerClient.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts index 6699986cc..6f3c9fc45 100644 --- a/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts +++ b/examples/zkapps/04-zkapp-browser-ui/ui/src/pages/zkappWorkerClient.ts @@ -1,15 +1,18 @@ import { Field, PublicKey, fetchAccount } from 'o1js'; import * as Comlink from "comlink"; -import type { - WorkerFunctions, - ZkappWorkerReponse, - ZkappWorkerRequest, -} from './zkappWorker'; +// import type { +// WorkerFunctions, +// ZkappWorkerReponse, +// ZkappWorkerRequest, +// } from './zkappWorker'; export default class ZkappWorkerClient { // --------------------------------------------------------------------------------------- + // Proxy to interact with the worker's methods as if they were local + remoteApi: Comlink.Remote; + setActiveInstanceToDevnet() { return this._call('setActiveInstanceToDevnet', {}); }