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
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 aSigningStargateClient without a custom registry, it uses
defaultRegistryTypes — a list of all standard Cosmos SDK message types:
Registering Custom Types
If your chain has custom modules, register their generated types on top of the defaults:Registry API
Encoding Flow
When you callsignAndBroadcast, this is what happens to your messages:
Next Steps
Custom Types
Register custom protobuf types for your chain.
Encode Objects
Understand the EncodeObject format.