Skip to content

Latest commit

 

History

History
149 lines (75 loc) · 2.19 KB

ContactListManager.md

File metadata and controls

149 lines (75 loc) · 2.19 KB

nostr-websocket-utils v0.3.0


nostr-websocket-utils / ContactListManager

Interface: ContactListManager

Contact list manager interface

Methods

addContact()

addContact(contact): void

Adds or updates a contact

Parameters

contact

Contact

Contact to add/update

Returns

void

Defined in

nips/nip-02.ts:119


removeContact()

removeContact(pubkey): void

Removes a contact

Parameters

pubkey

string

Public key of contact to remove

Returns

void

Defined in

nips/nip-02.ts:125


getContact()

getContact(pubkey): undefined | Contact

Gets a contact by public key

Parameters

pubkey

string

Public key to look up

Returns

undefined | Contact

Contact if found

Defined in

nips/nip-02.ts:132


getAllContacts()

getAllContacts(): Contact[]

Gets all contacts

Returns

Contact[]

Array of all contacts

Defined in

nips/nip-02.ts:138


updateContactMetadata()

updateContactMetadata(pubkey, metadata): void

Updates contact metadata

Parameters

pubkey

string

Public key of contact

metadata

Record<string, unknown>

New metadata

Returns

void

Defined in

nips/nip-02.ts:145


createEvent()

createEvent(): NostrWSMessage

Creates a contact list event

Returns

NostrWSMessage

Contact list event

Defined in

nips/nip-02.ts:151