/** * `PasskeyServer` — the SERVER-ONLY counterpart to {@link PasskeyKit}. * * It holds the relayer API key and therefore must never run in a browser * bundle: it is exported exclusively from the `passkey-kit/server` subpath so a * bundler can't pull it into client code, and its config must come from * server-side environment variables (never `VITE_`-prefixed). * * Responsibilities: fee-sponsored submission via {@link RelayerClient} and * convenience signer-discovery helpers that delegate to a {@link MercuryIndexer} * over Mercury's keyless hosted passkey-indexer. (`MercuryIndexer` itself is * keyless and browser-safe — exported from the main `passkey-kit` entry; these * server methods are a thin convenience over it.) * * @packageDocumentation */ import { type Transaction } from "@stellar/stellar-sdk"; import { Server } from "@stellar/stellar-sdk/rpc"; import { AssembledTransaction } from "@stellar/stellar-sdk/contract"; import { type RelayerClientConfig, type RelayerSubmitOptions } from "./relayer.js"; import type { WalletSigner } from "./indexer/index.js"; import type { TransactionResult } from "./types.js"; export { RelayerClient, type RelayerClientConfig, type RelayerSubmitOptions, } from "./relayer.js"; /** Mercury hosted passkey-indexer configuration (keyless). */ export interface MercuryConfig { /** * Passkey-indexer base URL. Defaults to the network's hosted endpoint * (`https://{testnet,mainnet}.mercurydata.app/rest/passkey-indexer`); set it * only to point at a self-hosted instance. */ url?: string; } /** Configuration for a {@link PasskeyServer}. */ export interface PasskeyServerConfig { /** Network passphrase (required). */ networkPassphrase: string; /** Stellar RPC URL (needed for temporary-signer eviction probes). */ rpcUrl?: string; /** Relayer configuration for fee-sponsored submission. */ relayer?: RelayerClientConfig; /** Mercury indexer configuration. */ mercury?: MercuryConfig; } export declare class PasskeyServer { readonly networkPassphrase: string; readonly rpc?: Server; private readonly relayer?; private readonly mercury?; constructor(config: PasskeyServerConfig); /** * Submit a transaction via the relayer for fee sponsorship. * * invokeHostFunction transactions without source-account auth use the preferred * `{ func, auth }` Soroban path; everything else (deploys, source-account auth) * is fee-bumped via the `{ xdr }` envelope path. Never throws — returns a typed * {@link TransactionResult}. */ send(input: AssembledTransaction | Transaction | string, options?: RelayerSubmitOptions): Promise; /** Poll a `skipWait` submission by its relayer transaction id. */ getTransaction(transactionId: string): Promise; private requireMercury; /** * Enumerate a wallet's signers via Mercury. Temporary signers whose ledger * entry has been evicted are flagged `status: "evicted"` when this server was * given an `rpcUrl` (the indexer can't observe TTL eviction directly). */ getSigners(contractId: string): Promise; /** * Reverse lookup: find the wallet(s) a signer belongs to via Mercury. * * @returns the confirmed address at `index`, or `undefined` if there are none. */ getContractId(options: { keyId?: string; publicKey?: string; policy?: string; }, index?: number): Promise; } //# sourceMappingURL=server.d.ts.map