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.
 
 
 
 

10509 lines
122 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Wallet</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: Wallet</h1>
<section>
<header>
<h2>Wallet</h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Wallet"><span class="type-signature"></span>new Wallet<span class="signature">(options)</span><span class="type-signature"></span></h4>
<div class="description">
<p>BIP44 Wallet</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>db</code></td>
<td class="type">
<span class="param-type"><a href="WalletDB.html">WalletDB</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>present, no coins will be available.</p></td>
</tr>
<tr>
<td class="name"><code>master</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">
&lt;nullable><br>
</td>
<td class="description last"><p>Master HD key. If not
present, it will be generated.</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 to use witness programs.</p></td>
</tr>
<tr>
<td class="name"><code>accountIndex</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>The BIP44 account index (default=0).</p></td>
</tr>
<tr>
<td class="name"><code>receiveDepth</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>The index of the <em>next</em> receiving
address.</p></td>
</tr>
<tr>
<td class="name"><code>changeDepth</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>The index of the <em>next</em> change
address.</p></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>Type of wallet (pubkeyhash, multisig)
(default=pubkeyhash).</p></td>
</tr>
<tr>
<td class="name"><code>compressed</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 use compressed
public keys (default=true).</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><code>m</code> value for multisig.</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><code>n</code> value for multisig.</p></td>
</tr>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Wallet ID (used for storage)
(default=account key &quot;address&quot;).</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line40">line 40</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)</span><span class="type-signature"> &rarr; {<a href="Wallet.html">Wallet</a>}</span></h4>
<div class="description">
<p>Instantiate a Wallet from a
jsonified wallet object.</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>json</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>The jsonified wallet object.</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1505">line 1505</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Wallet.html">Wallet</a></span>
</dd>
</dl>
<h4 class="name" id=".fromRaw"><span class="type-signature">(static) </span>fromRaw<span class="signature">(data)</span><span class="type-signature"> &rarr; {<a href="Wallet.html">Wallet</a>}</span></h4>
<div class="description">
<p>Instantiate a wallet from serialized data.</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">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1494">line 1494</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Wallet.html">Wallet</a></span>
</dd>
</dl>
<h4 class="name" id=".isWallet"><span class="type-signature">(static) </span>isWallet<span class="signature">(obj)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
<p>Test an object to see if it is a Wallet.</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1515">line 1515</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=".parseJSON"><span class="type-signature">(static) </span>parseJSON<span class="signature">(json, passphrase<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Object|Object}</span></h4>
<div class="description">
<p>Handle a deserialized JSON wallet 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"></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"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1433">line 1433</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
<p>Error on bad decrypt</p>
</div>
<h5>Returns:</h5>
<ul>
<li>
<div class="param-desc">
<p>A &quot;naked&quot; wallet (a
plain javascript object which is suitable
for passing to the Wallet constructor).</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</li>
<li>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</li>
</ul>
<h4 class="name" id=".parseRaw"><span class="type-signature">(static) </span>parseRaw<span class="signature">(data)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Parse a serialized wallet. Return a &quot;naked&quot;
wallet object, suitable for passing into
the wallet constructor.</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">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1471">line 1471</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="addKey"><span class="type-signature"></span>addKey<span class="signature">(key, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Add a public account key to the wallet (multisig).
Saves the key in the wallet database.</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"><a href="HDPublicKey.html">HDPublicKey</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line195">line 195</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addTX"><span class="type-signature"></span>addTX<span class="signature">(tx, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Add a transaction to the wallets TX history (accesses db).</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"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1063">line 1063</a>
</li></ul></dd>
</dl>
<h4 class="name" id="close"><span class="type-signature"></span>close<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Close the wallet, unregister with the database.</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>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line130">line 130</a>
</li></ul></dd>
</dl>
<h4 class="name" id="createAccount"><span class="type-signature"></span>createAccount<span class="signature">(options, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Create an account. Requires passphrase if master key is encrypted.</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="Account.html">Account</a> options.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="Account.html">Account</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line339">line 339</a>
</li></ul></dd>
</dl>
<h4 class="name" id="createAddress"><span class="type-signature"></span>createAddress<span class="signature">(account<span class="signature-attributes">nullable</span>, change, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Create a new address (increments depth).</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>account</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<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">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="KeyRing.html">KeyRing</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line451">line 451</a>
</li></ul></dd>
</dl>
<h4 class="name" id="createChange"><span class="type-signature"></span>createChange<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Create a new change address (increments receiveDepth).</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>account</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="KeyRing.html">KeyRing</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line436">line 436</a>
</li></ul></dd>
</dl>
<h4 class="name" id="createReceive"><span class="type-signature"></span>createReceive<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Create a new receiving address (increments receiveDepth).</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>account</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="KeyRing.html">KeyRing</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line422">line 422</a>
</li></ul></dd>
</dl>
<h4 class="name" id="createTX"><span class="type-signature"></span>createTX<span class="signature">(options, outputs, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Build a transaction, fill it with outputs and inputs,
sort the members according to BIP69, set locktime,
and sign it (accesses db).</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="Wallet.html#fill">options</a>.</p></td>
</tr>
<tr>
<td class="name"><code>outputs</code></td>
<td class="type">
<span class="param-type">Array.&lt;Object></span>
</td>
<td class="description last"><p>See <a href="Script.html#.createOutputScript">Script.createOutputScript</a>.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="MTX.html">MTX</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line597">line 597</a>
</li></ul></dd>
</dl>
<h4 class="name" id="deriveInputs"><span class="type-signature"></span>deriveInputs<span class="signature">(tx, index<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="KeyRing.html">KeyRing</a>>}</span></h4>
<div class="description">
<p>Derive necessary addresses for signing a transaction.</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="Input.html">Input</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>Input 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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line671">line 671</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.&lt;<a href="KeyRing.html">KeyRing</a>></span>
</dd>
</dl>
<h4 class="name" id="fill"><span class="type-signature"></span>fill<span class="signature">(tx, options<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Fill a transaction with inputs, estimate
transaction size, calculate fee, and add a change 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>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"><p><em>Must</em> be a mutable transaction.</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;nullable><br>
</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>If no account is
specified, coins from the entire wallet will be filled.</p></td>
</tr>
<tr>
<td class="name"><code>selection</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Coin selection priority. Can
be <code>age</code>, <code>random</code>, or <code>all</code>. (default=age).</p></td>
</tr>
<tr>
<td class="name"><code>round</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Whether to round to the nearest
kilobyte for fee calculation.
See <a href="TX.html#getMinFee">TX#getMinFee</a> vs. <a href="TX.html#getRoundFee">TX#getRoundFee</a>.</p></td>
</tr>
<tr>
<td class="name"><code>rate</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Rate">Rate</a></span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Rate used for fee calculation.</p></td>
</tr>
<tr>
<td class="name"><code>confirmed</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Select only confirmed coins.</p></td>
</tr>
<tr>
<td class="name"><code>free</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Do not apply a fee if the
transaction priority is high enough to be considered free.</p></td>
</tr>
<tr>
<td class="name"><code>fee</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Amount">Amount</a></span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>Use a hard fee rather than calculating one.</p></td>
</tr>
<tr>
<td class="name"><code>subtractFee</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">Boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Whether to subtract the
fee from existing outputs rather than adding more inputs.</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line531">line 531</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li><a href="MTX.html#selectCoins">MTX#selectCoins</a></li>
<li><a href="MTX.html#fill">MTX#fill</a></li>
</ul>
</dd>
</dl>
<h4 class="name" id="fillCoins"><span class="type-signature"></span>fillCoins<span class="signature">(tx, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Fill transaction with coins (accesses db).</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"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="TX.html">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1032">line 1032</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getAccount"><span class="type-signature"></span>getAccount<span class="signature">(account, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Retrieve an account from the database.</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>account</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="Account.html">Account</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line400">line 400</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getAccounts"><span class="type-signature"></span>getAccounts<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>List account names and indexes from the db.</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, Array].</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line390">line 390</a>
</li></ul></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 for current receiving address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1300">line 1300</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="getBalance"><span class="type-signature"></span>getBalance<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get wallet balance (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="global.html#Balance">Balance</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1103">line 1103</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getCoin"><span class="type-signature"></span>getCoin<span class="signature">(hash, index, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get a coin from the wallet (accesses db).</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>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</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="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="Coin.html">Coin</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1043">line 1043</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getCoins"><span class="type-signature"></span>getCoins<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get all available coins (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="Coin.html">Coin</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1083">line 1083</a>
</li></ul></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 for current receiving 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>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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1289">line 1289</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="getHistory"><span class="type-signature"></span>getHistory<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get all transactions in transaction history (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="TX.html">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1073">line 1073</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getID"><span class="type-signature"></span>getID<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Base58String">Base58String</a>}</span></h4>
<div class="description">
<p>Generate the wallet ID if none was passed in.
It is represented as <code>m/44'</code> (public) hashed
and converted to an address with a prefix
of <code>0x03be04</code> (<code>WLT</code> in base58).</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line316">line 316</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="global.html#Base58String">Base58String</a></span>
</dd>
</dl>
<h4 class="name" id="getInputPaths"><span class="type-signature"></span>getInputPaths<span class="signature">(tx, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Map input addresses to paths.</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>
|
<span class="param-type"><a href="Input.html">Input</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="global.html#Path">Path</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line706">line 706</a>
</li></ul></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 for current receiving address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1277">line 1277</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 for current receiving 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>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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1266">line 1266</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="getLast"><span class="type-signature"></span>getLast<span class="signature">(account<span class="signature-attributes">nullable</span>, limit, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get the last N transactions (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>limit</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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="TX.html">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1126">line 1126</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getLastTime"><span class="type-signature"></span>getLastTime<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get last timestamp and height this wallet was active
at (accesses db). Useful for resetting the chain
to a certain height when in SPV mode.</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, Number(ts), Number(height)].</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1115">line 1115</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getOutputPaths"><span class="type-signature"></span>getOutputPaths<span class="signature">(tx, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Map output addresses to paths.</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>
|
<span class="param-type"><a href="Output.html">Output</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="global.html#Path">Path</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line754">line 754</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getPath"><span class="type-signature"></span>getPath<span class="signature">(address, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get path by address hash.</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>address</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="global.html#Path">Path</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line504">line 504</a>
</li></ul></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 for current receiving address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1229">line 1229</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 current receiving 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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1254">line 1254</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 current receiving 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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1242">line 1242</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 for current receiving 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>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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1160">line 1160</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="getRedeem"><span class="type-signature"></span>getRedeem<span class="signature">(hash)</span><span class="type-signature"> &rarr; {<a href="Script.html">Script</a>}</span></h4>
<div class="description">
<p>Get a redeem script or witness script by hash.</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>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</td>
<td class="description last"><p>Can be a ripemd160 or a sha256.</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line872">line 872</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="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 for current receiving address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1171">line 1171</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 for current receiving address.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1218">line 1218</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 for current receiving 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>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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1183">line 1183</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 for current receiving 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>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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1195">line 1195</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 for current receiving 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>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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1207">line 1207</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="getTimeRange"><span class="type-signature"></span>getTimeRange<span class="signature">(account<span class="signature-attributes">nullable</span>, options, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get a range of transactions between two timestamps (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last">
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>start</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>end</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="TX.html">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1139">line 1139</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getTX"><span class="type-signature"></span>getTX<span class="signature">(hash, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get a transaction from the wallet (accesses db).</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>hash</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Hash">Hash</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, <a href="TX.html">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1053">line 1053</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getUnconfirmed"><span class="type-signature"></span>getUnconfirmed<span class="signature">(account<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Get all pending/unconfirmed transactions (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">String</span>
|
<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>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, <a href="TX.html">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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1093">line 1093</a>
</li></ul></dd>
</dl>
<h4 class="name" id="hasAddress"><span class="type-signature"></span>hasAddress<span class="signature">(address, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Test whether the wallet possesses an address.</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>address</code></td>
<td class="type">
<span class="param-type"><a href="global.html#Base58Address">Base58Address</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Error, Boolean].</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line494">line 494</a>
</li></ul></dd>
</dl>
<h4 class="name" id="init"><span class="type-signature"></span>init<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Attempt to intialize the wallet (generating
the first addresses along with the lookahead
addresses). Called automatically from the
walletdb and open().</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>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line161">line 161</a>
</li></ul></dd>
</dl>
<h4 class="name" id="inspect"><span class="type-signature"></span>inspect<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Convert the wallet to a more inspection-friendly object.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1393">line 1393</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="lock"><span class="type-signature"></span>lock<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Lock the wallet, destroy decrypted key.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line294">line 294</a>
</li></ul></dd>
</dl>
<h4 class="name" id="open"><span class="type-signature"></span>open<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Open the wallet, register with the database.</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>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line90">line 90</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeKey"><span class="type-signature"></span>removeKey<span class="signature">(key, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Remove a public account key from the wallet (multisig).
Remove the key from the wallet database.</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"><a href="HDPublicKey.html">HDPublicKey</a></span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line229">line 229</a>
</li></ul></dd>
</dl>
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">(callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Save the wallet to the database. Necessary
when address depth and keys change.</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>callback</code></td>
<td class="type">
<span class="param-type">function</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line484">line 484</a>
</li></ul></dd>
</dl>
<h4 class="name" id="scan"><span class="type-signature"></span>scan<span class="signature">(getByAddress, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Scan for active accounts and addresses. Used for importing a wallet.</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>getByAddress</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Must be a function which accepts
a <a href="global.html#Base58Address">Base58Address</a> as well as a callback and returns
transactions by address.</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Return [Error, Number] (total number
of addresses allocated).</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line914">line 914</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>, callback)</span><span class="type-signature"></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 wallet.</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>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, Number]
(total number of scripts built).</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line958">line 958</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setPassphrase"><span class="type-signature"></span>setPassphrase<span class="signature">(old<span class="signature-attributes">nullable</span>, new_<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Change or set master key's passphrase.</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>old</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>new_</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Buffer</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line263">line 263</a>
</li></ul></dd>
</dl>
<h4 class="name" id="sign"><span class="type-signature"></span>sign<span class="signature">(tx, index<span class="signature-attributes">nullable</span>, type<span class="signature-attributes">nullable</span>, callback)</span><span class="type-signature"></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 wallet.</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 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>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error, Number] (total number
of inputs scripts built and signed).</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line984">line 984</a>
</li></ul></dd>
</dl>
<h4 class="name" id="syncOutputDepth"><span class="type-signature"></span>syncOutputDepth<span class="signature">(tx, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Sync address depths based on a transaction's outputs.
This is used for deriving new addresses when
a confirmed transaction is seen.</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"></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Returns [Errr, Boolean]
(true if new addresses were allocated).</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line790">line 790</a>
</li></ul></dd>
</dl>
<h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
<p>Convert the wallet to an object suitable for
serialization. Will automatically encrypt the
master key based on the <code>passphrase</code> option.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1411">line 1411</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 wallet.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="bcoin_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1448">line 1448</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="unlock"><span class="type-signature"></span>unlock<span class="signature">(passphrase, timeout<span class="signature-attributes">opt, nullable</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Unlock the key for <code>timeout</code> milliseconds.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>passphrase</code></td>
<td class="type">
<span class="param-type">Buffer</span>
|
<span class="param-type">String</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>timeout</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;optional><br>
&lt;nullable><br>
</td>
<td class="default">
60000
</td>
<td class="description last"><p>ms.</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line304">line 304</a>
</li></ul></dd>
</dl>
<h4 class="name" id="zap"><span class="type-signature"></span>zap<span class="signature">(account<span class="signature-attributes">nullable</span>, age, callback)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Zap stale TXs from wallet (accesses db).</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>account</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<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>age</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Age threshold (unix time, default=72 hours).</p></td>
</tr>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Returns [Error].</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_wallet.js.html">bcoin/wallet.js</a>, <a href="bcoin_wallet.js.html#line1150">line 1150</a>
</li></ul></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:59 GMT-0700 (PDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>