@xyo-network/xl1-providers 4.0.10 → 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.
@@ -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;