By default, CosmJS builds, signs, and broadcasts a transactions in a single function call. Often, it's useful to separate these steps.
This gist explores a simple way of doing so in TypeScript, and may also be useful for those wanting to dive deeper into how Cosmos messages are composed and signed.
You will need a few dependencies:
- cosmwasm: which is a wrapper package for all of the CosmJS packages
- cosmjs-types: which contains helpers for encoding and decoding protobuf messages.