Branch data Line data Source code
1 : : // Copyright (c) 2011-2022 The Bitcoin Core developers
2 : : // Distributed under the MIT software license, see the accompanying
3 : : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 : :
5 : : #include <core_io.h>
6 : : #include <hash.h>
7 : : #include <key_io.h>
8 : : #include <rpc/util.h>
9 : : #include <script/script.h>
10 : : #include <util/moneystr.h>
11 : : #include <wallet/coincontrol.h>
12 : : #include <wallet/receive.h>
13 : : #include <wallet/rpc/util.h>
14 : : #include <wallet/spend.h>
15 : : #include <wallet/wallet.h>
16 : :
17 : : #include <univalue.h>
18 : :
19 : :
20 : : namespace wallet {
21 : 42 : static CAmount GetReceived(const CWallet& wallet, const UniValue& params, bool by_label) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
22 : : {
23 : 42 : std::vector<CTxDestination> addresses;
24 [ + + ]: 42 : if (by_label) {
25 : : // Get the set of addresses assigned to label
26 [ + - + + : 73 : addresses = wallet.ListAddrBookAddresses(CWallet::AddrBookFilter{LabelFromValue(params[0])});
+ - ]
27 [ + + + - : 25 : if (addresses.empty()) throw JSONRPCError(RPC_WALLET_ERROR, "Label not found in wallet");
+ - ]
28 : : } else {
29 : : // Get the address
30 [ + - + - : 17 : CTxDestination dest = DecodeDestination(params[0].get_str());
+ - ]
31 [ + - - + ]: 17 : if (!IsValidDestination(dest)) {
32 [ # # # # ]: 0 : throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address");
33 : : }
34 [ + - ]: 17 : addresses.emplace_back(dest);
35 : 17 : }
36 : :
37 : : // Filter by own scripts only
38 : 40 : std::set<CScript> output_scripts;
39 [ + + ]: 97 : for (const auto& address : addresses) {
40 [ + - ]: 57 : auto output_script{GetScriptForDestination(address)};
41 [ + - + + ]: 57 : if (wallet.IsMine(output_script)) {
42 [ + - ]: 56 : output_scripts.insert(output_script);
43 : : }
44 : 57 : }
45 : :
46 [ + + ]: 40 : if (output_scripts.empty()) {
47 [ + - + - ]: 2 : throw JSONRPCError(RPC_WALLET_ERROR, "Address not found in wallet");
48 : : }
49 : :
50 : : // Minimum confirmations
51 : 39 : int min_depth = 1;
52 [ + - + + ]: 39 : if (!params[1].isNull())
53 [ + - + - ]: 3 : min_depth = params[1].getInt<int>();
54 : :
55 [ + - + + : 39 : const bool include_immature_coinbase{params[2].isNull() ? false : params[2].get_bool()};
+ - + - ]
56 : :
57 : : // Tally
58 : 39 : CAmount amount = 0;
59 [ + + + - ]: 3329 : for (const auto& [_, wtx] : wallet.mapWallet) {
60 [ + - ]: 3290 : int depth{wallet.GetTxDepthInMainChain(wtx)};
61 : 5613 : if (depth < min_depth
62 : : // Coinbase with less than 1 confirmation is no longer in the main chain
63 [ + + + + ]: 3288 : || (wtx.IsCoinBase() && (depth < 1))
64 [ + + + - : 6376 : || (wallet.IsTxImmatureCoinBase(wtx) && !include_immature_coinbase))
+ + + + ]
65 : : {
66 : 2323 : continue;
67 : : }
68 : :
69 [ + + ]: 2882 : for (const CTxOut& txout : wtx.tx->vout) {
70 [ + + ]: 1915 : if (output_scripts.count(txout.scriptPubKey) > 0) {
71 : 42 : amount += txout.nValue;
72 : : }
73 : : }
74 : : }
75 : :
76 : 78 : return amount;
77 : 42 : }
78 : :
79 : :
80 : 801 : RPCHelpMan getreceivedbyaddress()
81 : : {
82 : 801 : return RPCHelpMan{
83 : : "getreceivedbyaddress",
84 : : "Returns the total amount received by the given address in transactions with at least minconf confirmations.\n",
85 : : {
86 [ + - ]: 801 : {"address", RPCArg::Type::STR, RPCArg::Optional::NO, "The bitcoin address for transactions."},
87 [ + - ]: 1602 : {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "Only include transactions confirmed at least this many times."},
88 [ + - ]: 1602 : {"include_immature_coinbase", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include immature coinbase transactions."},
89 : : },
90 : 0 : RPCResult{
91 [ + - ]: 1602 : RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received at this address."
92 [ + - + - ]: 2403 : },
93 : 801 : RPCExamples{
94 : : "\nThe amount from transactions with at least 1 confirmation\n"
95 [ + - + - : 2403 : + HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\"") +
+ - + - ]
96 : 801 : "\nThe amount including unconfirmed transactions, zero confirmations\n"
97 [ + - + - : 4005 : + HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\" 0") +
+ - + - ]
98 : 801 : "\nThe amount with at least 6 confirmations\n"
99 [ + - + - : 4005 : + HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\" 6") +
+ - + - ]
100 : 801 : "\nThe amount with at least 6 confirmations including immature coinbase outputs\n"
101 [ + - + - : 4005 : + HelpExampleCli("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\" 6 true") +
+ - + - ]
102 : 801 : "\nAs a JSON-RPC call\n"
103 [ + - + - : 4005 : + HelpExampleRpc("getreceivedbyaddress", "\"" + EXAMPLE_ADDRESS[0] + "\", 6")
+ - + - ]
104 [ + - ]: 801 : },
105 : 17 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
106 : : {
107 [ - + ]: 17 : const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
108 [ - + ]: 17 : if (!pwallet) return UniValue::VNULL;
109 : :
110 : : // Make sure the results are valid at least up to the most recent block
111 : : // the user could have gotten from another RPC command prior to now
112 [ + - ]: 17 : pwallet->BlockUntilSyncedToCurrentChain();
113 : :
114 [ + - ]: 17 : LOCK(pwallet->cs_wallet);
115 : :
116 [ + + + - ]: 17 : return ValueFromAmount(GetReceived(*pwallet, request.params, /*by_label=*/false));
117 : 33 : },
118 [ + - + - : 15219 : };
+ - + - +
- + - + -
+ - + - +
- + + -
- ]
119 [ + - + - : 5607 : }
+ - + - -
- ]
120 : :
121 : :
122 : 809 : RPCHelpMan getreceivedbylabel()
123 : : {
124 : 809 : return RPCHelpMan{
125 : : "getreceivedbylabel",
126 : : "Returns the total amount received by addresses with <label> in transactions with at least [minconf] confirmations.\n",
127 : : {
128 [ + - ]: 809 : {"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The selected label, may be the default label using \"\"."},
129 [ + - ]: 1618 : {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "Only include transactions confirmed at least this many times."},
130 [ + - ]: 1618 : {"include_immature_coinbase", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include immature coinbase transactions."},
131 : : },
132 : 0 : RPCResult{
133 [ + - ]: 1618 : RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received for this label."
134 [ + - + - ]: 2427 : },
135 : 809 : RPCExamples{
136 : : "\nAmount received by the default label with at least 1 confirmation\n"
137 [ + - + - : 1618 : + HelpExampleCli("getreceivedbylabel", "\"\"") +
+ - + - ]
138 : 809 : "\nAmount received at the tabby label including unconfirmed amounts with zero confirmations\n"
139 [ + - + - : 3236 : + HelpExampleCli("getreceivedbylabel", "\"tabby\" 0") +
+ - + - ]
140 : 809 : "\nThe amount with at least 6 confirmations\n"
141 [ + - + - : 3236 : + HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") +
+ - + - ]
142 : 809 : "\nThe amount with at least 6 confirmations including immature coinbase outputs\n"
143 [ + - + - : 3236 : + HelpExampleCli("getreceivedbylabel", "\"tabby\" 6 true") +
+ - + - ]
144 : 809 : "\nAs a JSON-RPC call\n"
145 [ + - + - : 3236 : + HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6, true")
+ - + - ]
146 [ + - ]: 809 : },
147 : 25 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
148 : : {
149 [ - + ]: 25 : const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
150 [ - + ]: 25 : if (!pwallet) return UniValue::VNULL;
151 : :
152 : : // Make sure the results are valid at least up to the most recent block
153 : : // the user could have gotten from another RPC command prior to now
154 [ + - ]: 25 : pwallet->BlockUntilSyncedToCurrentChain();
155 : :
156 [ + - ]: 25 : LOCK(pwallet->cs_wallet);
157 : :
158 [ + + + - ]: 25 : return ValueFromAmount(GetReceived(*pwallet, request.params, /*by_label=*/true));
159 : 48 : },
160 [ + - + - : 15371 : };
+ - + - +
- + - + -
+ - + - +
- + + -
- ]
161 [ + - + - : 6472 : }
+ - + - +
- - - ]
162 : :
163 : :
164 : 1281 : RPCHelpMan getbalance()
165 : : {
166 : 1281 : return RPCHelpMan{
167 : : "getbalance",
168 : : "Returns the total available balance.\n"
169 : : "The available balance is what the wallet considers currently spendable, and is\n"
170 : : "thus affected by options which limit spendability such as -spendzeroconfchange.\n",
171 : : {
172 [ + - ]: 1281 : {"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "Remains for backward compatibility. Must be excluded or set to \"*\"."},
173 [ + - ]: 2562 : {"minconf", RPCArg::Type::NUM, RPCArg::Default{0}, "Only include transactions confirmed at least this many times."},
174 [ + - ]: 2562 : {"include_watchonly", RPCArg::Type::BOOL, RPCArg::DefaultHint{"true for watch-only wallets, otherwise false"}, "Also include balance in watch-only addresses (see 'importaddress')"},
175 [ + - ]: 2562 : {"avoid_reuse", RPCArg::Type::BOOL, RPCArg::Default{true}, "(only available if avoid_reuse wallet flag is set) Do not include balance in dirty outputs; addresses are considered dirty if they have previously been used in a transaction."},
176 : : },
177 : 0 : RPCResult{
178 [ + - ]: 2562 : RPCResult::Type::STR_AMOUNT, "amount", "The total amount in " + CURRENCY_UNIT + " received for this wallet."
179 [ + - + - ]: 3843 : },
180 : 1281 : RPCExamples{
181 : : "\nThe total amount in the wallet with 0 or more confirmations\n"
182 [ + - + - : 1281 : + HelpExampleCli("getbalance", "") +
+ - + - ]
183 : 1281 : "\nThe total amount in the wallet with at least 6 confirmations\n"
184 [ + - + - : 5124 : + HelpExampleCli("getbalance", "\"*\" 6") +
+ - + - ]
185 : 1281 : "\nAs a JSON-RPC call\n"
186 [ + - + - : 5124 : + HelpExampleRpc("getbalance", "\"*\", 6")
+ - + - ]
187 [ + - ]: 1281 : },
188 : 497 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
189 : : {
190 [ - + ]: 497 : const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
191 [ - + ]: 497 : if (!pwallet) return UniValue::VNULL;
192 : :
193 : : // Make sure the results are valid at least up to the most recent block
194 : : // the user could have gotten from another RPC command prior to now
195 [ + - ]: 497 : pwallet->BlockUntilSyncedToCurrentChain();
196 : :
197 [ + - ]: 497 : LOCK(pwallet->cs_wallet);
198 : :
199 [ + - ]: 497 : const auto dummy_value{self.MaybeArg<std::string>("dummy")};
200 [ + + + + ]: 497 : if (dummy_value && *dummy_value != "*") {
201 [ + - + - ]: 2 : throw JSONRPCError(RPC_METHOD_DEPRECATED, "dummy first argument must be excluded or set to \"*\".");
202 : : }
203 : :
204 [ + - ]: 496 : const auto min_depth{self.Arg<int>("minconf")};
205 : :
206 [ + - + - ]: 496 : bool include_watchonly = ParseIncludeWatchonly(request.params[2], *pwallet);
207 : :
208 [ + - + - ]: 496 : bool avoid_reuse = GetAvoidReuseFlag(*pwallet, request.params[3]);
209 : :
210 [ + - ]: 496 : const auto bal = GetBalance(*pwallet, min_depth, avoid_reuse);
211 : :
212 [ + + + - ]: 496 : return ValueFromAmount(bal.m_mine_trusted + (include_watchonly ? bal.m_watchonly_trusted : 0));
213 : 993 : },
214 [ + - + - : 30744 : };
+ - + - +
- + - + -
+ - + - +
- + - + -
+ + - - ]
215 [ + - + - : 11529 : }
+ - + - +
- - - ]
216 : :
217 : 819 : RPCHelpMan lockunspent()
218 : : {
219 : 819 : return RPCHelpMan{
220 : : "lockunspent",
221 : : "Updates list of temporarily unspendable outputs.\n"
222 : : "Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n"
223 : : "If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\n"
224 : : "A locked transaction output will not be chosen by automatic coin selection, when spending bitcoins.\n"
225 : : "Manually selected coins are automatically unlocked.\n"
226 : : "Locks are stored in memory only, unless persistent=true, in which case they will be written to the\n"
227 : : "wallet database and loaded on node start. Unwritten (persistent=false) locks are always cleared\n"
228 : : "(by virtue of process exit) when a node stops or fails. Unlocking will clear both persistent and not.\n"
229 : : "Also see the listunspent call\n",
230 : : {
231 [ + - ]: 819 : {"unlock", RPCArg::Type::BOOL, RPCArg::Optional::NO, "Whether to unlock (true) or lock (false) the specified transactions"},
232 : 1638 : {"transactions", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The transaction outputs and within each, the txid (string) vout (numeric).",
233 : : {
234 [ + - ]: 819 : {"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "",
235 : : {
236 [ + - ]: 819 : {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id"},
237 [ + - ]: 819 : {"vout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The output number"},
238 : : },
239 : : },
240 : : },
241 : : },
242 [ + - ]: 1638 : {"persistent", RPCArg::Type::BOOL, RPCArg::Default{false}, "Whether to write/erase this lock in the wallet database, or keep the change in memory only. Ignored for unlocking."},
243 : : },
244 : 0 : RPCResult{
245 : : RPCResult::Type::BOOL, "", "Whether the command was successful or not"
246 [ + - + - : 1638 : },
+ - ]
247 : 819 : RPCExamples{
248 : : "\nList the unspent transactions\n"
249 [ + - + - : 1638 : + HelpExampleCli("listunspent", "") +
+ - + - ]
250 : 819 : "\nLock an unspent transaction\n"
251 [ + - + - : 3276 : + HelpExampleCli("lockunspent", "false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
+ - + - ]
252 : 819 : "\nList the locked transactions\n"
253 [ + - + - : 3276 : + HelpExampleCli("listlockunspent", "") +
+ - + - ]
254 : 819 : "\nUnlock the transaction again\n"
255 [ + - + - : 3276 : + HelpExampleCli("lockunspent", "true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
+ - + - ]
256 : 819 : "\nLock the transaction persistently in the wallet database\n"
257 [ + - + - : 3276 : + HelpExampleCli("lockunspent", "false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\" true") +
+ - + - ]
258 : 819 : "\nAs a JSON-RPC call\n"
259 [ + - + - : 3276 : + HelpExampleRpc("lockunspent", "false, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"")
+ - + - ]
260 [ + - ]: 819 : },
261 : 35 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
262 : : {
263 : 35 : std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
264 [ - + ]: 35 : if (!pwallet) return UniValue::VNULL;
265 : :
266 : : // Make sure the results are valid at least up to the most recent block
267 : : // the user could have gotten from another RPC command prior to now
268 [ + - ]: 35 : pwallet->BlockUntilSyncedToCurrentChain();
269 : :
270 [ + - ]: 35 : LOCK(pwallet->cs_wallet);
271 : :
272 [ + - + - ]: 35 : bool fUnlock = request.params[0].get_bool();
273 : :
274 [ + - + + : 35 : const bool persistent{request.params[2].isNull() ? false : request.params[2].get_bool()};
+ - + - ]
275 : :
276 [ + - + + ]: 35 : if (request.params[1].isNull()) {
277 [ + - ]: 4 : if (fUnlock) {
278 [ + - - + ]: 4 : if (!pwallet->UnlockAllCoins())
279 [ # # # # ]: 0 : throw JSONRPCError(RPC_WALLET_ERROR, "Unlocking coins failed");
280 : : }
281 [ + - ]: 4 : return true;
282 : : }
283 : :
284 [ + - + - ]: 31 : const UniValue& output_params = request.params[1].get_array();
285 : :
286 : : // Create and validate the COutPoints first.
287 : :
288 : 31 : std::vector<COutPoint> outputs;
289 [ + - ]: 31 : outputs.reserve(output_params.size());
290 : :
291 [ + + ]: 93 : for (unsigned int idx = 0; idx < output_params.size(); idx++) {
292 [ + - + - ]: 71 : const UniValue& o = output_params[idx].get_obj();
293 : :
294 [ + - + + : 284 : RPCTypeCheckObj(o,
- - ]
295 : : {
296 [ + - ]: 71 : {"txid", UniValueType(UniValue::VSTR)},
297 [ + - ]: 71 : {"vout", UniValueType(UniValue::VNUM)},
298 : : });
299 : :
300 [ + + ]: 71 : const Txid txid = Txid::FromUint256(ParseHashO(o, "txid"));
301 [ + - + - ]: 69 : const int nOutput = o.find_value("vout").getInt<int>();
302 [ - + ]: 69 : if (nOutput < 0) {
303 [ # # # # ]: 0 : throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout cannot be negative");
304 : : }
305 : :
306 [ + - ]: 69 : const COutPoint outpt(txid, nOutput);
307 : :
308 [ + - ]: 69 : const auto it = pwallet->mapWallet.find(outpt.hash);
309 [ + + ]: 69 : if (it == pwallet->mapWallet.end()) {
310 [ + - + - ]: 2 : throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, unknown transaction");
311 : : }
312 : :
313 [ + + ]: 68 : const CWalletTx& trans = it->second;
314 : :
315 [ + + ]: 68 : if (outpt.n >= trans.tx->vout.size()) {
316 [ + - + - ]: 2 : throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout index out of bounds");
317 : : }
318 : :
319 [ + - + + ]: 67 : if (pwallet->IsSpent(outpt)) {
320 [ + - + - ]: 2 : throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected unspent output");
321 : : }
322 : :
323 [ + - ]: 66 : const bool is_locked = pwallet->IsLockedCoin(outpt);
324 : :
325 [ + + ]: 66 : if (fUnlock && !is_locked) {
326 [ + - + - ]: 2 : throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected locked output");
327 : : }
328 : :
329 [ + + + + ]: 65 : if (!fUnlock && is_locked && !persistent) {
330 [ + - + - ]: 6 : throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, output already locked");
331 : : }
332 : :
333 [ + - ]: 62 : outputs.push_back(outpt);
334 : : }
335 : :
336 : 22 : std::unique_ptr<WalletBatch> batch = nullptr;
337 : : // Unlock is always persistent
338 [ + + + - ]: 25 : if (fUnlock || persistent) batch = std::make_unique<WalletBatch>(pwallet->GetDatabase());
339 : :
340 : : // Atomically set (un)locked status for the outputs.
341 [ + + ]: 84 : for (const COutPoint& outpt : outputs) {
342 [ + + ]: 62 : if (fUnlock) {
343 [ + - - + : 2 : if (!pwallet->UnlockCoin(outpt, batch.get())) throw JSONRPCError(RPC_WALLET_ERROR, "Unlocking coin failed");
- - - - ]
344 : : } else {
345 [ + - - + : 60 : if (!pwallet->LockCoin(outpt, batch.get())) throw JSONRPCError(RPC_WALLET_ERROR, "Locking coin failed");
- - - - ]
346 : : }
347 : : }
348 : :
349 [ + - ]: 22 : return true;
350 [ + - + - : 163 : },
+ - - - ]
351 [ + - + - : 22932 : };
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + + +
+ + + - -
- - - - ]
352 [ + - + - : 10647 : }
+ - + - +
- + - + -
- - - - ]
353 : :
354 : 793 : RPCHelpMan listlockunspent()
355 : : {
356 : 793 : return RPCHelpMan{
357 : : "listlockunspent",
358 : : "Returns list of temporarily unspendable outputs.\n"
359 : : "See the lockunspent call to lock and unlock transactions for spending.\n",
360 : : {},
361 : 0 : RPCResult{
362 : : RPCResult::Type::ARR, "", "",
363 : : {
364 : : {RPCResult::Type::OBJ, "", "",
365 : : {
366 : : {RPCResult::Type::STR_HEX, "txid", "The transaction id locked"},
367 : : {RPCResult::Type::NUM, "vout", "The vout value"},
368 : : }},
369 : : }
370 [ + - + - : 4758 : },
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + + +
+ - - -
- ]
371 : 793 : RPCExamples{
372 : : "\nList the unspent transactions\n"
373 [ + - + - : 1586 : + HelpExampleCli("listunspent", "") +
+ - + - ]
374 : 793 : "\nLock an unspent transaction\n"
375 [ + - + - : 3172 : + HelpExampleCli("lockunspent", "false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
+ - + - ]
376 : 793 : "\nList the locked transactions\n"
377 [ + - + - : 3172 : + HelpExampleCli("listlockunspent", "") +
+ - + - ]
378 : 793 : "\nUnlock the transaction again\n"
379 [ + - + - : 3172 : + HelpExampleCli("lockunspent", "true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
+ - + - ]
380 : 793 : "\nAs a JSON-RPC call\n"
381 [ + - + - : 3172 : + HelpExampleRpc("listlockunspent", "")
+ - + - ]
382 [ + - ]: 793 : },
383 : 9 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
384 : : {
385 [ - + ]: 9 : const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
386 [ - + ]: 9 : if (!pwallet) return UniValue::VNULL;
387 : :
388 [ + - ]: 9 : LOCK(pwallet->cs_wallet);
389 : :
390 : 9 : std::vector<COutPoint> vOutpts;
391 [ + - ]: 9 : pwallet->ListLockedCoins(vOutpts);
392 : :
393 : 9 : UniValue ret(UniValue::VARR);
394 : :
395 [ + + ]: 13 : for (const COutPoint& outpt : vOutpts) {
396 : 4 : UniValue o(UniValue::VOBJ);
397 : :
398 [ + - + - : 8 : o.pushKV("txid", outpt.hash.GetHex());
+ - + - ]
399 [ + - + - : 8 : o.pushKV("vout", (int)outpt.n);
+ - ]
400 [ + - ]: 4 : ret.push_back(std::move(o));
401 : 4 : }
402 : :
403 : 9 : return ret;
404 [ + - ]: 27 : },
405 [ + - + - : 4758 : };
+ - + - ]
406 [ + - + - : 3172 : }
+ - + - -
- ]
407 : :
408 : 1359 : RPCHelpMan getbalances()
409 : : {
410 : 1359 : return RPCHelpMan{
411 : : "getbalances",
412 [ + - ]: 2718 : "Returns an object with all balances in " + CURRENCY_UNIT + ".\n",
413 : : {},
414 : 0 : RPCResult{
415 : : RPCResult::Type::OBJ, "", "",
416 : : {
417 : : {RPCResult::Type::OBJ, "mine", "balances from outputs that the wallet can sign",
418 : : {
419 : : {RPCResult::Type::STR_AMOUNT, "trusted", "trusted balance (outputs created by the wallet or confirmed outputs)"},
420 : : {RPCResult::Type::STR_AMOUNT, "untrusted_pending", "untrusted pending balance (outputs created by others that are in the mempool)"},
421 : : {RPCResult::Type::STR_AMOUNT, "immature", "balance from immature coinbase outputs"},
422 : : {RPCResult::Type::STR_AMOUNT, "used", /*optional=*/true, "(only present if avoid_reuse is set) balance from coins sent to addresses that were previously spent from (potentially privacy violating)"},
423 : : }},
424 : : RESULT_LAST_PROCESSED_BLOCK,
425 : : }
426 [ + - + - : 12231 : },
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
+ + + - -
- - ]
427 : 1359 : RPCExamples{
428 [ + - + - : 2718 : HelpExampleCli("getbalances", "") +
+ - ]
429 [ + - + - : 5436 : HelpExampleRpc("getbalances", "")},
+ - + - +
- ]
430 : 575 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
431 : : {
432 [ - + ]: 575 : const std::shared_ptr<const CWallet> rpc_wallet = GetWalletForJSONRPCRequest(request);
433 [ - + ]: 568 : if (!rpc_wallet) return UniValue::VNULL;
434 [ + - ]: 568 : const CWallet& wallet = *rpc_wallet;
435 : :
436 : : // Make sure the results are valid at least up to the most recent block
437 : : // the user could have gotten from another RPC command prior to now
438 [ + - ]: 568 : wallet.BlockUntilSyncedToCurrentChain();
439 : :
440 [ + - ]: 568 : LOCK(wallet.cs_wallet);
441 : :
442 [ + - ]: 568 : const auto bal = GetBalance(wallet);
443 : 568 : UniValue balances{UniValue::VOBJ};
444 : 568 : {
445 : 568 : UniValue balances_mine{UniValue::VOBJ};
446 [ + - + - : 1136 : balances_mine.pushKV("trusted", ValueFromAmount(bal.m_mine_trusted));
+ - ]
447 [ + - + - : 1136 : balances_mine.pushKV("untrusted_pending", ValueFromAmount(bal.m_mine_untrusted_pending));
+ - ]
448 [ + - + - : 1136 : balances_mine.pushKV("immature", ValueFromAmount(bal.m_mine_immature));
+ - ]
449 [ + - + + ]: 568 : if (wallet.IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE)) {
450 : : // If the AVOID_REUSE flag is set, bal has been set to just the un-reused address balance. Get
451 : : // the total balance, and then subtract bal to get the reused address balance.
452 [ + - ]: 11 : const auto full_bal = GetBalance(wallet, 0, false);
453 [ + - + - : 22 : balances_mine.pushKV("used", ValueFromAmount(full_bal.m_mine_trusted + full_bal.m_mine_untrusted_pending - bal.m_mine_trusted - bal.m_mine_untrusted_pending));
+ - ]
454 : : }
455 [ + - + - ]: 1136 : balances.pushKV("mine", std::move(balances_mine));
456 : 568 : }
457 [ + - ]: 568 : AppendLastProcessedBlock(balances, wallet);
458 : 568 : return balances;
459 [ + - ]: 1704 : },
460 [ + - + - : 10872 : };
+ - ]
461 [ + - + - : 8154 : }
+ - + - +
- + - + -
- - - - ]
462 : :
463 : 1150 : RPCHelpMan listunspent()
464 : : {
465 : 1150 : return RPCHelpMan{
466 : : "listunspent",
467 : : "Returns array of unspent transaction outputs\n"
468 : : "with between minconf and maxconf (inclusive) confirmations.\n"
469 : : "Optionally filter to only include txouts paid to specified addresses.\n",
470 : : {
471 [ + - ]: 2300 : {"minconf", RPCArg::Type::NUM, RPCArg::Default{1}, "The minimum confirmations to filter"},
472 [ + - ]: 2300 : {"maxconf", RPCArg::Type::NUM, RPCArg::Default{9999999}, "The maximum confirmations to filter"},
473 : 2300 : {"addresses", RPCArg::Type::ARR, RPCArg::Default{UniValue::VARR}, "The bitcoin addresses to filter",
474 : : {
475 [ + - ]: 1150 : {"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "bitcoin address"},
476 : : },
477 : : },
478 [ + - ]: 2300 : {"include_unsafe", RPCArg::Type::BOOL, RPCArg::Default{true}, "Include outputs that are not safe to spend\n"
479 : : "See description of \"safe\" attribute below."},
480 [ + - ]: 1150 : {"query_options", RPCArg::Type::OBJ_NAMED_PARAMS, RPCArg::Optional::OMITTED, "",
481 : : {
482 [ + - + - ]: 3450 : {"minimumAmount", RPCArg::Type::AMOUNT, RPCArg::Default{FormatMoney(0)}, "Minimum value of each UTXO in " + CURRENCY_UNIT + ""},
483 [ + - ]: 3450 : {"maximumAmount", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"unlimited"}, "Maximum value of each UTXO in " + CURRENCY_UNIT + ""},
484 [ + - ]: 2300 : {"maximumCount", RPCArg::Type::NUM, RPCArg::DefaultHint{"unlimited"}, "Maximum number of UTXOs"},
485 [ + - ]: 3450 : {"minimumSumAmount", RPCArg::Type::AMOUNT, RPCArg::DefaultHint{"unlimited"}, "Minimum sum value of all UTXOs in " + CURRENCY_UNIT + ""},
486 [ + - ]: 2300 : {"include_immature_coinbase", RPCArg::Type::BOOL, RPCArg::Default{false}, "Include immature coinbase UTXOs"}
487 : : },
488 [ + - + - ]: 1150 : RPCArgOptions{.oneline_description="query_options"}},
489 : : },
490 : 0 : RPCResult{
491 : : RPCResult::Type::ARR, "", "",
492 : : {
493 : : {RPCResult::Type::OBJ, "", "",
494 : : {
495 : : {RPCResult::Type::STR_HEX, "txid", "the transaction id"},
496 : : {RPCResult::Type::NUM, "vout", "the vout value"},
497 : : {RPCResult::Type::STR, "address", /*optional=*/true, "the bitcoin address"},
498 : : {RPCResult::Type::STR, "label", /*optional=*/true, "The associated label, or \"\" for the default label"},
499 : : {RPCResult::Type::STR, "scriptPubKey", "the output script"},
500 [ + - ]: 2300 : {RPCResult::Type::STR_AMOUNT, "amount", "the transaction output amount in " + CURRENCY_UNIT},
501 : : {RPCResult::Type::NUM, "confirmations", "The number of confirmations"},
502 : : {RPCResult::Type::NUM, "ancestorcount", /*optional=*/true, "The number of in-mempool ancestor transactions, including this one (if transaction is in the mempool)"},
503 : : {RPCResult::Type::NUM, "ancestorsize", /*optional=*/true, "The virtual transaction size of in-mempool ancestors, including this one (if transaction is in the mempool)"},
504 [ + - ]: 2300 : {RPCResult::Type::STR_AMOUNT, "ancestorfees", /*optional=*/true, "The total fees of in-mempool ancestors (including this one) with fee deltas used for mining priority in " + CURRENCY_ATOM + " (if transaction is in the mempool)"},
505 : : {RPCResult::Type::STR_HEX, "redeemScript", /*optional=*/true, "The redeem script if the output script is P2SH"},
506 : : {RPCResult::Type::STR, "witnessScript", /*optional=*/true, "witness script if the output script is P2WSH or P2SH-P2WSH"},
507 : : {RPCResult::Type::BOOL, "spendable", "Whether we have the private keys to spend this output"},
508 : : {RPCResult::Type::BOOL, "solvable", "Whether we know how to spend this output, ignoring the lack of keys"},
509 : : {RPCResult::Type::BOOL, "reused", /*optional=*/true, "(only present if avoid_reuse is set) Whether this output is reused/dirty (sent to an address that was previously spent from)"},
510 : : {RPCResult::Type::STR, "desc", /*optional=*/true, "(only when solvable) A descriptor for spending this output"},
511 : : {RPCResult::Type::ARR, "parent_descs", /*optional=*/false, "List of parent descriptors for the output script of this coin.", {
512 : : {RPCResult::Type::STR, "desc", "The descriptor string."},
513 : : }},
514 : : {RPCResult::Type::BOOL, "safe", "Whether this output is considered safe to spend. Unconfirmed transactions\n"
515 : : "from outside keys and unconfirmed replacement transactions are considered unsafe\n"
516 : : "and are not eligible for spending by fundrawtransaction and sendtoaddress."},
517 : : }},
518 : : }
519 [ + - + - : 32200 : },
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ + + + +
+ - - - -
- - ]
520 : 1150 : RPCExamples{
521 [ + - + - : 2300 : HelpExampleCli("listunspent", "")
+ - ]
522 [ + - + - : 6900 : + HelpExampleCli("listunspent", "6 9999999 \"[\\\"" + EXAMPLE_ADDRESS[0] + "\\\",\\\"" + EXAMPLE_ADDRESS[1] + "\\\"]\"")
+ - + - +
- ]
523 [ + - + - : 6900 : + HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"" + EXAMPLE_ADDRESS[0] + "\\\",\\\"" + EXAMPLE_ADDRESS[1] + "\\\"]\"")
+ - + - +
- ]
524 [ + - + - : 4600 : + HelpExampleCli("listunspent", "6 9999999 '[]' true '{ \"minimumAmount\": 0.005 }'")
+ - + - ]
525 [ + - + - : 4600 : + HelpExampleRpc("listunspent", "6, 9999999, [] , true, { \"minimumAmount\": 0.005 } ")
+ - + - ]
526 [ + - ]: 1150 : },
527 : 366 : [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
528 : : {
529 [ - + ]: 366 : const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
530 [ - + ]: 366 : if (!pwallet) return UniValue::VNULL;
531 : :
532 : 366 : int nMinDepth = 1;
533 [ + - + + ]: 366 : if (!request.params[0].isNull()) {
534 [ + - + - ]: 84 : nMinDepth = request.params[0].getInt<int>();
535 : : }
536 : :
537 : 366 : int nMaxDepth = 9999999;
538 [ + - + + ]: 366 : if (!request.params[1].isNull()) {
539 [ + - + - ]: 6 : nMaxDepth = request.params[1].getInt<int>();
540 : : }
541 : :
542 [ + - ]: 366 : std::set<CTxDestination> destinations;
543 [ + - + + ]: 366 : if (!request.params[2].isNull()) {
544 [ + - + - : 47 : UniValue inputs = request.params[2].get_array();
+ - ]
545 [ + + ]: 94 : for (unsigned int idx = 0; idx < inputs.size(); idx++) {
546 [ + - ]: 47 : const UniValue& input = inputs[idx];
547 [ + - + - ]: 47 : CTxDestination dest = DecodeDestination(input.get_str());
548 [ + - - + ]: 47 : if (!IsValidDestination(dest)) {
549 [ # # # # : 0 : throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Bitcoin address: ") + input.get_str());
# # # # ]
550 : : }
551 [ + - - + ]: 47 : if (!destinations.insert(dest).second) {
552 [ # # # # : 0 : throw JSONRPCError(RPC_INVALID_PARAMETER, std::string("Invalid parameter, duplicated address: ") + input.get_str());
# # # # ]
553 : : }
554 : 47 : }
555 : 47 : }
556 : :
557 : 366 : bool include_unsafe = true;
558 [ + - + + ]: 366 : if (!request.params[3].isNull()) {
559 [ + - + - ]: 5 : include_unsafe = request.params[3].get_bool();
560 : : }
561 : :
562 : 366 : CoinFilterParams filter_coins;
563 : 366 : filter_coins.min_amount = 0;
564 : :
565 [ + - + + ]: 366 : if (!request.params[4].isNull()) {
566 [ + - + - ]: 132 : const UniValue& options = request.params[4].get_obj();
567 : :
568 [ + - + + : 924 : RPCTypeCheckObj(options,
- - ]
569 : : {
570 [ + - ]: 132 : {"minimumAmount", UniValueType()},
571 [ + - ]: 132 : {"maximumAmount", UniValueType()},
572 [ + - ]: 132 : {"minimumSumAmount", UniValueType()},
573 [ + - ]: 132 : {"maximumCount", UniValueType(UniValue::VNUM)},
574 [ + - ]: 132 : {"include_immature_coinbase", UniValueType(UniValue::VBOOL)}
575 : : },
576 : : true, true);
577 : :
578 [ + - + + ]: 264 : if (options.exists("minimumAmount"))
579 [ + - + - : 128 : filter_coins.min_amount = AmountFromValue(options["minimumAmount"]);
+ - ]
580 : :
581 [ + - - + ]: 264 : if (options.exists("maximumAmount"))
582 [ # # # # : 0 : filter_coins.max_amount = AmountFromValue(options["maximumAmount"]);
# # ]
583 : :
584 [ + - - + ]: 264 : if (options.exists("minimumSumAmount"))
585 [ # # # # : 0 : filter_coins.min_sum_amount = AmountFromValue(options["minimumSumAmount"]);
# # ]
586 : :
587 [ + - - + ]: 264 : if (options.exists("maximumCount"))
588 [ # # # # : 0 : filter_coins.max_count = options["maximumCount"].getInt<int64_t>();
# # ]
589 : :
590 [ + - + + ]: 264 : if (options.exists("include_immature_coinbase")) {
591 [ + - + - : 4 : filter_coins.include_immature_coinbase = options["include_immature_coinbase"].get_bool();
+ - ]
592 : : }
593 : : }
594 : :
595 : : // Make sure the results are valid at least up to the most recent block
596 : : // the user could have gotten from another RPC command prior to now
597 [ + - ]: 366 : pwallet->BlockUntilSyncedToCurrentChain();
598 : :
599 : 366 : UniValue results(UniValue::VARR);
600 : 366 : std::vector<COutput> vecOutputs;
601 : 366 : {
602 [ + - ]: 366 : CCoinControl cctl;
603 : 366 : cctl.m_avoid_address_reuse = false;
604 : 366 : cctl.m_min_depth = nMinDepth;
605 : 366 : cctl.m_max_depth = nMaxDepth;
606 : 366 : cctl.m_include_unsafe_inputs = include_unsafe;
607 [ + - ]: 366 : LOCK(pwallet->cs_wallet);
608 [ + - + - : 732 : vecOutputs = AvailableCoinsListUnspent(*pwallet, &cctl, filter_coins).All();
+ - ]
609 : 366 : }
610 : :
611 [ + - ]: 366 : LOCK(pwallet->cs_wallet);
612 : :
613 [ + - ]: 366 : const bool avoid_reuse = pwallet->IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE);
614 : :
615 [ + + ]: 33892 : for (const COutput& out : vecOutputs) {
616 : 33526 : CTxDestination address;
617 : 33526 : const CScript& scriptPubKey = out.txout.scriptPubKey;
618 [ + - ]: 33526 : bool fValidAddress = ExtractDestination(scriptPubKey, address);
619 [ + + + - : 33526 : bool reused = avoid_reuse && pwallet->IsSpentKey(scriptPubKey);
+ + ]
620 : :
621 [ + + + - : 33526 : if (destinations.size() && (!fValidAddress || !destinations.count(address)))
+ + ]
622 : 234 : continue;
623 : :
624 : 33292 : UniValue entry(UniValue::VOBJ);
625 [ + - + - : 66584 : entry.pushKV("txid", out.outpoint.hash.GetHex());
+ - + - ]
626 [ + - + - : 66584 : entry.pushKV("vout", (int)out.outpoint.n);
+ - ]
627 : :
628 [ + - ]: 33292 : if (fValidAddress) {
629 [ + - + - : 66584 : entry.pushKV("address", EncodeDestination(address));
+ - + - ]
630 : :
631 [ + - ]: 33292 : const auto* address_book_entry = pwallet->FindAddressBookEntry(address);
632 [ + + ]: 33292 : if (address_book_entry) {
633 [ + - + - : 99012 : entry.pushKV("label", address_book_entry->GetLabel());
+ - + - ]
634 : : }
635 : :
636 [ + - ]: 33292 : std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey);
637 [ + - ]: 33292 : if (provider) {
638 [ + - + + ]: 33292 : if (scriptPubKey.IsPayToScriptHash()) {
639 [ - + + - ]: 10081 : const CScriptID hash = ToScriptID(std::get<ScriptHash>(address));
640 : 10081 : CScript redeemScript;
641 [ + - + - ]: 10081 : if (provider->GetCScript(hash, redeemScript)) {
642 [ + + + - : 30243 : entry.pushKV("redeemScript", HexStr(redeemScript));
+ - + - +
- ]
643 : : // Now check if the redeemScript is actually a P2WSH script
644 : 10081 : CTxDestination witness_destination;
645 [ + - + + ]: 10081 : if (redeemScript.IsPayToWitnessScriptHash()) {
646 [ + - ]: 2 : bool extracted = ExtractDestination(redeemScript, witness_destination);
647 [ + - ]: 2 : CHECK_NONFATAL(extracted);
648 : : // Also return the witness script
649 [ - + ]: 2 : const WitnessV0ScriptHash& whash = std::get<WitnessV0ScriptHash>(witness_destination);
650 [ + - ]: 2 : CScriptID id{RIPEMD160(whash)};
651 : 2 : CScript witnessScript;
652 [ + - + - ]: 2 : if (provider->GetCScript(id, witnessScript)) {
653 [ - + + - : 6 : entry.pushKV("witnessScript", HexStr(witnessScript));
+ - + - +
- ]
654 : : }
655 : 2 : }
656 : 10081 : }
657 [ + - + + ]: 33292 : } else if (scriptPubKey.IsPayToWitnessScriptHash()) {
658 [ - + ]: 30 : const WitnessV0ScriptHash& whash = std::get<WitnessV0ScriptHash>(address);
659 [ + - ]: 30 : CScriptID id{RIPEMD160(whash)};
660 : 30 : CScript witnessScript;
661 [ + - + - ]: 30 : if (provider->GetCScript(id, witnessScript)) {
662 [ + - + - : 90 : entry.pushKV("witnessScript", HexStr(witnessScript));
+ - + - +
- ]
663 : : }
664 : 30 : }
665 : : }
666 : 33292 : }
667 : :
668 [ + + + - : 99876 : entry.pushKV("scriptPubKey", HexStr(scriptPubKey));
+ - + - +
- ]
669 [ + - + - : 66584 : entry.pushKV("amount", ValueFromAmount(out.txout.nValue));
+ - ]
670 [ + - + - : 66584 : entry.pushKV("confirmations", out.depth);
+ - ]
671 [ + + ]: 33292 : if (!out.depth) {
672 : 75 : size_t ancestor_count, descendant_count, ancestor_size;
673 : 75 : CAmount ancestor_fees;
674 [ + - ]: 75 : pwallet->chain().getTransactionAncestry(out.outpoint.hash, ancestor_count, descendant_count, &ancestor_size, &ancestor_fees);
675 [ + - ]: 75 : if (ancestor_count) {
676 [ + - + - : 150 : entry.pushKV("ancestorcount", uint64_t(ancestor_count));
+ - ]
677 [ + - + - : 150 : entry.pushKV("ancestorsize", uint64_t(ancestor_size));
+ - ]
678 [ + - + - : 150 : entry.pushKV("ancestorfees", uint64_t(ancestor_fees));
+ - ]
679 : : }
680 : : }
681 [ + - + - : 66584 : entry.pushKV("spendable", out.spendable);
+ - ]
682 [ + - + - : 66584 : entry.pushKV("solvable", out.solvable);
+ - ]
683 [ + - ]: 33292 : if (out.solvable) {
684 [ + - ]: 33292 : std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey);
685 [ + - ]: 33292 : if (provider) {
686 [ + - ]: 33292 : auto descriptor = InferDescriptor(scriptPubKey, *provider);
687 [ + - + - : 66584 : entry.pushKV("desc", descriptor->ToString());
+ - + - ]
688 : 33292 : }
689 : 33292 : }
690 [ + - ]: 33292 : PushParentDescriptors(*pwallet, scriptPubKey, entry);
691 [ + + + - : 33308 : if (avoid_reuse) entry.pushKV("reused", reused);
+ - + - ]
692 [ + - + - : 66584 : entry.pushKV("safe", out.safe);
+ - ]
693 [ + - ]: 33292 : results.push_back(std::move(entry));
694 : 33526 : }
695 : :
696 [ + - ]: 366 : return results;
697 [ + - + - : 864 : },
+ - + - +
- + - -
- ]
698 [ + - + - : 65550 : };
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + + +
+ + + - -
- - - - ]
699 [ + - + - : 49450 : }
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - + - +
- + - + -
+ - - - -
- - - ]
700 : : } // namespace wallet
|