51 lines
28 KiB
HTML
51 lines
28 KiB
HTML
<html><head><title>Abstract Provider</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.js</div><div class="version">v5.0</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-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-inherits-signer">Wallet inherits Signer</a></div><div class="ancestor show link depth-2"><a href="/api/providers/">Providers</a></div><div class="myself ancestor ancestor show link depth-3"><a href="/api/providers/provider/">Provider</a></div><div class="child link depth-4"><a href="/api/providers/provider/#accounts-methods">Accounts Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#blocks-methods">Blocks Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#ethereum-naming-service-(ens)-methods">Ethereum Naming Service (ENS) Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#logs-methods">Logs Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#network-status-methods">Network Status Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#transactions-methods">Transactions Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#event-emitter-methods">Event Emitter Methods</a></div><div class="child link depth-4"><a href="/api/providers/provider/#inspection-methods">Inspection Methods</a></div><div class="show link depth-3"><a href="/api/providers/jsonrpc-provider/">JSON-RPC Provider</a></div><div class="hide link depth-4"><a href="/api/providers/jsonrpc-provider/#jsonrpcprovider">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="show 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/#nodesmithprovider">NodesmithProvider</a></div><div class="hide link depth-4"><a href="/api/providers/api-providers/#alchemyprovider">AlchemyProvider</a></div><div class="show 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="show link depth-3"><a href="/api/providers/types/">Types</a></div><div class="hide link depth-4"><a href="/api/providers/types/#blocks">Blocks</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="show link depth-2"><a href="/api/utils/">Utilities</a></div><div class="hide link depth-3"><a href="/api/utils/address/">Addresses</a></div><div class="hide 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="hide 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="hide 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="hide 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="hide link depth-3"><a href="/api/utils/fixednumber/">FixedNumber</a></div><div class="hide link depth-4"><a href="/api/utils/fixednumber/#types">Types</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="hide 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="hide 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="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="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/providers/">Providers</a> » <span class="current">Abstract Provider</span></div>
|
|
<a name="provider"></a><a name="provider"></a><h1>Provider</h1>
|
|
<p>Explain what a provider is...</p>
|
|
<a name="accounts-methods"></a><h2>Accounts Methods</h2>
|
|
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getBalance</span> ( <span class="param">address</span> [ , <span class="param">blockTag</span> = <span class="default-value">"</span><span class="param">latest</span>" ] ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/utils/bignumber/">BigNumber</a> ></span></div><div class="body"><p>Returns the balance of <i>address</i> as of the <i>blockTag</i> block height.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getCode</span> ( <span class="param">address</span> [ , <span class="param">blockTag</span> = <span class="default-value">"</span><span class="param">latest</span>" ] ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/utils/bytes/#hexstring">Hexstring</a> ></span></div><div class="body"><p>Returns the contract code of <i>address</i> as of the <i>blockTag</i> block height. If there is no contract currently deployed, the result is <code class="inline">0x</code>.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getStorageAt</span> ( <span class="param">address</span> , <span class="param">position</span> [ , <span class="param">blockTag</span> = <span class="default-value">"</span><span class="param">latest</span>" ] ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/utils/bytes/#hexstring">Hexstring</a> ></span></div><div class="body"><p>Returns the <code class="inline">Bytes32</code> value of the <i>position</i> at <i>address</i>, as of the <i>blockTag</i>.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getTransactionCount</span> ( <span class="param">address</span> [ , <span class="param">blockTag</span> = <span class="default-value">"</span><span class="param">latest</span>" ] ) <span class="arrow">⇒</span> <span class="returns">Promise< number ></span></div><div class="body"><p>Returns the number of transactions <i>address</i> has ever <b>sent</b>, as of <i>blockTag</i>. This value is required to be the nonce for the next transaction from <i>address</i> sent to the network.</p></div></div>
|
|
<a name="examples"></a><h3>Examples</h3>
|
|
|
|
<div class="code"><br><span class="comment">// Get the balance for an account...</span><br>provider.getBalance("ricmoo.firefly.eth");<br><span class="result ok">// { Promise: { BigNumber: "3446592266910605872" } }</span></span><br><br><span class="comment">// Get the code for a contract...</span><br>provider.getCode("registrar.firefly.eth");<br><span class="result ok">// { Promise: "0x606060405236156100885763ffffffff60e060020a60003504166369fe0e2d81146100fa578063704b6c021461010f57806379502c551461012d578063bed866f614610179578063c37067fa1461019e578063c66485b2146101ab578063d80528ae146101c9578063ddca3f43146101f7578063f2c298be14610219578063f3fef3a314610269575b6100f85b6000808052600760209081527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df80543490810190915560408051918252517fdb7750418f9fa390aaf85d881770065aa4adbe46343bcff4ae573754c829d9af929181900390910190a25b565b005b341561010257fe5b6100f860043561028a565b005b341561011757fe5b6100f8600160a060020a03600435166102ec565b005b341561013557fe5b61013d610558565b60408051600160a060020a0396871681526020810195909552928516848401526060840191909152909216608082015290519081900360a00190f35b341561018157fe5b61018c600435610580565b60408051918252519081900360200190f35b6100f8600435610595565b005b34156101b357fe5b6100f8600160a060020a03600435166105e6565b005b34156101d157fe5b6101d9610676565b60408051938452602084019290925282820152519081900360600190f35b34156101ff57fe5b61018c61068d565b60408051918252519081900360200190f35b6100f8600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965061069495505050505050565b005b341561027157fe5b6100f8600160a060020a0360043516602435610ab2565b005b60025433600160a060020a039081169116146102a65760006000fd5b600454604080519182526020820183905280517f854231545a00e13c316c82155f2b8610d638e9ff6ebc4930676f84a5af08a49a9281900390910190a160048190555b50565b60025433600160a060020a039081169116146103085760006000fd5b60025460408051600160a060020a039283168152918316602083015280517fbadc9a52979e89f78b7c58309537410c5e51d0f63a0a455efe8d61d2b474e6989281900390910190a16002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911790915560008054604080516020908101849052815160e060020a6302571be30281527f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26004820152915192909416936302571be39360248084019492938390030190829087803b15156103e957fe5b60325a03f115156103f657fe5b50505060405180519050600160a060020a0316631e83409a826000604051602001526040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b151561045f57fe5b60325a03f1151561046c57fe5b50506040805160008054600354602093840183905284517f0178b8bf00000000000000000000000000000000000000000000000000000000815260048101919091529351600160a060020a039091169450630178b8bf9360248082019493918390030190829087803b15156104dd57fe5b60325a03f115156104ea57fe5b505060408051805160035460025460e860020a62d5fa2b0284526004840191909152600160a060020a03908116602484015292519216925063d5fa2b0091604480830192600092919082900301818387803b151561054457fe5b60325a03f1151561055157fe5b5050505b50565b600054600354600254600454600154600160a060020a039485169492831692165b9091929394565b6000818152600760205260409020545b919050565b6000818152600760209081526040918290208054349081019091558251908152915183927fdb7750418f9fa390aaf85d881770065aa4adbe46343bcff4ae573754c829d9af92908290030190a25b50565b60025433600160a060020a039081169116146106025760006000fd5b60015460408051600160a060020a039283168152918316602083015280517f279875333405c968e401e3bc4e71d5f8e48728c90f4e8180ce28f74efb5669209281900390910190a16001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600654600554600160a060020a033016315b909192565b6004545b90565b80516001820190600080808060048510806106af5750601485115b156106ba5760006000fd5b600093505b8484101561072a57855160ff16925060618310806106e05750607a8360ff16115b80156106fc575060308360ff1610806106fc575060398360ff16115b5b801561070d57508260ff16602d14155b156107185760006000fd5b6001909501945b6001909301926106bf565b60045434101561073a5760006000fd5b866040518082805190602001908083835b6020831061076a5780518252601f19909201916020918201910161074b565b51815160209384036101000a60001901801990921691161790526040805192909401829003822060035483528282018190528451928390038501832060008054948401819052865160e060020a6302571be3028152600481018390529651929a509098509650600160a060020a0390921694506302571be393602480820194509192919082900301818787803b15156107ff57fe5b60325a03f1151561080c57fe5b505060405151600160a060020a031691909114905061082b5760006000fd5b60008054600354604080517f06ab5923000000000000000000000000000000000000000000000000000000008152600481019290925260248201869052600160a060020a03308116604484015290519216926306ab59239260648084019382900301818387803b151561089a57fe5b60325a03f115156108a757fe5b505060008054600154604080517f1896f70a00000000000000000000000000000000000000000000000000000000815260048101879052600160a060020a0392831660248201529051919092169350631896f70a9260448084019391929182900301818387803b151561091657fe5b60325a03f1151561092357fe5b50506001546040805160e860020a62d5fa2b02815260048101859052600160a060020a033381166024830152915191909216925063d5fa2b009160448082019260009290919082900301818387803b151561097a57fe5b60325a03f1151561098757fe5b505060008054604080517f5b0fc9c300000000000000000000000000000000000000000000000000000000815260048101869052600160a060020a0333811660248301529151919092169350635b0fc9c39260448084019391929182900301818387803b15156109f357fe5b60325a03f11515610a0057fe5b505060058054349081019091556006805460010190556000838152600760209081526040918290208054840190558151600160a060020a03331681529081019290925280518493507f179ef3319e6587f6efd3157b34c8b357141528074bcb03f9903589876168fa149281900390910190a260408051348152905182917fdb7750418f9fa390aaf85d881770065aa4adbe46343bcff4ae573754c829d9af919081900360200190a25b50505050505050565b60025433600160a060020a03908116911614610ace5760006000fd5b604051600160a060020a0383169082156108fc029083906000818181858888f193505050501515610aff5760006000fd5b60408051600160a060020a03841681526020810183905281517fac375770417e1cb46c89436efcf586a74d0298fee9838f66a38d40c65959ffda929181900390910190a15b50505600a165627a7a723058205c3628c01dc80233f51979d91a76cec2a25d84e86c9838d34672734ca2232b640029" }</span></span><br><br><span class="comment">// Get the storage value at position 0...</span><br>provider.getStorageAt("registrar.firefly.eth", 0)<br><span class="result ok">// { Promise: "0x000000000000000000000000314159265dd8dbb310642f98f50c066173c1259b" }</span></span><br><br><span class="comment">// Get transaction count of an account...</span><br>provider.getTransactionCount("ricmoo.firefly.eth");<br><span class="result ok">// { Promise: 531 }</span></span><br></div>
|
|
|
|
<a name="blocks-methods"></a><h2>Blocks Methods</h2>
|
|
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getBlock</span> ( <span class="param">block</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/providers/types/#provider-block">Block</a> ></span></div><div class="body"><p>Get the <i>block</i> from the network, where the <code class="inline">result.transactions</code> is a list of transaction hashes.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getBlockWithTransactions</span> ( <span class="param">block</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/providers/types/#provider-blocktxs">BlockWithTransactions</a> ></span></div><div class="body"><p>Get the <i>block</i> from the network, where the <code class="inline">result.transactions</code> is an Array of <a href="/api/providers/types/#provider-transactionresponse">TransactionResponse</a> objects.</p></div></div>
|
|
<a name="ethereum-naming-service-(ens)-methods"></a><h2>Ethereum Naming Service (ENS) Methods</h2>
|
|
<p>TODO: Explain ENS here...</p>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">lookupAddress</span> ( <span class="param">address</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< string ></span></div><div class="body"><p>Performs a reverse lookup of the <i>address</i> in ENS using the <i>Reverse Registrar</i>. If the name does not exist, or the forward lookup does not match, <code class="inline">null</code> is returned.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">resovleName</span> ( <span class="param">name</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< string ></span></div><div class="body"><p>Looks up the address of <i>name</i>. If the name is not owned, or does not have a <i>Resolver</i> configured, or the <i>Resolver</i> does not have an address configured, <code class="inline">null</code> is returned.</p></div></div>
|
|
<a name="examples"></a><h3>Examples</h3>
|
|
|
|
<div class="code"><br><span class="comment">// Reverse lookup of an ENS by address...</span><br>provider.lookupAddress("0x6fC21092DA55B392b045eD78F4732bff3C580e2c");<br><span class="result ok">// { Promise: "registrar.firefly.eth" }</span></span><br><br><span class="comment">// Lookup an address of an ENS name...</span><br>provider.resolveName("ricmoo.firefly.eth");<br><span class="result ok">// { Promise: "0x8ba1f109551bD432803012645Ac136ddd64DBA72" }</span></span><br><br></div>
|
|
|
|
<a name="logs-methods"></a><h2>Logs Methods</h2>
|
|
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getLogs</span> ( <span class="param">filter</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< Array< <a href="/api/providers/types/#provider-log">Log</a> > ></span></div><div class="body"><p>Returns the Array of <a href="/api/providers/types/#provider-log">Log</a> matching the <i>filter</i>.</p><p>Keep in mind that many backends will discard old events, and that requests which are too broad may get dropped as they require too many resources to execute the query.</p></div></div>
|
|
<a name="network-status-methods"></a><h2>Network Status Methods</h2>
|
|
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getNetwork</span> ( ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/providers/types/#provider-network">Network</a> ></span></div><div class="body"><p>Returns the <a href="/api/providers/types/#provider-network">Network</a> this Provider is connected to.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getBlockNumber</span> ( ) <span class="arrow">⇒</span> <span class="returns">Promise< number ></span></div><div class="body"><p>Returns the block number (or height) of the most recently mined block.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">getGasPrice</span> ( ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/utils/bignumber/">BigNumber</a> ></span></div><div class="body"><p>Returns a <i>best guess</i> of the <a href="/concepts/gas/#gas-price">Gas Price</a> to use in a transaction.</p></div></div>
|
|
<a name="transactions-methods"></a><h2>Transactions Methods</h2>
|
|
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">call</span> ( <span class="param">transaction</span> [ , <span class="param">blockTag</span> = <span class="default-value">"</span><span class="param">latest</span>" ] ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/utils/bytes/#hexstring">Hexstring</a> ></span></div><div class="body"><p>Returns the result of executing the <i>transaction</i>, using <i>call</i>. A call does not require any ether, but cannot change any state. This is useful for calling gettings on Contracts.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">estimateGas</span> ( <span class="param">transaction</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/utils/bignumber/">BigNumber</a> ></span></div><div class="body"><p>Returns an estimate of the amount of gas that would be required to submit <i>transaction</i> to the network.</p><p>An estimate may not be accurate since there could be another transaction on the network that was not accounted for, but after being mined affected relevant state.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">sendTransaction</span> ( <span class="param">transaction</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/providers/types/#provider-transactionresponse">TransactionResponse</a> ></span></div><div class="body"><p>Submits <i>transaction</i> to the network to be mined. The <i>transaction</i> <b>must</b> be signed, and be valid (i.e. the nonce is correct and the account has sufficient balance to pay for the transaction).</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">waitForTransaction</span> ( <span class="param">transactionHash</span> ) <span class="arrow">⇒</span> <span class="returns">Promise< <a href="/api/providers/types/#provider-transactionreceipt">TransactionReceipt</a> ></span></div><div class="body"><p>Returns a Promise which will not resolve until <i>transactionHash</i> is mined.</p></div></div>
|
|
<a name="event-emitter-methods"></a><h2>Event Emitter Methods</h2>
|
|
<p>Explain events here...</p>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">on</span> ( <span class="param">eventName</span> , <span class="param">listener</span> ) <span class="arrow">⇒</span> <span class="returns">this</span></div><div class="body"><p>Add a <i>listener</i> to be triggered for each <i>eventName</i>.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">once</span> ( <span class="param">eventName</span> , <span class="param">listener</span> ) <span class="arrow">⇒</span> <span class="returns">this</span></div><div class="body"><p>Add a <i>listener</i> to be triggered for only the next <i>eventName</i>, at which time it be removed.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">emit</span> ( <span class="param">eventName</span> , ...<span class="param">args</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span></div><div class="body"><p>Notify all listeners of <i>eventName</i>, passing <i>args</i> to each listener. This is generally only used internally.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">off</span> ( <span class="param">eventName</span> [ , <span class="param">listener</span> ] ) <span class="arrow">⇒</span> <span class="returns">this</span></div><div class="body"><p>Remove a <i>listener</i> for <i>eventName</i>. If no <i>listener</i> is provided, all listeners for <i>eventName</i> are removed.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">removeAllListeners</span> ( [ <span class="param">eventName</span> ] ) <span class="arrow">⇒</span> <span class="returns">this</span></div><div class="body"><p>Remove all the listeners for <i>eventName</i>. If no <i>eventName</i> is provided, <b>all</b> events are removed.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">listenerCount</span> ( [ <span class="param">eventName</span> ] ) <span class="arrow">⇒</span> <span class="returns">number</span></div><div class="body"><p>Returns the number of listeners for <i>eventName</i>. If no <i>eventName</i> is provided, the total number of listeners is returned.</p></div></div>
|
|
<div class="property"><div class="signature"><span class="path">provider</span> . <span class="method">listeners</span> ( <span class="param">eventName</span> ) <span class="arrow">⇒</span> <span class="returns">Array< Listener ></span></div><div class="body"><p>Returns the list of Listeners for <i>eventName</i>.</p></div></div>
|
|
<a name="inspection-methods"></a><h2>Inspection Methods</h2>
|
|
|
|
<div class="property"><div class="signature"><span class="path">Provider</span> . <span class="method">isProvider</span> ( <span class="param">object</span> ) <span class="arrow">⇒</span> <span class="returns">boolean</span></div><div class="body"><p>Returns true if and only if object is a Provider.</p></div></div><div class="footer"><div class="nav previous"><a href="/api/providers/"><span class="arrow">←</span>Providers</a></div> <div class="nav next"><a href="/api/providers/jsonrpc-provider/">JSON-RPC Provider<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:afe22f89ad3a869a23a32424f5f4ece8ca570d0ae5971ba6120011a3fd5fee80 --> |