Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: MrKain on May 31, 2013, 01:28:11 PM



Title: raw transaction over json/post - am i doing it right ?
Post by: MrKain on May 31, 2013, 01:28:11 PM


Is the following format json correct ?

I'm sending it over http post over a socket

{"jsonrpc": "1.0", "id":"rqid547333300","method": "createrawtransaction", "params": [{"txid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","vout":0}] {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":0.00500000}}:

I'm missing a quote somewhere I think -

thanks for any help

MK


Title: Re: raw transaction over json/post - am i doing it right ?
Post by: orz.dk on May 31, 2013, 03:08:53 PM
I am about to play around with this myself, so im interested in the solution.

I may be wrong, and it is untested, but i believe that the entire jsonrpc params should be an array. For the createrawtransaction you need two elements. First element is another array, containing the inputs. Second element is the address. Maybe something like:

{"jsonrpc": "1.0", "id":"rqid547333300","method": "createrawtransaction",

"params": [[ {"txid":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","vout":0}],  {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":0.00500000} ]

}


/orz.dk