import { PubKeyHex, WalletInterface } from '../wallet/index.js';
import { DisplayableIdentity } from './types/index.js';
export type Contact = DisplayableIdentity & {
    metadata?: Record<string, any>;
};
export declare class ContactsManager {
    private readonly wallet;
    private readonly cache;
    private readonly CONTACTS_CACHE_KEY;
    private readonly originator?;
    constructor(wallet?: WalletInterface, originator?: string);
    /**
     * Load all records from the contacts basket
     * @param identityKey Optional specific identity key to fetch
     * @param forceRefresh Whether to force a check for new contact data
     * @param limit Maximum number of contacts to return
     * @returns A promise that resolves with an array of contacts
     */
    getContacts(identityKey?: PubKeyHex, forceRefresh?: boolean, limit?: number): Promise<Contact[]>;
    /** Returns cached contacts (optionally filtered) or null if cache is missing/invalid. */
    private loadCachedContacts;
    /** Builds the HMAC-based identity-key tag array; empty array if no identity key is given. */
    private buildIdentityKeyTags;
    /** Decodes and decrypts all contact outputs in parallel, returning valid Contact objects. */
    private decryptContactOutputs;
    /**
     * Save or update a Metanet contact
     * @param contact The displayable identity information for the contact
     * @param metadata Optional metadata to store with the contact (ex. notes, aliases, etc)
     */
    saveContact(contact: DisplayableIdentity, metadata?: Record<string, any>): Promise<void>;
    /** Computes the HMAC-based hash of an identity key for tag indexing. */
    private hashIdentityKey;
    /** Scans existing outputs to find the one matching the given identity key; returns output + keyID. */
    private findExistingOutput;
    /** Encrypts a contact and produces its PushDrop locking script. */
    private encryptAndLock;
    /** Spends an existing contact output and creates a replacement with updated data. */
    private updateContactOutput;
    /** Creates a new on-chain contact output. */
    private createContactOutput;
    /**
     * Remove a contact from the contacts basket
     * @param identityKey The identity key of the contact to remove
     */
    removeContact(identityKey: string): Promise<void>;
    /** Attempts to decrypt and spend a single output if it matches the given identity key. Returns true if spent. */
    private trySpendContactOutput;
}
//# sourceMappingURL=ContactsManager.d.ts.map