@gearbox-protocol/sdk 9.12.7 → 9.12.9

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.
@@ -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
  */
@@ -222,6 +222,9 @@ class RedstoneUpdater extends import_base.SDKConstruct {
222
222
  ignoreMissingFeed: this.#ignoreMissingFeeds,
223
223
  enableEnhancedLogs: this.#enableLogging
224
224
  });
225
+ wrapper.setMetadataTimestamp(
226
+ this.#historicalTimestampMs ?? Number(this.sdk.timestamp) * 1e3
227
+ );
225
228
  const dataPayload = await (0, import_utils.retry)(
226
229
  () => wrapper.prepareRedstonePayload(true),
227
230
  { attempts: 5, interval: this.#historicalTimestampMs ? 30500 : 250 }
@@ -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
  */
@@ -200,6 +200,9 @@ class RedstoneUpdater extends SDKConstruct {
200
200
  ignoreMissingFeed: this.#ignoreMissingFeeds,
201
201
  enableEnhancedLogs: this.#enableLogging
202
202
  });
203
+ wrapper.setMetadataTimestamp(
204
+ this.#historicalTimestampMs ?? Number(this.sdk.timestamp) * 1e3
205
+ );
203
206
  const dataPayload = await retry(
204
207
  () => wrapper.prepareRedstonePayload(true),
205
208
  { attempts: 5, interval: this.#historicalTimestampMs ? 30500 : 250 }
@@ -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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "9.12.7",
3
+ "version": "9.12.9",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",