@secondlayer/subgraphs 4.0.3 → 4.0.5

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.
@@ -1668,7 +1668,7 @@ import { sql as sql3 } from "kysely";
1668
1668
  // src/runtime/block-source.ts
1669
1669
  import { getSourceDb as getSourceDb2 } from "@secondlayer/shared/db";
1670
1670
  import {
1671
- IndexHttpClient
1671
+ createInternalIndexHttpClient
1672
1672
  } from "@secondlayer/shared/index-http";
1673
1673
  import { logger as logger4 } from "@secondlayer/shared/logger";
1674
1674
 
@@ -2024,12 +2024,7 @@ class FallbackBlockSource {
2024
2024
  }
2025
2025
  var postgresBlockSource = new PostgresBlockSource;
2026
2026
  function buildHttpClient() {
2027
- const baseUrl = process.env.SUBGRAPH_INDEX_API_URL ?? process.env.STREAMS_API_URL ?? "http://api:3800";
2028
- return new IndexHttpClient({
2029
- indexBaseUrl: baseUrl,
2030
- streamsBaseUrl: baseUrl,
2031
- streamsApiKey: process.env.STREAMS_INTERNAL_API_KEY ?? "sk-sl_streams_decode_internal"
2032
- });
2027
+ return createInternalIndexHttpClient();
2033
2028
  }
2034
2029
  function resolveBlockSource(subgraph) {
2035
2030
  if (process.env.SUBGRAPH_SOURCE === "streams-index" && subgraph && isStreamsIndexEligible(subgraph)) {
@@ -3980,7 +3975,9 @@ import {
3980
3975
 
3981
3976
  // src/runtime/streams-reorg-poll.ts
3982
3977
  import { getErrorMessage as getErrorMessage5 } from "@secondlayer/shared";
3983
- import { IndexHttpClient as IndexHttpClient2 } from "@secondlayer/shared/index-http";
3978
+ import {
3979
+ createInternalIndexHttpClient as createInternalIndexHttpClient2
3980
+ } from "@secondlayer/shared/index-http";
3984
3981
  import { logger as logger12 } from "@secondlayer/shared/logger";
3985
3982
  var POLL_MS = Number(process.env.SUBGRAPH_REORG_POLL_MS) || 15000;
3986
3983
  var STARTUP_MARGIN_MS = 60 * 60 * 1000;
@@ -4005,12 +4002,7 @@ async function pollReorgsOnce(http2, cursor, onReorg, handled) {
4005
4002
  return next_since ?? cursor;
4006
4003
  }
4007
4004
  function startStreamsReorgPoll(onReorg) {
4008
- const baseUrl = process.env.SUBGRAPH_INDEX_API_URL ?? process.env.STREAMS_API_URL ?? "http://api:3800";
4009
- const http2 = new IndexHttpClient2({
4010
- indexBaseUrl: baseUrl,
4011
- streamsBaseUrl: baseUrl,
4012
- streamsApiKey: process.env.STREAMS_INTERNAL_API_KEY ?? "sk-sl_streams_decode_internal"
4013
- });
4005
+ const http2 = createInternalIndexHttpClient2();
4014
4006
  let since = new Date(Date.now() - STARTUP_MARGIN_MS).toISOString();
4015
4007
  let running = true;
4016
4008
  let timer;
@@ -4392,5 +4384,5 @@ export {
4392
4384
  startSubgraphOperationRunner
4393
4385
  };
4394
4386
 
4395
- //# debugId=861951DF1312D9D664756E2164756E21
4387
+ //# debugId=175795E59F84AF1D64756E2164756E21
4396
4388
  //# sourceMappingURL=processor.js.map