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

Make a new watchonly wallet file containing the public descriptors from this wallet The exported watchonly wallet file will be named and placed at the path specified in &apos;destination&apos;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e16015720)&rsqb;&rsqb;
xref:util/Result.adoc[util::Result&lt;std::string&gt;]
ExportWatchOnlyWallet(
    xref:wallet/CWallet.adoc[CWallet] const& wallet,
    xref:fs/path.adoc[fs::path] const& destination,
    xref:wallet/WalletContext.adoc[WalletContext]& context);
----

== Return Value

The name of the created watch&hyphen;only wallet on success, or an error on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *wallet*
| The wallet to export the public descriptors from&period;
| *destination*
| The path where the new watch&hyphen;only wallet file is created&period;
| *context*
| The wallet context used to create and load the new wallet&period;
|===


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