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