Mirra
SDK Reference

Contacts

SDK reference for contacts operations

Overview

Manage user contacts - list, add, remove, search, block, and unblock contacts

  • Category: internal
  • Auth Required: No
  • Supported Modes: standard, delegated, service

Operations

listContacts

Get a list of all accepted contacts for the user with their profile information

Arguments:

  • limit (number, optional): Maximum number of contacts to return (default: 100)
  • offset (number, optional): Number of contacts to skip for pagination (default: 0)

Returns:

object - List of contacts with pagination info

Example:

const result = await mirra.contacts.listContacts({});

getContact

Get detailed information about a specific contact by their ID or username

Arguments:

  • contactId (string, optional): The contact user ID (MongoDB ObjectId)
  • username (string, optional): The contact username

Returns:

object - Contact information

Example:

const result = await mirra.contacts.getContact({});

addContact

Send a contact request to another user by their username

Arguments:

  • username (string, required): Username of the user to add as a contact

Returns:

object - Contact request details

Example:

const result = await mirra.contacts.addContact({
  username: "example"
});

removeContact

Remove a user from your contacts list (unfriend)

Arguments:

  • contactId (string, optional): The contact user ID to remove
  • username (string, optional): The contact username to remove

Returns:

object - Removal confirmation

Example:

const result = await mirra.contacts.removeContact({});

searchContacts

Search your contacts by username, email, phone, or wallet address

Arguments:

  • query (string, required): Search query - can be username, email, phone, or wallet address
  • searchType (string, optional): Type of search to perform: all, username, email, phone, or wallet (default: all)
  • limit (number, optional): Maximum number of results (default: 20)

Returns:

object - Search results with matching contacts

Example:

const result = await mirra.contacts.searchContacts({
  query: "example"
});

blockContact

Block a user (prevents them from contacting you)

Arguments:

  • contactId (string, optional): The user ID to block
  • username (string, optional): The username to block

Returns:

object - Block confirmation

Example:

const result = await mirra.contacts.blockContact({});

unblockContact

Unblock a previously blocked user

Arguments:

  • contactId (string, optional): The user ID to unblock
  • username (string, optional): The username to unblock

Returns:

object - Unblock confirmation

Example:

const result = await mirra.contacts.unblockContact({});

getBlockedContacts

Get a list of all users you have blocked

Arguments:

  • limit (number, optional): Maximum number of results (default: 100)
  • offset (number, optional): Number of items to skip for pagination (default: 0)

Returns:

object - List of blocked users with pagination

Example:

const result = await mirra.contacts.getBlockedContacts({});

getContactRequests

Get pending contact requests (sent by you or received from others)

Arguments:

  • type (string, optional): Type of requests to retrieve: all, sent, or received (default: all)
  • status (string, optional): Filter by request status: pending, accepted, or rejected (default: pending)

Returns:

object - List of contact requests

Example:

const result = await mirra.contacts.getContactRequests({});

On this page