nostr-websocket-utils

nostr-websocket-utils v0.3.16


nostr-websocket-utils / ContactListManager

Interface: ContactListManager

Defined in: nips/nip-02.ts:103

Contact list manager interface

Methods

addContact()

addContact(contact): void

Defined in: nips/nip-02.ts:108

Adds or updates a contact

Parameters

contact

Contact

Contact to add/update

Returns

void


removeContact()

removeContact(pubkey): void

Defined in: nips/nip-02.ts:114

Removes a contact

Parameters

pubkey

string

Public key of contact to remove

Returns

void


getContact()

getContact(pubkey): Contact | undefined

Defined in: nips/nip-02.ts:121

Gets a contact by public key

Parameters

pubkey

string

Public key to look up

Returns

Contact | undefined

Contact if found


getAllContacts()

getAllContacts(): Contact[]

Defined in: nips/nip-02.ts:127

Gets all contacts

Returns

Contact[]

Array of all contacts


updateContactMetadata()

updateContactMetadata(pubkey, metadata): void

Defined in: nips/nip-02.ts:134

Updates contact metadata

Parameters

pubkey

string

Public key of contact

metadata

Record<string, unknown>

New metadata

Returns

void


createEvent()

createEvent(): NostrWSMessage

Defined in: nips/nip-02.ts:140

Creates a contact list event

Returns

NostrWSMessage

Contact list event