Dec-04-2018, 03:51 PM
Trying to do a transaction via RPC in python. I'm getting the error - TypeError: unhashable type: 'list' - for the line with the private key entry, when running the method signrawtransaction. Does anybody know what is wrong with my code (or not wrong)?
def signrawtransaction(serialized_transaction): payload = { [ { "method": "signrawtransaction", "params": [serialized_transaction], "txid": "52938c72e777d0cdd547337314aa8955c629d6e45d0119e05586c9aa1c1f6695", "vout": 0, "scriptPubKey": "16ae4544b56c619e5624fa708c3b1887e785baa3e338be5c805ba3b39d0427e1", } ], { "835c32d409a14cd042afc7d5b99031ced36ded276214b782e8a4b51c93feb838" # private key } } signed_transaction = requests.post(url, data=json.dumps(payload), headers=headers).json()['result'] return signed_transaction