The createAleoWorker
method creates a new Web Worker instance for handling Aleo computations. This is useful for offloading heavy cryptographic operations to a separate thread to avoid blocking the main thread.
options
(CreateAleoWorkerOptions): An object containing:url
(string): URL of the worker script filebaseUrl
(string, optional): Base URL to resolve the worker script URL against
Returns a wrapped Worker instance configured for Aleo operations using Comlink.
import { createAleoWorker } from "zpass-sdk";
const AleoWorker = () => {
return createAleoWorker({url: "worker.js", baseUrl: import.meta.url});
};
export { AleoWorker };