Preparing a transaction
First of, we need to prepare the transaction for signing.Signing a transaction
Once we have prepared the transaction, we proceed to signing. Once you get thetxRaw transaction from the previous step use any Cosmos native wallet to sign (ex: Keplr),
Broadcasting a transaction
Once we have the signature ready, we need to broadcast the transaction to the Injective chain itself. After getting the signature from the second step, we need to include that signature in the signed transaction and broadcast it to the chain.Example (Prepare + Sign + Broadcast)
Let’s have a look at the whole flow (using Keplr as a signing wallet)Example with MsgBroadcasterWithPk
You can use theMsgBroadcasterWithPk class from the @injectivelabs/sdk-ts package which abstracts away most of the logic written above into a single class.
This abstraction allows you to sign transactions in a Node/CLI environment.
