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