@@ -1747,22 +1747,23 @@ RPCHelpMan listdescriptors()
1747
1747
" listdescriptors" ,
1748
1748
" \n List descriptors imported into a descriptor-enabled wallet." ,
1749
1749
{},
1750
- RPCResult{
1751
- RPCResult::Type::ARR, " " , " Response is an array of descriptor objects" ,
1750
+ RPCResult{RPCResult::Type::OBJ, " " , " " , {
1751
+ {RPCResult::Type::STR, " wallet_name" , " Name of wallet this operation was performed on" },
1752
+ {RPCResult::Type::ARR, " descriptors" , " Array of descriptor objects" ,
1752
1753
{
1753
1754
{RPCResult::Type::OBJ, " " , " " , {
1754
1755
{RPCResult::Type::STR, " desc" , " Descriptor string representation" },
1755
1756
{RPCResult::Type::NUM, " timestamp" , " The creation time of the descriptor" },
1756
1757
{RPCResult::Type::BOOL, " active" , " Activeness flag" },
1757
- {RPCResult::Type::BOOL, " internal" , true , " Whether this is internal or external descriptor; defined only for active descriptors" },
1758
+ {RPCResult::Type::BOOL, " internal" , true , " Whether this is an internal or external descriptor; defined only for active descriptors" },
1758
1759
{RPCResult::Type::ARR_FIXED, " range" , true , " Defined only for ranged descriptors" , {
1759
1760
{RPCResult::Type::NUM, " " , " Range start inclusive" },
1760
1761
{RPCResult::Type::NUM, " " , " Range end inclusive" },
1761
1762
}},
1762
1763
{RPCResult::Type::NUM, " next" , true , " The next index to generate addresses from; defined only for ranged descriptors" },
1763
1764
}},
1764
- }
1765
- },
1765
+ }}
1766
+ }} ,
1766
1767
RPCExamples{
1767
1768
HelpExampleCli (" listdescriptors" , " " ) + HelpExampleRpc (" listdescriptors" , " " )
1768
1769
},
@@ -1779,7 +1780,7 @@ RPCHelpMan listdescriptors()
1779
1780
1780
1781
LOCK (wallet->cs_wallet );
1781
1782
1782
- UniValue response (UniValue::VARR);
1783
+ UniValue descriptors (UniValue::VARR);
1783
1784
const auto active_spk_mans = wallet->GetActiveScriptPubKeyMans ();
1784
1785
for (const auto & spk_man : wallet->GetAllScriptPubKeyMans ()) {
1785
1786
const auto desc_spk_man = dynamic_cast <DescriptorScriptPubKeyMan*>(spk_man);
@@ -1808,9 +1809,13 @@ RPCHelpMan listdescriptors()
1808
1809
spk.pushKV (" range" , range);
1809
1810
spk.pushKV (" next" , wallet_descriptor.next_index );
1810
1811
}
1811
- response .push_back (spk);
1812
+ descriptors .push_back (spk);
1812
1813
}
1813
1814
1815
+ UniValue response (UniValue::VOBJ);
1816
+ response.pushKV (" wallet_name" , wallet->GetName ());
1817
+ response.pushKV (" descriptors" , descriptors);
1818
+
1814
1819
return response;
1815
1820
},
1816
1821
};
0 commit comments