@gearbox-protocol/sdk 9.12.8 → 9.12.10
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/sdk/market/oracle/PriceOracleBaseContract.js +6 -0
- package/dist/cjs/sdk/market/pricefeeds/AbstractLPPriceFeed.js +7 -2
- package/dist/cjs/sdk/market/pricefeeds/index.js +2 -0
- package/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js +6 -0
- package/dist/esm/sdk/market/pricefeeds/AbstractLPPriceFeed.js +5 -1
- package/dist/esm/sdk/market/pricefeeds/index.js +1 -0
- package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +4 -0
- package/dist/types/sdk/market/oracle/types.d.ts +4 -0
- package/dist/types/sdk/market/pricefeeds/AbstractLPPriceFeed.d.ts +1 -0
- package/dist/types/sdk/market/pricefeeds/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -175,6 +175,12 @@ class PriceOracleBaseContract extends import_base.BaseContract {
|
|
|
175
175
|
async updatePrices() {
|
|
176
176
|
await this.sdk.marketRegister.updatePrices([this.address]);
|
|
177
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* All price feed tree nodes known to this oracle
|
|
180
|
+
*/
|
|
181
|
+
get priceFeeds() {
|
|
182
|
+
return this.#priceFeedTree.values().map((node) => this.sdk.priceFeeds.mustGet(node.baseParams.addr));
|
|
183
|
+
}
|
|
178
184
|
/**
|
|
179
185
|
* Paired method to updatePrices, helps to update prices on all oracles in one multicall
|
|
180
186
|
*/
|
|
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var AbstractLPPriceFeed_exports = {};
|
|
20
20
|
__export(AbstractLPPriceFeed_exports, {
|
|
21
|
-
AbstractLPPriceFeedContract: () => AbstractLPPriceFeedContract
|
|
21
|
+
AbstractLPPriceFeedContract: () => AbstractLPPriceFeedContract,
|
|
22
|
+
isLPPriceFeed: () => isLPPriceFeed
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(AbstractLPPriceFeed_exports);
|
|
24
25
|
var import_viem = require("viem");
|
|
@@ -114,7 +115,11 @@ class AbstractLPPriceFeedContract extends import_AbstractPriceFeed.AbstractPrice
|
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
}
|
|
118
|
+
function isLPPriceFeed(priceFeed) {
|
|
119
|
+
return priceFeed instanceof AbstractLPPriceFeedContract;
|
|
120
|
+
}
|
|
117
121
|
// Annotate the CommonJS export names for ESM import in node:
|
|
118
122
|
0 && (module.exports = {
|
|
119
|
-
AbstractLPPriceFeedContract
|
|
123
|
+
AbstractLPPriceFeedContract,
|
|
124
|
+
isLPPriceFeed
|
|
120
125
|
});
|
|
@@ -15,6 +15,7 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
15
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
16
|
var pricefeeds_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(pricefeeds_exports);
|
|
18
|
+
__reExport(pricefeeds_exports, require("./AbstractLPPriceFeed.js"), module.exports);
|
|
18
19
|
__reExport(pricefeeds_exports, require("./AbstractPriceFeed.js"), module.exports);
|
|
19
20
|
__reExport(pricefeeds_exports, require("./BalancerStablePriceFeed.js"), module.exports);
|
|
20
21
|
__reExport(pricefeeds_exports, require("./BalancerWeightedPriceFeed.js"), module.exports);
|
|
@@ -39,6 +40,7 @@ __reExport(pricefeeds_exports, require("./YearnPriceFeed.js"), module.exports);
|
|
|
39
40
|
__reExport(pricefeeds_exports, require("./ZeroPriceFeed.js"), module.exports);
|
|
40
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
42
|
0 && (module.exports = {
|
|
43
|
+
...require("./AbstractLPPriceFeed.js"),
|
|
42
44
|
...require("./AbstractPriceFeed.js"),
|
|
43
45
|
...require("./BalancerStablePriceFeed.js"),
|
|
44
46
|
...require("./BalancerWeightedPriceFeed.js"),
|
|
@@ -146,6 +146,12 @@ class PriceOracleBaseContract extends BaseContract {
|
|
|
146
146
|
async updatePrices() {
|
|
147
147
|
await this.sdk.marketRegister.updatePrices([this.address]);
|
|
148
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* All price feed tree nodes known to this oracle
|
|
151
|
+
*/
|
|
152
|
+
get priceFeeds() {
|
|
153
|
+
return this.#priceFeedTree.values().map((node) => this.sdk.priceFeeds.mustGet(node.baseParams.addr));
|
|
154
|
+
}
|
|
149
155
|
/**
|
|
150
156
|
* Paired method to updatePrices, helps to update prices on all oracles in one multicall
|
|
151
157
|
*/
|
|
@@ -93,6 +93,10 @@ class AbstractLPPriceFeedContract extends AbstractPriceFeedContract {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
function isLPPriceFeed(priceFeed) {
|
|
97
|
+
return priceFeed instanceof AbstractLPPriceFeedContract;
|
|
98
|
+
}
|
|
96
99
|
export {
|
|
97
|
-
AbstractLPPriceFeedContract
|
|
100
|
+
AbstractLPPriceFeedContract,
|
|
101
|
+
isLPPriceFeed
|
|
98
102
|
};
|
|
@@ -90,6 +90,10 @@ export declare abstract class PriceOracleBaseContract<abi extends Abi | readonly
|
|
|
90
90
|
* Will (re)create price feeds if needed
|
|
91
91
|
*/
|
|
92
92
|
updatePrices(): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* All price feed tree nodes known to this oracle
|
|
95
|
+
*/
|
|
96
|
+
get priceFeeds(): IPriceFeedContract[];
|
|
93
97
|
/**
|
|
94
98
|
* Paired method to updatePrices, helps to update prices on all oracles in one multicall
|
|
95
99
|
*/
|
|
@@ -20,6 +20,10 @@ export interface OnDemandPriceUpdates<T = unknown> {
|
|
|
20
20
|
multicall: MultiCall[];
|
|
21
21
|
}
|
|
22
22
|
export interface IPriceOracleContract extends IBaseContract {
|
|
23
|
+
/**
|
|
24
|
+
* All price feed tree nodes known to this oracle
|
|
25
|
+
*/
|
|
26
|
+
priceFeeds: IPriceFeedContract[];
|
|
23
27
|
/**
|
|
24
28
|
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
25
29
|
*/
|
|
@@ -18,3 +18,4 @@ export declare abstract class AbstractLPPriceFeedContract<const abi extends Abi
|
|
|
18
18
|
static toLowerBound(value: bigint): bigint;
|
|
19
19
|
stateHuman(raw?: boolean): UnionOmit<LPPriceFeedStateHuman, "stalenessPeriod">;
|
|
20
20
|
}
|
|
21
|
+
export declare function isLPPriceFeed(priceFeed: unknown): priceFeed is AbstractLPPriceFeedContract<any>;
|