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