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