@gitmyabi/dusd 0.0.0-stage → 1.0.1

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