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

Fills out a PSBT with information from the wallet&period; Fills in UTXOs if we have them&period; Tries to sign if options&period;sign&equals;true&period; Sets `complete` if the PSBT is now complete (i&period;e&period; has all required signatures or signature&hyphen;parts, and is ready to finalize&period;)

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;common::PSBTError&gt;
FillPSBT(
    xref:PartiallySignedTransaction.adoc[PartiallySignedTransaction]& psbtx,
    xref:common/PSBTFillOptions.adoc[common::PSBTFillOptions] const& options,
    bool& complete,
    size&lowbar;t* n&lowbar;signed = nullptr) const;
----

== Return Value

an error if something goes wrong

== Parameters

[cols="1,4"]
|===
| Name| Description
| *psbtx* [in]
| PartiallySignedTransaction to fill in
| *options* [in]
| options for filling or signing
| *complete* [out]
| indicates whether the PSBT is now complete
| *n&lowbar;signed* [out]
| the number of inputs signed by this wallet
|===


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