@leofcoin/contracts 0.1.20 → 0.1.21

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/.size-log.json CHANGED
@@ -654,6 +654,23 @@
654
654
  "development": 6,
655
655
  "total": 8
656
656
  }
657
+ },
658
+ {
659
+ "version": "0.1.20",
660
+ "timestamp": "2026-07-29T13:42:42.696Z",
661
+ "size": {
662
+ "bytes": 30783,
663
+ "formatted": "30.06 KB"
664
+ },
665
+ "nodeModules": {
666
+ "bytes": 0,
667
+ "formatted": "0 Bytes"
668
+ },
669
+ "dependencies": {
670
+ "production": 2,
671
+ "development": 6,
672
+ "total": 8
673
+ }
657
674
  }
658
675
  ]
659
676
  }
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@leofcoin/contracts",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "./factory": "./exports/factory.js",
8
- "./name-token": "./exports/name-token.js",
8
+ "./name-service": "./exports/name-service.js",
9
+ "./name-token": "./exports/name-service.js",
9
10
  "./power-token": "./exports/power-token.js",
10
11
  "./native-token": "./exports/native-token.js",
11
12
  "./validators": "./exports/validators.js"
12
13
  },
13
14
  "scripts": {
14
15
  "build": "rollup -c",
15
- "postbuild": "node scripts/track-size.js",
16
16
  "test": "node --test test/**/*.js",
17
17
  "size": "node scripts/track-size.js"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/leofcoin/contracts.git"
21
+ "url": "https://github.com/leofcoin/monorepo"
22
22
  },
23
23
  "keywords": [],
24
24
  "author": "",
package/src/validators.ts CHANGED
@@ -159,7 +159,9 @@ export default class Validators extends Roles {
159
159
  // only return 128 best participating max
160
160
  .splice(0, _peers.length > 128 ? 128 : _peers.length)
161
161
 
162
- const luckyNumber = lottery(1, peers.length - 1)
162
+ if (peers.length === 0) return
163
+
164
+ const luckyNumber = peers.length === 1 ? [0] : lottery(1, peers.length - 1)
163
165
 
164
166
  let nextValidator = peers[luckyNumber[0]][0]
165
167
  // redraw when the validator is the same
package/tsconfig.json CHANGED
@@ -8,6 +8,7 @@
8
8
  "resolveJsonModule": true,
9
9
  "declaration": true,
10
10
  "outDir": "exports",
11
+ "rootDir": "./src",
11
12
  "types": ["@leofcoin/types", "@leofcoin/types/global"]
12
13
  },
13
14
  "include": ["./src/**/*"]