[#wallet-CoinsResult]
= xref:wallet.adoc[wallet]::CoinsResult
:relfileprefix: ../
:mrdocs:

COutputs available for spending, stored by OutputType&period; This struct is really just a wrapper around OutputType vectors with a convenient method for concatenating and returning all COutputs as one vector&period;

== Synopsis

Declared in `&lt;wallet&sol;spend&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct CoinsResult;
----

== Description

Size(), Erase(), Shuffle(), and Add() methods are implemented to allow easy interaction with the struct&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CoinsResult/Add.adoc[`Add`] 
| Add a single output of the given type to the result&period;
| xref:wallet/CoinsResult/All.adoc[`All`] 
| Concatenate and return all COutputs as one vector
| xref:wallet/CoinsResult/Erase.adoc[`Erase`] 
| Remove the given outpoints from the stored coins&period;
| xref:wallet/CoinsResult/GetAppropriateTotal.adoc[`GetAppropriateTotal`] 
| Returns the appropriate total based on whether fees are being subtracted from outputs&period;
| xref:wallet/CoinsResult/GetEffectiveTotalAmount.adoc[`GetEffectiveTotalAmount`] 
| Return the sum of the effective value of all available coins, if known&period;
| xref:wallet/CoinsResult/GetTotalAmount.adoc[`GetTotalAmount`] 
| Return the sum of the raw value of all available coins&period;
| xref:wallet/CoinsResult/Shuffle.adoc[`Shuffle`] 
| Randomly shuffle the stored coins&period;
| xref:wallet/CoinsResult/Size.adoc[`Size`] 
| The following methods are provided so that CoinsResult can mimic a vector, i&period;e&period;, methods can work with individual OutputType vectors or on the entire object
| xref:wallet/CoinsResult/TypesCount.adoc[`TypesCount`] 
| Return how many different output types this struct stores
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CoinsResult/coins.adoc[`coins`] 
| Available outputs grouped by their output type&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/AvailableCoins.adoc[`AvailableCoins`]
| Populate the CoinsResult struct with vectors of available COutputs, organized by OutputType&period;
| xref:wallet/FetchSelectedInputs.adoc[`FetchSelectedInputs`]
| Fetch and validate coin control selected inputs&period; Coins could be internal (from the wallet) or external&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
