-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: snapshot votePoll relay #2797
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
New dependency changes detected. Learn more about Socket for GitHub βοΈ π No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
π Modified Dependency Overview:
|
What does this PR do?
π€ Generated by Copilot at 182034f
This pull request adds a new feature to create and vote on snapshot polls in the web app and the extension. It implements new components, handlers, helpers, types, and queries to support the feature. It also fixes some typos and issues in the existing code and updates the dependencies of some packages.
Related issues
Fixes # (issue)
Type of change
Explanation of the changes
π€ Generated by Copilot at 182034f
NewPublication
that allows users to create and publish a new publication with a snapshot poll (link)handlePublish
that validates the input fields, generates a snapshot account, signs and sends the poll data to the snapshot sequencer, and creates a new publication document in the database (link)handleCancel
that resets the input fields and redirects the user to the home page (link)handleInputChange
that updates the state of the input fields based on the user's input (link)votePoll
that handles the request to vote on a poll from the extension (link)/votePoll
to theitty-router
instance in theindex.ts
module of thesnapshot-relay
package, which handles the POST requests to vote on a poll from the extension using thevotePoll
handler (link,link)generateSnapshotAccount
that generates a snapshot account from the given parameters (link)NewPublication
component and theSnapshot
component (link,link)useSpaceQuery
that queries the space of a proposal by its id using the Apollo client (link)Space
that queries the space of a proposal by its id (link)SpaceQuery
and its variables to thegenerated.ts
module, which is generated by thegraphql-codegen
tool based on the GraphQL documents in thesnapshot
package (link)Snapshot
component (link,link)Snapshot
component's props frompropsalId
toproposalId
(link,link)snapshotClient.vote
method with anaxios
request to the snapshot relay worker's/votePoll
endpoint in theChoices
component (link)axios
to theChoices
component (link)timestamp
property in thetypedData
object fromBigInt
tonumber
in thecreatePoll
handler (link)createPoll
handler (link)validateLensAccount
that validates the access token of a Lens account by sending a request to the Lens API and checking the verify field in the response (link)votePoll
handler to verify the access token (link)@tsndr/cloudflare-worker-jwt
to thesnapshot-relay
package, which is used to decode and verify JWT tokens in the worker handlers (link,link,link)react
from thelib
package and add a new dependencyviem
that provides some utilities for working with Ethereum accounts and signatures (link,link)Choices
component and thestopEventPropagation
module (link,link,link,link)Emoji
πππ οΈ