@leofcoin/contracts 0.1.19 → 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
@@ -450,6 +450,227 @@
450
450
  "development": 6,
451
451
  "total": 8
452
452
  }
453
+ },
454
+ {
455
+ "version": "0.1.19",
456
+ "timestamp": "2026-05-22T17:02:36.312Z",
457
+ "size": {
458
+ "bytes": 30783,
459
+ "formatted": "30.06 KB"
460
+ },
461
+ "nodeModules": {
462
+ "bytes": 0,
463
+ "formatted": "0 Bytes"
464
+ },
465
+ "dependencies": {
466
+ "production": 2,
467
+ "development": 6,
468
+ "total": 8
469
+ }
470
+ },
471
+ {
472
+ "version": "0.1.19",
473
+ "timestamp": "2026-05-22T17:02:43.825Z",
474
+ "size": {
475
+ "bytes": 30783,
476
+ "formatted": "30.06 KB"
477
+ },
478
+ "nodeModules": {
479
+ "bytes": 0,
480
+ "formatted": "0 Bytes"
481
+ },
482
+ "dependencies": {
483
+ "production": 2,
484
+ "development": 6,
485
+ "total": 8
486
+ }
487
+ },
488
+ {
489
+ "version": "0.1.19",
490
+ "timestamp": "2026-05-23T14:46:05.393Z",
491
+ "size": {
492
+ "bytes": 30783,
493
+ "formatted": "30.06 KB"
494
+ },
495
+ "nodeModules": {
496
+ "bytes": 0,
497
+ "formatted": "0 Bytes"
498
+ },
499
+ "dependencies": {
500
+ "production": 2,
501
+ "development": 6,
502
+ "total": 8
503
+ }
504
+ },
505
+ {
506
+ "version": "0.1.19",
507
+ "timestamp": "2026-05-23T15:16:45.728Z",
508
+ "size": {
509
+ "bytes": 30783,
510
+ "formatted": "30.06 KB"
511
+ },
512
+ "nodeModules": {
513
+ "bytes": 0,
514
+ "formatted": "0 Bytes"
515
+ },
516
+ "dependencies": {
517
+ "production": 2,
518
+ "development": 6,
519
+ "total": 8
520
+ }
521
+ },
522
+ {
523
+ "version": "0.1.19",
524
+ "timestamp": "2026-05-30T20:24:41.941Z",
525
+ "size": {
526
+ "bytes": 30783,
527
+ "formatted": "30.06 KB"
528
+ },
529
+ "nodeModules": {
530
+ "bytes": 0,
531
+ "formatted": "0 Bytes"
532
+ },
533
+ "dependencies": {
534
+ "production": 2,
535
+ "development": 6,
536
+ "total": 8
537
+ }
538
+ },
539
+ {
540
+ "version": "0.1.19",
541
+ "timestamp": "2026-05-30T20:24:49.475Z",
542
+ "size": {
543
+ "bytes": 30783,
544
+ "formatted": "30.06 KB"
545
+ },
546
+ "nodeModules": {
547
+ "bytes": 0,
548
+ "formatted": "0 Bytes"
549
+ },
550
+ "dependencies": {
551
+ "production": 2,
552
+ "development": 6,
553
+ "total": 8
554
+ }
555
+ },
556
+ {
557
+ "version": "0.1.19",
558
+ "timestamp": "2026-05-31T20:45:59.389Z",
559
+ "size": {
560
+ "bytes": 30783,
561
+ "formatted": "30.06 KB"
562
+ },
563
+ "nodeModules": {
564
+ "bytes": 0,
565
+ "formatted": "0 Bytes"
566
+ },
567
+ "dependencies": {
568
+ "production": 2,
569
+ "development": 6,
570
+ "total": 8
571
+ }
572
+ },
573
+ {
574
+ "version": "0.1.19",
575
+ "timestamp": "2026-06-06T17:38:05.629Z",
576
+ "size": {
577
+ "bytes": 30783,
578
+ "formatted": "30.06 KB"
579
+ },
580
+ "nodeModules": {
581
+ "bytes": 0,
582
+ "formatted": "0 Bytes"
583
+ },
584
+ "dependencies": {
585
+ "production": 2,
586
+ "development": 6,
587
+ "total": 8
588
+ }
589
+ },
590
+ {
591
+ "version": "0.1.19",
592
+ "timestamp": "2026-06-06T17:39:13.711Z",
593
+ "size": {
594
+ "bytes": 30783,
595
+ "formatted": "30.06 KB"
596
+ },
597
+ "nodeModules": {
598
+ "bytes": 0,
599
+ "formatted": "0 Bytes"
600
+ },
601
+ "dependencies": {
602
+ "production": 2,
603
+ "development": 6,
604
+ "total": 8
605
+ }
606
+ },
607
+ {
608
+ "version": "0.1.19",
609
+ "timestamp": "2026-06-06T17:39:29.845Z",
610
+ "size": {
611
+ "bytes": 30783,
612
+ "formatted": "30.06 KB"
613
+ },
614
+ "nodeModules": {
615
+ "bytes": 0,
616
+ "formatted": "0 Bytes"
617
+ },
618
+ "dependencies": {
619
+ "production": 2,
620
+ "development": 6,
621
+ "total": 8
622
+ }
623
+ },
624
+ {
625
+ "version": "0.1.19",
626
+ "timestamp": "2026-07-18T21:17:52.098Z",
627
+ "size": {
628
+ "bytes": 30783,
629
+ "formatted": "30.06 KB"
630
+ },
631
+ "nodeModules": {
632
+ "bytes": 0,
633
+ "formatted": "0 Bytes"
634
+ },
635
+ "dependencies": {
636
+ "production": 2,
637
+ "development": 6,
638
+ "total": 8
639
+ }
640
+ },
641
+ {
642
+ "version": "0.1.20",
643
+ "timestamp": "2026-07-29T12:56:22.518Z",
644
+ "size": {
645
+ "bytes": 30783,
646
+ "formatted": "30.06 KB"
647
+ },
648
+ "nodeModules": {
649
+ "bytes": 0,
650
+ "formatted": "0 Bytes"
651
+ },
652
+ "dependencies": {
653
+ "production": 2,
654
+ "development": 6,
655
+ "total": 8
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
+ }
453
674
  }
454
675
  ]
455
676
  }
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@leofcoin/contracts",
3
- "version": "0.1.19",
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": "",
@@ -32,7 +32,7 @@
32
32
  "lucky-numbers": "^1.2.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@leofcoin/types": "^1.0.22",
35
+ "@leofcoin/types": "^1.0.26",
36
36
  "@rollup/plugin-node-resolve": "^16.0.3",
37
37
  "@rollup/plugin-terser": "^0.4.4",
38
38
  "@rollup/plugin-typescript": "^12.3.0",
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/**/*"]