74 lines
35 KiB
HTML
74 lines
35 KiB
HTML
<html><head><title>Application Binary Interface</title><link rel="stylesheet" type="text/css" href="/static/style.css"></head><body><div class="sidebar"><div class="header"><div class="logo"><a href="/"><div class="image"></div><div class="name">ethers</div><div class="version">v5.0-beta</div></a></div></div><div class="toc"><div><div class="link title"><a href="/">Documentation</a></div><div class="base show link depth-1"><a href="/getting-started/">Getting Started</a></div><div class="hide link depth-2"><a href="/getting-started/#installing">Installing</a></div><div class="hide link depth-2"><a href="/getting-started/#importing">Importing</a></div><div class="base show link depth-1"><a href="/concepts/">Concepts</a></div><div class="hide link depth-2"><a href="/concepts/events/">Events</a></div><div class="hide link depth-3"><a href="/concepts/events/#solidity-topics">Solidity Topics</a></div><div class="hide link depth-2"><a href="/concepts/gas/">Gas</a></div><div class="hide link depth-3"><a href="/concepts/gas/#gas-price">Gas Price</a></div><div class="hide link depth-3"><a href="/concepts/gas/#gas-limit">Gas Limit</a></div><div class="base ancestor show link depth-1"><a href="/api/">Application Programming Interface</a></div><div class="show link depth-2"><a href="/api/contract/">Contracts</a></div><div class="hide link depth-3"><a href="/api/contract/#buckets">Buckets</a></div><div class="show link depth-2"><a href="/api/signer/">Signers</a></div><div class="hide link depth-3"><a href="/api/signer/#signer">Signer</a></div><div class="hide link depth-3"><a href="/api/signer/#wallet">Wallet</a></div><div class="hide link depth-3"><a href="/api/signer/#voidsigner">VoidSigner</a></div><div class="hide link depth-3"><a href="/api/signer/#externallyownedaccount">ExternallyOwnedAccount</a></div><div class="show link depth-2"><a href="/api/providers/">Providers</a></div><div class="hide link depth-3"><a href="/api/providers/provider/">Provider</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#accounts-methods">Accounts Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#blocks-methods">Blocks Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#ethereum-naming-service-(ens)-methods">Ethereum Naming Service (ENS) Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#logs-methods">Logs Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#network-status-methods">Network Status Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#transactions-methods">Transactions Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#event-emitter-methods">Event Emitter Methods</a></div><div class="hide link depth-4"><a href="/api/providers/provider/#inspection-methods">Inspection Methods</a></div><div class="hide link depth-3"><a href="/api/providers/jsonrpc-provider/">JsonRpcProvider</a></div><div class="hide link depth-4"><a href="/api/providers/jsonrpc-provider/#jsonrpcsigner">JsonRpcSigner</a></div><div class="hide link depth-4"><a href="/api/providers/jsonrpc-provider/#jsonrpcuncheckedsigner">JsonRpcUncheckedSigner</a></div><div class="hide link depth-3"><a href="/api/providers/api-providers/">API Providers</a></div><div class="hide link depth-4"><a href="/api/providers/api-providers/#etherscanprovider">EtherscanProvider</a></div><div class="hide link depth-4"><a href="/api/providers/api-providers/#infuraprovider">InfuraProvider</a></div><div class="hide link depth-4"><a href="/api/providers/api-providers/#alchemyprovider">AlchemyProvider</a></div><div class="hide link depth-4"><a href="/api/providers/api-providers/#cloudfrontprovider">CloudfrontProvider</a></div><div class="hide link depth-3"><a href="/api/providers/other/">Other Providers</a></div><div class="hide link depth-4"><a href="/api/providers/other/#fallbackprovider">FallbackProvider</a></div><div class="hide link depth-4"><a href="/api/providers/other/#ipcprovider">IpcProvider</a></div><div class="hide link depth-4"><a href="/api/providers/other/#urljsonrpcprovider">UrlJsonRpcProvider</a></div><div class="hide link depth-4"><a href="/api/providers/other/#web3provider">Web3Provider</a></div><div class="hide link depth-3"><a href="/api/providers/types/">Types</a></div><div class="hide link depth-4"><a href="/api/providers/types/#network">Network</a></div><div class="hide link depth-4"><a href="/api/providers/types/#block">Block</a></div><div class="hide link depth-4"><a href="/api/providers/types/#events-and-logs">Events and Logs</a></div><div class="hide link depth-4"><a href="/api/providers/types/#transactions">Transactions</a></div><div class="ancestor show link depth-2"><a href="/api/utils/">Utilities</a></div><div class="show link depth-3"><a href="/api/utils/address/">Addresses</a></div><div class="hide link depth-4"><a href="/api/utils/address/#address-formats">Address Formats</a></div><div class="hide link depth-4"><a href="/api/utils/address/#functions">Functions</a></div><div class="myself ancestor ancestor show link depth-3"><a href="/api/utils/abi/">Application Binary Interface</a></div><div class="child link depth-4"><a href="/api/utils/abi/#formats">Formats</a></div><div class="child link depth-4"><a href="/api/utils/abi/#fragment">Fragment</a></div><div class="child link depth-4"><a href="/api/utils/abi/#constructorfragment">ConstructorFragment</a></div><div class="child link depth-4"><a href="/api/utils/abi/#eventfragment">EventFragment</a></div><div class="child link depth-4"><a href="/api/utils/abi/#functionfragment">FunctionFragment</a></div><div class="child link depth-4"><a href="/api/utils/abi/#paramtype">ParamType</a></div><div class="show link depth-3"><a href="/api/utils/bignumber/">BigNumber</a></div><div class="hide link depth-4"><a href="/api/utils/bignumber/#types">Types</a></div><div class="hide link depth-4"><a href="/api/utils/bignumber/#creating-instances">Creating Instances</a></div><div class="hide link depth-4"><a href="/api/utils/bignumber/#methods">Methods</a></div><div class="hide link depth-4"><a href="/api/utils/bignumber/#notes">Notes</a></div><div class="show link depth-3"><a href="/api/utils/bytes/">Byte Manipulation</a></div><div class="hide link depth-4"><a href="/api/utils/bytes/#types">Types</a></div><div class="hide link depth-4"><a href="/api/utils/bytes/#inspection">Inspection</a></div><div class="hide link depth-4"><a href="/api/utils/bytes/#converting-between-arrays-and-hexstrings">Converting between Arrays and Hexstrings</a></div><div class="hide link depth-4"><a href="/api/utils/bytes/#array-manipulation">Array Manipulation</a></div><div class="hide link depth-4"><a href="/api/utils/bytes/#hexstring-manipulation">Hexstring Manipulation</a></div><div class="hide link depth-4"><a href="/api/utils/bytes/#signature-conversion">Signature Conversion</a></div><div class="show link depth-3"><a href="/api/utils/constants/">Constants</a></div><div class="hide link depth-4"><a href="/api/utils/constants/#bytes">Bytes</a></div><div class="hide link depth-4"><a href="/api/utils/constants/#strings">Strings</a></div><div class="hide link depth-4"><a href="/api/utils/constants/#bignumber">BigNumber</a></div><div class="show link depth-3"><a href="/api/utils/display-logic/">Display Logic and Input</a></div><div class="hide link depth-4"><a href="/api/utils/display-logic/#units">Units</a></div><div class="hide link depth-4"><a href="/api/utils/display-logic/#functions">Functions</a></div><div class="show link depth-3"><a href="/api/utils/fixednumber/">FixedNumber</a></div><div class="hide link depth-4"><a href="/api/utils/fixednumber/#fixedformat">FixedFormat</a></div><div class="hide link depth-4"><a href="/api/utils/fixednumber/#creating-instances">Creating Instances</a></div><div class="hide link depth-4"><a href="/api/utils/fixednumber/#properties">Properties</a></div><div class="hide link depth-4"><a href="/api/utils/fixednumber/#methods">Methods</a></div><div class="show link depth-3"><a href="/api/utils/hashing/">Hashing Algorithms</a></div><div class="hide link depth-4"><a href="/api/utils/hashing/#cryptographic-hashing">Cryptographic Hashing</a></div><div class="hide link depth-4"><a href="/api/utils/hashing/#common-hashing-helpers">Common Hashing Helpers</a></div><div class="hide link depth-4"><a href="/api/utils/hashing/#solidity-hashing-algorithms">Solidity Hashing Algorithms</a></div><div class="show link depth-3"><a href="/api/utils/strings/">Strings</a></div><div class="hide link depth-4"><a href="/api/utils/strings/#bytes32string">Bytes32String</a></div><div class="hide link depth-4"><a href="/api/utils/strings/#utf-8-strings">UTF-8 Strings</a></div><div class="hide link depth-4"><a href="/api/utils/strings/#unicodenormalizationform">UnicodeNormalizationForm</a></div><div class="hide link depth-4"><a href="/api/utils/strings/#custom-utf-8-error-handling">Custom UTF-8 Error Handling</a></div><div class="show link depth-3"><a href="/api/utils/transactions/">Transactions</a></div><div class="hide link depth-4"><a href="/api/utils/transactions/#types">Types</a></div><div class="hide link depth-4"><a href="/api/utils/transactions/#functions">Functions</a></div><div class="show link depth-2"><a href="/api/other/">Other Libraries</a></div><div class="hide link depth-3"><a href="/api/other/hardware/">Hardware Wallets</a></div><div class="hide link depth-4"><a href="/api/other/hardware/#ledgersigner">LedgerSigner</a></div><div class="base show link depth-1"><a href="/cli/">Command Line Interfaces</a></div><div class="hide link depth-2"><a href="/cli/ethers/">Sandbox Utility</a></div><div class="hide link depth-3"><a href="/cli/ethers/#help">Help</a></div><div class="hide link depth-3"><a href="/cli/ethers/#examples">Examples</a></div><div class="hide link depth-2"><a href="/cli/asm/">Assembler</a></div><div class="hide link depth-3"><a href="/cli/asm/#help">Help</a></div><div class="hide link depth-3"><a href="/cli/asm/#examples">Examples</a></div><div class="hide link depth-2"><a href="/cli/ens/">ENS</a></div><div class="hide link depth-3"><a href="/cli/ens/#help">Help</a></div><div class="hide link depth-3"><a href="/cli/ens/#examples">Examples</a></div><div class="hide link depth-2"><a href="/cli/typescript/">TypeScript</a></div><div class="hide link depth-3"><a href="/cli/typescript/#help">Help</a></div><div class="hide link depth-3"><a href="/cli/typescript/#examples">Examples</a></div><div class="hide link depth-2"><a href="/cli/plugin/">Making Your Own</a></div><div class="hide link depth-3"><a href="/cli/plugin/#cli">CLI</a></div><div class="hide link depth-3"><a href="/cli/plugin/#plugin">Plugin</a></div><div class="hide link depth-3"><a href="/cli/plugin/#argparser">ArgParser</a></div><div class="base show link depth-1"><a href="/cookbook/">Cookbook</a></div><div class="base show link depth-1"><a href="/migration/">Migration Guide</a></div><div class="hide link depth-2"><a href="/migration/#from-web3">From Web3</a></div><div class="hide link depth-2"><a href="/migration/#from-ethers-v4">From ethers v4</a></div><div class="base show link depth-1"><a href="/testing/">Testing</a></div><div class="base show link depth-1"><a href="/contributing/">Contributing and Hacking</a></div><div class="hide link depth-2"><a href="/contributing/#building">Building</a></div><div class="base show link depth-1"><a href="/documentation/">Flatworm Docs</a></div><div class="hide link depth-2"><a href="/documentation/#fragments">Fragments</a></div><div class="hide link depth-2"><a href="/documentation/#markdown">Markdown</a></div><div class="hide link depth-2"><a href="/documentation/#configuration">Configuration</a></div><div class="hide link depth-2"><a href="/documentation/#extended-directive-functions">Extended Directive Functions</a></div><div class="base show link depth-1"><a href="/license/">License and Copyright</a></div></div></div></div><div class="content"><div class="breadcrumbs"><a href="/">Documentation</a> » <a href="/api/">Application Programming Interface</a> » <a href="/api/utils/">Utilities</a> » <span class="current">Application Binary Interface</span></div>
|
|
<a name="application-binary-interface"></a><h1 class="show-anchors"><div>Application Binary Interface<div class="anchors"><a class="self" href="#application-binary-interface"></a></div></div></h1>
|
|
<p>Explain an ABI.</p>
|
|
<a name="formats"></a><h2 class="show-anchors"><div>Formats<div class="anchors"><a class="self" href="#formats"></a></div></div></h2>
|
|
|
|
<a name="json-string-abi-(solidity-output-json)"></a><h3 class="show-anchors"><div>JSON String ABI (Solidity Output JSON)<div class="anchors"><a class="self" href="#json-string-abi-(solidity-output-json)"></a></div></div></h3>
|
|
<p>The <b>JSON ABI Format</b> is the format that is <a href="https://solidity.readthedocs.io/en/v0.6.0/using-the-compiler.html#output-description">output from the Solidity compiler</a>.</p><p>A JSON serialized object is always a string, which represents an Array of Objects, where each Object has various properties describing the <a href="/api/utils/abi/#abi-fragment">Fragment</a> of the ABI.</p><p>The deserialied JSON string (which is a normal JavaScript Object) may also be passed into any function which accepts a JSON String ABI.</p>
|
|
<a name="humanb-readable-abi"></a><h3 class="show-anchors"><div>Humanb-Readable ABI<div class="anchors"><a class="self" href="#humanb-readable-abi"></a></div></div></h3>
|
|
<p>The Human-Readable ABI was</p><p><a href="https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917">article</a></p>
|
|
<a name="abi-outputformats"></a><a name="output-formats"></a><h3 class="show-anchors"><div>Output Formats<div class="anchors"><a class="self" href="#abi-outputformats"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L232">source</a></div></div></h3>
|
|
<p>Each <a href="/api/utils/abi/#abi-fragment">Fragment</a> and <a href="/api/utils/abi/#abi-paramtype">ParamType</a> may be output using its <code class="inline">format</code> method.</p>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">FragmentTypes</span> . <span class="method">full</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is a full human-readable string, including all parameter names, any optional modifiers (e.g. <code class="inline">indexed</code>, <code class="inline">public</code>, etc) and white-space to aid in human readabiliy.</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">FragmentTypes</span> . <span class="method">minimal</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is similar to <code class="inline">full</code>, except with no unnecessary whitespace or parameter names. This is useful for storing a minimal string which can still fully reconstruct the original Fragment using <a href="/api/utils/abi/#abi-fragment-from">Fragment . from</a>.</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">FragmentTypes</span> . <span class="method">json</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This returns a JavaScript Object which is safe to call <code class="inline">JSON.stringify</code> on to create a JSON string.</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">FragmentTypes</span> . <span class="method">sighash</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is a minimal output format, which is used by Solidity when computing a signature hash or an event topic hash.</p></div></div>
|
|
<div class="definition container-box warning show-anchors"><div class="term">Note</div><div class="body"><p>The <code class="inline">sighash</code> format is <b>insufficient</b> to re-create the original <a href="/api/utils/abi/#abi-fragment">Fragment</a>, since it discards modifiers such as indexed, anonymous, stateMutability, etc.</p></div></div>
|
|
<a name="abi-fragment"></a><a name="fragment"></a><h2 class="show-anchors"><div>Fragment<div class="anchors"><a class="self" href="#abi-fragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L392">source</a></div></div></h2>
|
|
<p>An ABI is a collection of <b>Fragments</b>, where each fragment specifies:</p><ul><li>An Event</li><li>A Function</li><li>A Constructor</li></ul>
|
|
<a name="properties"></a><h3 class="show-anchors"><div>Properties<div class="anchors"><a class="self" href="#properties"></a></div></div></h3>
|
|
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">name</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is the name of the Event or Function. This will be null for a <a href="/api/utils/abi/#abi-constructorfragment">ConstructorFragment</a>.</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">type</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is a string which indicates the type of the <a href="/api/utils/abi/#abi-fragment">Fragment</a>. This will be one of:</p><ul><li><code class="inline">constructor</code></li><li><code class="inline">event</code></li><li><code class="inline">function</code></li></ul></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">inputs</span> <span class="arrow">⇒</span> <span class="returns">Array< <a href="/api/utils/abi/#abi-paramtype">ParamType</a> ></span><div class="anchors"></div></div><div class="body"><p>This is an array of of each <a href="/api/utils/abi/#abi-paramtype">ParamType</a> for the input parameters to the Constructor, Event of Function.</p></div></div>
|
|
<a name="methods"></a><h3 class="show-anchors"><div>Methods<div class="anchors"><a class="self" href="#methods"></a></div></div></h3>
|
|
|
|
<a name="abi-fragment-from"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">Fragment</span> . <span class="method">from</span> ( <span class="param">objectOrString</span> ) <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/abi/#abi-fragment">Fragment</a></span><div class="anchors"><a class="self" href="#abi-fragment-from"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L411">source</a></div></div><div class="body"><p>Returns a</p></div></div>
|
|
<a name="abi-isfragment"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">Fragment</span> . <span class="method">isFragment</span> ( <span class="param">object</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"><a class="self" href="#abi-isfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L455">source</a></div></div><div class="body"><p>Tra lal al</p></div></div>
|
|
<a name="abi-constructorfragment"></a><a name="constructorfragment"></a><h2 class="show-anchors"><div>ConstructorFragment<span class="inherits"> inherits <a href="/api/utils/abi/#abi-fragment">Fragment</a></span><div class="anchors"><a class="self" href="#abi-constructorfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L639">source</a></div></div></h2>
|
|
|
|
<a name="properties"></a><h3 class="show-anchors"><div>Properties<div class="anchors"><a class="self" href="#properties"></a></div></div></h3>
|
|
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">gas</span> <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/bignumber/">BigNumber</a></span><div class="anchors"></div></div><div class="body"><p>This is the gas limit that should be used during deployment. It may be null.</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">payable</span> <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"></div></div><div class="body"><p>This is whether the constructor may receive ether during deployment as an endowment (i.e. msg.value != 0).</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">stateMutability</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is the state mutability of the constructor. It can be any of:</p><ul><li><code class="inline">nonpayable</code></li><li><code class="inline">payable</code></li></ul></div></div>
|
|
<a name="methods"></a><h3 class="show-anchors"><div>Methods<div class="anchors"><a class="self" href="#methods"></a></div></div></h3>
|
|
|
|
<a name="abi-constructorfragment-from"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">ConstructorFragment</span> . <span class="method">from</span> ( <span class="param">objectOrString</span> ) <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/abi/#abi-constructorfragment">ConstructorFragment</a></span><div class="anchors"><a class="self" href="#abi-constructorfragment-from"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L677">source</a></div></div><div class="body"><p>Tra la la...</p></div></div>
|
|
<a name="abi-isconstructorfragment"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">ConstructorFragment</span> . <span class="method">isConstructorFragment</span> ( <span class="param">object</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"><a class="self" href="#abi-isconstructorfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L720">source</a></div></div><div class="body"><p>Tra lal al</p></div></div>
|
|
<a name="abi-eventfragment"></a><a name="eventfragment"></a><h2 class="show-anchors"><div>EventFragment<span class="inherits"> inherits <a href="/api/utils/abi/#abi-fragment">Fragment</a></span><div class="anchors"><a class="self" href="#abi-eventfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L460">source</a></div></div></h2>
|
|
|
|
<a name="properties"></a><h3 class="show-anchors"><div>Properties<div class="anchors"><a class="self" href="#properties"></a></div></div></h3>
|
|
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">anonymous</span> <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"></div></div><div class="body"><p>This is whether the event is anonymous. An anonymous Event does not inject its topic hash as topic0 when creating a log.</p></div></div>
|
|
<a name="methods"></a><h3 class="show-anchors"><div>Methods<div class="anchors"><a class="self" href="#methods"></a></div></div></h3>
|
|
|
|
<a name="abi-eventfragment-from"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">EventFragment</span> . <span class="method">from</span> ( <span class="param">objectOrString</span> ) <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/abi/#abi-eventfragment">EventFragment</a></span><div class="anchors"><a class="self" href="#abi-eventfragment-from"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L497">source</a></div></div><div class="body"><p>Tra la la...</p></div></div>
|
|
<a name="abi-iseventfragment"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">EventFragment</span> . <span class="method">isEventFragment</span> ( <span class="param">object</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"><a class="self" href="#abi-iseventfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L543">source</a></div></div><div class="body"><p>Tra lal al</p></div></div>
|
|
<a name="abi-functionfragment"></a><a name="functionfragment"></a><h2 class="show-anchors"><div>FunctionFragment<span class="inherits"> inherits <a href="/api/utils/abi/#abi-constructorfragment">ConstructorFragment</a></span><div class="anchors"><a class="self" href="#abi-functionfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L725">source</a></div></div></h2>
|
|
|
|
<a name="properties"></a><h3 class="show-anchors"><div>Properties<div class="anchors"><a class="self" href="#properties"></a></div></div></h3>
|
|
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">constant</span> <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"></div></div><div class="body"><p>This is whether the function is constant (i.e. does not change state). This is true if the state mutability is <code class="inline">pure</code> or <code class="inline">view</code>.</p></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">stateMutability</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"></div></div><div class="body"><p>This is the state mutability of the constructor. It can be any of:</p><ul><li><code class="inline">nonpayable</code></li><li><code class="inline">payable</code></li><li><code class="inline">pure</code></li><li><code class="inline">view</code></li></ul></div></div>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">fragment</span> . <span class="method">outputs</span> <span class="arrow">⇒</span> <span class="returns">Array< <a href="/api/utils/abi/#abi-paramtype">ParamType</a> ></span><div class="anchors"></div></div><div class="body"><p>A list of the Function output parameters.</p></div></div>
|
|
<a name="method"></a><h3 class="show-anchors"><div>Method<div class="anchors"><a class="self" href="#method"></a></div></div></h3>
|
|
|
|
<a name="abi-functionfragment-from"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">FunctionFragment</span> . <span class="method">from</span> ( <span class="param">objectOrString</span> ) <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/abi/#abi-functionfragment">FunctionFragment</a></span><div class="anchors"><a class="self" href="#abi-functionfragment-from"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L677">source</a></div></div><div class="body"><p>Tra la la...</p></div></div>
|
|
<a name="abi-isfunctionfragment"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">FunctionFragment</span> . <span class="method">isFunctionFragment</span> ( <span class="param">object</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"><a class="self" href="#abi-isfunctionfragment"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L840">source</a></div></div><div class="body"><p>Tra lal al</p></div></div>
|
|
<a name="abi-paramtype"></a><a name="paramtype"></a><h2 class="show-anchors"><div>ParamType<div class="anchors"><a class="self" href="#abi-paramtype"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L248">source</a></div></div></h2>
|
|
<p>The following examples will represent the Solidity parameter:</p><p><code class="inline">string foobar</code></p>
|
|
<a name="properties"></a><h3 class="show-anchors"><div>Properties<div class="anchors"><a class="self" href="#properties"></a></div></div></h3>
|
|
|
|
<a name="abi-paramtype-name"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">name</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"><a class="self" href="#abi-paramtype-name"></a></div></div><div class="body"><p>The local parameter name. This may be null for unnamed parameters. For example, the parameter definition <code class="inline">string foobar</code> would be <code class="inline">foobar</code>.</p></div></div>
|
|
<a name="abi-paramtype-type"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">type</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"><a class="self" href="#abi-paramtype-type"></a></div></div><div class="body"><p>The full type of the parameter, including tuple and array symbols. This may be null for unnamed parameters. For the above example, this would be <code class="inline">foobar</code>.</p></div></div>
|
|
<a name="abi-paramtype-basetype"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">basetype</span> <span class="arrow">⇒</span> <span class="returns">string</span><div class="anchors"><a class="self" href="#abi-paramtype-basetype"></a></div></div><div class="body"><p>The base type of the parameter. For primitive types (e.g. <code class="inline">address</code>, <code class="inline">uint256</code>, etc) this is equal to <a href="/api/utils/abi/#abi-paramtype-type">type</a>. For arrays, it will be the string <code class="inline">array</code> and for a tuple, it will be the string <code class="inline">tuple</code>.</p></div></div>
|
|
<a name="abi-paramtype-indexed"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">indexed</span> <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"><a class="self" href="#abi-paramtype-indexed"></a></div></div><div class="body"><p>Whether the parameter has been marked as indexed. This <b>only</b> applies to parameters which are part of an <a href="/api/utils/abi/#abi-eventfragment">EventFragment</a>.</p></div></div>
|
|
<a name="abi-paramtype-arraychildren"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">arrayChildren</span> <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/abi/#abi-paramtype">ParamType</a></span><div class="anchors"><a class="self" href="#abi-paramtype-arraychildren"></a></div></div><div class="body"><p>The type of children of the array. This is null for for any parameter wjhich is not an array.</p></div></div>
|
|
<a name="abi-paramtype-arraylength"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">arrayLength</span> <span class="arrow">⇒</span> <span class="returns">number</span><div class="anchors"><a class="self" href="#abi-paramtype-arraylength"></a></div></div><div class="body"><p>The length of the array, or <code class="inline">-1</code> for dynamic-length arrays. This is null for parameters which is not arrays.</p></div></div>
|
|
<a name="abi-paramtype-components"></a><div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">components</span> <span class="arrow">⇒</span> <span class="returns">Array< <a href="/api/utils/abi/#abi-paramtype">ParamType</a> ></span><div class="anchors"><a class="self" href="#abi-paramtype-components"></a></div></div><div class="body"><p>The components of a tuple. This is null for non-tuple parameters.</p></div></div>
|
|
<a name="methods"></a><h3 class="show-anchors"><div>Methods<div class="anchors"><a class="self" href="#methods"></a></div></div></h3>
|
|
<p>Tra la la...</p>
|
|
<div class="property show-anchors"><div class="signature"><span class="path">paramType</span> . <span class="method">format</span> ( [ <span class="param">outputType</span> = <span class="default-value">"</span><span class="param">sighash</span>" ] ) <div class="anchors"></div></div><div class="body"><p>Tra la la...</p></div></div>
|
|
<a name="abi-paramtype-from"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">ParamType</span> . <span class="method">from</span> ( <span class="param">objectOrString</span> ) <span class="arrow">⇒</span> <span class="returns"><a href="/api/utils/abi/#abi-paramtype">ParamType</a></span><div class="anchors"><a class="self" href="#abi-paramtype-from"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L352">source</a></div></div><div class="body"><p>Tra la la...</p></div></div>
|
|
<a name="abi-paramtype-isparamtype"></a><div class="property show-anchors"><div class="signature"><span class="path">utils</span> . <span class="path">ParamType</span> . <span class="method">isParamType</span> ( <span class="param">object</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span><div class="anchors"><a class="self" href="#abi-paramtype-isparamtype"></a><a class="source" href="https://github.com/ethers-io/ethers.js/blob/ethers-v5-beta/packages/abi/src.ts/fragments.ts#L383">source</a></div></div><div class="body"><p>Tra la la...</p></div></div><div class="footer"><div class="nav previous"><a href="/api/utils/address/"><span class="arrow">←</span>Addresses</a></div> <div class="nav next"><a href="/api/utils/bignumber/">BigNumber<span class="arrow">→</span></a></div></div><div class="copyright">The content of this site is licensed under the <a href="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons Attribution 4.0 International License</a>.</div></div><script src="/script.js" type="text/javascript"></script></body></html><!-- ContentHash:4b3559a3689def86807e9174edc024067f29b75137d4f21eec098d01bcb28261 --> |