api
api copied to clipboard
`view_functions` namespace implementation
With the introduction of Metadata V16 there is a new field part of the PalletMetadata, that is view_functions which allows pallets to expose specific query functions that don't change the storage.
They are fairly similar to RuntimeAPI in a sense with the core difference that they are defined directly on the pallet without the need of added the same boiler palte code to impl_runtime_apis! every time we want to add the pallet to a Runtime.
There needs to be a way to easily call such functions from the DAPP developer's perspective, that is why I propose for a new namespace view (e.g. api.view.templatePallet.some_query()) to be added to easily call view functions.
I have done a rough implementation of the issue do le me know if tis upto expecation