@indexing/jiti 0.1.15 → 0.1.17

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
 
@@ -1175,7 +1176,10 @@ const $8deaea1ef39b6485$export$5beebc5708fabf3c = {
1175
1176
  for (const tx of typedBlock.transactions || []){
1176
1177
  if (!tx.receipt) continue;
1177
1178
  const timestamp = new Date(typedBlock.timestamp * 1000).toISOString();
1178
- const transactionGasFee = BigInt(tx.receipt.gasUsed) * BigInt(tx.receipt.effectiveGasPrice);
1179
+ // Some EVM forks (e.g. Cronos / Ethermint) omit effectiveGasPrice on the receipt;
1180
+ // fall back to the tx's gasPrice so gas-fee math doesn't throw and drop the whole block.
1181
+ const effectiveGasPrice = tx.receipt.effectiveGasPrice ?? tx.gasPrice ?? 0;
1182
+ const transactionGasFee = BigInt(tx.receipt.gasUsed ?? 0) * BigInt(effectiveGasPrice);
1179
1183
  // check if this tx has zkSync native ETH Transfer logs (used to skip unreliable traces)
1180
1184
  const hasZkSyncEthLogs = tx.receipt.logs.some((log)=>log.address.toLowerCase() === $8deaea1ef39b6485$var$ZKSYNC_NATIVE_ETH);
1181
1185
  // track direct ETH transfers
@@ -1565,19 +1569,25 @@ async function $45fec2af5a17964d$export$59c69e19e33761f6(storage, namespace, key
1565
1569
 
1566
1570
 
1567
1571
 
1572
+ // Per-network RPC host registry. A jiti consumer injects the hosts a resolver should use for a
1573
+ // given chain — e.g. the indexer points the TON jetton resolver at the same hosts oscar uses
1574
+ // (BlockPi/QuickNode from network_connections) so jiti avoids Orbs's per-IP rate limit on the
1575
+ // oscar box. Generic so future resolvers (other chains) reuse it. Empty for a network ⇒ the
1576
+ // resolver falls back to its built-in default (e.g. Orbs discovery for TON).
1577
+ const $eb4c6dcc5cce273f$var$rpcHostsByNetwork = new Map();
1578
+ function $eb4c6dcc5cce273f$export$7559df4097bd05d7(network, hosts) {
1579
+ $eb4c6dcc5cce273f$var$rpcHostsByNetwork.set(network.toUpperCase(), (hosts || []).filter(Boolean));
1580
+ }
1581
+ function $eb4c6dcc5cce273f$export$62908ad6afd56388(network) {
1582
+ return $eb4c6dcc5cce273f$var$rpcHostsByNetwork.get(network.toUpperCase()) ?? [];
1583
+ }
1584
+
1585
+
1568
1586
  const $b2a2726ff5c26695$export$a0a0f70252f1386f = "ton-jetton-wallet";
1569
1587
  const $b2a2726ff5c26695$var$ORBS_MANAGER_URL = "https://ton.access.orbs.network/mngr/nodes";
1570
1588
  const $b2a2726ff5c26695$var$ORBS_REFRESH_MS = 300000;
1571
1589
  let $b2a2726ff5c26695$var$orbsHosts = [];
1572
1590
  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
1591
  function $b2a2726ff5c26695$var$shuffled(hosts) {
1582
1592
  const a = [
1583
1593
  ...hosts
@@ -1597,7 +1607,8 @@ function $b2a2726ff5c26695$var$buildUrl(host) {
1597
1607
  return host.endsWith("/jsonRPC") ? host : `${host.replace(/\/$/, "")}/jsonRPC`;
1598
1608
  }
1599
1609
  async function $b2a2726ff5c26695$var$getHosts() {
1600
- if ($b2a2726ff5c26695$var$configuredHosts.length) return $b2a2726ff5c26695$var$shuffled($b2a2726ff5c26695$var$configuredHosts).map($b2a2726ff5c26695$var$buildUrl);
1610
+ const configured = (0, $eb4c6dcc5cce273f$export$62908ad6afd56388)("TON");
1611
+ if (configured.length) return $b2a2726ff5c26695$var$shuffled(configured).map($b2a2726ff5c26695$var$buildUrl);
1601
1612
  if ($b2a2726ff5c26695$var$orbsHosts.length && Date.now() - $b2a2726ff5c26695$var$orbsRefreshedAt < $b2a2726ff5c26695$var$ORBS_REFRESH_MS) return $b2a2726ff5c26695$var$shuffled($b2a2726ff5c26695$var$orbsHosts);
1602
1613
  try {
1603
1614
  const resp = await fetch($b2a2726ff5c26695$var$ORBS_MANAGER_URL, {
@@ -11965,6 +11976,7 @@ $parcel$exportWildcard($b4b970cc11bce2a5$exports, $4a8e5fd52443a474$exports);
11965
11976
 
11966
11977
  var $lCdWD = parcelRequire("lCdWD");
11967
11978
 
11979
+
11968
11980
  const $882b6d93070905b3$export$eab97d15b1788b8d = {
11969
11981
  ...$d7167569386d0d4c$exports
11970
11982
  };