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

Adds script and derivation path information to a PSBT, and optionally signs it&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
std::optional&lt;common::PSBTError&gt;
FillPSBT(
    xref:PartiallySignedTransaction.adoc[PartiallySignedTransaction]& psbt,
    xref:PrecomputedTransactionData.adoc[PrecomputedTransactionData] const& txdata,
    xref:common/PSBTFillOptions.adoc[common::PSBTFillOptions] const& options,
    int* n&lowbar;signed = nullptr) const;
----

== Return Value

A PSBTError if filling failed, or nullopt on success&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *psbt*
| The partially signed transaction to fill, updated in place&period;
| *txdata*
| Precomputed transaction data used during signing&period;
| *options*
| Options controlling what is filled in and whether to sign&period;
| *n&lowbar;signed*
| If not null, set to the number of inputs signed&period;
|===


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