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