@gitmyabi/popo 1.0.1 → 1.0.2

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