genlayer-js 0.18.5 → 0.18.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
 
2
2
 
3
+ ## 0.18.7 (2025-12-04)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Decodes contract error messages ([#127](https://github.com/genlayerlabs/genlayer-js/issues/127)) ([0a82545](https://github.com/genlayerlabs/genlayer-js/commit/0a82545e994144229950ad2d156c20233102a8c4))
9
+
10
+ ## 0.18.6 (2025-12-04)
11
+
12
+
13
+ ### Features
14
+
15
+ * Fetch epoch zero minimum duration ([#126](https://github.com/genlayerlabs/genlayer-js/issues/126)) ([89c2261](https://github.com/genlayerlabs/genlayer-js/commit/89c22611d6bf70e83d02f5922ba3e18d912abb2d))
16
+
3
17
  ## 0.18.5 (2025-12-03)
4
18
 
5
19
  ## 0.18.4 (2025-11-11)
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkTBF5WZHLcjs = require('../chunk-TBF5WZHL.cjs');
5
+ var _chunkI23SLL2Acjs = require('../chunk-I23SLL2A.cjs');
6
6
  require('../chunk-75ZPJI57.cjs');
7
7
 
8
8
 
9
9
 
10
10
 
11
- exports.localnet = _chunkTBF5WZHLcjs.localnet; exports.studionet = _chunkTBF5WZHLcjs.studionet; exports.testnetAsimov = _chunkTBF5WZHLcjs.testnetAsimov;
11
+ exports.localnet = _chunkI23SLL2Acjs.localnet; exports.studionet = _chunkI23SLL2Acjs.studionet; exports.testnetAsimov = _chunkI23SLL2Acjs.testnetAsimov;
@@ -2,7 +2,7 @@ import {
2
2
  localnet,
3
3
  studionet,
4
4
  testnetAsimov
5
- } from "../chunk-NZI52PRP.js";
5
+ } from "../chunk-RW6PLN5W.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
  export {
8
8
  localnet,
@@ -8042,6 +8042,13 @@ var studionet = _viem.defineChain.call(void 0, {
8042
8042
 
8043
8043
  // src/abi/staking.ts
8044
8044
  var VALIDATOR_WALLET_ABI = [
8045
+ // Custom errors
8046
+ { name: "NotOperator", type: "error", inputs: [] },
8047
+ { name: "InvalidAddress", type: "error", inputs: [] },
8048
+ { name: "TransferFailed", type: "error", inputs: [] },
8049
+ { name: "OperatorTransferNotReady", type: "error", inputs: [] },
8050
+ { name: "NoPendingOperator", type: "error", inputs: [] },
8051
+ // Functions
8045
8052
  {
8046
8053
  name: "operator",
8047
8054
  type: "function",
@@ -8105,19 +8112,51 @@ var VALIDATOR_WALLET_ABI = [
8105
8112
  }
8106
8113
  ];
8107
8114
  var STAKING_ABI = [
8108
- // Custom errors
8109
- { name: "BelowMinStake", type: "error", inputs: [] },
8110
- { name: "AlreadyValidator", type: "error", inputs: [] },
8111
- { name: "NotValidator", type: "error", inputs: [] },
8112
- { name: "NotOwner", type: "error", inputs: [] },
8113
- { name: "NotOperator", type: "error", inputs: [] },
8114
- { name: "ValidatorBanned", type: "error", inputs: [] },
8115
- { name: "ValidatorQuarantined", type: "error", inputs: [] },
8116
- { name: "InsufficientShares", type: "error", inputs: [] },
8117
- { name: "NothingToClaim", type: "error", inputs: [] },
8118
- { name: "NotYetClaimable", type: "error", inputs: [] },
8119
- { name: "ZeroAmount", type: "error", inputs: [] },
8120
- { name: "InvalidOperator", type: "error", inputs: [] },
8115
+ // Custom errors from IGenLayerStaking
8116
+ { name: "OnlyGEN", type: "error", inputs: [] },
8117
+ { name: "OnlyTribunal", type: "error", inputs: [] },
8118
+ { name: "OnlyIdleness", type: "error", inputs: [] },
8119
+ { name: "OnlyTransactions", type: "error", inputs: [] },
8120
+ { name: "OnlyIdlenessOrTribunal", type: "error", inputs: [] },
8121
+ { name: "OnlyTransactionsOrTribunal", type: "error", inputs: [] },
8122
+ { name: "InvalidAtEpoch", type: "error", inputs: [] },
8123
+ { name: "MaxValidatorsCannotBeZero", type: "error", inputs: [] },
8124
+ { name: "ValidatorExitExceedsShares", type: "error", inputs: [] },
8125
+ { name: "DelegatorExitExceedsShares", type: "error", inputs: [] },
8126
+ { name: "DelegatorMayNotJoinWithZeroValue", type: "error", inputs: [] },
8127
+ { name: "DelegatorMayNotJoinTwoValidatorsSimultaneously", type: "error", inputs: [] },
8128
+ { name: "DelegatorBelowMinimumStake", type: "error", inputs: [] },
8129
+ { name: "DelegatorExitWouldBeBelowMinimum", type: "error", inputs: [] },
8130
+ { name: "ValidatorNotActive", type: "error", inputs: [] },
8131
+ { name: "ValidatorMayNotBeDelegator", type: "error", inputs: [] },
8132
+ { name: "ValidatorMustNotBeDelegator", type: "error", inputs: [] },
8133
+ { name: "ValidatorMayNotJoinWithZeroValue", type: "error", inputs: [] },
8134
+ { name: "ValidatorMayNotDepositZeroValue", type: "error", inputs: [] },
8135
+ { name: "ValidatorWithdrawalExceedsStake", type: "error", inputs: [] },
8136
+ { name: "ValidatorAlreadyJoined", type: "error", inputs: [] },
8137
+ { name: "ValidatorNotJoined", type: "error", inputs: [] },
8138
+ { name: "ValidatorBelowMinimumStake", type: "error", inputs: [] },
8139
+ { name: "OperatorAlreadyAssigned", type: "error", inputs: [] },
8140
+ { name: "InvalidOperatorAddress", type: "error", inputs: [] },
8141
+ { name: "MaxNumberOfValidatorsReached", type: "error", inputs: [] },
8142
+ { name: "ValidatorsConsumed", type: "error", inputs: [] },
8143
+ { name: "ValidatorsUnavailable", type: "error", inputs: [] },
8144
+ { name: "EpochNotFinished", type: "error", inputs: [] },
8145
+ { name: "EpochNotFinalized", type: "error", inputs: [] },
8146
+ { name: "InflationInvalidAmount", type: "error", inputs: [] },
8147
+ { name: "InflationAlreadyReceived", type: "error", inputs: [] },
8148
+ { name: "InflationAlreadyInitialized", type: "error", inputs: [] },
8149
+ { name: "EpochAlreadyFinalized", type: "error", inputs: [] },
8150
+ { name: "PendingTribunals", type: "error", inputs: [{ name: "epoch", type: "uint256" }] },
8151
+ { name: "FailedTransfer", type: "error", inputs: [{ name: "validator", type: "address" }] },
8152
+ { name: "NFTMinterCallFailed", type: "error", inputs: [] },
8153
+ { name: "DeepthoughtCallFailed", type: "error", inputs: [] },
8154
+ { name: "NFTMinterNotConfigured", type: "error", inputs: [] },
8155
+ { name: "NumberOfValidatorsExceedsAvailable", type: "error", inputs: [] },
8156
+ { name: "EpochAdvanceNotReady", type: "error", inputs: [] },
8157
+ { name: "PreviousEpochNotFinalizable", type: "error", inputs: [] },
8158
+ { name: "NoBurning", type: "error", inputs: [] },
8159
+ { name: "ReductionFactorCannotBeZero", type: "error", inputs: [] },
8121
8160
  // Validator functions
8122
8161
  {
8123
8162
  name: "validatorJoin",
@@ -8333,6 +8372,13 @@ var STAKING_ABI = [
8333
8372
  inputs: [],
8334
8373
  outputs: [{ name: "", type: "uint256" }]
8335
8374
  },
8375
+ {
8376
+ name: "epochZeroMinDuration",
8377
+ type: "function",
8378
+ stateMutability: "view",
8379
+ inputs: [],
8380
+ outputs: [{ name: "", type: "uint256" }]
8381
+ },
8336
8382
  {
8337
8383
  name: "getQuarantinedValidators",
8338
8384
  type: "function",
@@ -8042,6 +8042,13 @@ import { defineChain as defineChain3 } from "viem";
8042
8042
 
8043
8043
  // src/abi/staking.ts
8044
8044
  var VALIDATOR_WALLET_ABI = [
8045
+ // Custom errors
8046
+ { name: "NotOperator", type: "error", inputs: [] },
8047
+ { name: "InvalidAddress", type: "error", inputs: [] },
8048
+ { name: "TransferFailed", type: "error", inputs: [] },
8049
+ { name: "OperatorTransferNotReady", type: "error", inputs: [] },
8050
+ { name: "NoPendingOperator", type: "error", inputs: [] },
8051
+ // Functions
8045
8052
  {
8046
8053
  name: "operator",
8047
8054
  type: "function",
@@ -8105,19 +8112,51 @@ var VALIDATOR_WALLET_ABI = [
8105
8112
  }
8106
8113
  ];
8107
8114
  var STAKING_ABI = [
8108
- // Custom errors
8109
- { name: "BelowMinStake", type: "error", inputs: [] },
8110
- { name: "AlreadyValidator", type: "error", inputs: [] },
8111
- { name: "NotValidator", type: "error", inputs: [] },
8112
- { name: "NotOwner", type: "error", inputs: [] },
8113
- { name: "NotOperator", type: "error", inputs: [] },
8114
- { name: "ValidatorBanned", type: "error", inputs: [] },
8115
- { name: "ValidatorQuarantined", type: "error", inputs: [] },
8116
- { name: "InsufficientShares", type: "error", inputs: [] },
8117
- { name: "NothingToClaim", type: "error", inputs: [] },
8118
- { name: "NotYetClaimable", type: "error", inputs: [] },
8119
- { name: "ZeroAmount", type: "error", inputs: [] },
8120
- { name: "InvalidOperator", type: "error", inputs: [] },
8115
+ // Custom errors from IGenLayerStaking
8116
+ { name: "OnlyGEN", type: "error", inputs: [] },
8117
+ { name: "OnlyTribunal", type: "error", inputs: [] },
8118
+ { name: "OnlyIdleness", type: "error", inputs: [] },
8119
+ { name: "OnlyTransactions", type: "error", inputs: [] },
8120
+ { name: "OnlyIdlenessOrTribunal", type: "error", inputs: [] },
8121
+ { name: "OnlyTransactionsOrTribunal", type: "error", inputs: [] },
8122
+ { name: "InvalidAtEpoch", type: "error", inputs: [] },
8123
+ { name: "MaxValidatorsCannotBeZero", type: "error", inputs: [] },
8124
+ { name: "ValidatorExitExceedsShares", type: "error", inputs: [] },
8125
+ { name: "DelegatorExitExceedsShares", type: "error", inputs: [] },
8126
+ { name: "DelegatorMayNotJoinWithZeroValue", type: "error", inputs: [] },
8127
+ { name: "DelegatorMayNotJoinTwoValidatorsSimultaneously", type: "error", inputs: [] },
8128
+ { name: "DelegatorBelowMinimumStake", type: "error", inputs: [] },
8129
+ { name: "DelegatorExitWouldBeBelowMinimum", type: "error", inputs: [] },
8130
+ { name: "ValidatorNotActive", type: "error", inputs: [] },
8131
+ { name: "ValidatorMayNotBeDelegator", type: "error", inputs: [] },
8132
+ { name: "ValidatorMustNotBeDelegator", type: "error", inputs: [] },
8133
+ { name: "ValidatorMayNotJoinWithZeroValue", type: "error", inputs: [] },
8134
+ { name: "ValidatorMayNotDepositZeroValue", type: "error", inputs: [] },
8135
+ { name: "ValidatorWithdrawalExceedsStake", type: "error", inputs: [] },
8136
+ { name: "ValidatorAlreadyJoined", type: "error", inputs: [] },
8137
+ { name: "ValidatorNotJoined", type: "error", inputs: [] },
8138
+ { name: "ValidatorBelowMinimumStake", type: "error", inputs: [] },
8139
+ { name: "OperatorAlreadyAssigned", type: "error", inputs: [] },
8140
+ { name: "InvalidOperatorAddress", type: "error", inputs: [] },
8141
+ { name: "MaxNumberOfValidatorsReached", type: "error", inputs: [] },
8142
+ { name: "ValidatorsConsumed", type: "error", inputs: [] },
8143
+ { name: "ValidatorsUnavailable", type: "error", inputs: [] },
8144
+ { name: "EpochNotFinished", type: "error", inputs: [] },
8145
+ { name: "EpochNotFinalized", type: "error", inputs: [] },
8146
+ { name: "InflationInvalidAmount", type: "error", inputs: [] },
8147
+ { name: "InflationAlreadyReceived", type: "error", inputs: [] },
8148
+ { name: "InflationAlreadyInitialized", type: "error", inputs: [] },
8149
+ { name: "EpochAlreadyFinalized", type: "error", inputs: [] },
8150
+ { name: "PendingTribunals", type: "error", inputs: [{ name: "epoch", type: "uint256" }] },
8151
+ { name: "FailedTransfer", type: "error", inputs: [{ name: "validator", type: "address" }] },
8152
+ { name: "NFTMinterCallFailed", type: "error", inputs: [] },
8153
+ { name: "DeepthoughtCallFailed", type: "error", inputs: [] },
8154
+ { name: "NFTMinterNotConfigured", type: "error", inputs: [] },
8155
+ { name: "NumberOfValidatorsExceedsAvailable", type: "error", inputs: [] },
8156
+ { name: "EpochAdvanceNotReady", type: "error", inputs: [] },
8157
+ { name: "PreviousEpochNotFinalizable", type: "error", inputs: [] },
8158
+ { name: "NoBurning", type: "error", inputs: [] },
8159
+ { name: "ReductionFactorCannotBeZero", type: "error", inputs: [] },
8121
8160
  // Validator functions
8122
8161
  {
8123
8162
  name: "validatorJoin",
@@ -8333,6 +8372,13 @@ var STAKING_ABI = [
8333
8372
  inputs: [],
8334
8373
  outputs: [{ name: "", type: "uint256" }]
8335
8374
  },
8375
+ {
8376
+ name: "epochZeroMinDuration",
8377
+ type: "function",
8378
+ stateMutability: "view",
8379
+ inputs: [],
8380
+ outputs: [{ name: "", type: "uint256" }]
8381
+ },
8336
8382
  {
8337
8383
  name: "getQuarantinedValidators",
8338
8384
  type: "function",
@@ -289,6 +289,26 @@ type MetaMaskClientResult = {
289
289
  };
290
290
 
291
291
  declare const VALIDATOR_WALLET_ABI: readonly [{
292
+ readonly name: "NotOperator";
293
+ readonly type: "error";
294
+ readonly inputs: readonly [];
295
+ }, {
296
+ readonly name: "InvalidAddress";
297
+ readonly type: "error";
298
+ readonly inputs: readonly [];
299
+ }, {
300
+ readonly name: "TransferFailed";
301
+ readonly type: "error";
302
+ readonly inputs: readonly [];
303
+ }, {
304
+ readonly name: "OperatorTransferNotReady";
305
+ readonly type: "error";
306
+ readonly inputs: readonly [];
307
+ }, {
308
+ readonly name: "NoPendingOperator";
309
+ readonly type: "error";
310
+ readonly inputs: readonly [];
311
+ }, {
292
312
  readonly name: "operator";
293
313
  readonly type: "function";
294
314
  readonly stateMutability: "view";
@@ -387,51 +407,185 @@ declare const VALIDATOR_WALLET_ABI: readonly [{
387
407
  readonly outputs: readonly [];
388
408
  }];
389
409
  declare const STAKING_ABI: readonly [{
390
- readonly name: "BelowMinStake";
410
+ readonly name: "OnlyGEN";
391
411
  readonly type: "error";
392
412
  readonly inputs: readonly [];
393
413
  }, {
394
- readonly name: "AlreadyValidator";
414
+ readonly name: "OnlyTribunal";
395
415
  readonly type: "error";
396
416
  readonly inputs: readonly [];
397
417
  }, {
398
- readonly name: "NotValidator";
418
+ readonly name: "OnlyIdleness";
399
419
  readonly type: "error";
400
420
  readonly inputs: readonly [];
401
421
  }, {
402
- readonly name: "NotOwner";
422
+ readonly name: "OnlyTransactions";
403
423
  readonly type: "error";
404
424
  readonly inputs: readonly [];
405
425
  }, {
406
- readonly name: "NotOperator";
426
+ readonly name: "OnlyIdlenessOrTribunal";
427
+ readonly type: "error";
428
+ readonly inputs: readonly [];
429
+ }, {
430
+ readonly name: "OnlyTransactionsOrTribunal";
431
+ readonly type: "error";
432
+ readonly inputs: readonly [];
433
+ }, {
434
+ readonly name: "InvalidAtEpoch";
435
+ readonly type: "error";
436
+ readonly inputs: readonly [];
437
+ }, {
438
+ readonly name: "MaxValidatorsCannotBeZero";
439
+ readonly type: "error";
440
+ readonly inputs: readonly [];
441
+ }, {
442
+ readonly name: "ValidatorExitExceedsShares";
443
+ readonly type: "error";
444
+ readonly inputs: readonly [];
445
+ }, {
446
+ readonly name: "DelegatorExitExceedsShares";
447
+ readonly type: "error";
448
+ readonly inputs: readonly [];
449
+ }, {
450
+ readonly name: "DelegatorMayNotJoinWithZeroValue";
451
+ readonly type: "error";
452
+ readonly inputs: readonly [];
453
+ }, {
454
+ readonly name: "DelegatorMayNotJoinTwoValidatorsSimultaneously";
455
+ readonly type: "error";
456
+ readonly inputs: readonly [];
457
+ }, {
458
+ readonly name: "DelegatorBelowMinimumStake";
459
+ readonly type: "error";
460
+ readonly inputs: readonly [];
461
+ }, {
462
+ readonly name: "DelegatorExitWouldBeBelowMinimum";
463
+ readonly type: "error";
464
+ readonly inputs: readonly [];
465
+ }, {
466
+ readonly name: "ValidatorNotActive";
467
+ readonly type: "error";
468
+ readonly inputs: readonly [];
469
+ }, {
470
+ readonly name: "ValidatorMayNotBeDelegator";
471
+ readonly type: "error";
472
+ readonly inputs: readonly [];
473
+ }, {
474
+ readonly name: "ValidatorMustNotBeDelegator";
475
+ readonly type: "error";
476
+ readonly inputs: readonly [];
477
+ }, {
478
+ readonly name: "ValidatorMayNotJoinWithZeroValue";
479
+ readonly type: "error";
480
+ readonly inputs: readonly [];
481
+ }, {
482
+ readonly name: "ValidatorMayNotDepositZeroValue";
483
+ readonly type: "error";
484
+ readonly inputs: readonly [];
485
+ }, {
486
+ readonly name: "ValidatorWithdrawalExceedsStake";
487
+ readonly type: "error";
488
+ readonly inputs: readonly [];
489
+ }, {
490
+ readonly name: "ValidatorAlreadyJoined";
491
+ readonly type: "error";
492
+ readonly inputs: readonly [];
493
+ }, {
494
+ readonly name: "ValidatorNotJoined";
495
+ readonly type: "error";
496
+ readonly inputs: readonly [];
497
+ }, {
498
+ readonly name: "ValidatorBelowMinimumStake";
499
+ readonly type: "error";
500
+ readonly inputs: readonly [];
501
+ }, {
502
+ readonly name: "OperatorAlreadyAssigned";
503
+ readonly type: "error";
504
+ readonly inputs: readonly [];
505
+ }, {
506
+ readonly name: "InvalidOperatorAddress";
507
+ readonly type: "error";
508
+ readonly inputs: readonly [];
509
+ }, {
510
+ readonly name: "MaxNumberOfValidatorsReached";
511
+ readonly type: "error";
512
+ readonly inputs: readonly [];
513
+ }, {
514
+ readonly name: "ValidatorsConsumed";
407
515
  readonly type: "error";
408
516
  readonly inputs: readonly [];
409
517
  }, {
410
- readonly name: "ValidatorBanned";
518
+ readonly name: "ValidatorsUnavailable";
411
519
  readonly type: "error";
412
520
  readonly inputs: readonly [];
413
521
  }, {
414
- readonly name: "ValidatorQuarantined";
522
+ readonly name: "EpochNotFinished";
415
523
  readonly type: "error";
416
524
  readonly inputs: readonly [];
417
525
  }, {
418
- readonly name: "InsufficientShares";
526
+ readonly name: "EpochNotFinalized";
419
527
  readonly type: "error";
420
528
  readonly inputs: readonly [];
421
529
  }, {
422
- readonly name: "NothingToClaim";
530
+ readonly name: "InflationInvalidAmount";
423
531
  readonly type: "error";
424
532
  readonly inputs: readonly [];
425
533
  }, {
426
- readonly name: "NotYetClaimable";
534
+ readonly name: "InflationAlreadyReceived";
427
535
  readonly type: "error";
428
536
  readonly inputs: readonly [];
429
537
  }, {
430
- readonly name: "ZeroAmount";
538
+ readonly name: "InflationAlreadyInitialized";
431
539
  readonly type: "error";
432
540
  readonly inputs: readonly [];
433
541
  }, {
434
- readonly name: "InvalidOperator";
542
+ readonly name: "EpochAlreadyFinalized";
543
+ readonly type: "error";
544
+ readonly inputs: readonly [];
545
+ }, {
546
+ readonly name: "PendingTribunals";
547
+ readonly type: "error";
548
+ readonly inputs: readonly [{
549
+ readonly name: "epoch";
550
+ readonly type: "uint256";
551
+ }];
552
+ }, {
553
+ readonly name: "FailedTransfer";
554
+ readonly type: "error";
555
+ readonly inputs: readonly [{
556
+ readonly name: "validator";
557
+ readonly type: "address";
558
+ }];
559
+ }, {
560
+ readonly name: "NFTMinterCallFailed";
561
+ readonly type: "error";
562
+ readonly inputs: readonly [];
563
+ }, {
564
+ readonly name: "DeepthoughtCallFailed";
565
+ readonly type: "error";
566
+ readonly inputs: readonly [];
567
+ }, {
568
+ readonly name: "NFTMinterNotConfigured";
569
+ readonly type: "error";
570
+ readonly inputs: readonly [];
571
+ }, {
572
+ readonly name: "NumberOfValidatorsExceedsAvailable";
573
+ readonly type: "error";
574
+ readonly inputs: readonly [];
575
+ }, {
576
+ readonly name: "EpochAdvanceNotReady";
577
+ readonly type: "error";
578
+ readonly inputs: readonly [];
579
+ }, {
580
+ readonly name: "PreviousEpochNotFinalizable";
581
+ readonly type: "error";
582
+ readonly inputs: readonly [];
583
+ }, {
584
+ readonly name: "NoBurning";
585
+ readonly type: "error";
586
+ readonly inputs: readonly [];
587
+ }, {
588
+ readonly name: "ReductionFactorCannotBeZero";
435
589
  readonly type: "error";
436
590
  readonly inputs: readonly [];
437
591
  }, {
@@ -749,6 +903,15 @@ declare const STAKING_ABI: readonly [{
749
903
  readonly name: "";
750
904
  readonly type: "uint256";
751
905
  }];
906
+ }, {
907
+ readonly name: "epochZeroMinDuration";
908
+ readonly type: "function";
909
+ readonly stateMutability: "view";
910
+ readonly inputs: readonly [];
911
+ readonly outputs: readonly [{
912
+ readonly name: "";
913
+ readonly type: "uint256";
914
+ }];
752
915
  }, {
753
916
  readonly name: "getQuarantinedValidators";
754
917
  readonly type: "function";