UNPKG

@bsv/sdk

Version:

BSV Blockchain Software Development Kit

31 lines 1.37 kB
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; constructor(wallet?: WalletInterface); /** * 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[]>; /** * 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>; /** * Remove a contact from the contacts basket * @param identityKey The identity key of the contact to remove */ removeContact(identityKey: string): Promise<void>; } //# sourceMappingURL=ContactsManager.d.ts.map