genlayer-js 0.18.4 → 0.18.6

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/CLAUDE.md +66 -0
  3. package/README.md +52 -1
  4. package/dist/chains/index.cjs +2 -2
  5. package/dist/chains/index.d.cts +2 -2
  6. package/dist/chains/index.d.ts +2 -2
  7. package/dist/chains/index.js +1 -1
  8. package/dist/{chains-BIe_Q0mF.d.cts → chains-B7B7UXdn.d.cts} +6 -2
  9. package/dist/{chains-BIe_Q0mF.d.ts → chains-B7B7UXdn.d.ts} +6 -2
  10. package/dist/{chunk-NO75TOQL.js → chunk-KVHGQTAI.js} +539 -4
  11. package/dist/{chunk-SMGWE7OH.cjs → chunk-QAAO2WJL.cjs} +540 -5
  12. package/dist/index-3leEwFoq.d.cts +1389 -0
  13. package/dist/index-BBh1NZjP.d.ts +1389 -0
  14. package/dist/{index-C5zeayBB.d.cts → index-BVDASTaU.d.cts} +1 -1
  15. package/dist/{index-BpFWfpio.d.ts → index-ucNO2REF.d.ts} +1 -1
  16. package/dist/index.cjs +551 -38
  17. package/dist/index.d.cts +17 -5
  18. package/dist/index.d.ts +17 -5
  19. package/dist/index.js +528 -15
  20. package/dist/types/index.cjs +2 -2
  21. package/dist/types/index.d.cts +2 -2
  22. package/dist/types/index.d.ts +2 -2
  23. package/dist/types/index.js +1 -1
  24. package/package.json +1 -1
  25. package/src/abi/index.ts +1 -0
  26. package/src/abi/staking.ts +525 -0
  27. package/src/chains/localnet.ts +2 -1
  28. package/src/chains/studionet.ts +1 -0
  29. package/src/chains/testnetAsimov.ts +10 -3
  30. package/src/client/client.ts +17 -15
  31. package/src/index.ts +1 -0
  32. package/src/staking/actions.ts +609 -0
  33. package/src/staking/index.ts +2 -0
  34. package/src/staking/utils.ts +22 -0
  35. package/src/types/chains.ts +6 -2
  36. package/src/types/clients.ts +6 -6
  37. package/src/types/index.ts +1 -0
  38. package/src/types/staking.ts +228 -0
  39. package/tsconfig.vitest-temp.json +41 -0
  40. package/dist/index-B2AY6_eD.d.ts +0 -407
  41. package/dist/index-BYma5s90.d.cts +0 -407
  42. /package/dist/{chunk-FPZNF3JH.cjs → chunk-W4V73RPN.cjs} +0 -0
  43. /package/dist/{chunk-47QDX7IX.js → chunk-ZHBOSLFN.js} +0 -0
