Skip to content

Social Graph

The Social Graph contract manages follow/unfollow and block/unblock relationships between users. All operations are accessed through the main SocialSDK — there is no separate graph SDK class.

import { SocialSDK } from '@akta/sdk/social'
const social = new SocialSDK({ algorand })
await social.follow({ address: userToFollow })

A user can gate who is allowed to follow them (e.g., require a minimum stake or NFT holding):

await social.follow({
address: userToFollow,
gateTxn: gateCallTxn, // Gate proof transaction
})
await social.unfollow({ address: userToUnfollow })

Blocks prevent interactions from the blocked address:

await social.block({ address: userToBlock })
await social.unblock({ address: userToUnblock })
// Check if an address is following another
const follows = await social.isFollowing({
follower: addressA,
user: addressB,
})
// Check if a user has blocked another
const blocked = await social.isBlocked({
user: blocker,
blocked: blockedAddress,
})
// Get follow index (position in the follow list)
const index = await social.getFollowIndex({
follower: addressA,
user: addressB,
})
OperationMBR (ALGO)
Follow0.0317
Block0.0157
Unfollow / UnblockRefunded

The social graph feeds into two gate types for access control:

GateDescription
Social Follower Count GateRequires a minimum follower count
Social Follower Index GateRequires following a specific set of users

See Gates for details on social-based access control.