error code: -3 error message: Invalid amount

+1 vote
I'm trying to use the `sendwithdatafrom` functionality. Using the CLI the following is sent resulting in the above error? I can confirm that the asset and addresses etc are valid.

`
sendwithdatafrom 1QxEwNiZbvZ5oyXwwBzWWtXiZPktPaH1RYheGB 1DXoFDDJW4KWgfBbepKYETT7DU5jP1aBkJjX7s 110.05 {"for":"SP-001_stream","key":"94011166-1cb5-4cdd-9b13-c6c7a9a4d060","data":"7b2262617463685f6964223a312c226d79636572745f757365725f6964223a312c22636c69656e745f6964223a322c22736974655f6964223a332c2274786e5f747970655f6964223a312c22636172626f6e5f61737365745f6964223a312c22756e69745f636f6e765f6964223a332c226b6773223a3131302e30352c22756e69745f636f6e765f6669656c64223a22526f6f6d204e6967687473222c22756e69745f636f6e765f717479223a352c22726174696f223a2232322e303130303030222c226373765f64617461223a227b5c22436f6d70616e79204e616d655c223a6e756c6c2c5c224669727374204e616d655c223a5c224a696d696e675c222c5c224c617374204e616d655c223a5c2259616e675c222c5c22436f756e7472795c223a5c224672616e63655c222c5c22456d61696c5c223a5c226c656f6e6172642e6861726c657940696d7061637463686f6963652e636f6d5c222c5c224172726976616c20446174655c223a5c2233315c5c5c2f30385c5c5c2f323031365c222c5c2244657061727475726520446174655c223a5c2230355c5c5c2f30395c5c5c2f323031365c222c5c22526f6f6d204e756d6265725c223a3132382c5c22526f6f6d204e69676874735c223a357d222c2274786e5f616c6c6f636174696f6e5f64617465223a22323031362d30392d30352031323a30303a3030222c226964223a2239343031313136362d316362352d346364642d396231332d633663376139613464303630222c22757064617465645f6174223a22323031372d30322d32382031333a30393a3035222c22637265617465645f6174223a22323031372d30322d32382031333a30393a3035227d"}
`
asked Feb 28, 2017 by lenh
Are you trying to send units of the native currency or of an asset?
Units of the asset - we are not using native currency at all.

1 Answer

+1 vote

The amount field needs to be formatted differently to refer to a native asset. Here's an example you can make suit your own case:

sendwithdatafrom 1QxEwNiZbvZ5oyXwwBzWWtXiZPktPaH1RYheGB 1DXoFDDJW4KWgfBbepKYETT7DU5jP1aBkJjX7s '{"asset1":110.05}' {"for":"SP-001_stream","key":"abc","data":"0123"}

answered Feb 28, 2017 by MultiChain
...