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

Idea: Make it easier to display an asset given an ID and an Amount #1849

Open
cronokirby opened this issue Oct 4, 2024 · 3 comments
Open
Labels
ui Related to user interface or ux design

Comments

@cronokirby
Copy link
Contributor

Right now, you need to know about the Registry system, figure out what chain ID you have, manually create a specific variant of ValueView, and then pass that to the appropriate UI component.

The registry is static information, once you have picked a chain ID, so it would be nice if you could pass the registry to the top level PenumbraUIProvider, which would then let you automatically view assets given just an ID, without having to manually thread all of this logic through.

@VanishMax
Copy link
Contributor

Is @penumbra-zone/client package what you're looking for? https://github.com/penumbra-zone/web/tree/main/packages/client

@grod220
Copy link
Collaborator

grod220 commented Oct 7, 2024

This may be a bit tricky as consumers of the registry npm package have two options: bundled vs remote. In some cases, like stakingAssetId, it's safe to grab it via the field in the bundled registry (synchronous). However, the rest of the usages of the registry should be using the remote registry (asynchronous). This allows the apps to have the latest rpcs, metadata, ibc info, etc----without having to publish a new version of the package and consumers install+redeploy.

Given the async nature, I wonder if it would be too complicated for the library to have to handle in every component that uses metadata the loading/error/loaded states.

@cronokirby
Copy link
Contributor Author

Yeah, I guess maybe the solution there is to just accept a Registry as part of the UI context? Then the client could decide how they want to get that registry, but would then benefit from threading through the UI.

Maybe we should see how this pattern plays out in the dex explorer for a bit before coming back to this.

@TalDerei TalDerei added the ui Related to user interface or ux design label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Related to user interface or ux design
Projects
Status: 🗄️ Backlog
Development

No branches or pull requests

4 participants