Talisman and I are looking into building a simple JS module that helps developers build XCM for transactions and abstract common patterns like cross chain transfers into a simple JS function taking inputs like:
fromParachain, toParachain, assetId, recipient etc. These functions would then return the XCM object and allow the developer to encode it into hex so that it can be submitted to the network via the
I am currently working on an example transfer which would allow a user to transfer an asset from one parachain to another. You can see it here: Polkadot/Substrate Portal
However, I am running into the following difficulties:
- How does one encode the XCM into hex? I know that this is possible as it is done on the web interface but there is very little insight into how this is actually done in practice. I have tried looking through the web portal’s code but it is so abstract. I want to be able to build and encode the XCM I have in the above link.
I am also curious to hear from developers as to whether they believe such a module would be useful for them. I know that it is currently very difficult to make an XCM transaction in polkadot.js so I imagine this would be a very important piece of infrastructure.