@gearbox-protocol/sdk 5.0.1 → 6.0.0-next.1
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.
- package/dist/cjs/dev/calcLiquidatableLTs.js +5 -1
- package/dist/cjs/sdk/base/BaseContract.js +0 -1
- package/dist/cjs/sdk/chain/chains.js +0 -3
- package/dist/cjs/sdk/constants/networks.js +15 -34
- package/dist/cjs/sdk/market/MarketSuite.js +1 -5
- package/dist/cjs/sdk/market/oracle/PriceOracleBaseContract.js +52 -47
- package/dist/cjs/sdk/market/oracle/PriceOracleV300Contract.js +2 -3
- package/dist/cjs/sdk/market/oracle/PriceOracleV310Contract.js +2 -3
- package/dist/cjs/sdk/market/oracle/createPriceOracle.js +28 -9
- package/dist/cjs/sdk/market/pricefeeds/AbstractLPPriceFeed.js +2 -1
- package/dist/cjs/sdk/market/pricefeeds/RedstonePriceFeed.js +1 -1
- package/dist/cjs/sdk/plugins/V300StalenessPeriodPlugin.js +5 -5
- package/dist/cjs/sdk/sdk-legacy/core/endpoint.js +4 -4
- package/dist/esm/dev/calcLiquidatableLTs.js +5 -1
- package/dist/esm/sdk/base/BaseContract.js +0 -1
- package/dist/esm/sdk/chain/chains.js +0 -3
- package/dist/esm/sdk/constants/networks.js +15 -34
- package/dist/esm/sdk/market/MarketSuite.js +2 -6
- package/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js +53 -47
- package/dist/esm/sdk/market/oracle/PriceOracleV300Contract.js +2 -3
- package/dist/esm/sdk/market/oracle/PriceOracleV310Contract.js +2 -3
- package/dist/esm/sdk/market/oracle/createPriceOracle.js +27 -8
- package/dist/esm/sdk/market/pricefeeds/AbstractLPPriceFeed.js +2 -1
- package/dist/esm/sdk/market/pricefeeds/RedstonePriceFeed.js +2 -2
- package/dist/esm/sdk/plugins/V300StalenessPeriodPlugin.js +6 -6
- package/dist/esm/sdk/sdk-legacy/core/endpoint.js +4 -4
- package/dist/types/sdk/market/MarketSuite.d.ts +2 -2
- package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +28 -684
- package/dist/types/sdk/market/oracle/PriceOracleV300Contract.d.ts +1 -1
- package/dist/types/sdk/market/oracle/PriceOracleV310Contract.d.ts +2 -2
- package/dist/types/sdk/market/oracle/createPriceOracle.d.ts +14 -3
- package/dist/types/sdk/market/oracle/types.d.ts +97 -6
- package/dist/types/sdk/plugins/V300StalenessPeriodPlugin.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { Abi, Address
|
|
2
|
-
import { iPriceFeedCompressorAbi } from "../../../abi/compressors.js";
|
|
1
|
+
import type { Abi, Address } from "viem";
|
|
3
2
|
import type { BaseContractOptions } from "../../base/BaseContract.js";
|
|
4
|
-
import type {
|
|
3
|
+
import type { PriceOracleData } from "../../base/index.js";
|
|
5
4
|
import { BaseContract } from "../../base/index.js";
|
|
6
5
|
import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
7
6
|
import type { PriceOracleStateHuman } from "../../types/index.js";
|
|
@@ -9,13 +8,9 @@ import { AddressMap } from "../../utils/index.js";
|
|
|
9
8
|
import type { IPriceFeedContract, UpdatePriceFeedsResult } from "../pricefeeds/index.js";
|
|
10
9
|
import { PriceFeedRef } from "../pricefeeds/index.js";
|
|
11
10
|
import PriceFeedAnswerMap from "./PriceFeedAnswerMap.js";
|
|
12
|
-
import type { IPriceOracleContract, OnDemandPriceUpdate, PriceFeedsForTokensOptions } from "./types.js";
|
|
13
|
-
export declare class PriceOracleBaseContract<abi extends Abi | readonly unknown[]> extends BaseContract<abi> implements IPriceOracleContract {
|
|
11
|
+
import type { DelegatedOracleMulticall, IPriceOracleContract, OnDemandPriceUpdate, PriceFeedsForTokensOptions } from "./types.js";
|
|
12
|
+
export declare abstract class PriceOracleBaseContract<abi extends Abi | readonly unknown[]> extends BaseContract<abi> implements IPriceOracleContract {
|
|
14
13
|
#private;
|
|
15
|
-
/**
|
|
16
|
-
* Underlying token of market to which this price oracle belongs
|
|
17
|
-
*/
|
|
18
|
-
readonly underlying: Address;
|
|
19
14
|
/**
|
|
20
15
|
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
21
16
|
*/
|
|
@@ -32,7 +27,7 @@ export declare class PriceOracleBaseContract<abi extends Abi | readonly unknown[
|
|
|
32
27
|
* Mapping Token => Price in USD
|
|
33
28
|
*/
|
|
34
29
|
readonly reservePrices: PriceFeedAnswerMap;
|
|
35
|
-
constructor(sdk: GearboxSDK, args: BaseContractOptions<abi>, data: PriceOracleData
|
|
30
|
+
constructor(sdk: GearboxSDK, args: BaseContractOptions<abi>, data: PriceOracleData);
|
|
36
31
|
/**
|
|
37
32
|
* Returns main and reserve price feeds for given tokens
|
|
38
33
|
* @param tokens
|
|
@@ -68,715 +63,64 @@ export declare class PriceOracleBaseContract<abi extends Abi | readonly unknown[
|
|
|
68
63
|
reservePrice(token: Address): bigint;
|
|
69
64
|
/**
|
|
70
65
|
* Returns true if oracle's price feed tree contains given price feed
|
|
66
|
+
* This feed is not necessary connected to token, but can be a component of composite feed for some token
|
|
71
67
|
* @param priceFeed
|
|
72
68
|
* @returns
|
|
73
69
|
*/
|
|
74
70
|
usesPriceFeed(priceFeed: Address): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Tries to convert amount of token into underlying of current market
|
|
77
|
-
* @param token
|
|
78
|
-
* @param amount
|
|
79
|
-
* @param reserve
|
|
80
|
-
* @returns
|
|
81
|
-
*/
|
|
82
|
-
convertToUnderlying(token: Address, amount: bigint, reserve?: boolean): bigint;
|
|
83
71
|
/**
|
|
84
72
|
* Tries to convert amount of from one token to another, using latest known prices
|
|
85
73
|
* @param from
|
|
86
74
|
* @param to
|
|
87
75
|
* @param amount
|
|
88
|
-
* @param reserve
|
|
76
|
+
* @param reserve use reserve price feed instead of main
|
|
89
77
|
*/
|
|
90
78
|
convert(from: Address, to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
91
79
|
/**
|
|
92
80
|
* Tries to convert amount of token to USD, using latest known prices
|
|
93
81
|
* @param from
|
|
94
|
-
* @param to
|
|
95
82
|
* @param amount
|
|
96
|
-
* @param reserve
|
|
83
|
+
* @param reserve use reserve price feed instead of main
|
|
97
84
|
*/
|
|
98
85
|
convertToUSD(from: Address, amount: bigint, reserve?: boolean): bigint;
|
|
99
86
|
/**
|
|
100
87
|
* Tries to convert amount of USD to token, using latest known prices
|
|
101
88
|
* @param to
|
|
102
89
|
* @param amount
|
|
103
|
-
* @param reserve
|
|
90
|
+
* @param reserve use reserve price feed instead of main
|
|
104
91
|
*/
|
|
105
92
|
convertFromUSD(to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
106
93
|
/**
|
|
107
94
|
* Loads new prices for this oracle from PriceFeedCompressor
|
|
108
|
-
*
|
|
95
|
+
* Will (re)create price feeds if needed
|
|
109
96
|
*/
|
|
110
97
|
updatePrices(): Promise<void>;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
readonly type: "function";
|
|
125
|
-
readonly inputs: readonly [{
|
|
126
|
-
readonly name: "priceOracle";
|
|
127
|
-
readonly internalType: "address";
|
|
128
|
-
readonly type: "address";
|
|
129
|
-
}];
|
|
130
|
-
readonly name: "getPriceOracleState";
|
|
131
|
-
readonly outputs: readonly [{
|
|
132
|
-
readonly name: "";
|
|
133
|
-
readonly internalType: "struct PriceOracleState";
|
|
134
|
-
readonly type: "tuple";
|
|
135
|
-
readonly components: readonly [{
|
|
136
|
-
readonly name: "baseParams";
|
|
137
|
-
readonly internalType: "struct BaseParams";
|
|
138
|
-
readonly type: "tuple";
|
|
139
|
-
readonly components: readonly [{
|
|
140
|
-
readonly name: "addr";
|
|
141
|
-
readonly internalType: "address";
|
|
142
|
-
readonly type: "address";
|
|
143
|
-
}, {
|
|
144
|
-
readonly name: "version";
|
|
145
|
-
readonly internalType: "uint256";
|
|
146
|
-
readonly type: "uint256";
|
|
147
|
-
}, {
|
|
148
|
-
readonly name: "contractType";
|
|
149
|
-
readonly internalType: "bytes32";
|
|
150
|
-
readonly type: "bytes32";
|
|
151
|
-
}, {
|
|
152
|
-
readonly name: "serializedParams";
|
|
153
|
-
readonly internalType: "bytes";
|
|
154
|
-
readonly type: "bytes";
|
|
155
|
-
}];
|
|
156
|
-
}, {
|
|
157
|
-
readonly name: "priceFeedMap";
|
|
158
|
-
readonly internalType: "struct PriceFeedMapEntry[]";
|
|
159
|
-
readonly type: "tuple[]";
|
|
160
|
-
readonly components: readonly [{
|
|
161
|
-
readonly name: "token";
|
|
162
|
-
readonly internalType: "address";
|
|
163
|
-
readonly type: "address";
|
|
164
|
-
}, {
|
|
165
|
-
readonly name: "reserve";
|
|
166
|
-
readonly internalType: "bool";
|
|
167
|
-
readonly type: "bool";
|
|
168
|
-
}, {
|
|
169
|
-
readonly name: "priceFeed";
|
|
170
|
-
readonly internalType: "address";
|
|
171
|
-
readonly type: "address";
|
|
172
|
-
}, {
|
|
173
|
-
readonly name: "stalenessPeriod";
|
|
174
|
-
readonly internalType: "uint32";
|
|
175
|
-
readonly type: "uint32";
|
|
176
|
-
}];
|
|
177
|
-
}, {
|
|
178
|
-
readonly name: "priceFeedTree";
|
|
179
|
-
readonly internalType: "struct PriceFeedTreeNode[]";
|
|
180
|
-
readonly type: "tuple[]";
|
|
181
|
-
readonly components: readonly [{
|
|
182
|
-
readonly name: "baseParams";
|
|
183
|
-
readonly internalType: "struct BaseParams";
|
|
184
|
-
readonly type: "tuple";
|
|
185
|
-
readonly components: readonly [{
|
|
186
|
-
readonly name: "addr";
|
|
187
|
-
readonly internalType: "address";
|
|
188
|
-
readonly type: "address";
|
|
189
|
-
}, {
|
|
190
|
-
readonly name: "version";
|
|
191
|
-
readonly internalType: "uint256";
|
|
192
|
-
readonly type: "uint256";
|
|
193
|
-
}, {
|
|
194
|
-
readonly name: "contractType";
|
|
195
|
-
readonly internalType: "bytes32";
|
|
196
|
-
readonly type: "bytes32";
|
|
197
|
-
}, {
|
|
198
|
-
readonly name: "serializedParams";
|
|
199
|
-
readonly internalType: "bytes";
|
|
200
|
-
readonly type: "bytes";
|
|
201
|
-
}];
|
|
202
|
-
}, {
|
|
203
|
-
readonly name: "description";
|
|
204
|
-
readonly internalType: "string";
|
|
205
|
-
readonly type: "string";
|
|
206
|
-
}, {
|
|
207
|
-
readonly name: "decimals";
|
|
208
|
-
readonly internalType: "uint8";
|
|
209
|
-
readonly type: "uint8";
|
|
210
|
-
}, {
|
|
211
|
-
readonly name: "skipCheck";
|
|
212
|
-
readonly internalType: "bool";
|
|
213
|
-
readonly type: "bool";
|
|
214
|
-
}, {
|
|
215
|
-
readonly name: "updatable";
|
|
216
|
-
readonly internalType: "bool";
|
|
217
|
-
readonly type: "bool";
|
|
218
|
-
}, {
|
|
219
|
-
readonly name: "underlyingFeeds";
|
|
220
|
-
readonly internalType: "address[]";
|
|
221
|
-
readonly type: "address[]";
|
|
222
|
-
}, {
|
|
223
|
-
readonly name: "underlyingStalenessPeriods";
|
|
224
|
-
readonly internalType: "uint32[]";
|
|
225
|
-
readonly type: "uint32[]";
|
|
226
|
-
}, {
|
|
227
|
-
readonly name: "answer";
|
|
228
|
-
readonly internalType: "struct PriceFeedAnswer";
|
|
229
|
-
readonly type: "tuple";
|
|
230
|
-
readonly components: readonly [{
|
|
231
|
-
readonly name: "price";
|
|
232
|
-
readonly internalType: "int256";
|
|
233
|
-
readonly type: "int256";
|
|
234
|
-
}, {
|
|
235
|
-
readonly name: "updatedAt";
|
|
236
|
-
readonly internalType: "uint256";
|
|
237
|
-
readonly type: "uint256";
|
|
238
|
-
}, {
|
|
239
|
-
readonly name: "success";
|
|
240
|
-
readonly internalType: "bool";
|
|
241
|
-
readonly type: "bool";
|
|
242
|
-
}];
|
|
243
|
-
}];
|
|
244
|
-
}];
|
|
245
|
-
}];
|
|
246
|
-
readonly stateMutability: "view";
|
|
247
|
-
}, {
|
|
248
|
-
readonly type: "function";
|
|
249
|
-
readonly inputs: readonly [{
|
|
250
|
-
readonly name: "priceOracle";
|
|
251
|
-
readonly internalType: "address";
|
|
252
|
-
readonly type: "address";
|
|
253
|
-
}, {
|
|
254
|
-
readonly name: "tokens";
|
|
255
|
-
readonly internalType: "address[]";
|
|
256
|
-
readonly type: "address[]";
|
|
257
|
-
}];
|
|
258
|
-
readonly name: "getPriceOracleState";
|
|
259
|
-
readonly outputs: readonly [{
|
|
260
|
-
readonly name: "";
|
|
261
|
-
readonly internalType: "struct PriceOracleState";
|
|
262
|
-
readonly type: "tuple";
|
|
263
|
-
readonly components: readonly [{
|
|
264
|
-
readonly name: "baseParams";
|
|
265
|
-
readonly internalType: "struct BaseParams";
|
|
266
|
-
readonly type: "tuple";
|
|
267
|
-
readonly components: readonly [{
|
|
268
|
-
readonly name: "addr";
|
|
269
|
-
readonly internalType: "address";
|
|
270
|
-
readonly type: "address";
|
|
271
|
-
}, {
|
|
272
|
-
readonly name: "version";
|
|
273
|
-
readonly internalType: "uint256";
|
|
274
|
-
readonly type: "uint256";
|
|
275
|
-
}, {
|
|
276
|
-
readonly name: "contractType";
|
|
277
|
-
readonly internalType: "bytes32";
|
|
278
|
-
readonly type: "bytes32";
|
|
279
|
-
}, {
|
|
280
|
-
readonly name: "serializedParams";
|
|
281
|
-
readonly internalType: "bytes";
|
|
282
|
-
readonly type: "bytes";
|
|
283
|
-
}];
|
|
284
|
-
}, {
|
|
285
|
-
readonly name: "priceFeedMap";
|
|
286
|
-
readonly internalType: "struct PriceFeedMapEntry[]";
|
|
287
|
-
readonly type: "tuple[]";
|
|
288
|
-
readonly components: readonly [{
|
|
289
|
-
readonly name: "token";
|
|
290
|
-
readonly internalType: "address";
|
|
291
|
-
readonly type: "address";
|
|
292
|
-
}, {
|
|
293
|
-
readonly name: "reserve";
|
|
294
|
-
readonly internalType: "bool";
|
|
295
|
-
readonly type: "bool";
|
|
296
|
-
}, {
|
|
297
|
-
readonly name: "priceFeed";
|
|
298
|
-
readonly internalType: "address";
|
|
299
|
-
readonly type: "address";
|
|
300
|
-
}, {
|
|
301
|
-
readonly name: "stalenessPeriod";
|
|
302
|
-
readonly internalType: "uint32";
|
|
303
|
-
readonly type: "uint32";
|
|
304
|
-
}];
|
|
305
|
-
}, {
|
|
306
|
-
readonly name: "priceFeedTree";
|
|
307
|
-
readonly internalType: "struct PriceFeedTreeNode[]";
|
|
308
|
-
readonly type: "tuple[]";
|
|
309
|
-
readonly components: readonly [{
|
|
310
|
-
readonly name: "baseParams";
|
|
311
|
-
readonly internalType: "struct BaseParams";
|
|
312
|
-
readonly type: "tuple";
|
|
313
|
-
readonly components: readonly [{
|
|
314
|
-
readonly name: "addr";
|
|
315
|
-
readonly internalType: "address";
|
|
316
|
-
readonly type: "address";
|
|
317
|
-
}, {
|
|
318
|
-
readonly name: "version";
|
|
319
|
-
readonly internalType: "uint256";
|
|
320
|
-
readonly type: "uint256";
|
|
321
|
-
}, {
|
|
322
|
-
readonly name: "contractType";
|
|
323
|
-
readonly internalType: "bytes32";
|
|
324
|
-
readonly type: "bytes32";
|
|
325
|
-
}, {
|
|
326
|
-
readonly name: "serializedParams";
|
|
327
|
-
readonly internalType: "bytes";
|
|
328
|
-
readonly type: "bytes";
|
|
329
|
-
}];
|
|
330
|
-
}, {
|
|
331
|
-
readonly name: "description";
|
|
332
|
-
readonly internalType: "string";
|
|
333
|
-
readonly type: "string";
|
|
334
|
-
}, {
|
|
335
|
-
readonly name: "decimals";
|
|
336
|
-
readonly internalType: "uint8";
|
|
337
|
-
readonly type: "uint8";
|
|
338
|
-
}, {
|
|
339
|
-
readonly name: "skipCheck";
|
|
340
|
-
readonly internalType: "bool";
|
|
341
|
-
readonly type: "bool";
|
|
342
|
-
}, {
|
|
343
|
-
readonly name: "updatable";
|
|
344
|
-
readonly internalType: "bool";
|
|
345
|
-
readonly type: "bool";
|
|
346
|
-
}, {
|
|
347
|
-
readonly name: "underlyingFeeds";
|
|
348
|
-
readonly internalType: "address[]";
|
|
349
|
-
readonly type: "address[]";
|
|
350
|
-
}, {
|
|
351
|
-
readonly name: "underlyingStalenessPeriods";
|
|
352
|
-
readonly internalType: "uint32[]";
|
|
353
|
-
readonly type: "uint32[]";
|
|
354
|
-
}, {
|
|
355
|
-
readonly name: "answer";
|
|
356
|
-
readonly internalType: "struct PriceFeedAnswer";
|
|
357
|
-
readonly type: "tuple";
|
|
358
|
-
readonly components: readonly [{
|
|
359
|
-
readonly name: "price";
|
|
360
|
-
readonly internalType: "int256";
|
|
361
|
-
readonly type: "int256";
|
|
362
|
-
}, {
|
|
363
|
-
readonly name: "updatedAt";
|
|
364
|
-
readonly internalType: "uint256";
|
|
365
|
-
readonly type: "uint256";
|
|
366
|
-
}, {
|
|
367
|
-
readonly name: "success";
|
|
368
|
-
readonly internalType: "bool";
|
|
369
|
-
readonly type: "bool";
|
|
370
|
-
}];
|
|
371
|
-
}];
|
|
372
|
-
}];
|
|
373
|
-
}];
|
|
374
|
-
readonly stateMutability: "view";
|
|
375
|
-
}, {
|
|
376
|
-
readonly type: "function";
|
|
377
|
-
readonly inputs: readonly [{
|
|
378
|
-
readonly name: "filter";
|
|
379
|
-
readonly internalType: "struct MarketFilter";
|
|
380
|
-
readonly type: "tuple";
|
|
381
|
-
readonly components: readonly [{
|
|
382
|
-
readonly name: "configurators";
|
|
383
|
-
readonly internalType: "address[]";
|
|
384
|
-
readonly type: "address[]";
|
|
385
|
-
}, {
|
|
386
|
-
readonly name: "pools";
|
|
387
|
-
readonly internalType: "address[]";
|
|
388
|
-
readonly type: "address[]";
|
|
389
|
-
}, {
|
|
390
|
-
readonly name: "underlying";
|
|
391
|
-
readonly internalType: "address";
|
|
392
|
-
readonly type: "address";
|
|
393
|
-
}];
|
|
394
|
-
}];
|
|
395
|
-
readonly name: "getPriceOracles";
|
|
396
|
-
readonly outputs: readonly [{
|
|
397
|
-
readonly name: "";
|
|
398
|
-
readonly internalType: "struct PriceOracleState[]";
|
|
399
|
-
readonly type: "tuple[]";
|
|
400
|
-
readonly components: readonly [{
|
|
401
|
-
readonly name: "baseParams";
|
|
402
|
-
readonly internalType: "struct BaseParams";
|
|
403
|
-
readonly type: "tuple";
|
|
404
|
-
readonly components: readonly [{
|
|
405
|
-
readonly name: "addr";
|
|
406
|
-
readonly internalType: "address";
|
|
407
|
-
readonly type: "address";
|
|
408
|
-
}, {
|
|
409
|
-
readonly name: "version";
|
|
410
|
-
readonly internalType: "uint256";
|
|
411
|
-
readonly type: "uint256";
|
|
412
|
-
}, {
|
|
413
|
-
readonly name: "contractType";
|
|
414
|
-
readonly internalType: "bytes32";
|
|
415
|
-
readonly type: "bytes32";
|
|
416
|
-
}, {
|
|
417
|
-
readonly name: "serializedParams";
|
|
418
|
-
readonly internalType: "bytes";
|
|
419
|
-
readonly type: "bytes";
|
|
420
|
-
}];
|
|
421
|
-
}, {
|
|
422
|
-
readonly name: "priceFeedMap";
|
|
423
|
-
readonly internalType: "struct PriceFeedMapEntry[]";
|
|
424
|
-
readonly type: "tuple[]";
|
|
425
|
-
readonly components: readonly [{
|
|
426
|
-
readonly name: "token";
|
|
427
|
-
readonly internalType: "address";
|
|
428
|
-
readonly type: "address";
|
|
429
|
-
}, {
|
|
430
|
-
readonly name: "reserve";
|
|
431
|
-
readonly internalType: "bool";
|
|
432
|
-
readonly type: "bool";
|
|
433
|
-
}, {
|
|
434
|
-
readonly name: "priceFeed";
|
|
435
|
-
readonly internalType: "address";
|
|
436
|
-
readonly type: "address";
|
|
437
|
-
}, {
|
|
438
|
-
readonly name: "stalenessPeriod";
|
|
439
|
-
readonly internalType: "uint32";
|
|
440
|
-
readonly type: "uint32";
|
|
441
|
-
}];
|
|
442
|
-
}, {
|
|
443
|
-
readonly name: "priceFeedTree";
|
|
444
|
-
readonly internalType: "struct PriceFeedTreeNode[]";
|
|
445
|
-
readonly type: "tuple[]";
|
|
446
|
-
readonly components: readonly [{
|
|
447
|
-
readonly name: "baseParams";
|
|
448
|
-
readonly internalType: "struct BaseParams";
|
|
449
|
-
readonly type: "tuple";
|
|
450
|
-
readonly components: readonly [{
|
|
451
|
-
readonly name: "addr";
|
|
452
|
-
readonly internalType: "address";
|
|
453
|
-
readonly type: "address";
|
|
454
|
-
}, {
|
|
455
|
-
readonly name: "version";
|
|
456
|
-
readonly internalType: "uint256";
|
|
457
|
-
readonly type: "uint256";
|
|
458
|
-
}, {
|
|
459
|
-
readonly name: "contractType";
|
|
460
|
-
readonly internalType: "bytes32";
|
|
461
|
-
readonly type: "bytes32";
|
|
462
|
-
}, {
|
|
463
|
-
readonly name: "serializedParams";
|
|
464
|
-
readonly internalType: "bytes";
|
|
465
|
-
readonly type: "bytes";
|
|
466
|
-
}];
|
|
467
|
-
}, {
|
|
468
|
-
readonly name: "description";
|
|
469
|
-
readonly internalType: "string";
|
|
470
|
-
readonly type: "string";
|
|
471
|
-
}, {
|
|
472
|
-
readonly name: "decimals";
|
|
473
|
-
readonly internalType: "uint8";
|
|
474
|
-
readonly type: "uint8";
|
|
475
|
-
}, {
|
|
476
|
-
readonly name: "skipCheck";
|
|
477
|
-
readonly internalType: "bool";
|
|
478
|
-
readonly type: "bool";
|
|
479
|
-
}, {
|
|
480
|
-
readonly name: "updatable";
|
|
481
|
-
readonly internalType: "bool";
|
|
482
|
-
readonly type: "bool";
|
|
483
|
-
}, {
|
|
484
|
-
readonly name: "underlyingFeeds";
|
|
485
|
-
readonly internalType: "address[]";
|
|
486
|
-
readonly type: "address[]";
|
|
487
|
-
}, {
|
|
488
|
-
readonly name: "underlyingStalenessPeriods";
|
|
489
|
-
readonly internalType: "uint32[]";
|
|
490
|
-
readonly type: "uint32[]";
|
|
491
|
-
}, {
|
|
492
|
-
readonly name: "answer";
|
|
493
|
-
readonly internalType: "struct PriceFeedAnswer";
|
|
494
|
-
readonly type: "tuple";
|
|
495
|
-
readonly components: readonly [{
|
|
496
|
-
readonly name: "price";
|
|
497
|
-
readonly internalType: "int256";
|
|
498
|
-
readonly type: "int256";
|
|
499
|
-
}, {
|
|
500
|
-
readonly name: "updatedAt";
|
|
501
|
-
readonly internalType: "uint256";
|
|
502
|
-
readonly type: "uint256";
|
|
503
|
-
}, {
|
|
504
|
-
readonly name: "success";
|
|
505
|
-
readonly internalType: "bool";
|
|
506
|
-
readonly type: "bool";
|
|
507
|
-
}];
|
|
508
|
-
}];
|
|
509
|
-
}];
|
|
510
|
-
}];
|
|
511
|
-
readonly stateMutability: "view";
|
|
512
|
-
}, {
|
|
513
|
-
readonly type: "function";
|
|
514
|
-
readonly inputs: readonly [{
|
|
515
|
-
readonly name: "priceFeeds";
|
|
516
|
-
readonly internalType: "address[]";
|
|
517
|
-
readonly type: "address[]";
|
|
518
|
-
}];
|
|
519
|
-
readonly name: "getUpdatablePriceFeeds";
|
|
520
|
-
readonly outputs: readonly [{
|
|
521
|
-
readonly name: "";
|
|
522
|
-
readonly internalType: "struct BaseParams[]";
|
|
523
|
-
readonly type: "tuple[]";
|
|
524
|
-
readonly components: readonly [{
|
|
525
|
-
readonly name: "addr";
|
|
526
|
-
readonly internalType: "address";
|
|
527
|
-
readonly type: "address";
|
|
528
|
-
}, {
|
|
529
|
-
readonly name: "version";
|
|
530
|
-
readonly internalType: "uint256";
|
|
531
|
-
readonly type: "uint256";
|
|
532
|
-
}, {
|
|
533
|
-
readonly name: "contractType";
|
|
534
|
-
readonly internalType: "bytes32";
|
|
535
|
-
readonly type: "bytes32";
|
|
536
|
-
}, {
|
|
537
|
-
readonly name: "serializedParams";
|
|
538
|
-
readonly internalType: "bytes";
|
|
539
|
-
readonly type: "bytes";
|
|
540
|
-
}];
|
|
541
|
-
}];
|
|
542
|
-
readonly stateMutability: "view";
|
|
543
|
-
}, {
|
|
544
|
-
readonly type: "function";
|
|
545
|
-
readonly inputs: readonly [{
|
|
546
|
-
readonly name: "filter";
|
|
547
|
-
readonly internalType: "struct MarketFilter";
|
|
548
|
-
readonly type: "tuple";
|
|
549
|
-
readonly components: readonly [{
|
|
550
|
-
readonly name: "configurators";
|
|
551
|
-
readonly internalType: "address[]";
|
|
552
|
-
readonly type: "address[]";
|
|
553
|
-
}, {
|
|
554
|
-
readonly name: "pools";
|
|
555
|
-
readonly internalType: "address[]";
|
|
556
|
-
readonly type: "address[]";
|
|
557
|
-
}, {
|
|
558
|
-
readonly name: "underlying";
|
|
559
|
-
readonly internalType: "address";
|
|
560
|
-
readonly type: "address";
|
|
561
|
-
}];
|
|
562
|
-
}];
|
|
563
|
-
readonly name: "getUpdatablePriceFeeds";
|
|
564
|
-
readonly outputs: readonly [{
|
|
565
|
-
readonly name: "";
|
|
566
|
-
readonly internalType: "struct BaseParams[]";
|
|
567
|
-
readonly type: "tuple[]";
|
|
568
|
-
readonly components: readonly [{
|
|
569
|
-
readonly name: "addr";
|
|
570
|
-
readonly internalType: "address";
|
|
571
|
-
readonly type: "address";
|
|
572
|
-
}, {
|
|
573
|
-
readonly name: "version";
|
|
574
|
-
readonly internalType: "uint256";
|
|
575
|
-
readonly type: "uint256";
|
|
576
|
-
}, {
|
|
577
|
-
readonly name: "contractType";
|
|
578
|
-
readonly internalType: "bytes32";
|
|
579
|
-
readonly type: "bytes32";
|
|
580
|
-
}, {
|
|
581
|
-
readonly name: "serializedParams";
|
|
582
|
-
readonly internalType: "bytes";
|
|
583
|
-
readonly type: "bytes";
|
|
584
|
-
}];
|
|
585
|
-
}];
|
|
586
|
-
readonly stateMutability: "view";
|
|
587
|
-
}, {
|
|
588
|
-
readonly type: "function";
|
|
589
|
-
readonly inputs: readonly [{
|
|
590
|
-
readonly name: "filter";
|
|
591
|
-
readonly internalType: "struct MarketFilter";
|
|
592
|
-
readonly type: "tuple";
|
|
593
|
-
readonly components: readonly [{
|
|
594
|
-
readonly name: "configurators";
|
|
595
|
-
readonly internalType: "address[]";
|
|
596
|
-
readonly type: "address[]";
|
|
597
|
-
}, {
|
|
598
|
-
readonly name: "pools";
|
|
599
|
-
readonly internalType: "address[]";
|
|
600
|
-
readonly type: "address[]";
|
|
601
|
-
}, {
|
|
602
|
-
readonly name: "underlying";
|
|
603
|
-
readonly internalType: "address";
|
|
604
|
-
readonly type: "address";
|
|
605
|
-
}];
|
|
606
|
-
}];
|
|
607
|
-
readonly name: "loadPriceFeedTree";
|
|
608
|
-
readonly outputs: readonly [{
|
|
609
|
-
readonly name: "";
|
|
610
|
-
readonly internalType: "struct PriceFeedTreeNode[]";
|
|
611
|
-
readonly type: "tuple[]";
|
|
612
|
-
readonly components: readonly [{
|
|
613
|
-
readonly name: "baseParams";
|
|
614
|
-
readonly internalType: "struct BaseParams";
|
|
615
|
-
readonly type: "tuple";
|
|
616
|
-
readonly components: readonly [{
|
|
617
|
-
readonly name: "addr";
|
|
618
|
-
readonly internalType: "address";
|
|
619
|
-
readonly type: "address";
|
|
620
|
-
}, {
|
|
621
|
-
readonly name: "version";
|
|
622
|
-
readonly internalType: "uint256";
|
|
623
|
-
readonly type: "uint256";
|
|
624
|
-
}, {
|
|
625
|
-
readonly name: "contractType";
|
|
626
|
-
readonly internalType: "bytes32";
|
|
627
|
-
readonly type: "bytes32";
|
|
628
|
-
}, {
|
|
629
|
-
readonly name: "serializedParams";
|
|
630
|
-
readonly internalType: "bytes";
|
|
631
|
-
readonly type: "bytes";
|
|
632
|
-
}];
|
|
633
|
-
}, {
|
|
634
|
-
readonly name: "description";
|
|
635
|
-
readonly internalType: "string";
|
|
636
|
-
readonly type: "string";
|
|
637
|
-
}, {
|
|
638
|
-
readonly name: "decimals";
|
|
639
|
-
readonly internalType: "uint8";
|
|
640
|
-
readonly type: "uint8";
|
|
641
|
-
}, {
|
|
642
|
-
readonly name: "skipCheck";
|
|
643
|
-
readonly internalType: "bool";
|
|
644
|
-
readonly type: "bool";
|
|
645
|
-
}, {
|
|
646
|
-
readonly name: "updatable";
|
|
647
|
-
readonly internalType: "bool";
|
|
648
|
-
readonly type: "bool";
|
|
649
|
-
}, {
|
|
650
|
-
readonly name: "underlyingFeeds";
|
|
651
|
-
readonly internalType: "address[]";
|
|
652
|
-
readonly type: "address[]";
|
|
653
|
-
}, {
|
|
654
|
-
readonly name: "underlyingStalenessPeriods";
|
|
655
|
-
readonly internalType: "uint32[]";
|
|
656
|
-
readonly type: "uint32[]";
|
|
657
|
-
}, {
|
|
658
|
-
readonly name: "answer";
|
|
659
|
-
readonly internalType: "struct PriceFeedAnswer";
|
|
660
|
-
readonly type: "tuple";
|
|
661
|
-
readonly components: readonly [{
|
|
662
|
-
readonly name: "price";
|
|
663
|
-
readonly internalType: "int256";
|
|
664
|
-
readonly type: "int256";
|
|
665
|
-
}, {
|
|
666
|
-
readonly name: "updatedAt";
|
|
667
|
-
readonly internalType: "uint256";
|
|
668
|
-
readonly type: "uint256";
|
|
669
|
-
}, {
|
|
670
|
-
readonly name: "success";
|
|
671
|
-
readonly internalType: "bool";
|
|
672
|
-
readonly type: "bool";
|
|
673
|
-
}];
|
|
674
|
-
}];
|
|
675
|
-
}];
|
|
676
|
-
readonly stateMutability: "view";
|
|
677
|
-
}, {
|
|
678
|
-
readonly type: "function";
|
|
679
|
-
readonly inputs: readonly [{
|
|
680
|
-
readonly name: "priceFeeds";
|
|
681
|
-
readonly internalType: "address[]";
|
|
682
|
-
readonly type: "address[]";
|
|
683
|
-
}];
|
|
684
|
-
readonly name: "loadPriceFeedTree";
|
|
685
|
-
readonly outputs: readonly [{
|
|
686
|
-
readonly name: "";
|
|
687
|
-
readonly internalType: "struct PriceFeedTreeNode[]";
|
|
688
|
-
readonly type: "tuple[]";
|
|
689
|
-
readonly components: readonly [{
|
|
690
|
-
readonly name: "baseParams";
|
|
691
|
-
readonly internalType: "struct BaseParams";
|
|
692
|
-
readonly type: "tuple";
|
|
693
|
-
readonly components: readonly [{
|
|
694
|
-
readonly name: "addr";
|
|
695
|
-
readonly internalType: "address";
|
|
696
|
-
readonly type: "address";
|
|
697
|
-
}, {
|
|
698
|
-
readonly name: "version";
|
|
699
|
-
readonly internalType: "uint256";
|
|
700
|
-
readonly type: "uint256";
|
|
701
|
-
}, {
|
|
702
|
-
readonly name: "contractType";
|
|
703
|
-
readonly internalType: "bytes32";
|
|
704
|
-
readonly type: "bytes32";
|
|
705
|
-
}, {
|
|
706
|
-
readonly name: "serializedParams";
|
|
707
|
-
readonly internalType: "bytes";
|
|
708
|
-
readonly type: "bytes";
|
|
709
|
-
}];
|
|
710
|
-
}, {
|
|
711
|
-
readonly name: "description";
|
|
712
|
-
readonly internalType: "string";
|
|
713
|
-
readonly type: "string";
|
|
714
|
-
}, {
|
|
715
|
-
readonly name: "decimals";
|
|
716
|
-
readonly internalType: "uint8";
|
|
717
|
-
readonly type: "uint8";
|
|
718
|
-
}, {
|
|
719
|
-
readonly name: "skipCheck";
|
|
720
|
-
readonly internalType: "bool";
|
|
721
|
-
readonly type: "bool";
|
|
722
|
-
}, {
|
|
723
|
-
readonly name: "updatable";
|
|
724
|
-
readonly internalType: "bool";
|
|
725
|
-
readonly type: "bool";
|
|
726
|
-
}, {
|
|
727
|
-
readonly name: "underlyingFeeds";
|
|
728
|
-
readonly internalType: "address[]";
|
|
729
|
-
readonly type: "address[]";
|
|
730
|
-
}, {
|
|
731
|
-
readonly name: "underlyingStalenessPeriods";
|
|
732
|
-
readonly internalType: "uint32[]";
|
|
733
|
-
readonly type: "uint32[]";
|
|
734
|
-
}, {
|
|
735
|
-
readonly name: "answer";
|
|
736
|
-
readonly internalType: "struct PriceFeedAnswer";
|
|
737
|
-
readonly type: "tuple";
|
|
738
|
-
readonly components: readonly [{
|
|
739
|
-
readonly name: "price";
|
|
740
|
-
readonly internalType: "int256";
|
|
741
|
-
readonly type: "int256";
|
|
742
|
-
}, {
|
|
743
|
-
readonly name: "updatedAt";
|
|
744
|
-
readonly internalType: "uint256";
|
|
745
|
-
readonly type: "uint256";
|
|
746
|
-
}, {
|
|
747
|
-
readonly name: "success";
|
|
748
|
-
readonly internalType: "bool";
|
|
749
|
-
readonly type: "bool";
|
|
750
|
-
}];
|
|
751
|
-
}];
|
|
752
|
-
}];
|
|
753
|
-
readonly stateMutability: "view";
|
|
754
|
-
}, {
|
|
755
|
-
readonly type: "function";
|
|
756
|
-
readonly inputs: readonly [];
|
|
757
|
-
readonly name: "version";
|
|
758
|
-
readonly outputs: readonly [{
|
|
759
|
-
readonly name: "";
|
|
760
|
-
readonly internalType: "uint256";
|
|
761
|
-
readonly type: "uint256";
|
|
762
|
-
}];
|
|
763
|
-
readonly stateMutability: "view";
|
|
764
|
-
}];
|
|
765
|
-
address: `0x${string}`;
|
|
766
|
-
functionName: string;
|
|
767
|
-
args: any[];
|
|
768
|
-
};
|
|
769
|
-
onResult: (resp: ContractFunctionReturnType<typeof iPriceFeedCompressorAbi, "view", "getPriceOracleState">) => void;
|
|
770
|
-
};
|
|
98
|
+
/**
|
|
99
|
+
* Paired method to updatePrices, helps to update prices on all oracles in one multicall
|
|
100
|
+
*/
|
|
101
|
+
syncStateMulticall(): DelegatedOracleMulticall;
|
|
102
|
+
/**
|
|
103
|
+
* Helper function to handle situation when we have multiple different compressor data entries for same oracle
|
|
104
|
+
* This happens in v300
|
|
105
|
+
*
|
|
106
|
+
* @deprecated should be unnecessary after full v310 migration (oracles will be unique)
|
|
107
|
+
* @param data
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
110
|
+
merge(data: PriceOracleData): this;
|
|
771
111
|
/**
|
|
772
112
|
* Helper method to find "attachment point" of price feed (makes sense for updatable price feeds only) -
|
|
773
113
|
* returns token (in v3.0 can be ticker) and main/reserve flag
|
|
774
114
|
*
|
|
115
|
+
* @deprecated Should be gone after v310 migration
|
|
116
|
+
*
|
|
775
117
|
* @param priceFeed
|
|
776
118
|
* @returns
|
|
777
119
|
*/
|
|
778
120
|
findTokenForPriceFeed(priceFeed: Address): [token: Address | undefined, reserve: boolean];
|
|
121
|
+
/**
|
|
122
|
+
* Returns list of addresses that should be watched for events to sync state
|
|
123
|
+
*/
|
|
779
124
|
get watchAddresses(): Set<Address>;
|
|
780
125
|
stateHuman(raw?: boolean): PriceOracleStateHuman;
|
|
781
|
-
protected get priceFeedTree(): readonly PriceFeedTreeNode[];
|
|
782
126
|
}
|