/**
 * Comprehensive Ordinals API Service
 * Handles both user's node API endpoints and ordinals.com recursive endpoints
 * Based on the official Ordinals API documentation
 */
import { InscriptionData } from '../types/inscription';
export interface ApiEndpoint {
    baseUrl: string;
    timeout?: number;
    headers?: Record<string, string>;
}
export interface ApiResponse<T = any> {
    data: T;
    success: boolean;
    error?: string;
    source: 'user-node' | 'ordinals.com';
}
export interface InscriptionApiData {
    id: string;
    number?: number;
    address?: string;
    content_type?: string;
    content_length?: number;
    timestamp?: number;
    genesis_height?: number;
    genesis_fee?: number;
    output?: string;
    output_value?: number;
    sat?: number;
    satpoint?: string;
    charms?: string[];
}
export interface InscriptionsListResponse {
    ids?: string[];
    inscriptions?: InscriptionApiData[];
    children?: InscriptionApiData[];
    more?: boolean;
    page?: number;
    page_index?: number;
    prev?: number | null;
    next?: number | null;
}
export interface BlockResponse {
    hash: string;
    height: number;
    inscriptions: string[];
    transactions: string[];
    target?: string;
    best_height?: number;
}
export interface AddressResponse {
    outputs: string[];
    inscriptions: string[];
    sat_balance: number;
    runes_balances: any[];
}
export declare class OrdinalsApiService {
    private userNodeEndpoint;
    private ordinalsEndpoint;
    private cache;
    private cacheMaxAge;
    constructor(userNodeUrl?: string, ordinalsUrl?: string);
    /**
     * Generic HTTP request handler with fallback logic
     */
    private makeRequest;
    /**
     * Check if endpoint is a recursive endpoint that can use ordinals.com
     */
    private isRecursiveEndpoint;
    /**
     * GET /address/<ADDRESS>
     * List all assets of an address
     */
    getAddressAssets(address: string): Promise<ApiResponse<AddressResponse>>;
    /**
     * GET /block/<BLOCK_HASH_OR_HEIGHT>
     * Returns info about the specified block
     */
    getBlock(blockHashOrHeight: string | number): Promise<ApiResponse<BlockResponse>>;
    /**
     * GET /blockcount
     * Returns the height of the latest block
     */
    getBlockCount(): Promise<ApiResponse<number>>;
    /**
     * GET /blockhash/<HEIGHT>
     * Returns blockhash of specified block
     */
    getBlockHash(height: number): Promise<ApiResponse<string>>;
    /**
     * GET /inscription/<INSCRIPTION_ID>
     * Fetch details about a specific inscription by its ID
     */
    getInscription(inscriptionId: string): Promise<ApiResponse<InscriptionApiData>>;
    /**
     * GET /inscriptions
     * Get a list of the latest 100 inscriptions
     */
    getInscriptions(page?: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /inscriptions/<PAGE>
     * Pagination for inscriptions
     */
    getInscriptionsPage(page: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /inscriptions/block/<BLOCK_HEIGHT>
     * Get inscriptions for a specific block
     */
    getInscriptionsInBlock(blockHeight: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * POST /inscriptions
     * Fetch details for a list of inscription IDs
     */
    getInscriptionsByIds(inscriptionIds: string[]): Promise<ApiResponse<InscriptionApiData[]>>;
    /**
     * GET /output/<OUTPUT>
     * Returns information about a UTXO, including inscriptions within it
     */
    getOutput(output: string): Promise<ApiResponse<any>>;
    /**
     * GET /status
     * Returns details about the server installation and index
     */
    getStatus(): Promise<ApiResponse<any>>;
    /**
     * GET /r/blockhash
     * Latest block hash
     */
    getLatestBlockHash(): Promise<ApiResponse<string>>;
    /**
     * GET /r/blockheight
     * Latest block height
     */
    getLatestBlockHeight(): Promise<ApiResponse<number>>;
    /**
     * GET /r/blocktime
     * UNIX timestamp of latest block
     */
    getLatestBlockTime(): Promise<ApiResponse<number>>;
    /**
     * GET /r/children/<INSCRIPTION_ID>
     * The first 100 child inscription ids
     */
    getInscriptionChildren(inscriptionId: string, page?: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /r/children/<INSCRIPTION_ID>/inscriptions
     * Details of first 100 child inscriptions
     */
    getInscriptionChildrenDetails(inscriptionId: string, page?: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /r/inscription/<INSCRIPTION_ID>
     * Information about an inscription
     */
    getInscriptionInfo(inscriptionId: string): Promise<ApiResponse<InscriptionApiData>>;
    /**
     * GET /r/metadata/<INSCRIPTION_ID>
     * JSON string containing the hex-encoded CBOR metadata
     */
    getInscriptionMetadata(inscriptionId: string): Promise<ApiResponse<string>>;
    /**
     * GET /r/parents/<INSCRIPTION_ID>
     * The first 100 parent inscription ids
     */
    getInscriptionParents(inscriptionId: string, page?: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /r/parents/<INSCRIPTION_ID>/inscriptions
     * Details of the first 100 parent inscriptions
     */
    getInscriptionParentsDetails(inscriptionId: string, page?: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /r/sat/<SAT_NUMBER>/inscriptions
     * The first 100 inscription ids on a sat
     */
    getSatInscriptions(satNumber: number, page?: number): Promise<ApiResponse<InscriptionsListResponse>>;
    /**
     * GET /r/sat/<SAT_NUMBER>/at/<INDEX>
     * The inscription id at INDEX of all inscriptions on a sat
     */
    getSatInscriptionAtIndex(satNumber: number, index: number): Promise<ApiResponse<string>>;
    /**
     * GET /content/<INSCRIPTION_ID>
     * The content of the inscription (recursive endpoint, can use ordinals.com)
     */
    getInscriptionContent(inscriptionId: string): Promise<ApiResponse<any>>;
    /**
     * Convert API response to normalized inscription data
     */
    normalizeInscriptionData(apiData: InscriptionApiData | string): InscriptionData;
    /**
     * Process various API response formats and extract inscriptions
     */
    extractInscriptions(response: InscriptionsListResponse): InscriptionData[];
    /**
     * Clear cache
     */
    clearCache(): void;
    /**
     * Update endpoint configurations
     */
    updateEndpoints(userNodeUrl?: string, ordinalsUrl?: string): void;
}
export declare const ordinalsApi: OrdinalsApiService;
export default ordinalsApi;
//# sourceMappingURL=OrdinalsApiService.d.ts.map