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