[#miniscript-FromString]
= xref:miniscript.adoc[miniscript]::FromString
:relfileprefix: ../
:mrdocs:

Parses a Miniscript from its textual (policy&hyphen;language) representation&period;

== Synopsis

Declared in `&lt;script&sol;miniscript&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Ctx&gt;
std::optional&lt;Node&lt;Ctx::Key&gt;&gt;
FromString(
    std::string const& str,
    Ctx const& ctx);
----

== Return Value

The parsed node tree, or std&colon;&colon;nullopt on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| The Miniscript string to parse&period;
| *ctx*
| Context providing key parsing and the script context&period;
|===


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