MsgBroadcaster abstraction class is a way to broadcast transactions on Injective with ease. With it, you can pass a Message that you want to be packed in a transaction and the signer’s address and the transaction will be prepared, signed, and broadcasted.
An example of usage can be found on our Helix demo repo. As for the messages that you can pass to the broadcast methods, you can find examples in the Core Modules section of the docs.
MsgBroadcaster + Wallet Strategy
This MsgBroadcaster is used alongside the Wallet Strategy class for building decentralized applications. To instantiate (and use) theMsgBroadcaster class, you can use the following code snippet
Constructor/Broadcast Options
We allow to override some of the options passed to the constructor ofMsgBroadcaster as well as when broadcasting the transaction. Here is the interface and the meaning of each field
To override the
endpoints and use your infrastructure (which is something we recommend), please read more on the Networks page on the endpoints you need to provide and how to set them up.MsgBroadcaster with Private Key
This MsgBroadcaster is used with a private key (mostly used for CLI environments). Constructor/broadcast options are quite similar as for theMsgBroadcaster.