Skip to main content

Following And Unfollowing

This section covers how to follow and unfollow on the Subsocial blockchain.

Methods for profiles

Follow An Account

Start following an account.

substrateApi.tx.accountFollows.followAccount(AccountId: AnyAccountId)

Example:

const substrateApi = await api.substrateApi
const tx = substrateApi.tx.accountFollows.followAccount('3osmnRNnrcScHsgkTJH1xyBF5kGjpbWHsGrqM31BJpy4vwn8')

Unfollow An Account

Stop following an account.

substrateApi.tx.accountFollows.unfollowAccount(AccountId: AnyAccountId)

Example:

const substrateApi = await api.substrateApi
const tx = substrateApi.tx.accountFollows.unfollowAccount('3osmnRNnrcScHsgkTJH1xyBF5kGjpbWHsGrqM31BJpy4vwn8')

🆃 AnyAccountId: AccountId | string


Methods for spaces

Follow A Space

Start following a space.

substrateApi.tx.spaceFollows.followSpace(SpaceId: AnySpaceId)

Example:

const substrateApi = await api.substrateApi
const tx = substrateApi.tx.spaceFollows.followSpace('1')

Unfollow A Space

Stop following a space.

substrateApi.tx.spaceFollows.unfollowSpace(SpaceId: AnySpaceId)

Example:

const substrateApi = await api.substrateApi
const tx = substrateApi.tx.spaceFollows.unfollowSpace('1')

🆃 AnySpaceId: SpaceId | BN