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