Following & Social Graph
Batch, paging and non-transferable relationship certificates.
Follow and unfollow#
await (await social.follow(target)).wait();
const following = await social.isFollowing(account, target);
const fans = await social.followers(target, 0n, 20);
const subscriptions = await social.following(account, 0n, 20);
await (await social.unfollow(target)).wait();You cannot follow yourself or zero addresses. Repeated following and unfollowing accounts will be rolled back. The target user is automatically registered when he or she has no identity; after the target sets the fan limit, new followers must meet the capacity.
Batch and paging#
BatchfollowBatch / unfollowBatchEach time 1-100 addresses are executed, the entire transaction is executed atomically. If any item is invalid, all transactions will be rolled back. The SDK rejects duplicate addresses in advance. Batch batching still consumes gas, 100 is the protocol upper limit, the actual amount should be chosen according to the chain and wallet budget.
Followers and follow lists use offset / limit, limit is 1–100. Deletion uses swapping tails, and the order of the list will change. Relationship changes encountered during paging reading may be repeated or missed. A complete and consistent export should use a fixed blockTag. read() / Go Call(), or read your own event index.
ERC-1155 Relationship Credentials#
The follower holds a non-transferable credential corresponding to the target profileId. It is cast when you pay attention to it and destroyed when it is removed. ERC-1155 contract wallets must implement receiving callbacks when paying attention; ordinary wallets do not need additional settings.
These tokens are used to express social relationships and have no protocol-level redemption commitments, transfer markets, or gaming rights.
Real-time updates#
Followed(follower, account) with Unfollowed(follower, account)Update relationship edges, number of fans and number of followers. StandardTransferSinglecan be used for voucher indexing; only one event source is selected for the same projection to avoid repeated accumulation.