🤝Contacts
Rather than manipulating directly the contacts in the user profile, we recommend using the functions from our SDK.
Contacts interface
enum ConnectionType {
CONNECT = "add-friend",
BLOCK = "block",
}
interface Contact {
target: string;
namespace: string; //namespece will always be protico when using our services
connectionType: ConnectionType;
alias?: string;
}
Getting user contacts
const contacts: Contact[] = await ceramicClient.contact.get(address?:string);
Parameters description
Parameter
Description
Optional
address
Wallet address associated with the user
Yes Default: Own address
Upserting a user contact
type ContactInfo = {
connectionType?: ConnectionType;
target: string;
alias?: string;
};
const contacts: Contact[] = await ceramicClient.contact.upsert(contact:ContactInfo);
Parameters description
Parameter
Description
Optional
contact
Contact information. Passing an existing target will update the contact, while passing a new one will create a new contact
No
Deleting a user contact
const contacts: Contact[] = await ceramicClient.contact.delete(address:string);
Parameters description
Parameter
Description
Optional
address
Address of the contact to be deleted
No
Last updated