Skip to main content
Every Cosmos SDK transaction contains one or more messages — typed instructions that tell the chain what to do. In CosmJS, messages are represented as EncodeObject values: a typeUrl string paired with a Protobuf message value.

Token Transfer (MsgSend)

MsgSend.fromPartial() creates a message from a partial object, filling in defaults for missing fields. The coins helper builds the [{ denom, amount }] array.

Staking Delegation

Multiple Messages in One Transaction

A single transaction can carry multiple messages. They execute atomically — all succeed or all fail:
For type-safe message construction, use typed encode objects like MsgSendEncodeObject from @cosmjs/stargate. See EncodeObject for the full list.

Next Steps

Simulating Gas

Estimate how much gas your messages will consume before broadcasting.

Custom Message Types

Register your own Protobuf message types with the Registry.