@@ -0,0 +1,1389 @@
1
+ import { Hex, Address, GetContractReturnType, PublicClient, Client, Transport, Chain, Account, WalletActions, PublicActions } from 'viem';
2
+ import { G as GenLayerChain } from './chains-B7B7UXdn.js';
3
+
4
+ declare class CalldataAddress {
5
+ bytes: Uint8Array;
6
+ constructor(addr: Uint8Array);
7
+ }
8
+ type CalldataEncodable = null | boolean | CalldataAddress | number | bigint | string | Uint8Array | Array<CalldataEncodable> | Map<string, CalldataEncodable> | {
9
+ [key: string]: CalldataEncodable;
10
+ };
11
+ type MethodDescription = {
12
+ method: string;
13
+ args: Array<CalldataEncodable>;
14
+ };
15
+ type TransactionDataElement = string | number | bigint | boolean | Uint8Array;
16
+
17
+ type Hash = `0x${string}` & {
18
+ length: 66;
19
+ };
20
+ type TransactionHash = Hash;
21
+ declare enum TransactionStatus {
22
+ UNINITIALIZED = "UNINITIALIZED",
23
+ PENDING = "PENDING",
24
+ PROPOSING = "PROPOSING",
25
+ COMMITTING = "COMMITTING",
26
+ REVEALING = "REVEALING",
27
+ ACCEPTED = "ACCEPTED",
28
+ UNDETERMINED = "UNDETERMINED",
29
+ FINALIZED = "FINALIZED",
30
+ CANCELED = "CANCELED",
31
+ APPEAL_REVEALING = "APPEAL_REVEALING",
32
+ APPEAL_COMMITTING = "APPEAL_COMMITTING",
33
+ READY_TO_FINALIZE = "READY_TO_FINALIZE",
34
+ VALIDATORS_TIMEOUT = "VALIDATORS_TIMEOUT",
35
+ LEADER_TIMEOUT = "LEADER_TIMEOUT"
36
+ }
37
+ declare enum TransactionResult {
38
+ SUCCESS = "SUCCESS",
39
+ FAILURE = "FAILURE"
40
+ }
41
+ declare enum TransactionResult {
42
+ IDLE = "IDLE",
43
+ AGREE = "AGREE",
44
+ DISAGREE = "DISAGREE",
45
+ TIMEOUT = "TIMEOUT",
46
+ DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION",
47
+ NO_MAJORITY = "NO_MAJORITY",
48
+ MAJORITY_AGREE = "MAJORITY_AGREE",
49
+ MAJORITY_DISAGREE = "MAJORITY_DISAGREE"
50
+ }
51
+ declare const transactionsStatusNumberToName: {
52
+ "0": TransactionStatus;
53
+ "1": TransactionStatus;
54
+ "2": TransactionStatus;
55
+ "3": TransactionStatus;
56
+ "4": TransactionStatus;
57
+ "5": TransactionStatus;
58
+ "6": TransactionStatus;
59
+ "7": TransactionStatus;
60
+ "8": TransactionStatus;
61
+ "9": TransactionStatus;
62
+ "10": TransactionStatus;
63
+ "11": TransactionStatus;
64
+ "12": TransactionStatus;
65
+ "13": TransactionStatus;
66
+ };
67
+ declare const transactionsStatusNameToNumber: {
68
+ UNINITIALIZED: string;
69
+ PENDING: string;
70
+ PROPOSING: string;
71
+ COMMITTING: string;
72
+ REVEALING: string;
73
+ ACCEPTED: string;
74
+ UNDETERMINED: string;
75
+ FINALIZED: string;
76
+ CANCELED: string;
77
+ APPEAL_REVEALING: string;
78
+ APPEAL_COMMITTING: string;
79
+ READY_TO_FINALIZE: string;
80
+ VALIDATORS_TIMEOUT: string;
81
+ LEADER_TIMEOUT: string;
82
+ };
83
+ declare const DECIDED_STATES: TransactionStatus[];
84
+ declare function isDecidedState(status: string): boolean;
85
+ declare const transactionResultNumberToName: {
86
+ "0": TransactionResult;
87
+ "1": TransactionResult;
88
+ "2": TransactionResult;
89
+ "3": TransactionResult;
90
+ "4": TransactionResult;
91
+ "5": TransactionResult;
92
+ "6": TransactionResult;
93
+ "7": TransactionResult;
94
+ };
95
+ declare const TransactionResultNameToNumber: {
96
+ IDLE: string;
97
+ AGREE: string;
98
+ DISAGREE: string;
99
+ TIMEOUT: string;
100
+ DETERMINISTIC_VIOLATION: string;
101
+ NO_MAJORITY: string;
102
+ MAJORITY_AGREE: string;
103
+ MAJORITY_DISAGREE: string;
104
+ };
105
+ declare enum VoteType {
106
+ NOT_VOTED = "NOT_VOTED",
107
+ AGREE = "AGREE",
108
+ DISAGREE = "DISAGREE",
109
+ TIMEOUT = "TIMEOUT",
110
+ DETERMINISTIC_VIOLATION = "DETERMINISTIC_VIOLATION"
111
+ }
112
+ declare const voteTypeNumberToName: {
113
+ "0": VoteType;
114
+ "1": VoteType;
115
+ "2": VoteType;
116
+ "3": VoteType;
117
+ "4": VoteType;
118
+ };
119
+ declare const voteTypeNameToNumber: {
120
+ NOT_VOTED: string;
121
+ AGREE: string;
122
+ DISAGREE: string;
123
+ TIMEOUT: string;
124
+ DETERMINISTIC_VIOLATION: string;
125
+ };
126
+ type TransactionType = "deploy" | "call";
127
+ declare enum TransactionHashVariant {
128
+ LATEST_FINAL = "latest-final",
129
+ LATEST_NONFINAL = "latest-nonfinal"
130
+ }
131
+ type DecodedDeployData = {
132
+ code?: Hex;
133
+ constructorArgs?: any;
134
+ leaderOnly?: boolean;
135
+ type?: TransactionType;
136
+ contractAddress?: Address;
137
+ };
138
+ type DecodedCallData = {
139
+ callData?: any;
140
+ leaderOnly?: boolean;
141
+ type: TransactionType;
142
+ };
143
+ type GenLayerTransaction = {
144
+ currentTimestamp?: string;
145
+ from_address?: Address;
146
+ sender?: Address;
147
+ to_address?: Address;
148
+ recipient?: Address;
149
+ numOfInitialValidators?: string;
150
+ txSlot?: string;
151
+ createdTimestamp?: string;
152
+ lastVoteTimestamp?: string;
153
+ randomSeed?: Hash;
154
+ result?: number;
155
+ resultName?: TransactionResult;
156
+ data?: Record<string, unknown>;
157
+ txData?: Hex;
158
+ txDataDecoded?: DecodedDeployData | DecodedCallData;
159
+ txReceipt?: Hash;
160
+ messages?: unknown[];
161
+ queueType?: number;
162
+ queuePosition?: string;
163
+ activator?: Address;
164
+ lastLeader?: Address;
165
+ status?: TransactionStatus | number;
166
+ statusName?: TransactionStatus;
167
+ hash?: TransactionHash;
168
+ txId?: TransactionHash;
169
+ readStateBlockRange?: {
170
+ activationBlock: string;
171
+ processingBlock: string;
172
+ proposalBlock: string;
173
+ };
174
+ numOfRounds?: string;
175
+ lastRound?: {
176
+ round: string;
177
+ leaderIndex: string;
178
+ votesCommitted: string;
179
+ votesRevealed: string;
180
+ appealBond: string;
181
+ rotationsLeft: string;
182
+ result: number;
183
+ roundValidators: Address[];
184
+ validatorVotesHash: Hash[];
185
+ validatorVotes: number[];
186
+ validatorVotesName: VoteType[];
187
+ };
188
+ consensus_data?: {
189
+ final: boolean;
190
+ leader_receipt?: {
191
+ calldata: string;
192
+ class_name: string;
193
+ contract_state: string;
194
+ eq_outputs: Record<string, unknown>;
195
+ error: string | null;
196
+ execution_result: string;
197
+ gas_used: number;
198
+ mode: string;
199
+ node_config: Record<string, unknown>;
200
+ pending_transactions: unknown[];
201
+ vote: string;
202
+ result: string;
203
+ }[];
204
+ validators?: Record<string, unknown>[];
205
+ votes?: Record<string, string>;
206
+ };
207
+ nonce?: number;
208
+ value?: number;
209
+ type?: number;
210
+ gaslimit?: bigint;
211
+ created_at?: Date;
212
+ r?: number;
213
+ s?: number;
214
+ v?: number;
215
+ };
216
+ type GenLayerRawTransaction = {
217
+ currentTimestamp: bigint;
218
+ sender: Address;
219
+ recipient: Address;
220
+ numOfInitialValidators: bigint;
221
+ txSlot: bigint;
222
+ createdTimestamp: bigint;
223
+ lastVoteTimestamp: bigint;
224
+ randomSeed: Hash;
225
+ result: number;
226
+ txData: Hex | undefined | null;
227
+ txReceipt: Hash;
228
+ messages: unknown[];
229
+ queueType: number;
230
+ queuePosition: bigint;
231
+ activator: Address;
232
+ lastLeader: Address;
233
+ status: number;
234
+ txId: Hash;
235
+ readStateBlockRange: {
236
+ activationBlock: bigint;
237
+ processingBlock: bigint;
238
+ proposalBlock: bigint;
239
+ };
240
+ numOfRounds: bigint;
241
+ lastRound: {
242
+ round: bigint;
243
+ leaderIndex: bigint;
244
+ votesCommitted: bigint;
245
+ votesRevealed: bigint;
246
+ appealBond: bigint;
247
+ rotationsLeft: bigint;
248
+ result: number;
249
+ roundValidators: Address[];
250
+ validatorVotesHash: Hash[];
251
+ validatorVotes: number[];
252
+ };
253
+ };
254
+
255
+ type ContractParamsArraySchemaElement = ContractParamsSchema | {
256
+ $rep: ContractParamsSchema;
257
+ };
258
+ type ContractParamsSchema = "null" | "bool" | "int" | "address" | "string" | "bytes" | "any" | "array" | "dict" | {
259
+ $or: ContractParamsSchema[];
260
+ } | {
261
+ $dict: ContractParamsSchema;
262
+ } | {
263
+ [key: string]: ContractParamsSchema;
264
+ } | ContractParamsArraySchemaElement[];
265
+ interface ContractMethodBase {
266
+ params: [string, ContractParamsSchema][];
267
+ kwparams: {
268
+ [key: string]: ContractParamsSchema;
269
+ };
270
+ }
271
+ interface ContractMethod extends ContractMethodBase {
272
+ ret: ContractParamsSchema;
273
+ readonly: boolean;
274
+ payable?: boolean;
275
+ }
276
+ type ContractSchema = {
277
+ ctor: ContractMethodBase;
278
+ methods: ContractMethod[];
279
+ };
280
+
281
+ type Network = "localnet" | "studionet" | "testnetAsimov" | "mainnet";
282
+
283
+ type SnapSource = 'npm' | 'local';
284
+
285
+ type MetaMaskClientResult = {
286
+ isFlask: boolean;
287
+ installedSnaps: Record<string, any>;
288
+ isGenLayerSnapInstalled: boolean;
289
+ };
290
+
291
+ declare const VALIDATOR_WALLET_ABI: readonly [{
292
+ readonly name: "operator";
293
+ readonly type: "function";
294
+ readonly stateMutability: "view";
295
+ readonly inputs: readonly [];
296
+ readonly outputs: readonly [{
297
+ readonly name: "";
298
+ readonly type: "address";
299
+ }];
300
+ }, {
301
+ readonly name: "owner";
302
+ readonly type: "function";
303
+ readonly stateMutability: "view";
304
+ readonly inputs: readonly [];
305
+ readonly outputs: readonly [{
306
+ readonly name: "";
307
+ readonly type: "address";
308
+ }];
309
+ }, {
310
+ readonly name: "getIdentity";
311
+ readonly type: "function";
312
+ readonly stateMutability: "view";
313
+ readonly inputs: readonly [];
314
+ readonly outputs: readonly [{
315
+ readonly name: "";
316
+ readonly type: "tuple";
317
+ readonly components: readonly [{
318
+ readonly name: "moniker";
319
+ readonly type: "string";
320
+ }, {
321
+ readonly name: "logoUri";
322
+ readonly type: "string";
323
+ }, {
324
+ readonly name: "website";
325
+ readonly type: "string";
326
+ }, {
327
+ readonly name: "description";
328
+ readonly type: "string";
329
+ }, {
330
+ readonly name: "email";
331
+ readonly type: "string";
332
+ }, {
333
+ readonly name: "twitter";
334
+ readonly type: "string";
335
+ }, {
336
+ readonly name: "telegram";
337
+ readonly type: "string";
338
+ }, {
339
+ readonly name: "github";
340
+ readonly type: "string";
341
+ }, {
342
+ readonly name: "extraCid";
343
+ readonly type: "bytes";
344
+ }];
345
+ }];
346
+ }, {
347
+ readonly name: "setOperator";
348
+ readonly type: "function";
349
+ readonly stateMutability: "nonpayable";
350
+ readonly inputs: readonly [{
351
+ readonly name: "_operator";
352
+ readonly type: "address";
353
+ }];
354
+ readonly outputs: readonly [];
355
+ }, {
356
+ readonly name: "setIdentity";
357
+ readonly type: "function";
358
+ readonly stateMutability: "nonpayable";
359
+ readonly inputs: readonly [{
360
+ readonly name: "moniker";
361
+ readonly type: "string";
362
+ }, {
363
+ readonly name: "logoUri";
364
+ readonly type: "string";
365
+ }, {
366
+ readonly name: "website";
367
+ readonly type: "string";
368
+ }, {
369
+ readonly name: "description";
370
+ readonly type: "string";
371
+ }, {
372
+ readonly name: "email";
373
+ readonly type: "string";
374
+ }, {
375
+ readonly name: "twitter";
376
+ readonly type: "string";
377
+ }, {
378
+ readonly name: "telegram";
379
+ readonly type: "string";
380
+ }, {
381
+ readonly name: "github";
382
+ readonly type: "string";
383
+ }, {
384
+ readonly name: "extraCid";
385
+ readonly type: "bytes";
386
+ }];
387
+ readonly outputs: readonly [];
388
+ }];
389
+ declare const STAKING_ABI: readonly [{
390
+ readonly name: "BelowMinStake";
391
+ readonly type: "error";
392
+ readonly inputs: readonly [];
393
+ }, {
394
+ readonly name: "AlreadyValidator";
395
+ readonly type: "error";
396
+ readonly inputs: readonly [];
397
+ }, {
398
+ readonly name: "NotValidator";
399
+ readonly type: "error";
400
+ readonly inputs: readonly [];
401
+ }, {
402
+ readonly name: "NotOwner";
403
+ readonly type: "error";
404
+ readonly inputs: readonly [];
405
+ }, {
406
+ readonly name: "NotOperator";
407
+ readonly type: "error";
408
+ readonly inputs: readonly [];
409
+ }, {
410
+ readonly name: "ValidatorBanned";
411
+ readonly type: "error";
412
+ readonly inputs: readonly [];
413
+ }, {
414
+ readonly name: "ValidatorQuarantined";
415
+ readonly type: "error";
416
+ readonly inputs: readonly [];
417
+ }, {
418
+ readonly name: "InsufficientShares";
419
+ readonly type: "error";
420
+ readonly inputs: readonly [];
421
+ }, {
422
+ readonly name: "NothingToClaim";
423
+ readonly type: "error";
424
+ readonly inputs: readonly [];
425
+ }, {
426
+ readonly name: "NotYetClaimable";
427
+ readonly type: "error";
428
+ readonly inputs: readonly [];
429
+ }, {
430
+ readonly name: "ZeroAmount";
431
+ readonly type: "error";
432
+ readonly inputs: readonly [];
433
+ }, {
434
+ readonly name: "InvalidOperator";
435
+ readonly type: "error";
436
+ readonly inputs: readonly [];
437
+ }, {
438
+ readonly name: "validatorJoin";
439
+ readonly type: "function";
440
+ readonly stateMutability: "payable";
441
+ readonly inputs: readonly [];
442
+ readonly outputs: readonly [{
443
+ readonly name: "validator";
444
+ readonly type: "address";
445
+ }];
446
+ }, {
447
+ readonly name: "validatorJoin";
448
+ readonly type: "function";
449
+ readonly stateMutability: "payable";
450
+ readonly inputs: readonly [{
451
+ readonly name: "_operator";
452
+ readonly type: "address";
453
+ }];
454
+ readonly outputs: readonly [{
455
+ readonly name: "validator";
456
+ readonly type: "address";
457
+ }];
458
+ }, {
459
+ readonly name: "validatorDeposit";
460
+ readonly type: "function";
461
+ readonly stateMutability: "payable";
462
+ readonly inputs: readonly [];
463
+ readonly outputs: readonly [];
464
+ }, {
465
+ readonly name: "validatorExit";
466
+ readonly type: "function";
467
+ readonly stateMutability: "nonpayable";
468
+ readonly inputs: readonly [{
469
+ readonly name: "_sharesWithdrawal";
470
+ readonly type: "uint256";
471
+ }];
472
+ readonly outputs: readonly [];
473
+ }, {
474
+ readonly name: "validatorClaim";
475
+ readonly type: "function";
476
+ readonly stateMutability: "nonpayable";
477
+ readonly inputs: readonly [{
478
+ readonly name: "_validator";
479
+ readonly type: "address";
480
+ }];
481
+ readonly outputs: readonly [{
482
+ readonly name: "";
483
+ readonly type: "uint256";
484
+ }];
485
+ }, {
486
+ readonly name: "validatorPrime";
487
+ readonly type: "function";
488
+ readonly stateMutability: "nonpayable";
489
+ readonly inputs: readonly [{
490
+ readonly name: "_validator";
491
+ readonly type: "address";
492
+ }];
493
+ readonly outputs: readonly [];
494
+ }, {
495
+ readonly name: "delegatorJoin";
496
+ readonly type: "function";
497
+ readonly stateMutability: "payable";
498
+ readonly inputs: readonly [{
499
+ readonly name: "_validator";
500
+ readonly type: "address";
501
+ }];
502
+ readonly outputs: readonly [];
503
+ }, {
504
+ readonly name: "delegatorExit";
505
+ readonly type: "function";
506
+ readonly stateMutability: "nonpayable";
507
+ readonly inputs: readonly [{
508
+ readonly name: "_validator";
509
+ readonly type: "address";
510
+ }, {
511
+ readonly name: "_sharesExit";
512
+ readonly type: "uint256";
513
+ }];
514
+ readonly outputs: readonly [];
515
+ }, {
516
+ readonly name: "delegatorClaim";
517
+ readonly type: "function";
518
+ readonly stateMutability: "nonpayable";
519
+ readonly inputs: readonly [{
520
+ readonly name: "_delegator";
521
+ readonly type: "address";
522
+ }, {
523
+ readonly name: "_validator";
524
+ readonly type: "address";
525
+ }];
526
+ readonly outputs: readonly [];
527
+ }, {
528
+ readonly name: "isValidator";
529
+ readonly type: "function";
530
+ readonly stateMutability: "view";
531
+ readonly inputs: readonly [{
532
+ readonly name: "_address";
533
+ readonly type: "address";
534
+ }];
535
+ readonly outputs: readonly [{
536
+ readonly name: "";
537
+ readonly type: "bool";
538
+ }];
539
+ }, {
540
+ readonly name: "validatorView";
541
+ readonly type: "function";
542
+ readonly stateMutability: "view";
543
+ readonly inputs: readonly [{
544
+ readonly name: "_validator";
545
+ readonly type: "address";
546
+ }];
547
+ readonly outputs: readonly [{
548
+ readonly name: "";
549
+ readonly type: "tuple";
550
+ readonly components: readonly [{
551
+ readonly name: "left";
552
+ readonly type: "address";
553
+ }, {
554
+ readonly name: "right";
555
+ readonly type: "address";
556
+ }, {
557
+ readonly name: "parent";
558
+ readonly type: "address";
559
+ }, {
560
+ readonly name: "eBanned";
561
+ readonly type: "uint256";
562
+ }, {
563
+ readonly name: "ePrimed";
564
+ readonly type: "uint256";
565
+ }, {
566
+ readonly name: "vStake";
567
+ readonly type: "uint256";
568
+ }, {
569
+ readonly name: "vShares";
570
+ readonly type: "uint256";
571
+ }, {
572
+ readonly name: "dStake";
573
+ readonly type: "uint256";
574
+ }, {
575
+ readonly name: "dShares";
576
+ readonly type: "uint256";
577
+ }, {
578
+ readonly name: "vDeposit";
579
+ readonly type: "uint256";
580
+ }, {
581
+ readonly name: "vWithdrawal";
582
+ readonly type: "uint256";
583
+ }, {
584
+ readonly name: "live";
585
+ readonly type: "bool";
586
+ }];
587
+ }];
588
+ }, {
589
+ readonly name: "sharesOf";
590
+ readonly type: "function";
591
+ readonly stateMutability: "view";
592
+ readonly inputs: readonly [{
593
+ readonly name: "_delegator";
594
+ readonly type: "address";
595
+ }, {
596
+ readonly name: "_validator";
597
+ readonly type: "address";
598
+ }];
599
+ readonly outputs: readonly [{
600
+ readonly name: "";
601
+ readonly type: "uint256";
602
+ }];
603
+ }, {
604
+ readonly name: "stakeOf";
605
+ readonly type: "function";
606
+ readonly stateMutability: "view";
607
+ readonly inputs: readonly [{
608
+ readonly name: "_delegator";
609
+ readonly type: "address";
610
+ }, {
611
+ readonly name: "_validator";
612
+ readonly type: "address";
613
+ }];
614
+ readonly outputs: readonly [{
615
+ readonly name: "";
616
+ readonly type: "uint256";
617
+ }];
618
+ }, {
619
+ readonly name: "epoch";
620
+ readonly type: "function";
621
+ readonly stateMutability: "view";
622
+ readonly inputs: readonly [];
623
+ readonly outputs: readonly [{
624
+ readonly name: "";
625
+ readonly type: "uint256";
626
+ }];
627
+ }, {
628
+ readonly name: "validatorMinStake";
629
+ readonly type: "function";
630
+ readonly stateMutability: "view";
631
+ readonly inputs: readonly [];
632
+ readonly outputs: readonly [{
633
+ readonly name: "";
634
+ readonly type: "uint256";
635
+ }];
636
+ }, {
637
+ readonly name: "delegatorMinStake";
638
+ readonly type: "function";
639
+ readonly stateMutability: "view";
640
+ readonly inputs: readonly [];
641
+ readonly outputs: readonly [{
642
+ readonly name: "";
643
+ readonly type: "uint256";
644
+ }];
645
+ }, {
646
+ readonly name: "activeValidators";
647
+ readonly type: "function";
648
+ readonly stateMutability: "view";
649
+ readonly inputs: readonly [];
650
+ readonly outputs: readonly [{
651
+ readonly name: "";
652
+ readonly type: "address[]";
653
+ }];
654
+ }, {
655
+ readonly name: "activeValidatorsCount";
656
+ readonly type: "function";
657
+ readonly stateMutability: "view";
658
+ readonly inputs: readonly [];
659
+ readonly outputs: readonly [{
660
+ readonly name: "";
661
+ readonly type: "uint256";
662
+ }];
663
+ }, {
664
+ readonly name: "epochOdd";
665
+ readonly type: "function";
666
+ readonly stateMutability: "view";
667
+ readonly inputs: readonly [];
668
+ readonly outputs: readonly [{
669
+ readonly name: "";
670
+ readonly type: "tuple";
671
+ readonly components: readonly [{
672
+ readonly name: "start";
673
+ readonly type: "uint256";
674
+ }, {
675
+ readonly name: "end";
676
+ readonly type: "uint256";
677
+ }, {
678
+ readonly name: "inflation";
679
+ readonly type: "uint256";
680
+ }, {
681
+ readonly name: "weight";
682
+ readonly type: "uint256";
683
+ }, {
684
+ readonly name: "weightDeposit";
685
+ readonly type: "uint256";
686
+ }, {
687
+ readonly name: "weightWithdrawal";
688
+ readonly type: "uint256";
689
+ }, {
690
+ readonly name: "vcount";
691
+ readonly type: "uint256";
692
+ }, {
693
+ readonly name: "claimed";
694
+ readonly type: "uint256";
695
+ }, {
696
+ readonly name: "stakeDeposit";
697
+ readonly type: "uint256";
698
+ }, {
699
+ readonly name: "stakeWithdrawal";
700
+ readonly type: "uint256";
701
+ }];
702
+ }];
703
+ }, {
704
+ readonly name: "epochEven";
705
+ readonly type: "function";
706
+ readonly stateMutability: "view";
707
+ readonly inputs: readonly [];
708
+ readonly outputs: readonly [{
709
+ readonly name: "";
710
+ readonly type: "tuple";
711
+ readonly components: readonly [{
712
+ readonly name: "start";
713
+ readonly type: "uint256";
714
+ }, {
715
+ readonly name: "end";
716
+ readonly type: "uint256";
717
+ }, {
718
+ readonly name: "inflation";
719
+ readonly type: "uint256";
720
+ }, {
721
+ readonly name: "weight";
722
+ readonly type: "uint256";
723
+ }, {
724
+ readonly name: "weightDeposit";
725
+ readonly type: "uint256";
726
+ }, {
727
+ readonly name: "weightWithdrawal";
728
+ readonly type: "uint256";
729
+ }, {
730
+ readonly name: "vcount";
731
+ readonly type: "uint256";
732
+ }, {
733
+ readonly name: "claimed";
734
+ readonly type: "uint256";
735
+ }, {
736
+ readonly name: "stakeDeposit";
737
+ readonly type: "uint256";
738
+ }, {
739
+ readonly name: "stakeWithdrawal";
740
+ readonly type: "uint256";
741
+ }];
742
+ }];
743
+ }, {
744
+ readonly name: "epochMinDuration";
745
+ readonly type: "function";
746
+ readonly stateMutability: "view";
747
+ readonly inputs: readonly [];
748
+ readonly outputs: readonly [{
749
+ readonly name: "";
750
+ readonly type: "uint256";
751
+ }];
752
+ }, {
753
+ readonly name: "epochZeroMinDuration";
754
+ readonly type: "function";
755
+ readonly stateMutability: "view";
756
+ readonly inputs: readonly [];
757
+ readonly outputs: readonly [{
758
+ readonly name: "";
759
+ readonly type: "uint256";
760
+ }];
761
+ }, {
762
+ readonly name: "getQuarantinedValidators";
763
+ readonly type: "function";
764
+ readonly stateMutability: "view";
765
+ readonly inputs: readonly [];
766
+ readonly outputs: readonly [{
767
+ readonly name: "";
768
+ readonly type: "address[]";
769
+ }];
770
+ }, {
771
+ readonly name: "getAllQuarantinedValidators";
772
+ readonly type: "function";
773
+ readonly stateMutability: "view";
774
+ readonly inputs: readonly [{
775
+ readonly name: "_startIndex";
776
+ readonly type: "uint256";
777
+ }, {
778
+ readonly name: "_size";
779
+ readonly type: "uint256";
780
+ }];
781
+ readonly outputs: readonly [{
782
+ readonly name: "validatorList";
783
+ readonly type: "tuple[]";
784
+ readonly components: readonly [{
785
+ readonly name: "validator";
786
+ readonly type: "address";
787
+ }, {
788
+ readonly name: "untilEpochBanned";
789
+ readonly type: "uint256";
790
+ }, {
791
+ readonly name: "permanentlyBanned";
792
+ readonly type: "bool";
793
+ }];
794
+ }];
795
+ }, {
796
+ readonly name: "getAllBannedValidators";
797
+ readonly type: "function";
798
+ readonly stateMutability: "view";
799
+ readonly inputs: readonly [{
800
+ readonly name: "_startIndex";
801
+ readonly type: "uint256";
802
+ }, {
803
+ readonly name: "_size";
804
+ readonly type: "uint256";
805
+ }];
806
+ readonly outputs: readonly [{
807
+ readonly name: "validatorList";
808
+ readonly type: "tuple[]";
809
+ readonly components: readonly [{
810
+ readonly name: "validator";
811
+ readonly type: "address";
812
+ }, {
813
+ readonly name: "untilEpochBanned";
814
+ readonly type: "uint256";
815
+ }, {
816
+ readonly name: "permanentlyBanned";
817
+ readonly type: "bool";
818
+ }];
819
+ }];
820
+ }, {
821
+ readonly name: "validatorDepositLen";
822
+ readonly type: "function";
823
+ readonly stateMutability: "view";
824
+ readonly inputs: readonly [{
825
+ readonly name: "_validator";
826
+ readonly type: "address";
827
+ }];
828
+ readonly outputs: readonly [{
829
+ readonly name: "len_";
830
+ readonly type: "uint256";
831
+ }];
832
+ }, {
833
+ readonly name: "validatorDeposit";
834
+ readonly type: "function";
835
+ readonly stateMutability: "view";
836
+ readonly inputs: readonly [{
837
+ readonly name: "_validator";
838
+ readonly type: "address";
839
+ }, {
840
+ readonly name: "_index";
841
+ readonly type: "uint256";
842
+ }];
843
+ readonly outputs: readonly [{
844
+ readonly name: "epoch_";
845
+ readonly type: "uint256";
846
+ }, {
847
+ readonly name: "commit_";
848
+ readonly type: "tuple";
849
+ readonly components: readonly [{
850
+ readonly name: "input";
851
+ readonly type: "uint256";
852
+ }, {
853
+ readonly name: "output";
854
+ readonly type: "uint256";
855
+ }, {
856
+ readonly name: "epoch";
857
+ readonly type: "uint256";
858
+ }, {
859
+ readonly name: "linkToNextCommit";
860
+ readonly type: "uint256";
861
+ }];
862
+ }];
863
+ }, {
864
+ readonly name: "delegatorDepositLen";
865
+ readonly type: "function";
866
+ readonly stateMutability: "view";
867
+ readonly inputs: readonly [{
868
+ readonly name: "_delegator";
869
+ readonly type: "address";
870
+ }, {
871
+ readonly name: "_validator";
872
+ readonly type: "address";
873
+ }];
874
+ readonly outputs: readonly [{
875
+ readonly name: "";
876
+ readonly type: "uint256";
877
+ }];
878
+ }, {
879
+ readonly name: "delegatorDeposit";
880
+ readonly type: "function";
881
+ readonly stateMutability: "view";
882
+ readonly inputs: readonly [{
883
+ readonly name: "_delegator";
884
+ readonly type: "address";
885
+ }, {
886
+ readonly name: "_validator";
887
+ readonly type: "address";
888
+ }, {
889
+ readonly name: "_index";
890
+ readonly type: "uint256";
891
+ }];
892
+ readonly outputs: readonly [{
893
+ readonly name: "claim_";
894
+ readonly type: "tuple";
895
+ readonly components: readonly [{
896
+ readonly name: "quantity";
897
+ readonly type: "uint256";
898
+ }, {
899
+ readonly name: "commit";
900
+ readonly type: "uint256";
901
+ }];
902
+ }, {
903
+ readonly name: "commit_";
904
+ readonly type: "tuple";
905
+ readonly components: readonly [{
906
+ readonly name: "input";
907
+ readonly type: "uint256";
908
+ }, {
909
+ readonly name: "output";
910
+ readonly type: "uint256";
911
+ }, {
912
+ readonly name: "epoch";
913
+ readonly type: "uint256";
914
+ }, {
915
+ readonly name: "linkToNextCommit";
916
+ readonly type: "uint256";
917
+ }];
918
+ }];
919
+ }, {
920
+ readonly name: "validatorWithdrawalLen";
921
+ readonly type: "function";
922
+ readonly stateMutability: "view";
923
+ readonly inputs: readonly [{
924
+ readonly name: "_validator";
925
+ readonly type: "address";
926
+ }];
927
+ readonly outputs: readonly [{
928
+ readonly name: "len_";
929
+ readonly type: "uint256";
930
+ }];
931
+ }, {
932
+ readonly name: "validatorWithdrawal";
933
+ readonly type: "function";
934
+ readonly stateMutability: "view";
935
+ readonly inputs: readonly [{
936
+ readonly name: "_validator";
937
+ readonly type: "address";
938
+ }, {
939
+ readonly name: "_index";
940
+ readonly type: "uint256";
941
+ }];
942
+ readonly outputs: readonly [{
943
+ readonly name: "epoch_";
944
+ readonly type: "uint256";
945
+ }, {
946
+ readonly name: "commit_";
947
+ readonly type: "tuple";
948
+ readonly components: readonly [{
949
+ readonly name: "input";
950
+ readonly type: "uint256";
951
+ }, {
952
+ readonly name: "output";
953
+ readonly type: "uint256";
954
+ }, {
955
+ readonly name: "epoch";
956
+ readonly type: "uint256";
957
+ }, {
958
+ readonly name: "linkToNextCommit";
959
+ readonly type: "uint256";
960
+ }];
961
+ }];
962
+ }, {
963
+ readonly name: "delegatorWithdrawalLen";
964
+ readonly type: "function";
965
+ readonly stateMutability: "view";
966
+ readonly inputs: readonly [{
967
+ readonly name: "_delegator";
968
+ readonly type: "address";
969
+ }, {
970
+ readonly name: "_validator";
971
+ readonly type: "address";
972
+ }];
973
+ readonly outputs: readonly [{
974
+ readonly name: "";
975
+ readonly type: "uint256";
976
+ }];
977
+ }, {
978
+ readonly name: "delegatorWithdrawal";
979
+ readonly type: "function";
980
+ readonly stateMutability: "view";
981
+ readonly inputs: readonly [{
982
+ readonly name: "_delegator";
983
+ readonly type: "address";
984
+ }, {
985
+ readonly name: "_validator";
986
+ readonly type: "address";
987
+ }, {
988
+ readonly name: "_index";
989
+ readonly type: "uint256";
990
+ }];
991
+ readonly outputs: readonly [{
992
+ readonly name: "claim_";
993
+ readonly type: "tuple";
994
+ readonly components: readonly [{
995
+ readonly name: "quantity";
996
+ readonly type: "uint256";
997
+ }, {
998
+ readonly name: "commit";
999
+ readonly type: "uint256";
1000
+ }];
1001
+ }, {
1002
+ readonly name: "commit_";
1003
+ readonly type: "tuple";
1004
+ readonly components: readonly [{
1005
+ readonly name: "input";
1006
+ readonly type: "uint256";
1007
+ }, {
1008
+ readonly name: "output";
1009
+ readonly type: "uint256";
1010
+ }, {
1011
+ readonly name: "epoch";
1012
+ readonly type: "uint256";
1013
+ }, {
1014
+ readonly name: "linkToNextCommit";
1015
+ readonly type: "uint256";
1016
+ }];
1017
+ }];
1018
+ }, {
1019
+ readonly name: "ValidatorJoin";
1020
+ readonly type: "event";
1021
+ readonly inputs: readonly [{
1022
+ readonly name: "operator";
1023
+ readonly type: "address";
1024
+ readonly indexed: false;
1025
+ }, {
1026
+ readonly name: "validator";
1027
+ readonly type: "address";
1028
+ readonly indexed: false;
1029
+ }, {
1030
+ readonly name: "amount";
1031
+ readonly type: "uint256";
1032
+ readonly indexed: false;
1033
+ }];
1034
+ }, {
1035
+ readonly name: "ValidatorDeposit";
1036
+ readonly type: "event";
1037
+ readonly inputs: readonly [{
1038
+ readonly name: "validator";
1039
+ readonly type: "address";
1040
+ readonly indexed: false;
1041
+ }, {
1042
+ readonly name: "amount";
1043
+ readonly type: "uint256";
1044
+ readonly indexed: false;
1045
+ }];
1046
+ }, {
1047
+ readonly name: "ValidatorExit";
1048
+ readonly type: "event";
1049
+ readonly inputs: readonly [{
1050
+ readonly name: "validator";
1051
+ readonly type: "address";
1052
+ readonly indexed: false;
1053
+ }, {
1054
+ readonly name: "shares";
1055
+ readonly type: "uint256";
1056
+ readonly indexed: false;
1057
+ }];
1058
+ }, {
1059
+ readonly name: "DelegatorJoin";
1060
+ readonly type: "event";
1061
+ readonly inputs: readonly [{
1062
+ readonly name: "delegator";
1063
+ readonly type: "address";
1064
+ readonly indexed: false;
1065
+ }, {
1066
+ readonly name: "validator";
1067
+ readonly type: "address";
1068
+ readonly indexed: false;
1069
+ }, {
1070
+ readonly name: "amount";
1071
+ readonly type: "uint256";
1072
+ readonly indexed: false;
1073
+ }];
1074
+ }];
1075
+
1076
+ type WalletClientWithAccount = Client<Transport, Chain, Account>;
1077
+ type StakingKeyedClient = {
1078
+ public: PublicClient;
1079
+ wallet: WalletClientWithAccount;
1080
+ };
1081
+ type StakingContract = GetContractReturnType<typeof STAKING_ABI, StakingKeyedClient, Address>;
1082
+ interface ValidatorView {
1083
+ left: Address;
1084
+ right: Address;
1085
+ parent: Address;
1086
+ eBanned: bigint;
1087
+ ePrimed: bigint;
1088
+ vStake: bigint;
1089
+ vShares: bigint;
1090
+ dStake: bigint;
1091
+ dShares: bigint;
1092
+ vDeposit: bigint;
1093
+ vWithdrawal: bigint;
1094
+ live: boolean;
1095
+ }
1096
+ interface ValidatorIdentity {
1097
+ moniker: string;
1098
+ logoUri: string;
1099
+ website: string;
1100
+ description: string;
1101
+ email: string;
1102
+ twitter: string;
1103
+ telegram: string;
1104
+ github: string;
1105
+ extraCid: string;
1106
+ }
1107
+ interface ValidatorInfo {
1108
+ address: Address;
1109
+ owner: Address;
1110
+ operator: Address;
1111
+ vStake: string;
1112
+ vStakeRaw: bigint;
1113
+ vShares: bigint;
1114
+ dStake: string;
1115
+ dStakeRaw: bigint;
1116
+ dShares: bigint;
1117
+ vDeposit: string;
1118
+ vDepositRaw: bigint;
1119
+ vWithdrawal: string;
1120
+ vWithdrawalRaw: bigint;
1121
+ ePrimed: bigint;
1122
+ live: boolean;
1123
+ banned: boolean;
1124
+ bannedEpoch?: bigint;
1125
+ needsPriming: boolean;
1126
+ identity?: ValidatorIdentity;
1127
+ pendingDeposits: PendingDeposit[];
1128
+ pendingWithdrawals: PendingWithdrawal[];
1129
+ }
1130
+ interface WithdrawalCommit {
1131
+ input: bigint;
1132
+ output: bigint;
1133
+ epoch: bigint;
1134
+ linkToNextCommit: bigint;
1135
+ }
1136
+ interface PendingDeposit {
1137
+ epoch: bigint;
1138
+ stake: string;
1139
+ stakeRaw: bigint;
1140
+ shares: bigint;
1141
+ }
1142
+ interface PendingWithdrawal {
1143
+ epoch: bigint;
1144
+ shares: bigint;
1145
+ stake: string;
1146
+ stakeRaw: bigint;
1147
+ }
1148
+ interface BannedValidatorInfo {
1149
+ validator: Address;
1150
+ untilEpoch: bigint;
1151
+ permanentlyBanned: boolean;
1152
+ }
1153
+ interface StakeInfo {
1154
+ delegator: Address;
1155
+ validator: Address;
1156
+ shares: bigint;
1157
+ stake: string;
1158
+ stakeRaw: bigint;
1159
+ pendingDeposits: PendingDeposit[];
1160
+ pendingWithdrawals: PendingWithdrawal[];
1161
+ }
1162
+ interface EpochData {
1163
+ start: bigint;
1164
+ end: bigint;
1165
+ inflation: bigint;
1166
+ weight: bigint;
1167
+ weightDeposit: bigint;
1168
+ weightWithdrawal: bigint;
1169
+ vcount: bigint;
1170
+ claimed: bigint;
1171
+ stakeDeposit: bigint;
1172
+ stakeWithdrawal: bigint;
1173
+ }
1174
+ interface EpochInfo {
1175
+ currentEpoch: bigint;
1176
+ validatorMinStake: string;
1177
+ validatorMinStakeRaw: bigint;
1178
+ delegatorMinStake: string;
1179
+ delegatorMinStakeRaw: bigint;
1180
+ activeValidatorsCount: bigint;
1181
+ epochMinDuration: bigint;
1182
+ currentEpochStart: Date;
1183
+ currentEpochEnd: Date | null;
1184
+ nextEpochEstimate: Date | null;
1185
+ inflation: string;
1186
+ inflationRaw: bigint;
1187
+ totalWeight: bigint;
1188
+ totalClaimed: string;
1189
+ totalClaimedRaw: bigint;
1190
+ }
1191
+ interface StakingTransactionResult {
1192
+ transactionHash: `0x${string}`;
1193
+ blockNumber: bigint;
1194
+ gasUsed: bigint;
1195
+ }
1196
+ interface ValidatorJoinResult extends StakingTransactionResult {
1197
+ validatorWallet: Address;
1198
+ operator: Address;
1199
+ amount: string;
1200
+ amountRaw: bigint;
1201
+ }
1202
+ interface DelegatorJoinResult extends StakingTransactionResult {
1203
+ validator: Address;
1204
+ delegator: Address;
1205
+ amount: string;
1206
+ amountRaw: bigint;
1207
+ }
1208
+ interface ValidatorJoinOptions {
1209
+ amount: bigint | string;
1210
+ operator?: Address;
1211
+ }
1212
+ interface ValidatorDepositOptions {
1213
+ amount: bigint | string;
1214
+ }
1215
+ interface ValidatorExitOptions {
1216
+ shares: bigint | string;
1217
+ }
1218
+ interface ValidatorClaimOptions {
1219
+ validator?: Address;
1220
+ }
1221
+ interface ValidatorPrimeOptions {
1222
+ validator: Address;
1223
+ }
1224
+ interface SetOperatorOptions {
1225
+ validator: Address;
1226
+ operator: Address;
1227
+ }
1228
+ interface SetIdentityOptions {
1229
+ validator: Address;
1230
+ moniker: string;
1231
+ logoUri?: string;
1232
+ website?: string;
1233
+ description?: string;
1234
+ email?: string;
1235
+ twitter?: string;
1236
+ telegram?: string;
1237
+ github?: string;
1238
+ extraCid?: string;
1239
+ }
1240
+ interface DelegatorJoinOptions {
1241
+ validator: Address;
1242
+ amount: bigint | string;
1243
+ }
1244
+ interface DelegatorExitOptions {
1245
+ validator: Address;
1246
+ shares: bigint | string;
1247
+ }
1248
+ interface DelegatorClaimOptions {
1249
+ validator: Address;
1250
+ delegator?: Address;
1251
+ }
1252
+ interface StakingActions {
1253
+ validatorJoin: (options: ValidatorJoinOptions) => Promise<ValidatorJoinResult>;
1254
+ validatorDeposit: (options: ValidatorDepositOptions) => Promise<StakingTransactionResult>;
1255
+ validatorExit: (options: ValidatorExitOptions) => Promise<StakingTransactionResult>;
1256
+ validatorClaim: (options?: ValidatorClaimOptions) => Promise<StakingTransactionResult & {
1257
+ claimedAmount: bigint;
1258
+ }>;
1259
+ delegatorJoin: (options: DelegatorJoinOptions) => Promise<DelegatorJoinResult>;
1260
+ delegatorExit: (options: DelegatorExitOptions) => Promise<StakingTransactionResult>;
1261
+ delegatorClaim: (options: DelegatorClaimOptions) => Promise<StakingTransactionResult>;
1262
+ isValidator: (address: Address) => Promise<boolean>;
1263
+ getValidatorInfo: (validator: Address) => Promise<ValidatorInfo>;
1264
+ getStakeInfo: (delegator: Address, validator: Address) => Promise<StakeInfo>;
1265
+ getEpochInfo: () => Promise<EpochInfo>;
1266
+ getActiveValidators: () => Promise<Address[]>;
1267
+ getActiveValidatorsCount: () => Promise<bigint>;
1268
+ getStakingContract: () => StakingContract;
1269
+ parseStakingAmount: (amount: string | bigint) => bigint;
1270
+ formatStakingAmount: (amount: bigint) => string;
1271
+ }
1272
+
1273
+ type GenLayerMethod = {
1274
+ method: "sim_fundAccount";
1275
+ params: [address: Address, amount: number];
1276
+ } | {
1277
+ method: "eth_getTransactionByHash";
1278
+ params: [hash: TransactionHash];
1279
+ } | {
1280
+ method: "eth_call";
1281
+ params: [requestParams: any, blockNumberOrHash: string];
1282
+ } | {
1283
+ method: "eth_sendRawTransaction";
1284
+ params: [signedTransaction: string];
1285
+ } | {
1286
+ method: "gen_getContractSchema";
1287
+ params: [address: Address];
1288
+ } | {
1289
+ method: "gen_getContractSchemaForCode";
1290
+ params: [contractCode: string];
1291
+ } | {
1292
+ method: "gen_getContractCode";
1293
+ params: [address: Address];
1294
+ } | {
1295
+ method: "sim_getTransactionsForAddress";
1296
+ params: [address: Address, filter?: "all" | "from" | "to"];
1297
+ } | {
1298
+ method: "eth_getTransactionCount";
1299
+ params: [address: Address, block: string];
1300
+ } | {
1301
+ method: "eth_estimateGas";
1302
+ params: [transactionParams: any];
1303
+ } | {
1304
+ method: "gen_call";
1305
+ params: [requestParams: any];
1306
+ };
1307
+ type GenLayerClient<TGenLayerChain extends GenLayerChain> = Omit<Client<Transport, TGenLayerChain>, "getTransaction" | "readContract"> & Omit<WalletActions<TGenLayerChain>, "deployContract" | "writeContract"> & Omit<PublicActions<Transport, TGenLayerChain>, "readContract" | "getTransaction" | "waitForTransactionReceipt"> & {
1308
+ request: Client<Transport, TGenLayerChain>["request"] & {
1309
+ <TMethod extends GenLayerMethod>(args: Extract<GenLayerMethod, {
1310
+ method: TMethod["method"];
1311
+ }>): Promise<unknown>;
1312
+ };
1313
+ readContract: <RawReturn extends boolean | undefined>(args: {
1314
+ account?: Account;
1315
+ address: Address;
1316
+ functionName: string;
1317
+ args?: CalldataEncodable[];
1318
+ kwargs?: Map<string, CalldataEncodable> | {
1319
+ [key: string]: CalldataEncodable;
1320
+ };
1321
+ rawReturn?: RawReturn;
1322
+ jsonSafeReturn?: boolean;
1323
+ transactionHashVariant?: TransactionHashVariant;
1324
+ }) => Promise<RawReturn extends true ? `0x${string}` : CalldataEncodable>;
1325
+ writeContract: (args: {
1326
+ account?: Account;
1327
+ address: Address;
1328
+ functionName: string;
1329
+ args?: CalldataEncodable[];
1330
+ kwargs?: Map<string, CalldataEncodable> | {
1331
+ [key: string]: CalldataEncodable;
1332
+ };
1333
+ value: bigint;
1334
+ leaderOnly?: boolean;
1335
+ consensusMaxRotations?: number;
1336
+ }) => Promise<any>;
1337
+ simulateWriteContract: <RawReturn extends boolean | undefined>(args: {
1338
+ account?: Account;
1339
+ address: Address;
1340
+ functionName: string;
1341
+ args?: CalldataEncodable[];
1342
+ kwargs?: Map<string, CalldataEncodable> | {
1343
+ [key: string]: CalldataEncodable;
1344
+ };
1345
+ rawReturn?: RawReturn;
1346
+ leaderOnly?: boolean;
1347
+ transactionHashVariant?: TransactionHashVariant;
1348
+ }) => Promise<RawReturn extends true ? `0x${string}` : CalldataEncodable>;
1349
+ deployContract: (args: {
1350
+ account?: Account;
1351
+ code: string | Uint8Array;
1352
+ args?: CalldataEncodable[];
1353
+ kwargs?: Map<string, CalldataEncodable> | {
1354
+ [key: string]: CalldataEncodable;
1355
+ };
1356
+ leaderOnly?: boolean;
1357
+ consensusMaxRotations?: number;
1358
+ }) => Promise<`0x${string}`>;
1359
+ getTransaction: (args: {
1360
+ hash: TransactionHash;
1361
+ }) => Promise<GenLayerTransaction>;
1362
+ getCurrentNonce: (args: {
1363
+ address: Address;
1364
+ }) => Promise<number>;
1365
+ estimateTransactionGas: (transactionParams: {
1366
+ from?: Address;
1367
+ to: Address;
1368
+ data?: `0x${string}`;
1369
+ value?: bigint;
1370
+ }) => Promise<bigint>;
1371
+ waitForTransactionReceipt: (args: {
1372
+ hash: TransactionHash;
1373
+ status?: TransactionStatus;
1374
+ interval?: number;
1375
+ retries?: number;
1376
+ }) => Promise<GenLayerTransaction>;
1377
+ getContractSchema: (address: Address) => Promise<ContractSchema>;
1378
+ getContractSchemaForCode: (contractCode: string | Uint8Array) => Promise<ContractSchema>;
1379
+ getContractCode: (address: Address) => Promise<string>;
1380
+ initializeConsensusSmartContract: (forceReset?: boolean) => Promise<void>;
1381
+ connect: (network?: Network, snapSource?: SnapSource) => Promise<void>;
1382
+ metamaskClient: (snapSource?: SnapSource) => Promise<MetaMaskClientResult>;
1383
+ appealTransaction: (args: {
1384
+ account?: Account;
1385
+ txId: `0x${string}`;
1386
+ }) => Promise<any>;
1387
+ } & StakingActions;
1388
+
1389
+ export { type SetOperatorOptions as $, type ValidatorView as A, type ValidatorIdentity as B, type CalldataEncodable as C, type DecodedDeployData as D, type ValidatorInfo as E, type PendingWithdrawal as F, type GenLayerClient as G, type Hash as H, type BannedValidatorInfo as I, type StakeInfo as J, type EpochData as K, type EpochInfo as L, type MethodDescription as M, type Network as N, type StakingTransactionResult as O, type PendingDeposit as P, type ValidatorJoinResult as Q, type DelegatorJoinResult as R, STAKING_ABI as S, type TransactionDataElement as T, type ValidatorJoinOptions as U, VALIDATOR_WALLET_ABI as V, type WithdrawalCommit as W, type ValidatorDepositOptions as X, type ValidatorExitOptions as Y, type ValidatorClaimOptions as Z, type ValidatorPrimeOptions as _, type DecodedCallData as a, type SetIdentityOptions as a0, type DelegatorJoinOptions as a1, type DelegatorExitOptions as a2, type DelegatorClaimOptions as a3, type StakingActions as a4, type GenLayerRawTransaction as b, type GenLayerTransaction as c, CalldataAddress as d, type GenLayerMethod as e, type ContractParamsArraySchemaElement as f, type ContractParamsSchema as g, type ContractMethodBase as h, type ContractMethod as i, type ContractSchema as j, type TransactionHash as k, TransactionStatus as l, TransactionResult as m, transactionsStatusNameToNumber as n, DECIDED_STATES as o, isDecidedState as p, transactionResultNumberToName as q, TransactionResultNameToNumber as r, VoteType as s, transactionsStatusNumberToName as t, voteTypeNameToNumber as u, voteTypeNumberToName as v, type TransactionType as w, TransactionHashVariant as x, type SnapSource as y, type StakingContract as z };