@indexing/jiti 0.1.14 → 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/module.js CHANGED
@@ -1548,6 +1548,20 @@ async function $692184cb0ed76c37$export$59c69e19e33761f6(storage, namespace, key
1548
1548
 
1549
1549
 
1550
1550
 
1551
+ // Per-network RPC host registry. A jiti consumer injects the hosts a resolver should use for a
1552
+ // given chain — e.g. the indexer points the TON jetton resolver at the same hosts oscar uses
1553
+ // (BlockPi/QuickNode from network_connections) so jiti avoids Orbs's per-IP rate limit on the
1554
+ // oscar box. Generic so future resolvers (other chains) reuse it. Empty for a network ⇒ the
1555
+ // resolver falls back to its built-in default (e.g. Orbs discovery for TON).
1556
+ const $fd51662490d4092f$var$rpcHostsByNetwork = new Map();
1557
+ function $fd51662490d4092f$export$7559df4097bd05d7(network, hosts) {
1558
+ $fd51662490d4092f$var$rpcHostsByNetwork.set(network.toUpperCase(), (hosts || []).filter(Boolean));
1559
+ }
1560
+ function $fd51662490d4092f$export$62908ad6afd56388(network) {
1561
+ return $fd51662490d4092f$var$rpcHostsByNetwork.get(network.toUpperCase()) ?? [];
1562
+ }
1563
+
1564
+
1551
1565
  const $cfe9a1176e32c0c3$export$a0a0f70252f1386f = "ton-jetton-wallet";
1552
1566
  const $cfe9a1176e32c0c3$var$ORBS_MANAGER_URL = "https://ton.access.orbs.network/mngr/nodes";
1553
1567
  const $cfe9a1176e32c0c3$var$ORBS_REFRESH_MS = 300000;
@@ -1566,7 +1580,14 @@ function $cfe9a1176e32c0c3$var$shuffled(hosts) {
1566
1580
  }
1567
1581
  return a;
1568
1582
  }
1583
+ // toncenter v2 speaks JSON-RPC at `<host>/jsonRPC`. Orbs hosts already end in it; BlockPi-style
1584
+ // base hosts (…/rpc/<key>) need it appended — mirrors oscar's TON buildUrl.
1585
+ function $cfe9a1176e32c0c3$var$buildUrl(host) {
1586
+ return host.endsWith("/jsonRPC") ? host : `${host.replace(/\/$/, "")}/jsonRPC`;
1587
+ }
1569
1588
  async function $cfe9a1176e32c0c3$var$getHosts() {
1589
+ const configured = (0, $fd51662490d4092f$export$62908ad6afd56388)("TON");
1590
+ if (configured.length) return $cfe9a1176e32c0c3$var$shuffled(configured).map($cfe9a1176e32c0c3$var$buildUrl);
1570
1591
  if ($cfe9a1176e32c0c3$var$orbsHosts.length && Date.now() - $cfe9a1176e32c0c3$var$orbsRefreshedAt < $cfe9a1176e32c0c3$var$ORBS_REFRESH_MS) return $cfe9a1176e32c0c3$var$shuffled($cfe9a1176e32c0c3$var$orbsHosts);
1571
1592
  try {
1572
1593
  const resp = await fetch($cfe9a1176e32c0c3$var$ORBS_MANAGER_URL, {
@@ -11934,6 +11955,7 @@ $parcel$exportWildcard($a4e0e4b4a62175c4$exports, $e64a550a52a9d690$exports);
11934
11955
 
11935
11956
  var $cP1H0 = parcelRequire("cP1H0");
11936
11957
 
11958
+
11937
11959
  const $149c1bd638913645$export$eab97d15b1788b8d = {
11938
11960
  ...$fde9406d76ec24a9$exports
11939
11961
  };
@@ -11949,5 +11971,5 @@ function $149c1bd638913645$export$a07bfd14bbc36e4b(key) {
11949
11971
 
11950
11972
 
11951
11973
  var createPostgresCacheStorage = parcelRequire("cP1H0").createPostgresCacheStorage;
11952
- export {$149c1bd638913645$export$eab97d15b1788b8d as utils, $149c1bd638913645$export$a8fc3402335b0b04 as templates, $149c1bd638913645$export$cceb5167b935aafb as getAllTemplates, $149c1bd638913645$export$a07bfd14bbc36e4b as getTemplateByKey, $692184cb0ed76c37$export$2aca74ef9665e35d as cacheGet, $692184cb0ed76c37$export$59c69e19e33761f6 as cacheSet, $caa0db003a346aa2$export$2b845901f37b4099 as registerCacheNamespace, createPostgresCacheStorage as createPostgresCacheStorage, $cfe9a1176e32c0c3$export$77ffdf974cb300ec as lookupJettonWallet, $cfe9a1176e32c0c3$export$cef9e9799d863462 as resolveJettonWalletData, $cfe9a1176e32c0c3$export$a0a0f70252f1386f as TON_JETTON_NAMESPACE};
11974
+ export {$149c1bd638913645$export$eab97d15b1788b8d as utils, $149c1bd638913645$export$a8fc3402335b0b04 as templates, $149c1bd638913645$export$cceb5167b935aafb as getAllTemplates, $149c1bd638913645$export$a07bfd14bbc36e4b as getTemplateByKey, $692184cb0ed76c37$export$2aca74ef9665e35d as cacheGet, $692184cb0ed76c37$export$59c69e19e33761f6 as cacheSet, $caa0db003a346aa2$export$2b845901f37b4099 as registerCacheNamespace, createPostgresCacheStorage as createPostgresCacheStorage, $cfe9a1176e32c0c3$export$77ffdf974cb300ec as lookupJettonWallet, $cfe9a1176e32c0c3$export$cef9e9799d863462 as resolveJettonWalletData, $cfe9a1176e32c0c3$export$a0a0f70252f1386f as TON_JETTON_NAMESPACE, $fd51662490d4092f$export$7559df4097bd05d7 as setRpcHosts, $fd51662490d4092f$export$62908ad6afd56388 as getRpcHosts};
11953
11975
  //# sourceMappingURL=module.js.map