nano-pow 5.1.6 → 5.1.8
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/main.min.js +6 -3
- package/package.json +9 -8
package/dist/main.min.js
CHANGED
|
@@ -1387,8 +1387,11 @@ async function generate4(hash, difficulty, effort, debug) {
|
|
|
1387
1387
|
// src/lib/config/index.ts
|
|
1388
1388
|
//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>
|
|
1389
1389
|
//! SPDX-License-Identifier: GPL-3.0-or-later
|
|
1390
|
-
var NanoPowConfigConstructor = class
|
|
1390
|
+
var NanoPowConfigConstructor = class {
|
|
1391
1391
|
static #isInternal = false;
|
|
1392
|
+
static get isInternal() {
|
|
1393
|
+
return this.#isInternal;
|
|
1394
|
+
}
|
|
1392
1395
|
api;
|
|
1393
1396
|
debug;
|
|
1394
1397
|
difficulty;
|
|
@@ -1402,14 +1405,13 @@ var NanoPowConfigConstructor = class _NanoPowConfigConstructor {
|
|
|
1402
1405
|
};
|
|
1403
1406
|
}
|
|
1404
1407
|
constructor(api, debug, difficulty, effort) {
|
|
1405
|
-
if (!
|
|
1408
|
+
if (!this.constructor.isInternal) {
|
|
1406
1409
|
throw new TypeError(`NanoPowConfig cannot be constructed with 'new'.`);
|
|
1407
1410
|
}
|
|
1408
1411
|
this.api = api;
|
|
1409
1412
|
this.debug = debug;
|
|
1410
1413
|
this.difficulty = difficulty;
|
|
1411
1414
|
this.effort = effort;
|
|
1412
|
-
_NanoPowConfigConstructor.#isInternal = false;
|
|
1413
1415
|
}
|
|
1414
1416
|
static async create(options) {
|
|
1415
1417
|
const input = options;
|
|
@@ -1419,6 +1421,7 @@ var NanoPowConfigConstructor = class _NanoPowConfigConstructor {
|
|
|
1419
1421
|
const effort = this.#getValidEffort(input);
|
|
1420
1422
|
this.#isInternal = true;
|
|
1421
1423
|
const config = new this(api, debug, difficulty, effort);
|
|
1424
|
+
this.#isInternal = false;
|
|
1422
1425
|
return config;
|
|
1423
1426
|
}
|
|
1424
1427
|
// Check platform support for default API setting
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nano-pow",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.8",
|
|
4
4
|
"description": "Proof-of-work generation and validation with WebGPU/WebGL/WASM for Nano cryptocurrency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nemo",
|
|
@@ -43,8 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"benchmark": "npm run build && ./dist/bin/nano-pow.sh --benchmark 10 --debug",
|
|
46
|
-
"build": "
|
|
46
|
+
"build": "npm run clean && npm run generate && node esbuild.mjs && cp -p src/bin/nano-pow.sh dist/bin",
|
|
47
47
|
"build:dev": "NODE_ENV=development npm run build",
|
|
48
|
+
"clean": "rm -rf dist types && tsc",
|
|
48
49
|
"generate": "node ./scripts/blake2b-gen.js && asc src/lib/generate/wasm/asm/index.ts",
|
|
49
50
|
"prepare": "npm run build",
|
|
50
51
|
"score": "npm run build && ./dist/bin/nano-pow.sh --effort 4 --benchmark 10 --score 10",
|
|
@@ -52,15 +53,15 @@
|
|
|
52
53
|
"test": "npm run build:dev && ./test/script.sh"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^24.
|
|
56
|
-
"@webgpu/types": "^0.1.
|
|
57
|
-
"assemblyscript": "^0.28.
|
|
58
|
-
"esbuild": "^0.25.
|
|
56
|
+
"@types/node": "^24.7.1",
|
|
57
|
+
"@webgpu/types": "^0.1.65",
|
|
58
|
+
"assemblyscript": "^0.28.8",
|
|
59
|
+
"esbuild": "^0.25.10",
|
|
59
60
|
"esbuild-plugin-glsl": "^1.4.0",
|
|
60
|
-
"typescript": "^5.9.
|
|
61
|
+
"typescript": "^5.9.3"
|
|
61
62
|
},
|
|
62
63
|
"optionalDependencies": {
|
|
63
|
-
"puppeteer": "^24.
|
|
64
|
+
"puppeteer": "^24.24.0"
|
|
64
65
|
},
|
|
65
66
|
"type": "module",
|
|
66
67
|
"exports": {
|