import { BroadcastFailure, BroadcastResponse, WalletInterface } from '@bsv/sdk'; import { AppCatalogFindAcrossHostsResult, AppCatalogFindOptions, AppCatalogOptions, AppCatalogQuery, PublishedApp, PublishedAppMetadata } from './types/index.js'; export declare const DEFAULT_APP_LOOKUP_HOSTS: string[]; export declare class AppCatalog { private readonly keyID; private readonly overlayTopic; private readonly overlayService; private readonly wallet; private readonly networkPreset; private readonly acceptDelayedBroadcast; private cachedNetworkPromise; private cachedIdentityKeyPromise; private resolver; private broadcaster; constructor(opts: AppCatalogOptions); private getNetwork; private getIdentityKey; private getBroadcaster; private getResolver; /** * Publishes an app by embedding its metadata JSON into a PushDrop token * and broadcasting that token to the overlay network. */ publishApp(metadata: PublishedAppMetadata, opts?: { wallet?: WalletInterface; }): Promise; /** * Updates an existing app listing by spending its previous PushDrop output * and creating a new one with the updated metadata. The new output is then * broadcast to the overlay. */ updateApp(prev: PublishedApp, newMetadata: PublishedAppMetadata): Promise; /** * Removes an app listing from the overlay by spending its previous PushDrop output. * * @param prev The previous app listing to remove. * @returns The BroadcastResponse or BroadcastFailure from the overlay. */ removeApp(prev: PublishedApp): Promise; /** * Finds apps published to the overlay by querying the lookup service. * * Supports pagination and sorting through the following parameters: * - `limit`: Maximum number of results to return (default: 50) * - `skip`: Number of results to skip for pagination (default: 0) * - `sortOrder`: Sort direction - 'asc' (oldest first) or 'desc' (newest first, default) * * @example * // Get the first page of 20 results * const page1 = await appCatalog.findApps({ limit: 20, skip: 0 }); * * // Get the second page * const page2 = await appCatalog.findApps({ limit: 20, skip: 20 }); * * // Sort by oldest first * const oldestFirst = await appCatalog.findApps({ sortOrder: 'asc' }); */ findApps(query?: AppCatalogQuery, opts?: AppCatalogFindOptions): Promise; /** * Finds apps by querying explicit overlay hosts directly, merging all valid * results, and returning per-host diagnostics. This is useful for frontends * that need stable results across regions when SLAP discovery or one overlay * cluster returns a sparse catalog. */ findAppsAcrossHosts(query?: AppCatalogQuery, opts?: AppCatalogFindOptions): Promise; private parseLookupAnswer; private parseLookupAnswerWithStats; private buildLookupQuery; private normalizeHosts; private dedupeApps; private errorMessage; } export * from './constants.js'; export * from './broadcast.js'; export * from './metadata.js'; export * from './types/index.js'; //# sourceMappingURL=index.d.ts.map