Help with sendwithmetadata in Savoir

+1 vote


I'm having a problem with the sendwithmetadata command executing from python (Savoir library). I am, however, able to successfully execute the command on the same node server using multi chain-cli. It seems the problem in python is with my json object.....but the solution continues to escape me. Could someone please provide some details on what I am doing wrong? Help would be much appreciated!! 

Python code:

api = Savoir(rpcuser, rpcpasswd, rpchost, rpcport, chainname)
api.sendwithmetadata('wallet_address_here', json.dumps({'coin':75.0}), 'badcoffeebadcode')


Error! Status code: 500
Text: {"result":null,"error":{"code":-1,"message":"value is type str, expected real"},"id":1}

Json: {'result': None, 'error': {'code': -1, 'message': 'value is type str, expected real'}, 'id': 1}



asked Nov 18, 2017 by deifen

1 Answer

0 votes

We didn't create this library, but the issue is probably that you need to pass the data encoded as hexadecimal, and badcoffeebadcode is not a valid hexadecimal string.

answered Nov 20, 2017 by MultiChain
Thank you! Yes, it was a complete n00b mistake on my part....should have been 0 instead of o.....In any case, I'll post the command that works here in case it helps someone else.

api.sendwithmetadata('wallet_address_here', {'coin':75.0}, 'badc0ffeebadc0de'))