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