@gitmyabi/usd 1.0.0 → 1.0.3

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