Create a post or comment anonymously (without account.signer or account.author)

Create a post or comment anonymously (without account.signer or account.author) in Bitsocial React Hooks. Usage, options, and examples.

const account = useAccount();
const signer = await account.pkc.createSigner();

const publishCommentOptions = {
  content: "hello",
  title: "hello",
  communityAddress: "12D3KooW...",
  // use a newly generated author address (optional)
  signer,
  // use a different display name (optional)
  author: {
    displayName: "Esteban",
    address: signer.address,
  },
};

const { publishComment } = usePublishComment(publishCommentOptions);
await publishComment();