Posting messages

Messages are the core unit of activity in a community.

Requirements

Before posting, the user must:

  1. Be authenticated via Twitter OAuth (accessToken in hand).
  2. Have at least one wallet linked to their account (linkWallet).
  3. The linked wallet must be the one specified in walletAddress.

Post a message

await api.postMessage({
  path: { token_address: '7eYw...mintAddr' },
  body: {
    content: 'This is my take on $TOKEN',
    chainId: 'solana',
    walletAddress: 'YourLinkedSolanaWallet',
  },
  throwOnError: true,
});

Attach media

Upload media first, then include the returned URL:

const { data: media } = await api.uploadCommunityMedia({
  body: {
    contentType: 'image/jpeg',
    data: btoa(rawImageBytes), // base64
  },
});
 
await api.postMessage({
  path: { token_address: '7eYw...' },
  body: {
    content: 'Check this chart',
    chainId: 'solana',
    walletAddress: 'YourWallet',
    mediaUrl: media.mediaUrl,
  },
});

Free-form URLs are rejected — only URLs from uploadCommunityMedia or a listed media provider are accepted.

Reply to a message

await api.postReply({
  path: { token_address: '7eYw...', message_id: 'msg_123' },
  body: { content: 'Agreed', chainId: 'solana', walletAddress: 'YourWallet' },
});

Likes

await api.likeMessage({ path: { token_address: '7eYw...', message_id: 'msg_123' } });
await api.unlikeMessage({ path: { token_address: '7eYw...', message_id: 'msg_123' } });
const { data } = await api.getLikeCount({ path: { token_address: '7eYw...', message_id: 'msg_123' } });

Report content

await api.reportMessage({
  path: { token_address: '7eYw...', message_id: 'msg_123' },
  body: { reason: 'spam' },
  // reason: 'spam' | 'harassment' | 'hate_speech' | 'inappropriate_content' | 'other'
  // when reason === 'other', include: text: 'describe the issue'
});