/** * Mercury hosted passkey-indexer backend. * * Queries Mercury's public, **keyless** passkey-indexer REST API — no JWT, no * API key — which indexes passkey-kit smart-wallet signers on both networks with * full history across both signer generations (legacy `("sw_v1", …)` tuple * events and the v1 typed `#[contractevent]`s). The endpoint returns fully * decoded signer rows, so this backend maps JSON straight onto {@link WalletSigner} * with no XDR round-trip. * * Base URLs (see {@link mercuryPasskeyIndexerUrl}): * `https://{testnet,mainnet}.mercurydata.app/rest/passkey-indexer` * GET / -> `{ service, status }` health * GET /api/wallet/:contractId -> signers (this backend's getSigners) * GET /api/lookup/:credentialId -> wallets by passkey keyId (hex) * GET /api/lookup/address/:address -> wallets by ed25519 (G…) / policy (C…) * GET /api/stats -> indexer statistics * * Docs: https://docs.mercurydata.app/smart-wallet-indexers/introduction-1 * * @packageDocumentation */ import { type Server } from "@stellar/stellar-sdk/rpc"; import { SignerKey } from "../types.js"; import type { FindWalletsHardeningDeps, IndexerHealth, SignerIndexer, WalletSigner } from "./types.js"; /** * Resolve the hosted passkey-indexer base URL for a network. Mercury indexes * both testnet and mainnet; any other network returns `undefined` (no hosted * endpoint — pass an explicit `url` to point at a self-hosted instance). */ export declare function mercuryPasskeyIndexerUrl(networkPassphrase: string): string | undefined; export interface MercuryIndexerConfig { /** * Hosted passkey-indexer base URL, e.g. * `https://testnet.mercurydata.app/rest/passkey-indexer`. Keyless (public * REST). Prefer {@link MercuryIndexer.forNetwork} to resolve this per network. */ url: string; /** * RPC server — enables the temporary-signer eviction probe and lets * `findWallets` confirm reverse-lookup candidates on-chain. */ rpc?: Server; /** * Deps that let `findWallets` confirm a candidate by deterministic derivation * from the keyId, skipping an RPC round-trip. */ hardening?: FindWalletsHardeningDeps; /** Injectable fetch (tests / non-global runtimes). Defaults to global `fetch`. */ fetch?: typeof fetch; } export declare class MercuryIndexer implements SignerIndexer { private readonly config; constructor(config: MercuryIndexerConfig); /** * Null-tolerant factory: resolve the hosted base URL for `networkPassphrase` * (unless `url` is given), returning `null` when the network has no hosted * endpoint and no explicit `url` — callers treat `null` as "discovery * disabled". */ static forNetwork(config: Omit & { url?: string; }, networkPassphrase: string): MercuryIndexer | null; /** * GET a passkey-indexer route. Returns the parsed JSON, or `null` on a `404` * (a genuine "not found" is an answer, not a failure). Any other non-2xx, a * timeout, or a transport error throws an {@link IndexerError}. */ private get; getSigners(wallet: string): Promise; /** * Whether the signer's temporary ledger entry still exists on-chain. Probes by * the `SignerKey` ScVal — the exact key the contract stores the entry under * (`storage().temporary().set::`) — so it actually * matches. Throws on a transport error (caller decides eviction only from a * genuine not-found). */ private entryExists; findWallets(key: SignerKey): Promise; /** * Harden the reverse lookup (#598 F3): keep a candidate only if it is either * the deterministic derivation of the keyId OR still holds the signer entry * on-chain — never trust an unverified indexer row. * * Fail-CLOSED: when candidates exist but no confirmation route * does — no `rpc`, and no usable derivation (`hardening` only covers * Secp256r1 keys) — this throws instead of returning unconfirmed rows. An * unverifiable answer must never be handed to a caller that will route * deposits or identity to it. */ private confirmCandidates; health(): Promise; } //# sourceMappingURL=mercury.d.ts.map