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