You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3196 lines
38 KiB

9 years ago
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Input</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Input</h1>
<section>
<header>
<h2>Input</h2>
</header>
<article>
<div class="container-overview">
9 years ago
<h4 class="name" id="Input"><span class="type-signature"></span>new Input<span class="signature">(options, mutable<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
9 years ago
<div class="description">
<p>Represents a transaction input.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedInput">NakedInput</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
9 years ago
<td class="name"><code>mutable</code></td>
9 years ago
<td class="type">
9 years ago
<span class="param-type">Boolean</span>
9 years ago
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>prevout</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Outpoint.</p>
<h6>Properties</h6>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</td>
<td class="description last"><p>Previous transaction hash.</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Previous output index.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>script</code></td>
<td class="type">
<span class="param-type"><a href="Script.html">Script</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Input script / scriptSig.</p></td>
</tr>
<tr>
<td class="name"><code>sequence</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>nSequence.</p></td>
</tr>
<tr>
<td class="name"><code>witness</code></td>
<td class="type">
<span class="param-type"><a href="Witness.html">Witness</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Witness (empty if not present).</p></td>
</tr>
<tr>
<td class="name"><code>coin</code></td>
<td class="type">
<span class="param-type"><a href="Coin.html">Coin</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Previous output.</p></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Script type.</p></td>
</tr>
<tr>
<td class="name"><code>address</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Input address.</p></td>
</tr>
9 years ago
<tr>
<td class="name"><code>mutable</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
9 years ago
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line33">line 33</a>
9 years ago
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
9 years ago
<h4 class="name" id=".fromExtended"><span class="type-signature">(static) </span>fromExtended<span class="signature">(data, enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="TX.html">TX</a>}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Instantiate an input from a Buffer
in &quot;extended&quot; serialization format.</p>
9 years ago
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Encoding, can be <code>'hex'</code> or null.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line414">line 414</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="TX.html">TX</a></span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id=".fromJSON"><span class="type-signature">(static) </span>fromJSON<span class="signature">(json)</span><span class="type-signature"> &rarr; {<a href="Input.html">Input</a>}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Instantiate an Input from a jsonified input object.</p>
9 years ago
</div>
9 years ago
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>json</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The jsonified input object.</p></td>
</tr>
</tbody>
</table>
9 years ago
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line318">line 318</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="Input.html">Input</a></span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id=".fromRaw"><span class="type-signature">(static) </span>fromRaw<span class="signature">(data, enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="Input.html">Input</a>}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Instantiate an input from a serialized Buffer.</p>
9 years ago
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Encoding, can be <code>'hex'</code> or null.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line360">line 360</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="Input.html">Input</a></span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id=".isInput"><span class="type-signature">(static) </span>isInput<span class="signature">(obj)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Test an object to see if it is an Input.</p>
9 years ago
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
9 years ago
<td class="name"><code>obj</code></td>
9 years ago
<td class="type">
9 years ago
<span class="param-type">Object</span>
9 years ago
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line424">line 424</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type">Boolean</span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id=".parseExtended"><span class="type-signature">(static) </span>parseExtended<span class="signature">(data, enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#NakedInput">NakedInput</a>}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Parse an input in &quot;extended&quot; serialization format.</p>
9 years ago
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
9 years ago
<th>Attributes</th>
9 years ago
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
9 years ago
<td class="name"><code>data</code></td>
9 years ago
<td class="type">
9 years ago
<span class="param-type">Buffer</span>
9 years ago
</td>
9 years ago
<td class="attributes">
9 years ago
9 years ago
</td>
9 years ago
9 years ago
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Encoding, can be <code>'hex'</code> or null.</p></td>
9 years ago
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line393">line 393</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
9 years ago
<div class="param-desc">
<ul>
<li>A &quot;naked&quot; input object.</li>
</ul>
</div>
9 years ago
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="global.html#NakedInput">NakedInput</a></span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id=".parseJSON"><span class="type-signature">(static) </span>parseJSON<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#NakedInput">NakedInput</a>}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Handle a deserialized JSON input object.</p>
9 years ago
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line299">line 299</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
9 years ago
<div class="param-desc">
<p>A &quot;naked&quot; input (a
plain javascript object which is suitable
for passing to the Input constructor).</p>
</div>
9 years ago
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="global.html#NakedInput">NakedInput</a></span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id=".parseRaw"><span class="type-signature">(static) </span>parseRaw<span class="signature">(data, enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#NakedInput">NakedInput</a>}</span></h4>
9 years ago
<div class="description">
9 years ago
<p>Parse a serialized input.</p>
9 years ago
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
9 years ago
<th>Attributes</th>
9 years ago
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
9 years ago
<td class="name"><code>data</code></td>
9 years ago
<td class="type">
9 years ago
<span class="param-type">Buffer</span>
9 years ago
</td>
9 years ago
<td class="attributes">
</td>
9 years ago
<td class="description last"></td>
</tr>
9 years ago
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Encoding, can be <code>'hex'</code> or null.</p></td>
</tr>
9 years ago
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line344">line 344</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
9 years ago
<div class="param-desc">
<p>A &quot;naked&quot; input object.</p>
</div>
9 years ago
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="global.html#NakedInput">NakedInput</a></span>
9 years ago
</dd>
</dl>
9 years ago
<h4 class="name" id="getAddress"><span class="type-signature"></span>getAddress<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {<a href="Address.html">Address</a>}</span></h4>
9 years ago
<div class="description">
<p>Get the previous output script's address. Will &quot;guess&quot;
based on the input script and/or witness if coin
is not available.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line154">line 154</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>address</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
9 years ago
<span class="param-type"><a href="Address.html">Address</a></span>
</dd>
</dl>
<h4 class="name" id="getHash"><span class="type-signature"></span>getHash<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Hash">Hash</a>}</span></h4>
<div class="description">
<p>Get the address hash.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line183">line 183</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>hash</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
9 years ago
</dd>
</dl>
<h4 class="name" id="getRedeem"><span class="type-signature"></span>getRedeem<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {<a href="Script.html">Script</a>}</span></h4>
<div class="description">
<p>Get the redeem script. Will attempt to resolve nested
9 years ago
redeem scripts if witnessscripthash is behind a scripthash.</p>
9 years ago
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line91">line 91</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Redeem script.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Script.html">Script</a></span>
</dd>
</dl>
<h4 class="name" id="getSubtype"><span class="type-signature"></span>getSubtype<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
<p>Get the redeem script type.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line133">line 133</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>subtype</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="getType"><span class="type-signature"></span>getType<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
<p>Get the previous output script type. Will &quot;guess&quot;
based on the input script and/or witness if coin
is not available.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line61">line 61</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>type</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="inspect"><span class="type-signature"></span>inspect<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Convert the input to a more user-friendly object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line238">line 238</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="isCoinbase"><span class="type-signature"></span>isCoinbase<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Test to see if outpoint hash is null.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line204">line 204</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="isFinal"><span class="type-signature"></span>isFinal<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Test to see if nSequence is equal to uint32max.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line195">line 195</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="test"><span class="type-signature"></span>test<span class="signature">(addressMap)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Test the input against an address, an
9 years ago
array of addresses, or a map of hashes.</p>
9 years ago
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>addressMap</code></td>
<td class="type">
9 years ago
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
9 years ago
|
9 years ago
<span class="param-type">Array.&lt;<a href="global.html#Hash">Hash</a>></span>
9 years ago
|
9 years ago
<span class="param-type"><a href="global.html#AddressHashMap">AddressHashMap</a></span>
9 years ago
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line215">line 215</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Whether the input matched.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="toExtended"><span class="type-signature"></span>toExtended<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer|String}</span></h4>
<div class="description">
<p>Serialize the input to an &quot;extended&quot; format,
including both the input and the witness.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Encoding, can be <code>'hex'</code> or null.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line371">line 371</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
|
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Convert the input to an object suitable
for JSON serialization. Note that the hashes
will be reversed to abide by bitcoind's legacy
of little-endian uint256s.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line279">line 279</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="toRaw"><span class="type-signature"></span>toRaw<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer|String}</span></h4>
<div class="description">
<p>Serialize the input.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Encoding, can be <code>'hex'</code> or null.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
9 years ago
<a href="bcoin_input.js.html">bcoin/input.js</a>, <a href="bcoin_input.js.html#line328">line 328</a>
9 years ago
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
|
<span class="param-type">String</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
8 years ago
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-bcoin.html">bcoin</a></li><li><a href="module-constants.html">constants</a></li><li><a href="module-ec.html">ec</a></li><li><a href="module-ldb.html">ldb</a></li><li><a href="module-network.html">network</a></li><li><a href="module-profiler.html">profiler</a></li><li><a href="module-request.html">request</a></li><li><a href="module-uri.html">uri</a></li><li><a href="module-utils.html">utils</a></li></ul><h3>Classes</h3><ul><li><a href="AbstractBlock.html">AbstractBlock</a></li><li><a href="Account.html">Account</a></li><li><a href="Address.html">Address</a></li><li><a href="AES.html">AES</a></li><li><a href="Block.html">Block</a></li><li><a href="Bloom.html">Bloom</a></li><li><a href="BroadcastItem.html">BroadcastItem</a></li><li><a href="BST.html">BST</a></li><li><a href="BufferReader.html">BufferReader</a></li><li><a href="BufferWriter.html">BufferWriter</a></li><li><a href="Chain.html">Chain</a></li><li><a href="ChainDB.html">ChainDB</a></li><li><a href="ChainEntry.html">ChainEntry</a></li><li><a href="Coin.html">Coin</a></li><li><a href="Coins.html">Coins</a></li><li><a href="CoinView.html">CoinView</a></li><li><a href="CompactBlock.html">CompactBlock</a></li><li><a href="Environment.html">Environment</a></li><li><a href="Framer.html">Framer</a></li><li><a href="Fullnode.html">Fullnode</a></li><li><a href="HD.html">HD</a></li><li><a href="HDPrivateKey.html">HDPrivateKey</a></li><li><a href="HDPublicKey.html">HDPublicKey</a></li><li><a href="Headers.html">Headers</a></li><li><a href="HTTPBase.html">HTTPBase</a></li><li><a href="HTTPClient.html">HTTPClient</a></li><li><a href="HTTPServer.html">HTTPServer</a></li><li><a href="HTTPWallet.html">HTTPWallet</a></li><li><a href="Input.html">Input</a></li><li><a href="KeyPair.html">KeyPair</a></li><li><a href="KeyRing.html">KeyRing</a></li><li><a href="LoadRequest.html">LoadRequest</a></li><li><a href="Locker.html">Locker</a></li><li><a href="LowlevelUp.html">LowlevelUp</a></li><li><a href="LRU.html">LRU</a></li><li><a href="Master.html">Master</a></li><li><a href="Mempool.html">Mempool</a></li><li><a href="MempoolEntry.html">MempoolEntry</a></li><li><a href="MerkleBlock.html">MerkleBlock</a></li><li><a href="Miner.html">Miner</a></li><li><a href="MinerBlock.html">MinerBlock</a></li><li><a href="Mnemonic.html">Mnemonic</a></li><li><a href="MTX.html">MTX</a></li><li><a href="Network.html">Network</a></li><li><a href="NetworkAddress.html">NetworkAddress</a></li><li><a href="Node.html">Node</a></li><li><a href="NullCache.html">NullCache</a></li><li><a href="Output.html">Output</a></li><li><a href="Parser.html">Parser</a></li><li><a href="Peer.html">Peer</a></li><li><a href="Pool.html">Pool</a></li><li><a href="Profile.html">Profile</a></li><li><a href="RollingFilter.html">RollingFilter</a></li><li><a href="Script.html">Script</a></li><li><a href="ScriptError.html">ScriptError</a></li><li><a href="Snapshot.html">Snapshot</a></li><li><a href="SPVNode.html">SPVNode</a></li><li><a href="Stack.html">Stack</a></li><li><a href="TimeData.html">TimeData</a></li><li><a href="TX.html">TX</a></li><li><a href="TXDB.html">TXDB</a></li><li><a href="VerifyError.html">VerifyError</a></li><li><a href="Wallet.html">Wallet</a></li><li><a href="WalletDB.html">WalletDB</a></li><li><a href="Witness.html">Witness</a></li><li><a href="Worker.html">Worker</a></li><li><a href="Workers.html">Workers</a></li></ul><h3>Global</h3><ul><li><a href="global.html#hostname">hostname</a></li><li><a href="global.html#isMapped">isMapped</a></li><li><a href="global.html#mkdirp">mkdirp</a></li><li><a href="global.html#normalize">normalize</a></li><li><a href="global.html#parseHost">parseHost</a></li><li><a href="global.html#scrypt">scrypt</a></li><li><a href="global.html#toBuffer">toBuffer</a></li><li><a href="global.html#toString">toString</a></li><li><a href="global.html#version">version</a></li></ul>
9 years ago
</nav>
<br class="clear">
<footer>
8 years ago
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Sun Jun 05 2016 20:46:57 GMT-0700 (PDT)
9 years ago
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>