Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Contacts

Contacts is an API module for managing local contacts and finding contacts on the network

extends

API

Hierarchy

  • API
    • Contacts

Index

Constructors

Methods

Constructors

constructor

Methods

add

  • add(address: string, contact: Contact): Promise<boolean>
  • Adds or updates a contact directly, usually from a search

    Parameters

    • address: string
    • contact: Contact

      JSON object representing a contact

    Returns Promise<boolean>

    Whether the operation was sucessfull

get

  • get(address: string): Promise<Contact>
  • Retrieve information about a known contact

    Parameters

    • address: string

      Address of the contact

    Returns Promise<Contact>

    The associated contact object

list

remove

  • remove(contactId: string): Promise<boolean>
  • Remove a known contact

    Parameters

    • contactId: string

    Returns Promise<boolean>

    Whether the operation was successfull

search

  • search(name?: undefined | string, address?: undefined | string, options?: QueryOptions): Promise<ReadableStream<QueryResult>>
  • Searches locally and on the network for contacts by display name, peer id, or address

    Parameters

    • Optional name: undefined | string

      Search by display name string

    • Optional address: undefined | string

      Search by account address string

    • Optional options: QueryOptions

      Additional options to control the query

    Returns Promise<ReadableStream<QueryResult>>

    A ReadableStream of QueryResult objects. })