How to query for a single stream item by txid?

+1 vote

I know I can use liststreamitems for retrieving a list of stream items with its data. I also know about gettxoutdata for getting the data of a certain txid, but I'm basically looking for the same data that liststreamitems provides, but for a single item.

Does anyone know how to query for a single stream item by txid?

asked Oct 29, 2016 by datboiii

1 Answer

+1 vote
Best answer

You can use getrawtransaction [txid] 1 to get a detailed summary of what happened in a particular truncation. The output of this does not currently show as much information as we'd like, but the data field is in there, and the next alpha version will show more. 

answered Oct 30, 2016 by MultiChain
selected Oct 30, 2016 by datboiii
Yeah, that's what I'm doing right now, but it would be great to have something like `liststreamitem [txid]` (keys are not unique). Thank you for all the hard work!
Thanks for the suggestion. Would you be OK with the stream also being specified in the API command, something like:

getstreamitem stream txid (verbose=false)

And another question: do you envisage needing this to support multiple txids in a single call, e.g.:

liststreamtxitems stream txid-array (verbose=false)
Both would work, but I might lose the stream argument, as technically every txid will be unique anyway, no need to specify it :)
Any news on this?
Hope it will be in the next alpha which has a ton of API improvements. FYI the stream parameter is required because it's possible to write to multiple streams in a single atomic transaction, if you use raw transactions.
Thanks a lot!
Alpha 26 has been released with the getstreamitem API.
Much obliged!