@gearbox-protocol/sdk 10.2.8 → 10.2.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.
@@ -191,13 +191,22 @@ class PythUpdater extends import_base.SDKConstruct {
191
191
  },
192
192
  { attempts: 3, exponent: 2, interval: 200 }
193
193
  );
194
- return respToCalldata(resp);
194
+ const result = respToCalldata(resp);
195
+ if (!this.#ignoreMissingFeeds && result.length !== dataFeedsIds.size) {
196
+ throw new Error(
197
+ `expected ${dataFeedsIds.size} price feeds, got ${result.length}`
198
+ );
199
+ }
200
+ return result;
195
201
  }
196
202
  }
197
203
  function isPyth(pf) {
198
204
  return pf.contractType === "PRICE_FEED::PYTH";
199
205
  }
200
206
  function respToCalldata(resp) {
207
+ if (resp.binary.data.length === 0) {
208
+ return [];
209
+ }
201
210
  const updates = splitAccumulatorUpdates(resp.binary.data[0]);
202
211
  return updates.map(({ data, dataFeedId, timestamp }) => {
203
212
  return {
@@ -171,13 +171,22 @@ class PythUpdater extends SDKConstruct {
171
171
  },
172
172
  { attempts: 3, exponent: 2, interval: 200 }
173
173
  );
174
- return respToCalldata(resp);
174
+ const result = respToCalldata(resp);
175
+ if (!this.#ignoreMissingFeeds && result.length !== dataFeedsIds.size) {
176
+ throw new Error(
177
+ `expected ${dataFeedsIds.size} price feeds, got ${result.length}`
178
+ );
179
+ }
180
+ return result;
175
181
  }
176
182
  }
177
183
  function isPyth(pf) {
178
184
  return pf.contractType === "PRICE_FEED::PYTH";
179
185
  }
180
186
  function respToCalldata(resp) {
187
+ if (resp.binary.data.length === 0) {
188
+ return [];
189
+ }
181
190
  const updates = splitAccumulatorUpdates(resp.binary.data[0]);
182
191
  return updates.map(({ data, dataFeedId, timestamp }) => {
183
192
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "10.2.8",
3
+ "version": "10.2.9",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",