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