-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Closed
Labels
Description
The first line of RPC help messages follow the syntax:
method [optionalparam] [optionalparam]
That doesn't work nicely now that we have parameters that are JSON objects or arrays.
I propose that the syntax be changed to:
method requiredparam requiredparam ( optionalparam optionalparam )
... that string-type parameters by reported in double-quotes, number-type parameters left as-is, Arrays be reported as [foo,...] and Objects as {"foo":bar}
... and that default values be specified in the description, not using the (confusing) foo=3 syntax.
Examples of help using old and new schemes:
verifymessage <bitcoinaddress> <signature> <message>
verifymessage "bitcoinaddress" "signature" "message"
getreceivedbyaddress <bitcoinaddress> [minconf=1]
getreceivedbyaddress "bitcoinaddress" ( minconf )
sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )
listunspent [minconf=1] [maxconf=9999999] ["address",...]
listunspent ( minconf maxconf ["address",...] )
signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighashtype="ALL"]
signrawtransaction "hex string" ( [{"txid":txid,"vout":n,"scriptPubKey":hex},...] ["privatekey1",...] "sighashtype" )