add-contact.rst (1063B)
1 .. ts:op:: addContact 2 3 Add a contact to the wallet's contact list. Contacts are identified 4 by the pair of ``alias`` and ``aliasType``; if a contact with the 5 same alias and alias type already exists, it is updated. 6 7 **Request:** 8 9 The request arguments are an `AddContactRequest` object. 10 11 **Response:** 12 13 On success, the result is an empty object. 14 15 **Side effects:** 16 17 Adds or updates the contact in the wallet's contact list. After 18 the contact list has changed, wallet-core emits a 19 ``contact-added`` notification. 20 21 .. ts:def:: AddContactRequest 22 23 interface AddContactRequest { 24 // The contact to add or update. 25 contact: ContactEntry; 26 } 27 28 .. ts:def:: ContactEntry 29 30 interface ContactEntry { 31 // Contact alias. 32 alias: string; 33 34 // Alias type. 35 aliasType: string; 36 37 // Mailbox URI. 38 mailboxBaseUri: string; 39 40 // Mailbox identity. 41 mailboxAddress: HashCodeString; 42 43 // The source of this contact, may be a URI. 44 source: string; 45 46 // The local petname of the contact. 47 petname: string; 48 }