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