nano-pow 5.0.3 → 5.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.js CHANGED
@@ -73,7 +73,7 @@ Object.defineProperty(wasm, "isSupported", {
73
73
  const instance = await WebAssembly.instantiate(module);
74
74
  isWasmSupported = instance instanceof WebAssembly.Instance;
75
75
  } catch (err) {
76
- console.warn("WASM is not supported in this environment.\n", err);
76
+ console.warn("WASM is not supported in this environment.\n", err.message ?? err);
77
77
  isWasmSupported = false;
78
78
  } finally {
79
79
  delete this.isSupported;
@@ -76,7 +76,7 @@ Object.defineProperty(wasm, "isSupported", {
76
76
  const instance = await WebAssembly.instantiate(module);
77
77
  isWasmSupported = instance instanceof WebAssembly.Instance;
78
78
  } catch (err) {
79
- console.warn("WASM is not supported in this environment.\n", err);
79
+ console.warn("WASM is not supported in this environment.\n", err.message ?? err);
80
80
  isWasmSupported = false;
81
81
  } finally {
82
82
  delete this.isSupported;
@@ -260,7 +260,7 @@ var enc = `sha256-${hash("sha256", src, "base64")}`;
260
260
  var body = `
261
261
  <!DOCTYPE html>
262
262
  <link rel="icon" href="data:,">
263
- <meta http-equiv="Content-Security-Policy" content="default-src 'none'; base-uri 'none'; form-action 'none'; script-src '${enc}';">
263
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; base-uri 'none'; form-action 'none'; script-src '${enc}' 'wasm-unsafe-eval'; worker-src blob: https://nanopow.invalid;">
264
264
  <script type="module">${src}</script>
265
265
  `;
266
266
  LOG: logger.log("setting puppeteer request interception");
package/dist/main.min.js CHANGED
@@ -82,7 +82,7 @@ Object.defineProperty(wasm, "isSupported", {
82
82
  const instance = await WebAssembly.instantiate(module);
83
83
  isWasmSupported = instance instanceof WebAssembly.Instance;
84
84
  } catch (err) {
85
- console.warn("WASM is not supported in this environment.\n", err);
85
+ console.warn("WASM is not supported in this environment.\n", err.message ?? err);
86
86
  isWasmSupported = false;
87
87
  } finally {
88
88
  delete this.isSupported;
@@ -549,6 +549,7 @@ var worker = async (compute) => {
549
549
  }
550
550
  } finally {
551
551
  postMessage(result2);
552
+ addEventListener("message", handleMessage);
552
553
  }
553
554
  }
554
555
  addEventListener("message", handleMessage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nano-pow",
3
- "version": "5.0.3",
3
+ "version": "5.0.5",
4
4
  "description": "Proof-of-work generation and validation with WebGPU/WebGL/WASM for Nano cryptocurrency.",
5
5
  "keywords": [
6
6
  "nemo",