Skip to content

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?

NeedUse
Preview an operation before signingbuilder function
Hand an operation to a wallet or external signerbuilder function
Test operation payload constructionbuilder function
Submit directly with a key your app controlsclient.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:

ActionBuilderBroadcast helper
generic custom JSONbuildCustomJsonOperation()client.broadcast.customJson()
followbuildFollowOperation()client.broadcast.follow()
unfollowbuildUnfollowOperation()client.broadcast.unfollow()
mutebuildMuteOperation()client.broadcast.mute()
unmutebuildUnmuteOperation()client.broadcast.unmute()
reblogbuildReblogOperation()client.broadcast.reblog() / reblurt()
undo reblogbuildUndoReblogOperation()client.broadcast.undoReblog()
community subscribebuildCommunitySubscribeOperation()client.broadcast.communitySubscribe()
community unsubscribebuildCommunityUnsubscribeOperation()client.broadcast.communityUnsubscribe()
notification read markerbuildReadNotificationOperation()client.broadcast.readNotification()

Follow and mute

ts
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

ts
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.

ts
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:

ts
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:

text
Nexus discovers a post/community -> builder constructs operation -> user confirms -> wallet/signing flow broadcasts

API details