<divclass="link title"><ahref="/v5/">Documentation</a></div><divclass="base show link depth-1"><ahref="/v5/getting-started/">Getting Started</a></div><divclass="base show link depth-1"><ahref="/v5/concepts/">Ethereum Basics</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/events/">Events</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/gas/">Gas</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/security/">Security</a></div><divclass="base ancestor show link depth-1"><ahref="/v5/api/">Application Programming Interface</a></div><divclass="show link depth-2"><ahref="/v5/api/contract/">Contract Interaction</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/contract/">Contract</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/contract-factory/">ContractFactory</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/example/">Example: ERC-20 Contract</a></div><divclass="show link depth-2"><ahref="/v5/api/signer/">Signers</a></div><divclass="show link depth-2"><ahref="/v5/api/providers/">Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/provider/">Provider</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/api-providers/">API Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/other/">Other Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/types/">Types</a></div><divclass="ancestor show link depth-2"><ahref="/v5/api/utils/">Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/abi/">Application Binary Interface</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/coder/">AbiCoder</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/formats/">ABI Formats</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/fragments/">Fragments</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/interface/">Interface</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/address/">Addresses</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/bignumber/">BigNumber</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/bytes/">Byte Manipulation</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/constants/">Constants</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/display-logic/">Display Logic and Input</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/encoding/">Encoding Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/fixednumber/">FixedNumber</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/hashing/">Hashing Algorithms</a></div><divclass="myself ancestor ancestor show link depth-3"><ahref="/v5/api/utils/hdnode/">HD Wallet</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/logger/">Logging</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/properties/">Property Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/signing-key/">Signing Key</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/strings/">Strings</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/transactions/">Transactions</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/web/">Web Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/wordlists/">Wordlists</a></div><divclass="show link depth-2"><ahref="/v5/api/other/">Other Libraries</a></div><divclass="hide link depth-3"><ahref="/v5/api/other/assembly/">Assembly</a></div><divclass="hide link depth-4"><ahref="/v5/api/other/assembly/dialect/">Ethers ASM Dialect</a></div><divclass="hide link depth-4"><ahref="/v5/api/other/assembly/api/">Utilities</a></div><divclass="hide link depth-4"><ahref="/v5/api/other/assembly/ast/">Abstract Syntax Tree</a></div><divclass="hide link depth-3"><ahref="/v5/api/other/hardware/">Hardware Wallets</a></div><divclass="sho
<divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">defaultPath</span><spanclass="arrow">⇒</span><spanclass="returns">"m/44'/60'/0'/0/0"</span><divclass="anchors"></div></div><divclass="body"><p>The default path for Ethereum in an HD Wallet</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="path">mnemonic</span><spanclass="symbol">.</span><spanclass="method">phrase</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The mnemonic phrase for this mnemonic. It is 12, 15, 18, 21 or 24 words long and separated by the whitespace specified by the <codeclass="inline">locale</code>.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">mnemonic</span><spanclass="symbol">.</span><spanclass="method">path</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The HD path for this mnemonic.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">mnemonic</span><spanclass="symbol">.</span><spanclass="method">locale</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The language of the wordlist this mnemonic is using.</p>
<aname="HDNode-fromMnemonic"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">HDNode</span><spanclass="symbol">.</span><spanclass="method">fromMnemonic</span><spanclass="symbol">(</span><spanclass="param">phrase</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">password</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">wordlist</span><spanclass="symbol">]</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#HDNode-fromMnemonic"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L262">source</a></div></div><divclass="body"><p>Return the <ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a> for <i>phrase</i> with the optional <i>password</i> and <i>wordlist</i>.</p>
</div></div><aname="HDNode-fromSeed"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">HDNode</span><spanclass="symbol">.</span><spanclass="method">fromSeed</span><spanclass="symbol">(</span><spanclass="param">aBytesLike</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#HDNode-fromSeed"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L277">source</a></div></div><divclass="body"><p>Return the <ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a> for the seed <i>aBytesLike</i>.</p>
</div></div><aname="HDNode-fromExtendedKey"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">HDNode</span><spanclass="symbol">.</span><spanclass="method">fromExtendedKey</span><spanclass="symbol">(</span><spanclass="param">extendedKey</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#HDNode-fromExtendedKey"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L281">source</a></div></div><divclass="body"><p>Return the <ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a> for the <i>extendedKey</i>. If <i>extendedKey</i> was neutered, the <b>HDNode</b> will only be able to compute addresses and not private keys.</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">privateKey</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 32 >></span><divclass="anchors"></div></div><divclass="body"><p>The private key for this HDNode.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">publicKey</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 33 >></span><divclass="anchors"></div></div><divclass="body"><p>The (compresses) public key for this HDNode.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">fingerprint</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 4 >></span><divclass="anchors"></div></div><divclass="body"><p>The fingerprint is meant as an index to quickly match parent and children nodes together, however collisions may occur and software should verify matching nodes.</p>
<p>Most developers will not need to use this.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">parentFingerprint</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 4 >></span><divclass="anchors"></div></div><divclass="body"><p>The fingerprint of the parent node. See <i>fingerprint</i> for more details.</p>
<p>Most developers will not need to use this.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">address</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/address/#address">Address</a>></span><divclass="anchors"></div></div><divclass="body"><p>The address of this HDNode.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">mnemonic</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/hdnode/#Mnemonic">Mnemonic</a></span><divclass="anchors"></div></div><divclass="body"><p>The mnemonic of this HDNode, if known.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">path</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The path of this HDNode, if known. If the <i>mnemonic</i> is also known, this will match <codeclass="inline">mnemonic.path</code>.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">chainCode</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 32 >></span><divclass="anchors"></div></div><divclass="body"><p>The chain code is used as a non-secret private key which is then used with EC-multiply to provide the ability to derive addresses without the private key of child non-hardened nodes.</p>
<p>Most developers will not need to use this.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">index</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The index of this HDNode. This will match the last component of the <i>path</i>.</p>
<p>Most developers will not need to use this.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">depth</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The depth of this HDNode. This will match the number of components (less one, the <codeclass="inline">m/</code>) of the <i>path</i>.</p>
<p>Most developers will not need to use this.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">extendedKey</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>A serialized string representation of this HDNode. Not all properties are included in the serialization, such as the mnemonic and path, so serializing and deserializing (using the <codeclass="inline">fromExtendedKey</code> class method) will result in reduced information.</p>
<aname="HDNode-neuter"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">neuter</span><spanclass="symbol">(</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#HDNode-neuter"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L161">source</a></div></div><divclass="body"><p>Return a new instance of <i>hdNode</i> with its private key removed but all otehr properties preserved. This ensures that the key can not leak the private key of itself or any derived children, but may still be used to compute the addresses of itself and any non-hardened children.</p>
</div></div><aname="HDNode-derivePath"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">hdNode</span><spanclass="symbol">.</span><spanclass="method">derivePath</span><spanclass="symbol">(</span><spanclass="param">path</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#HDNode-derivePath"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L224">source</a></div></div><divclass="body"><p>Return a new <ahref="/v5/api/utils/hdnode/#HDNode">HDNode</a> which is the child of <i>hdNode</i> found by deriving <i>path</i>.</p>
<aname="utils-mnemonicToSeed"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">mnemonicToSeed</span><spanclass="symbol">(</span><spanclass="param">phrase</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">password</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 64 >></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#utils-mnemonicToSeed"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L309">source</a></div></div><divclass="body"><p>Convert a mnemonic phrase to a seed, according to <ahref="https://en.bitcoin.it/wiki/BIP_0039">BIP-39</a>.</p>
</div></div><aname="utils-mnemonicToEntropy"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">mnemonicToEntropy</span><spanclass="symbol">(</span><spanclass="param">phrase</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">wordlist</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>></span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#utils-mnemonicToEntropy"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L317">source</a></div></div><divclass="body"><p>Convert a mnemonic phrase to its entropy, according to <ahref="https://en.bitcoin.it/wiki/BIP_0039">BIP-39</a>.</p>
</div></div><aname="utils-isValidMnemonic"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">isValidMnemonic</span><spanclass="symbol">(</span><spanclass="param">phrase</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">wordlist</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">boolean</span><divclass="anchors"><aclass="self"href="/v5/api/utils/hdnode/#utils-isValidMnemonic"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/hdnode/src.ts/index.ts#L398">source</a></div></div><divclass="body"><p>Returns true if <i>phrase</i> is a valid mnemonic phrase, by testing the checksum.</p>
<divclass="copyright">The content of this site is licensed under the <ahref="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on July 5, 2020, 12:0am.</div>