api icon indicating copy to clipboard operation
api copied to clipboard

`view_functions` namespace implementation

Open valentinfernandez1 opened this issue 7 months ago • 1 comments

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.

valentinfernandez1 avatar May 06 '25 15:05 valentinfernandez1

I have done a rough implementation of the issue do le me know if tis upto expecation

demoncoder-crypto avatar May 07 '25 22:05 demoncoder-crypto