πAddress Book
Explains how to manage the address book.
{ // address book entry model
id: '<unique id of the address book entry>',
alias: '<alias assigned to the address book entry>',
address: '<blockchain address assigned to the entry>',
phone_number: '<phone number>',
email: '<email assigned to the address book entry>',
created_at: '<timestamp>'
}Creating new entry
// user object obtained
const newEntry = await user.addToAddressBook({
address: '0x4Ed918C7800F5dc34d2C774f6EA5fbd15f1a94a7',
alias: 'random-addr',
phone_number: '+123456789', // phone number is optional
email: '[email protected]' // email is optional
});
console.log(`entry created, id: ${newEntry.id}`);Update existing entry
Fetch entry by alias
Fetch all entries
Live example
Last updated