@xyo-network/xl1-providers 4.0.9 → 4.0.11

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.
@@ -14,9 +14,10 @@ export interface BasicRestViewerLocatorOptions {
14
14
  fetchFn?: typeof globalThis.fetch;
15
15
  /**
16
16
  * Whether `XyoViewer` precomputes network-stake-reward positions across the whole chain at
17
- * startup. Defaults to `true` (matching `SimpleXyoViewer`'s own default), but that precompute
18
- * issues one REST round trip per position/step, which can be slow or fragile against a large,
19
- * live chain set `false` for a lighter-weight client that doesn't need reward data.
17
+ * startup. Defaults to `false` here — unlike `SimpleXyoViewer`'s own node-side default of
18
+ * `true` — because that precompute issues one REST round trip per position/step, which against
19
+ * a large live chain turns gateway construction from seconds into minutes-or-worse. Set `true`
20
+ * only when the client actually needs reward data warmed at startup.
20
21
  */
21
22
  initRewardsCache?: boolean;
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"basicRestViewerLocator.d.ts","sourceRoot":"","sources":["../../../src/locators/basicRestViewerLocator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACiC,oBAAoB,EAChE,MAAM,+BAA+B,CAAA;AAgBtC,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,0IAA0I;IAC1I,MAAM,EAAE,oBAAoB,CAAA;IAC5B,yIAAyI;IACzI,UAAU,CAAC,EAAE,oBAAoB,CAAA;IACjC,gIAAgI;IAChI,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,sHAAsH;IACtH,OAAO,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IACjC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,6BAA6B,yJAyExC"}
1
+ {"version":3,"file":"basicRestViewerLocator.d.ts","sourceRoot":"","sources":["../../../src/locators/basicRestViewerLocator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACiC,oBAAoB,EAChE,MAAM,+BAA+B,CAAA;AAgBtC,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,0IAA0I;IAC1I,MAAM,EAAE,oBAAoB,CAAA;IAC5B,yIAAyI;IACzI,UAAU,CAAC,EAAE,oBAAoB,CAAA;IACjC,gIAAgI;IAChI,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,sHAAsH;IACtH,OAAO,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IACjC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,6BAA6B,yJAyExC"}
@@ -1625,11 +1625,12 @@ async function basicRestViewerLocator(name, restConfig, dataLakeEndpoint, option
1625
1625
  locator.registerMany([
1626
1626
  SimpleXyoGateway3.factory(SimpleXyoGateway3.dependencies, {}),
1627
1627
  SimpleXyoConnectionViewer.factory(SimpleXyoConnectionViewer.dependencies, {}),
1628
- SimpleStakeEventsViewer3.factory(SimpleStakeEventsViewer3.dependencies, { positions: [] })
1628
+ SimpleStakeEventsViewer3.factory(SimpleStakeEventsViewer3.dependencies, { positions: [] }),
1629
+ // always registered with an explicit initRewardsCache: the REST default is false (see
1630
+ // BasicRestViewerLocatorOptions) — SimpleXyoViewer's own default of true would walk the whole
1631
+ // chain one round trip per position/step during gateway construction
1632
+ SimpleXyoViewer.factory(SimpleXyoViewer.dependencies, { initRewardsCache: options?.initRewardsCache ?? false })
1629
1633
  ]);
1630
- if (isDefined4(options?.initRewardsCache)) {
1631
- locator.register(SimpleXyoViewer.factory(SimpleXyoViewer.dependencies, { initRewardsCache: options.initRewardsCache }));
1632
- }
1633
1634
  const fetchFn = options?.fetchFn;
1634
1635
  const chainStateBaseUrl = (restConfig.chainState ?? restConfig.blocks).baseUrl;
1635
1636
  const indexBaseUrl = (restConfig.index ?? restConfig.blocks).baseUrl;