UNPKG

@nori-zk/mina-token-bridge

Version:

A Mina zk-program contract allowing users to mint tokens on Nori Bridge.

31 lines 868 B
export class WorkerChild { constructor(proc = process) { this.proc = proc; this.proc.on('message', (msg) => { if (typeof msg === 'string' && this.messageCallback) { this.messageCallback(msg); } else if (this.messageCallback) { this.messageCallback(JSON.stringify(msg)); } }); this.proc.on('error', (err) => { if (this.errorCallback) this.errorCallback(err); }); this.proc.send('ready'); } send(data) { this.proc.send?.(data); } onMessageHandler(callback) { this.messageCallback = callback; } onErrorHandler(callback) { this.errorCallback = callback; } terminate() { this.proc.removeAllListeners(); } } //# sourceMappingURL=index.node.js.map