Great question,
So txwrapper-core was developed with the idea that we would expose all the tools necessary for individuals to build their own offline tx construction libraries.
In your case the best way to include type-bundles is to leverage txwrapper-registry. Currently the only way the registry accepts them is through an environment variable called TX_TYPES_BUNDLES
which is the path to the types-bundle file. The code can be found here, and the readme here.
If it is a use case where you would like the ability to pass in a types-bundle directly into createRegistry
, I would be happy to add the ability in for you.
For building offline libraries using txwrapper-core though, I would look through the txwrapper-polkadot
index.ts file which shows how we expose a lot of the functionality for users for parity based chains specifically. I would then look at txwrapper-substrate
. This is where we actually construct methods using the tools from txwrapper-core for offline construction. So if you wanted to build transactions offline using txwrapper-core for specific parachains you would need to construct each method you would like to use to build these transactions. I always use balances transfer as an example. It's pretty straightforward, you just need to know the args its accepting and everything else is template like. As an extra note as well, I would look into the txwrapper-examples
we provide for what the workflow looks like for constructing transactions.
The only thing I ask is if you would like the ability to pass in a a types-bundle directly into createRegistry
from the txwrapper-registry
library, please file an issue here, and I can add that in pretty quick.