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.
 
 
 
 

4428 lines
52 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: KeyRing</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: KeyRing</h1>
<section>
<header>
<h2>KeyRing</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="KeyRing"><span class="type-signature"></span>new KeyRing<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Represents a key ring which amounts to an address. Used for <a href="Wallet.html">Wallet</a>.</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">
<h6>Properties</h6>
<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>key</code></td>
<td class="type">
<span class="param-type"><a href="HDPrivateKey.html">HDPrivateKey</a></span>
|
<span class="param-type"><a href="HDPublicKey.html">HDPublicKey</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>path</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>change</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
&lt;nullable><br>
</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">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><code>&quot;pubkeyhash&quot;</code> or <code>&quot;multisig&quot;</code>.</p></td>
</tr>
<tr>
<td class="name"><code>keys</code></td>
<td class="type">
<span class="param-type">Array.&lt;Buffer></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Shared multisig keys.</p></td>
</tr>
<tr>
<td class="name"><code>m</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Multisig <code>m</code> value.</p></td>
</tr>
<tr>
<td class="name"><code>n</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Multisig <code>n</code> value.</p></td>
</tr>
<tr>
<td class="name"><code>witness</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 witness programs are enabled.</p></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line30">line 30</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".fromJSON"><span class="type-signature">(static) </span>fromJSON<span class="signature">(json, passphrase<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="KeyRing.html">KeyRing</a>}</span></h4>
<div class="description">
<p>Instantiate an KeyRing from a jsonified transaction object.</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>json</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The jsonified transaction object.</p></td>
</tr>
<tr>
<td class="name"><code>passphrase</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>KeyRing passphrase</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line552">line 552</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="KeyRing.html">KeyRing</a></span>
</dd>
</dl>
<h4 class="name" id=".fromRaw"><span class="type-signature">(static) </span>fromRaw<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="KeyRing.html">KeyRing</a>}</span></h4>
<div class="description">
<p>Instantiate a keyring from serialized data.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line603">line 603</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="KeyRing.html">KeyRing</a></span>
</dd>
</dl>
<h4 class="name" id=".isKeyRing"><span class="type-signature">(static) </span>isKeyRing<span class="signature">(obj)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Test whether an object is a KeyRing.</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>obj</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line643">line 643</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="addKey"><span class="type-signature"></span>addKey<span class="signature">(key)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Add a key to shared keys.</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>key</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line71">line 71</a>
</li></ul></dd>
</dl>
<h4 class="name" id="compile"><span class="type-signature"></span>compile<span class="signature">(hash, type<span class="signature-attributes">nullable</span>, version<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#Base58Address">Base58Address</a>}</span></h4>
<div class="description">
<p>Compile a hash to 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>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
|
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#AddressType">AddressType</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>version</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Witness version.</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line317">line 317</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<p>Error on bad hash/prefix.</p>
</div>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Base58Address">Base58Address</a></span>
</dd>
</dl>
<h4 class="name" id="getAddress"><span class="type-signature"></span>getAddress<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Base58Address">Base58Address</a>}</span></h4>
<div class="description">
<p>Get base58 address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line338">line 338</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Base58Address">Base58Address</a></span>
</dd>
</dl>
<h4 class="name" id="getAddressMap"><span class="type-signature"></span>getAddressMap<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#AddressMap">AddressMap</a>}</span></h4>
<div class="description">
<p>Create the address map for testing txs.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line349">line 349</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#AddressMap">AddressMap</a></span>
</dd>
</dl>
<h4 class="name" id="getHash"><span class="type-signature"></span>getHash<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get hash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line327">line 327</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="getKeyAddress"><span class="type-signature"></span>getKeyAddress<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Base58Address">Base58Address</a>}</span></h4>
<div class="description">
<p>Get pubkeyhash address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line293">line 293</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Base58Address">Base58Address</a></span>
</dd>
</dl>
<h4 class="name" id="getKeyHash"><span class="type-signature"></span>getKeyHash<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get public key hash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line279">line 279</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="getProgram"><span class="type-signature"></span>getProgram<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get witness program.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line139">line 139</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="getProgramAddress"><span class="type-signature"></span>getProgramAddress<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Base58Address">Base58Address</a>}</span></h4>
<div class="description">
<p>Get address' scripthash address for witness program.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line185">line 185</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Base58Address">Base58Address</a></span>
</dd>
</dl>
<h4 class="name" id="getProgramHash"><span class="type-signature"></span>getProgramHash<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get address' ripemd160 program scripthash
(for witness programs behind a scripthash).</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line168">line 168</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="getPublicKey"><span class="type-signature"></span>getPublicKey<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get public key.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line99">line 99</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="getScript"><span class="type-signature"></span>getScript<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Script.html">Script</a>}</span></h4>
<div class="description">
<p>Get redeem script.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line114">line 114</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Script.html">Script</a></span>
</dd>
</dl>
<h4 class="name" id="getScriptAddress"><span class="type-signature"></span>getScriptAddress<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Base58Address">Base58Address</a>}</span></h4>
<div class="description">
<p>Get scripthash address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line253">line 253</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Base58Address">Base58Address</a></span>
</dd>
</dl>
<h4 class="name" id="getScriptHash"><span class="type-signature"></span>getScriptHash<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get scripthash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line206">line 206</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="getScriptHash160"><span class="type-signature"></span>getScriptHash160<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get ripemd160 scripthash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line218">line 218</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="getScriptHash256"><span class="type-signature"></span>getScriptHash256<span class="signature">(enc<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Get sha256 scripthash.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>enc</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p><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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line236">line 236</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="ownInput"><span class="type-signature"></span>ownInput<span class="signature">(tx, index<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Check whether transaction input belongs to this 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>tx</code></td>
<td class="type">
<span class="param-type"><a href="TX.html">TX</a></span>
|
<span class="param-type"><a href="Output.html">Output</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Transaction or Output.</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Output index.</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line372">line 372</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="ownOutput"><span class="type-signature"></span>ownOutput<span class="signature">(tx, index<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Check whether transaction output belongs to this 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>tx</code></td>
<td class="type">
<span class="param-type"><a href="TX.html">TX</a></span>
|
<span class="param-type"><a href="Output.html">Output</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Transaction or Output.</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Output index.</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line388">line 388</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="removeKey"><span class="type-signature"></span>removeKey<span class="signature">(key)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Remove a key from shared keys.</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>key</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line86">line 86</a>
</li></ul></dd>
</dl>
<h4 class="name" id="scriptInputs"><span class="type-signature"></span>scriptInputs<span class="signature">(tx, index<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Build input scripts templates for a transaction (does not
sign, only creates signature slots). Only builds scripts
for inputs that are redeemable by this 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>tx</code></td>
<td class="type">
<span class="param-type"><a href="MTX.html">MTX</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">
&lt;nullable><br>
</td>
<td class="description last"><p>Index of input. If not present,
it will attempt to sign all redeemable inputs.</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line407">line 407</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Total number of scripts built.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id="sign"><span class="type-signature"></span>sign<span class="signature">(tx, key, index<span class="signature-attributes">nullable</span>, type<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
<p>Build input scripts and sign inputs for a transaction. Only attempts
to build/sign inputs that are redeemable by this 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>tx</code></td>
<td class="type">
<span class="param-type"><a href="MTX.html">MTX</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type"><a href="HDPrivateKey.html">HDPrivateKey</a></span>
|
<span class="param-type"><a href="KeyPair.html">KeyPair</a></span>
|
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Private key.</p></td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Index of input. If not present,
it will attempt to build and sign all redeemable inputs.</p></td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type"><a href="global.html#SighashType">SighashType</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line444">line 444</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Total number of inputs scripts built and signed.</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span class="signature">(passphrase<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Convert an KeyRing to a more json-friendly object.</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>passphrase</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>KeyRing passphrase</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_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line528">line 528</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="toRaw"><span class="type-signature"></span>toRaw<span class="signature">()</span><span class="type-signature"> &rarr; {Buffer}</span></h4>
<div class="description">
<p>Serialize the keyring.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_keyring.js.html">bcoin/keyring.js</a>, <a href="bcoin_keyring.js.html#line573">line 573</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<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>