Skip to main content
The Registry class (from @cosmjs/proto-signing) is the central type map that knows how to encode and decode Protobuf messages by type URL. When you call signAndBroadcast, the client uses its registry to serialize each EncodeObject into binary Protobuf wrapped in Any.

How It Works

Internally, the Registry keeps a Map<string, GeneratedType> where each key is a type URL and each value is a Protobuf codec. A codec is any object with encode and decode methods — the exact shape depends on the code generator used: All three are supported through the GeneratedType union:

Default Types

When you create a SigningStargateClient without a custom registry, it uses defaultRegistryTypes — a list of all standard Cosmos SDK message types:
This includes messages from bank, staking, distribution, governance, authz, feegrant, group, IBC, and vesting modules.

Registering Custom Types

If your chain has custom modules, register their generated types on top of the defaults:
Then pass the registry to the client:

Registry API

Encoding Flow

When you call signAndBroadcast, this is what happens to your messages:

Next Steps

Custom Types

Register custom protobuf types for your chain.

Encode Objects

Understand the EncodeObject format.