Updated documents to include ENS.

This commit is contained in:
ricmoo 2017-05-21 20:37:29 -04:00
parent c815166eb5
commit 0d36f839c3
20 changed files with 158 additions and 123 deletions

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 6a62ca43dcc6af574ac04a9f0b9d6b4e
config: 37414eb22e627195a5e1926fb6f4cd20
tags: 645f666f9bcd5a90fca523b33c5a78b7

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Low-Level API &mdash; ethers.js 2.0.0 documentation</title>
<title>Low-Level API &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="next" title="Cookbook" href="cookbook.html"/>
<link rel="prev" title="Utilities" href="api-utils.html"/>
@ -64,7 +64,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -420,7 +420,7 @@ is designed for developers that are sub-classing Provider.</p>
<dt><sup>prototype</sup> . perform ( method , params )</dt>
<dd>The only method needed to override in a subclass. All values are sanitized
and defaults populated in params and the result is sanitized before returning.
Returns a <span class="xref std std-ref">Promise</span>, see the example below for overview of
Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a>, see the example below for overview of
<em>method</em> and <em>params</em>.</dd>
</dl>
</div>
@ -431,7 +431,7 @@ Returns a <span class="xref std std-ref">Promise</span>, see the example below f
<dd>Set up <em>childProvider</em> as an provider, inheriting the parent prototype and
set up a prototype.inherits on the <em>childProvider</em>.</dd>
<dt><sup>Provider</sup> . fetchJSON ( url , body , processFunc )</dt>
<dd>Convenience method for returning a <span class="xref std std-ref">Promise</span> with the result of fetching JSON
<dd>Convenience method for returning a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the result of fetching JSON
from a <em>url</em> with an optional <em>body</em>. The optional <em>processFunc</em> is called on
the parsed JSON before being passed to the Promise&#8217;s resolve. (throwing an error
in the <em>processFunc</em> will cause the Promise to reject)</dd>
@ -728,7 +728,7 @@ invalid RLP-coded data)</dd>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contracts &mdash; ethers.js 2.0.0 documentation</title>
<title>Contracts &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="up" title="Application Programming Interface (API)" href="api.html"/>
<link rel="next" title="Utilities" href="api-utils.html"/>
<link rel="prev" title="Providers API" href="api-providers.html"/>
@ -65,7 +65,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -184,8 +184,8 @@ which is usually generated by a compiler, such as Solidity.</p>
<div class="section" id="connecting-to-a-contract">
<h2>Connecting to a Contract<a class="headerlink" href="#connecting-to-a-contract" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt>new <sup>ethers</sup> . Contract ( address , interface , providerOrSigner )</dt>
<dd><p class="first">Connects to the contract at <em>address</em> defined by <em>interface</em>, which
<dt>new <sup>ethers</sup> . Contract ( addressOrName , interface , providerOrSigner )</dt>
<dd><p class="first">Connects to the contract at <em>addressOrName</em> defined by <em>interface</em>, which
may be a JSON string or the parsed object.</p>
<p>The <em>providerOrSigner</em> may be any instance of the following:</p>
<dl class="last docutils">
@ -207,10 +207,10 @@ transaction occurs and to defer address behaviour.</dd>
<h2>Prototype<a class="headerlink" href="#prototype" title="Permalink to this headline"></a></h2>
<p>The prototype will contain all the methods and events defined in the
<strong>interface</strong>.</p>
<p>The result of all contant methods are a <span class="xref std std-ref">Promise</span> which
<p>The result of all contant methods are a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> which
resolve to the result as a tuple, optionally with the parameters
accessible by name, if named in the ABI.</p>
<p>The result of all non-constant methods are a <span class="xref std std-ref">Promise</span>
<p>The result of all non-constant methods are a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a>
which resolve to the <a class="reference internal" href="api-providers.html#transactionrequest"><span class="std std-ref">transaction</span></a> that
was sent to the network.</p>
<p>Name collisions with the built-in properties (below) will not be overwritten.
@ -222,7 +222,7 @@ function with a given name will be available. (In the future this will
be addressed by adding parameter explicit calls).</p>
<dl class="docutils">
<dt><sup>prototype</sup> . address</dt>
<dd>The address of the contract.</dd>
<dd>The address (or ENS name) of the contract.</dd>
<dt><sup>prototype</sup> . interface</dt>
<dd>The <a class="reference internal" href="api-advanced.html#api-interface"><span class="std std-ref">Interface</span></a> meta-class of the parsed
ABI. Generally, this should not need to be accessed directly.</dd>
@ -477,7 +477,7 @@ deferring the address, signing and sending transactions.</p>
<dl class="docutils">
<dt><sup>object</sup> . getAddress()</dt>
<dd><p class="first"><em>Required.</em></p>
<p class="last">Which must return a valid address or a <span class="xref std std-ref">Promise</span> which will resolve to a valid
<p class="last">Which must return a valid address or a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> which will resolve to a valid
address or reject an error.</p>
</dd>
<dt><sup>object</sup> . provider</dt>
@ -489,14 +489,14 @@ calls, listen for events and possibly send transaction.</p>
<dd><p class="first"><em>Optional.</em></p>
<p>If this is not defined, the provider is queries directly, after populating
the address using <em>getAddress()</em>.</p>
<p class="last">The result must be a <span class="xref std std-ref">Promise</span> which resolves to the
<p class="last">The result must be a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> which resolves to the
<a class="reference internal" href="api-utils.html#bignumber"><span class="std std-ref">BigNumber</span></a> estimated gas cost.</p>
</dd>
<dt><sup>object</sup> . sendTransaction ( transaction )</dt>
<dd><p class="first"><em>Optional.</em></p>
<p>If this is defined, it is called instead of sign and is expected to
populate <em>nonce</em>, <em>gasLimit</em> and <em>gasPrice</em>.</p>
<p class="last">The result must be a <span class="xref std std-ref">Promise</span> which resolves to the sent transaction, or
<p class="last">The result must be a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> which resolves to the sent transaction, or
rejects on failure.</p>
</dd>
<dt><sup>object</sup> . sign ( transaction )</dt>
@ -591,7 +591,7 @@ provider to send it to the network.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Providers API &mdash; ethers.js 2.0.0 documentation</title>
<title>Providers API &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="up" title="Application Programming Interface (API)" href="api.html"/>
<link rel="next" title="Contracts" href="api-contract.html"/>
<link rel="prev" title="Wallets" href="api-wallet.html"/>
@ -65,7 +65,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -286,7 +286,7 @@ the providers attached)</dd>
<dd>The JSON-RPC URL the provider is connected to</dd>
<dt><sup>prototype</sup> . send ( method , params )</dt>
<dd>Send the JSON-RPC <em>method</em> with <em>params</em>. This is useful for calling
non-standard or less common JSON-RPC methods. A <span class="xref std std-ref">Promise</span> is
non-standard or less common JSON-RPC methods. A <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> is
returned which will resolve to the parsed JSON result.</dd>
</dl>
</div>
@ -309,17 +309,20 @@ returned which will resolve to the parsed JSON result.</dd>
<div class="section" id="account-actions">
<h2>Account Actions<a class="headerlink" href="#account-actions" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt><sup>prototype</sup> . getBalance ( address [ , blockTag ] )</dt>
<dd><p class="first">Returns a <span class="xref std std-ref">Promise</span> with the balance (as a <a class="reference internal" href="api-utils.html#bignumber"><span class="std std-ref">BigNumber</span></a>) of
<em>address</em> at <em>blockTag</em>. (See: <a class="reference external" href="blocktag">Block Tags</a>)</p>
<dt><sup>prototype</sup> . getBalance ( addressOrName [ , blockTag ] )</dt>
<dd><p class="first">Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the balance (as a <a class="reference internal" href="api-utils.html#bignumber"><span class="std std-ref">BigNumber</span></a>) of
<em>addressOrName</em> at <em>blockTag</em>. (See: <a class="reference external" href="blocktag">Block Tags</a>)</p>
<p class="last"><strong>default:</strong> <em>blockTag</em>=&#8221;latest&#8221;</p>
</dd>
<dt><sup>prototype</sup> . getTransactionCount ( address [ , blockTag ] )</dt>
<dd><p class="first">Returns a <span class="xref std std-ref">Promise</span> with the number of sent transactions (as a Number) from
<em>address</em> at <em>blockTag</em>. This is also the nonce required to send a new
<dt><sup>prototype</sup> . getTransactionCount ( addressOrName [ , blockTag ] )</dt>
<dd><p class="first">Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the number of sent transactions (as a Number) from
<em>addressOrName</em> at <em>blockTag</em>. This is also the nonce required to send a new
transaction. (See: <a class="reference external" href="blocktag">Block Tags</a>)</p>
<p class="last"><strong>default:</strong> <em>blockTag</em>=&#8221;latest&#8221;</p>
</dd>
<dt><sup>prototype</sup> . resolveName ( ensName )</dt>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the address (or null) of that the <em>ensName</em> resolves
to.</dd>
</dl>
<div class="section" id="id3">
<h3><em>Examples</em><a class="headerlink" href="#id3" title="Permalink to this headline"></a></h3>
@ -338,6 +341,10 @@ transaction. (See: <a class="reference external" href="blocktag">Block Tags</a>)
<span class="n">provider</span><span class="o">.</span><span class="n">getTransactionCount</span><span class="p">(</span><span class="n">address</span><span class="p">)</span><span class="o">.</span><span class="n">then</span><span class="p">(</span><span class="n">function</span><span class="p">(</span><span class="n">transactionCount</span><span class="p">)</span> <span class="p">{</span>
<span class="n">console</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="s2">&quot;Total Transactions Ever Send: &quot;</span> <span class="o">+</span> <span class="n">transactionCount</span><span class="p">);</span>
<span class="p">});</span>
<span class="n">provider</span><span class="o">.</span><span class="n">resolveName</span><span class="p">(</span><span class="s2">&quot;test.ricmoose.eth&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">then</span><span class="p">(</span><span class="n">function</span><span class="p">(</span><span class="n">address</span><span class="p">)</span> <span class="p">{</span>
<span class="n">console</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="s2">&quot;Address: &quot;</span> <span class="o">+</span> <span class="n">address</span><span class="p">);</span>
<span class="p">});</span>
</pre></div>
</div>
</div>
@ -347,15 +354,15 @@ transaction. (See: <a class="reference external" href="blocktag">Block Tags</a>)
<h2>Blockchain Status<a class="headerlink" href="#blockchain-status" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt><sup>prototype</sup> . getBlockNumber ( )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the latest block number (as a Number).</dd>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the latest block number (as a Number).</dd>
<dt><sup>prototype</sup> . getGasPrice ( )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the current gas price (as a <a class="reference internal" href="api-utils.html#bignumber"><span class="std std-ref">BigNumber</span></a>).</dd>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the current gas price (as a <a class="reference internal" href="api-utils.html#bignumber"><span class="std std-ref">BigNumber</span></a>).</dd>
<dt><sup>prototype</sup> . getBlock ( blockHashOrBlockNumber )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the block at <em>blockHashorBlockNumber</em>. (See: <a class="reference external" href="blockresponse">Block Responses</a>)</dd>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the block at <em>blockHashorBlockNumber</em>. (See: <a class="reference external" href="blockresponse">Block Responses</a>)</dd>
<dt><sup>prototype</sup> . getTransaction ( transactionHash )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the transaction with <em>transactionHash</em>. (See: <a class="reference external" href="transactionresult">Transaction Results</a>)</dd>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the transaction with <em>transactionHash</em>. (See: <a class="reference external" href="transactionresult">Transaction Results</a>)</dd>
<dt><sup>prototype</sup> . getTransactionReceipt ( transactionHash )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the transaction receipt with <em>transactionHash</em>.
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the transaction receipt with <em>transactionHash</em>.
(See: <a class="reference external" href="transactionReceipts">Transaction Receipts</a>)</dd>
</dl>
<div class="section" id="id4">
@ -414,19 +421,19 @@ usually be used instead.</p>
<dl class="docutils">
<dt><sup>prototype</sup> . call ( transaction )</dt>
<dd><p class="first">Send the <strong>read-only</strong> (constant) <em>transaction</em> to a single Ethereum node and
return a <span class="xref std std-ref">Promise</span> with the result (as a <a class="reference internal" href="api-utils.html#hexstring"><span class="std std-ref">hex string</span></a>) of executing it.
return a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the result (as a <a class="reference internal" href="api-utils.html#hexstring"><span class="std std-ref">hex string</span></a>) of executing it.
(See <a class="reference external" href="transactionrequest">Transaction Requests</a>)</p>
<p class="last">This is free, since it does not change any state on the blockchain.</p>
</dd>
<dt><sup>prototype</sup> . estimateGas ( transaction )</dt>
<dd><p class="first">Send a <em>transaction</em> to a single Ethereum node and return a <span class="xref std std-ref">Promise</span> with the
<dd><p class="first">Send a <em>transaction</em> to a single Ethereum node and return a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the
estimated amount of gas required (as a <a class="reference internal" href="api-utils.html#bignumber"><span class="std std-ref">BigNumber</span></a>) to send it.
(See <a class="reference external" href="transactionrequest">Transaction Requests</a>)</p>
<p class="last">This is free, but only an estimate. Providing too little gas will result in a
transaction being rejected (while still consuming all provided gas).</p>
</dd>
<dt><sup>prototype</sup> . sendTransaction ( signedTransaction )</dt>
<dd><p class="first">Send the <em>signedTransaction</em> to the <strong>entire</strong> Ethereum network and returns a <span class="xref std std-ref">Promise</span>
<dd><p class="first">Send the <em>signedTransaction</em> to the <strong>entire</strong> Ethereum network and returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a>
with the transaction hash.</p>
<p class="last"><strong>This will consume gas</strong> from the account that signed the transaction.</p>
</dd>
@ -442,15 +449,16 @@ with the transaction hash.</p>
<div class="section" id="contract-state">
<h2>Contract State<a class="headerlink" href="#contract-state" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt><sup>prototype</sup> . getCode ( address )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the bytecode (as a <a class="reference internal" href="api-utils.html#hexstring"><span class="std std-ref">hex string</span></a>) at <em>address</em>.</dd>
<dt><sup>prototype</sup> . getStorageAt ( address, position [ , blockTag ] )</dt>
<dd><p class="first">Returns a <span class="xref std std-ref">Promise</span> with the value (as a <a class="reference internal" href="api-utils.html#hexstring"><span class="std std-ref">hex string</span></a>) at <em>address</em> in
<em>position</em> at <em>blockTag</em>. (See <a class="reference external" href="blocktag">Block Tags</a>)</p>
<dt><sup>prototype</sup> . getCode ( addressOrName )</dt>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the bytecode (as a <a class="reference internal" href="api-utils.html#hexstring"><span class="std std-ref">hex string</span></a>)
at <em>addressOrName</em>.</dd>
<dt><sup>prototype</sup> . getStorageAt ( addressOrName, position [ , blockTag ] )</dt>
<dd><p class="first">Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the value (as a <a class="reference internal" href="api-utils.html#hexstring"><span class="std std-ref">hex string</span></a>) at
<em>addressOrName</em> in <em>position</em> at <em>blockTag</em>. (See <a class="reference external" href="blocktag">Block Tags</a>)</p>
<p class="last">default: <em>blockTag</em>= &#8220;latest&#8221;</p>
</dd>
<dt><sup>prototype</sup> . getLogs ( filter )</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with an array (possibly empty) of the logs that
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with an array (possibly empty) of the logs that
match the <em>filter</em>. (See <a class="reference external" href="filter">Filters</a>)</dd>
</dl>
<div class="section" id="id8">
@ -486,6 +494,11 @@ total number of callbacks registered</dd>
<dd><p class="first">Whenever a new block is mined</p>
<p class="last"><code class="docutils literal"><span class="pre">callback(</span> <span class="pre">blockNumber</span> <span class="pre">)</span></code></p>
</dd>
<dt>any address</dt>
<dd><p class="first">When the balance of the coresposding address changes.</p>
<blockquote class="last">
<div><code class="docutils literal"><span class="pre">callback(</span> <span class="pre">balance</span> <span class="pre">)</span></code></div></blockquote>
</dd>
<dt>any transaction hash</dt>
<dd><p class="first">When the coresponding transaction is mined; also see
<a class="reference external" href="waitForTransaction">Waiting for Transactions</a></p>
@ -502,7 +515,7 @@ total number of callbacks registered</dd>
<span id="id9"></span><h3>Waiting for Transactions<a class="headerlink" href="#waitfortransaction" title="Permalink to this headline"></a></h3>
<dl class="docutils">
<dt><sup>prototype</sup> . waitForTransaction ( transachtionHash [ , timeout ] )</dt>
<dd>Return a <span class="xref std std-ref">Promise</span> which returns the transaction once <em>transactionHash</em> is
<dd>Return a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> which returns the transaction once <em>transactionHash</em> is
mined, with an optional <em>timeout</em> (in milliseconds)</dd>
</dl>
</div>
@ -513,6 +526,10 @@ mined, with an optional <em>timeout</em> (in milliseconds)</dd>
<span class="n">console</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="s1">&#39;New Block: &#39;</span> <span class="o">+</span> <span class="n">blockNumber</span><span class="p">);</span>
<span class="p">});</span>
<span class="o">//</span> <span class="n">Get</span> <span class="n">notified</span> <span class="n">on</span> <span class="n">account</span> <span class="n">balance</span> <span class="n">change</span>
<span class="n">provider</span><span class="o">.</span><span class="n">on</span><span class="p">(</span><span class="s1">&#39;0x46Fa84b9355dB0708b6A57cd6ac222950478Be1d&#39;</span><span class="p">,</span> <span class="n">function</span><span class="p">(</span><span class="n">blockNumber</span><span class="p">)</span> <span class="p">{</span>
<span class="n">console</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="s1">&#39;New Block: &#39;</span> <span class="o">+</span> <span class="n">blockNumber</span><span class="p">);</span>
<span class="p">});</span>
<span class="o">//</span> <span class="n">Get</span> <span class="n">notified</span> <span class="n">when</span> <span class="n">a</span> <span class="n">transaction</span> <span class="ow">is</span> <span class="n">mined</span>
<span class="n">provider</span><span class="o">.</span><span class="n">once</span><span class="p">(</span><span class="n">transactionHash</span><span class="p">,</span> <span class="n">function</span><span class="p">(</span><span class="n">transction</span><span class="p">)</span> <span class="p">{</span>
@ -585,17 +602,17 @@ or <a class="reference internal" href="api-utils.html#hexstring"><span class="st
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">//</span> <span class="n">Example</span><span class="p">:</span>
<span class="p">{</span>
<span class="o">//</span> <span class="n">Required</span> <span class="n">unless</span> <span class="n">deploying</span> <span class="n">a</span> <span class="n">contract</span> <span class="p">(</span><span class="ow">in</span> <span class="n">which</span> <span class="n">case</span> <span class="n">omit</span><span class="p">)</span>
<span class="n">to</span><span class="p">:</span> <span class="n">address</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">target</span> <span class="n">address</span>
<span class="n">to</span><span class="p">:</span> <span class="n">addressOrName</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">target</span> <span class="n">address</span> <span class="ow">or</span> <span class="n">ENS</span> <span class="n">name</span>
<span class="o">//</span> <span class="n">These</span> <span class="n">are</span> <span class="n">optional</span><span class="o">/</span><span class="n">meaningless</span> <span class="k">for</span> <span class="n">call</span> <span class="ow">and</span> <span class="n">estimateGas</span>
<span class="n">nonce</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">transaction</span> <span class="n">nonce</span>
<span class="n">gasLimit</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">maximum</span> <span class="n">gas</span> <span class="n">this</span> <span class="n">transaction</span> <span class="n">may</span> <span class="n">spend</span>
<span class="n">gasPrice</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">price</span> <span class="p">(</span><span class="ow">in</span> <span class="n">wei</span><span class="p">)</span> <span class="n">per</span> <span class="n">unit</span> <span class="n">of</span> <span class="n">gas</span>
<span class="n">nonce</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">transaction</span> <span class="n">nonce</span>
<span class="n">gasLimit</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">maximum</span> <span class="n">gas</span> <span class="n">this</span> <span class="n">transaction</span> <span class="n">may</span> <span class="n">spend</span>
<span class="n">gasPrice</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">price</span> <span class="p">(</span><span class="ow">in</span> <span class="n">wei</span><span class="p">)</span> <span class="n">per</span> <span class="n">unit</span> <span class="n">of</span> <span class="n">gas</span>
<span class="o">//</span> <span class="n">These</span> <span class="n">are</span> <span class="n">always</span> <span class="n">optional</span> <span class="p">(</span><span class="n">but</span> <span class="k">for</span> <span class="n">call</span><span class="p">,</span> <span class="n">data</span> <span class="ow">is</span> <span class="n">usually</span> <span class="n">specified</span><span class="p">)</span>
<span class="n">data</span><span class="p">:</span> <span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="o">//</span> <span class="n">extra</span> <span class="n">data</span> <span class="k">for</span> <span class="n">the</span> <span class="n">transaction</span><span class="p">,</span> <span class="ow">or</span> <span class="nb">input</span> <span class="k">for</span> <span class="n">call</span>
<span class="n">value</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">amount</span> <span class="p">(</span><span class="ow">in</span> <span class="n">wei</span><span class="p">)</span> <span class="n">this</span> <span class="n">transaction</span> <span class="ow">is</span> <span class="n">sending</span>
<span class="n">chainId</span><span class="p">:</span> <span class="mi">3</span> <span class="o">//</span> <span class="n">the</span> <span class="n">network</span> <span class="n">ID</span><span class="p">;</span> <span class="n">usually</span> <span class="n">added</span> <span class="n">by</span> <span class="n">a</span> <span class="n">signer</span>
<span class="n">data</span><span class="p">:</span> <span class="s2">&quot;0x&quot;</span><span class="p">,</span> <span class="o">//</span> <span class="n">extra</span> <span class="n">data</span> <span class="k">for</span> <span class="n">the</span> <span class="n">transaction</span><span class="p">,</span> <span class="ow">or</span> <span class="nb">input</span> <span class="k">for</span> <span class="n">call</span>
<span class="n">value</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span> <span class="o">//</span> <span class="n">the</span> <span class="n">amount</span> <span class="p">(</span><span class="ow">in</span> <span class="n">wei</span><span class="p">)</span> <span class="n">this</span> <span class="n">transaction</span> <span class="ow">is</span> <span class="n">sending</span>
<span class="n">chainId</span><span class="p">:</span> <span class="mi">3</span> <span class="o">//</span> <span class="n">the</span> <span class="n">network</span> <span class="n">ID</span><span class="p">;</span> <span class="n">usually</span> <span class="n">added</span> <span class="n">by</span> <span class="n">a</span> <span class="n">signer</span>
<span class="p">}</span>
</pre></div>
</div>
@ -683,8 +700,8 @@ for the vast majority of filters, a single topic is usually sufficient (see the
<span class="n">fromBlock</span><span class="p">:</span> <span class="s2">&quot;latest&quot;</span><span class="p">,</span>
<span class="n">toBlock</span><span class="p">:</span> <span class="s2">&quot;latest&quot;</span><span class="p">,</span>
<span class="o">//</span> <span class="n">Optional</span><span class="p">;</span> <span class="n">An</span> <span class="n">address</span> <span class="n">to</span> <span class="nb">filter</span> <span class="n">by</span>
<span class="n">address</span><span class="p">:</span> <span class="n">address</span><span class="p">,</span>
<span class="o">//</span> <span class="n">Optional</span><span class="p">;</span> <span class="n">An</span> <span class="n">address</span> <span class="p">(</span><span class="ow">or</span> <span class="n">ENS</span> <span class="n">name</span><span class="p">)</span> <span class="n">to</span> <span class="nb">filter</span> <span class="n">by</span>
<span class="n">address</span><span class="p">:</span> <span class="n">addressOrName</span><span class="p">,</span>
<span class="o">//</span> <span class="n">Optional</span><span class="p">;</span> <span class="n">A</span> <span class="p">(</span><span class="n">possibly</span> <span class="n">nested</span><span class="p">)</span> <span class="nb">list</span> <span class="n">of</span> <span class="n">topics</span>
<span class="n">topics</span><span class="p">:</span> <span class="p">[</span> <span class="n">topic1</span> <span class="p">]</span>
@ -698,7 +715,7 @@ for the vast majority of filters, a single topic is usually sufficient (see the
<h2>Provider Specific Extra API Calls<a class="headerlink" href="#provider-specific-extra-api-calls" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt><sup>EtherscanProvider</sup> . getEtherPrice()</dt>
<dd>Returns a <span class="xref std std-ref">Promise</span> with the price of ether in USD.</dd>
<dd>Returns a <a class="reference internal" href="notes.html#promise"><span class="std std-ref">Promise</span></a> with the price of ether in USD.</dd>
</dl>
<div class="section" id="id16">
<h3><em>Examples</em><a class="headerlink" href="#id16" title="Permalink to this headline"></a></h3>
@ -753,7 +770,7 @@ for the vast majority of filters, a single topic is usually sufficient (see the
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Utilities &mdash; ethers.js 2.0.0 documentation</title>
<title>Utilities &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="up" title="Application Programming Interface (API)" href="api.html"/>
<link rel="next" title="Low-Level API" href="api-advanced.html"/>
<link rel="prev" title="Contracts" href="api-contract.html"/>
@ -65,7 +65,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -518,7 +518,7 @@ defined)</dd>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wallets &mdash; ethers.js 2.0.0 documentation</title>
<title>Wallets &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="up" title="Application Programming Interface (API)" href="api.html"/>
<link rel="next" title="Providers API" href="api-providers.html"/>
<link rel="prev" title="Application Programming Interface (API)" href="api.html"/>
@ -65,7 +65,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -354,8 +354,8 @@ in <strong>wei</strong>) at the <a class="reference internal" href="api-provider
<dd>Sends the <em>transaction</em> to the network and returns a Promise with the transaction
details. It is highly recommended to omit <em>transaction.chainId</em>, it will be
filled in by <em>provider</em>.</dd>
<dt><sup>prototype</sup> . send ( address, amountWei [ , options ] )</dt>
<dd>Sends <em>amountWei</em> to <em>address</em> on the network and returns a Promise with the
<dt><sup>prototype</sup> . send ( addressOrName, amountWei [ , options ] )</dt>
<dd>Sends <em>amountWei</em> to <em>addressOrName</em> on the network and returns a Promise with the
transaction details.</dd>
</dl>
<div class="section" id="id2">
@ -539,7 +539,7 @@ transaction details.</dd>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Application Programming Interface (API) &mdash; ethers.js 2.0.0 documentation</title>
<title>Application Programming Interface (API) &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="next" title="Wallets" href="api-wallet.html"/>
<link rel="prev" title="Getting Started" href="getting-started.html"/>
@ -64,7 +64,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -231,7 +231,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cookbook &mdash; ethers.js 2.0.0 documentation</title>
<title>Cookbook &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="next" title="Notes" href="notes.html"/>
<link rel="prev" title="Low-Level API" href="api-advanced.html"/>
@ -64,7 +64,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -426,7 +426,7 @@ through to INFURA, but dump all data going back and forth.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; ethers.js 2.0.0 documentation</title>
<title>Index &mdash; ethers.js 2.1.0 documentation</title>
@ -35,7 +35,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
@ -63,7 +63,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -173,7 +173,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Getting Started &mdash; ethers.js 2.0.0 documentation</title>
<title>Getting Started &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="next" title="Application Programming Interface (API)" href="api.html"/>
<link rel="prev" title="What is ethers.js" href="index.html"/>
@ -64,7 +64,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -212,7 +212,7 @@ distribution network) should suffice:</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>What is ethers.js &mdash; ethers.js 2.0.0 documentation</title>
<title>What is ethers.js &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="#"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="#"/>
<link rel="next" title="Getting Started" href="getting-started.html"/>
@ -63,7 +63,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -307,7 +307,7 @@ the owners machine at all times.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Notes &mdash; ethers.js 2.0.0 documentation</title>
<title>Notes &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="next" title="Testing" href="testing.html"/>
<link rel="prev" title="Cookbook" href="cookbook.html"/>
@ -64,7 +64,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -177,6 +177,7 @@ which can have mathematical operations handeled safely.</p>
<span id="promise"></span><h2>Promises<a class="headerlink" href="#promises" title="Permalink to this headline"></a></h2>
<p>A <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise in JavaScript</a> is an object which simplifies many aspects of dealing with
asynchronous functions.</p>
<p>It allows a pending result to be treated in many ways as if it has already been resolved.</p>
<p>The most useful operations you will need are:</p>
<dl class="docutils">
<dt><sup>Promise</sup> . all ( promises )</dt>
@ -342,7 +343,7 @@ alphanumeric characters (instead of the standard 30).</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

Binary file not shown.

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; ethers.js 2.0.0 documentation</title>
<title>Search &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
@ -62,7 +62,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -176,7 +176,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

File diff suppressed because one or more lines are too long

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Testing &mdash; ethers.js 2.0.0 documentation</title>
<title>Testing &mdash; ethers.js 2.1.0 documentation</title>
@ -34,7 +34,7 @@
<link rel="top" title="ethers.js 2.0.0 documentation" href="index.html"/>
<link rel="top" title="ethers.js 2.1.0 documentation" href="index.html"/>
<link rel="prev" title="Notes" href="notes.html"/>
@ -63,7 +63,7 @@
<div class="version">
2.0.0
2.1.0
</div>
@ -191,7 +191,7 @@ generate and are too large to check into GitHub)</dd>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true

@ -22,8 +22,8 @@ To better see this demonstrated, see the `example`_ below.
Connecting to a Contract
========================
new :sup:`ethers` . Contract ( address , interface , providerOrSigner )
Connects to the contract at *address* defined by *interface*, which
new :sup:`ethers` . Contract ( addressOrName , interface , providerOrSigner )
Connects to the contract at *addressOrName* defined by *interface*, which
may be a JSON string or the parsed object.
The *providerOrSigner* may be any instance of the following:
@ -66,7 +66,7 @@ function with a given name will be available. (In the future this will
be addressed by adding parameter explicit calls).
:sup:`prototype` . address
The address of the contract.
The address (or ENS name) of the contract.
:sup:`prototype` . interface
The :ref:`Interface <api-interface>` meta-class of the parsed

@ -126,19 +126,22 @@ InfuraProvider :sup:`( inherits from JsonRpcProvider )`
Account Actions
===============
:sup:`prototype` . getBalance ( address [ , blockTag ] )
:sup:`prototype` . getBalance ( addressOrName [ , blockTag ] )
Returns a :ref:`Promise <promise>` with the balance (as a :ref:`BigNumber <bignumber>`) of
*address* at *blockTag*. (See: `Block Tags <blocktag>`_)
*addressOrName* at *blockTag*. (See: `Block Tags <blocktag>`_)
**default:** *blockTag*\ ="latest"
:sup:`prototype` . getTransactionCount ( address [ , blockTag ] )
:sup:`prototype` . getTransactionCount ( addressOrName [ , blockTag ] )
Returns a :ref:`Promise <promise>` with the number of sent transactions (as a Number) from
*address* at *blockTag*. This is also the nonce required to send a new
*addressOrName* at *blockTag*. This is also the nonce required to send a new
transaction. (See: `Block Tags <blocktag>`_)
**default:** *blockTag*\ ="latest"
:sup:`prototype` . resolveName ( ensName )
Returns a :ref:`Promise <promise>` with the address (or null) of that the *ensName* resolves
to.
*Examples*
----------
@ -161,6 +164,10 @@ Account Actions
console.log("Total Transactions Ever Send: " + transactionCount);
});
provider.resolveName("test.ricmoose.eth").then(function(address) {
console.log("Address: " + address);
});
-----
Blockchain Status
@ -271,12 +278,13 @@ usually be used instead.
Contract State
==============
:sup:`prototype` . getCode ( address )
Returns a :ref:`Promise <promise>` with the bytecode (as a :ref:`hex string <hexstring>`) at *address*.
:sup:`prototype` . getCode ( addressOrName )
Returns a :ref:`Promise <promise>` with the bytecode (as a :ref:`hex string <hexstring>`)
at *addressOrName*.
:sup:`prototype` . getStorageAt ( address, position [ , blockTag ] )
Returns a :ref:`Promise <promise>` with the value (as a :ref:`hex string <hexstring>`) at *address* in
*position* at *blockTag*. (See `Block Tags <blocktag>`_)
:sup:`prototype` . getStorageAt ( addressOrName, position [ , blockTag ] )
Returns a :ref:`Promise <promise>` with the value (as a :ref:`hex string <hexstring>`) at
*addressOrName* in *position* at *blockTag*. (See `Block Tags <blocktag>`_)
default: *blockTag*\ = "latest"
@ -324,6 +332,11 @@ Event Types
``callback( blockNumber )``
any address
When the balance of the coresposding address changes.
``callback( balance )``
any transaction hash
When the coresponding transaction is mined; also see
`Waiting for Transactions <waitForTransaction>`_
@ -355,6 +368,10 @@ Waiting for Transactions
console.log('New Block: ' + blockNumber);
});
// Get notified on account balance change
provider.on('0x46Fa84b9355dB0708b6A57cd6ac222950478Be1d', function(blockNumber) {
console.log('New Block: ' + blockNumber);
});
// Get notified when a transaction is mined
provider.once(transactionHash, function(transction) {
@ -439,17 +456,17 @@ or :ref:`hex string <hexstring>`.
// Example:
{
// Required unless deploying a contract (in which case omit)
to: address, // the target address
to: addressOrName, // the target address or ENS name
// These are optional/meaningless for call and estimateGas
nonce: 0, // the transaction nonce
gasLimit: 0, // the maximum gas this transaction may spend
gasPrice: 0, // the price (in wei) per unit of gas
nonce: 0, // the transaction nonce
gasLimit: 0, // the maximum gas this transaction may spend
gasPrice: 0, // the price (in wei) per unit of gas
// These are always optional (but for call, data is usually specified)
data: "0x", // extra data for the transaction, or input for call
value: 0, // the amount (in wei) this transaction is sending
chainId: 3 // the network ID; usually added by a signer
data: "0x", // extra data for the transaction, or input for call
value: 0, // the amount (in wei) this transaction is sending
chainId: 3 // the network ID; usually added by a signer
}
@ -549,8 +566,8 @@ The *EtherscanProvider* only supports a single topic.
fromBlock: "latest",
toBlock: "latest",
// Optional; An address to filter by
address: address,
// Optional; An address (or ENS name) to filter by
address: addressOrName,
// Optional; A (possibly nested) list of topics
topics: [ topic1 ]

@ -216,8 +216,8 @@ These operations require the wallet have a provider attached to it.
details. It is highly recommended to omit *transaction.chainId*, it will be
filled in by *provider*.
:sup:`prototype` . send ( address, amountWei [ , options ] )
Sends *amountWei* to *address* on the network and returns a Promise with the
:sup:`prototype` . send ( addressOrName, amountWei [ , options ] )
Sends *amountWei* to *addressOrName* on the network and returns a Promise with the
transaction details.
*Examples*

@ -59,9 +59,9 @@ author = u'Richard Moore <me@ricmoo.com>'
# built documents.
#
# The short X.Y version.
version = u'2.0.0'
version = u'2.1.0'
# The full version, including alpha/beta/rc tags.
release = u'2.0.0'
release = u'2.1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.