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