Possible to combine native asset sendt to a stream with json metadata?

+2 votes
Is it possible to send native assets between 2 addresses in a node and capture JSON metadata to a particular stream (all-in-one command/transaction)

Address 1  > Address 2   (28.5 USD) to Stream "auditrail" with JSON metadata:

                                          {"key1":"value1","key2":"value2","key3":"value3"}

I am facing errors when trying the following command:

createrawsendfrom <from-addr> '{"<to-addr>":{"asset2":20,"data":{"json":{"key1":"value1","key2":"value2","key3":"value3"}}}}'

Even if this command were to work it doesn't allow us to specify the specific stream to publish to (goes into the root stream I presume).
asked Dec 10, 2018 by Srinjoy Chakravarty

1 Answer

+1 vote

The example you provide is using inline metadata (putting metadata inside the asset output) rather than writing to a stream. Your simplest solution is to use this form of command:

sendwithdatafrom <from-addr> <to-addr> '{"asset2":20}' '{"for":"<stream>", "key":"<whatever>", "data":{"json":{"key1":"value1","key2":"value2","key3":"value3"}}}'

answered Dec 11, 2018 by MultiChain
...