Fetching profile of an human avatar
This section is dedicated to handling/updating the profiles of an avatar.
Get a profile for the avatar
const profile = await inviteeAvatar.profile.get();
if (profile) {
console.log(profile.name, profile.description);
}Update profile of the avatar
import type { Profile } from '@aboutcircles/sdk-types';
const newProfile: Profile = {
name: 'Avatar Name',
description: 'Updated description for the avatar.',
avatarUrl: 'ipfs://QmYourImageCIDHere', // optional
};
try {
const newCid = await inviteeAvatar.profile.update(newProfile);
console.log('Profile updated. New CID:', newCid);
} catch (err) {
console.error('Error updating profile:', err);
}Last updated
Was this helpful?