<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="hide link depth-2"><ahref="/v5/concepts/best-practices/">Best Practices</a></div><divclass="base show link depth-1"><ahref="/v5/api-keys/">Provider API Keys</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/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="show link depth-2"><ahref="/v5/api/signer/">Signers</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="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="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="myself ancestor ancestor 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="hidelinkde
<aname="utils-fetchJson"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">fetchJson</span><spanclass="symbol">(</span><spanclass="param">urlOrConnectionInfo</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">json</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">processFunc</span><spanclass="symbol">]</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">Promise< any ></span><divclass="anchors"><aclass="self"href="/v5/api/utils/web/#utils-fetchJson"></a></div></div><divclass="body"><p>Fetch and parse the JSON content from <i>urlOrConnectionInfo</i>, with the optional body <i>json</i> and optionally processing the result with <i>processFun</i> before returning it.</p>
</div></div><aname="utils-poll"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">poll</span><spanclass="symbol">(</span><spanclass="param">pollFunc</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">options</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">Promise< any ></span><divclass="anchors"><aclass="self"href="/v5/api/utils/web/#utils-poll"></a></div></div><divclass="body"><p>Repeatedly call pollFunc using the <ahref="/v5/api/utils/web/#PollOptions">PollOptions</a> until it returns a value other than undefined.</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="path">connection</span><spanclass="symbol">.</span><spanclass="method">url</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The URL to connect to.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">connection</span><spanclass="symbol">.</span><spanclass="method">user</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The username to use for <ahref="https://en.wikipedia.org/wiki/Basic_access_authentication">Basic Authentication</a>. The default is null (i.e. do not use basic authentication)</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">connection</span><spanclass="symbol">.</span><spanclass="method">password</span><spanclass="arrow">⇒</span><spanclass="returns">string</span><divclass="anchors"></div></div><divclass="body"><p>The password to use for <ahref="https://en.wikipedia.org/wiki/Basic_access_authentication">Basic Authentication</a>. The default is null (i.e. do not use basic authentication)</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">connection</span><spanclass="symbol">.</span><spanclass="method">allowInsecureAuthentication</span><spanclass="arrow">⇒</span><spanclass="returns">boolean</span><divclass="anchors"></div></div><divclass="body"><p>Allow <ahref="https://en.wikipedia.org/wiki/Basic_access_authentication">Basic Authentication</a> over non-secure HTTP. The default is false.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">connection</span><spanclass="symbol">.</span><spanclass="method">timeout</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>How long to wait before rejecting with a <i>timeout</i> error.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">connection</span><spanclass="symbol">.</span><spanclass="method">headers</span><spanclass="arrow">⇒</span><spanclass="returns">{[key:string]:string}</span><divclass="anchors"></div></div><divclass="body"><p>Additional headers to include in the connection.</p>
<divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">timeout</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The amount of time allowed to elapse before triggering a timeout error.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">floor</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The minimum time limit to allow for <ahref="https://en.wikipedia.org/wiki/Exponential_backoff">Exponential Backoff</a>.</p>
<p>The default is 0s.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">ceiling</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The maximum time limit to allow for <ahref="https://en.wikipedia.org/wiki/Exponential_backoff">Exponential Backoff</a>.</p>
<p>The default is 10s.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">interval</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The interval used during <ahref="https://en.wikipedia.org/wiki/Exponential_backoff">Exponential Backoff</a> calculation.</p>
<p>The default is 250ms.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">retryLimit</span><spanclass="arrow">⇒</span><spanclass="returns">number</span><divclass="anchors"></div></div><divclass="body"><p>The number of times to retry in the event of an error or <i>undefined</i> is returned.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">onceBlock</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/providers/provider/">Provider</a></span><divclass="anchors"></div></div><divclass="body"><p>If this is specified, the polling will wait on new blocks from <i>provider</i> before attempting the <i>pollFunc</i> again.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">options</span><spanclass="symbol">.</span><spanclass="method">oncePoll</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/providers/provider/">Provider</a></span><divclass="anchors"></div></div><divclass="body"><p>If this is specified, the polling will occur on each poll cycle of <i>provider</i> before attempting the <i>pollFunc</i> again.</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 February 8, 2021, 3:25pm.</div>