@indexing/jiti 0.1.15 → 0.1.16

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/main.js CHANGED
@@ -143,8 +143,9 @@ $parcel$export(module.exports, "registerCacheNamespace", () => $226820b1648da9ad
143
143
  $parcel$export(module.exports, "createPostgresCacheStorage", () => (parcelRequire("lCdWD")).createPostgresCacheStorage);
144
144
  $parcel$export(module.exports, "lookupJettonWallet", () => $b2a2726ff5c26695$export$77ffdf974cb300ec);
145
145
  $parcel$export(module.exports, "resolveJettonWalletData", () => $b2a2726ff5c26695$export$cef9e9799d863462);
146
- $parcel$export(module.exports, "setTonRpcHosts", () => $b2a2726ff5c26695$export$c9db54a59e1b6652);
147
146
  $parcel$export(module.exports, "TON_JETTON_NAMESPACE", () => $b2a2726ff5c26695$export$a0a0f70252f1386f);
147
+ $parcel$export(module.exports, "setRpcHosts", () => $eb4c6dcc5cce273f$export$7559df4097bd05d7);
148
+ $parcel$export(module.exports, "getRpcHosts", () => $eb4c6dcc5cce273f$export$62908ad6afd56388);
148
149
  var $d7167569386d0d4c$exports = {};
149
150
  var $56acd58307ebf8e6$exports = {};
150
151
 
@@ -1565,19 +1566,25 @@ async function $45fec2af5a17964d$export$59c69e19e33761f6(storage, namespace, key
1565
1566
 
1566
1567
 
1567
1568
 
1569
+ // Per-network RPC host registry. A jiti consumer injects the hosts a resolver should use for a
1570
+ // given chain — e.g. the indexer points the TON jetton resolver at the same hosts oscar uses
1571
+ // (BlockPi/QuickNode from network_connections) so jiti avoids Orbs's per-IP rate limit on the
1572
+ // oscar box. Generic so future resolvers (other chains) reuse it. Empty for a network ⇒ the
1573
+ // resolver falls back to its built-in default (e.g. Orbs discovery for TON).
1574
+ const $eb4c6dcc5cce273f$var$rpcHostsByNetwork = new Map();
1575
+ function $eb4c6dcc5cce273f$export$7559df4097bd05d7(network, hosts) {
1576
+ $eb4c6dcc5cce273f$var$rpcHostsByNetwork.set(network.toUpperCase(), (hosts || []).filter(Boolean));
1577
+ }
1578
+ function $eb4c6dcc5cce273f$export$62908ad6afd56388(network) {
1579
+ return $eb4c6dcc5cce273f$var$rpcHostsByNetwork.get(network.toUpperCase()) ?? [];
1580
+ }
1581
+
1582
+
1568
1583
  const $b2a2726ff5c26695$export$a0a0f70252f1386f = "ton-jetton-wallet";
1569
1584
  const $b2a2726ff5c26695$var$ORBS_MANAGER_URL = "https://ton.access.orbs.network/mngr/nodes";
1570
1585
  const $b2a2726ff5c26695$var$ORBS_REFRESH_MS = 300000;
1571
1586
  let $b2a2726ff5c26695$var$orbsHosts = [];
1572
1587
  let $b2a2726ff5c26695$var$orbsRefreshedAt = 0;
1573
- // Consumer-injected TON RPC hosts (toncenter v2 jsonRPC-compatible base hosts). When set, the
1574
- // resolver uses THESE instead of Orbs discovery — e.g. the indexer injects oscar's configured
1575
- // TON hosts (BlockPi/QuickNode from network_connections) so jiti hits the same hosts oscar uses
1576
- // and avoids Orbs's per-IP rate limit on the oscar box. Empty ⇒ fall back to Orbs discovery.
1577
- let $b2a2726ff5c26695$var$configuredHosts = [];
1578
- function $b2a2726ff5c26695$export$c9db54a59e1b6652(hosts) {
1579
- $b2a2726ff5c26695$var$configuredHosts = (hosts || []).filter(Boolean);
1580
- }
1581
1588
  function $b2a2726ff5c26695$var$shuffled(hosts) {
1582
1589
  const a = [
1583
1590
  ...hosts
@@ -1597,7 +1604,8 @@ function $b2a2726ff5c26695$var$buildUrl(host) {
1597
1604
  return host.endsWith("/jsonRPC") ? host : `${host.replace(/\/$/, "")}/jsonRPC`;
1598
1605
  }
1599
1606
  async function $b2a2726ff5c26695$var$getHosts() {
1600
- if ($b2a2726ff5c26695$var$configuredHosts.length) return $b2a2726ff5c26695$var$shuffled($b2a2726ff5c26695$var$configuredHosts).map($b2a2726ff5c26695$var$buildUrl);
1607
+ const configured = (0, $eb4c6dcc5cce273f$export$62908ad6afd56388)("TON");
1608
+ if (configured.length) return $b2a2726ff5c26695$var$shuffled(configured).map($b2a2726ff5c26695$var$buildUrl);
1601
1609
  if ($b2a2726ff5c26695$var$orbsHosts.length && Date.now() - $b2a2726ff5c26695$var$orbsRefreshedAt < $b2a2726ff5c26695$var$ORBS_REFRESH_MS) return $b2a2726ff5c26695$var$shuffled($b2a2726ff5c26695$var$orbsHosts);
1602
1610
  try {
1603
1611
  const resp = await fetch($b2a2726ff5c26695$var$ORBS_MANAGER_URL, {
@@ -11965,6 +11973,7 @@ $parcel$exportWildcard($b4b970cc11bce2a5$exports, $4a8e5fd52443a474$exports);
11965
11973
 
11966
11974
  var $lCdWD = parcelRequire("lCdWD");
11967
11975
 
11976
+
11968
11977
  const $882b6d93070905b3$export$eab97d15b1788b8d = {
11969
11978
  ...$d7167569386d0d4c$exports
11970
11979
  };