@ellcrys/spell
Version:
The official JavaScript library for Ellcrys
908 lines • 47.8 kB
HTML
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>State | Spell Documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">Spell Documentation</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="../modules/state.html">State</a>
</li>
<li>
<a href="state.state-1.html">State</a>
</li>
</ul>
<h1>Class State</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read the state of the Ellcrys blockchain
on a client.</p>
</div>
<dl class="tsd-comment-tags">
<dt>export</dt>
<dd></dd>
<dt>class</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="namespace.namespace-1.html" class="tsd-signature-type">Namespace</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">State</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="state.state-1.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-inherited tsd-is-private-protected">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="state.state-1.html#client" class="tsd-kind-icon">client</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getaccount" class="tsd-kind-icon">get<wbr>Account</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getaccountnonce" class="tsd-kind-icon">get<wbr>Account<wbr>Nonce</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getbestchain" class="tsd-kind-icon">get<wbr>Best<wbr>Chain</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getblock" class="tsd-kind-icon">get<wbr>Block</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getblockbyhash" class="tsd-kind-icon">get<wbr>Block<wbr>ByHash</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getbranches" class="tsd-kind-icon">get<wbr>Branches</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getdifficulty" class="tsd-kind-icon">get<wbr>Difficulty</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getminedblocks" class="tsd-kind-icon">get<wbr>Mined<wbr>Blocks</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getobjects" class="tsd-kind-icon">get<wbr>Objects</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getorphans" class="tsd-kind-icon">get<wbr>Orphans</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#getreorgs" class="tsd-kind-icon">get<wbr>ReOrgs</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#gettipblock" class="tsd-kind-icon">get<wbr>Tip<wbr>Block</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#gettransaction" class="tsd-kind-icon">get<wbr>Transaction</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#listaccounts" class="tsd-kind-icon">list<wbr>Accounts</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#listtopaccounts" class="tsd-kind-icon">list<wbr>Top<wbr>Accounts</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="state.state-1.html#suggestnonce" class="tsd-kind-icon">suggest<wbr>Nonce</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>State<span class="tsd-signature-symbol">(</span>client<span class="tsd-signature-symbol">: </span><a href="rpcclient.rpcclient-1.html" class="tsd-signature-type">RPCClient</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="state.state-1.html" class="tsd-signature-type">State</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L25">namespaces/state.ts:25</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates an instance of State.</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>client: <a href="rpcclient.rpcclient-1.html" class="tsd-signature-type">RPCClient</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="state.state-1.html" class="tsd-signature-type">State</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-inherited tsd-is-private-protected">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
<a name="client" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagProtected">Protected</span> client</h3>
<div class="tsd-signature tsd-kind-icon">client<span class="tsd-signature-symbol">:</span> <a href="rpcclient.rpcclient-1.html" class="tsd-signature-type">RPCClient</a></div>
<aside class="tsd-sources">
<p>Inherited from <a href="namespace.namespace-1.html">Namespace</a>.<a href="namespace.namespace-1.html#client">client</a></p>
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/namespace.ts#L14">namespaces/namespace.ts:14</a></li>
</ul>
</aside>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getaccount" class="tsd-anchor"></a>
<h3>get<wbr>Account</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Account<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Account</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L191">namespaces/state.ts:191</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a specific account on the network</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>address: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The address of the accounts</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Account</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getaccountnonce" class="tsd-anchor"></a>
<h3>get<wbr>Account<wbr>Nonce</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Account<wbr>Nonce<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L211">namespaces/state.ts:211</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get the nonce of a given address</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>address: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The address whose nonce will be fetched</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getbestchain" class="tsd-anchor"></a>
<h3>get<wbr>Best<wbr>Chain</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Best<wbr>Chain<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Chain</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L308">namespaces/state.ts:308</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get the best chain on the node</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Chain</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getblock" class="tsd-anchor"></a>
<h3>get<wbr>Block</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Block<span class="tsd-signature-symbol">(</span>num<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L44">namespaces/state.ts:44</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a block by number</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>num: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>The block number/height</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getblockbyhash" class="tsd-anchor"></a>
<h3>get<wbr>Block<wbr>ByHash</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Block<wbr>ByHash<span class="tsd-signature-symbol">(</span>blockHash<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L91">namespaces/state.ts:91</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a block by block Hash.</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>blockHash: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The hash of the block.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getbranches" class="tsd-anchor"></a>
<h3>get<wbr>Branches</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Branches<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Branches</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L270">namespaces/state.ts:270</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get all the known branches on the node</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Branches</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getdifficulty" class="tsd-anchor"></a>
<h3>get<wbr>Difficulty</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Difficulty<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Difficulty</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L111">namespaces/state.ts:111</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get the current difficulty and total difficulty
of the network.</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Difficulty</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getminedblocks" class="tsd-anchor"></a>
<h3>get<wbr>Mined<wbr>Blocks</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Mined<wbr>Blocks<span class="tsd-signature-symbol">(</span>opts<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">ArgMindedBlock</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">MinedBlocksResult</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L75">namespaces/state.ts:75</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Fetch blocks mined by the node. It is possible to
limit the results by specifying opts.limit to
a desired number.</p>
</div>
<p>To support pagination, set
opts.lastHash to get only results after a specified
block hash.</p>
<p>Given the possibility that a node may mined blocks
using different coinbase (and public key), use
opts.creatorPubKey to return blocks mined by a
specific public key (or account).</p>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> opts: <span class="tsd-signature-type">ArgMindedBlock</span><span class="tsd-signature-symbol"> = {}</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">MinedBlocksResult</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getobjects" class="tsd-anchor"></a>
<h3>get<wbr>Objects</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Objects<span class="tsd-signature-symbol">(</span>filter<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">JSON</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L328">namespaces/state.ts:328</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns raw db objects (Debug only)</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>filter: <span class="tsd-signature-type">JSON</span></h5>
<div class="tsd-comment tsd-typography">
<p>Filter parameters</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getorphans" class="tsd-anchor"></a>
<h3>get<wbr>Orphans</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Orphans<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L289">namespaces/state.ts:289</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get orphan blocks on the node</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="getreorgs" class="tsd-anchor"></a>
<h3>get<wbr>ReOrgs</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>ReOrgs<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ReOrgInfo</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L151">namespaces/state.ts:151</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a list of re-organization events
that have occurred from the node's
perspective</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ReOrgInfo</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="gettipblock" class="tsd-anchor"></a>
<h3>get<wbr>Tip<wbr>Block</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Tip<wbr>Block<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L347">namespaces/state.ts:347</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Return the block with the highest height or number on the node</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Block</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="gettransaction" class="tsd-anchor"></a>
<h3>get<wbr>Transaction</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">get<wbr>Transaction<span class="tsd-signature-symbol">(</span>txHash<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Transaction</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L251">namespaces/state.ts:251</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a transaction by its hash</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>txHash: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The transaction's hash</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Transaction</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="listaccounts" class="tsd-anchor"></a>
<h3>list<wbr>Accounts</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">list<wbr>Accounts<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Account</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L130">namespaces/state.ts:130</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get all the account on the network</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Account</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="listtopaccounts" class="tsd-anchor"></a>
<h3>list<wbr>Top<wbr>Accounts</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">list<wbr>Top<wbr>Accounts<span class="tsd-signature-symbol">(</span>limit<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Account</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L171">namespaces/state.ts:171</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a list of top accounts on the network.</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>limit: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>The maximum number of top accounts to return</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Account</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="suggestnonce" class="tsd-anchor"></a>
<h3>suggest<wbr>Nonce</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">suggest<wbr>Nonce<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/ellcrys/spell.js/blob/cda6112/src/lib/namespaces/state.ts#L231">namespaces/state.ts:231</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Get a suggestion about the next nonce of an account.</p>
</div>
<dl class="tsd-comment-tags">
<dt>memberof</dt>
<dd><p>State</p>
</dd>
</dl>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>address: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>The address of the account.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Globals</em></a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/auth.html">Auth</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/ell.html">Ell</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/errors.html">Errors</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/index.html">Index</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/key.html">Key</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/logger.html">Logger</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/miner.html">Miner</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/namespace.html">Namespace</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/net.html">Net</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/node.html">Node</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/pool.html">Pool</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/rpc.html">RPC</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/rpcclient.html">RPCClient</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/spell.html">Spell</a>
</li>
<li class="current tsd-kind-external-module">
<a href="../modules/state.html">State</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/transactionbuilder.html">Transaction<wbr>Builder</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/txutility.html">Tx<wbr>Utility</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-class tsd-parent-kind-external-module">
<a href="state.state-1.html" class="tsd-kind-icon">State</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="state.state-1.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
<a href="state.state-1.html#client" class="tsd-kind-icon">client</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getaccount" class="tsd-kind-icon">get<wbr>Account</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getaccountnonce" class="tsd-kind-icon">get<wbr>Account<wbr>Nonce</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getbestchain" class="tsd-kind-icon">get<wbr>Best<wbr>Chain</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getblock" class="tsd-kind-icon">get<wbr>Block</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getblockbyhash" class="tsd-kind-icon">get<wbr>Block<wbr>ByHash</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getbranches" class="tsd-kind-icon">get<wbr>Branches</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getdifficulty" class="tsd-kind-icon">get<wbr>Difficulty</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getminedblocks" class="tsd-kind-icon">get<wbr>Mined<wbr>Blocks</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getobjects" class="tsd-kind-icon">get<wbr>Objects</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getorphans" class="tsd-kind-icon">get<wbr>Orphans</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#getreorgs" class="tsd-kind-icon">get<wbr>ReOrgs</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#gettipblock" class="tsd-kind-icon">get<wbr>Tip<wbr>Block</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#gettransaction" class="tsd-kind-icon">get<wbr>Transaction</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#listaccounts" class="tsd-kind-icon">list<wbr>Accounts</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#listtopaccounts" class="tsd-kind-icon">list<wbr>Top<wbr>Accounts</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="state.state-1.html#suggestnonce" class="tsd-kind-icon">suggest<wbr>Nonce</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
</body>
</html>