@oddmaki-protocol/sdk 1.11.0 → 1.11.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/index.js CHANGED
@@ -11887,15 +11887,12 @@ var PriceMarketModule = class extends BaseModule {
11887
11887
  }
11888
11888
  async fetchPythHistoricalRaw(feedId, publishTime, windowSeconds) {
11889
11889
  const window = Math.max(0, Math.floor(windowSeconds));
11890
- const offsets = window === 0 ? [0] : Array.from(/* @__PURE__ */ new Set([
11891
- 0,
11892
- Math.floor(window / 4),
11893
- Math.floor(window / 2),
11894
- Math.floor(3 * window / 4),
11895
- window
11896
- ])).sort((a, b) => a - b);
11897
- for (const offset of offsets) {
11898
- const t = publishTime + offset;
11890
+ const offsets = window === 0 ? [0] : Array.from(/* @__PURE__ */ new Set([0, Math.floor(window / 2)])).sort((a, b) => a - b);
11891
+ for (let i = 0; i < offsets.length; i++) {
11892
+ if (i > 0) {
11893
+ await new Promise((r) => setTimeout(r, 200));
11894
+ }
11895
+ const t = publishTime + offsets[i];
11899
11896
  const url = `${PYTH_HERMES_BASE}/v2/updates/price/${t}?ids[]=${feedId}`;
11900
11897
  const response = await this.hermesFetchWithBackoff(url);
11901
11898
  if (response === null) continue;