diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index c20f2941d2cc9..4365a72407b86 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -285,10 +285,12 @@ UniValue getblockhashes(const UniValue& params, bool fHelp) "1. high (numeric, required) The newer block timestamp\n" "2. low (numeric, required) The older block timestamp\n" "\nResult:\n" - "[" + "[\n" " \"hash\" (string) The block hash\n" - "]" + "]\n" "\nExamples:\n" + + HelpExampleCli("getblockhashes", "1231614698 1231024505") + + HelpExampleRpc("getblockhashes", "1231614698, 1231024505") ); unsigned int high = params[0].get_int(); diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 04715802372f5..27a09c0fc4b6a 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -102,6 +102,14 @@ static const CRPCConvertParam vRPCConvertParams[] = { "prioritisetransaction", 2 }, { "setban", 2 }, { "setban", 3 }, + { "getblockhashes", 0 }, + { "getblockhashes", 1 }, + { "getspentinfo", 0}, + { "getaddresstxids", 0}, + { "getaddressbalance", 0}, + { "getaddressdeltas", 0}, + { "getaddressutxos", 0}, + { "getaddressmempool", 0}, }; class CRPCConvertTable diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 651f9d5da3130..328e9eb290626 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -462,7 +462,30 @@ UniValue getaddressmempool(const UniValue& params, bool fHelp) throw runtime_error( "getaddressmempool\n" "\nReturns all mempool deltas for an address (requires addressindex to be enabled).\n" - ); + "\nArguments:\n" + "{\n" + " \"addresses\"\n" + " [\n" + " \"address\" (string) The base58check encoded address\n" + " ,...\n" + " ]\n" + "}\n" + "\nResult:\n" + "[\n" + " {\n" + " \"address\" (string) The base58check encoded address\n" + " \"txid\" (string) The related txid\n" + " \"index\" (number) The related input or output index\n" + " \"satoshis\" (number) The difference of satoshis\n" + " \"timestamp\" (number) The time the transaction entered the mempool (seconds)\n" + " \"prevtxid\" (string) The previous txid (if spending)\n" + " \"prevout\" (string) The previous transaction output index (if spending)\n" + " }\n" + "]\n" + "\nExamples:\n" + + HelpExampleCli("getaddressmempool", "'{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}'") + + HelpExampleRpc("getaddressmempool", "{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}") + ); std::vector > addresses; @@ -510,6 +533,14 @@ UniValue getaddressutxos(const UniValue& params, bool fHelp) throw runtime_error( "getaddressutxos\n" "\nReturns all unspent outputs for an address (requires addressindex to be enabled).\n" + "\nArguments:\n" + "{\n" + " \"addresses\"\n" + " [\n" + " \"address\" (string) The base58check encoded address\n" + " ,...\n" + " ]\n" + "}\n" "\nResult\n" "[\n" " {\n" @@ -521,7 +552,10 @@ UniValue getaddressutxos(const UniValue& params, bool fHelp) " \"satoshis\" (number) The number of satoshis of the output\n" " }\n" "]\n" - ); + "\nExamples:\n" + + HelpExampleCli("getaddressutxos", "'{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}'") + + HelpExampleRpc("getaddressutxos", "{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}") + ); std::vector > addresses; @@ -566,7 +600,17 @@ UniValue getaddressdeltas(const UniValue& params, bool fHelp) throw runtime_error( "getaddressdeltas\n" "\nReturns all changes for an address (requires addressindex to be enabled).\n" - "\nResult\n" + "\nArguments:\n" + "{\n" + " \"addresses\"\n" + " [\n" + " \"address\" (string) The base58check encoded address\n" + " ,...\n" + " ]\n" + " \"start\" (number) The start block height\n" + " \"end\" (number) The end block height\n" + "}\n" + "\nResult:\n" "[\n" " {\n" " \"satoshis\" (number) The difference of satoshis\n" @@ -576,6 +620,9 @@ UniValue getaddressdeltas(const UniValue& params, bool fHelp) " \"address\" (string) The base58check encoded address\n" " }\n" "]\n" + "\nExamples:\n" + + HelpExampleCli("getaddressdeltas", "'{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}'") + + HelpExampleRpc("getaddressdeltas", "{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}") ); @@ -639,12 +686,23 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( "getaddressbalance\n" - "\nReturns the balance for an address (requires addressindex to be enabled).\n" - "\nResult\n" + "\nReturns the balance for an address(es) (requires addressindex to be enabled).\n" + "\nArguments:\n" "{\n" - " \"balance\" (string) The current balance\n" - " ,...\n" + " \"addresses\"\n" + " [\n" + " \"address\" (string) The base58check encoded address\n" + " ,...\n" + " ]\n" "}\n" + "\nResult:\n" + "{\n" + " \"balance\" (string) The current balance in satoshis\n" + " \"received\" (string) The total number of satoshis received (including change)\n" + "}\n" + "\nExamples:\n" + + HelpExampleCli("getaddressbalance", "'{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}'") + + HelpExampleRpc("getaddressbalance", "{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}") ); std::vector > addresses; @@ -684,12 +742,25 @@ UniValue getaddresstxids(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( "getaddresstxids\n" - "\nReturns the txids for an address (requires addressindex to be enabled).\n" - "\nResult\n" + "\nReturns the txids for an address(es) (requires addressindex to be enabled).\n" + "\nArguments:\n" + "{\n" + " \"addresses\"\n" + " [\n" + " \"address\" (string) The base58check encoded address\n" + " ,...\n" + " ]\n" + " \"start\" (number) The start block height\n" + " \"end\" (number) The end block height\n" + "}\n" + "\nResult:\n" "[\n" " \"transactionid\" (string) The transaction id\n" " ,...\n" "]\n" + "\nExamples:\n" + + HelpExampleCli("getaddresstxids", "'{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}'") + + HelpExampleRpc("getaddresstxids", "{\"addresses\": [\"12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\"]}") ); std::vector > addresses; @@ -756,12 +827,20 @@ UniValue getspentinfo(const UniValue& params, bool fHelp) throw runtime_error( "getspentinfo\n" "\nReturns the txid and index where an output is spent.\n" - "\nResult\n" + "\nArguments:\n" + "{\n" + " \"txid\" (string) The hex string of the txid\n" + " \"index\" (number) The start block height\n" + "}\n" + "\nResult:\n" "{\n" " \"txid\" (string) The transaction id\n" " \"index\" (number) The spending input index\n" " ,...\n" "}\n" + "\nExamples:\n" + + HelpExampleCli("getspentinfo", "'{\"txid\": \"0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9\", \"index\": 0}'") + + HelpExampleRpc("getspentinfo", "{\"txid\": \"0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9\", \"index\": 0}") ); UniValue txidValue = find_value(params[0].get_obj(), "txid");