@gitmyabi/popo 1.0.0 → 1.0.1

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