@gitmyabi/usad 0.0.0-stage → 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,1613 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USADv2_json = exports.USADv2_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * USADv2_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.USADv2_jsonAbi = [
11
+ {
12
+ "inputs": [],
13
+ "stateMutability": "nonpayable",
14
+ "type": "constructor"
15
+ },
16
+ {
17
+ "inputs": [
18
+ {
19
+ "internalType": "address",
20
+ "name": "account",
21
+ "type": "address"
22
+ }
23
+ ],
24
+ "name": "BlacklistedRecipient",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [
29
+ {
30
+ "internalType": "address",
31
+ "name": "account",
32
+ "type": "address"
33
+ }
34
+ ],
35
+ "name": "BlacklistedSender",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "anonymous": false,
40
+ "inputs": [
41
+ {
42
+ "indexed": true,
43
+ "internalType": "bytes32",
44
+ "name": "actionId",
45
+ "type": "bytes32"
46
+ }
47
+ ],
48
+ "name": "ActionCancelled",
49
+ "type": "event"
50
+ },
51
+ {
52
+ "anonymous": false,
53
+ "inputs": [
54
+ {
55
+ "indexed": true,
56
+ "internalType": "bytes32",
57
+ "name": "actionId",
58
+ "type": "bytes32"
59
+ },
60
+ {
61
+ "indexed": true,
62
+ "internalType": "bytes4",
63
+ "name": "selector",
64
+ "type": "bytes4"
65
+ },
66
+ {
67
+ "indexed": true,
68
+ "internalType": "address",
69
+ "name": "target",
70
+ "type": "address"
71
+ }
72
+ ],
73
+ "name": "ActionExecuted",
74
+ "type": "event"
75
+ },
76
+ {
77
+ "anonymous": false,
78
+ "inputs": [
79
+ {
80
+ "indexed": true,
81
+ "internalType": "bytes32",
82
+ "name": "actionId",
83
+ "type": "bytes32"
84
+ },
85
+ {
86
+ "indexed": true,
87
+ "internalType": "bytes4",
88
+ "name": "selector",
89
+ "type": "bytes4"
90
+ },
91
+ {
92
+ "indexed": true,
93
+ "internalType": "address",
94
+ "name": "target",
95
+ "type": "address"
96
+ },
97
+ {
98
+ "indexed": false,
99
+ "internalType": "uint256",
100
+ "name": "executeAfter",
101
+ "type": "uint256"
102
+ }
103
+ ],
104
+ "name": "ActionQueued",
105
+ "type": "event"
106
+ },
107
+ {
108
+ "anonymous": false,
109
+ "inputs": [
110
+ {
111
+ "indexed": true,
112
+ "internalType": "address",
113
+ "name": "target",
114
+ "type": "address"
115
+ },
116
+ {
117
+ "indexed": true,
118
+ "internalType": "bytes32",
119
+ "name": "actionId",
120
+ "type": "bytes32"
121
+ },
122
+ {
123
+ "indexed": false,
124
+ "internalType": "uint256",
125
+ "name": "executedAt",
126
+ "type": "uint256"
127
+ }
128
+ ],
129
+ "name": "AddressBlacklisted",
130
+ "type": "event"
131
+ },
132
+ {
133
+ "anonymous": false,
134
+ "inputs": [
135
+ {
136
+ "indexed": true,
137
+ "internalType": "address",
138
+ "name": "target",
139
+ "type": "address"
140
+ },
141
+ {
142
+ "indexed": true,
143
+ "internalType": "bytes32",
144
+ "name": "actionId",
145
+ "type": "bytes32"
146
+ },
147
+ {
148
+ "indexed": false,
149
+ "internalType": "uint256",
150
+ "name": "executedAt",
151
+ "type": "uint256"
152
+ }
153
+ ],
154
+ "name": "AddressUnblacklisted",
155
+ "type": "event"
156
+ },
157
+ {
158
+ "anonymous": false,
159
+ "inputs": [
160
+ {
161
+ "indexed": true,
162
+ "internalType": "address",
163
+ "name": "owner",
164
+ "type": "address"
165
+ },
166
+ {
167
+ "indexed": true,
168
+ "internalType": "address",
169
+ "name": "spender",
170
+ "type": "address"
171
+ },
172
+ {
173
+ "indexed": false,
174
+ "internalType": "uint256",
175
+ "name": "value",
176
+ "type": "uint256"
177
+ }
178
+ ],
179
+ "name": "Approval",
180
+ "type": "event"
181
+ },
182
+ {
183
+ "anonymous": false,
184
+ "inputs": [
185
+ {
186
+ "indexed": false,
187
+ "internalType": "uint8",
188
+ "name": "version",
189
+ "type": "uint8"
190
+ }
191
+ ],
192
+ "name": "Initialized",
193
+ "type": "event"
194
+ },
195
+ {
196
+ "anonymous": false,
197
+ "inputs": [
198
+ {
199
+ "indexed": true,
200
+ "internalType": "address",
201
+ "name": "previousOwner",
202
+ "type": "address"
203
+ },
204
+ {
205
+ "indexed": true,
206
+ "internalType": "address",
207
+ "name": "newOwner",
208
+ "type": "address"
209
+ }
210
+ ],
211
+ "name": "OwnershipTransferred",
212
+ "type": "event"
213
+ },
214
+ {
215
+ "anonymous": false,
216
+ "inputs": [
217
+ {
218
+ "indexed": false,
219
+ "internalType": "address",
220
+ "name": "account",
221
+ "type": "address"
222
+ }
223
+ ],
224
+ "name": "Paused",
225
+ "type": "event"
226
+ },
227
+ {
228
+ "anonymous": false,
229
+ "inputs": [
230
+ {
231
+ "indexed": true,
232
+ "internalType": "address",
233
+ "name": "from",
234
+ "type": "address"
235
+ },
236
+ {
237
+ "indexed": true,
238
+ "internalType": "address",
239
+ "name": "to",
240
+ "type": "address"
241
+ },
242
+ {
243
+ "indexed": false,
244
+ "internalType": "uint256",
245
+ "name": "value",
246
+ "type": "uint256"
247
+ }
248
+ ],
249
+ "name": "Transfer",
250
+ "type": "event"
251
+ },
252
+ {
253
+ "anonymous": false,
254
+ "inputs": [
255
+ {
256
+ "indexed": false,
257
+ "internalType": "address",
258
+ "name": "account",
259
+ "type": "address"
260
+ }
261
+ ],
262
+ "name": "Unpaused",
263
+ "type": "event"
264
+ },
265
+ {
266
+ "inputs": [],
267
+ "name": "DOMAIN_SEPARATOR",
268
+ "outputs": [
269
+ {
270
+ "internalType": "bytes32",
271
+ "name": "",
272
+ "type": "bytes32"
273
+ }
274
+ ],
275
+ "stateMutability": "view",
276
+ "type": "function"
277
+ },
278
+ {
279
+ "inputs": [],
280
+ "name": "TIMELOCK_DELAY",
281
+ "outputs": [
282
+ {
283
+ "internalType": "uint256",
284
+ "name": "",
285
+ "type": "uint256"
286
+ }
287
+ ],
288
+ "stateMutability": "view",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [
293
+ {
294
+ "internalType": "address",
295
+ "name": "owner",
296
+ "type": "address"
297
+ },
298
+ {
299
+ "internalType": "address",
300
+ "name": "spender",
301
+ "type": "address"
302
+ }
303
+ ],
304
+ "name": "allowance",
305
+ "outputs": [
306
+ {
307
+ "internalType": "uint256",
308
+ "name": "",
309
+ "type": "uint256"
310
+ }
311
+ ],
312
+ "stateMutability": "view",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "inputs": [
317
+ {
318
+ "internalType": "address",
319
+ "name": "spender",
320
+ "type": "address"
321
+ },
322
+ {
323
+ "internalType": "uint256",
324
+ "name": "amount",
325
+ "type": "uint256"
326
+ }
327
+ ],
328
+ "name": "approve",
329
+ "outputs": [
330
+ {
331
+ "internalType": "bool",
332
+ "name": "",
333
+ "type": "bool"
334
+ }
335
+ ],
336
+ "stateMutability": "nonpayable",
337
+ "type": "function"
338
+ },
339
+ {
340
+ "inputs": [
341
+ {
342
+ "internalType": "address",
343
+ "name": "account",
344
+ "type": "address"
345
+ }
346
+ ],
347
+ "name": "balanceOf",
348
+ "outputs": [
349
+ {
350
+ "internalType": "uint256",
351
+ "name": "",
352
+ "type": "uint256"
353
+ }
354
+ ],
355
+ "stateMutability": "view",
356
+ "type": "function"
357
+ },
358
+ {
359
+ "inputs": [
360
+ {
361
+ "internalType": "bytes32",
362
+ "name": "actionId",
363
+ "type": "bytes32"
364
+ }
365
+ ],
366
+ "name": "cancelAction",
367
+ "outputs": [],
368
+ "stateMutability": "nonpayable",
369
+ "type": "function"
370
+ },
371
+ {
372
+ "inputs": [],
373
+ "name": "decimals",
374
+ "outputs": [
375
+ {
376
+ "internalType": "uint8",
377
+ "name": "",
378
+ "type": "uint8"
379
+ }
380
+ ],
381
+ "stateMutability": "pure",
382
+ "type": "function"
383
+ },
384
+ {
385
+ "inputs": [
386
+ {
387
+ "internalType": "address",
388
+ "name": "spender",
389
+ "type": "address"
390
+ },
391
+ {
392
+ "internalType": "uint256",
393
+ "name": "subtractedValue",
394
+ "type": "uint256"
395
+ }
396
+ ],
397
+ "name": "decreaseAllowance",
398
+ "outputs": [
399
+ {
400
+ "internalType": "bool",
401
+ "name": "",
402
+ "type": "bool"
403
+ }
404
+ ],
405
+ "stateMutability": "nonpayable",
406
+ "type": "function"
407
+ },
408
+ {
409
+ "inputs": [],
410
+ "name": "eip712Domain",
411
+ "outputs": [
412
+ {
413
+ "internalType": "bytes1",
414
+ "name": "fields",
415
+ "type": "bytes1"
416
+ },
417
+ {
418
+ "internalType": "string",
419
+ "name": "name_",
420
+ "type": "string"
421
+ },
422
+ {
423
+ "internalType": "string",
424
+ "name": "version_",
425
+ "type": "string"
426
+ },
427
+ {
428
+ "internalType": "uint256",
429
+ "name": "chainId",
430
+ "type": "uint256"
431
+ },
432
+ {
433
+ "internalType": "address",
434
+ "name": "verifyingContract",
435
+ "type": "address"
436
+ },
437
+ {
438
+ "internalType": "bytes32",
439
+ "name": "salt",
440
+ "type": "bytes32"
441
+ },
442
+ {
443
+ "internalType": "uint256[]",
444
+ "name": "extensions",
445
+ "type": "uint256[]"
446
+ }
447
+ ],
448
+ "stateMutability": "view",
449
+ "type": "function"
450
+ },
451
+ {
452
+ "inputs": [
453
+ {
454
+ "internalType": "address",
455
+ "name": "target",
456
+ "type": "address"
457
+ }
458
+ ],
459
+ "name": "executeBlacklist",
460
+ "outputs": [],
461
+ "stateMutability": "nonpayable",
462
+ "type": "function"
463
+ },
464
+ {
465
+ "inputs": [
466
+ {
467
+ "internalType": "address",
468
+ "name": "target",
469
+ "type": "address"
470
+ }
471
+ ],
472
+ "name": "executeUnblacklist",
473
+ "outputs": [],
474
+ "stateMutability": "nonpayable",
475
+ "type": "function"
476
+ },
477
+ {
478
+ "inputs": [],
479
+ "name": "executeUnpause",
480
+ "outputs": [],
481
+ "stateMutability": "nonpayable",
482
+ "type": "function"
483
+ },
484
+ {
485
+ "inputs": [
486
+ {
487
+ "internalType": "bytes32",
488
+ "name": "actionId",
489
+ "type": "bytes32"
490
+ }
491
+ ],
492
+ "name": "getActionExecutionTime",
493
+ "outputs": [
494
+ {
495
+ "internalType": "uint256",
496
+ "name": "",
497
+ "type": "uint256"
498
+ }
499
+ ],
500
+ "stateMutability": "view",
501
+ "type": "function"
502
+ },
503
+ {
504
+ "inputs": [
505
+ {
506
+ "internalType": "address",
507
+ "name": "spender",
508
+ "type": "address"
509
+ },
510
+ {
511
+ "internalType": "uint256",
512
+ "name": "addedValue",
513
+ "type": "uint256"
514
+ }
515
+ ],
516
+ "name": "increaseAllowance",
517
+ "outputs": [
518
+ {
519
+ "internalType": "bool",
520
+ "name": "",
521
+ "type": "bool"
522
+ }
523
+ ],
524
+ "stateMutability": "nonpayable",
525
+ "type": "function"
526
+ },
527
+ {
528
+ "inputs": [
529
+ {
530
+ "internalType": "address",
531
+ "name": "asset_",
532
+ "type": "address"
533
+ }
534
+ ],
535
+ "name": "initialize",
536
+ "outputs": [],
537
+ "stateMutability": "nonpayable",
538
+ "type": "function"
539
+ },
540
+ {
541
+ "inputs": [],
542
+ "name": "initializeV2",
543
+ "outputs": [],
544
+ "stateMutability": "nonpayable",
545
+ "type": "function"
546
+ },
547
+ {
548
+ "inputs": [
549
+ {
550
+ "internalType": "bytes32",
551
+ "name": "actionId",
552
+ "type": "bytes32"
553
+ }
554
+ ],
555
+ "name": "isActionQueued",
556
+ "outputs": [
557
+ {
558
+ "internalType": "bool",
559
+ "name": "",
560
+ "type": "bool"
561
+ }
562
+ ],
563
+ "stateMutability": "view",
564
+ "type": "function"
565
+ },
566
+ {
567
+ "inputs": [
568
+ {
569
+ "internalType": "address",
570
+ "name": "account",
571
+ "type": "address"
572
+ }
573
+ ],
574
+ "name": "isBlacklisted",
575
+ "outputs": [
576
+ {
577
+ "internalType": "bool",
578
+ "name": "",
579
+ "type": "bool"
580
+ }
581
+ ],
582
+ "stateMutability": "view",
583
+ "type": "function"
584
+ },
585
+ {
586
+ "inputs": [],
587
+ "name": "name",
588
+ "outputs": [
589
+ {
590
+ "internalType": "string",
591
+ "name": "",
592
+ "type": "string"
593
+ }
594
+ ],
595
+ "stateMutability": "view",
596
+ "type": "function"
597
+ },
598
+ {
599
+ "inputs": [
600
+ {
601
+ "internalType": "address",
602
+ "name": "owner",
603
+ "type": "address"
604
+ }
605
+ ],
606
+ "name": "nonces",
607
+ "outputs": [
608
+ {
609
+ "internalType": "uint256",
610
+ "name": "",
611
+ "type": "uint256"
612
+ }
613
+ ],
614
+ "stateMutability": "view",
615
+ "type": "function"
616
+ },
617
+ {
618
+ "inputs": [],
619
+ "name": "owner",
620
+ "outputs": [
621
+ {
622
+ "internalType": "address",
623
+ "name": "",
624
+ "type": "address"
625
+ }
626
+ ],
627
+ "stateMutability": "view",
628
+ "type": "function"
629
+ },
630
+ {
631
+ "inputs": [],
632
+ "name": "pause",
633
+ "outputs": [],
634
+ "stateMutability": "nonpayable",
635
+ "type": "function"
636
+ },
637
+ {
638
+ "inputs": [],
639
+ "name": "paused",
640
+ "outputs": [
641
+ {
642
+ "internalType": "bool",
643
+ "name": "",
644
+ "type": "bool"
645
+ }
646
+ ],
647
+ "stateMutability": "view",
648
+ "type": "function"
649
+ },
650
+ {
651
+ "inputs": [
652
+ {
653
+ "internalType": "address",
654
+ "name": "owner",
655
+ "type": "address"
656
+ },
657
+ {
658
+ "internalType": "address",
659
+ "name": "spender",
660
+ "type": "address"
661
+ },
662
+ {
663
+ "internalType": "uint256",
664
+ "name": "value",
665
+ "type": "uint256"
666
+ },
667
+ {
668
+ "internalType": "uint256",
669
+ "name": "deadline",
670
+ "type": "uint256"
671
+ },
672
+ {
673
+ "internalType": "uint8",
674
+ "name": "v",
675
+ "type": "uint8"
676
+ },
677
+ {
678
+ "internalType": "bytes32",
679
+ "name": "r",
680
+ "type": "bytes32"
681
+ },
682
+ {
683
+ "internalType": "bytes32",
684
+ "name": "s",
685
+ "type": "bytes32"
686
+ }
687
+ ],
688
+ "name": "permit",
689
+ "outputs": [],
690
+ "stateMutability": "nonpayable",
691
+ "type": "function"
692
+ },
693
+ {
694
+ "inputs": [
695
+ {
696
+ "internalType": "address",
697
+ "name": "target",
698
+ "type": "address"
699
+ }
700
+ ],
701
+ "name": "queueBlacklist",
702
+ "outputs": [
703
+ {
704
+ "internalType": "bytes32",
705
+ "name": "actionId",
706
+ "type": "bytes32"
707
+ }
708
+ ],
709
+ "stateMutability": "nonpayable",
710
+ "type": "function"
711
+ },
712
+ {
713
+ "inputs": [
714
+ {
715
+ "internalType": "address",
716
+ "name": "target",
717
+ "type": "address"
718
+ }
719
+ ],
720
+ "name": "queueUnblacklist",
721
+ "outputs": [
722
+ {
723
+ "internalType": "bytes32",
724
+ "name": "actionId",
725
+ "type": "bytes32"
726
+ }
727
+ ],
728
+ "stateMutability": "nonpayable",
729
+ "type": "function"
730
+ },
731
+ {
732
+ "inputs": [],
733
+ "name": "queueUnpause",
734
+ "outputs": [
735
+ {
736
+ "internalType": "bytes32",
737
+ "name": "actionId",
738
+ "type": "bytes32"
739
+ }
740
+ ],
741
+ "stateMutability": "nonpayable",
742
+ "type": "function"
743
+ },
744
+ {
745
+ "inputs": [],
746
+ "name": "renounceOwnership",
747
+ "outputs": [],
748
+ "stateMutability": "nonpayable",
749
+ "type": "function"
750
+ },
751
+ {
752
+ "inputs": [],
753
+ "name": "symbol",
754
+ "outputs": [
755
+ {
756
+ "internalType": "string",
757
+ "name": "",
758
+ "type": "string"
759
+ }
760
+ ],
761
+ "stateMutability": "view",
762
+ "type": "function"
763
+ },
764
+ {
765
+ "inputs": [],
766
+ "name": "totalSupply",
767
+ "outputs": [
768
+ {
769
+ "internalType": "uint256",
770
+ "name": "",
771
+ "type": "uint256"
772
+ }
773
+ ],
774
+ "stateMutability": "view",
775
+ "type": "function"
776
+ },
777
+ {
778
+ "inputs": [
779
+ {
780
+ "internalType": "address",
781
+ "name": "to",
782
+ "type": "address"
783
+ },
784
+ {
785
+ "internalType": "uint256",
786
+ "name": "amount",
787
+ "type": "uint256"
788
+ }
789
+ ],
790
+ "name": "transfer",
791
+ "outputs": [
792
+ {
793
+ "internalType": "bool",
794
+ "name": "",
795
+ "type": "bool"
796
+ }
797
+ ],
798
+ "stateMutability": "nonpayable",
799
+ "type": "function"
800
+ },
801
+ {
802
+ "inputs": [
803
+ {
804
+ "internalType": "address",
805
+ "name": "from",
806
+ "type": "address"
807
+ },
808
+ {
809
+ "internalType": "address",
810
+ "name": "to",
811
+ "type": "address"
812
+ },
813
+ {
814
+ "internalType": "uint256",
815
+ "name": "amount",
816
+ "type": "uint256"
817
+ }
818
+ ],
819
+ "name": "transferFrom",
820
+ "outputs": [
821
+ {
822
+ "internalType": "bool",
823
+ "name": "",
824
+ "type": "bool"
825
+ }
826
+ ],
827
+ "stateMutability": "nonpayable",
828
+ "type": "function"
829
+ },
830
+ {
831
+ "inputs": [
832
+ {
833
+ "internalType": "address",
834
+ "name": "newOwner",
835
+ "type": "address"
836
+ }
837
+ ],
838
+ "name": "transferOwnership",
839
+ "outputs": [],
840
+ "stateMutability": "nonpayable",
841
+ "type": "function"
842
+ },
843
+ {
844
+ "inputs": [],
845
+ "name": "unpause",
846
+ "outputs": [],
847
+ "stateMutability": "nonpayable",
848
+ "type": "function"
849
+ }
850
+ ];
851
+ /**
852
+ * USADv2_json Contract Class
853
+ *
854
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
855
+ *
856
+ * @example
857
+ * ```typescript
858
+ * import { createPublicClient, createWalletClient, http } from 'viem';
859
+ * import { mainnet } from 'viem/chains';
860
+ * import { USADv2_json } from 'USADv2_json';
861
+ *
862
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
863
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
864
+ *
865
+ * const contract = new USADv2_json('0x...', { publicClient, walletClient });
866
+ *
867
+ * // Read functions
868
+ * const result = await contract.balanceOf('0x...');
869
+ *
870
+ * // Write functions
871
+ * const hash = await contract.transfer('0x...', 1000n);
872
+ *
873
+ * // Simulate transactions (dry-run)
874
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
875
+ * console.log('Gas estimate:', simulation.request.gas);
876
+ *
877
+ * // Watch events
878
+ * const unwatch = contract.watch.Transfer((event) => {
879
+ * console.log('Transfer event:', event);
880
+ * });
881
+ * ```
882
+ */
883
+ class USADv2_json {
884
+ constructor(address, clients) {
885
+ this.contractAddress = address;
886
+ this.publicClient = clients.publicClient;
887
+ this.contract = (0, viem_1.getContract)({
888
+ address,
889
+ abi: exports.USADv2_jsonAbi,
890
+ client: {
891
+ public: clients.publicClient,
892
+ wallet: clients.walletClient,
893
+ },
894
+ });
895
+ }
896
+ /**
897
+ * Get the contract address
898
+ */
899
+ get address() {
900
+ return this.contractAddress;
901
+ }
902
+ /**
903
+ * Get the underlying viem contract instance
904
+ */
905
+ getContract() {
906
+ return this.contract;
907
+ }
908
+ /**
909
+ * DOMAIN_SEPARATOR
910
+ * view
911
+ */
912
+ async DOMAIN_SEPARATOR() {
913
+ return this.contract.read.DOMAIN_SEPARATOR();
914
+ }
915
+ /**
916
+ * TIMELOCK_DELAY
917
+ * view
918
+ */
919
+ async TIMELOCK_DELAY() {
920
+ return this.contract.read.TIMELOCK_DELAY();
921
+ }
922
+ /**
923
+ * allowance
924
+ * view
925
+ */
926
+ async allowance(owner, spender) {
927
+ return this.contract.read.allowance([owner, spender]);
928
+ }
929
+ /**
930
+ * balanceOf
931
+ * view
932
+ */
933
+ async balanceOf(account) {
934
+ return this.contract.read.balanceOf([account]);
935
+ }
936
+ /**
937
+ * decimals
938
+ * pure
939
+ */
940
+ async decimals() {
941
+ return this.contract.read.decimals();
942
+ }
943
+ /**
944
+ * eip712Domain
945
+ * view
946
+ */
947
+ async eip712Domain() {
948
+ return this.contract.read.eip712Domain();
949
+ }
950
+ /**
951
+ * getActionExecutionTime
952
+ * view
953
+ */
954
+ async getActionExecutionTime(actionId) {
955
+ return this.contract.read.getActionExecutionTime([actionId]);
956
+ }
957
+ /**
958
+ * isActionQueued
959
+ * view
960
+ */
961
+ async isActionQueued(actionId) {
962
+ return this.contract.read.isActionQueued([actionId]);
963
+ }
964
+ /**
965
+ * isBlacklisted
966
+ * view
967
+ */
968
+ async isBlacklisted(account) {
969
+ return this.contract.read.isBlacklisted([account]);
970
+ }
971
+ /**
972
+ * name
973
+ * view
974
+ */
975
+ async name() {
976
+ return this.contract.read.name();
977
+ }
978
+ /**
979
+ * nonces
980
+ * view
981
+ */
982
+ async nonces(owner) {
983
+ return this.contract.read.nonces([owner]);
984
+ }
985
+ /**
986
+ * owner
987
+ * view
988
+ */
989
+ async owner() {
990
+ return this.contract.read.owner();
991
+ }
992
+ /**
993
+ * paused
994
+ * view
995
+ */
996
+ async paused() {
997
+ return this.contract.read.paused();
998
+ }
999
+ /**
1000
+ * symbol
1001
+ * view
1002
+ */
1003
+ async symbol() {
1004
+ return this.contract.read.symbol();
1005
+ }
1006
+ /**
1007
+ * totalSupply
1008
+ * view
1009
+ */
1010
+ async totalSupply() {
1011
+ return this.contract.read.totalSupply();
1012
+ }
1013
+ /**
1014
+ * approve
1015
+ * nonpayable
1016
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1017
+ */
1018
+ async approve(spender, amount, options) {
1019
+ if (!this.contract.write) {
1020
+ throw new Error('Wallet client is required for write operations');
1021
+ }
1022
+ return this.contract.write.approve([spender, amount], options);
1023
+ }
1024
+ /**
1025
+ * cancelAction
1026
+ * nonpayable
1027
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1028
+ */
1029
+ async cancelAction(actionId, options) {
1030
+ if (!this.contract.write) {
1031
+ throw new Error('Wallet client is required for write operations');
1032
+ }
1033
+ return this.contract.write.cancelAction([actionId], options);
1034
+ }
1035
+ /**
1036
+ * decreaseAllowance
1037
+ * nonpayable
1038
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1039
+ */
1040
+ async decreaseAllowance(spender, subtractedValue, options) {
1041
+ if (!this.contract.write) {
1042
+ throw new Error('Wallet client is required for write operations');
1043
+ }
1044
+ return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
1045
+ }
1046
+ /**
1047
+ * executeBlacklist
1048
+ * nonpayable
1049
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1050
+ */
1051
+ async executeBlacklist(target, options) {
1052
+ if (!this.contract.write) {
1053
+ throw new Error('Wallet client is required for write operations');
1054
+ }
1055
+ return this.contract.write.executeBlacklist([target], options);
1056
+ }
1057
+ /**
1058
+ * executeUnblacklist
1059
+ * nonpayable
1060
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1061
+ */
1062
+ async executeUnblacklist(target, options) {
1063
+ if (!this.contract.write) {
1064
+ throw new Error('Wallet client is required for write operations');
1065
+ }
1066
+ return this.contract.write.executeUnblacklist([target], options);
1067
+ }
1068
+ /**
1069
+ * executeUnpause
1070
+ * nonpayable
1071
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1072
+ */
1073
+ async executeUnpause(options) {
1074
+ if (!this.contract.write) {
1075
+ throw new Error('Wallet client is required for write operations');
1076
+ }
1077
+ return this.contract.write.executeUnpause(options);
1078
+ }
1079
+ /**
1080
+ * increaseAllowance
1081
+ * nonpayable
1082
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1083
+ */
1084
+ async increaseAllowance(spender, addedValue, options) {
1085
+ if (!this.contract.write) {
1086
+ throw new Error('Wallet client is required for write operations');
1087
+ }
1088
+ return this.contract.write.increaseAllowance([spender, addedValue], options);
1089
+ }
1090
+ /**
1091
+ * initialize
1092
+ * nonpayable
1093
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1094
+ */
1095
+ async initialize(asset_, options) {
1096
+ if (!this.contract.write) {
1097
+ throw new Error('Wallet client is required for write operations');
1098
+ }
1099
+ return this.contract.write.initialize([asset_], options);
1100
+ }
1101
+ /**
1102
+ * initializeV2
1103
+ * nonpayable
1104
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1105
+ */
1106
+ async initializeV2(options) {
1107
+ if (!this.contract.write) {
1108
+ throw new Error('Wallet client is required for write operations');
1109
+ }
1110
+ return this.contract.write.initializeV2(options);
1111
+ }
1112
+ /**
1113
+ * pause
1114
+ * nonpayable
1115
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1116
+ */
1117
+ async pause(options) {
1118
+ if (!this.contract.write) {
1119
+ throw new Error('Wallet client is required for write operations');
1120
+ }
1121
+ return this.contract.write.pause(options);
1122
+ }
1123
+ /**
1124
+ * permit
1125
+ * nonpayable
1126
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1127
+ */
1128
+ async permit(owner, spender, value, deadline, v, r, s, options) {
1129
+ if (!this.contract.write) {
1130
+ throw new Error('Wallet client is required for write operations');
1131
+ }
1132
+ return this.contract.write.permit([owner, spender, value, deadline, v, r, s], options);
1133
+ }
1134
+ /**
1135
+ * queueBlacklist
1136
+ * nonpayable
1137
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1138
+ */
1139
+ async queueBlacklist(target, options) {
1140
+ if (!this.contract.write) {
1141
+ throw new Error('Wallet client is required for write operations');
1142
+ }
1143
+ return this.contract.write.queueBlacklist([target], options);
1144
+ }
1145
+ /**
1146
+ * queueUnblacklist
1147
+ * nonpayable
1148
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1149
+ */
1150
+ async queueUnblacklist(target, options) {
1151
+ if (!this.contract.write) {
1152
+ throw new Error('Wallet client is required for write operations');
1153
+ }
1154
+ return this.contract.write.queueUnblacklist([target], options);
1155
+ }
1156
+ /**
1157
+ * queueUnpause
1158
+ * nonpayable
1159
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1160
+ */
1161
+ async queueUnpause(options) {
1162
+ if (!this.contract.write) {
1163
+ throw new Error('Wallet client is required for write operations');
1164
+ }
1165
+ return this.contract.write.queueUnpause(options);
1166
+ }
1167
+ /**
1168
+ * renounceOwnership
1169
+ * nonpayable
1170
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1171
+ */
1172
+ async renounceOwnership(options) {
1173
+ if (!this.contract.write) {
1174
+ throw new Error('Wallet client is required for write operations');
1175
+ }
1176
+ return this.contract.write.renounceOwnership(options);
1177
+ }
1178
+ /**
1179
+ * transfer
1180
+ * nonpayable
1181
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1182
+ */
1183
+ async transfer(to, amount, options) {
1184
+ if (!this.contract.write) {
1185
+ throw new Error('Wallet client is required for write operations');
1186
+ }
1187
+ return this.contract.write.transfer([to, amount], options);
1188
+ }
1189
+ /**
1190
+ * transferFrom
1191
+ * nonpayable
1192
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1193
+ */
1194
+ async transferFrom(from, to, amount, options) {
1195
+ if (!this.contract.write) {
1196
+ throw new Error('Wallet client is required for write operations');
1197
+ }
1198
+ return this.contract.write.transferFrom([from, to, amount], options);
1199
+ }
1200
+ /**
1201
+ * transferOwnership
1202
+ * nonpayable
1203
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1204
+ */
1205
+ async transferOwnership(newOwner, options) {
1206
+ if (!this.contract.write) {
1207
+ throw new Error('Wallet client is required for write operations');
1208
+ }
1209
+ return this.contract.write.transferOwnership([newOwner], options);
1210
+ }
1211
+ /**
1212
+ * unpause
1213
+ * nonpayable
1214
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1215
+ */
1216
+ async unpause(options) {
1217
+ if (!this.contract.write) {
1218
+ throw new Error('Wallet client is required for write operations');
1219
+ }
1220
+ return this.contract.write.unpause(options);
1221
+ }
1222
+ /**
1223
+ * Simulate contract write operations (dry-run without sending transaction)
1224
+ *
1225
+ * @example
1226
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1227
+ * console.log('Gas estimate:', result.request.gas);
1228
+ * console.log('Would succeed:', result.result);
1229
+ */
1230
+ get simulate() {
1231
+ const contract = this.contract;
1232
+ if (!contract.simulate) {
1233
+ throw new Error('Public client is required for simulation');
1234
+ }
1235
+ return {
1236
+ /**
1237
+ * Simulate approve
1238
+ * Returns gas estimate and result without sending transaction
1239
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1240
+ */
1241
+ async approve(spender, amount, options) {
1242
+ return contract.simulate.approve([spender, amount], options);
1243
+ },
1244
+ /**
1245
+ * Simulate cancelAction
1246
+ * Returns gas estimate and result without sending transaction
1247
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1248
+ */
1249
+ async cancelAction(actionId, options) {
1250
+ return contract.simulate.cancelAction([actionId], options);
1251
+ },
1252
+ /**
1253
+ * Simulate decreaseAllowance
1254
+ * Returns gas estimate and result without sending transaction
1255
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1256
+ */
1257
+ async decreaseAllowance(spender, subtractedValue, options) {
1258
+ return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
1259
+ },
1260
+ /**
1261
+ * Simulate executeBlacklist
1262
+ * Returns gas estimate and result without sending transaction
1263
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1264
+ */
1265
+ async executeBlacklist(target, options) {
1266
+ return contract.simulate.executeBlacklist([target], options);
1267
+ },
1268
+ /**
1269
+ * Simulate executeUnblacklist
1270
+ * Returns gas estimate and result without sending transaction
1271
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1272
+ */
1273
+ async executeUnblacklist(target, options) {
1274
+ return contract.simulate.executeUnblacklist([target], options);
1275
+ },
1276
+ /**
1277
+ * Simulate executeUnpause
1278
+ * Returns gas estimate and result without sending transaction
1279
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1280
+ */
1281
+ async executeUnpause(options) {
1282
+ return contract.simulate.executeUnpause(options);
1283
+ },
1284
+ /**
1285
+ * Simulate increaseAllowance
1286
+ * Returns gas estimate and result without sending transaction
1287
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1288
+ */
1289
+ async increaseAllowance(spender, addedValue, options) {
1290
+ return contract.simulate.increaseAllowance([spender, addedValue], options);
1291
+ },
1292
+ /**
1293
+ * Simulate initialize
1294
+ * Returns gas estimate and result without sending transaction
1295
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1296
+ */
1297
+ async initialize(asset_, options) {
1298
+ return contract.simulate.initialize([asset_], options);
1299
+ },
1300
+ /**
1301
+ * Simulate initializeV2
1302
+ * Returns gas estimate and result without sending transaction
1303
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1304
+ */
1305
+ async initializeV2(options) {
1306
+ return contract.simulate.initializeV2(options);
1307
+ },
1308
+ /**
1309
+ * Simulate pause
1310
+ * Returns gas estimate and result without sending transaction
1311
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1312
+ */
1313
+ async pause(options) {
1314
+ return contract.simulate.pause(options);
1315
+ },
1316
+ /**
1317
+ * Simulate permit
1318
+ * Returns gas estimate and result without sending transaction
1319
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1320
+ */
1321
+ async permit(owner, spender, value, deadline, v, r, s, options) {
1322
+ return contract.simulate.permit([owner, spender, value, deadline, v, r, s], options);
1323
+ },
1324
+ /**
1325
+ * Simulate queueBlacklist
1326
+ * Returns gas estimate and result without sending transaction
1327
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1328
+ */
1329
+ async queueBlacklist(target, options) {
1330
+ return contract.simulate.queueBlacklist([target], options);
1331
+ },
1332
+ /**
1333
+ * Simulate queueUnblacklist
1334
+ * Returns gas estimate and result without sending transaction
1335
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1336
+ */
1337
+ async queueUnblacklist(target, options) {
1338
+ return contract.simulate.queueUnblacklist([target], options);
1339
+ },
1340
+ /**
1341
+ * Simulate queueUnpause
1342
+ * Returns gas estimate and result without sending transaction
1343
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1344
+ */
1345
+ async queueUnpause(options) {
1346
+ return contract.simulate.queueUnpause(options);
1347
+ },
1348
+ /**
1349
+ * Simulate renounceOwnership
1350
+ * Returns gas estimate and result without sending transaction
1351
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1352
+ */
1353
+ async renounceOwnership(options) {
1354
+ return contract.simulate.renounceOwnership(options);
1355
+ },
1356
+ /**
1357
+ * Simulate transfer
1358
+ * Returns gas estimate and result without sending transaction
1359
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1360
+ */
1361
+ async transfer(to, amount, options) {
1362
+ return contract.simulate.transfer([to, amount], options);
1363
+ },
1364
+ /**
1365
+ * Simulate transferFrom
1366
+ * Returns gas estimate and result without sending transaction
1367
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1368
+ */
1369
+ async transferFrom(from, to, amount, options) {
1370
+ return contract.simulate.transferFrom([from, to, amount], options);
1371
+ },
1372
+ /**
1373
+ * Simulate transferOwnership
1374
+ * Returns gas estimate and result without sending transaction
1375
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1376
+ */
1377
+ async transferOwnership(newOwner, options) {
1378
+ return contract.simulate.transferOwnership([newOwner], options);
1379
+ },
1380
+ /**
1381
+ * Simulate unpause
1382
+ * Returns gas estimate and result without sending transaction
1383
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1384
+ */
1385
+ async unpause(options) {
1386
+ return contract.simulate.unpause(options);
1387
+ }
1388
+ };
1389
+ }
1390
+ /**
1391
+ * Watch contract events
1392
+ *
1393
+ * @example
1394
+ * // Watch all Transfer events
1395
+ * const unwatch = contract.watch.Transfer((event) => {
1396
+ * console.log('Transfer:', event);
1397
+ * });
1398
+ *
1399
+ * // Stop watching
1400
+ * unwatch();
1401
+ */
1402
+ get watch() {
1403
+ return {
1404
+ /**
1405
+ * Watch ActionCancelled events
1406
+ * @param callback Function to call when event is emitted
1407
+ * @param filter Optional filter for indexed parameters
1408
+ * @returns Unwatch function to stop listening
1409
+ */
1410
+ ActionCancelled: (callback, filter) => {
1411
+ return this.publicClient.watchContractEvent({
1412
+ address: this.contractAddress,
1413
+ abi: exports.USADv2_jsonAbi,
1414
+ eventName: 'ActionCancelled',
1415
+ args: filter,
1416
+ onLogs: (logs) => {
1417
+ logs.forEach((log) => {
1418
+ callback(log.args);
1419
+ });
1420
+ },
1421
+ });
1422
+ },
1423
+ /**
1424
+ * Watch ActionExecuted events
1425
+ * @param callback Function to call when event is emitted
1426
+ * @param filter Optional filter for indexed parameters
1427
+ * @returns Unwatch function to stop listening
1428
+ */
1429
+ ActionExecuted: (callback, filter) => {
1430
+ return this.publicClient.watchContractEvent({
1431
+ address: this.contractAddress,
1432
+ abi: exports.USADv2_jsonAbi,
1433
+ eventName: 'ActionExecuted',
1434
+ args: filter,
1435
+ onLogs: (logs) => {
1436
+ logs.forEach((log) => {
1437
+ callback(log.args);
1438
+ });
1439
+ },
1440
+ });
1441
+ },
1442
+ /**
1443
+ * Watch ActionQueued events
1444
+ * @param callback Function to call when event is emitted
1445
+ * @param filter Optional filter for indexed parameters
1446
+ * @returns Unwatch function to stop listening
1447
+ */
1448
+ ActionQueued: (callback, filter) => {
1449
+ return this.publicClient.watchContractEvent({
1450
+ address: this.contractAddress,
1451
+ abi: exports.USADv2_jsonAbi,
1452
+ eventName: 'ActionQueued',
1453
+ args: filter,
1454
+ onLogs: (logs) => {
1455
+ logs.forEach((log) => {
1456
+ callback(log.args);
1457
+ });
1458
+ },
1459
+ });
1460
+ },
1461
+ /**
1462
+ * Watch AddressBlacklisted events
1463
+ * @param callback Function to call when event is emitted
1464
+ * @param filter Optional filter for indexed parameters
1465
+ * @returns Unwatch function to stop listening
1466
+ */
1467
+ AddressBlacklisted: (callback, filter) => {
1468
+ return this.publicClient.watchContractEvent({
1469
+ address: this.contractAddress,
1470
+ abi: exports.USADv2_jsonAbi,
1471
+ eventName: 'AddressBlacklisted',
1472
+ args: filter,
1473
+ onLogs: (logs) => {
1474
+ logs.forEach((log) => {
1475
+ callback(log.args);
1476
+ });
1477
+ },
1478
+ });
1479
+ },
1480
+ /**
1481
+ * Watch AddressUnblacklisted events
1482
+ * @param callback Function to call when event is emitted
1483
+ * @param filter Optional filter for indexed parameters
1484
+ * @returns Unwatch function to stop listening
1485
+ */
1486
+ AddressUnblacklisted: (callback, filter) => {
1487
+ return this.publicClient.watchContractEvent({
1488
+ address: this.contractAddress,
1489
+ abi: exports.USADv2_jsonAbi,
1490
+ eventName: 'AddressUnblacklisted',
1491
+ args: filter,
1492
+ onLogs: (logs) => {
1493
+ logs.forEach((log) => {
1494
+ callback(log.args);
1495
+ });
1496
+ },
1497
+ });
1498
+ },
1499
+ /**
1500
+ * Watch Approval events
1501
+ * @param callback Function to call when event is emitted
1502
+ * @param filter Optional filter for indexed parameters
1503
+ * @returns Unwatch function to stop listening
1504
+ */
1505
+ Approval: (callback, filter) => {
1506
+ return this.publicClient.watchContractEvent({
1507
+ address: this.contractAddress,
1508
+ abi: exports.USADv2_jsonAbi,
1509
+ eventName: 'Approval',
1510
+ args: filter,
1511
+ onLogs: (logs) => {
1512
+ logs.forEach((log) => {
1513
+ callback(log.args);
1514
+ });
1515
+ },
1516
+ });
1517
+ },
1518
+ /**
1519
+ * Watch Initialized events
1520
+ * @param callback Function to call when event is emitted
1521
+ * @param filter Optional filter for indexed parameters
1522
+ * @returns Unwatch function to stop listening
1523
+ */
1524
+ Initialized: (callback) => {
1525
+ return this.publicClient.watchContractEvent({
1526
+ address: this.contractAddress,
1527
+ abi: exports.USADv2_jsonAbi,
1528
+ eventName: 'Initialized',
1529
+ onLogs: (logs) => {
1530
+ logs.forEach((log) => {
1531
+ callback(log.args);
1532
+ });
1533
+ },
1534
+ });
1535
+ },
1536
+ /**
1537
+ * Watch OwnershipTransferred events
1538
+ * @param callback Function to call when event is emitted
1539
+ * @param filter Optional filter for indexed parameters
1540
+ * @returns Unwatch function to stop listening
1541
+ */
1542
+ OwnershipTransferred: (callback, filter) => {
1543
+ return this.publicClient.watchContractEvent({
1544
+ address: this.contractAddress,
1545
+ abi: exports.USADv2_jsonAbi,
1546
+ eventName: 'OwnershipTransferred',
1547
+ args: filter,
1548
+ onLogs: (logs) => {
1549
+ logs.forEach((log) => {
1550
+ callback(log.args);
1551
+ });
1552
+ },
1553
+ });
1554
+ },
1555
+ /**
1556
+ * Watch Paused events
1557
+ * @param callback Function to call when event is emitted
1558
+ * @param filter Optional filter for indexed parameters
1559
+ * @returns Unwatch function to stop listening
1560
+ */
1561
+ Paused: (callback) => {
1562
+ return this.publicClient.watchContractEvent({
1563
+ address: this.contractAddress,
1564
+ abi: exports.USADv2_jsonAbi,
1565
+ eventName: 'Paused',
1566
+ onLogs: (logs) => {
1567
+ logs.forEach((log) => {
1568
+ callback(log.args);
1569
+ });
1570
+ },
1571
+ });
1572
+ },
1573
+ /**
1574
+ * Watch Transfer events
1575
+ * @param callback Function to call when event is emitted
1576
+ * @param filter Optional filter for indexed parameters
1577
+ * @returns Unwatch function to stop listening
1578
+ */
1579
+ Transfer: (callback, filter) => {
1580
+ return this.publicClient.watchContractEvent({
1581
+ address: this.contractAddress,
1582
+ abi: exports.USADv2_jsonAbi,
1583
+ eventName: 'Transfer',
1584
+ args: filter,
1585
+ onLogs: (logs) => {
1586
+ logs.forEach((log) => {
1587
+ callback(log.args);
1588
+ });
1589
+ },
1590
+ });
1591
+ },
1592
+ /**
1593
+ * Watch Unpaused events
1594
+ * @param callback Function to call when event is emitted
1595
+ * @param filter Optional filter for indexed parameters
1596
+ * @returns Unwatch function to stop listening
1597
+ */
1598
+ Unpaused: (callback) => {
1599
+ return this.publicClient.watchContractEvent({
1600
+ address: this.contractAddress,
1601
+ abi: exports.USADv2_jsonAbi,
1602
+ eventName: 'Unpaused',
1603
+ onLogs: (logs) => {
1604
+ logs.forEach((log) => {
1605
+ callback(log.args);
1606
+ });
1607
+ },
1608
+ });
1609
+ }
1610
+ };
1611
+ }
1612
+ }
1613
+ exports.USADv2_json = USADv2_json;