Skip to content

Instantly share code, notes, and snippets.

@stevedylandev
Created February 6, 2024 15:16
Show Gist options
  • Save stevedylandev/427cf92a4f689829bf677c1e77b0593e to your computer and use it in GitHub Desktop.
Save stevedylandev/427cf92a4f689829bf677c1e77b0593e to your computer and use it in GitHub Desktop.
Verify Message
import { getSSLHubRpcClient, Message } from "@farcaster/hub-nodejs";
const HUB_URL = "hub-grpc.pinata.cloud";
const client = getSSLHubRpcClient(HUB_URL);
const frameMessage = Message.decode(Buffer.from(req.body?.trustedData?.messageBytes || '', 'hex'));
const result = await client.validateMessage(frameMessage);
if (result.isOk() && result.value.valid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment