@fiderail/indexer 0.0.0-stage → 2.3.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FideRail Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,48 @@
1
- # Temporary Holding Version
1
+ # @fiderail/indexer
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Unified 4-chain x 2-stablecoin indexer (EVM + SVM adapters), CDP Bazaar and PayAI capability synchronizer, and SSRF-hardened L1 liveness probe and zero-payment x402 endpoint grader for [FideRail](https://fiderail.com).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @fiderail/indexer
9
+ ```
10
+
11
+ ## Quick Usage
12
+
13
+ ```ts
14
+ import { createIndexer, diagnoseX402Endpoint } from "@fiderail/indexer";
15
+
16
+ // Grade any public x402 endpoint without making a payment
17
+ const report = await diagnoseX402Endpoint({
18
+ url: "https://api.fiderail.com/v1/trust/base/0x7284d41b5b852f2bd4c99bdf95043d84452d299c",
19
+ });
20
+ console.log(report.grade, report.diagnosticFlags);
21
+
22
+ // Run a single indexing pass across configured RPC endpoints
23
+ const indexer = createIndexer({ dbPath: "./data/fiderail.db" });
24
+ await indexer.runOnce();
25
+ await indexer.stop();
26
+ ```
27
+
28
+ ## Key Exports
29
+
30
+ - **Indexer Orchestrator**: `createIndexer` (`IndexerOptions`)
31
+ - **EVM Adapter (Base, Arbitrum, Polygon)**: `parseEvmReceiptStablecoinTransfers`, `parseBaseReceiptUsdcTransfer`, `isPermit2ProxyReceipt`, `getEvmChainAssetContracts`, `resolveEvmAsset`, `BASE_USDC`, `X402_PERMIT2_PROXIES`, `BASE_CDP_FACILITATOR`, `ERC8004_IDENTITY`
32
+ - **SVM Adapter (Solana)**: `parseSolanaStablecoinTransfers`, `parseSolanaUsdcTransfer`, `hasSolanaMemo`, `DEFAULT_SOLANA_TARGETS`, `SOL_USDC_MINT`, `SOL_USDT_MINT`
33
+ - **Discovery & Liveness Grader**: `syncBazaarCapabilities`, `normalizeDiscoveryItems`, `CDP_BAZAAR_URL`, `PAYAI_DISCOVERY_URL`, `diagnoseX402Endpoint`, `probeSingleEndpoint`, `runLivenessProbeBatch`, `isSafePublicHttpUrl`, `assertSafePublicUrlWithDns`
34
+
35
+ ## Runtime Requirements
36
+
37
+ Requires **Node.js `>= 22.13.0`**. Uses multi-RPC failover for EVM/SVM polling and DNS-pinned SSRF protection for outbound L1 probes.
38
+
39
+ ## Links
40
+
41
+ - Portal: [https://fiderail.com](https://fiderail.com)
42
+ - Documentation: [https://fiderail.com/docs](https://fiderail.com/docs)
43
+ - Source (GitLab): [https://gitlab.com/fiderail/fiderail](https://gitlab.com/fiderail/fiderail)
44
+ - Mirror (GitHub — pending reinstatement): [https://github.com/fiderail/fiderail](https://github.com/fiderail/fiderail)
45
+
46
+ ## License
47
+
48
+ [MIT](./LICENSE)
@@ -0,0 +1,23 @@
1
+ import type { FideRailRepository, ServiceCapability } from "@fiderail/core";
2
+ export declare const CDP_BAZAAR_URL = "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources";
3
+ export declare const PAYAI_DISCOVERY_URL = "https://facilitator.payai.network/discovery/resources";
4
+ /**
5
+ * Normalizes x402 discovery entries from Coinbase CDP Bazaar or PayAI Discovery
6
+ * across all 4 locked chains (Base, Solana, Arbitrum, Polygon).
7
+ */
8
+ export declare function normalizeDiscoveryItems(rawItems?: readonly Record<string, any>[], sourceName?: string): ServiceCapability[];
9
+ export declare function syncBazaarCapabilities({ repo, fetchImpl, cdpPages, payAiPages, pageSize, paceMs, }: {
10
+ repo: FideRailRepository;
11
+ fetchImpl?: typeof globalThis.fetch;
12
+ cdpPages?: number;
13
+ payAiPages?: number;
14
+ pageSize?: number;
15
+ paceMs?: number;
16
+ }): Promise<{
17
+ upserted: number;
18
+ cdpCount: number;
19
+ payAiCount: number;
20
+ totalCapabilities: number;
21
+ errors: string[];
22
+ }>;
23
+ //# sourceMappingURL=bazaar-sync.d.ts.map
@@ -0,0 +1,151 @@
1
+ import { getAssetSpec, getPrimaryAsset, normalizeChainAddress, normalizeChainName, rawAmountToDecimal, toUsdAmount, } from "@fiderail/spec";
2
+ export const CDP_BAZAAR_URL = "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources";
3
+ export const PAYAI_DISCOVERY_URL = "https://facilitator.payai.network/discovery/resources";
4
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
5
+ function fallbackServiceName(resourceUrl) {
6
+ try {
7
+ const u = new URL(resourceUrl);
8
+ const pathSlug = u.pathname.replace(/^\/+|\/+$/g, "").split("/").slice(0, 2).join("/");
9
+ return pathSlug ? `${u.hostname}/${pathSlug}` : u.hostname;
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ }
15
+ /**
16
+ * Normalizes x402 discovery entries from Coinbase CDP Bazaar or PayAI Discovery
17
+ * across all 4 locked chains (Base, Solana, Arbitrum, Polygon).
18
+ */
19
+ export function normalizeDiscoveryItems(rawItems = [], sourceName = "x402_bazaar") {
20
+ const dedup = new Map();
21
+ for (const item of rawItems || []) {
22
+ if (!item || typeof item !== "object")
23
+ continue;
24
+ const accepts = Array.isArray(item.accepts) ? item.accepts : [];
25
+ const itemResource = typeof item.resource === "string" ? item.resource.trim() : "";
26
+ const itemDescription = typeof item.description === "string" ? item.description.trim() : "";
27
+ const itemMethod = item.method || item.extensions?.bazaar?.info?.input?.method || "GET";
28
+ const itemTags = Array.isArray(item.tags)
29
+ ? item.tags.map((t) => String(t).trim()).filter(Boolean)
30
+ : [];
31
+ const lastUpdated = item.lastUpdated ? String(item.lastUpdated) : null;
32
+ for (const acc of accepts) {
33
+ if (!acc || typeof acc !== "object")
34
+ continue;
35
+ const chain = normalizeChainName(acc.network);
36
+ if (!chain)
37
+ continue;
38
+ const address = normalizeChainAddress(chain, acc.payTo);
39
+ if (!address)
40
+ continue;
41
+ const extra = acc.extra && typeof acc.extra === "object" ? acc.extra : {};
42
+ const resourceUrl = (typeof extra.resource === "string" && extra.resource.trim()) || itemResource;
43
+ if (!resourceUrl)
44
+ continue;
45
+ const description = itemDescription ||
46
+ (typeof extra.description === "string" ? extra.description.trim() : "") ||
47
+ null;
48
+ const serviceName = (typeof item.serviceName === "string" && item.serviceName.trim()) ||
49
+ (typeof item.toolName === "string" && item.toolName.trim()) ||
50
+ fallbackServiceName(resourceUrl);
51
+ const assetSpec = getAssetSpec(chain, acc.asset) || getPrimaryAsset(chain);
52
+ const rawAmount = acc.amount ?? acc.maxAmountRequired;
53
+ let priceUsdc = null;
54
+ if (rawAmount !== null && rawAmount !== undefined && rawAmount !== "") {
55
+ const n = Number(rawAmount);
56
+ if (Number.isFinite(n) && n >= 0) {
57
+ priceUsdc = toUsdAmount(rawAmountToDecimal(String(Math.round(n)), assetSpec.decimals), assetSpec.fiatPeg);
58
+ }
59
+ }
60
+ const key = `${chain}|${address}|${resourceUrl}`;
61
+ if (!dedup.has(key)) {
62
+ dedup.set(key, {
63
+ chain,
64
+ address,
65
+ resourceUrl,
66
+ serviceName,
67
+ description,
68
+ method: String(itemMethod || "GET").toUpperCase(),
69
+ priceUsdc,
70
+ assetSymbol: assetSpec.symbol,
71
+ tags: itemTags,
72
+ source: sourceName,
73
+ lastUpdated,
74
+ });
75
+ }
76
+ }
77
+ }
78
+ return [...dedup.values()];
79
+ }
80
+ async function fetchDiscoveryCatalog({ baseUrl, sourceName, pages, pageSize, paceMs, fetchImpl, }) {
81
+ const rows = [];
82
+ for (let page = 0; page < pages; page++) {
83
+ const offset = page * pageSize;
84
+ const sep = baseUrl.includes("?") ? "&" : "?";
85
+ const url = `${baseUrl}${sep}limit=${pageSize}&offset=${offset}`;
86
+ const res = await fetchImpl(url, {
87
+ headers: { Accept: "application/json", "User-Agent": "FideRail-Indexer/2.0" },
88
+ signal: AbortSignal.timeout(12000),
89
+ });
90
+ if (!res.ok) {
91
+ throw new Error(`${sourceName} HTTP ${res.status}`);
92
+ }
93
+ const json = (await res.json());
94
+ const items = Array.isArray(json.items) ? json.items : [];
95
+ rows.push(...normalizeDiscoveryItems(items, sourceName));
96
+ if (items.length < pageSize)
97
+ break;
98
+ if (page + 1 < pages && paceMs > 0)
99
+ await sleep(paceMs);
100
+ }
101
+ return rows;
102
+ }
103
+ export async function syncBazaarCapabilities({ repo, fetchImpl = globalThis.fetch, cdpPages = 4, payAiPages = 2, pageSize = 100, paceMs = 250, }) {
104
+ const errors = [];
105
+ const allRows = [];
106
+ let cdpCount = 0;
107
+ let payAiCount = 0;
108
+ try {
109
+ const cdpRows = await fetchDiscoveryCatalog({
110
+ baseUrl: CDP_BAZAAR_URL,
111
+ sourceName: "cdp_bazaar",
112
+ pages: cdpPages,
113
+ pageSize,
114
+ paceMs,
115
+ fetchImpl,
116
+ });
117
+ cdpCount = cdpRows.length;
118
+ allRows.push(...cdpRows);
119
+ }
120
+ catch (err) {
121
+ errors.push(`cdp_bazaar: ${err.message}`);
122
+ }
123
+ try {
124
+ const payAiRows = await fetchDiscoveryCatalog({
125
+ baseUrl: PAYAI_DISCOVERY_URL,
126
+ sourceName: "payai_discovery",
127
+ pages: payAiPages,
128
+ pageSize,
129
+ paceMs,
130
+ fetchImpl,
131
+ });
132
+ payAiCount = payAiRows.length;
133
+ allRows.push(...payAiRows);
134
+ }
135
+ catch (err) {
136
+ errors.push(`payai_discovery: ${err.message}`);
137
+ }
138
+ const { upserted } = await repo.upsertServiceCapabilities(allRows);
139
+ const stats = await repo.getStats();
140
+ await repo.setState("bazaar_last_sync_at", new Date().toISOString());
141
+ await repo.setState("bazaar_last_upserted", String(upserted));
142
+ await repo.setState("bazaar_last_error", errors.join("; "));
143
+ return {
144
+ upserted,
145
+ cdpCount,
146
+ payAiCount,
147
+ totalCapabilities: stats.capabilities.total,
148
+ errors,
149
+ };
150
+ }
151
+ //# sourceMappingURL=bazaar-sync.js.map
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { openFideRailRepository } from "@fiderail/db";
3
+ import { createIndexer } from "./indexer.js";
4
+ async function main() {
5
+ const once = process.argv.includes("--once");
6
+ const repo = await openFideRailRepository();
7
+ const indexer = createIndexer({ repo: repo ?? undefined });
8
+ if (once) {
9
+ const result = await indexer.runOnce();
10
+ console.log(JSON.stringify(result, null, 2));
11
+ await indexer.stop();
12
+ if (repo)
13
+ await repo.close();
14
+ process.exit(result.errors.length > 0 ? 1 : 0);
15
+ }
16
+ indexer.start();
17
+ const shutdown = async () => {
18
+ await indexer.stop();
19
+ if (repo)
20
+ await repo.close();
21
+ process.exit(0);
22
+ };
23
+ process.on("SIGINT", () => void shutdown());
24
+ process.on("SIGTERM", () => void shutdown());
25
+ }
26
+ main().catch((err) => {
27
+ console.error(`[Indexer] Fatal error: ${err.message}`);
28
+ process.exit(1);
29
+ });
30
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,36 @@
1
+ import { type AssetSymbol, type ChainKey } from "@fiderail/spec";
2
+ export declare const BASE_USDC: string;
3
+ export declare const BASE_PERMIT2_PROXY = "0x4020a4f3b7b90cca423b9fabcc0ce57c6c240002";
4
+ export declare const X402_PERMIT2_EXACT_PROXY = "0x402085c248eea27d92e8b30b2c58ed07f9e20001";
5
+ export declare const X402_PERMIT2_PROXIES: readonly string[];
6
+ export declare const BASE_CDP_FACILITATOR = "0xdbdf3d8ed80f84c35d01c6c9f9271761bad90ba6";
7
+ export declare const ERC8004_IDENTITY = "0x8004a169fb4a3325136eb29fa0ceb6d2e539a432";
8
+ export declare const TOPIC_TRANSFER = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef";
9
+ export declare const TOPIC_EIP3009_AUTH_USED = "0x98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a5";
10
+ export declare function unpadTopicAddress(topic: unknown): string | null;
11
+ export declare function padAddressTopic(address: string): string;
12
+ export declare function isPermit2ProxyReceipt(rcpt: Record<string, any> | null | undefined): boolean;
13
+ export interface ParsedEvmStablecoinTransfer {
14
+ eventIndex: number;
15
+ assetContract: string;
16
+ assetSymbol: AssetSymbol;
17
+ amountRaw: string;
18
+ amountDecimal: number;
19
+ amountUsd: number;
20
+ /** Backward-compatible USD alias */
21
+ amountUsdc: number;
22
+ payer: string;
23
+ payee: string;
24
+ }
25
+ /**
26
+ * Parses ALL recognized stablecoin Transfer logs (locked 2 assets per EVM chain) from a receipt.
27
+ * Automatically normalizes EURC using `eurUsdRate` and retains exact raw integer amounts + logIndex.
28
+ */
29
+ export declare function parseEvmReceiptStablecoinTransfers(chain: "base" | "arbitrum" | "polygon", rcpt: Record<string, any> | null | undefined, eurUsdRate?: number): ParsedEvmStablecoinTransfer[];
30
+ /**
31
+ * Backward-compatible helper returning the largest Base USDC/EURC stablecoin transfer in a receipt.
32
+ */
33
+ export declare function parseBaseReceiptUsdcTransfer(rcpt: Record<string, any> | null | undefined): ParsedEvmStablecoinTransfer | null;
34
+ export declare function getEvmChainAssetContracts(chain: "base" | "arbitrum" | "polygon"): string[];
35
+ export declare function resolveEvmAsset(chain: ChainKey, contractOrSymbol: string): import("@fiderail/spec").StablecoinAssetSpec | null;
36
+ //# sourceMappingURL=evm-adapter.d.ts.map
@@ -0,0 +1,98 @@
1
+ import { DEFAULT_EUR_USD_RATE, getAssetSpec, getChainSpec, getPrimaryAssetContract, rawAmountToDecimal, toUsdAmount, } from "@fiderail/spec";
2
+ export const BASE_USDC = getPrimaryAssetContract("base").toLowerCase();
3
+ export const BASE_PERMIT2_PROXY = "0x4020a4f3b7b90cca423b9fabcc0ce57c6c240002";
4
+ export const X402_PERMIT2_EXACT_PROXY = "0x402085c248eea27d92e8b30b2c58ed07f9e20001";
5
+ export const X402_PERMIT2_PROXIES = Object.freeze([
6
+ BASE_PERMIT2_PROXY,
7
+ X402_PERMIT2_EXACT_PROXY,
8
+ ]);
9
+ export const BASE_CDP_FACILITATOR = "0xdbdf3d8ed80f84c35d01c6c9f9271761bad90ba6";
10
+ export const ERC8004_IDENTITY = "0x8004a169fb4a3325136eb29fa0ceb6d2e539a432";
11
+ export const TOPIC_TRANSFER = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef";
12
+ export const TOPIC_EIP3009_AUTH_USED = "0x98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a5";
13
+ export function unpadTopicAddress(topic) {
14
+ if (!topic || typeof topic !== "string" || topic.length < 42)
15
+ return null;
16
+ return ("0x" + topic.slice(-40)).toLowerCase();
17
+ }
18
+ export function padAddressTopic(address) {
19
+ return "0x" + address.replace(/^0x/i, "").toLowerCase().padStart(64, "0");
20
+ }
21
+ export function isPermit2ProxyReceipt(rcpt) {
22
+ if (!rcpt || typeof rcpt !== "object")
23
+ return false;
24
+ const to = String(rcpt.to || "").toLowerCase();
25
+ if (X402_PERMIT2_PROXIES.includes(to))
26
+ return true;
27
+ for (const log of rcpt.logs || []) {
28
+ const addr = String(log?.address || "").toLowerCase();
29
+ if (X402_PERMIT2_PROXIES.includes(addr))
30
+ return true;
31
+ }
32
+ return false;
33
+ }
34
+ /**
35
+ * Parses ALL recognized stablecoin Transfer logs (locked 2 assets per EVM chain) from a receipt.
36
+ * Automatically normalizes EURC using `eurUsdRate` and retains exact raw integer amounts + logIndex.
37
+ */
38
+ export function parseEvmReceiptStablecoinTransfers(chain, rcpt, eurUsdRate = DEFAULT_EUR_USD_RATE) {
39
+ const spec = getChainSpec(chain);
40
+ const contractMap = new Map(spec.assets.map((a) => [a.contract.toLowerCase(), a]));
41
+ const transfers = [];
42
+ for (const log of rcpt?.logs || []) {
43
+ const addr = String(log.address || "").toLowerCase();
44
+ const asset = contractMap.get(addr);
45
+ if (!asset)
46
+ continue;
47
+ if (String(log.topics?.[0] || "").toLowerCase() !== TOPIC_TRANSFER)
48
+ continue;
49
+ const payer = unpadTopicAddress(log.topics?.[1]);
50
+ const payee = unpadTopicAddress(log.topics?.[2]);
51
+ if (!payer || !payee)
52
+ continue;
53
+ let rawBig = 0n;
54
+ try {
55
+ rawBig = BigInt(log.data || "0x0");
56
+ }
57
+ catch {
58
+ rawBig = 0n;
59
+ }
60
+ if (rawBig <= 0n)
61
+ continue;
62
+ const amountDecimal = rawAmountToDecimal(rawBig, asset.decimals);
63
+ const amountUsd = toUsdAmount(amountDecimal, asset.fiatPeg, eurUsdRate);
64
+ if (amountUsd <= 0)
65
+ continue;
66
+ const eventIndex = log.logIndex ? parseInt(String(log.logIndex), 16) : transfers.length;
67
+ transfers.push({
68
+ eventIndex: Number.isFinite(eventIndex) ? eventIndex : transfers.length,
69
+ assetContract: asset.contract,
70
+ assetSymbol: asset.symbol,
71
+ amountRaw: rawBig.toString(),
72
+ amountDecimal,
73
+ amountUsd,
74
+ amountUsdc: amountUsd,
75
+ payer,
76
+ payee,
77
+ });
78
+ }
79
+ return transfers;
80
+ }
81
+ /**
82
+ * Backward-compatible helper returning the largest Base USDC/EURC stablecoin transfer in a receipt.
83
+ */
84
+ export function parseBaseReceiptUsdcTransfer(rcpt) {
85
+ const list = parseEvmReceiptStablecoinTransfers("base", rcpt);
86
+ if (list.length === 0)
87
+ return null;
88
+ list.sort((a, b) => b.amountUsd - a.amountUsd);
89
+ return list[0];
90
+ }
91
+ export function getEvmChainAssetContracts(chain) {
92
+ const spec = getChainSpec(chain);
93
+ return spec.assets.map((a) => a.contract.toLowerCase());
94
+ }
95
+ export function resolveEvmAsset(chain, contractOrSymbol) {
96
+ return getAssetSpec(chain, contractOrSymbol);
97
+ }
98
+ //# sourceMappingURL=evm-adapter.js.map
@@ -0,0 +1,6 @@
1
+ export * from "./evm-adapter.js";
2
+ export * from "./svm-adapter.js";
3
+ export * from "./bazaar-sync.js";
4
+ export * from "./liveness-probe.js";
5
+ export * from "./indexer.js";
6
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./evm-adapter.js";
2
+ export * from "./svm-adapter.js";
3
+ export * from "./bazaar-sync.js";
4
+ export * from "./liveness-probe.js";
5
+ export * from "./indexer.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,112 @@
1
+ import { getChainSpec } from "@fiderail/spec";
2
+ import type { FideRailRepository } from "@fiderail/core";
3
+ import { type SolanaTarget } from "./svm-adapter.js";
4
+ export interface IndexerOptions {
5
+ repo?: FideRailRepository;
6
+ dbPath?: string;
7
+ zanApiKey?: string;
8
+ alchemyApiKey?: string;
9
+ baseRpcUrls?: string;
10
+ baseReceiptRpcUrls?: string;
11
+ solanaRpcUrls?: string;
12
+ arbitrumRpcUrls?: string;
13
+ arbitrumReceiptRpcUrls?: string;
14
+ polygonRpcUrls?: string;
15
+ polygonReceiptRpcUrls?: string;
16
+ baseRpcs?: string[];
17
+ baseReceiptRpcs?: string[];
18
+ solanaRpcs?: string[];
19
+ arbitrumRpcs?: string[];
20
+ arbitrumReceiptRpcs?: string[];
21
+ polygonRpcs?: string[];
22
+ polygonReceiptRpcs?: string[];
23
+ eurUsdRate?: number;
24
+ basePollIntervalMs?: number;
25
+ solanaPollIntervalMs?: number;
26
+ allowlistedEvmPollIntervalMs?: number;
27
+ recomputeIntervalMs?: number;
28
+ bazaarSyncIntervalMs?: number;
29
+ livenessProbeIntervalMs?: number;
30
+ livenessProbeBatchSize?: number;
31
+ skipBazaarSync?: boolean;
32
+ skipLivenessProbe?: boolean;
33
+ skipFacilitatorDiscovery?: boolean;
34
+ baseBackfillBlocks?: number;
35
+ baseMaxBlocksPerTick?: number;
36
+ baseMaxReceiptsPerTick?: number;
37
+ solanaMaxTxsPerTick?: number;
38
+ solanaMaxCatchupPages?: number;
39
+ retentionDays?: number;
40
+ rpcPaceMs?: number;
41
+ probeProxyUrl?: string;
42
+ probeProxyToken?: string;
43
+ allowPrivateHosts?: boolean;
44
+ solanaTargets?: SolanaTarget[];
45
+ fetchImpl?: typeof globalThis.fetch;
46
+ rpcHandler?: (url: string, payload: any) => Promise<any>;
47
+ logger?: Pick<Console, "log" | "error">;
48
+ }
49
+ export declare function createIndexer(options?: IndexerOptions): {
50
+ repo: FideRailRepository;
51
+ getChainSpec: typeof getChainSpec;
52
+ syncBaseOnce: ({ forceRecompute }?: {
53
+ forceRecompute?: boolean | undefined;
54
+ }) => Promise<{
55
+ chain: "base";
56
+ fromBlock: number;
57
+ toBlock: number;
58
+ latestBlock: number;
59
+ inserted: number;
60
+ identitiesUpserted: number;
61
+ profiles: number;
62
+ recomputed: boolean;
63
+ }>;
64
+ syncSolanaOnce: ({ forceRecompute }?: {
65
+ forceRecompute?: boolean | undefined;
66
+ }) => Promise<{
67
+ chain: "solana";
68
+ latestSlot: number | null;
69
+ inserted: number;
70
+ profiles: number;
71
+ recomputed: boolean;
72
+ }>;
73
+ syncAllowlistedEvmOnce: (chain: "arbitrum" | "polygon", { forceRecompute }?: {
74
+ forceRecompute?: boolean | undefined;
75
+ }) => Promise<{
76
+ chain: "arbitrum" | "polygon";
77
+ skipped: boolean;
78
+ reason: string;
79
+ inserted: number;
80
+ profiles: number;
81
+ recomputed: boolean;
82
+ fromBlock?: undefined;
83
+ toBlock?: undefined;
84
+ latestBlock?: undefined;
85
+ } | {
86
+ chain: "arbitrum" | "polygon";
87
+ skipped: boolean;
88
+ fromBlock: number;
89
+ toBlock: number;
90
+ latestBlock: number;
91
+ inserted: number;
92
+ profiles: number;
93
+ recomputed: boolean;
94
+ reason?: undefined;
95
+ }>;
96
+ syncBazaarOnce: () => Promise<{
97
+ upserted: number;
98
+ cdpCount: number;
99
+ payAiCount: number;
100
+ totalCapabilities: number;
101
+ errors: string[];
102
+ }>;
103
+ runLivenessOnce: () => Promise<{
104
+ probed: number;
105
+ healthy: number;
106
+ downOrDegraded: number;
107
+ }>;
108
+ runOnce: () => Promise<Record<string, any>>;
109
+ start: () => void;
110
+ stop: () => Promise<void>;
111
+ };
112
+ //# sourceMappingURL=indexer.d.ts.map