recipes icon indicating copy to clipboard operation
recipes copied to clipboard

Question: How can I generate "types.json" file in each pallets ?

Open CocDap opened this issue 4 years ago • 2 comments

When I read recipes code or others substrate code. I saw that in every pallets has types.json. types.json contains information about storage when we declare in decl_module!. I dont know how to generate it (Although I find and know a file " aggrerate_types.json" that generate types.json, I dont how to execute that file )

Can anyone help me and explain why we generate that files and what we do? Thanks you so much

CocDap avatar Jun 18 '21 08:06 CocDap

In recipes they aren't generated; they are written by hand. I don't know of a general process to generate them. But here is some info about how to convert your own Rust types into the corresponding json type definitions.

https://polkadot.js.org/docs/api/start/types.basics https://polkadot.js.org/docs/api/start/types.extend

https://github.com/polkadot-js/apps/blob/master/packages/page-settings/src/md/basics.md#developer

JoshOrndorff avatar Jun 18 '21 15:06 JoshOrndorff

Thanks for replying soon. Thank you very much

CocDap avatar Jun 19 '21 04:06 CocDap