Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Add a new page to create a valid App Data document #160

Closed
ramirotw opened this issue Jul 6, 2022 · 0 comments · Fixed by #168
Closed

Add a new page to create a valid App Data document #160

ramirotw opened this issue Jul 6, 2022 · 0 comments · Fixed by #168
Assignees
Labels
app:Explorer Explorer App
Milestone

Comments

@ramirotw
Copy link
Contributor

ramirotw commented Jul 6, 2022

Description
We need a page dedicated to viewing/decoding existing app-data hashes as well as creating new metadata documents, even uploading them to ipfs could be nice to have:

  1. Implement an input to allow decoding existing app-data hashes. Source of inspiration: https://codepen.io/pacara/pen/BadZgjg
    To do this we can leverage what has been done in Add AppData row with Metadata Info in Orders details page #159 and parameterize the app-data
  2. Implement a form that will generate a valid metadata document:

@alfetopito's notes:

More things I had in mind for this. Rather than build it dynamically, we could have a more guided form, with the fields:
1. appCode is optional and is a free form text input
2. version is read only and set to latest
4. environment is optional and is a free form text input. It could hint at possible choices (productions, development, staging)
5. metadata is mandatory, even if empty
Then, for the metadata, user can pick any of the choices of referrer and quote. Maybe a checkbox to enable them?
1. referrer:
  * version is read only and set to latest
  * address is required and must be an address (0x....)
2. quote:
  *  not actually sure it makes sense to allow this field here, but it might be worth adding it just for the sake of completeness
version is read only and set to latest
  *  slippageBips is mandatory and accepts a number (stored as string in the final JSON)

Another point that comes to mind is that parallel to the form there could be a panel displaying the result of user’s choices in real time, updating the JSON and generating the appDataHash
The JSON and appDataHash would have a copy button.
Not sure how exploitable this is, but there could be an option to upload the resulting doc to IPFS

@anxolin's notes:

I rescued some old notes on some libraries that u might be interesting in using.  I looked at it when I was trying to find how to formally define the meta-data JSON format:
* https://jsonforms.io/
  * Great docs!
  * very modular
  *  https://github.com/eclipsesource/jsonforms
* https://github.com/rjsf-team/react-jsonschema-form
  * Awesome tool and showcase: https://rjsf-team.github.io/react-jsonschema-form/
  * Different theming options
* Uniforms: https://uniforms.tools/docs/what-are-uniforms
  *  Different styles
  * Also great, and very nice docs
  * For reordering and so on, doesn’t use a UI schema. So maybe less flexible
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:Explorer Explorer App
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants