SuperNET icon indicating copy to clipboard operation
SuperNET copied to clipboard

`sendrawtransaction` doesn't return valid JSON

Open lukechilds opened this issue 7 years ago • 4 comments

on success sendrawtransaction return the txid. But it's not formatted as JSON it's literally just the txid:

d4173e42eab51cee52af6f878567d5bbd97b394ec156a4ee62d4ef570b53f725

Which throws an error in our API wrapper library:

SyntaxError: Unexpected token d in JSON at position 0

It should be wrapped in double quotes to be parseable as JSON:

"d4173e42eab51cee52af6f878567d5bbd97b394ec156a4ee62d4ef570b53f725"

But would probably be better of formatted like the rest of the responses, something like this:

{
	success: true,
	txid: "d4173e42eab51cee52af6f878567d5bbd97b394ec156a4ee62d4ef570b53f725"
}

lukechilds avatar May 21 '18 05:05 lukechilds

@jl777 we're trying to get a release out to the KMD community today, if there's any way you can get this fixed today that would be really helpful.

lukechilds avatar May 21 '18 05:05 lukechilds

ok, i will do it right away, but you would need to add a "needjson":1 as it is the way it is for compatibility with how bitcoin does it. but if there is a needjson:1, I will wrap it in json like above

jl777 avatar May 21 '18 07:05 jl777

pushed needjson:1 support to dev branch

jl777 avatar May 21 '18 07:05 jl777

Thanks!

lukechilds avatar May 21 '18 07:05 lukechilds