Hi, I am trying to create a JSON object from the result of getstreaminfo in a PHP app. I have tried this:
$getstreamitem = multichain('getstreamitem' , 'cabe6c8e62dd625cc05815824ddd5353d7b29d471c26619751dcc550dc7b03f1', true);
foreach ($getstreamitem as $item) {
if (!isset($getstreamitem['getstreamitem'])) {
$getstreamitem['getstreamitem'] = [];
}
$getstreamitem['getstreamitem'][] = $item;
}
print json_encode($getstreamitem);
echo "<br>";echo "<br>";
But in my output, I get:
{"result":null,"error":{"code":-8,"message":"parameter 2 must be hexadecimal string (not '')"},"id":1545517613,"getstreamitem":[null,{"code":-8,"message":"parameter 2 must be hexadecimal string (not '')"},1545517613]}
Not sure how to resolve this!
Thanks!