@indexing/jiti 0.1.14 → 0.1.15
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 +15 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +15 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -1553,6 +1553,14 @@ const $cfe9a1176e32c0c3$var$ORBS_MANAGER_URL = "https://ton.access.orbs.network/
|
|
|
1553
1553
|
const $cfe9a1176e32c0c3$var$ORBS_REFRESH_MS = 300000;
|
|
1554
1554
|
let $cfe9a1176e32c0c3$var$orbsHosts = [];
|
|
1555
1555
|
let $cfe9a1176e32c0c3$var$orbsRefreshedAt = 0;
|
|
1556
|
+
// Consumer-injected TON RPC hosts (toncenter v2 jsonRPC-compatible base hosts). When set, the
|
|
1557
|
+
// resolver uses THESE instead of Orbs discovery — e.g. the indexer injects oscar's configured
|
|
1558
|
+
// TON hosts (BlockPi/QuickNode from network_connections) so jiti hits the same hosts oscar uses
|
|
1559
|
+
// and avoids Orbs's per-IP rate limit on the oscar box. Empty ⇒ fall back to Orbs discovery.
|
|
1560
|
+
let $cfe9a1176e32c0c3$var$configuredHosts = [];
|
|
1561
|
+
function $cfe9a1176e32c0c3$export$c9db54a59e1b6652(hosts) {
|
|
1562
|
+
$cfe9a1176e32c0c3$var$configuredHosts = (hosts || []).filter(Boolean);
|
|
1563
|
+
}
|
|
1556
1564
|
function $cfe9a1176e32c0c3$var$shuffled(hosts) {
|
|
1557
1565
|
const a = [
|
|
1558
1566
|
...hosts
|
|
@@ -1566,7 +1574,13 @@ function $cfe9a1176e32c0c3$var$shuffled(hosts) {
|
|
|
1566
1574
|
}
|
|
1567
1575
|
return a;
|
|
1568
1576
|
}
|
|
1577
|
+
// toncenter v2 speaks JSON-RPC at `<host>/jsonRPC`. Orbs hosts already end in it; BlockPi-style
|
|
1578
|
+
// base hosts (…/rpc/<key>) need it appended — mirrors oscar's TON buildUrl.
|
|
1579
|
+
function $cfe9a1176e32c0c3$var$buildUrl(host) {
|
|
1580
|
+
return host.endsWith("/jsonRPC") ? host : `${host.replace(/\/$/, "")}/jsonRPC`;
|
|
1581
|
+
}
|
|
1569
1582
|
async function $cfe9a1176e32c0c3$var$getHosts() {
|
|
1583
|
+
if ($cfe9a1176e32c0c3$var$configuredHosts.length) return $cfe9a1176e32c0c3$var$shuffled($cfe9a1176e32c0c3$var$configuredHosts).map($cfe9a1176e32c0c3$var$buildUrl);
|
|
1570
1584
|
if ($cfe9a1176e32c0c3$var$orbsHosts.length && Date.now() - $cfe9a1176e32c0c3$var$orbsRefreshedAt < $cfe9a1176e32c0c3$var$ORBS_REFRESH_MS) return $cfe9a1176e32c0c3$var$shuffled($cfe9a1176e32c0c3$var$orbsHosts);
|
|
1571
1585
|
try {
|
|
1572
1586
|
const resp = await fetch($cfe9a1176e32c0c3$var$ORBS_MANAGER_URL, {
|
|
@@ -11949,5 +11963,5 @@ function $149c1bd638913645$export$a07bfd14bbc36e4b(key) {
|
|
|
11949
11963
|
|
|
11950
11964
|
|
|
11951
11965
|
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};
|
|
11966
|
+
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$c9db54a59e1b6652 as setTonRpcHosts, $cfe9a1176e32c0c3$export$a0a0f70252f1386f as TON_JETTON_NAMESPACE};
|
|
11953
11967
|
//# sourceMappingURL=module.js.map
|