Circles Documentation
  • Welcome to Circles
  • Overview
    • Understanding Personal and Group Currencies
      • Personal Currencies
      • Group Currencies
    • Why Build on Circles?
    • Circles Architecture
  • Developer Docs
    • The Circles Stack
    • Circles SDK Overview
    • Quickstart Guide for Circles SDK
    • Setting Circles Profiles
    • Building with different Circles Avatars
      • Personal / Human Avatars
        • Inviting and accepting human avatars
        • Mint personal tokens
        • Fetching profile of an human avatar
        • Manage trust connections
        • Get token balances of an avatar
        • Transfer personal Circles tokens to different avatar
      • Group Avatars
        • Create Base Groups for your community.
          • Vanilla groups with V2 hub
        • Mint group tokens
        • Managing group invites
        • Find groups and memberships
        • Getting total supply of group tokens available
      • Organization Avatars
        • Creation of Organizations
        • Managing trust connections via Org avatar account
  • Tutorials and Examples
    • Setting up Circles SDK with React
  • Querying Circles profiles and data
    • Query Circles Data
    • Subscribing to Avatar events
    • Utilising CirclesQuery Class
    • Query Circles profiles
  • Circles SDK Reference
    • Circles SDK interface
    • SDK Methods
    • Circles Data Methods
    • Circles Events Types
  • Developer Support
    • Glossary
    • Past Hackathon Projects on Circles
Powered by GitBook
On this page
  • Trust an avatar
  • Untrust an avatar
  • Check if avatar trusts another Avatar

Was this helpful?

Export as PDF
  1. Developer Docs
  2. Building with different Circles Avatars
  3. Personal / Human Avatars

Manage trust connections

Trust an avatar

This function allows an avatar to trust another avatar or multiple avatars. Trusting an avatar means you are willing to accept Circles that have been issued by them. Once trusted, Circles transfers from the trusted avatar are allowed.

const trustReceipt = await avatar.trust("AvatarAddress");
console.log(receipt);

Untrust an avatar

This function revokes trust from another avatar or multiple avatars. Once trust is revoked, the avatar will no longer accept Circles issued by the untrusted avatar. However, this will not impact Circles that were already received from the untrusted avatar.

const untrustReceipt = await avatar.untrust("AvatarAddress");
console.log(receipt);

Check if avatar trusts another Avatar

This function checks if the current avatar is trusted by another avatar. It can be used to verify whether another avatar is willing to accept Circles issued by the current avatar.

const isTrusted = await avatar.isTrustedBy("AvatarAddress");
console.log(isTrusted); // true or false

This function retrieves all trust relationships of the current avatar. It returns an array of trust relations indicating which avatars are trusted, which avatars trust the current avatar, and which relationships are mutual.

const trustRelations = await avatar.getTrustRelations();
trustRelations.forEach
    (relation => { 
        console.log(${relation.avatar1} ${relation.relation} ${relation.avatar2}); });

PreviousFetching profile of an human avatarNextGet token balances of an avatar

Last updated 6 months ago

Was this helpful?