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