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.
 
 
 
 

28794 lines
323 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Framer</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: Framer</h1>
<section>
<header>
<h2>Framer</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Framer"><span class="type-signature"></span>new Framer<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Protocol packet framer</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line23">line 23</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".addr"><span class="type-signature">(static) </span>addr<span class="signature">(hosts, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an addr packet (without a header).</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>hosts</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#NakedNetworkAddress">NakedNetworkAddress</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1171">line 1171</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".address"><span class="type-signature">(static) </span>address<span class="signature">(data, full<span class="signature-attributes">nullable</span>, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an address.</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedNetworkAddress">NakedNetworkAddress</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>full</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Whether to include the timestamp.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line425">line 425</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".alert"><span class="type-signature">(static) </span>alert<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an alert packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#AlertPacket">AlertPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1193">line 1193</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".block"><span class="type-signature">(static) </span>block<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a block without witness data.</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line886">line 886</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".block.cost"><span class="type-signature">(static) </span>block.cost<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate block cost.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1551">line 1551</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>cost</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".block.size"><span class="type-signature">(static) </span>block.size<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction size without witness.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1505">line 1505</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".block.sizes"><span class="type-signature">(static) </span>block.sizes<span class="signature">(block)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Calculate total block size and
witness size without serializing.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1454">line 1454</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>In the form of <code>{size: Number, witnessSize: Number}</code>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".block.virtualSize"><span class="type-signature">(static) </span>block.virtualSize<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate block virtual size.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1529">line 1529</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Virtual size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".block.witnessSize"><span class="type-signature">(static) </span>block.witnessSize<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate block size with witness (if present).</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1485">line 1485</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".blockHeaders"><span class="type-signature">(static) </span>blockHeaders<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a block header without any transaction count field.</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
|
<span class="param-type"><a href="MerkleBlock.html">MerkleBlock</a></span>
|
<span class="param-type"><a href="Headers.html">Headers</a></span>
|
<span class="param-type"><a href="ChainEntry.html">ChainEntry</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1116">line 1116</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".checkOrder"><span class="type-signature">(static) </span>checkOrder<span class="signature">(order, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a checkorder packet (without a header).</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>order</code></td>
<td class="type">
<span class="param-type"><a href="global.html#SubmitOrderPacket">SubmitOrderPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1356">line 1356</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".coin"><span class="type-signature">(static) </span>coin<span class="signature">(coin, extended, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a coin.</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>coin</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedCoin">NakedCoin</a></span>
|
<span class="param-type"><a href="Coin.html">Coin</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>extended</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Whether to include the hash and index.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line669">line 669</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".extendedTX"><span class="type-signature">(static) </span>extendedTX<span class="signature">(tx, saveCoins<span class="signature-attributes">nullable</span>, enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a transaction to BCoin &quot;extended format&quot;.
This is the serialization format BCoin uses internally
to store transactions in the database. The extended
serialization includes the height, block hash, index,
timestamp, pending-since time, and optionally a vector
for the serialized coins.</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>saveCoins</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Whether to serialize the coins.</p></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>One of <code>&quot;hex&quot;</code> or <code>null</code>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line977">line 977</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".feeFilter"><span class="type-signature">(static) </span>feeFilter<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a feefilter packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#FeeFilterPacket">FeeFilterPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1436">line 1436</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".filterAdd"><span class="type-signature">(static) </span>filterAdd<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filteradd packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
|
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Data to be added to bloom filter.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1409">line 1409</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".filterClear"><span class="type-signature">(static) </span>filterClear<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterclear packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1425">line 1425</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".filterLoad"><span class="type-signature">(static) </span>filterLoad<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterload packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#FilterLoadPacket">FilterLoadPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line584">line 584</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getAddr"><span class="type-signature">(static) </span>getAddr<span class="signature">(writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getaddr packet (without a header).</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>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1257">line 1257</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getBlocks"><span class="type-signature">(static) </span>getBlocks<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getblocks packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetBlocksPacket">GetBlocksPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line622">line 622</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getData"><span class="type-signature">(static) </span>getData<span class="signature">(items, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getdata packet (without a header).</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>items</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#InvItem">InvItem</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line536">line 536</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getHeaders"><span class="type-signature">(static) </span>getHeaders<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getheaders packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetBlocksPacket">GetBlocksPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line611">line 611</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getUTXOs"><span class="type-signature">(static) </span>getUTXOs<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getutxos packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetUTXOsPacket">GetUTXOsPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1268">line 1268</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".haveWitness"><span class="type-signature">(static) </span>haveWitness<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a havewitness packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1398">line 1398</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".headers"><span class="type-signature">(static) </span>headers<span class="signature">(headers, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize headers.</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>headers</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#NakedBlock">NakedBlock</a>></span>
|
<span class="param-type">Array.&lt;<a href="Headers.html">Headers</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1086">line 1086</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".input"><span class="type-signature">(static) </span>input<span class="signature">(input, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an 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>input</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedInput">NakedInput</a></span>
|
<span class="param-type"><a href="Input.html">Input</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line751">line 751</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".inv"><span class="type-signature">(static) </span>inv<span class="signature">(items, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an inv packet (without a header).</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>items</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#InvItem">InvItem</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line525">line 525</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".mempool"><span class="type-signature">(static) </span>mempool<span class="signature">(writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a mempool packet (without a header).</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>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1247">line 1247</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".merkleBlock"><span class="type-signature">(static) </span>merkleBlock<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a merkle block.</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="MerkleBlock.html">MerkleBlock</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1054">line 1054</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".notFound"><span class="type-signature">(static) </span>notFound<span class="signature">(items, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a notfound packet (without a header).</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>items</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#InvItem">InvItem</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line547">line 547</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".outpoint"><span class="type-signature">(static) </span>outpoint<span class="signature">(hash, index, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an outpoint.</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>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line732">line 732</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".output"><span class="type-signature">(static) </span>output<span class="signature">(output, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an output.</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>output</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedOutput">NakedOutput</a></span>
|
<span class="param-type"><a href="Output.html">Output</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line772">line 772</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".ping"><span class="type-signature">(static) </span>ping<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a ping packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#PingPacket">PingPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line558">line 558</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".pong"><span class="type-signature">(static) </span>pong<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a pong packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#PingPacket">PingPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line571">line 571</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".reject"><span class="type-signature">(static) </span>reject<span class="signature">(details, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reject packet (without a header).</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>details</code></td>
<td class="type">
<span class="param-type"><a href="global.html#RejectPacket">RejectPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1139">line 1139</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".renderTX"><span class="type-signature">(static) </span>renderTX<span class="signature">(tx, useWitness, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a transaction lazily (use existing raw data if present).</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>useWitness</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Whether to include witness data.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line910">line 910</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".reply"><span class="type-signature">(static) </span>reply<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reply packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ReplyPacket">ReplyPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1367">line 1367</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".script"><span class="type-signature">(static) </span>script<span class="signature">(script, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a script. Note that scripts require
extra magic since they're so goddamn bizarre.
Normally in an &quot;encoded&quot; script we don't
include the varint size because scripthashes
don't include them. This is why
script.encode/decode is separate from the
framer and parser.</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>script</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedScript">NakedScript</a></span>
|
<span class="param-type"><a href="Script.html">Script</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line840">line 840</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".sendHeaders"><span class="type-signature">(static) </span>sendHeaders<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a sendheaders packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1389">line 1389</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".submitOrder"><span class="type-signature">(static) </span>submitOrder<span class="signature">(order, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a submitorder packet (without a header).</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>order</code></td>
<td class="type">
<span class="param-type"><a href="global.html#SubmitOrderPacket">SubmitOrderPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1337">line 1337</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".tx"><span class="type-signature">(static) </span>tx<span class="signature">(tx, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize transaction without 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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line700">line 700</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".tx.cost"><span class="type-signature">(static) </span>tx.cost<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction cost.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1564">line 1564</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>cost</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".tx.size"><span class="type-signature">(static) </span>tx.size<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction size without witness.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1517">line 1517</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".tx.sizes"><span class="type-signature">(static) </span>tx.sizes<span class="signature">(block)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Calculate total transaction size and
witness size without serializing.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1470">line 1470</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>In the form of <code>{size: Number, witnessSize: Number}</code>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".tx.virtualSize"><span class="type-signature">(static) </span>tx.virtualSize<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction virtual size.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1540">line 1540</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Virtual size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".tx.witnessSize"><span class="type-signature">(static) </span>tx.witnessSize<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction size with witness (if present).</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1495">line 1495</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".UTXOs"><span class="type-signature">(static) </span>UTXOs<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a utxos packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#UTXOsPacket">UTXOsPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1294">line 1294</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".verack"><span class="type-signature">(static) </span>verack<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a verack packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line490">line 490</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".version"><span class="type-signature">(static) </span>version<span class="signature">(options, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a version packet (without a header).</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#VersionPacket">VersionPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line452">line 452</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".witness"><span class="type-signature">(static) </span>witness<span class="signature">(witness, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a 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>witness</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedWitness">NakedWitness</a></span>
|
<span class="param-type"><a href="Witness.html">Witness</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line864">line 864</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".witnessBlock"><span class="type-signature">(static) </span>witnessBlock<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a block with witness data. Calculates the witness
size as it is framing (exposed on return value as <code>_witnessSize</code>).</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line898">line 898</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".witnessTX"><span class="type-signature">(static) </span>witnessTX<span class="signature">(tx, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize transaction with witness. Calculates the witness
size as it is framing (exposed on return value as <code>_witnessSize</code>).</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line792">line 792</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="addr"><span class="type-signature"></span>addr<span class="signature">(peers)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an addr packet with a header.</p>
</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>peers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.addr">Framer.addr</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line392">line 392</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>addr packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="alert"><span class="type-signature"></span>alert<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an alert packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.alert">Framer.alert</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line402">line 402</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>alert packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="block"><span class="type-signature"></span>block<span class="signature">(block)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a block packet with a header.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.block">Framer.block</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line342">line 342</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>block packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="checkOrder"><span class="type-signature"></span>checkOrder<span class="signature">(order)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a checkorder packet with a header.</p>
</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>order</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.checkOrder">Framer.checkOrder</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line162">line 162</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>checkorder packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="feeFilter"><span class="type-signature"></span>feeFilter<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a feefilter packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See Framer.feefilter.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line413">line 413</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>feefilter packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="filterAdd"><span class="type-signature"></span>filterAdd<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filteradd packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See Framer.filteradd.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line201">line 201</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>filteradd packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="filterClear"><span class="type-signature"></span>filterClear<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterclear packet with a header.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line210">line 210</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>filterclear packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="filterLoad"><span class="type-signature"></span>filterLoad<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterload packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.filterLoad">Framer.filterLoad</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line270">line 270</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>filterload packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getAddr"><span class="type-signature"></span>getAddr<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getaddr packet with a header.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line142">line 142</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getaddr packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getBlocks"><span class="type-signature"></span>getBlocks<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getblocks packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getBlocks">Framer.getBlocks</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line290">line 290</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getblocks packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getData"><span class="type-signature"></span>getData<span class="signature">(items)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getdata packet with a header.</p>
</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>items</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getData">Framer.getData</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line230">line 230</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getdata packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getHeaders"><span class="type-signature"></span>getHeaders<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getheaders packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getHeaders">Framer.getHeaders</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line280">line 280</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getheaders packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getUTXOs"><span class="type-signature"></span>getUTXOs<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getutxos packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getUTXOs">Framer.getUTXOs</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line123">line 123</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getutxos packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="haveWitness"><span class="type-signature"></span>haveWitness<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a havewitness packet with a header.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line191">line 191</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>havewitness packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="header"><span class="type-signature"></span>header<span class="signature">(cmd, payload)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a header for a payload.</p>
</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>cmd</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Packet type.</p></td>
</tr>
<tr>
<td class="name"><code>payload</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line41">line 41</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Header.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="headers"><span class="type-signature"></span>headers<span class="signature">(headers)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a headers packet with a header.</p>
</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>headers</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="Headers.html">Headers</a>></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.headers">Framer.headers</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line372">line 372</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>headers packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="inv"><span class="type-signature"></span>inv<span class="signature">(items)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an inv packet with a header.</p>
</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>items</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.inv">Framer.inv</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line220">line 220</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>inv packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="mempool"><span class="type-signature"></span>mempool<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a mempool packet with a header.
See <a href="Framer.html#.mempool">Framer.mempool</a>.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line113">line 113</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>mempool packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="merkleBlock"><span class="type-signature"></span>merkleBlock<span class="signature">(block)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a merkleblock packet with a header.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="MerkleBlock.html">MerkleBlock</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.merkleBlock">Framer.merkleBlock</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line362">line 362</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>merkleblock packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="notFound"><span class="type-signature"></span>notFound<span class="signature">(items)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a notfound packet with a header.</p>
</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>items</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.notFound">Framer.notFound</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line240">line 240</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>notfound packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="packet"><span class="type-signature"></span>packet<span class="signature">(cmd, payload)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Frame a payload with a header.</p>
</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>cmd</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Packet type.</p></td>
</tr>
<tr>
<td class="name"><code>payload</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line77">line 77</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Payload with header prepended.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="ping"><span class="type-signature"></span>ping<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a ping packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.ping">Framer.ping</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line250">line 250</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>ping packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="pong"><span class="type-signature"></span>pong<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a pong packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.pong">Framer.pong</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line260">line 260</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>pong packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="reject"><span class="type-signature"></span>reject<span class="signature">(details)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reject packet with a header.</p>
</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>details</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.reject">Framer.reject</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line382">line 382</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>reject packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="reply"><span class="type-signature"></span>reply<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reply packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.reply">Framer.reply</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line172">line 172</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>reply packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="sendHeaders"><span class="type-signature"></span>sendHeaders<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a sendheaders packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.sendHeaders">Framer.sendHeaders</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line182">line 182</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>sendheaders packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="submitOrder"><span class="type-signature"></span>submitOrder<span class="signature">(order)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a submitorder packet with a header.</p>
</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>order</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.submitOrder">Framer.submitOrder</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line152">line 152</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>submitorder packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="tx"><span class="type-signature"></span>tx<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a tx packet with a header.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.tx">Framer.tx</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line300">line 300</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>tx packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="UTXOs"><span class="type-signature"></span>UTXOs<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a utxos packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See Framer.utxos.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line133">line 133</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>utxos packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="verack"><span class="type-signature"></span>verack<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a verack packet with a header.
See <a href="Framer.html#.verack">Framer.verack</a>.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>verack packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a version packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.version">Framer.version</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>version packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="witnessBlock"><span class="type-signature"></span>witnessBlock<span class="signature">(block)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a block packet with a header, using witness serialization.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.witnessBlock">Framer.witnessBlock</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line352">line 352</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>block packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="witnessTX"><span class="type-signature"></span>witnessTX<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a tx packet with a header, using witness serialization.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.witnessTX">Framer.witnessTX</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line317">line 317</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>tx packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
</article>
</section>
<section>
<header>
<h2>Framer</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Framer"><span class="type-signature"></span>new Framer<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Framer</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_workers.js.html">bcoin/workers.js</a>, <a href="bcoin_workers.js.html#line752">line 752</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".addr"><span class="type-signature">(static) </span>addr<span class="signature">(hosts, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an addr packet (without a header).</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>hosts</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#NakedNetworkAddress">NakedNetworkAddress</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1171">line 1171</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".address"><span class="type-signature">(static) </span>address<span class="signature">(data, full<span class="signature-attributes">nullable</span>, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an address.</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedNetworkAddress">NakedNetworkAddress</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>full</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Whether to include the timestamp.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line425">line 425</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".alert"><span class="type-signature">(static) </span>alert<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an alert packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#AlertPacket">AlertPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1193">line 1193</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".block"><span class="type-signature">(static) </span>block<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a block without witness data.</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line886">line 886</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".block.cost"><span class="type-signature">(static) </span>block.cost<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate block cost.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1551">line 1551</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>cost</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".block.size"><span class="type-signature">(static) </span>block.size<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction size without witness.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1505">line 1505</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".block.sizes"><span class="type-signature">(static) </span>block.sizes<span class="signature">(block)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Calculate total block size and
witness size without serializing.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1454">line 1454</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>In the form of <code>{size: Number, witnessSize: Number}</code>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".block.virtualSize"><span class="type-signature">(static) </span>block.virtualSize<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate block virtual size.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1529">line 1529</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Virtual size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".block.witnessSize"><span class="type-signature">(static) </span>block.witnessSize<span class="signature">(block)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate block size with witness (if present).</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1485">line 1485</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".blockHeaders"><span class="type-signature">(static) </span>blockHeaders<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a block header without any transaction count field.</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
|
<span class="param-type"><a href="MerkleBlock.html">MerkleBlock</a></span>
|
<span class="param-type"><a href="Headers.html">Headers</a></span>
|
<span class="param-type"><a href="ChainEntry.html">ChainEntry</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1116">line 1116</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".checkOrder"><span class="type-signature">(static) </span>checkOrder<span class="signature">(order, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a checkorder packet (without a header).</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>order</code></td>
<td class="type">
<span class="param-type"><a href="global.html#SubmitOrderPacket">SubmitOrderPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1356">line 1356</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".coin"><span class="type-signature">(static) </span>coin<span class="signature">(coin, extended, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a coin.</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>coin</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedCoin">NakedCoin</a></span>
|
<span class="param-type"><a href="Coin.html">Coin</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>extended</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Whether to include the hash and index.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line669">line 669</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".extendedTX"><span class="type-signature">(static) </span>extendedTX<span class="signature">(tx, saveCoins<span class="signature-attributes">nullable</span>, enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a transaction to BCoin &quot;extended format&quot;.
This is the serialization format BCoin uses internally
to store transactions in the database. The extended
serialization includes the height, block hash, index,
timestamp, pending-since time, and optionally a vector
for the serialized coins.</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>saveCoins</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Whether to serialize the coins.</p></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>One of <code>&quot;hex&quot;</code> or <code>null</code>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line977">line 977</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".feeFilter"><span class="type-signature">(static) </span>feeFilter<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a feefilter packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#FeeFilterPacket">FeeFilterPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1436">line 1436</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".filterAdd"><span class="type-signature">(static) </span>filterAdd<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filteradd packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
|
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Data to be added to bloom filter.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1409">line 1409</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".filterClear"><span class="type-signature">(static) </span>filterClear<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterclear packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1425">line 1425</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".filterLoad"><span class="type-signature">(static) </span>filterLoad<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterload packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#FilterLoadPacket">FilterLoadPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line584">line 584</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getAddr"><span class="type-signature">(static) </span>getAddr<span class="signature">(writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getaddr packet (without a header).</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>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1257">line 1257</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getBlocks"><span class="type-signature">(static) </span>getBlocks<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getblocks packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetBlocksPacket">GetBlocksPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line622">line 622</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getData"><span class="type-signature">(static) </span>getData<span class="signature">(items, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getdata packet (without a header).</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>items</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#InvItem">InvItem</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line536">line 536</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getHeaders"><span class="type-signature">(static) </span>getHeaders<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getheaders packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetBlocksPacket">GetBlocksPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line611">line 611</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".getUTXOs"><span class="type-signature">(static) </span>getUTXOs<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getutxos packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#GetUTXOsPacket">GetUTXOsPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1268">line 1268</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".haveWitness"><span class="type-signature">(static) </span>haveWitness<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a havewitness packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1398">line 1398</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".headers"><span class="type-signature">(static) </span>headers<span class="signature">(headers, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize headers.</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>headers</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#NakedBlock">NakedBlock</a>></span>
|
<span class="param-type">Array.&lt;<a href="Headers.html">Headers</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1086">line 1086</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".input"><span class="type-signature">(static) </span>input<span class="signature">(input, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an 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>input</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedInput">NakedInput</a></span>
|
<span class="param-type"><a href="Input.html">Input</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line751">line 751</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".inv"><span class="type-signature">(static) </span>inv<span class="signature">(items, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an inv packet (without a header).</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>items</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#InvItem">InvItem</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line525">line 525</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".mempool"><span class="type-signature">(static) </span>mempool<span class="signature">(writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a mempool packet (without a header).</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>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1247">line 1247</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".merkleBlock"><span class="type-signature">(static) </span>merkleBlock<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a merkle block.</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="MerkleBlock.html">MerkleBlock</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1054">line 1054</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".notFound"><span class="type-signature">(static) </span>notFound<span class="signature">(items, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a notfound packet (without a header).</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>items</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="global.html#InvItem">InvItem</a>></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line547">line 547</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".outpoint"><span class="type-signature">(static) </span>outpoint<span class="signature">(hash, index, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an outpoint.</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>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line732">line 732</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".output"><span class="type-signature">(static) </span>output<span class="signature">(output, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize an output.</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>output</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedOutput">NakedOutput</a></span>
|
<span class="param-type"><a href="Output.html">Output</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line772">line 772</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".ping"><span class="type-signature">(static) </span>ping<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a ping packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#PingPacket">PingPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line558">line 558</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".pong"><span class="type-signature">(static) </span>pong<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a pong packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#PingPacket">PingPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line571">line 571</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".reject"><span class="type-signature">(static) </span>reject<span class="signature">(details, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reject packet (without a header).</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>details</code></td>
<td class="type">
<span class="param-type"><a href="global.html#RejectPacket">RejectPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1139">line 1139</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".renderTX"><span class="type-signature">(static) </span>renderTX<span class="signature">(tx, useWitness, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a transaction lazily (use existing raw data if present).</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>useWitness</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Whether to include witness data.</p></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line910">line 910</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".reply"><span class="type-signature">(static) </span>reply<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reply packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#ReplyPacket">ReplyPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1367">line 1367</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".script"><span class="type-signature">(static) </span>script<span class="signature">(script, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a script. Note that scripts require
extra magic since they're so goddamn bizarre.
Normally in an &quot;encoded&quot; script we don't
include the varint size because scripthashes
don't include them. This is why
script.encode/decode is separate from the
framer and parser.</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>script</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedScript">NakedScript</a></span>
|
<span class="param-type"><a href="Script.html">Script</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line840">line 840</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".sendHeaders"><span class="type-signature">(static) </span>sendHeaders<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a sendheaders packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1389">line 1389</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".submitOrder"><span class="type-signature">(static) </span>submitOrder<span class="signature">(order, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a submitorder packet (without a header).</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>order</code></td>
<td class="type">
<span class="param-type"><a href="global.html#SubmitOrderPacket">SubmitOrderPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1337">line 1337</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".tx"><span class="type-signature">(static) </span>tx<span class="signature">(tx, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize transaction without 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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line700">line 700</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".tx.cost"><span class="type-signature">(static) </span>tx.cost<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction cost.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1564">line 1564</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>cost</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".tx.size"><span class="type-signature">(static) </span>tx.size<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction size without witness.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1517">line 1517</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".tx.sizes"><span class="type-signature">(static) </span>tx.sizes<span class="signature">(block)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Calculate total transaction size and
witness size without serializing.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1470">line 1470</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>In the form of <code>{size: Number, witnessSize: Number}</code>.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id=".tx.virtualSize"><span class="type-signature">(static) </span>tx.virtualSize<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction virtual size.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1540">line 1540</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Virtual size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".tx.witnessSize"><span class="type-signature">(static) </span>tx.witnessSize<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Calculate transaction size with witness (if present).</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1495">line 1495</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Size.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".UTXOs"><span class="type-signature">(static) </span>UTXOs<span class="signature">(data, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a utxos packet (without a header).</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>data</code></td>
<td class="type">
<span class="param-type"><a href="global.html#UTXOsPacket">UTXOsPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line1294">line 1294</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".verack"><span class="type-signature">(static) </span>verack<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a verack packet (without a header).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line490">line 490</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".version"><span class="type-signature">(static) </span>version<span class="signature">(options, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a version packet (without a header).</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#VersionPacket">VersionPacket</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line452">line 452</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".witness"><span class="type-signature">(static) </span>witness<span class="signature">(witness, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a 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>witness</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedWitness">NakedWitness</a></span>
|
<span class="param-type"><a href="Witness.html">Witness</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line864">line 864</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".witnessBlock"><span class="type-signature">(static) </span>witnessBlock<span class="signature">(block, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize a block with witness data. Calculates the witness
size as it is framing (exposed on return value as <code>_witnessSize</code>).</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>block</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedBlock">NakedBlock</a></span>
|
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line898">line 898</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id=".witnessTX"><span class="type-signature">(static) </span>witnessTX<span class="signature">(tx, writer<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize transaction with witness. Calculates the witness
size as it is framing (exposed on return value as <code>_witnessSize</code>).</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NakedTX">NakedTX</a></span>
|
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>writer</code></td>
<td class="type">
<span class="param-type"><a href="BufferWriter.html">BufferWriter</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>A buffer writer to continue writing from.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line792">line 792</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Returns a BufferWriter if <code>writer</code> was passed in.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="addr"><span class="type-signature"></span>addr<span class="signature">(peers)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an addr packet with a header.</p>
</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>peers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.addr">Framer.addr</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line392">line 392</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>addr packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="alert"><span class="type-signature"></span>alert<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an alert packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.alert">Framer.alert</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line402">line 402</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>alert packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="block"><span class="type-signature"></span>block<span class="signature">(block)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a block packet with a header.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.block">Framer.block</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line342">line 342</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>block packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="checkOrder"><span class="type-signature"></span>checkOrder<span class="signature">(order)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a checkorder packet with a header.</p>
</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>order</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.checkOrder">Framer.checkOrder</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line162">line 162</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>checkorder packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="feeFilter"><span class="type-signature"></span>feeFilter<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a feefilter packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See Framer.feefilter.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line413">line 413</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>feefilter packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="filterAdd"><span class="type-signature"></span>filterAdd<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filteradd packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See Framer.filteradd.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line201">line 201</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>filteradd packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="filterClear"><span class="type-signature"></span>filterClear<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterclear packet with a header.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line210">line 210</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>filterclear packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="filterLoad"><span class="type-signature"></span>filterLoad<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a filterload packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.filterLoad">Framer.filterLoad</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line270">line 270</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>filterload packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getAddr"><span class="type-signature"></span>getAddr<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getaddr packet with a header.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line142">line 142</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getaddr packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getBlocks"><span class="type-signature"></span>getBlocks<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getblocks packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getBlocks">Framer.getBlocks</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line290">line 290</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getblocks packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getData"><span class="type-signature"></span>getData<span class="signature">(items)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getdata packet with a header.</p>
</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>items</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getData">Framer.getData</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line230">line 230</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getdata packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getHeaders"><span class="type-signature"></span>getHeaders<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getheaders packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getHeaders">Framer.getHeaders</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line280">line 280</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getheaders packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="getUTXOs"><span class="type-signature"></span>getUTXOs<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a getutxos packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.getUTXOs">Framer.getUTXOs</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line123">line 123</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>getutxos packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="haveWitness"><span class="type-signature"></span>haveWitness<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a havewitness packet with a header.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line191">line 191</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>havewitness packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="header"><span class="type-signature"></span>header<span class="signature">(cmd, payload)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a header for a payload.</p>
</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>cmd</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Packet type.</p></td>
</tr>
<tr>
<td class="name"><code>payload</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line41">line 41</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Header.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="headers"><span class="type-signature"></span>headers<span class="signature">(headers)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a headers packet with a header.</p>
</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>headers</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="Headers.html">Headers</a>></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.headers">Framer.headers</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line372">line 372</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>headers packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="inv"><span class="type-signature"></span>inv<span class="signature">(items)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create an inv packet with a header.</p>
</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>items</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.inv">Framer.inv</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line220">line 220</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>inv packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="mempool"><span class="type-signature"></span>mempool<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a mempool packet with a header.
See <a href="Framer.html#.mempool">Framer.mempool</a>.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line113">line 113</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>mempool packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="merkleBlock"><span class="type-signature"></span>merkleBlock<span class="signature">(block)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a merkleblock packet with a header.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="MerkleBlock.html">MerkleBlock</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.merkleBlock">Framer.merkleBlock</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line362">line 362</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>merkleblock packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="notFound"><span class="type-signature"></span>notFound<span class="signature">(items)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a notfound packet with a header.</p>
</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>items</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.notFound">Framer.notFound</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line240">line 240</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>notfound packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="packet"><span class="type-signature"></span>packet<span class="signature">(cmd, payload)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Frame a payload with a header.</p>
</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>cmd</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Packet type.</p></td>
</tr>
<tr>
<td class="name"><code>payload</code></td>
<td class="type">
<span class="param-type">Buffer</span>
</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>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line77">line 77</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Payload with header prepended.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="ping"><span class="type-signature"></span>ping<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a ping packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.ping">Framer.ping</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line250">line 250</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>ping packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="pong"><span class="type-signature"></span>pong<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a pong packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.pong">Framer.pong</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line260">line 260</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>pong packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="reject"><span class="type-signature"></span>reject<span class="signature">(details)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reject packet with a header.</p>
</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>details</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.reject">Framer.reject</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line382">line 382</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>reject packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="reply"><span class="type-signature"></span>reply<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a reply packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.reply">Framer.reply</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line172">line 172</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>reply packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="sendHeaders"><span class="type-signature"></span>sendHeaders<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a sendheaders packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.sendHeaders">Framer.sendHeaders</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line182">line 182</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>sendheaders packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="submitOrder"><span class="type-signature"></span>submitOrder<span class="signature">(order)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a submitorder packet with a header.</p>
</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>order</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.submitOrder">Framer.submitOrder</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line152">line 152</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>submitorder packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="tx"><span class="type-signature"></span>tx<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a tx packet with a header.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.tx">Framer.tx</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line300">line 300</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>tx packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="UTXOs"><span class="type-signature"></span>UTXOs<span class="signature">(data)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a utxos packet with a header.</p>
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See Framer.utxos.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line133">line 133</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>utxos packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="verack"><span class="type-signature"></span>verack<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a verack packet with a header.
See <a href="Framer.html#.verack">Framer.verack</a>.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line103">line 103</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>verack packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="version"><span class="type-signature"></span>version<span class="signature">(options)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a version packet with a header.</p>
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>See <a href="Framer.html#.version">Framer.version</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>version packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="witnessBlock"><span class="type-signature"></span>witnessBlock<span class="signature">(block)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a block packet with a header, using witness serialization.</p>
</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>block</code></td>
<td class="type">
<span class="param-type"><a href="Block.html">Block</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.witnessBlock">Framer.witnessBlock</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line352">line 352</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>block packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
<h4 class="name" id="witnessTX"><span class="type-signature"></span>witnessTX<span class="signature">(tx)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Create a tx packet with a header, using witness serialization.</p>
</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>tx</code></td>
<td class="type">
<span class="param-type"><a href="TX.html">TX</a></span>
</td>
<td class="description last"><p>See <a href="Framer.html#.witnessTX">Framer.witnessTX</a>.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_protocol_framer.js.html">bcoin/protocol/framer.js</a>, <a href="bcoin_protocol_framer.js.html#line317">line 317</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>tx packet.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Buffer</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<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>
</nav>
<br class="clear">
<footer>
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)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>