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.
Following
Section titled “Following”import { SocialSDK } from '@akta/sdk/social'
const social = new SocialSDK({ algorand })
await social.follow({ address: userToFollow })Gated Follows
Section titled “Gated Follows”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})Unfollowing
Section titled “Unfollowing”await social.unfollow({ address: userToUnfollow })Blocking
Section titled “Blocking”Blocks prevent interactions from the blocked address:
await social.block({ address: userToBlock })
await social.unblock({ address: userToUnblock })Reading Relationships
Section titled “Reading Relationships”// Check if an address is following anotherconst follows = await social.isFollowing({ follower: addressA, user: addressB,})
// Check if a user has blocked anotherconst 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,})MBR Costs
Section titled “MBR Costs”| Operation | MBR (ALGO) |
|---|---|
| Follow | 0.0317 |
| Block | 0.0157 |
| Unfollow / Unblock | Refunded |
Related Gates
Section titled “Related Gates”The social graph feeds into two gate types for access control:
| Gate | Description |
|---|---|
| Social Follower Count Gate | Requires a minimum follower count |
| Social Follower Index Gate | Requires following a specific set of users |
See Gates for details on social-based access control.