it doesn't work >dcrctl.exe --wallet sendmany "default" {"DshM....":100,"DshM.....":100} sendmany command: parameter #2 'amounts' must be valid JSON which unsmarshals to a map[string]float64 (code: ErrInvalidType) Usage: sendmany "fromaccount" {"address":amount,...} (minconf=1 "comment") what i did incorrect?
I answered in the other thread, but I'll move it here since it's a better place for it. Since you're typing it into the command line you need to quote the JSON portion with single quotes to prevent the shell from misinterpreting the command. dcrctl.exe --wallet sendmany "default" '{"DshM....":100,"DshM.....":100}'
it's not working too, the same error dcrctl.exe --wallet sendmany "default" '{"Ds...":'37',"Ds...":'37'}' sendmany command: parameter #2 'amounts' must be valid JSON which unsmarshals to a map[string]float64 (code: ErrInv alidType) Usage: sendmany "fromaccount" {"address":amount,...} (minconf=1 "comment"
The single quotes should only be around the entire string, not the numbers too. I highlighted the single quotes which are incorrect in red and the ones which are correct in green.
not working dcrctl.exe --wallet sendmany "default" '{"Ds...":37,"Ds...":37}' sendmany command: parameter #2 'amounts' must be valid JSON which unsmarshals to a map[string]float64 (code: ErrInv alidType) Usage: sendmany "fromaccount" {"address":amount,...} (minconf=1 "comment")
Oh, I know what the issue is. I rarely use cmd.exe for the shell (because it isn't very good), and so I misremembered how the quoting rules work there. With cmd.exe you have to use double quotes for the entire argument and escape the inner double quotes. So, like the following: Code: dcrctl.exe --wallet sendmany "default" "{\"Ds...\":37,\"Dsinvalid\":37}"