Hi
I am working on a python script using python-bitcoinrpc (
https://github.com/jgarzik/python-bitcoinrpc).
Cofiguration is working and rpc.commands get executed.
But I am running into an error with "
createrawtransaction".
I try
createrawtransaction(inputs, outputs, 0, True)
Error: "-1: JSON value is not a string as expected"
for the inputs and outputs I've set correspontig variables as lists, containing a dictionary/dictionaries with the relevant key:value pairs.
inputs: [
{
'tixid': 'c1636efe3d85e3bb7e58663cfa976590ed1a9bb6740e7b851cbb34ab63f52ab9',
'vout': 2,
'sequence': 4294967293
}
]
outputs: [
{
'bc1q5q5e95h3z0eymfwasm2whx2jrztqa8sy012345': 0.012345
},
{
'bc1q2gphxxpm7aetec0m7jpd04e342c5hree543210': 0.054321
}
]
I tried to set all values as str() instead of float() or int(). Stille get the error "-1: JSON value is not a string as expected"...
I tried
createrawtransaction(json.dumps(inputs), json.dumps(outputs), 0, True)
Error: "expected type array, got string"
it seams like "
createrawtransaction" does not accept the string value produced by json.dumps()....
As far as I can tell, my json array for the inputs and outputs are formated as described by
https://bitcoincore.org/en/doc/0.21.0/rpc/rawtransactions/createrawtransaction/What am I missing??
It almost looks like the python strings in my lists do not appear as strings to the bitcoin-cli.
I am running BitcoinCore 0.21.1, MacOs 11.4, python 3.9.4