@gitmyabi/pngvn 0.0.0-stage → 1.0.0

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