I'm using Bounded trait from preimages frame that allows to store dispatchable calls, e.g. similar to the one that is used in pallet-democracy:
pub type CallOf<T> = <T as frame_system::Config>::RuntimeCall; pub type BoundedCallOf<T> = Bounded<CallOf<T>>;
See the source code for reference: https://github.com/paritytech/substrate/blob/2dbf62591fd35725c6e39f8ddfd27c3695dab594/frame/democracy/src/lib.rs#L206
There is a possibility to decode it via preimages peek function on the backend side:
fn peek<T: Decode>(bounded: &Bounded<T>) -> Result<(T, Option<u32>), DispatchError>
and retrieve dispatch data.
However when I receive data via storage view call on the client side, the response looks like this:
So the question is - is there a possibility to decode the dispatchable data? I'm not able to pre-process storage view functions unwrapping the encoded bounded data.
I've tried to use parity scale codec TS implementation: https://github.com/paritytech/scale-ts but the examples described there are not clear.
Any help is appreciated.
Thanks in advance!