How to pass parameters for multisignature addresses from Perl to the JSON::RPC::Client?

1

I'm trying to create a multisig address with JSON::RPC::Client but I don't know how to pass the parameters. I can pass simple params such as in validateaddress that requires only <bitcoinaddress>. Working example:

$obj = { method  => 'validateaddress', params => ["$just_a_bit_address_in_string"],};
$res = $client->call($uri, $obj);

But when it comes to other types of parameters such as in createmultisig, that the required params are < nrequired > <'["key,"key"]'>, I don't know to pass it to $obj. How do I do that?

brooks

Posted 2015-04-13T20:03:05.250

Reputation: 15

Answers

0

The ["key,"key"] part of the documentation means that it expects an array.

You need to call it like this:

$obj = {method  => 'createmultisig', params => [2, ["$key1", "$key2"]],};
$res = $client->call($uri, $obj);

Nick ODell

Posted 2015-04-13T20:03:05.250

Reputation: 26 536