/** * SDNClient — unified client for Space Data Network nodes. * * Resolves nodes by various identifiers (PeerID, .onion, CID, IPNS, ENS, HTTP URL), * queries their data catalog, fetches/publishes SDS records, and manages subscriptions. */ import type { ResolvedNode, ResolveOptions, IdentifierType } from './resolver'; import { SDNTransportError } from './transport/http'; import type { NodeCatalog, SchemaCatalogEntry, DataQueryOptions, DataQueryResponse, DataRecord, PublishResult, BatchPublishResult, LogHeadResponse, LogEntriesResponse, LogHeadsResponse } from './transport/http'; import type { AuthProvider } from './transport/auth'; import type { DerivedIdentity } from './crypto/types'; import type { ParsedEPM } from './epm-resolver'; /** Options for creating an SDNClient. */ export interface SDNClientOptions extends ResolveOptions { /** Pre-resolved HTTP base URL (skip resolution). */ baseUrl?: string; /** Auth provider for authenticated requests. */ authProvider?: AuthProvider; } /** * SDNClient provides a unified interface to interact with an SDN node: * - Discover the node via various identifier types * - Query its data catalog (what schemas it publishes) * - Fetch data by schema, day, NORAD ID, entity ID * - Publish data (with authentication) * * @example * ```ts * // Resolve by domain * const client = await SDNClient.resolve('spaceaware.io'); * const catalog = await client.catalog(); * console.log(catalog.schemas); * * // Query OMM data * const omm = await client.query({ schema: 'OMM.fbs', noradCatId: 25544, day: '2026-02-24' }); * * // Authenticate and publish * await client.authenticate(identity); * await client.publish('OMM.fbs', flatbufferBytes); * ``` */ export declare class SDNClient { /** The resolved node info. */ readonly resolved: ResolvedNode; private transport; private _catalog?; private constructor(); /** * Resolve a node by any supported identifier and return a client. * * Supported identifiers: * - PeerID: `12D3KooW...` * - .onion: `abc...xyz.onion` * - HTTP: `https://spaceaware.io` or `spaceaware.io` * - Multiaddr: `/dns4/spaceaware.io/tcp/443` * - IPFS CID: `bafy...` * - IPNS: `k51...` * - ENS: `mynode.eth` */ static resolve(identifier: string, opts?: SDNClientOptions): Promise; /** Create a client from an explicit HTTP URL. */ static fromUrl(url: string, opts?: SDNClientOptions): SDNClient; /** Create a client from a parsed EPM. */ static fromEPM(epm: ParsedEPM): SDNClient | null; /** The node's HTTP base URL. */ get baseUrl(): string; /** The node's PeerID, if known. */ get peerId(): string | undefined; /** Fetch the node's schema catalog. */ catalog(): Promise; /** Get cached catalog (call catalog() first to populate). */ get cachedCatalog(): NodeCatalog | undefined; /** List schema names this node publishes. Fetches catalog if not cached. */ listSchemas(): Promise; /** Query data records. */ query(opts: DataQueryOptions): Promise; /** Get a single record by schema and CID. */ get(schema: string, cid: string): Promise; /** Get node info (EPM + runtime metadata). */ nodeInfo(): Promise>; /** * Authenticate with the node using an HD wallet identity. * Required before publishing data. */ authenticate(identity: DerivedIdentity): Promise; /** Publish a FlatBuffer record. Requires prior authenticate() call. */ publish(schema: string, data: Uint8Array): Promise; /** Publish multiple records in a batch. Requires prior authenticate() call. */ publishBatch(schema: string, records: Uint8Array[]): Promise; /** Get the log head for a publisher+schema. */ logHead(schema: string, publisherPeerID: string): Promise; /** Get log entries for a publisher+schema since a given sequence. */ logEntries(schema: string, publisherPeerID: string, sinceSequence?: number, limit?: number): Promise; /** Get all publishers' log heads for a schema. */ logHeads(schema: string): Promise; } export type { NodeCatalog, SchemaCatalogEntry, DataQueryOptions, DataQueryResponse, DataRecord, PublishResult, BatchPublishResult, LogHeadResponse, LogEntriesResponse, LogHeadsResponse, ResolvedNode, ResolveOptions, IdentifierType, AuthProvider, }; export { SDNTransportError }; //# sourceMappingURL=client.d.ts.map