How to convert the output of didc to JSON format?

input:
(variant {_128_=-272716322}) ("ic.rocks")

output:

{
  "_128_": -272716322
}
"ic.rocks"