File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,22 @@ function isValidateMessageJson(value: unknown): value is ValidateMessageJson {
2424}
2525
2626/**
27- * @returns a Promise that resolves with whether the message signature is valid, by querying a Farcaster hub, as well as the message itself
27+ * Validates a frame action message by querying a Farcaster hub.
28+ * Verifies the message signature is valid and returns the decoded message.
29+ *
30+ * @param body - The frame action payload containing trusted and untrusted data
31+ * @param options - Optional hub configuration
32+ * @param options.hubHttpUrl - The Farcaster hub HTTP URL (default: neynar hub)
33+ * @param options.hubRequestOptions - Additional request options for the hub API
34+ * @returns A Promise resolving to an object with isValid boolean and the message if valid
35+ *
36+ * @example
37+ * ```typescript
38+ * const { isValid, message } = await validateFrameMessage(body);
39+ * if (isValid && message) {
40+ * console.log('Valid message from FID:', message.data.fid);
41+ * }
42+ * ```
2843 */
2944export async function validateFrameMessage (
3045 body : FrameActionPayload ,
You can’t perform that action at this time.
0 commit comments