Skip to content

feat(eas-form): auto generate form from eas schema #67

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

Draft
wants to merge 17 commits into
base: draft
Choose a base branch
from

Conversation

metalboyrick
Copy link
Member

@metalboyrick metalboyrick commented Jan 6, 2025

Fixes #56

Copy link

changeset-bot bot commented Jan 6, 2025

⚠️ No Changeset found

Latest commit: 7390782

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@metalboyrick
Copy link
Member Author

screenshot of what the form looks like so far with dynamic schema, but not working yet

image

@@ -110,23 +114,25 @@ const createArgs = (schema: any, chain: Chain, fixture: any) => {
// TODO chain control at withWalletControlWagmi

export const AttestationWagmiOffchain: Story = {
// @ts-expect-error withMockAccount() decorator should inject an account.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(lets create extra stories and keep as is)

const entries = stringPairs.map((pair) => pair.split(" "));
const zodSchemaObject: any = {};

for (const entry of entries) {
Copy link
Member

@debuggingfuture debuggingfuture Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EAS parse the schema (base on ABI syntax)
you can refer to (our) implementation at SchemaEncoder constructor to which prase the schmeaString to schema object (then see if we are able to create zod schema from it)

Copy link
Member

@debuggingfuture debuggingfuture left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attestation Form dynamic schema
2 participants