Home | Platform SDK

Contacts

These methods are accessible through profile.contacts() which exposes a ContactRepository instance.

Get a list of all contacts

profile.contacts().all();

Get the first stored contact

profile.contacts().first();

Get the last stored contact

profile.contacts().last();

Get a list of all wallet keys

profile.contacts().keys();

Get a list of all wallet values

profile.contacts().values();

Create a new contact for the given data

profile.contacts().create({
    name: "Jane Doe",
    addresses: [{ coin: "Ethereum", network: "testnet", address: "TESTNET-ADDRESS" }],
    starred: true,
});

Fill the contacts with the given contacts object

profile.contacts().fill(contacts);

Find the contact for the given ID

profile.contacts().findById("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

Update a contact using its Id and provided information

profile.contacts().update(newContact.id(), { name: "Jane Doe" });

Forget the contact for the given ID

profile.contacts().forget("uuid");

Forget all contacts (Use with caution!)

profile.contacts().flush();

Get the count of stored contacts

profile.contacts().count();

Find the contact for the given address

profile.contacts().findByAddress("D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib");

Find all contacts for the given coin

profile.contacts().findByCoin("ARK");

Find the contact for the given address

profile.contacts().findByNetwork("devnet");

Get the contacts data as an Object

profile.contacts().toObject();
2021 © ARK.io | All rights reserved An ARK.io Product