Bug Description
When running the stellar events command with a Base64-encoded topic, the command fails with an error about unable to unmarshal string into TopicFilter type.
Command
stellar events --start-ledger 757126 --type contract --topic 'AAAADwAAAAh0cmFuc2Zlcg==' --network testnet
Error
❌ error: ErrorObject { code: InvalidParams, message: "invalid parameters", data: Some(RawValue("json: cannot unmarshal string into Go struct field EventFilter.filters.topics of type protocol.TopicFilter")) }
Analysis
The issue appears to be that the CLI is passing the --topic parameter as a string directly to the RPC server, which expects topics to be formatted as arrays (TopicFilter) of segments (SegmentFilter).
The Base64 string AAAADwAAAAh0cmFuc2Zlcg== decodes to what appears to be an ScVal containing "transfer", but it's not being properly structured as a topic filter for the RPC request.
Expected Behavior
The CLI should properly format the topic parameter to match the RPC server's expectations, either by:
- Converting single topic strings into the proper array format
- Providing clearer error messages about the required format
- Documenting the exact format needed for topic filters in the help text
Environment
- CLI version: latest
- Network: testnet
Bug Description
When running the
stellar eventscommand with a Base64-encoded topic, the command fails with an error about unable to unmarshal string into TopicFilter type.Command
Error
Analysis
The issue appears to be that the CLI is passing the
--topicparameter as a string directly to the RPC server, which expects topics to be formatted as arrays (TopicFilter) of segments (SegmentFilter).The Base64 string
AAAADwAAAAh0cmFuc2Zlcg==decodes to what appears to be an ScVal containing "transfer", but it's not being properly structured as a topic filter for the RPC request.Expected Behavior
The CLI should properly format the topic parameter to match the RPC server's expectations, either by:
Environment