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