Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support V3 Frames validation #1689

Closed
wants to merge 3 commits into from

Conversation

rygine
Copy link

@rygine rygine commented Dec 3, 2024

What changed? Why?

This PR adds support for validating V3 frame messages by adding an additional environment parameter to getXmtpFrameMessage that is passed into the updated validateFramesPost from @xmtp/frames-validator.

Notes to reviewers

To get the latest frames validator and types, @xmtp/frames-validator has been upgraded to ^1.0.1 in both peerDependencies and devDependencies.

The return type of getXmtpFrameMessage has also been updated to a discriminated union for a better DX.

For example:

if (isXmtpFrameRequest(body)) {
  const data = await getXmtpFrameMessage(body);
  if (!data.isValid) {
    throw new Error("Invalid message");
  }

  // `data.message` is now defined with a proper type
}

How has it been tested?

Tests were not added or updated as they aren't necessary in this context. Validation of V3 Frames via validateFramesPost is tested in the @xmtp/frames-validator package.

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 7:01pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 7:01pm

Copy link

vercel bot commented Dec 3, 2024

@rygine is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@rygine
Copy link
Author

rygine commented Dec 3, 2024

hey @Zizzamia, @humanagent mentioned you might be the best person to review this. please let me know otherwise, or if you need anything else in this PR. thanks!

@cpcramer
Copy link
Contributor

cpcramer commented Dec 6, 2024

@rygine Thanks for the contribution!

Please rebase off master as we've recently had some major changes related to our Frames support - chore: Remove Farcaster Frames support.

Also, CI is failing. Try running yarn format and yarn check in root! 😄

@rygine
Copy link
Author

rygine commented Dec 10, 2024

Closing this PR since Frames support has been removed

@rygine rygine closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants