shawntabrizi / substrate-collectables-workshop

A guided tutorial for building an NFT marketplace with the Polkadot SDK
https://www.shawntabrizi.com/substrate-collectables-workshop/
MIT License
236 stars 101 forks source link

How to communicate types to apps UI #99

Closed JoshOrndorff closed 3 months ago

JoshOrndorff commented 5 years ago

https://shawntabrizi.com/substrate-collectables-workshop/#/1/viewing-a-structure explains how to tell the polkadot-js apps UI about this particular custom type, and gives lots of clues about what the process might look like in general. But a link to where one could learn more would be very helpful.

For example if my struct uses a BTreeMap or some other sexy datastructure, how do I generalize?

JoshOrndorff commented 5 years ago

This is pretty helpful https://github.com/polkadot-js/apps/blob/master/packages/app-settings/src/md/basics.md

And my BTreeMap is not supported yet. From @jacogr on riot

The issue with structs is this one - https://github.com/polkadot-js/apps/issues/546 - the UI does not allow inputs to be broken down. TL;DR - not yet, PRs welcome. Inputs are an issue atm, since for structs it expects and already-encoded value. Once supplied, it is slightly more clever - so it you do a storage query, it will display the parts of the structure. (Same when submitting, the signer dialog will show the various parts)