paritytech / desub

Decode Substrate with Backwards-Compatible Metadata
GNU General Public License v3.0
39 stars 13 forks source link

desub compile to wasm #87

Open gilescope opened 2 years ago

gilescope commented 2 years ago

Would be cool to be able to use this in web contexts. I think I can get away with not needing subxt on the web but I definitely need desub capabilities.

jsdw commented 2 years ago

I've been working on porting over the dynamic-encode-and-decode-into-Value bits into a new crate, https://github.com/paritytech/scale-value, which has plans to be used in subxt for such decoding (and hopefully cargo-contract). I'm not sure what your exact needs are but perhaps you'd find that useful?

As quite a small crate, it should already support wasm, but there is an issue I raised to add CI to ensure that that is the case going forwards.

gilescope commented 2 years ago

Actually it looks like desub-current compiles to wasm, it's just desub-legacy that does not (and the top level desub crate because it pulls both in).

gilescope commented 2 years ago

Also having a look at https://github.com/virto-network/sube for fetching data using the browser.

jsdw commented 2 years ago

Actually it looks like desub-current compiles to wasm, it's just desub-legacy that does not (and the top level desub crate because it pulls both in).

That isn't surprising to me offhand! I'd def look towards scale-value where possible, but if you want to decode older blocks in the browser then you may indeed have to look elsewhere at the mo!