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