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