sendwithmetadatafrom - not working with multichain-api

+1 vote
When I try to do sendwithmetadatafrom using below command it works well.

sendwithmetadatafrom 1X5GrFfywN5PB8G1F6P1iaRoFD51iynKdWvcbo 1bC7uPxdy8Y92N8VC8qw2dNP3inSrjrLYH61cJ '{"34565-302-28256":9}' 48656C6C6F20576F726C64210A

However I am trying same command using multichain-api npm and it give below error

{code: -1,message: 'value is type str,expected real'}
asked Aug 22, 2017 by anonymous

1 Answer

+1 vote

If it works with multichain-cli, but not with this third party Javascript library, the most likely explanation is that you are passing the {"34565-302-28256":9} object as a string, instead of a native Javascript object as the library expects (which in the case of Javascript is just the same but without single quotes). When using multichain-cli you need to pass objects as preformatted JSON strings, because that is all the Unix command line offers. But when using a library for the API, the library can let you use the native object format of whichever language you are using.

answered Aug 22, 2017 by MultiChain
...