/** * Server-side relayer client. * * A thin, typed wrapper over the OpenZeppelin Channels client * (`@openzeppelin/relayer-plugin-channels` ^0.20) for fee-sponsored submission. * It holds the relayer API key, so it MUST run server-side only (it is reached * through `PasskeyServer`, exported from the `passkey-kit/server` subpath). * * Two submission modes: * - {@link RelayerClient.send} — `{ func, auth }` for invokeHostFunction flows * (the preferred Soroban path; the relayer builds the envelope + pays fees). * - {@link RelayerClient.sendTransaction} — `{ xdr }` for a signed envelope * (e.g. a deploy transaction that needs source-account auth + a fee bump). * * Every method returns a discriminated {@link TransactionResult} and NEVER * throws for expected relayer/on-chain failures — a `PluginClientError` is * mapped to a typed {@link RelayerError} (or a {@link ContractError} when a * contract code can be decoded from its details). * * @packageDocumentation */ import type { TransactionResult } from "./types.js"; /** Configuration for a {@link RelayerClient}. */ export interface RelayerClientConfig { /** Base URL of the Channels relayer service. */ baseUrl: string; /** API key for the relayer service (server-side secret). */ apiKey: string; /** Optional admin secret for management operations. */ adminSecret?: string; /** Request timeout in ms (default {@link DEFAULT_RELAYER_TIMEOUT_MS}). */ timeout?: number; } /** Per-submission relayer options. */ export interface RelayerSubmitOptions { /** Return immediately after submission; poll {@link RelayerClient.getTransaction}. */ skipWait?: boolean; /** Alternative fund-relayer id for the fee bump (must be allow-listed). */ fundRelayerId?: string; } export declare class RelayerClient { private readonly channels; constructor(config: RelayerClientConfig); /** * Submit an invokeHostFunction via `{ func, auth }` (the preferred Soroban * path). The relayer builds the transaction envelope with a channel account * and pays the fees. */ send(func: string, auth: string[], options?: RelayerSubmitOptions): Promise; /** * Submit a signed transaction envelope via `{ xdr }` for a fee bump (preserves * the inner signature; use for deploys / source-account-auth transactions). */ sendTransaction(xdr: string, options?: RelayerSubmitOptions): Promise; /** Poll a previously-submitted (`skipWait`) transaction by its relayer id. */ getTransaction(transactionId: string): Promise; private run; private toResult; private mapError; } //# sourceMappingURL=relayer.d.ts.map