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