ethers.js/docs/v4/cookbook.html

277 lines
9.7 KiB
HTML
Raw Permalink Normal View History

2020-06-11 16:29:05 -04:00
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cookbook &mdash; ethers.js 4.0.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/ethers.css" type="text/css" />
<link rel="stylesheet" href="_static/css/ethers.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Accounts" href="cookbook-accounts.html" />
<link rel="prev" title="Low-Level API" href="api-advanced.html" />
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> ethers.js
</a>
<div class="version">
4.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Developer Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="getting-started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">Application Programming Interface (API)</a></li>
<li class="toctree-l1"><a class="reference internal" href="api-advanced.html">Low-Level API</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Cookbook</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html">Accounts</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-contracts.html">Contracts</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-providers.html">Providers</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-signing.html">Signing Messages</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-testing.html">Testing</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-react.html">React Native</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="migration.html">Migration Guides</a></li>
<li class="toctree-l1"><a class="reference internal" href="notes.html">Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="testing.html">Testing</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">ethers.js</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Cookbook</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/cookbook.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="cookbook">
<h1>Cookbook<a class="headerlink" href="#cookbook" title="Permalink to this headline"></a></h1>
<p>This is a small (but growing) collection of simple recipes to perform common tasks
with the Ethereum blockchain and Ethereum accounts.</p>
<p>Some of these recipes are stubs that will be filled in shortly.</p>
<p>If there is a simple recipe you would like added, please send suggestions to <a class="reference external" href="mailto:support&#37;&#52;&#48;ethers&#46;io">support<span>&#64;</span>ethers<span>&#46;</span>io</a>.</p>
<hr class="docutils" />
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="cookbook-accounts.html">Accounts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html#dump-all-json-wallet-balances-in-current-directory">Dump All JSON Wallet Balances (in current directory)</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html#sweep-an-account-into-another">Sweep an Account into Another</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html#coalesce-jaxx-wallets">Coalesce Jaxx Wallets</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html#access-funds-in-a-mnemonic-phrase-wallet">Access Funds in a Mnemonic Phrase Wallet</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html#random-mnemonic">Random Mnemonic</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-accounts.html#get-transaction-history">Get Transaction History</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cookbook-contracts.html">Contracts</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-contracts.html#return-a-value-from-a-state-changing-method">Return a Value from a State-Changing Method</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-contracts.html#economic-incentives-and-economic-value">Economic Incentives and Economic Value</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cookbook-providers.html">Providers</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-providers.html#metamask">MetaMask</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-providers.html#testrpc-ganache">TestRPC / Ganache</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-providers.html#custom-provider">Custom Provider</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cookbook-signing.html">Signing Messages</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-signing.html#signing-a-string-message">Signing a String Message</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-signing.html#signing-a-digest-hash">Signing a Digest Hash</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cookbook-testing.html">Testing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-testing.html#contract-events">Contract Events</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-testing.html#using-multiple-accounts">Using Multiple Accounts</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cookbook-react.html">React Native</a><ul>
<li class="toctree-l2"><a class="reference internal" href="cookbook-react.html#shims">Shims</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-react.html#wordlists">Wordlists</a></li>
<li class="toctree-l2"><a class="reference internal" href="cookbook-react.html#other-notes">Other Notes</a></li>
</ul>
</li>
</ul>
</div>
<hr class="docutils" />
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="cookbook-accounts.html" class="btn btn-neutral float-right" title="Accounts" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="api-advanced.html" class="btn btn-neutral" title="Low-Level API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2016, Richard Moore &lt;me@ricmoo.com&gt;
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>