Program Streams GetTopicSchema
Fetch the protobuf schema and message type for an Program Stream topic.
GetTopicSchema returns the program-level proto used by one topic.
All topics from the same program share one schema document.
Request
message GetTopicSchemaRequest { string topic = 1;}Response
message GetTopicSchemaResponse { string proto_schema = 1; string message_type = 2;}proto_schema contains every instruction and event message for the program.
message_type identifies the payload message for your selected topic.
grpcurl
grpcurl \ -H "x-api-key: YOUR_API_KEY" \ -import-path . \ -proto program-streams.proto \ -d '{"topic":"solana.pump_fun.trade_event"}' \ events.nln.clr3.org:443 \ nln.stream.v1.StreamService/GetTopicSchemaSchema workflow
- Call
ListTopics. - Pick a topic.
- Call
GetTopicSchema. - Save the returned proto with a content hash.
- Generate your payload decoder.
- Record
message_typebeside the topic. - Regenerate after a schema hash change.
Do not compile a fetched schema inside your event loop.