SDK Methods
1. getAvatar
Gets an avatar instance by its address.
Parameters:
avatarAddress
: The avatar’s wallet address.subscribe
: Optional, whether to subscribe to avatar events.
Returns: A
Promise
that resolves to anAvatar
instance.
Usage Example:
2. acceptInvitation
Accepts an invitation to join Circles using either CID or Profile.
Parameters:
inviter
: The address of the inviting avatar.cidV0
: The CIDv0 of the avatar’s metadata (orprofile
data).
Returns: A
Promise
resolving to anAvatarInterface
.
Usage Example:
3. registerHuman
Registers the connected wallet as a human avatar in Circles V1.
Returns: A
Promise
resolving to anAvatarInterface
, representing the registered human avatar.
Usage Example:
4. registerOrganization
Registers the connected wallet as an organization avatar in Circles V1.
Returns: A
Promise
resolving to anAvatarInterface
for the organization avatar.
Usage Example:
5. registerOrganizationV2
Registers the connected wallet as an organization avatar in Circles V2 with profile data.
Parameters:
profile
: AProfile
object representing the organization’s profile.
Returns: A
Promise
resolving to anAvatarInterface
.
Usage Example:
6. registerGroupV2
Registers the connected wallet as a group avatar in Circles V2 with profile data.
Parameters:
mint
: Address of the minting policy contract.profile
: AGroupProfile
object containing group information.
Returns: A
Promise
resolving to anAvatarInterface
.
Usage Example:
7. migrateAvatar
Migrates a V1 avatar and its Circles holdings to V2.
Parameters:
avatar
: The address of the avatar to migrate.profile
: Profile data of the avatar.trustRelations
: Optional, a list of trust relations to migrate.
Returns: A
Promise
resolving tovoid
.
Usage Example:
8. createOrUpdateProfile
Creates or updates a user profile in Circles.
Parameters:
profile
: AProfile
object or a CID string pointing to the profile.
Returns: A
Promise
that resolves to aContractTransactionReceipt
.
Usage Example:
9. migrateV1Tokens
Migrates all V1 token holdings of an avatar to V2.
Parameters:
avatar
: The avatar whose tokens need to be migrated.tokens
: Optional list of token addresses.
Returns: A
Promise
resolving tovoid
.
Usage Example:
10. getInflationaryWrapper
Gets an inflationary wrapper for managing tokens.
Parameters:
wrapperAddress
: Address of the inflationary wrapper contract.
Returns: A
Promise
resolving toInflationaryCircles
.
Usage Example:
11. getDemurragedWrapped
This function retrieves a demurrage wrapper, which is used to manage tokens that decrease in value over time (demurrage).
Parameters:
wrapperAddress
: The address of the demurrage wrapper contract.
Returns : A Promise
that resolves to an instance of DemurrageCircles
.
Usage Example:
Last updated