-
Notifications
You must be signed in to change notification settings - Fork 3
/
Blockchain-Fae-Internal-Contract.html
105 lines (105 loc) · 196 KB
/
Blockchain-Fae-Internal-Contract.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Blockchain.Fae.Internal.Contract</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Blockchain.Fae.Internal.Contract.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">fae-2.0.0.0</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(c) Ryan Reich 2017-2018</td></tr><tr><th>License</th><td>MIT</td></tr><tr><th>Maintainer</th><td>ryan.reich@gmail.com</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Blockchain.Fae.Internal.Contract</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types</a><ul><li><a href="#g:2">Transaction data</a></li><li><a href="#g:3">Contract data</a></li><li><a href="#g:4">Contract outputs</a></li><li><a href="#g:5">Internal contract monads</a></li><li><a href="#g:6">Internal contract functions</a></li><li><a href="#g:7">External contract functions</a></li><li><a href="#g:8">User-visible</a></li></ul></li><li><a href="#g:9">Fae typeclasses</a></li><li><a href="#g:10">Template Haskell</a></li><li><a href="#g:11">API Functions</a><ul><li><a href="#g:12">Using escrows</a></li></ul></li><li><a href="#g:13">Internal functions</a><ul><li><a href="#g:14">Static data</a></li><li><a href="#g:15">Calling</a></li><li><a href="#g:16">Contract function converters</a></li><li><a href="#g:17">Escrow manipulation</a></li><li><a href="#g:18"><code>ReturnValue</code> manipulation</a></li></ul></li><li><a href="#g:19"><code>TXBodyM</code> stack manipulation</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Everything in Fae is a contract, and this module defines contracts and
their construction.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:TXData">TXData</a> = <a href="#v:TXData">TXData</a> {<ul class="subs"><li><a href="#v:thisTXSigners">thisTXSigners</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Signers">Signers</a></li><li><a href="#v:localHash">localHash</a> :: <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></li><li><a href="#v:thisTXID">thisTXID</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:TransactionID">TransactionID</a></li><li><a href="#v:localMaterials">localMaterials</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a></li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:MaterialsMap">MaterialsMap</a> = <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Assignment">Assignment</a> = <a href="#v:Assignment">Assignment</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignable">Assignable</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Assignable">Assignable</a><ul class="subs"><li>= <a href="#v:SignerName">SignerName</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a></li><li>| <a href="#v:MaterialsName">MaterialsName</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a></li><li>| <a href="#v:NewMaterial">NewMaterial</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a></li></ul></li><li class="src short"><span class="keyword">data</span> <a href="#t:WithMaterials">WithMaterials</a> a = <a href="#v:WithMaterials">WithMaterials</a> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a>) a</li><li class="src short"><span class="keyword">data</span> <a href="#t:ReturnValue">ReturnValue</a> = (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a) => <a href="#v:ReturnValue">ReturnValue</a> !a</li><li class="src short"><span class="keyword">data</span> <a href="#t:NamedContract">NamedContract</a> name = <a href="#v:NamedContract">NamedContract</a> {<ul class="subs"><li><a href="#v:contractName">contractName</a> :: !name</li><li><a href="#v:contractNextID">contractNextID</a> :: !<a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></li><li><a href="#v:endowment">endowment</a> :: !<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:AnyNamedContract">AnyNamedContract</a> = <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> name => <a href="#v:AnyNamedContract">AnyNamedContract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name)</li><li class="src short"><span class="keyword">data</span> <a href="#t:EscrowEntry">EscrowEntry</a> = <a href="#v:EscrowEntry">EscrowEntry</a> {<ul class="subs"><li><a href="#v:escrowVersion">escrowVersion</a> :: !<a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a></li><li><a href="#v:escrowNameOrFunction">escrowNameOrFunction</a> :: !(<a href="../base-4.10.1.0/Data-Either.html#t:Either">Either</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AnyNamedContract">AnyNamedContract</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractLocalContract">AbstractLocalContract</a>)</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:EscrowMap">EscrowMap</a> = <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EntryID">EntryID</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowEntry">EscrowEntry</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:WithEscrows">WithEscrows</a> a = <a href="#v:WithEscrows">WithEscrows</a> {<ul class="subs"><li><a href="#v:withEscrows">withEscrows</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></li><li><a href="#v:getWithEscrows">getWithEscrows</a> :: a</li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Escrows">Escrows</a> = <a href="#v:Escrows">Escrows</a> {<ul class="subs"><li><a href="#v:escrowMap">escrowMap</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></li><li><a href="#v:nextID">nextID</a> :: <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:Output">Output</a> = <a href="#v:Output">Output</a> {<ul class="subs"><li><a href="#v:storedContract">storedContract</a> :: <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a></li><li><a href="#v:contractNameType">contractNameType</a> :: <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></li><li><a href="#v:contractValType">contractValType</a> :: <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:StoredContract">StoredContract</a> = <a href="#v:StoredContract">StoredContract</a> {<ul class="subs"><li><a href="#v:storedFunction">storedFunction</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a></li><li><a href="#v:storedVersion">storedVersion</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a></li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:EscrowsT">EscrowsT</a> = <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:StateT">StateT</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:TXDataM">TXDataM</a> = <a href="../mtl-2.2.2/Control-Monad-Reader.html#t:Reader">Reader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:FaeExternalM">FaeExternalM</a> = <a href="../mtl-2.2.2/Control-Monad-Writer-Lazy.html#t:WriterT">WriterT</a> [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>] <a href="Blockchain-Fae-Internal-Contract.html#t:TXDataM">TXDataM</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:FaeContractM">FaeContractM</a> argType valType = <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowsT">EscrowsT</a> (<a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendT">SuspendT</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType) (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="Blockchain-Fae-Internal-Contract.html#t:FaeExternalM">FaeExternalM</a>)</li><li class="src short"><span class="keyword">type</span> <a href="#t:FaeTXM">FaeTXM</a> = <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowsT">EscrowsT</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeExternalM">FaeExternalM</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:TXBodyM">TXBodyM</a> = <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:StateT">StateT</a> [<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>] <a href="Blockchain-Fae-Internal-Contract.html#t:TXDataM">TXDataM</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:PreContractF">PreContractF</a> argType valType = <a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendPreF">SuspendPreF</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType) (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="Blockchain-Fae-Internal-Contract.html#t:FaeExternalM">FaeExternalM</a></li><li class="src short"><span class="keyword">newtype</span> <a href="#t:ContractF">ContractF</a> m argType valType = <a href="#v:ContractF">ContractF</a> {<ul class="subs"><li><a href="#v:getContractF">getContractF</a> :: <a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendStepF">SuspendStepF</a> argType valType m</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:AbstractLocalContract">AbstractLocalContract</a> = <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:AbstractGlobalContract">AbstractGlobalContract</a> = <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>])</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:Fae">Fae</a> argType valType a = <a href="#v:Fae">Fae</a> {<ul class="subs"><li><a href="#v:getFae">getFae</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeContractM">FaeContractM</a> argType valType a</li></ul>}</li><li class="src short"><span class="keyword">newtype</span> <a href="#t:FaeTX">FaeTX</a> a = <a href="#v:FaeTX">FaeTX</a> {<ul class="subs"><li><a href="#v:getFaeTX">getFaeTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> a</li></ul>}</li><li class="src short"><span class="keyword">type</span> <a href="#t:Contract">Contract</a> argType valType = <a href="Blockchain-Fae-Internal-Contract.html#t:ContractT">ContractT</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType) argType valType</li><li class="src short"><span class="keyword">type</span> <a href="#t:ContractT">ContractT</a> m argType valType = argType -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType)</li><li class="src short"><span class="keyword">class</span> <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a => <a href="#t:Exportable">Exportable</a> a <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> a), <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> a)) => <a href="#t:ContractName">ContractName</a> a <span class="keyword">where</span><ul class="subs"><li><span class="keyword">type</span> <a href="#t:ArgType">ArgType</a> a</li><li><span class="keyword">type</span> <a href="#t:ValType">ValType</a> a</li></ul></li><li class="src short"><span class="keyword">class</span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => <a href="#t:MonadContract">MonadContract</a> argType valType m | m -> argType valType <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><span class="keyword">class</span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="#t:MonadTX">MonadTX</a> m <span class="keyword">where</span><ul class="subs"></ul></li><li class="src short"><a href="#v:_withEscrows">_withEscrows</a> :: <span class="keyword">forall</span> a. <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></li><li class="src short"><a href="#v:_getWithEscrows">_getWithEscrows</a> :: <span class="keyword">forall</span> a a. <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens">Lens</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) a a</li><li class="src short"><a href="#v:_nextID">_nextID</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></li><li class="src short"><a href="#v:_escrowMap">_escrowMap</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></li><li class="src short"><a href="#v:_thisTXSigners">_thisTXSigners</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Signers">Signers</a></li><li class="src short"><a href="#v:_thisTXID">_thisTXID</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:TransactionID">TransactionID</a></li><li class="src short"><a href="#v:_localMaterials">_localMaterials</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a></li><li class="src short"><a href="#v:_localHash">_localHash</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></li><li class="src short"><a href="#v:_storedContract">_storedContract</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a>)</li><li class="src short"><a href="#v:_contractValType">_contractValType</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></li><li class="src short"><a href="#v:_contractNameType">_contractNameType</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></li><li class="src short"><a href="#v:_storedVersion">_storedVersion</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a></li><li class="src short"><a href="#v:_storedFunction">_storedFunction</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a></li><li class="src short"><a href="#v:lookupMaterial">lookupMaterial</a> :: <span class="keyword">forall</span> a m. (<a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</li><li class="src short"><a href="#v:material">material</a> :: <span class="keyword">forall</span> a m. (<a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m a</li><li class="src short"><a href="#v:materials">materials</a> :: <span class="keyword">forall</span> a m. (<a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a) => m (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> a)</li><li class="src short"><a href="#v:lookupSigner">lookupSigner</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:PublicKey">PublicKey</a>)</li><li class="src short"><a href="#v:signer">signer</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m <a href="Blockchain-Fae-Internal-Crypto.html#t:PublicKey">PublicKey</a></li><li class="src short"><a href="#v:signers">signers</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => m (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:PublicKey">PublicKey</a>)</li><li class="src short"><a href="#v:spend">spend</a> :: <span class="keyword">forall</span> m argType valType. (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType m) => valType -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType)</li><li class="src short"><a href="#v:release">release</a> :: <span class="keyword">forall</span> argType valType m. (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType m) => valType -> m argType</li><li class="src short"><a href="#v:newContract">newContract</a> :: <span class="keyword">forall</span> name m. (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> name, <a href="../base-4.10.1.0/Text-Read.html#t:Read">Read</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> name), <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> name), <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m) => name -> m ()</li><li class="src short"><a href="#v:newEscrow">newEscrow</a> :: (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> name, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m) => name -> m (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:EscrowID">EscrowID</a> name)</li><li class="src short"><a href="#v:useEscrow">useEscrow</a> :: (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> name, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> name), <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m) => [<a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a>] -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EscrowID">EscrowID</a> name -> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> name -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> name)</li><li class="src short"><a href="#v:-60--45--124-">(<-|)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a></li><li class="src short"><a href="#v:-8612-">(↤)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a></li><li class="src short"><a href="#v:-60--61--124-">(<=|)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a></li><li class="src short"><a href="#v:-10502-">(⤆)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a></li><li class="src short"><a href="#v:-42--60--45-">(*<-)</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a></li><li class="src short"><a href="#v:-10525-">(⤝)</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a></li><li class="src short"><a href="#v:makeAssignments">makeAssignments</a> :: [<a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a>] -> (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a>, <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a>, <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a>)</li><li class="src short"><a href="#v:mapNames">mapNames</a> :: (<a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Exceptions.html#t:ContractException">ContractException</a>) -> <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> b -> <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> b</li><li class="src short"><a href="#v:remapMaterials">remapMaterials</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-Reader.html#t:MonadReader">MonadReader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a> -> m a -> m a</li><li class="src short"><a href="#v:remapSigners">remapSigners</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-Reader.html#t:MonadReader">MonadReader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> m => <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m a -> m a</li><li class="src short"><a href="#v:pushArg">pushArg</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-Reader.html#t:MonadReader">MonadReader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> m => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m a -> m a</li><li class="src short"><a href="#v:txData">txData</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:TransactionID">TransactionID</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Signers">Signers</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a></li><li class="src short"><a href="#v:callContract">callContract</a> :: <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType -> argType -> m (valType, <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType))</li><li class="src short"><a href="#v:localContract">localContract</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> argType, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType) => <a href="Blockchain-Fae-Internal-Contract.html#t:PreContractF">PreContractF</a> argType valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractLocalContract">AbstractLocalContract</a></li><li class="src short"><a href="#v:globalContract">globalContract</a> :: (<a href="../base-4.10.1.0/Text-Read.html#t:Read">Read</a> argType, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> argType, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> valType, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType) => <a href="Blockchain-Fae-Internal-Contract.html#t:PreContractF">PreContractF</a> argType valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a></li><li class="src short"><a href="#v:acceptLocal">acceptLocal</a> :: <span class="keyword">forall</span> argType. <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> argType => <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType)</li><li class="src short"><a href="#v:returnLocal">returnLocal</a> :: <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType => <a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a></li><li class="src short"><a href="#v:acceptGlobal">acceptGlobal</a> :: <span class="keyword">forall</span> argType. (<a href="../base-4.10.1.0/Text-Read.html#t:Read">Read</a> argType, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> argType) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType)</li><li class="src short"><a href="#v:returnGlobal">returnGlobal</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> valType) => (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>]) -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>])</li><li class="src short"><a href="#v:acceptTyped">acceptTyped</a> :: <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> argType => argType -> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a></li><li class="src short"><a href="#v:returnTyped">returnTyped</a> :: <span class="keyword">forall</span> valType. <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType => <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> -> valType</li><li class="src short"><a href="#v:hideEscrows">hideEscrows</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> argType valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:PreContractF">PreContractF</a> argType valType</li><li class="src short"><a href="#v:forkNextID">forkNextID</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> (<a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a>, <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a>)</li><li class="src short"><a href="#v:putEscrows">putEscrows</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a -> m a</li><li class="src short"><a href="#v:takeEscrows">takeEscrows</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m) => valType -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType)</li><li class="src short"><a href="#v:useNamedEscrow">useNamedEscrow</a> :: (<a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> name) => <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EscrowID">EscrowID</a> name -> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:EntryID">EntryID</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a> -> <a href="../base-4.10.1.0/Data-Either.html#t:Either">Either</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name) <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractLocalContract">AbstractLocalContract</a> -> m a) -> m a</li><li class="src short"><a href="#v:liftEscrowState">liftEscrowState</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m => <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:State">State</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> a -> m a</li><li class="src short"><a href="#v:joinEscrowState">joinEscrowState</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m => <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:State">State</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> (m a) -> m a</li><li class="src short"><a href="#v:lookupWithEscrows">lookupWithEscrows</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EntryID">EntryID</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a></li><li class="src short"><a href="#v:getReturnValue">getReturnValue</a> :: <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a => <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> -> <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a</li><li class="src short"><a href="#v:returnValueType">returnValueType</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> -> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></li><li class="src short"><a href="#v:exportReturnValue">exportReturnValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> -> m <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a></li><li class="src short"><a href="#v:push">push</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> ()</li><li class="src short"><a href="#v:pop">pop</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></li><li class="src short"><a href="#v:keep">keep</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> ()</li><li class="src short"><a href="#v:unconsTXBodyM">unconsTXBodyM</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>])</li></ul></div><div id="interface"><h1 id="g:1">Types</h1><h2 id="g:2">Transaction data</h2><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:TXData" class="def">TXData</a> <a href="src/Blockchain.Fae.Internal.Contract.html#TXData" class="link">Source</a> <a href="#t:TXData" class="selflink">#</a></p><div class="doc"><p>The relevant transaction info</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:TXData" class="def">TXData</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:thisTXSigners" class="def">thisTXSigners</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Signers">Signers</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:localHash" class="def">localHash</a> :: <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:thisTXID" class="def">thisTXID</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:TransactionID">TransactionID</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:localMaterials" class="def">localMaterials</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a></dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:TXData" class="caption collapser" onclick="toggleSection('i:TXData')">Instances</p><div id="section.i:TXData" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:TXData:MonadTX:1" class="instance expander" onclick="toggleSection('i:id:TXData:MonadTX:1')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-350" class="link">Source</a> <a href="#t:TXData" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:TXData:MonadTX:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:MaterialsMap" class="def">MaterialsMap</a> = <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> <a href="src/Blockchain.Fae.Internal.Contract.html#MaterialsMap" class="link">Source</a> <a href="#t:MaterialsMap" class="selflink">#</a></p><div class="doc"><p>Useful shorthand.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Assignment" class="def">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#Assignment" class="link">Source</a> <a href="#t:Assignment" class="selflink">#</a></p><div class="doc"><p>A single declaration of a material (or signer) for a nested call.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Assignment" class="def">Assignment</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignable">Assignable</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a></td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Assignable" class="def">Assignable</a> <a href="src/Blockchain.Fae.Internal.Contract.html#Assignable" class="link">Source</a> <a href="#t:Assignable" class="selflink">#</a></p><div class="doc"><p>The (private) constructors allow one of the following options: remap
a signer's role name; remap a material's role name; introduce a new
material.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:SignerName" class="def">SignerName</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:MaterialsName" class="def">MaterialsName</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:NewMaterial" class="def">NewMaterial</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a></td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:WithMaterials" class="def">WithMaterials</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#WithMaterials" class="link">Source</a> <a href="#t:WithMaterials" class="selflink">#</a></p><div class="doc"><p>Similar to <code><a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a></code> below, but one level more abstract: packages
a contract argument with a set of implicit "materials" values whose
escrows can be extracted in <code><a href="Blockchain-Fae-Internal-Contract.html#v:acceptLocal">acceptLocal</a></code> (using the <code><a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a></code> modifier).</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:WithMaterials" class="def">WithMaterials</a> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a>) a</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:WithMaterials" class="caption collapser" onclick="toggleSection('i:WithMaterials')">Instances</p><div id="section.i:WithMaterials" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:WithMaterials:HasEscrowIDs:1" class="instance expander" onclick="toggleSection('i:id:WithMaterials:HasEscrowIDs:1')"></span> <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a => <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithMaterials">WithMaterials</a> a)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-315" class="link">Source</a> <a href="#t:WithMaterials" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:WithMaterials:HasEscrowIDs:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:traverseEscrowIDs">traverseEscrowIDs</a> :: <a href="Blockchain-Fae-Internal-IDs.html#t:EscrowIDTraversal">EscrowIDTraversal</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithMaterials">WithMaterials</a> a) <a href="src/Blockchain.Fae.Internal.IDs.html#traverseEscrowIDs" class="link">Source</a> <a href="#v:traverseEscrowIDs" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h2 id="g:3">Contract data</h2><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:ReturnValue" class="def">ReturnValue</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ReturnValue" class="link">Source</a> <a href="#t:ReturnValue" class="selflink">#</a></p><div class="doc"><p>Another dynamic type, this time including <code><a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a></code>. Its
constructor is strict, so as not to distinguish between an error in the
outer value and an error in the inner value.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src">(<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a) => <a id="v:ReturnValue" class="def">ReturnValue</a> !a</td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:ReturnValue" class="caption collapser" onclick="toggleSection('i:ReturnValue')">Instances</p><div id="section.i:ReturnValue" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ReturnValue:HasEscrowIDs:1" class="instance expander" onclick="toggleSection('i:id:ReturnValue:HasEscrowIDs:1')"></span> <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-311" class="link">Source</a> <a href="#t:ReturnValue" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:ReturnValue:HasEscrowIDs:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:traverseEscrowIDs">traverseEscrowIDs</a> :: <a href="Blockchain-Fae-Internal-IDs.html#t:EscrowIDTraversal">EscrowIDTraversal</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> <a href="src/Blockchain.Fae.Internal.IDs.html#traverseEscrowIDs" class="link">Source</a> <a href="#v:traverseEscrowIDs" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:NamedContract" class="def">NamedContract</a> name <a href="src/Blockchain.Fae.Internal.Contract.html#NamedContract" class="link">Source</a> <a href="#t:NamedContract" class="selflink">#</a></p><div class="doc"><p>Something like a closure for the initial state of a new contract
(currently only escrows). The actual contract function can be
reconstructed from this, but a <code><a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a></code> itself is <code>Serializable</code>
while a <code><a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a></code> is not.</p><p>The fields are strict to ensure that undefined values are detected in
the present contract call, and not unexpectedly, later.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:NamedContract" class="def">NamedContract</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:contractName" class="def">contractName</a> :: !name</dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:contractNextID" class="def">contractNextID</a> :: !<a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:endowment" class="def">endowment</a> :: !<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:NamedContract" class="caption collapser" onclick="toggleSection('i:NamedContract')">Instances</p><div id="section.i:NamedContract" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:NamedContract:Generic:1" class="instance expander" onclick="toggleSection('i:id:NamedContract:Generic:1')"></span> <a href="Blockchain-Fae.html#t:Generic">Generic</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-97" class="link">Source</a> <a href="#t:NamedContract" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:NamedContract:Generic:1" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> -> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="#t:Rep" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name -> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name) x <a href="#v:from" class="selflink">#</a></p><p class="src"><a href="#v:to">to</a> :: <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name) x -> <a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name <a href="#v:to" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:NamedContract:Rep:2" class="instance expander" onclick="toggleSection('i:id:NamedContract:Rep:2')"></span> <span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-1" class="link">Source</a> <a href="#t:NamedContract" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:NamedContract:Rep:2" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name) = <a href="../base-4.10.1.0/GHC-Generics.html#t:D1">D1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaData">MetaData</a> "NamedContract" "Blockchain.Fae.Internal.Contract" "fae-2.0.0.0-L07ThzIQy745sKb2gq45cw" <a href="../base-4.10.1.0/Data-Bool.html#v:False">False</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:C1">C1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaCons">MetaCons</a> "NamedContract" <a href="../base-4.10.1.0/GHC-Generics.html#v:PrefixI">PrefixI</a> <a href="../base-4.10.1.0/Data-Bool.html#v:True">True</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t::-42-:">(:*:)</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "contractName") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:SourceStrict">SourceStrict</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedStrict">DecidedStrict</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> name)) (<a href="../base-4.10.1.0/GHC-Generics.html#t::-42-:">(:*:)</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "contractNextID") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:SourceStrict">SourceStrict</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedStrict">DecidedStrict</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a>)) (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "endowment") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:SourceStrict">SourceStrict</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedStrict">DecidedStrict</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>)))))</div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:AnyNamedContract" class="def">AnyNamedContract</a> <a href="src/Blockchain.Fae.Internal.Contract.html#AnyNamedContract" class="link">Source</a> <a href="#t:AnyNamedContract" class="selflink">#</a></p><div class="doc"><p>The union of contract entry types for all possible names.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> name => <a id="v:AnyNamedContract" class="def">AnyNamedContract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name)</td><td class="doc empty"> </td></tr></table></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:EscrowEntry" class="def">EscrowEntry</a> <a href="src/Blockchain.Fae.Internal.Contract.html#EscrowEntry" class="link">Source</a> <a href="#t:EscrowEntry" class="selflink">#</a></p><div class="doc"><p>Each escrow has a continually updated version that we need to track;
this holds both for the escrow map of a contract and the escrows
accompanying a returned value.</p><p>The fields are strict to ensure that undefined values are detected in
the present contract call, and not unexpectedly, later.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:EscrowEntry" class="def">EscrowEntry</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:escrowVersion" class="def">escrowVersion</a> :: !<a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:escrowNameOrFunction" class="def">escrowNameOrFunction</a> :: !(<a href="../base-4.10.1.0/Data-Either.html#t:Either">Either</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AnyNamedContract">AnyNamedContract</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractLocalContract">AbstractLocalContract</a>)</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:EscrowEntry" class="caption collapser" onclick="toggleSection('i:EscrowEntry')">Instances</p><div id="section.i:EscrowEntry" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:EscrowEntry:NFData:1" class="instance expander" onclick="toggleSection('i:id:EscrowEntry:NFData:1')"></span> <a href="../cryptonite-0.25/Crypto-Internal-DeepSeq.html#t:NFData">NFData</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowEntry">EscrowEntry</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-307" class="link">Source</a> <a href="#t:EscrowEntry" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:EscrowEntry:NFData:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowEntry">EscrowEntry</a> -> () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:EscrowMap" class="def">EscrowMap</a> = <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EntryID">EntryID</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowEntry">EscrowEntry</a> <a href="src/Blockchain.Fae.Internal.Contract.html#EscrowMap" class="link">Source</a> <a href="#t:EscrowMap" class="selflink">#</a></p><div class="doc"><p>Convenience type.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:WithEscrows" class="def">WithEscrows</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#WithEscrows" class="link">Source</a> <a href="#t:WithEscrows" class="selflink">#</a></p><div class="doc"><p>This type encodes a value together with its backing escrows. It is
constructed automatically, and you can't construct it manually, so it is
only useful in type signatures; it forces contracts to return values
only via <code><a href="Blockchain-Fae-Internal-Contract.html#v:spend">spend</a></code> and <code><a href="Blockchain-Fae-Internal-Contract.html#v:release">release</a></code>.</p><p>This is actually a <code><a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a></code> isomorphic to <code>Writer EscrowMap</code>, but it is
more work than it is worth to write the instances for that.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:WithEscrows" class="def">WithEscrows</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:withEscrows" class="def">withEscrows</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:getWithEscrows" class="def">getWithEscrows</a> :: a</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:WithEscrows" class="caption collapser" onclick="toggleSection('i:WithEscrows')">Instances</p><div id="section.i:WithEscrows" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:WithEscrows:Generic:1" class="instance expander" onclick="toggleSection('i:id:WithEscrows:Generic:1')"></span> <a href="Blockchain-Fae.html#t:Generic">Generic</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-128" class="link">Source</a> <a href="#t:WithEscrows" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:WithEscrows:Generic:1" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> -> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="#t:Rep" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a -> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) x <a href="#v:from" class="selflink">#</a></p><p class="src"><a href="#v:to">to</a> :: <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) x -> <a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a <a href="#v:to" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:WithEscrows:ContractName:2" class="instance expander" onclick="toggleSection('i:id:WithEscrows:ContractName:2')"></span> (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> b) => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-340" class="link">Source</a> <a href="#t:WithEscrows" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:WithEscrows:ContractName:2" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:WithEscrows:Rep:3" class="instance expander" onclick="toggleSection('i:id:WithEscrows:Rep:3')"></span> <span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-1" class="link">Source</a> <a href="#t:WithEscrows" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:WithEscrows:Rep:3" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) = <a href="../base-4.10.1.0/GHC-Generics.html#t:D1">D1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaData">MetaData</a> "WithEscrows" "Blockchain.Fae.Internal.Contract" "fae-2.0.0.0-L07ThzIQy745sKb2gq45cw" <a href="../base-4.10.1.0/Data-Bool.html#v:False">False</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:C1">C1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaCons">MetaCons</a> "WithEscrows" <a href="../base-4.10.1.0/GHC-Generics.html#v:PrefixI">PrefixI</a> <a href="../base-4.10.1.0/Data-Bool.html#v:True">True</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t::-42-:">(:*:)</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "withEscrows") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>)) (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "getWithEscrows") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> a))))</div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:WithEscrows:ArgType:4" class="instance expander" onclick="toggleSection('i:id:WithEscrows:ArgType:4')"></span> <span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-341" class="link">Source</a> <a href="#t:WithEscrows" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:WithEscrows:ArgType:4" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) = a</div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:WithEscrows:ValType:5" class="instance expander" onclick="toggleSection('i:id:WithEscrows:ValType:5')"></span> <span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-342" class="link">Source</a> <a href="#t:WithEscrows" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:WithEscrows:ValType:5" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) = b</div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Escrows" class="def">Escrows</a> <a href="src/Blockchain.Fae.Internal.Contract.html#Escrows" class="link">Source</a> <a href="#t:Escrows" class="selflink">#</a></p><div class="doc"><p>How escrows are kept in each contract. Contracts track their escrow
ID sequence separately to prevent coupling between different ones.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Escrows" class="def">Escrows</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:escrowMap" class="def">escrowMap</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:nextID" class="def">nextID</a> :: <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a></dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Escrows" class="caption collapser" onclick="toggleSection('i:Escrows')">Instances</p><div id="section.i:Escrows" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Escrows:MonadTX:1" class="instance expander" onclick="toggleSection('i:id:Escrows:MonadTX:1')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-350" class="link">Source</a> <a href="#t:Escrows" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:Escrows:MonadTX:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h2 id="g:4">Contract outputs</h2><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Output" class="def">Output</a> <a href="src/Blockchain.Fae.Internal.Contract.html#Output" class="link">Source</a> <a href="#t:Output" class="selflink">#</a></p><div class="doc"><p>Stores the actual contract function, the type of its <code><a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a></code>
for exporting purposes, and the "nonce", or number of successful contract
calls.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Output" class="def">Output</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:storedContract" class="def">storedContract</a> :: <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:contractNameType" class="def">contractNameType</a> :: <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></dfn><div class="doc"><p>This is not <code>Maybe</code> because even when the contract is spent, we
need its type for exporting.</p></div></li><li><dfn class="src"><a id="v:contractValType" class="def">contractValType</a> :: <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a></dfn><div class="doc"><p>Likewise, this is needed to type-check the contract when it is
called (without examining the possibly-uncomputable return value).</p></div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Output" class="caption collapser" onclick="toggleSection('i:Output')">Instances</p><div id="section.i:Output" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Output:Generic:1" class="instance expander" onclick="toggleSection('i:id:Output:Generic:1')"></span> <a href="Blockchain-Fae.html#t:Generic">Generic</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-154" class="link">Source</a> <a href="#t:Output" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Output:Generic:1" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> -> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="#t:Rep" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> -> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> x <a href="#v:from" class="selflink">#</a></p><p class="src"><a href="#v:to">to</a> :: <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> x -> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> <a href="#v:to" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Output:NFData:2" class="instance expander" onclick="toggleSection('i:id:Output:NFData:2')"></span> <a href="../cryptonite-0.25/Crypto-Internal-DeepSeq.html#t:NFData">NFData</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-301" class="link">Source</a> <a href="#t:Output" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:Output:NFData:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> -> () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Output:MonadTX:3" class="instance expander" onclick="toggleSection('i:id:Output:MonadTX:3')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-350" class="link">Source</a> <a href="#t:Output" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:Output:MonadTX:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Output:Rep:4" class="instance expander" onclick="toggleSection('i:id:Output:Rep:4')"></span> <span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-1" class="link">Source</a> <a href="#t:Output" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Output:Rep:4" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> = <a href="../base-4.10.1.0/GHC-Generics.html#t:D1">D1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaData">MetaData</a> "Output" "Blockchain.Fae.Internal.Contract" "fae-2.0.0.0-L07ThzIQy745sKb2gq45cw" <a href="../base-4.10.1.0/Data-Bool.html#v:False">False</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:C1">C1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaCons">MetaCons</a> "Output" <a href="../base-4.10.1.0/GHC-Generics.html#v:PrefixI">PrefixI</a> <a href="../base-4.10.1.0/Data-Bool.html#v:True">True</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t::-42-:">(:*:)</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "storedContract") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a>))) (<a href="../base-4.10.1.0/GHC-Generics.html#t::-42-:">(:*:)</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "contractNameType") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a>)) (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "contractValType") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a>)))))</div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:StoredContract" class="def">StoredContract</a> <a href="src/Blockchain.Fae.Internal.Contract.html#StoredContract" class="link">Source</a> <a href="#t:StoredContract" class="selflink">#</a></p><div class="doc"><p>If the contract can be called again, this contains its function (which
is called) and nonce (which is verified when the contract ID used
contains a nonce).</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:StoredContract" class="def">StoredContract</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:storedFunction" class="def">storedFunction</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a></dfn><div class="doc empty"> </div></li><li><dfn class="src"><a id="v:storedVersion" class="def">storedVersion</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a></dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:StoredContract" class="caption collapser" onclick="toggleSection('i:StoredContract')">Instances</p><div id="section.i:StoredContract" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:StoredContract:Generic:1" class="instance expander" onclick="toggleSection('i:id:StoredContract:Generic:1')"></span> <a href="Blockchain-Fae.html#t:Generic">Generic</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-165" class="link">Source</a> <a href="#t:StoredContract" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:StoredContract:Generic:1" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> -> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="#t:Rep" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> -> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> x <a href="#v:from" class="selflink">#</a></p><p class="src"><a href="#v:to">to</a> :: <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> x -> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> <a href="#v:to" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:StoredContract:NFData:2" class="instance expander" onclick="toggleSection('i:id:StoredContract:NFData:2')"></span> <a href="../cryptonite-0.25/Crypto-Internal-DeepSeq.html#t:NFData">NFData</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-304" class="link">Source</a> <a href="#t:StoredContract" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:StoredContract:NFData:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> -> () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:StoredContract:Rep:3" class="instance expander" onclick="toggleSection('i:id:StoredContract:Rep:3')"></span> <span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-1" class="link">Source</a> <a href="#t:StoredContract" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:StoredContract:Rep:3" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> = <a href="../base-4.10.1.0/GHC-Generics.html#t:D1">D1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaData">MetaData</a> "StoredContract" "Blockchain.Fae.Internal.Contract" "fae-2.0.0.0-L07ThzIQy745sKb2gq45cw" <a href="../base-4.10.1.0/Data-Bool.html#v:False">False</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:C1">C1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaCons">MetaCons</a> "StoredContract" <a href="../base-4.10.1.0/GHC-Generics.html#v:PrefixI">PrefixI</a> <a href="../base-4.10.1.0/Data-Bool.html#v:True">True</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t::-42-:">(:*:)</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "storedFunction") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a>)) (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "storedVersion") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a>))))</div></div></td></tr></table></div></div></div><h2 id="g:5">Internal contract monads</h2><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:EscrowsT" class="def">EscrowsT</a> = <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:StateT">StateT</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> <a href="src/Blockchain.Fae.Internal.Contract.html#EscrowsT" class="link">Source</a> <a href="#t:EscrowsT" class="selflink">#</a></p><div class="doc"><p>Monad modifier; several of ours use escrows.</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:TXDataM" class="def">TXDataM</a> = <a href="../mtl-2.2.2/Control-Monad-Reader.html#t:Reader">Reader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="src/Blockchain.Fae.Internal.Contract.html#TXDataM" class="link">Source</a> <a href="#t:TXDataM" class="selflink">#</a></p><div class="doc"><p>Also used in <a href="Transaction.html">Transaction</a>, so needs a name</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:FaeExternalM" class="def">FaeExternalM</a> = <a href="../mtl-2.2.2/Control-Monad-Writer-Lazy.html#t:WriterT">WriterT</a> [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>] <a href="Blockchain-Fae-Internal-Contract.html#t:TXDataM">TXDataM</a> <a href="src/Blockchain.Fae.Internal.Contract.html#FaeExternalM" class="link">Source</a> <a href="#t:FaeExternalM" class="selflink">#</a></p><div class="doc"><p>The internal operational monad for Fae contracts.</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:FaeContractM" class="def">FaeContractM</a> argType valType = <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowsT">EscrowsT</a> (<a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendT">SuspendT</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType) (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="Blockchain-Fae-Internal-Contract.html#t:FaeExternalM">FaeExternalM</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#FaeContractM" class="link">Source</a> <a href="#t:FaeContractM" class="selflink">#</a></p><div class="doc"><p>The authoring monad for Fae contracts (when wrapped in <code><a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a></code>)</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:FaeTXM" class="def">FaeTXM</a> = <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowsT">EscrowsT</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeExternalM">FaeExternalM</a> <a href="src/Blockchain.Fae.Internal.Contract.html#FaeTXM" class="link">Source</a> <a href="#t:FaeTXM" class="selflink">#</a></p><div class="doc"><p>The authoring monad for Fae transactions (when wrapped in <code><a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></code>)</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:TXBodyM" class="def">TXBodyM</a> = <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:StateT">StateT</a> [<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>] <a href="Blockchain-Fae-Internal-Contract.html#t:TXDataM">TXDataM</a> <a href="src/Blockchain.Fae.Internal.Contract.html#TXBodyM" class="link">Source</a> <a href="#t:TXBodyM" class="selflink">#</a></p><div class="doc"><p>The monad in which the transaction body is run. Escrows are kept, but
not for casual use; the list is a stack tracing the descent into
sub-input calls.</p></div></div><h2 id="g:6">Internal contract functions</h2><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:PreContractF" class="def">PreContractF</a> argType valType = <a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendPreF">SuspendPreF</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType) (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="Blockchain-Fae-Internal-Contract.html#t:FaeExternalM">FaeExternalM</a> <a href="src/Blockchain.Fae.Internal.Contract.html#PreContractF" class="link">Source</a> <a href="#t:PreContractF" class="selflink">#</a></p><div class="doc"><p>User contract with escrows hidden</p></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:ContractF" class="def">ContractF</a> m argType valType <a href="src/Blockchain.Fae.Internal.Contract.html#ContractF" class="link">Source</a> <a href="#t:ContractF" class="selflink">#</a></p><div class="doc"><p>A type-correct contract function; <code><a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a></code> is omitted here
because neither of the abstract contracts takes it (though they do use
it internally).</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:ContractF" class="def">ContractF</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:getContractF" class="def">getContractF</a> :: <a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendStepF">SuspendStepF</a> argType valType m</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:ContractF" class="caption collapser" onclick="toggleSection('i:ContractF')">Instances</p><div id="section.i:ContractF" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ContractF:Generic:1" class="instance expander" onclick="toggleSection('i:id:ContractF:Generic:1')"></span> <a href="Blockchain-Fae.html#t:Generic">Generic</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-195" class="link">Source</a> <a href="#t:ContractF" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:ContractF:Generic:1" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> -> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="#t:Rep" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:from">from</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType -> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType) x <a href="#v:from" class="selflink">#</a></p><p class="src"><a href="#v:to">to</a> :: <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType) x -> <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType <a href="#v:to" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ContractF:NFData:2" class="instance expander" onclick="toggleSection('i:id:ContractF:NFData:2')"></span> <a href="../cryptonite-0.25/Crypto-Internal-DeepSeq.html#t:NFData">NFData</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-195" class="link">Source</a> <a href="#t:ContractF" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:ContractF:NFData:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:rnf">rnf</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType -> () <a href="#v:rnf" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:ContractF:Rep:3" class="instance expander" onclick="toggleSection('i:id:ContractF:Rep:3')"></span> <span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-1" class="link">Source</a> <a href="#t:ContractF" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:ContractF:Rep:3" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="../base-4.10.1.0/GHC-Generics.html#t:Rep">Rep</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType) = <a href="../base-4.10.1.0/GHC-Generics.html#t:D1">D1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaData">MetaData</a> "ContractF" "Blockchain.Fae.Internal.Contract" "fae-2.0.0.0-L07ThzIQy745sKb2gq45cw" <a href="../base-4.10.1.0/Data-Bool.html#v:True">True</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:C1">C1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaCons">MetaCons</a> "ContractF" <a href="../base-4.10.1.0/GHC-Generics.html#v:PrefixI">PrefixI</a> <a href="../base-4.10.1.0/Data-Bool.html#v:True">True</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:S1">S1</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="../base-4.10.1.0/GHC-Generics.html#v:MetaSel">MetaSel</a> (<a href="../base-4.10.1.0/Data-Maybe.html#v:Just">Just</a> <a href="../base-4.10.1.0/GHC-TypeLits.html#t:Symbol">Symbol</a> "getContractF") <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceUnpackedness">NoSourceUnpackedness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:NoSourceStrictness">NoSourceStrictness</a> <a href="../base-4.10.1.0/GHC-Generics.html#v:DecidedLazy">DecidedLazy</a>) (<a href="../base-4.10.1.0/GHC-Generics.html#t:Rec0">Rec0</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (<a href="Blockchain-Fae-Internal-Suspend.html#t:SuspendStepF">SuspendStepF</a> argType valType m))))</div></div></td></tr></table></div></div></div><h2 id="g:7">External contract functions</h2><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:AbstractLocalContract" class="def">AbstractLocalContract</a> = <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> <a href="src/Blockchain.Fae.Internal.Contract.html#AbstractLocalContract" class="link">Source</a> <a href="#t:AbstractLocalContract" class="selflink">#</a></p><div class="doc"><p>The form of a contract function intended to be called from within
a contract, as well as a precursor to an <code><a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a></code>.</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:AbstractGlobalContract" class="def">AbstractGlobalContract</a> = <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>]) <a href="src/Blockchain.Fae.Internal.Contract.html#AbstractGlobalContract" class="link">Source</a> <a href="#t:AbstractGlobalContract" class="selflink">#</a></p><div class="doc"><p>The form of a contract function intended to be called from
a transaction. Note that it returns into a <code><a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a></code>, i.e. does not
expose the outputs state, which is returned read-only in the return value.</p></div></div><h2 id="g:8">User-visible</h2><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:Fae" class="def">Fae</a> argType valType a <a href="src/Blockchain.Fae.Internal.Contract.html#Fae" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></p><div class="doc"><p>The monad that users actually write in, a newtype because we need to
limit the capabilities users are allowed to access.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Fae" class="def">Fae</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:getFae" class="def">getFae</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeContractM">FaeContractM</a> argType valType a</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:Fae" class="caption collapser" onclick="toggleSection('i:Fae')">Instances</p><div id="section.i:Fae" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:MonadContract:1" class="instance expander" onclick="toggleSection('i:id:Fae:MonadContract:1')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-358" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:Fae:MonadContract:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftContract">liftContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="src/Blockchain.Fae.Internal.Contract.html#liftContract" class="link">Source</a> <a href="#v:liftContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:Monad:2" class="instance expander" onclick="toggleSection('i:id:Fae:Monad:2')"></span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-217" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Fae:Monad:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(>>=)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> (a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b) -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b <a href="#v:-62--62--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62--62-">(>>)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b <a href="#v:-62--62-" class="selflink">#</a></p><p class="src"><a href="#v:return">return</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="#v:return" class="selflink">#</a></p><p class="src"><a href="#v:fail">fail</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="#v:fail" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:Functor:3" class="instance expander" onclick="toggleSection('i:id:Fae:Functor:3')"></span> <a href="../base-4.10.1.0/Data-Functor.html#t:Functor">Functor</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-217" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Fae:Functor:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -> b) -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(<$)</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:Applicative:4" class="instance expander" onclick="toggleSection('i:id:Fae:Applicative:4')"></span> <a href="../base-4.10.1.0/Control-Applicative.html#t:Applicative">Applicative</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-217" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Fae:Applicative:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(<*>)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType (a -> b) -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:liftA2">liftA2</a> :: (a -> b -> c) -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType c <a href="#v:liftA2" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*>)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(<*)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="#v:-60--42-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:MonadTX:5" class="instance expander" onclick="toggleSection('i:id:Fae:MonadTX:5')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-354" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:Fae:MonadTX:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:ContractName:6" class="instance expander" onclick="toggleSection('i:id:Fae:ContractName:6')"></span> (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> b) => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-340" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:Fae:ContractName:6" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:ArgType:7" class="instance expander" onclick="toggleSection('i:id:Fae:ArgType:7')"></span> <span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-341" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Fae:ArgType:7" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) = a</div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Fae:ValType:8" class="instance expander" onclick="toggleSection('i:id:Fae:ValType:8')"></span> <span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-342" class="link">Source</a> <a href="#t:Fae" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Fae:ValType:8" class="inst-details hide"><div class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) = b</div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">newtype</span> <a id="t:FaeTX" class="def">FaeTX</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#FaeTX" class="link">Source</a> <a href="#t:FaeTX" class="selflink">#</a></p><div class="doc"><p>Monad for writing transactions (no continuation), a newtype because we
need to limit the capabilities users are allowed to access.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:FaeTX" class="def">FaeTX</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:getFaeTX" class="def">getFaeTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> a</dfn><div class="doc empty"> </div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:FaeTX" class="caption collapser" onclick="toggleSection('i:FaeTX')">Instances</p><div id="section.i:FaeTX" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FaeTX:Monad:1" class="instance expander" onclick="toggleSection('i:id:FaeTX:Monad:1')"></span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-225" class="link">Source</a> <a href="#t:FaeTX" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:FaeTX:Monad:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-62--62--61-">(>>=)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> (a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b) -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b <a href="#v:-62--62--61-" class="selflink">#</a></p><p class="src"><a href="#v:-62--62-">(>>)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b <a href="#v:-62--62-" class="selflink">#</a></p><p class="src"><a href="#v:return">return</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="#v:return" class="selflink">#</a></p><p class="src"><a href="#v:fail">fail</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="#v:fail" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FaeTX:Functor:2" class="instance expander" onclick="toggleSection('i:id:FaeTX:Functor:2')"></span> <a href="../base-4.10.1.0/Data-Functor.html#t:Functor">Functor</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-225" class="link">Source</a> <a href="#t:FaeTX" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:FaeTX:Functor:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:fmap">fmap</a> :: (a -> b) -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b <a href="#v:fmap" class="selflink">#</a></p><p class="src"><a href="#v:-60--36-">(<$)</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="#v:-60--36-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FaeTX:Applicative:3" class="instance expander" onclick="toggleSection('i:id:FaeTX:Applicative:3')"></span> <a href="../base-4.10.1.0/Control-Applicative.html#t:Applicative">Applicative</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-225" class="link">Source</a> <a href="#t:FaeTX" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:FaeTX:Applicative:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:pure">pure</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="#v:pure" class="selflink">#</a></p><p class="src"><a href="#v:-60--42--62-">(<*>)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> (a -> b) -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b <a href="#v:-60--42--62-" class="selflink">#</a></p><p class="src"><a href="#v:liftA2">liftA2</a> :: (a -> b -> c) -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> c <a href="#v:liftA2" class="selflink">#</a></p><p class="src"><a href="#v:-42--62-">(*>)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b <a href="#v:-42--62-" class="selflink">#</a></p><p class="src"><a href="#v:-60--42-">(<*)</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> b -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="#v:-60--42-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FaeTX:MonadTX:4" class="instance expander" onclick="toggleSection('i:id:FaeTX:MonadTX:4')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-346" class="link">Source</a> <a href="#t:FaeTX" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:FaeTX:MonadTX:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FaeTX:TransactionBody:5" class="instance expander" onclick="toggleSection('i:id:FaeTX:TransactionBody:5')"></span> <a href="../base-4.10.1.0/Text-Show.html#t:Show">Show</a> a => <a href="Blockchain-Fae-Internal-Transaction.html#t:TransactionBody">TransactionBody</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a)</span> <a href="src/Blockchain.Fae.Internal.Transaction.html#line-128" class="link">Source</a> <a href="#t:TransactionBody" class="selflink">#</a></td><td class="doc"><p>The base-case instance: a transaction with no arguments.</p></td></tr><tr><td colspan="2"><div id="section.i:id:FaeTX:TransactionBody:5" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:callTransactionBody">callTransactionBody</a> :: <a href="Blockchain-Fae-Internal-Transaction.html#t:GlobalType">GlobalType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a) -> [<a href="Blockchain-Fae-Internal-Transaction.html#t:Input">Input</a>] -> <a href="Blockchain-Fae-Internal-Transaction.html#t:TXStorageM">TXStorageM</a> ([<a href="Blockchain-Fae-Internal-Storage.html#t:InputResults">InputResults</a>], <a href="Blockchain-Fae-Internal-Storage.html#t:Result">Result</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>]) <a href="src/Blockchain.Fae.Internal.Transaction.html#callTransactionBody" class="link">Source</a> <a href="#v:callTransactionBody" class="selflink">#</a></p><p class="src"><a href="#v:applyFallback">applyFallback</a> :: <a href="Blockchain-Fae-Internal-Transaction.html#t:GlobalType">GlobalType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a) -> <a href="Blockchain-Fae-Internal-Transaction.html#t:GlobalType">GlobalType</a> (<a href="Blockchain-Fae-Internal-Transaction.html#t:FallbackType">FallbackType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a)) -> <a href="Blockchain-Fae-Internal-Transaction.html#t:GlobalType">GlobalType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a) <a href="src/Blockchain.Fae.Internal.Transaction.html#applyFallback" class="link">Source</a> <a href="#v:applyFallback" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:FaeTX:Globalizable:6" class="instance expander" onclick="toggleSection('i:id:FaeTX:Globalizable:6')"></span> <a href="Blockchain-Fae-Internal-Transaction.html#t:Globalizable">Globalizable</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a)</span> <a href="src/Blockchain.Fae.Internal.Transaction.html#line-160" class="link">Source</a> <a href="#t:Globalizable" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:id:FaeTX:Globalizable:6" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:globalize">globalize</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Transaction.html#t:GlobalType">GlobalType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a) <a href="src/Blockchain.Fae.Internal.Transaction.html#globalize" class="link">Source</a> <a href="#v:globalize" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:Contract" class="def">Contract</a> argType valType = <a href="Blockchain-Fae-Internal-Contract.html#t:ContractT">ContractT</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType) argType valType <a href="src/Blockchain.Fae.Internal.Contract.html#Contract" class="link">Source</a> <a href="#t:Contract" class="selflink">#</a></p><div class="doc"><p>The user-provided form of a contract function. Concretely, this is:</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>type Contract argType valType = argType -> Fae argType valType (WithEscrows valType)
</code></strong></pre><p>That is, a function from the argument type to the escrow-bearing value
type, inside a Fae monad that expects these argument and value types.</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:ContractT" class="def">ContractT</a> m argType valType = argType -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="src/Blockchain.Fae.Internal.Contract.html#ContractT" class="link">Source</a> <a href="#t:ContractT" class="selflink">#</a></p><div class="doc"><p>Useful generalization to add effects</p></div></div><h1 id="g:9">Fae typeclasses</h1><div class="top"><p class="src"><span class="keyword">class</span> <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a => <a id="t:Exportable" class="def">Exportable</a> a <span class="keyword">where</span> <a href="src/Blockchain.Fae.Internal.Contract.html#Exportable" class="link">Source</a> <a href="#t:Exportable" class="selflink">#</a></p><div class="doc"><p>Instances of this class can be serialized, at least with the
assistance of some Fae contextual data (namely, the escrow storage).</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Blockchain-Fae-Internal-Contract.html#v:exportValue">exportValue</a>, <a href="Blockchain-Fae-Internal-Contract.html#v:importValue">importValue</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:exportValue" class="def">exportValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => a -> m <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Blockchain.Fae.Internal.Contract.html#exportValue" class="link">Source</a> <a href="#v:exportValue" class="selflink">#</a></p><div class="doc"><p>A lousy imitation of the <code><a href="../adjunctions-4.4/Control-Monad-Representable-State.html#v:put">put</a></code> function from <code><a href="Blockchain-Fae-Internal-Crypto.html#t:Serialize">Serialize</a></code> that
doesn't use a builder but goes straight to bytes.</p></div><p class="src"><a id="v:importValue" class="def">importValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a) <a href="src/Blockchain.Fae.Internal.Contract.html#importValue" class="link">Source</a> <a href="#v:importValue" class="selflink">#</a></p><div class="doc"><p>A lousy imitation of the <code><a href="../adjunctions-4.4/Control-Monad-Representable-State.html#v:get">get</a></code> function from <code><a href="Blockchain-Fae-Internal-Crypto.html#t:Serialize">Serialize</a></code> that
doesn't use a parser but takes straight from bytes.</p></div></div><div class="subs instances"><p id="control.i:Exportable" class="caption collapser" onclick="toggleSection('i:Exportable')">Instances</p><div id="section.i:Exportable" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exportable:Exportable:1" class="instance expander" onclick="toggleSection('i:ic:Exportable:Exportable:1')"></span> (<a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> a, <a href="Blockchain-Fae-Internal-Crypto.html#t:Serialize">Serialize</a> a) => <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> a)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-334" class="link">Source</a> <a href="#t:Exportable" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:Exportable:Exportable:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:exportValue">exportValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> a -> m <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Blockchain.Fae.Internal.Contract.html#exportValue" class="link">Source</a> <a href="#v:exportValue" class="selflink">#</a></p><p class="src"><a href="#v:importValue">importValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> a)) <a href="src/Blockchain.Fae.Internal.Contract.html#importValue" class="link">Source</a> <a href="#v:importValue" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:Exportable:Exportable:2" class="instance expander" onclick="toggleSection('i:ic:Exportable:Exportable:2')"></span> (<a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> (t a), <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a, <a href="../base-4.10.1.0/Data-Traversable.html#t:Traversable">Traversable</a> t, <a href="Blockchain-Fae-Internal-Crypto.html#t:Serialize">Serialize</a> (t <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a>)) => <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> (t a))</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-323" class="link">Source</a> <a href="#t:Exportable" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:Exportable:Exportable:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:exportValue">exportValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> (t a) -> m <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Blockchain.Fae.Internal.Contract.html#exportValue" class="link">Source</a> <a href="#v:exportValue" class="selflink">#</a></p><p class="src"><a href="#v:importValue">importValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:Container">Container</a> (t a))) <a href="src/Blockchain.Fae.Internal.Contract.html#importValue" class="link">Source</a> <a href="#v:importValue" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> a), <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> a)) => <a id="t:ContractName" class="def">ContractName</a> a <span class="keyword">where</span> <a href="src/Blockchain.Fae.Internal.Contract.html#ContractName" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></p><div class="doc"><p>Instances of <code><a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a></code> are always defined by contract authors,
making <code><a href="Blockchain-Fae-Internal-Contract.html#v:theContract">theContract</a></code> a global function. Since it's global, if a name is
serialized and then deserialized in another Fae instance, the function is
still present when we deserialize, so this is effectively a contract
that is portable between Fae instances (provided that both instances
have the module with the instance; it need not be run, just
interpreted).</p><p>A <code><a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a></code> is the only way to pass data into a new contract, so
the type should have fields for all the parameters of the contract,
<em>including</em> valuables that it is supposed to "own". Their escrows are
deposited at the beginning of the contract.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Blockchain-Fae-Internal-Contract.html#v:theContract">theContract</a></p></div><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a id="t:ArgType" class="def">ArgType</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a id="t:ValType" class="def">ValType</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:theContract" class="def">theContract</a> :: a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> a) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> a) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div><div class="subs instances"><p id="control.i:ContractName" class="caption collapser" onclick="toggleSection('i:ContractName')">Instances</p><div id="section.i:ContractName" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ContractName:ContractName:1" class="instance expander" onclick="toggleSection('i:ic:ContractName:ContractName:1')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> <a href="Blockchain-Fae-Internal-Reward.html#t:RewardName">RewardName</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-39" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></td><td class="doc"><p>The argument and value types are both private types (not exported by
<a href="Blockchain-Fae.html">Blockchain.Fae</a>), so that a reward contract cannot be called directly
by users; instead, they must use the interface, which consists only of
<code><a href="Blockchain-Fae-Internal-Reward.html#v:claimReward">claimReward</a></code>, which only destroys a reward and does not create them.
So the supply of <code><a href="Blockchain-Fae-Internal-Reward.html#t:Reward">Reward</a></code>s is limited to those transactions that are
marked to receive them as special input values.</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ContractName:ContractName:1" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> <a href="Blockchain-Fae-Internal-Reward.html#t:RewardName">RewardName</a> :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> <a href="Blockchain-Fae-Internal-Reward.html#t:RewardName">RewardName</a> :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Internal-Reward.html#t:RewardName">RewardName</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> <a href="Blockchain-Fae-Internal-Reward.html#t:RewardName">RewardName</a>) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> <a href="Blockchain-Fae-Internal-Reward.html#t:RewardName">RewardName</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ContractName:ContractName:2" class="instance expander" onclick="toggleSection('i:ic:ContractName:ContractName:2')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> <a href="Blockchain-Fae-Currency.html#t:CoinName">CoinName</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-165" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:ic:ContractName:ContractName:2" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> <a href="Blockchain-Fae-Currency.html#t:CoinName">CoinName</a> :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> <a href="Blockchain-Fae-Currency.html#t:CoinName">CoinName</a> :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Currency.html#t:CoinName">CoinName</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> <a href="Blockchain-Fae-Currency.html#t:CoinName">CoinName</a>) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> <a href="Blockchain-Fae-Currency.html#t:CoinName">CoinName</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ContractName:ContractName:3" class="instance expander" onclick="toggleSection('i:ic:ContractName:ContractName:3')"></span> <a href="Blockchain-Fae.html#t:ContractVal">ContractVal</a> a => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> (<a href="Blockchain-Fae-Contracts.html#t:SignOver">SignOver</a> a)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-249" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:ContractName:ContractName:3" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Contracts.html#t:SignOver">SignOver</a> a) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Contracts.html#t:SignOver">SignOver</a> a) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Contracts.html#t:SignOver">SignOver</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Contracts.html#t:SignOver">SignOver</a> a)) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Contracts.html#t:SignOver">SignOver</a> a)) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ContractName:ContractName:4" class="instance expander" onclick="toggleSection('i:ic:ContractName:ContractName:4')"></span> (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> b) => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-340" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:ContractName:ContractName:4" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> a b)) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ContractName:ContractName:5" class="instance expander" onclick="toggleSection('i:ic:ContractName:ContractName:5')"></span> (<a href="Blockchain-Fae.html#t:ContractVal">ContractVal</a> a, <a href="Blockchain-Fae-Currency.html#t:Currency">Currency</a> coin) => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> (<a href="Blockchain-Fae-Contracts.html#t:Sell">Sell</a> a coin)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-177" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:ContractName:ContractName:5" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Contracts.html#t:Sell">Sell</a> a coin) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Contracts.html#t:Sell">Sell</a> a coin) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Contracts.html#t:Sell">Sell</a> a coin -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Contracts.html#t:Sell">Sell</a> a coin)) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Contracts.html#t:Sell">Sell</a> a coin)) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:ContractName:ContractName:6" class="instance expander" onclick="toggleSection('i:ic:ContractName:ContractName:6')"></span> (<a href="Blockchain-Fae.html#t:ContractVal">ContractVal</a> a, <a href="Blockchain-Fae.html#t:ContractVal">ContractVal</a> b) => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> (<a href="Blockchain-Fae-Contracts.html#t:TwoPartySwap">TwoPartySwap</a> a b)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-89" class="link">Source</a> <a href="#t:ContractName" class="selflink">#</a></td><td class="doc"><p>_</p></td></tr><tr><td colspan="2"><div id="section.i:ic:ContractName:ContractName:6" class="inst-details hide"><div class="subs associated-types"><p class="caption">Associated Types</p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Contracts.html#t:TwoPartySwap">TwoPartySwap</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ArgType" class="link">Source</a> <a href="#t:ArgType" class="selflink">#</a></p><p class="src"><span class="keyword">type</span> <a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Contracts.html#t:TwoPartySwap">TwoPartySwap</a> a b) :: <a href="../base-4.10.1.0/Data-Kind.html#t:-42-">*</a> <a href="src/Blockchain.Fae.Internal.Contract.html#ValType" class="link">Source</a> <a href="#t:ValType" class="selflink">#</a></p></div> <div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:theContract">theContract</a> :: <a href="Blockchain-Fae-Contracts.html#t:TwoPartySwap">TwoPartySwap</a> a b -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> (<a href="Blockchain-Fae-Contracts.html#t:TwoPartySwap">TwoPartySwap</a> a b)) (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> (<a href="Blockchain-Fae-Contracts.html#t:TwoPartySwap">TwoPartySwap</a> a b)) <a href="src/Blockchain.Fae.Internal.Contract.html#theContract" class="link">Source</a> <a href="#v:theContract" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => <a id="t:MonadContract" class="def">MonadContract</a> argType valType m | m -> argType valType <span class="keyword">where</span> <a href="src/Blockchain.Fae.Internal.Contract.html#MonadContract" class="link">Source</a> <a href="#t:MonadContract" class="selflink">#</a></p><div class="doc"><p>Instances of this class have access to the full Fae API, allowing them
to define multi-stage contracts. As for <code><a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a></code>, these instances must
have their own evaluation function to get down to the base <code><a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a></code> monad.
Notably, <code>Transaction</code>s are <em>not</em> written in a <code><a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a></code>, because
they are one-shot.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Blockchain-Fae-Internal-Contract.html#v:liftContract">liftContract</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:liftContract" class="def">liftContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#liftContract" class="link">Source</a> <a href="#v:liftContract" class="selflink">#</a></p><div class="doc"><p>Injects the Fae contract API into <code>m</code>.</p></div></div><div class="subs instances"><p id="control.i:MonadContract" class="caption collapser" onclick="toggleSection('i:MonadContract')">Instances</p><div id="section.i:MonadContract" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadContract:MonadContract:1" class="instance expander" onclick="toggleSection('i:ic:MonadContract:MonadContract:1')"></span> (<a href="../transformers-0.5.2.0/Control-Monad-Trans-Class.html#t:MonadTrans">MonadTrans</a> t, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType m, <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> (t m)) => <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType (t m)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-363" class="link">Source</a> <a href="#t:MonadContract" class="selflink">#</a></td><td class="doc"><p>An <code>UndecidableInstance</code> for sure</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadContract:MonadContract:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftContract">liftContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> t m a <a href="src/Blockchain.Fae.Internal.Contract.html#liftContract" class="link">Source</a> <a href="#v:liftContract" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadContract:MonadContract:2" class="instance expander" onclick="toggleSection('i:ic:MonadContract:MonadContract:2')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-358" class="link">Source</a> <a href="#t:MonadContract" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadContract:MonadContract:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftContract">liftContract</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="src/Blockchain.Fae.Internal.Contract.html#liftContract" class="link">Source</a> <a href="#v:liftContract" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">class</span> <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a id="t:MonadTX" class="def">MonadTX</a> m <span class="keyword">where</span> <a href="src/Blockchain.Fae.Internal.Contract.html#MonadTX" class="link">Source</a> <a href="#t:MonadTX" class="selflink">#</a></p><div class="doc"><p>Instances of this class may use the bulk of the Fae API; namely, they
may hold value via escrows and create new contracts. Such monads are
intended to be defined by a transformer stack on top of <code><a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></code>, hence
<code><a href="Blockchain-Fae-Internal-Contract.html#v:liftTX">liftTX</a></code>; to be useful, they must have a function that "evaluates" them
down to <code><a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a></code> or <code><a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></code>, so they may define new transactions or
contracts.</p></div><div class="subs minimal"><p class="caption">Minimal complete definition</p><p class="src"><a href="Blockchain-Fae-Internal-Contract.html#v:liftTX">liftTX</a></p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a id="v:liftTX" class="def">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p><div class="doc"><p>Injects the Fae transaction API into <code>m</code>.</p></div></div><div class="subs instances"><p id="control.i:MonadTX" class="caption collapser" onclick="toggleSection('i:MonadTX')">Instances</p><div id="section.i:MonadTX" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadTX:MonadTX:1" class="instance expander" onclick="toggleSection('i:ic:MonadTX:MonadTX:1')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-346" class="link">Source</a> <a href="#t:MonadTX" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadTX:MonadTX:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadTX:MonadTX:2" class="instance expander" onclick="toggleSection('i:ic:MonadTX:MonadTX:2')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a></span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-350" class="link">Source</a> <a href="#t:MonadTX" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadTX:MonadTX:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadTX:MonadTX:3" class="instance expander" onclick="toggleSection('i:ic:MonadTX:MonadTX:3')"></span> (<a href="../transformers-0.5.2.0/Control-Monad-Trans-Class.html#t:MonadTrans">MonadTrans</a> t, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> (t m)) => <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> (t m)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-370" class="link">Source</a> <a href="#t:MonadTX" class="selflink">#</a></td><td class="doc"><p>An <code>UndecidableInstance</code> for sure</p></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadTX:MonadTX:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> t m a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:ic:MonadTX:MonadTX:4" class="instance expander" onclick="toggleSection('i:ic:MonadTX:MonadTX:4')"></span> <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType)</span> <a href="src/Blockchain.Fae.Internal.Contract.html#line-354" class="link">Source</a> <a href="#t:MonadTX" class="selflink">#</a></td><td class="doc"><ul><li></li></ul></td></tr><tr><td colspan="2"><div id="section.i:ic:MonadTX:MonadTX:4" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:liftTX">liftTX</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTX">FaeTX</a> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Fae">Fae</a> argType valType a <a href="src/Blockchain.Fae.Internal.Contract.html#liftTX" class="link">Source</a> <a href="#v:liftTX" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><h1 id="g:10">Template Haskell</h1><div class="top"><p class="src"><a id="v:_withEscrows" class="def">_withEscrows</a> :: <span class="keyword">forall</span> a. <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-292" class="link">Source</a> <a href="#v:_withEscrows" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_getWithEscrows" class="def">_getWithEscrows</a> :: <span class="keyword">forall</span> a a. <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens">Lens</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a) a a <a href="src/Blockchain.Fae.Internal.Contract.html#line-292" class="link">Source</a> <a href="#v:_getWithEscrows" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_nextID" class="def">_nextID</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-293" class="link">Source</a> <a href="#v:_nextID" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_escrowMap" class="def">_escrowMap</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-293" class="link">Source</a> <a href="#v:_escrowMap" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_thisTXSigners" class="def">_thisTXSigners</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Signers">Signers</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-294" class="link">Source</a> <a href="#v:_thisTXSigners" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_thisTXID" class="def">_thisTXID</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:TransactionID">TransactionID</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-294" class="link">Source</a> <a href="#v:_thisTXID" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_localMaterials" class="def">_localMaterials</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-294" class="link">Source</a> <a href="#v:_localMaterials" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_localHash" class="def">_localHash</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-294" class="link">Source</a> <a href="#v:_localHash" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_storedContract" class="def">_storedContract</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#line-295" class="link">Source</a> <a href="#v:_storedContract" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_contractValType" class="def">_contractValType</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-295" class="link">Source</a> <a href="#v:_contractValType" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_contractNameType" class="def">_contractNameType</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-295" class="link">Source</a> <a href="#v:_contractNameType" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_storedVersion" class="def">_storedVersion</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-296" class="link">Source</a> <a href="#v:_storedVersion" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:_storedFunction" class="def">_storedFunction</a> :: <a href="../lens-4.16.1/Control-Lens-Type.html#t:Lens-39-">Lens'</a> <a href="Blockchain-Fae-Internal-Contract.html#t:StoredContract">StoredContract</a> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a> <a href="src/Blockchain.Fae.Internal.Contract.html#line-296" class="link">Source</a> <a href="#v:_storedFunction" class="selflink">#</a></p></div><h1 id="g:11">API Functions</h1><div class="top"><p class="src"><a id="v:lookupMaterial" class="def">lookupMaterial</a> :: <span class="keyword">forall</span> a m. (<a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a) <a href="src/Blockchain.Fae.Internal.Contract.html#lookupMaterial" class="link">Source</a> <a href="#v:lookupMaterial" class="selflink">#</a></p><div class="doc"><p>Looks up a material by name, maybe. A <code><a href="../base-4.10.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> can mean that the
name was not found <em>or</em> that the named value had the wrong type.</p></div></div><div class="top"><p class="src"><a id="v:material" class="def">material</a> :: <span class="keyword">forall</span> a m. (<a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#material" class="link">Source</a> <a href="#v:material" class="selflink">#</a></p><div class="doc"><p>Looks up a material by name, throwing individual errors in case of
missing name or incorrect material type under an existing name.</p></div></div><div class="top"><p class="src"><a id="v:materials" class="def">materials</a> :: <span class="keyword">forall</span> a m. (<a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a) => m (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> a) <a href="src/Blockchain.Fae.Internal.Contract.html#materials" class="link">Source</a> <a href="#v:materials" class="selflink">#</a></p><div class="doc"><p>Uses all the materials in the map with a given type, ignoring the ones
with other types.</p></div></div><div class="top"><p class="src"><a id="v:lookupSigner" class="def">lookupSigner</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m (<a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:PublicKey">PublicKey</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#lookupSigner" class="link">Source</a> <a href="#v:lookupSigner" class="selflink">#</a></p><div class="doc"><p>Looks up a named signatory, maybe. </p></div></div><div class="top"><p class="src"><a id="v:signer" class="def">signer</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m <a href="Blockchain-Fae-Internal-Crypto.html#t:PublicKey">PublicKey</a> <a href="src/Blockchain.Fae.Internal.Contract.html#signer" class="link">Source</a> <a href="#v:signer" class="selflink">#</a></p><div class="doc"><p>Looks up a named signatory, or throws a <code><a href="Blockchain-Fae-Internal-Exceptions.html#v:MissingSigner">MissingSigner</a></code> if not found.</p></div></div><div class="top"><p class="src"><a id="v:signers" class="def">signers</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m => m (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="Blockchain-Fae-Internal-Crypto.html#t:PublicKey">PublicKey</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#signers" class="link">Source</a> <a href="#v:signers" class="selflink">#</a></p><div class="doc"><p>Returns the map of all signatories. This map is immutable within
a single transaction, but when descending into a contract or escrow
call, may be modified by "renamings" that reassign old roles' public
keys to new role names.</p></div></div><div class="top"><p class="src"><a id="v:spend" class="def">spend</a> :: <span class="keyword">forall</span> m argType valType. (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType m) => valType -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="src/Blockchain.Fae.Internal.Contract.html#spend" class="link">Source</a> <a href="#v:spend" class="selflink">#</a></p><div class="doc"><p>Terminates the contract entirely, returning its argument and
automatically transferring escrows backing the return value.</p></div></div><div class="top"><p class="src"><a id="v:release" class="def">release</a> :: <span class="keyword">forall</span> argType valType m. (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadContract">MonadContract</a> argType valType m) => valType -> m argType <a href="src/Blockchain.Fae.Internal.Contract.html#release" class="link">Source</a> <a href="#v:release" class="selflink">#</a></p><div class="doc"><p>Terminates the current contract call, returning its argument and
automatically transferring escrows backing the return value to the
caller. A <code><a href="Blockchain-Fae-Internal-Contract.html#v:release">release</a></code> expression evaluates to the argument of the
subsequent contract call, whose escrows are automatically deposited into
the contract at that point.</p></div></div><div class="top"><p class="src"><a id="v:newContract" class="def">newContract</a> :: <span class="keyword">forall</span> name m. (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> name, <a href="../base-4.10.1.0/Text-Read.html#t:Read">Read</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> name), <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> name), <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m) => name -> m () <a href="src/Blockchain.Fae.Internal.Contract.html#newContract" class="link">Source</a> <a href="#v:newContract" class="selflink">#</a></p><div class="doc"><p>Emits a new output contract with a given <code><a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a></code>, whose backing
escrows are deposited into the contract's context at the first call.
Unlike <code><a href="Blockchain-Fae-Internal-Contract.html#v:newEscrow">newEscrow</a></code>, this returns nothing rather than the <code><a href="Blockchain-Fae-Internal-IDs-Types.html#t:ContractID">ContractID</a></code>,
because there is no use for contract IDs within contract code.</p></div></div><div class="top"><p class="src"><a id="v:newEscrow" class="def">newEscrow</a> :: (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> name, <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m) => name -> m (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:EscrowID">EscrowID</a> name) <a href="src/Blockchain.Fae.Internal.Contract.html#newEscrow" class="link">Source</a> <a href="#v:newEscrow" class="selflink">#</a></p><div class="doc"><p>Creates a new escrow with a given <code><a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a></code>, whose backing
escrows are deposited into the new escrow's context at the first call.</p></div></div><h2 id="g:12">Using escrows</h2><div class="top"><p class="src"><a id="v:useEscrow" class="def">useEscrow</a> :: (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractName">ContractName</a> name, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> name), <a href="Blockchain-Fae-Internal-Contract.html#t:MonadTX">MonadTX</a> m) => [<a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a>] -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EscrowID">EscrowID</a> name -> <a href="Blockchain-Fae-Internal-Contract.html#t:ArgType">ArgType</a> name -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:ValType">ValType</a> name) <a href="src/Blockchain.Fae.Internal.Contract.html#useEscrow" class="link">Source</a> <a href="#v:useEscrow" class="selflink">#</a></p><div class="doc"><p>Calls an escrow by ID, which must exist in the present context. </p><p>The first argument declares the named signers and materials that the
escrow gets during execution. The names declared in this list are the
<em>only</em> ones available to the escrow, in order to prevent escrow authors
from building in back doors that respond to signers or materials passed
outside the control of the calling contract.</p></div></div><div class="top"><p class="src"><a id="v:-60--45--124-" class="def">(<-|)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#%3C-%7C" class="link">Source</a> <a href="#v:-60--45--124-" class="selflink">#</a></p><div class="doc"><p>Infix operator for adding a signer remap.</p></div></div><div class="top"><p class="src"><a id="v:-8612-" class="def">(↤)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#%21A4" class="link">Source</a> <a href="#v:-8612-" class="selflink">#</a></p><div class="doc"><p>Nicer Unicode alternative to <code><a href="Blockchain-Fae-Internal-Contract.html#v:-60--45--124-"><-|</a></code> (U+21a4)</p></div></div><div class="top"><p class="src"><a id="v:-60--61--124-" class="def">(<=|)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#%3C%3D%7C" class="link">Source</a> <a href="#v:-60--61--124-" class="selflink">#</a></p><div class="doc"><p>Infix operator for adding a materials remap.</p></div></div><div class="top"><p class="src"><a id="v:-10502-" class="def">(⤆)</a> :: <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#%2906" class="link">Source</a> <a href="#v:-10502-" class="selflink">#</a></p><div class="doc"><p>Nicer Unicode alternative to <code><a href="Blockchain-Fae-Internal-Contract.html#v:-60--61--124-"><=|</a></code> (U+2906)</p></div></div><div class="top"><p class="src"><a id="v:-42--60--45-" class="def">(*<-)</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#%2A%3C-" class="link">Source</a> <a href="#v:-42--60--45-" class="selflink">#</a></p><div class="doc"><p>Infix operator for adding a new material.</p></div></div><div class="top"><p class="src"><a id="v:-10525-" class="def">(⤝)</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> a, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> a) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> a -> <a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a> <a href="src/Blockchain.Fae.Internal.Contract.html#%291D" class="link">Source</a> <a href="#v:-10525-" class="selflink">#</a></p><div class="doc"><p>Nicer Unicode alternative to <code><a href="Blockchain-Fae-Internal-Contract.html#v:-42--60--45-">*<-</a></code> (U+291d)</p></div></div><h1 id="g:13">Internal functions</h1><h2 id="g:14">Static data</h2><div class="top"><p class="src"><a id="v:makeAssignments" class="def">makeAssignments</a> :: [<a href="Blockchain-Fae-Internal-Contract.html#t:Assignment">Assignment</a>] -> (<a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a>, <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a>, <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#makeAssignments" class="link">Source</a> <a href="#v:makeAssignments" class="selflink">#</a></p><div class="doc"><p>Cases the renamings into signer-specific and materials-specific.</p></div></div><div class="top"><p class="src"><a id="v:mapNames" class="def">mapNames</a> :: (<a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Exceptions.html#t:ContractException">ContractException</a>) -> <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> b -> <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> b <a href="src/Blockchain.Fae.Internal.Contract.html#mapNames" class="link">Source</a> <a href="#v:mapNames" class="selflink">#</a></p><div class="doc"><p>Composes two maps as though they were functions (composition is
left-to-right, unlike '(.)').</p></div></div><div class="top"><p class="src"><a id="v:remapMaterials" class="def">remapMaterials</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-Reader.html#t:MonadReader">MonadReader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:MaterialsMap">MaterialsMap</a> -> m a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#remapMaterials" class="link">Source</a> <a href="#v:remapMaterials" class="selflink">#</a></p><div class="doc"><p>Locally replaces the <code><a href="Blockchain-Fae-Internal-Contract.html#v:localMaterials">localMaterials</a></code> datum.</p></div></div><div class="top"><p class="src"><a id="v:remapSigners" class="def">remapSigners</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-Reader.html#t:MonadReader">MonadReader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> m => <a href="../containers-0.5.10.2/Data-Map-Internal.html#t:Map">Map</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#remapSigners" class="link">Source</a> <a href="#v:remapSigners" class="selflink">#</a></p><div class="doc"><p>Locally replaces the <code><a href="Blockchain-Fae-Internal-Contract.html#v:thisTXSigners">thisTXSigners</a></code> datum.</p></div></div><div class="top"><p class="src"><a id="v:pushArg" class="def">pushArg</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-Reader.html#t:MonadReader">MonadReader</a> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> m => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> m a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#pushArg" class="link">Source</a> <a href="#v:pushArg" class="selflink">#</a></p><div class="doc"><p>Morally speaking, records the arguments to the current contract call
in the progressive list of all historical calls. Technically, sets the
<code><a href="Blockchain-Fae-Internal-Contract.html#v:localHash">localHash</a></code> to the hash of the argument string; this is then hashed into
the sequence of <code><a href="Blockchain-Fae-Internal-Contract.html#v:nextID">nextID</a></code>s and escrow versions to produce a summary that
is almost certain to be unique.</p></div></div><div class="top"><p class="src"><a id="v:txData" class="def">txData</a> :: <a href="Blockchain-Fae-Internal-IDs-Types.html#t:TransactionID">TransactionID</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:Signers">Signers</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a> <a href="src/Blockchain.Fae.Internal.Contract.html#txData" class="link">Source</a> <a href="#v:txData" class="selflink">#</a></p><div class="doc"><p>Basically the <code><a href="Blockchain-Fae-Internal-Contract.html#t:TXData">TXData</a></code> constructor, except for the policy choice to
initialize the <code><a href="Blockchain-Fae-Internal-Contract.html#v:localHash">localHash</a></code> to the transaction ID.</p></div></div><h2 id="g:15">Calling</h2><div class="top"><p class="src"><a id="v:callContract" class="def">callContract</a> :: <a href="../base-4.10.1.0/Control-Monad.html#t:Monad">Monad</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType -> argType -> m (valType, <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:ContractF">ContractF</a> m argType valType)) <a href="src/Blockchain.Fae.Internal.Contract.html#callContract" class="link">Source</a> <a href="#v:callContract" class="selflink">#</a></p><div class="doc"><p>Converts a deeply wrapped function returning an awkward type into
a natural stepwise function call.</p></div></div><h2 id="g:16">Contract function converters</h2><div class="top"><p class="src"><a id="v:localContract" class="def">localContract</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> argType, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType) => <a href="Blockchain-Fae-Internal-Contract.html#t:PreContractF">PreContractF</a> argType valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractLocalContract">AbstractLocalContract</a> <a href="src/Blockchain.Fae.Internal.Contract.html#localContract" class="link">Source</a> <a href="#v:localContract" class="selflink">#</a></p><div class="doc"><p>Generalizes an operationally-correct explicitly-typed contract into an
abstract one suitable for calling within other contract code.</p></div></div><div class="top"><p class="src"><a id="v:globalContract" class="def">globalContract</a> :: (<a href="../base-4.10.1.0/Text-Read.html#t:Read">Read</a> argType, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> argType, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> valType, <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType) => <a href="Blockchain-Fae-Internal-Contract.html#t:PreContractF">PreContractF</a> argType valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a> <a href="src/Blockchain.Fae.Internal.Contract.html#globalContract" class="link">Source</a> <a href="#v:globalContract" class="selflink">#</a></p><div class="doc"><p>Generalizes an operationally-correct explicitly-typed contract into an
abstract one suitable for being called as a transaction input.</p></div></div><div class="top"><p class="src"><a id="v:acceptLocal" class="def">acceptLocal</a> :: <span class="keyword">forall</span> argType. <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> argType => <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType) <a href="src/Blockchain.Fae.Internal.Contract.html#acceptLocal" class="link">Source</a> <a href="#v:acceptLocal" class="selflink">#</a></p><div class="doc"><p>Prepares a value-bearing argument.</p></div></div><div class="top"><p class="src"><a id="v:returnLocal" class="def">returnLocal</a> :: <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType => <a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> <a href="src/Blockchain.Fae.Internal.Contract.html#returnLocal" class="link">Source</a> <a href="#v:returnLocal" class="selflink">#</a></p><div class="doc"><p>Prepares a value-bearing result.</p></div></div><div class="top"><p class="src"><a id="v:acceptGlobal" class="def">acceptGlobal</a> :: <span class="keyword">forall</span> argType. (<a href="../base-4.10.1.0/Text-Read.html#t:Read">Read</a> argType, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> argType) => <a href="../base-4.10.1.0/Data-String.html#t:String">String</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> argType) <a href="src/Blockchain.Fae.Internal.Contract.html#acceptGlobal" class="link">Source</a> <a href="#v:acceptGlobal" class="selflink">#</a></p><div class="doc"><p>Parses the literal argument into the argument type and collects all
the ambient escrows, which are those from this contract's materials.</p></div></div><div class="top"><p class="src"><a id="v:returnGlobal" class="def">returnGlobal</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="Blockchain-Fae-Internal-Contract.html#t:Exportable">Exportable</a> valType) => (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>]) -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:Output">Output</a>]) <a href="src/Blockchain.Fae.Internal.Contract.html#returnGlobal" class="link">Source</a> <a href="#v:returnGlobal" class="selflink">#</a></p><div class="doc"><p>Prepares a value-bearing result together with its table of versioned
values. N.B. The <code><a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a></code> component is <em>always</em> defined, though
its inner value may not be. The escrows are <em>not</em> emplaced in the state
because they are returned by the <code><a href="Blockchain-Fae-Internal-Contract.html#t:AbstractGlobalContract">AbstractGlobalContract</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:acceptTyped" class="def">acceptTyped</a> :: <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> argType => argType -> <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> <a href="src/Blockchain.Fae.Internal.Contract.html#acceptTyped" class="link">Source</a> <a href="#v:acceptTyped" class="selflink">#</a></p><div class="doc"><p>Prepares a typed value to be passed to an abstract function.</p></div></div><div class="top"><p class="src"><a id="v:returnTyped" class="def">returnTyped</a> :: <span class="keyword">forall</span> valType. <a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType => <a href="Blockchain-Fae-Internal-IDs.html#t:BearsValue">BearsValue</a> -> valType <a href="src/Blockchain.Fae.Internal.Contract.html#returnTyped" class="link">Source</a> <a href="#v:returnTyped" class="selflink">#</a></p><div class="doc"><p>Prepares an abstract function's return value as typed.</p></div></div><h2 id="g:17">Escrow manipulation</h2><div class="top"><p class="src"><a id="v:hideEscrows" class="def">hideEscrows</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:Contract">Contract</a> argType valType -> <a href="Blockchain-Fae-Internal-Contract.html#t:PreContractF">PreContractF</a> argType valType <a href="src/Blockchain.Fae.Internal.Contract.html#hideEscrows" class="link">Source</a> <a href="#v:hideEscrows" class="selflink">#</a></p><div class="doc"><p>Sets up the contract function to accept an escrow-backed initial
argument, then initializes its storage, removing it from scope.</p></div></div><div class="top"><p class="src"><a id="v:forkNextID" class="def">forkNextID</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:FaeTXM">FaeTXM</a> (<a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a>, <a href="Blockchain-Fae-Internal-Crypto.html#t:Digest">Digest</a>) <a href="src/Blockchain.Fae.Internal.Contract.html#forkNextID" class="link">Source</a> <a href="#v:forkNextID" class="selflink">#</a></p><div class="doc"><p>Computes the current next ID and the one that starts a new "branch",
and bumps the next ID in the current "branch".</p></div></div><div class="top"><p class="src"><a id="v:putEscrows" class="def">putEscrows</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#putEscrows" class="link">Source</a> <a href="#v:putEscrows" class="selflink">#</a></p><div class="doc"><p>Places the escrows backing a value into storage.</p></div></div><div class="top"><p class="src"><a id="v:takeEscrows" class="def">takeEscrows</a> :: (<a href="Blockchain-Fae-Internal-IDs.html#t:HasEscrowIDs">HasEscrowIDs</a> valType, <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m) => valType -> m (<a href="Blockchain-Fae-Internal-Contract.html#t:WithEscrows">WithEscrows</a> valType) <a href="src/Blockchain.Fae.Internal.Contract.html#takeEscrows" class="link">Source</a> <a href="#v:takeEscrows" class="selflink">#</a></p><div class="doc"><p>Extracts the escrows backing a single value.</p></div></div><div class="top"><p class="src"><a id="v:useNamedEscrow" class="def">useNamedEscrow</a> :: (<a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m, <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> name) => <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EscrowID">EscrowID</a> name -> (<a href="Blockchain-Fae-Internal-IDs-Types.html#t:EntryID">EntryID</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a> -> <a href="../base-4.10.1.0/Data-Either.html#t:Either">Either</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:NamedContract">NamedContract</a> name) <a href="Blockchain-Fae-Internal-Contract.html#t:AbstractLocalContract">AbstractLocalContract</a> -> m a) -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#useNamedEscrow" class="link">Source</a> <a href="#v:useNamedEscrow" class="selflink">#</a></p><div class="doc"><p>Gets an escrow entry, casting the contract name alternative to its
correct type, and applies a well-typed function.</p></div></div><div class="top"><p class="src"><a id="v:liftEscrowState" class="def">liftEscrowState</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m => <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:State">State</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> a -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#liftEscrowState" class="link">Source</a> <a href="#v:liftEscrowState" class="selflink">#</a></p><div class="doc"><p>Upgrades a computation using only the escrow map itself to one using
the whole <code><a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a></code> object.</p></div></div><div class="top"><p class="src"><a id="v:joinEscrowState" class="def">joinEscrowState</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:Escrows">Escrows</a> m => <a href="../mtl-2.2.2/Control-Monad-State-Lazy.html#t:State">State</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> (m a) -> m a <a href="src/Blockchain.Fae.Internal.Contract.html#joinEscrowState" class="link">Source</a> <a href="#v:joinEscrowState" class="selflink">#</a></p><div class="doc"><p>Helpful for encapsulating computations in <code><a href="Blockchain-Fae-Internal-Contract.html#v:useNamedEscrow">useNamedEscrow</a></code> that
require a full <code>MonadState Escrows</code>.</p></div></div><div class="top"><p class="src"><a id="v:lookupWithEscrows" class="def">lookupWithEscrows</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:EntryID">EntryID</a> -> <a href="Blockchain-Fae-Internal-IDs-Types.html#t:VersionID">VersionID</a> <a href="src/Blockchain.Fae.Internal.Contract.html#lookupWithEscrows" class="link">Source</a> <a href="#v:lookupWithEscrows" class="selflink">#</a></p><div class="doc"><p>Gets the escrow version from a specific escrow storage map.</p></div></div><h2 id="g:18"><code><a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a></code> manipulation</h2><div class="top"><p class="src"><a id="v:getReturnValue" class="def">getReturnValue</a> :: <a href="Blockchain-Fae-Internal-Exceptions.html#t:Typeable">Typeable</a> a => <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> -> <a href="../base-4.10.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a <a href="src/Blockchain.Fae.Internal.Contract.html#getReturnValue" class="link">Source</a> <a href="#v:getReturnValue" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Blockchain-Fae-Internal-IDs.html#v:unBear">unBear</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:returnValueType" class="def">returnValueType</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> -> <a href="../base-4.10.1.0/Data-Typeable.html#t:TypeRep">TypeRep</a> <a href="src/Blockchain.Fae.Internal.Contract.html#returnValueType" class="link">Source</a> <a href="#v:returnValueType" class="selflink">#</a></p><div class="doc"><p>Like <code><a href="Blockchain-Fae-Internal-IDs.html#v:bearerType">bearerType</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:exportReturnValue" class="def">exportReturnValue</a> :: <a href="../adjunctions-4.4/Control-Monad-Representable-State.html#t:MonadState">MonadState</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> m => <a href="Blockchain-Fae-Internal-Contract.html#t:ReturnValue">ReturnValue</a> -> m <a href="../bytestring-0.10.8.2/Data-ByteString.html#t:ByteString">ByteString</a> <a href="src/Blockchain.Fae.Internal.Contract.html#exportReturnValue" class="link">Source</a> <a href="#v:exportReturnValue" class="selflink">#</a></p><div class="doc"><p>Taking advantage of the existential type</p></div></div><h1 id="g:19"><code><a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a></code> stack manipulation</h1><div class="top"><p class="src"><a id="v:push" class="def">push</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> () <a href="src/Blockchain.Fae.Internal.Contract.html#push" class="link">Source</a> <a href="#v:push" class="selflink">#</a></p><div class="doc"><p>Add an escrow map to the stack</p></div></div><div class="top"><p class="src"><a id="v:pop" class="def">pop</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> <a href="src/Blockchain.Fae.Internal.Contract.html#pop" class="link">Source</a> <a href="#v:pop" class="selflink">#</a></p><div class="doc"><p>Remove an escrow map from the stack</p></div></div><div class="top"><p class="src"><a id="v:keep" class="def">keep</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a> -> <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> () <a href="src/Blockchain.Fae.Internal.Contract.html#keep" class="link">Source</a> <a href="#v:keep" class="selflink">#</a></p><div class="doc"><p>Modify the top of the stack with additional escrows.</p></div></div><div class="top"><p class="src"><a id="v:unconsTXBodyM" class="def">unconsTXBodyM</a> :: <a href="Blockchain-Fae-Internal-Contract.html#t:TXBodyM">TXBodyM</a> (<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>, [<a href="Blockchain-Fae-Internal-Contract.html#t:EscrowMap">EscrowMap</a>]) <a href="src/Blockchain.Fae.Internal.Contract.html#unconsTXBodyM" class="link">Source</a> <a href="#v:unconsTXBodyM" class="selflink">#</a></p><div class="doc"><p>The common denominator for <code><a href="Blockchain-Fae-Internal-Contract.html#v:pop">pop</a></code> and <code><a href="Blockchain-Fae-Internal-Contract.html#v:keep">keep</a></code>, carefully written so that
the monad is always defined and any bottom, not necessarily just the one
from the <code><a href="../base-4.10.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> case of <code><a href="../lens-4.16.1/Control-Lens-Cons.html#v:uncons">uncons</a></code>, lies in the inner values.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.18.1</p></div></body></html>