I am trying to use bitcoin's 'sendmany' function (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) to send mass payment with a perl script. I am running bitcoind on a vps and other functions are working fine but sendmany isn't. This is the code that I have :
use Finance::Bitcoin::API;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
use Data::Dumper;
my %recipients = ("ADDRESS1" => sprintf("%.8f",0.00005460)+0, "ADDRESS2" => sprintf("%.8f",0.00005460)+0);
my $uri = "https://$rpcuser:$rpcpass\@$rpcip:8332/";
my $api = Finance::Bitcoin::API->new( endpoint => $uri );
my $action = $api->call('sendmany','',%recipients);
if ($api->error)
{
print Dumper($api->error->{message})."\n";
}
else
{
print Dumper($action)."\n";
}
I am able to send single payments using the 'sendtoaddress' function and I am able to use the sendmany function directly in the vps that is running bitcoind by executing it from the shell, but it fails when I try it using the perl script above. There is no error message, I just get the instructions for using sendmany from shell and using curl. Can someone tell me what I am doing wrong?