restake 1.0.0

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/index.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const cafe_utility_1 = require("cafe-utility");
5
+ const process_1 = require("process");
6
+ const n = cafe_utility_1.Arrays.requireNumberArgument(process_1.argv, 'n');
7
+ const bzz = cafe_utility_1.FixedPointNumber.fromFloat(cafe_utility_1.Arrays.requireNumberArgument(process_1.argv, 'bzz'), 16);
8
+ const sleep = cafe_utility_1.Dates.make(cafe_utility_1.Arrays.requireStringArgument(process_1.argv, 'sleep'));
9
+ cafe_utility_1.System.forever(async () => {
10
+ const port = 1633 + cafe_utility_1.Random.intBetween(0, n - 1);
11
+ await fetch(`http://localhost:${port}/stake/${bzz.toString()}`, { method: 'POST' });
12
+ }, sleep, console.error);
13
+ process.on('unhandledRejection', console.error);
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "restake",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "bin": {
6
+ "restake": "./dist/index.js"
7
+ },
8
+ "main": "dist/index.js",
9
+ "scripts": {
10
+ "build": "tsc"
11
+ },
12
+ "keywords": [],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "type": "commonjs",
16
+ "dependencies": {
17
+ "cafe-utility": "^33.8.0"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^25.5.2"
21
+ }
22
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Node 16",
4
+
5
+ "compilerOptions": {
6
+ "outDir": "dist",
7
+ "lib": ["ES2022"],
8
+ "module": "CommonJS",
9
+ "target": "ES2022",
10
+ "declaration": false,
11
+ "strict": true,
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "moduleResolution": "node",
15
+ "esModuleInterop": true,
16
+ "noImplicitAny": true,
17
+ "strictNullChecks": true
18
+ },
19
+ "exclude": ["test"]
20
+ }