Social actions
Social actions such as follow, mute, reblog and community subscriptions are represented as Layer 1 custom_json operations.
@beblurt/dblurt exposes builders for preview/external-signing workflows and broadcast helpers for direct side-effectful workflows.
Builder or broadcast helper?
| Need | Use |
|---|---|
| Preview an operation before signing | builder function |
| Hand an operation to a wallet or external signer | builder function |
| Test operation payload construction | builder function |
| Submit directly with a key your app controls | client.broadcast helper |
Builders do not require private keys. Broadcast helpers do.
Builder coverage
The SDK exports builders for the currently supported social/custom JSON operation families:
| Action | Builder | Broadcast helper |
|---|---|---|
| generic custom JSON | buildCustomJsonOperation() | client.broadcast.customJson() |
| follow | buildFollowOperation() | client.broadcast.follow() |
| unfollow | buildUnfollowOperation() | client.broadcast.unfollow() |
| mute | buildMuteOperation() | client.broadcast.mute() |
| unmute | buildUnmuteOperation() | client.broadcast.unmute() |
| reblog | buildReblogOperation() | client.broadcast.reblog() / reblurt() |
| undo reblog | buildUndoReblogOperation() | client.broadcast.undoReblog() |
| community subscribe | buildCommunitySubscribeOperation() | client.broadcast.communitySubscribe() |
| community unsubscribe | buildCommunityUnsubscribeOperation() | client.broadcast.communityUnsubscribe() |
| notification read marker | buildReadNotificationOperation() | client.broadcast.readNotification() |
Follow and mute
import { buildFollowOperation } from '@beblurt/dblurt';
const follow = buildFollowOperation({
follower: 'alice',
following: 'bob'
});
console.log(follow);Use mute/unmute builders when your application needs the corresponding social relationship operation. Keep display policy and confirmation text in your application.
Reblog
import { buildReblogOperation } from '@beblurt/dblurt';
const reblog = buildReblogOperation({
account: 'alice',
author: 'bob',
permlink: 'hello-blurt'
});Reblog operations refer to the account performing the action and the content being shared.
Community subscriptions
Community actions are also custom JSON operations. They should be presented as social/community actions, not as generic opaque JSON when users are confirming them.
import { buildCommunitySubscribeOperation } from '@beblurt/dblurt';
const operation = buildCommunitySubscribeOperation({
account: 'alice',
community: 'blurt-101010'
});Notification read markers
Notification read markers are useful for application state, but they still produce an operation payload. Make sure the user/account context is clear before signing.
Direct broadcast helpers
For direct submission, use the broadcast helper only after your key-handling path is safe:
const confirmation = await client.broadcast.follow('alice', 'bob', postingKey);
console.log(confirmation.id);Read Broadcast safely before adding direct broadcast code.
Layer boundary
Social action builders produce Layer 1 operations. Nexus can help discover posts, profiles or communities, but Nexus does not broadcast actions or define Layer 1 authority.
A typical flow is:
Nexus discovers a post/community -> builder constructs operation -> user confirms -> wallet/signing flow broadcasts