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?

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.