@gitmyabi/gravity 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.
@@ -0,0 +1,1124 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * ValsetArgs struct type
4
+ */
5
+ export type ValsetArgs = {
6
+ validators: `0x${string}`[];
7
+ powers: bigint[];
8
+ valsetNonce: bigint;
9
+ rewardAmount: bigint;
10
+ rewardToken: `0x${string}`;
11
+ };
12
+ /**
13
+ * Signature struct type
14
+ */
15
+ export type Signature = {
16
+ v: bigint;
17
+ r: `0x${string}`;
18
+ s: `0x${string}`;
19
+ };
20
+ /**
21
+ * LogicCallArgs struct type
22
+ */
23
+ export type LogicCallArgs = {
24
+ transferAmounts: bigint[];
25
+ transferTokenContracts: `0x${string}`[];
26
+ feeAmounts: bigint[];
27
+ feeTokenContracts: `0x${string}`[];
28
+ logicContractAddress: `0x${string}`;
29
+ payload: `0x${string}`;
30
+ timeOut: bigint;
31
+ invalidationId: `0x${string}`;
32
+ invalidationNonce: bigint;
33
+ };
34
+ /**
35
+ * Gravity_json ABI
36
+ *
37
+ * This ABI is typed using viem's type system for full type safety.
38
+ */
39
+ export declare const Gravity_jsonAbi: readonly [{
40
+ readonly inputs: readonly [{
41
+ readonly internalType: "bytes32";
42
+ readonly name: "_gravityId";
43
+ readonly type: "bytes32";
44
+ }, {
45
+ readonly internalType: "address[]";
46
+ readonly name: "_validators";
47
+ readonly type: "address[]";
48
+ }, {
49
+ readonly internalType: "uint256[]";
50
+ readonly name: "_powers";
51
+ readonly type: "uint256[]";
52
+ }];
53
+ readonly stateMutability: "nonpayable";
54
+ readonly type: "constructor";
55
+ }, {
56
+ readonly inputs: readonly [];
57
+ readonly name: "BatchTimedOut";
58
+ readonly type: "error";
59
+ }, {
60
+ readonly inputs: readonly [];
61
+ readonly name: "IncorrectCheckpoint";
62
+ readonly type: "error";
63
+ }, {
64
+ readonly inputs: readonly [{
65
+ readonly internalType: "uint256";
66
+ readonly name: "cumulativePower";
67
+ readonly type: "uint256";
68
+ }, {
69
+ readonly internalType: "uint256";
70
+ readonly name: "powerThreshold";
71
+ readonly type: "uint256";
72
+ }];
73
+ readonly name: "InsufficientPower";
74
+ readonly type: "error";
75
+ }, {
76
+ readonly inputs: readonly [{
77
+ readonly internalType: "uint256";
78
+ readonly name: "newNonce";
79
+ readonly type: "uint256";
80
+ }, {
81
+ readonly internalType: "uint256";
82
+ readonly name: "currentNonce";
83
+ readonly type: "uint256";
84
+ }];
85
+ readonly name: "InvalidBatchNonce";
86
+ readonly type: "error";
87
+ }, {
88
+ readonly inputs: readonly [];
89
+ readonly name: "InvalidLogicCallFees";
90
+ readonly type: "error";
91
+ }, {
92
+ readonly inputs: readonly [{
93
+ readonly internalType: "uint256";
94
+ readonly name: "newNonce";
95
+ readonly type: "uint256";
96
+ }, {
97
+ readonly internalType: "uint256";
98
+ readonly name: "currentNonce";
99
+ readonly type: "uint256";
100
+ }];
101
+ readonly name: "InvalidLogicCallNonce";
102
+ readonly type: "error";
103
+ }, {
104
+ readonly inputs: readonly [];
105
+ readonly name: "InvalidLogicCallTransfers";
106
+ readonly type: "error";
107
+ }, {
108
+ readonly inputs: readonly [];
109
+ readonly name: "InvalidSendToCosmos";
110
+ readonly type: "error";
111
+ }, {
112
+ readonly inputs: readonly [];
113
+ readonly name: "InvalidSignature";
114
+ readonly type: "error";
115
+ }, {
116
+ readonly inputs: readonly [{
117
+ readonly internalType: "uint256";
118
+ readonly name: "newNonce";
119
+ readonly type: "uint256";
120
+ }, {
121
+ readonly internalType: "uint256";
122
+ readonly name: "currentNonce";
123
+ readonly type: "uint256";
124
+ }];
125
+ readonly name: "InvalidValsetNonce";
126
+ readonly type: "error";
127
+ }, {
128
+ readonly inputs: readonly [];
129
+ readonly name: "LogicCallTimedOut";
130
+ readonly type: "error";
131
+ }, {
132
+ readonly inputs: readonly [];
133
+ readonly name: "MalformedBatch";
134
+ readonly type: "error";
135
+ }, {
136
+ readonly inputs: readonly [];
137
+ readonly name: "MalformedCurrentValidatorSet";
138
+ readonly type: "error";
139
+ }, {
140
+ readonly inputs: readonly [];
141
+ readonly name: "MalformedNewValidatorSet";
142
+ readonly type: "error";
143
+ }, {
144
+ readonly anonymous: false;
145
+ readonly inputs: readonly [{
146
+ readonly indexed: false;
147
+ readonly internalType: "string";
148
+ readonly name: "_cosmosDenom";
149
+ readonly type: "string";
150
+ }, {
151
+ readonly indexed: true;
152
+ readonly internalType: "address";
153
+ readonly name: "_tokenContract";
154
+ readonly type: "address";
155
+ }, {
156
+ readonly indexed: false;
157
+ readonly internalType: "string";
158
+ readonly name: "_name";
159
+ readonly type: "string";
160
+ }, {
161
+ readonly indexed: false;
162
+ readonly internalType: "string";
163
+ readonly name: "_symbol";
164
+ readonly type: "string";
165
+ }, {
166
+ readonly indexed: false;
167
+ readonly internalType: "uint8";
168
+ readonly name: "_decimals";
169
+ readonly type: "uint8";
170
+ }, {
171
+ readonly indexed: false;
172
+ readonly internalType: "uint256";
173
+ readonly name: "_eventNonce";
174
+ readonly type: "uint256";
175
+ }];
176
+ readonly name: "ERC20DeployedEvent";
177
+ readonly type: "event";
178
+ }, {
179
+ readonly anonymous: false;
180
+ readonly inputs: readonly [{
181
+ readonly indexed: false;
182
+ readonly internalType: "bytes32";
183
+ readonly name: "_invalidationId";
184
+ readonly type: "bytes32";
185
+ }, {
186
+ readonly indexed: false;
187
+ readonly internalType: "uint256";
188
+ readonly name: "_invalidationNonce";
189
+ readonly type: "uint256";
190
+ }, {
191
+ readonly indexed: false;
192
+ readonly internalType: "bytes";
193
+ readonly name: "_returnData";
194
+ readonly type: "bytes";
195
+ }, {
196
+ readonly indexed: false;
197
+ readonly internalType: "uint256";
198
+ readonly name: "_eventNonce";
199
+ readonly type: "uint256";
200
+ }];
201
+ readonly name: "LogicCallEvent";
202
+ readonly type: "event";
203
+ }, {
204
+ readonly anonymous: false;
205
+ readonly inputs: readonly [{
206
+ readonly indexed: true;
207
+ readonly internalType: "address";
208
+ readonly name: "_tokenContract";
209
+ readonly type: "address";
210
+ }, {
211
+ readonly indexed: true;
212
+ readonly internalType: "address";
213
+ readonly name: "_sender";
214
+ readonly type: "address";
215
+ }, {
216
+ readonly indexed: false;
217
+ readonly internalType: "string";
218
+ readonly name: "_destination";
219
+ readonly type: "string";
220
+ }, {
221
+ readonly indexed: false;
222
+ readonly internalType: "uint256";
223
+ readonly name: "_amount";
224
+ readonly type: "uint256";
225
+ }, {
226
+ readonly indexed: false;
227
+ readonly internalType: "uint256";
228
+ readonly name: "_eventNonce";
229
+ readonly type: "uint256";
230
+ }];
231
+ readonly name: "SendToCosmosEvent";
232
+ readonly type: "event";
233
+ }, {
234
+ readonly anonymous: false;
235
+ readonly inputs: readonly [{
236
+ readonly indexed: true;
237
+ readonly internalType: "uint256";
238
+ readonly name: "_batchNonce";
239
+ readonly type: "uint256";
240
+ }, {
241
+ readonly indexed: true;
242
+ readonly internalType: "address";
243
+ readonly name: "_token";
244
+ readonly type: "address";
245
+ }, {
246
+ readonly indexed: false;
247
+ readonly internalType: "uint256";
248
+ readonly name: "_eventNonce";
249
+ readonly type: "uint256";
250
+ }];
251
+ readonly name: "TransactionBatchExecutedEvent";
252
+ readonly type: "event";
253
+ }, {
254
+ readonly anonymous: false;
255
+ readonly inputs: readonly [{
256
+ readonly indexed: true;
257
+ readonly internalType: "uint256";
258
+ readonly name: "_newValsetNonce";
259
+ readonly type: "uint256";
260
+ }, {
261
+ readonly indexed: false;
262
+ readonly internalType: "uint256";
263
+ readonly name: "_eventNonce";
264
+ readonly type: "uint256";
265
+ }, {
266
+ readonly indexed: false;
267
+ readonly internalType: "uint256";
268
+ readonly name: "_rewardAmount";
269
+ readonly type: "uint256";
270
+ }, {
271
+ readonly indexed: false;
272
+ readonly internalType: "address";
273
+ readonly name: "_rewardToken";
274
+ readonly type: "address";
275
+ }, {
276
+ readonly indexed: false;
277
+ readonly internalType: "address[]";
278
+ readonly name: "_validators";
279
+ readonly type: "address[]";
280
+ }, {
281
+ readonly indexed: false;
282
+ readonly internalType: "uint256[]";
283
+ readonly name: "_powers";
284
+ readonly type: "uint256[]";
285
+ }];
286
+ readonly name: "ValsetUpdatedEvent";
287
+ readonly type: "event";
288
+ }, {
289
+ readonly inputs: readonly [{
290
+ readonly internalType: "string";
291
+ readonly name: "_cosmosDenom";
292
+ readonly type: "string";
293
+ }, {
294
+ readonly internalType: "string";
295
+ readonly name: "_name";
296
+ readonly type: "string";
297
+ }, {
298
+ readonly internalType: "string";
299
+ readonly name: "_symbol";
300
+ readonly type: "string";
301
+ }, {
302
+ readonly internalType: "uint8";
303
+ readonly name: "_decimals";
304
+ readonly type: "uint8";
305
+ }];
306
+ readonly name: "deployERC20";
307
+ readonly outputs: readonly [];
308
+ readonly stateMutability: "nonpayable";
309
+ readonly type: "function";
310
+ }, {
311
+ readonly inputs: readonly [{
312
+ readonly internalType: "address";
313
+ readonly name: "_erc20Address";
314
+ readonly type: "address";
315
+ }];
316
+ readonly name: "lastBatchNonce";
317
+ readonly outputs: readonly [{
318
+ readonly internalType: "uint256";
319
+ readonly name: "";
320
+ readonly type: "uint256";
321
+ }];
322
+ readonly stateMutability: "view";
323
+ readonly type: "function";
324
+ }, {
325
+ readonly inputs: readonly [{
326
+ readonly internalType: "bytes32";
327
+ readonly name: "_invalidation_id";
328
+ readonly type: "bytes32";
329
+ }];
330
+ readonly name: "lastLogicCallNonce";
331
+ readonly outputs: readonly [{
332
+ readonly internalType: "uint256";
333
+ readonly name: "";
334
+ readonly type: "uint256";
335
+ }];
336
+ readonly stateMutability: "view";
337
+ readonly type: "function";
338
+ }, {
339
+ readonly inputs: readonly [{
340
+ readonly internalType: "address";
341
+ readonly name: "_tokenContract";
342
+ readonly type: "address";
343
+ }, {
344
+ readonly internalType: "string";
345
+ readonly name: "_destination";
346
+ readonly type: "string";
347
+ }, {
348
+ readonly internalType: "uint256";
349
+ readonly name: "_amount";
350
+ readonly type: "uint256";
351
+ }];
352
+ readonly name: "sendToCosmos";
353
+ readonly outputs: readonly [];
354
+ readonly stateMutability: "nonpayable";
355
+ readonly type: "function";
356
+ }, {
357
+ readonly inputs: readonly [];
358
+ readonly name: "state_gravityId";
359
+ readonly outputs: readonly [{
360
+ readonly internalType: "bytes32";
361
+ readonly name: "";
362
+ readonly type: "bytes32";
363
+ }];
364
+ readonly stateMutability: "view";
365
+ readonly type: "function";
366
+ }, {
367
+ readonly inputs: readonly [{
368
+ readonly internalType: "bytes32";
369
+ readonly name: "";
370
+ readonly type: "bytes32";
371
+ }];
372
+ readonly name: "state_invalidationMapping";
373
+ readonly outputs: readonly [{
374
+ readonly internalType: "uint256";
375
+ readonly name: "";
376
+ readonly type: "uint256";
377
+ }];
378
+ readonly stateMutability: "view";
379
+ readonly type: "function";
380
+ }, {
381
+ readonly inputs: readonly [{
382
+ readonly internalType: "address";
383
+ readonly name: "";
384
+ readonly type: "address";
385
+ }];
386
+ readonly name: "state_lastBatchNonces";
387
+ readonly outputs: readonly [{
388
+ readonly internalType: "uint256";
389
+ readonly name: "";
390
+ readonly type: "uint256";
391
+ }];
392
+ readonly stateMutability: "view";
393
+ readonly type: "function";
394
+ }, {
395
+ readonly inputs: readonly [];
396
+ readonly name: "state_lastEventNonce";
397
+ readonly outputs: readonly [{
398
+ readonly internalType: "uint256";
399
+ readonly name: "";
400
+ readonly type: "uint256";
401
+ }];
402
+ readonly stateMutability: "view";
403
+ readonly type: "function";
404
+ }, {
405
+ readonly inputs: readonly [];
406
+ readonly name: "state_lastValsetCheckpoint";
407
+ readonly outputs: readonly [{
408
+ readonly internalType: "bytes32";
409
+ readonly name: "";
410
+ readonly type: "bytes32";
411
+ }];
412
+ readonly stateMutability: "view";
413
+ readonly type: "function";
414
+ }, {
415
+ readonly inputs: readonly [];
416
+ readonly name: "state_lastValsetNonce";
417
+ readonly outputs: readonly [{
418
+ readonly internalType: "uint256";
419
+ readonly name: "";
420
+ readonly type: "uint256";
421
+ }];
422
+ readonly stateMutability: "view";
423
+ readonly type: "function";
424
+ }, {
425
+ readonly inputs: readonly [{
426
+ readonly components: readonly [{
427
+ readonly internalType: "address[]";
428
+ readonly name: "validators";
429
+ readonly type: "address[]";
430
+ }, {
431
+ readonly internalType: "uint256[]";
432
+ readonly name: "powers";
433
+ readonly type: "uint256[]";
434
+ }, {
435
+ readonly internalType: "uint256";
436
+ readonly name: "valsetNonce";
437
+ readonly type: "uint256";
438
+ }, {
439
+ readonly internalType: "uint256";
440
+ readonly name: "rewardAmount";
441
+ readonly type: "uint256";
442
+ }, {
443
+ readonly internalType: "address";
444
+ readonly name: "rewardToken";
445
+ readonly type: "address";
446
+ }];
447
+ readonly internalType: "struct ValsetArgs";
448
+ readonly name: "_currentValset";
449
+ readonly type: "tuple";
450
+ }, {
451
+ readonly components: readonly [{
452
+ readonly internalType: "uint8";
453
+ readonly name: "v";
454
+ readonly type: "uint8";
455
+ }, {
456
+ readonly internalType: "bytes32";
457
+ readonly name: "r";
458
+ readonly type: "bytes32";
459
+ }, {
460
+ readonly internalType: "bytes32";
461
+ readonly name: "s";
462
+ readonly type: "bytes32";
463
+ }];
464
+ readonly internalType: "struct Signature[]";
465
+ readonly name: "_sigs";
466
+ readonly type: "tuple[]";
467
+ }, {
468
+ readonly internalType: "uint256[]";
469
+ readonly name: "_amounts";
470
+ readonly type: "uint256[]";
471
+ }, {
472
+ readonly internalType: "address[]";
473
+ readonly name: "_destinations";
474
+ readonly type: "address[]";
475
+ }, {
476
+ readonly internalType: "uint256[]";
477
+ readonly name: "_fees";
478
+ readonly type: "uint256[]";
479
+ }, {
480
+ readonly internalType: "uint256";
481
+ readonly name: "_batchNonce";
482
+ readonly type: "uint256";
483
+ }, {
484
+ readonly internalType: "address";
485
+ readonly name: "_tokenContract";
486
+ readonly type: "address";
487
+ }, {
488
+ readonly internalType: "uint256";
489
+ readonly name: "_batchTimeout";
490
+ readonly type: "uint256";
491
+ }];
492
+ readonly name: "submitBatch";
493
+ readonly outputs: readonly [];
494
+ readonly stateMutability: "nonpayable";
495
+ readonly type: "function";
496
+ }, {
497
+ readonly inputs: readonly [{
498
+ readonly components: readonly [{
499
+ readonly internalType: "address[]";
500
+ readonly name: "validators";
501
+ readonly type: "address[]";
502
+ }, {
503
+ readonly internalType: "uint256[]";
504
+ readonly name: "powers";
505
+ readonly type: "uint256[]";
506
+ }, {
507
+ readonly internalType: "uint256";
508
+ readonly name: "valsetNonce";
509
+ readonly type: "uint256";
510
+ }, {
511
+ readonly internalType: "uint256";
512
+ readonly name: "rewardAmount";
513
+ readonly type: "uint256";
514
+ }, {
515
+ readonly internalType: "address";
516
+ readonly name: "rewardToken";
517
+ readonly type: "address";
518
+ }];
519
+ readonly internalType: "struct ValsetArgs";
520
+ readonly name: "_currentValset";
521
+ readonly type: "tuple";
522
+ }, {
523
+ readonly components: readonly [{
524
+ readonly internalType: "uint8";
525
+ readonly name: "v";
526
+ readonly type: "uint8";
527
+ }, {
528
+ readonly internalType: "bytes32";
529
+ readonly name: "r";
530
+ readonly type: "bytes32";
531
+ }, {
532
+ readonly internalType: "bytes32";
533
+ readonly name: "s";
534
+ readonly type: "bytes32";
535
+ }];
536
+ readonly internalType: "struct Signature[]";
537
+ readonly name: "_sigs";
538
+ readonly type: "tuple[]";
539
+ }, {
540
+ readonly components: readonly [{
541
+ readonly internalType: "uint256[]";
542
+ readonly name: "transferAmounts";
543
+ readonly type: "uint256[]";
544
+ }, {
545
+ readonly internalType: "address[]";
546
+ readonly name: "transferTokenContracts";
547
+ readonly type: "address[]";
548
+ }, {
549
+ readonly internalType: "uint256[]";
550
+ readonly name: "feeAmounts";
551
+ readonly type: "uint256[]";
552
+ }, {
553
+ readonly internalType: "address[]";
554
+ readonly name: "feeTokenContracts";
555
+ readonly type: "address[]";
556
+ }, {
557
+ readonly internalType: "address";
558
+ readonly name: "logicContractAddress";
559
+ readonly type: "address";
560
+ }, {
561
+ readonly internalType: "bytes";
562
+ readonly name: "payload";
563
+ readonly type: "bytes";
564
+ }, {
565
+ readonly internalType: "uint256";
566
+ readonly name: "timeOut";
567
+ readonly type: "uint256";
568
+ }, {
569
+ readonly internalType: "bytes32";
570
+ readonly name: "invalidationId";
571
+ readonly type: "bytes32";
572
+ }, {
573
+ readonly internalType: "uint256";
574
+ readonly name: "invalidationNonce";
575
+ readonly type: "uint256";
576
+ }];
577
+ readonly internalType: "struct LogicCallArgs";
578
+ readonly name: "_args";
579
+ readonly type: "tuple";
580
+ }];
581
+ readonly name: "submitLogicCall";
582
+ readonly outputs: readonly [];
583
+ readonly stateMutability: "nonpayable";
584
+ readonly type: "function";
585
+ }, {
586
+ readonly inputs: readonly [{
587
+ readonly components: readonly [{
588
+ readonly internalType: "address[]";
589
+ readonly name: "validators";
590
+ readonly type: "address[]";
591
+ }, {
592
+ readonly internalType: "uint256[]";
593
+ readonly name: "powers";
594
+ readonly type: "uint256[]";
595
+ }, {
596
+ readonly internalType: "uint256";
597
+ readonly name: "valsetNonce";
598
+ readonly type: "uint256";
599
+ }, {
600
+ readonly internalType: "uint256";
601
+ readonly name: "rewardAmount";
602
+ readonly type: "uint256";
603
+ }, {
604
+ readonly internalType: "address";
605
+ readonly name: "rewardToken";
606
+ readonly type: "address";
607
+ }];
608
+ readonly internalType: "struct ValsetArgs";
609
+ readonly name: "_currentValset";
610
+ readonly type: "tuple";
611
+ }, {
612
+ readonly components: readonly [{
613
+ readonly internalType: "uint8";
614
+ readonly name: "v";
615
+ readonly type: "uint8";
616
+ }, {
617
+ readonly internalType: "bytes32";
618
+ readonly name: "r";
619
+ readonly type: "bytes32";
620
+ }, {
621
+ readonly internalType: "bytes32";
622
+ readonly name: "s";
623
+ readonly type: "bytes32";
624
+ }];
625
+ readonly internalType: "struct Signature[]";
626
+ readonly name: "_sigs";
627
+ readonly type: "tuple[]";
628
+ }, {
629
+ readonly internalType: "bytes32";
630
+ readonly name: "_theHash";
631
+ readonly type: "bytes32";
632
+ }, {
633
+ readonly internalType: "uint256";
634
+ readonly name: "_powerThreshold";
635
+ readonly type: "uint256";
636
+ }];
637
+ readonly name: "testCheckValidatorSignatures";
638
+ readonly outputs: readonly [];
639
+ readonly stateMutability: "pure";
640
+ readonly type: "function";
641
+ }, {
642
+ readonly inputs: readonly [{
643
+ readonly components: readonly [{
644
+ readonly internalType: "address[]";
645
+ readonly name: "validators";
646
+ readonly type: "address[]";
647
+ }, {
648
+ readonly internalType: "uint256[]";
649
+ readonly name: "powers";
650
+ readonly type: "uint256[]";
651
+ }, {
652
+ readonly internalType: "uint256";
653
+ readonly name: "valsetNonce";
654
+ readonly type: "uint256";
655
+ }, {
656
+ readonly internalType: "uint256";
657
+ readonly name: "rewardAmount";
658
+ readonly type: "uint256";
659
+ }, {
660
+ readonly internalType: "address";
661
+ readonly name: "rewardToken";
662
+ readonly type: "address";
663
+ }];
664
+ readonly internalType: "struct ValsetArgs";
665
+ readonly name: "_valsetArgs";
666
+ readonly type: "tuple";
667
+ }, {
668
+ readonly internalType: "bytes32";
669
+ readonly name: "_gravityId";
670
+ readonly type: "bytes32";
671
+ }];
672
+ readonly name: "testMakeCheckpoint";
673
+ readonly outputs: readonly [];
674
+ readonly stateMutability: "pure";
675
+ readonly type: "function";
676
+ }, {
677
+ readonly inputs: readonly [{
678
+ readonly components: readonly [{
679
+ readonly internalType: "address[]";
680
+ readonly name: "validators";
681
+ readonly type: "address[]";
682
+ }, {
683
+ readonly internalType: "uint256[]";
684
+ readonly name: "powers";
685
+ readonly type: "uint256[]";
686
+ }, {
687
+ readonly internalType: "uint256";
688
+ readonly name: "valsetNonce";
689
+ readonly type: "uint256";
690
+ }, {
691
+ readonly internalType: "uint256";
692
+ readonly name: "rewardAmount";
693
+ readonly type: "uint256";
694
+ }, {
695
+ readonly internalType: "address";
696
+ readonly name: "rewardToken";
697
+ readonly type: "address";
698
+ }];
699
+ readonly internalType: "struct ValsetArgs";
700
+ readonly name: "_newValset";
701
+ readonly type: "tuple";
702
+ }, {
703
+ readonly components: readonly [{
704
+ readonly internalType: "address[]";
705
+ readonly name: "validators";
706
+ readonly type: "address[]";
707
+ }, {
708
+ readonly internalType: "uint256[]";
709
+ readonly name: "powers";
710
+ readonly type: "uint256[]";
711
+ }, {
712
+ readonly internalType: "uint256";
713
+ readonly name: "valsetNonce";
714
+ readonly type: "uint256";
715
+ }, {
716
+ readonly internalType: "uint256";
717
+ readonly name: "rewardAmount";
718
+ readonly type: "uint256";
719
+ }, {
720
+ readonly internalType: "address";
721
+ readonly name: "rewardToken";
722
+ readonly type: "address";
723
+ }];
724
+ readonly internalType: "struct ValsetArgs";
725
+ readonly name: "_currentValset";
726
+ readonly type: "tuple";
727
+ }, {
728
+ readonly components: readonly [{
729
+ readonly internalType: "uint8";
730
+ readonly name: "v";
731
+ readonly type: "uint8";
732
+ }, {
733
+ readonly internalType: "bytes32";
734
+ readonly name: "r";
735
+ readonly type: "bytes32";
736
+ }, {
737
+ readonly internalType: "bytes32";
738
+ readonly name: "s";
739
+ readonly type: "bytes32";
740
+ }];
741
+ readonly internalType: "struct Signature[]";
742
+ readonly name: "_sigs";
743
+ readonly type: "tuple[]";
744
+ }];
745
+ readonly name: "updateValset";
746
+ readonly outputs: readonly [];
747
+ readonly stateMutability: "nonpayable";
748
+ readonly type: "function";
749
+ }];
750
+ /**
751
+ * Type-safe ABI for Gravity_json
752
+ */
753
+ export type Gravity_jsonAbi = typeof Gravity_jsonAbi;
754
+ /**
755
+ * Contract instance type for Gravity_json
756
+ */
757
+ export type Gravity_jsonContract = any;
758
+ /**
759
+ * Gravity_json Contract Class
760
+ *
761
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
762
+ *
763
+ * @example
764
+ * ```typescript
765
+ * import { createPublicClient, createWalletClient, http } from 'viem';
766
+ * import { mainnet } from 'viem/chains';
767
+ * import { Gravity_json } from 'Gravity_json';
768
+ *
769
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
770
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
771
+ *
772
+ * const contract = new Gravity_json('0x...', { publicClient, walletClient });
773
+ *
774
+ * // Read functions
775
+ * const result = await contract.balanceOf('0x...');
776
+ *
777
+ * // Write functions
778
+ * const hash = await contract.transfer('0x...', 1000n);
779
+ *
780
+ * // Simulate transactions (dry-run)
781
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
782
+ * console.log('Gas estimate:', simulation.request.gas);
783
+ *
784
+ * // Watch events
785
+ * const unwatch = contract.watch.Transfer((event) => {
786
+ * console.log('Transfer event:', event);
787
+ * });
788
+ * ```
789
+ */
790
+ export declare class Gravity_json {
791
+ private contract;
792
+ private contractAddress;
793
+ private publicClient;
794
+ constructor(address: Address, clients: {
795
+ publicClient: PublicClient;
796
+ walletClient?: WalletClient;
797
+ });
798
+ /**
799
+ * Get the contract address
800
+ */
801
+ get address(): Address;
802
+ /**
803
+ * Get the underlying viem contract instance
804
+ */
805
+ getContract(): Gravity_jsonContract;
806
+ /**
807
+ * lastBatchNonce
808
+ * view
809
+ */
810
+ lastBatchNonce(_erc20Address: `0x${string}`): Promise<bigint>;
811
+ /**
812
+ * lastLogicCallNonce
813
+ * view
814
+ */
815
+ lastLogicCallNonce(_invalidation_id: `0x${string}`): Promise<bigint>;
816
+ /**
817
+ * state_gravityId
818
+ * view
819
+ */
820
+ state_gravityId(): Promise<`0x${string}`>;
821
+ /**
822
+ * state_invalidationMapping
823
+ * view
824
+ */
825
+ state_invalidationMapping(arg0: `0x${string}`): Promise<bigint>;
826
+ /**
827
+ * state_lastBatchNonces
828
+ * view
829
+ */
830
+ state_lastBatchNonces(arg0: `0x${string}`): Promise<bigint>;
831
+ /**
832
+ * state_lastEventNonce
833
+ * view
834
+ */
835
+ state_lastEventNonce(): Promise<bigint>;
836
+ /**
837
+ * state_lastValsetCheckpoint
838
+ * view
839
+ */
840
+ state_lastValsetCheckpoint(): Promise<`0x${string}`>;
841
+ /**
842
+ * state_lastValsetNonce
843
+ * view
844
+ */
845
+ state_lastValsetNonce(): Promise<bigint>;
846
+ /**
847
+ * testCheckValidatorSignatures
848
+ * pure
849
+ */
850
+ testCheckValidatorSignatures(_currentValset: ValsetArgs, _sigs: Signature[], _theHash: `0x${string}`, _powerThreshold: bigint): Promise<void>;
851
+ /**
852
+ * testMakeCheckpoint
853
+ * pure
854
+ */
855
+ testMakeCheckpoint(_valsetArgs: ValsetArgs, _gravityId: `0x${string}`): Promise<void>;
856
+ /**
857
+ * deployERC20
858
+ * nonpayable
859
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
860
+ */
861
+ deployERC20(_cosmosDenom: string, _name: string, _symbol: string, _decimals: bigint, options?: {
862
+ accessList?: import('viem').AccessList;
863
+ authorizationList?: import('viem').AuthorizationList;
864
+ chain?: import('viem').Chain | null;
865
+ dataSuffix?: `0x${string}`;
866
+ gas?: bigint;
867
+ gasPrice?: bigint;
868
+ maxFeePerGas?: bigint;
869
+ maxPriorityFeePerGas?: bigint;
870
+ nonce?: number;
871
+ value?: bigint;
872
+ }): Promise<`0x${string}`>;
873
+ /**
874
+ * sendToCosmos
875
+ * nonpayable
876
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
877
+ */
878
+ sendToCosmos(_tokenContract: `0x${string}`, _destination: string, _amount: bigint, options?: {
879
+ accessList?: import('viem').AccessList;
880
+ authorizationList?: import('viem').AuthorizationList;
881
+ chain?: import('viem').Chain | null;
882
+ dataSuffix?: `0x${string}`;
883
+ gas?: bigint;
884
+ gasPrice?: bigint;
885
+ maxFeePerGas?: bigint;
886
+ maxPriorityFeePerGas?: bigint;
887
+ nonce?: number;
888
+ value?: bigint;
889
+ }): Promise<`0x${string}`>;
890
+ /**
891
+ * submitBatch
892
+ * nonpayable
893
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
894
+ */
895
+ submitBatch(_currentValset: ValsetArgs, _sigs: Signature[], _amounts: bigint[], _destinations: `0x${string}`[], _fees: bigint[], _batchNonce: bigint, _tokenContract: `0x${string}`, _batchTimeout: bigint, options?: {
896
+ accessList?: import('viem').AccessList;
897
+ authorizationList?: import('viem').AuthorizationList;
898
+ chain?: import('viem').Chain | null;
899
+ dataSuffix?: `0x${string}`;
900
+ gas?: bigint;
901
+ gasPrice?: bigint;
902
+ maxFeePerGas?: bigint;
903
+ maxPriorityFeePerGas?: bigint;
904
+ nonce?: number;
905
+ value?: bigint;
906
+ }): Promise<`0x${string}`>;
907
+ /**
908
+ * submitLogicCall
909
+ * nonpayable
910
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
911
+ */
912
+ submitLogicCall(_currentValset: ValsetArgs, _sigs: Signature[], _args: LogicCallArgs, options?: {
913
+ accessList?: import('viem').AccessList;
914
+ authorizationList?: import('viem').AuthorizationList;
915
+ chain?: import('viem').Chain | null;
916
+ dataSuffix?: `0x${string}`;
917
+ gas?: bigint;
918
+ gasPrice?: bigint;
919
+ maxFeePerGas?: bigint;
920
+ maxPriorityFeePerGas?: bigint;
921
+ nonce?: number;
922
+ value?: bigint;
923
+ }): Promise<`0x${string}`>;
924
+ /**
925
+ * updateValset
926
+ * nonpayable
927
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
928
+ */
929
+ updateValset(_newValset: ValsetArgs, _currentValset: ValsetArgs, _sigs: Signature[], options?: {
930
+ accessList?: import('viem').AccessList;
931
+ authorizationList?: import('viem').AuthorizationList;
932
+ chain?: import('viem').Chain | null;
933
+ dataSuffix?: `0x${string}`;
934
+ gas?: bigint;
935
+ gasPrice?: bigint;
936
+ maxFeePerGas?: bigint;
937
+ maxPriorityFeePerGas?: bigint;
938
+ nonce?: number;
939
+ value?: bigint;
940
+ }): Promise<`0x${string}`>;
941
+ /**
942
+ * Simulate contract write operations (dry-run without sending transaction)
943
+ *
944
+ * @example
945
+ * const result = await contract.simulate.transfer('0x...', 1000n);
946
+ * console.log('Gas estimate:', result.request.gas);
947
+ * console.log('Would succeed:', result.result);
948
+ */
949
+ get simulate(): {
950
+ /**
951
+ * Simulate deployERC20
952
+ * Returns gas estimate and result without sending transaction
953
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
954
+ */
955
+ deployERC20(_cosmosDenom: string, _name: string, _symbol: string, _decimals: bigint, options?: {
956
+ accessList?: import("viem").AccessList;
957
+ authorizationList?: import("viem").AuthorizationList;
958
+ chain?: import("viem").Chain | null;
959
+ dataSuffix?: `0x${string}`;
960
+ gas?: bigint;
961
+ gasPrice?: bigint;
962
+ maxFeePerGas?: bigint;
963
+ maxPriorityFeePerGas?: bigint;
964
+ nonce?: number;
965
+ value?: bigint;
966
+ }): Promise<void>;
967
+ /**
968
+ * Simulate sendToCosmos
969
+ * Returns gas estimate and result without sending transaction
970
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
971
+ */
972
+ sendToCosmos(_tokenContract: `0x${string}`, _destination: string, _amount: bigint, options?: {
973
+ accessList?: import("viem").AccessList;
974
+ authorizationList?: import("viem").AuthorizationList;
975
+ chain?: import("viem").Chain | null;
976
+ dataSuffix?: `0x${string}`;
977
+ gas?: bigint;
978
+ gasPrice?: bigint;
979
+ maxFeePerGas?: bigint;
980
+ maxPriorityFeePerGas?: bigint;
981
+ nonce?: number;
982
+ value?: bigint;
983
+ }): Promise<void>;
984
+ /**
985
+ * Simulate submitBatch
986
+ * Returns gas estimate and result without sending transaction
987
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
988
+ */
989
+ submitBatch(_currentValset: ValsetArgs, _sigs: Signature[], _amounts: bigint[], _destinations: `0x${string}`[], _fees: bigint[], _batchNonce: bigint, _tokenContract: `0x${string}`, _batchTimeout: bigint, options?: {
990
+ accessList?: import("viem").AccessList;
991
+ authorizationList?: import("viem").AuthorizationList;
992
+ chain?: import("viem").Chain | null;
993
+ dataSuffix?: `0x${string}`;
994
+ gas?: bigint;
995
+ gasPrice?: bigint;
996
+ maxFeePerGas?: bigint;
997
+ maxPriorityFeePerGas?: bigint;
998
+ nonce?: number;
999
+ value?: bigint;
1000
+ }): Promise<void>;
1001
+ /**
1002
+ * Simulate submitLogicCall
1003
+ * Returns gas estimate and result without sending transaction
1004
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1005
+ */
1006
+ submitLogicCall(_currentValset: ValsetArgs, _sigs: Signature[], _args: LogicCallArgs, options?: {
1007
+ accessList?: import("viem").AccessList;
1008
+ authorizationList?: import("viem").AuthorizationList;
1009
+ chain?: import("viem").Chain | null;
1010
+ dataSuffix?: `0x${string}`;
1011
+ gas?: bigint;
1012
+ gasPrice?: bigint;
1013
+ maxFeePerGas?: bigint;
1014
+ maxPriorityFeePerGas?: bigint;
1015
+ nonce?: number;
1016
+ value?: bigint;
1017
+ }): Promise<void>;
1018
+ /**
1019
+ * Simulate updateValset
1020
+ * Returns gas estimate and result without sending transaction
1021
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1022
+ */
1023
+ updateValset(_newValset: ValsetArgs, _currentValset: ValsetArgs, _sigs: Signature[], options?: {
1024
+ accessList?: import("viem").AccessList;
1025
+ authorizationList?: import("viem").AuthorizationList;
1026
+ chain?: import("viem").Chain | null;
1027
+ dataSuffix?: `0x${string}`;
1028
+ gas?: bigint;
1029
+ gasPrice?: bigint;
1030
+ maxFeePerGas?: bigint;
1031
+ maxPriorityFeePerGas?: bigint;
1032
+ nonce?: number;
1033
+ value?: bigint;
1034
+ }): Promise<void>;
1035
+ };
1036
+ /**
1037
+ * Watch contract events
1038
+ *
1039
+ * @example
1040
+ * // Watch all Transfer events
1041
+ * const unwatch = contract.watch.Transfer((event) => {
1042
+ * console.log('Transfer:', event);
1043
+ * });
1044
+ *
1045
+ * // Stop watching
1046
+ * unwatch();
1047
+ */
1048
+ get watch(): {
1049
+ /**
1050
+ * Watch ERC20DeployedEvent events
1051
+ * @param callback Function to call when event is emitted
1052
+ * @param filter Optional filter for indexed parameters
1053
+ * @returns Unwatch function to stop listening
1054
+ */
1055
+ ERC20DeployedEvent: (callback: (event: {
1056
+ _tokenContract: `0x${string}`;
1057
+ _cosmosDenom: string;
1058
+ _name: string;
1059
+ _symbol: string;
1060
+ _decimals: bigint;
1061
+ _eventNonce: bigint;
1062
+ }) => void, filter?: {
1063
+ _tokenContract: `0x${string}`;
1064
+ }) => () => void;
1065
+ /**
1066
+ * Watch LogicCallEvent events
1067
+ * @param callback Function to call when event is emitted
1068
+ * @param filter Optional filter for indexed parameters
1069
+ * @returns Unwatch function to stop listening
1070
+ */
1071
+ LogicCallEvent: (callback: (event: {
1072
+ _invalidationId: `0x${string}`;
1073
+ _invalidationNonce: bigint;
1074
+ _returnData: `0x${string}`;
1075
+ _eventNonce: bigint;
1076
+ }) => void) => () => void;
1077
+ /**
1078
+ * Watch SendToCosmosEvent events
1079
+ * @param callback Function to call when event is emitted
1080
+ * @param filter Optional filter for indexed parameters
1081
+ * @returns Unwatch function to stop listening
1082
+ */
1083
+ SendToCosmosEvent: (callback: (event: {
1084
+ _tokenContract: `0x${string}`;
1085
+ _sender: `0x${string}`;
1086
+ _destination: string;
1087
+ _amount: bigint;
1088
+ _eventNonce: bigint;
1089
+ }) => void, filter?: {
1090
+ _tokenContract: `0x${string}`;
1091
+ _sender: `0x${string}`;
1092
+ }) => () => void;
1093
+ /**
1094
+ * Watch TransactionBatchExecutedEvent events
1095
+ * @param callback Function to call when event is emitted
1096
+ * @param filter Optional filter for indexed parameters
1097
+ * @returns Unwatch function to stop listening
1098
+ */
1099
+ TransactionBatchExecutedEvent: (callback: (event: {
1100
+ _batchNonce: bigint;
1101
+ _token: `0x${string}`;
1102
+ _eventNonce: bigint;
1103
+ }) => void, filter?: {
1104
+ _batchNonce: bigint;
1105
+ _token: `0x${string}`;
1106
+ }) => () => void;
1107
+ /**
1108
+ * Watch ValsetUpdatedEvent events
1109
+ * @param callback Function to call when event is emitted
1110
+ * @param filter Optional filter for indexed parameters
1111
+ * @returns Unwatch function to stop listening
1112
+ */
1113
+ ValsetUpdatedEvent: (callback: (event: {
1114
+ _newValsetNonce: bigint;
1115
+ _eventNonce: bigint;
1116
+ _rewardAmount: bigint;
1117
+ _rewardToken: `0x${string}`;
1118
+ _validators: `0x${string}`[];
1119
+ _powers: bigint[];
1120
+ }) => void, filter?: {
1121
+ _newValsetNonce: bigint;
1122
+ }) => () => void;
1123
+ };
1124
+ }