@gitmyabi/usd 1.0.5 → 1.0.6

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