GetTopicSchema
GetTopicSchema returns the program-level proto used by one topic.
All topics from the same program share one schema document.
Request
protobuf
message GetTopicSchemaRequest {
string topic = 1;
}Response
protobuf
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
bash
grpcurl \
-H "x-api-key: YOUR_API_KEY" \
-import-path . \
-proto program-streams.proto \
-d '{"topic":"solana.pump_fun.trade_event"}' \
events.sol.cubestech.online:443: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.