@@ -1190,7 +1190,7 @@ static UniValue listreceivedbyaddress(const JSONRPCRequest& request)
1190
1190
RPCResult{
1191
1191
" [\n "
1192
1192
" {\n "
1193
- " \" involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n "
1193
+ " \" involvesWatchonly\" : true, (bool) Only returns true if imported addresses were involved in transaction. \n "
1194
1194
" \" address\" : \" receivingaddress\" , (string) The receiving address\n "
1195
1195
" \" amount\" : x.xxx, (numeric) The total amount in " + CURRENCY_UNIT + " received by the address\n "
1196
1196
" \" confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n "
@@ -1240,7 +1240,7 @@ static UniValue listreceivedbylabel(const JSONRPCRequest& request)
1240
1240
RPCResult{
1241
1241
" [\n "
1242
1242
" {\n "
1243
- " \" involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n "
1243
+ " \" involvesWatchonly\" : true, (bool) Only returns true if imported addresses were involved in transaction. \n "
1244
1244
" \" amount\" : x.xxx, (numeric) The total amount received by addresses with this label\n "
1245
1245
" \" confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n "
1246
1246
" \" label\" : \" label\" (string) The label of the receiving address. The default label is \"\" .\n "
@@ -1359,6 +1359,27 @@ static void ListTransactions(interfaces::Chain::Lock& locked_chain, CWallet* con
1359
1359
}
1360
1360
}
1361
1361
1362
+ static const std::string TransactionDescriptionString ()
1363
+ {
1364
+ return " \" confirmations\" : n, (numeric) The number of confirmations for the transaction. Negative confirmations means the\n "
1365
+ " transaction conflicted that many blocks ago.\n "
1366
+ " \" generated\" : xxx, (bool) Only present if transaction only input is a coinbase one.\n "
1367
+ " \" trusted\" : xxx, (bool) Only present if we consider transaction to be trusted and so safe to spend from.\n "
1368
+ " \" blockhash\" : \" hashvalue\" , (string) The block hash containing the transaction.\n "
1369
+ " \" blockindex\" : n, (numeric) The index of the transaction in the block that includes it.\n "
1370
+ " \" blocktime\" : xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n "
1371
+ " \" txid\" : \" transactionid\" , (string) The transaction id.\n "
1372
+ " \" walletconflicts\" : [ (array) Conflicting transaction ids.\n "
1373
+ " \" txid\" , (string) The transaction id.\n "
1374
+ " ...\n "
1375
+ " ],\n "
1376
+ " \" time\" : xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n "
1377
+ " \" timereceived\" : xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n "
1378
+ " \" comment\" : \" ...\" , (string) If a comment is associated with the transaction, only present if not empty.\n "
1379
+ " \" bip125-replaceable\" : \" yes|no|unknown\" , (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n "
1380
+ " may be unknown for unconfirmed transactions not in the mempool\n " ;
1381
+ }
1382
+
1362
1383
UniValue listtransactions (const JSONRPCRequest& request)
1363
1384
{
1364
1385
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest (request);
@@ -1381,6 +1402,7 @@ UniValue listtransactions(const JSONRPCRequest& request)
1381
1402
RPCResult{
1382
1403
" [\n "
1383
1404
" {\n "
1405
+ " \" involvesWatchonly\" : xxx, (bool) Only returns true if imported addresses were involved in transaction.\n "
1384
1406
" \" address\" :\" address\" , (string) The bitcoin address of the transaction.\n "
1385
1407
" \" category\" : (string) The transaction category.\n "
1386
1408
" \" send\" Transactions sent.\n "
@@ -1394,19 +1416,8 @@ UniValue listtransactions(const JSONRPCRequest& request)
1394
1416
" \" vout\" : n, (numeric) the vout value\n "
1395
1417
" \" fee\" : x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + " . This is negative and only available for the \n "
1396
1418
" 'send' category of transactions.\n "
1397
- " \" confirmations\" : n, (numeric) The number of confirmations for the transaction. Negative confirmations indicate the\n "
1398
- " transaction conflicts with the block chain\n "
1399
- " \" trusted\" : xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n "
1400
- " \" blockhash\" : \" hashvalue\" , (string) The block hash containing the transaction.\n "
1401
- " \" blockindex\" : n, (numeric) The index of the transaction in the block that includes it.\n "
1402
- " \" blocktime\" : xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n "
1403
- " \" txid\" : \" transactionid\" , (string) The transaction id.\n "
1404
- " \" time\" : xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n "
1405
- " \" timereceived\" : xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n "
1406
- " \" comment\" : \" ...\" , (string) If a comment is associated with the transaction.\n "
1407
- " \" bip125-replaceable\" : \" yes|no|unknown\" , (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n "
1408
- " may be unknown for unconfirmed transactions not in the mempool\n "
1409
- " \" abandoned\" : xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n "
1419
+ + TransactionDescriptionString ()
1420
+ + " \" abandoned\" : xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n "
1410
1421
" 'send' category of transactions.\n "
1411
1422
" }\n "
1412
1423
" ]\n "
@@ -1515,6 +1526,7 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
1515
1526
RPCResult{
1516
1527
" {\n "
1517
1528
" \" transactions\" : [\n "
1529
+ " \" involvesWatchonly\" : xxx, (bool) Only returns true if imported addresses were involved in transaction.\n "
1518
1530
" \" address\" :\" address\" , (string) The bitcoin address of the transaction.\n "
1519
1531
" \" category\" : (string) The transaction category.\n "
1520
1532
" \" send\" Transactions sent.\n "
@@ -1526,17 +1538,8 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
1526
1538
" for all other categories\n "
1527
1539
" \" vout\" : n, (numeric) the vout value\n "
1528
1540
" \" fee\" : x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + " . This is negative and only available for the 'send' category of transactions.\n "
1529
- " \" confirmations\" : n, (numeric) The number of confirmations for the transaction.\n "
1530
- " When it's < 0, it means the transaction conflicted that many blocks ago.\n "
1531
- " \" blockhash\" : \" hashvalue\" , (string) The block hash containing the transaction.\n "
1532
- " \" blockindex\" : n, (numeric) The index of the transaction in the block that includes it.\n "
1533
- " \" blocktime\" : xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n "
1534
- " \" txid\" : \" transactionid\" , (string) The transaction id.\n "
1535
- " \" time\" : xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n "
1536
- " \" timereceived\" : xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT).\n "
1537
- " \" bip125-replaceable\" : \" yes|no|unknown\" , (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n "
1538
- " may be unknown for unconfirmed transactions not in the mempool\n "
1539
- " \" abandoned\" : xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n "
1541
+ + TransactionDescriptionString ()
1542
+ + " \" abandoned\" : xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n "
1540
1543
" \" comment\" : \" ...\" , (string) If a comment is associated with the transaction.\n "
1541
1544
" \" label\" : \" label\" (string) A comment for the address/transaction, if any\n "
1542
1545
" \" to\" : \" ...\" , (string) If a comment to is associated with the transaction.\n "
@@ -1655,40 +1658,33 @@ static UniValue gettransaction(const JSONRPCRequest& request)
1655
1658
},
1656
1659
RPCResult{
1657
1660
" {\n "
1658
- " \" amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + " \n "
1659
- " \" fee\" : x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + " . This is negative and only available for the \n "
1661
+ " \" amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + " \n "
1662
+ " \" fee\" : x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + " . This is negative and only available for the \n "
1660
1663
" 'send' category of transactions.\n "
1661
- " \" confirmations\" : n, (numeric) The number of confirmations\n "
1662
- " \" blockhash\" : \" hash\" , (string) The block hash\n "
1663
- " \" blockindex\" : xx, (numeric) The index of the transaction in the block that includes it\n "
1664
- " \" blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n "
1665
- " \" txid\" : \" transactionid\" , (string) The transaction id.\n "
1666
- " \" time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n "
1667
- " \" timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n "
1668
- " \" bip125-replaceable\" : \" yes|no|unknown\" , (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n "
1669
- " may be unknown for unconfirmed transactions not in the mempool\n "
1670
- " \" details\" : [\n "
1671
- " {\n "
1672
- " \" address\" : \" address\" , (string) The bitcoin address involved in the transaction\n "
1673
- " \" category\" : (string) The transaction category.\n "
1674
- " \" send\" Transactions sent.\n "
1675
- " \" receive\" Non-coinbase transactions received.\n "
1676
- " \" generate\" Coinbase transactions received with more than 100 confirmations.\n "
1677
- " \" immature\" Coinbase transactions received with 100 or fewer confirmations.\n "
1678
- " \" orphan\" Orphaned coinbase transactions received.\n "
1679
- " \" amount\" : x.xxx, (numeric) The amount in " + CURRENCY_UNIT + " \n "
1680
- " \" label\" : \" label\" , (string) A comment for the address/transaction, if any\n "
1681
- " \" vout\" : n, (numeric) the vout value\n "
1682
- " \" fee\" : x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + " . This is negative and only available for the \n "
1664
+ + TransactionDescriptionString ()
1665
+ + " \" details\" : [\n "
1666
+ " {\n "
1667
+ " \" involvesWatchonly\" : xxx, (bool) Only returns true if imported addresses were involved in transaction.\n "
1668
+ " \" address\" : \" address\" , (string) The bitcoin address involved in the transaction\n "
1669
+ " \" category\" : (string) The transaction category.\n "
1670
+ " \" send\" Transactions sent.\n "
1671
+ " \" receive\" Non-coinbase transactions received.\n "
1672
+ " \" generate\" Coinbase transactions received with more than 100 confirmations.\n "
1673
+ " \" immature\" Coinbase transactions received with 100 or fewer confirmations.\n "
1674
+ " \" orphan\" Orphaned coinbase transactions received.\n "
1675
+ " \" amount\" : x.xxx, (numeric) The amount in " + CURRENCY_UNIT + " \n "
1676
+ " \" label\" : \" label\" , (string) A comment for the address/transaction, if any\n "
1677
+ " \" vout\" : n, (numeric) the vout value\n "
1678
+ " \" fee\" : x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + " . This is negative and only available for the \n "
1683
1679
" 'send' category of transactions.\n "
1684
- " \" abandoned\" : xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n "
1680
+ " \" abandoned\" : xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n "
1685
1681
" 'send' category of transactions.\n "
1686
- " }\n "
1687
- " ,...\n "
1688
- " ],\n "
1689
- " \" hex\" : \" data\" (string) Raw data for transaction\n "
1690
- " \" decoded\" : transaction (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the\n "
1691
- " RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.\n "
1682
+ " }\n "
1683
+ " ,...\n "
1684
+ " ],\n "
1685
+ " \" hex\" : \" data\" (string) Raw data for transaction\n "
1686
+ " \" decoded\" : transaction (json object) Optional, the decoded transaction (only present when `verbose` is passed), equivalent to the\n "
1687
+ " RPC decoderawtransaction method, or the RPC getrawtransaction method when `verbose` is passed.\n "
1692
1688
" }\n "
1693
1689
},
1694
1690
RPCExamples{
0 commit comments