Skip to content

Commit

Permalink
Added more docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jan 10, 2020
1 parent 074eb4b commit 381a72d
Show file tree
Hide file tree
Showing 38 changed files with 1,358 additions and 157 deletions.
10 changes: 5 additions & 5 deletions docs.wrm/api/providers/api-providers.wrm
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ To mitigate these issues, it is recommended you use a
[Default Provider](get-default-provider).


_subsection: EtherscanProvider
_subsection: EtherscanProvider @INHERIT<[[provider]]>

The **EtherscanProvider** is backed by a combination of the various
[Etherscan APIs](https://etherscan.io/apis).

_property: provider.getHistory(address) => Array<History>


_subsection: InfuraProvider
_subsection: InfuraProvider @INHERIT<[[urljsonrpc-provider]]>

The **InfuraProvider** is backed by the popular [INFURA](https://infura.io)
Ethereum service.
Expand All @@ -30,23 +30,23 @@ It supports Mainnet (homestead) and all common testnets (Ropsten, Rinkeby,
G&ouml;rli and Kovan).


_subsection: NodesmithProvider
_subsection: NodesmithProvider @INHERIT<[[urljsonrpc-provider]]>

The **NodesmithProvider** is backed by [Nodesmith](https://nodesmith.io).

It supports Mainnet (homestead) and all common testnets (Ropsten, Rinkeby,
G&ouml;rli and Kovan), as well as the Ethereum-like network [Aion](https://aion.network).


_subsection: AlchemyProvider
_subsection: AlchemyProvider @INHERIT<[[urljsonrpc-provider]]>

The **AlchemtProvider** is backed by [Alchemy](https://alchemyapi.io).

It supports Mainnet (homestead) and all common testnets (Ropsten, Rinkeby,
G&ouml;rli and Kovan).


_subsection: CloudfrontProvider
_subsection: CloudfrontProvider @INHERIT<[[urljsonrpc-provider]]>

The CloudfrontProvider is backed by the
[Cloudflare Ethereum Gateway](https://developers.cloudflare.com/distributed-web/ethereum-gateway/).
Expand Down
15 changes: 10 additions & 5 deletions docs.wrm/api/providers/jsonrpc-provider.wrm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ _section: JSON-RPC Provider

Explain here...

_subsection: JsonRpcProvider @<jsonrpc-provider>
_subsection: JsonRpcProvider @<jsonrpc-provider> @INHERIT<[[provider]]>

TODO...

_property: provider.getSigner([ addressOrIndex ]) => [[jsonrpc-signer]]
_property: jsonRpcProvider.getSigner([ addressOrIndex ]) => [[jsonrpc-signer]] @<provider-getsigner> @SRC<providers/json-rpc-provider>
Returns a [[jsonrpc-signer]] which is managed by this Ethereum node, at
//addressOrIndex//. If no //addressOrIndex// is provided, the first
account (account #0) is used.

_property: provider.getUncheckSigner([ addressOrIndex ]) => [[jsonrpc-uncheckedsigner]]
_property: jsonRpcProvider.getUncheckedSigner([ addressOrIndex ]) => [[jsonrpc-uncheckedsigner]] @<provider-getuncheckedsigner> @SRC<providers/json-rpc-provider>

_subsection: JsonRpcSigner @<jsonrpc-signer>
_property: jsonRpcProvider.listAccounts() => Array<string> @<provider-listaccounts> @SRC<providers/json-rpc-provider>

_property: jsonRpcProvider.send(method, params) => Promise<any> @<provider-send> @SRC<providers/json-rpc-provider>


_subsection: JsonRpcSigner @<jsonrpc-signer> @INHERIT<[[signer]]>
TODO... Explain

_subsection: JsonRpcUncheckedSigner @<jsonrpc-uncheckedsigner>
_subsection: JsonRpcUncheckedSigner @<jsonrpc-uncheckedsigner> @INHERIT<[[signer]]>
TODO... Explain
14 changes: 12 additions & 2 deletions docs.wrm/api/providers/other.wrm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _section: Other Providers

Others...

_subsection: FallbackProvider @<provider-fallback>
_subsection: FallbackProvider @<provider-fallback> @INHERIT<[[provider]]>

Explain...

Expand All @@ -21,7 +21,17 @@ _property: provider.weights => Array<number>
The weight each of the Providers adds to a results acceptance.


_subsection: IpcProvider @<provider-ipc>
_subsection: IpcProvider @<provider-ipc> @INHERIT<[[jsonrpc-provider]]>

Explain...

_subsection: UrlJsonRpcProvider @<urljsonrpc-provider> @INHERIT<[[jsonrpc-provider]]>

Tra la la

_subsection: Web3Provider @<web3provider> @INHERIT<[[jsonrpc-provider]]>

Tra la la



52 changes: 26 additions & 26 deletions docs.wrm/api/providers/provider.wrm
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Explain what a provider is...

_subsection: Accounts Methods

_property: provider.getBalance(address [ , blockTag = "latest" ]) => Promise<[[bignumber]]>
_property: provider.getBalance(address [ , blockTag = "latest" ]) => Promise<[[bignumber]]> @<provider-getbalance> @SRC<providers/base-provider>
Returns the balance of //address// as of the //blockTag// block height.

_property: provider.getCode(address [ , blockTag = "latest" ]) => Promise<[[hexstring]]>
_property: provider.getCode(address [ , blockTag = "latest" ]) => Promise<string<[[datahexstring]]>> @<providers-getcode> @SRC<providers/base-provider>
Returns the contract code of //address// as of the //blockTag// block height. If there is
no contract currently deployed, the result is ``0x``.

_property: provider.getStorageAt(address, position [ , blockTag = "latest" ]) => Promise<[[hexstring]]>
Returns the ``Bytes32`` value of the //position// at //address//, as of the //blockTag//.
_property: provider.getStorageAt(addr, pos [ , blockTag = "latest" ]) => Promise<string<[[datahexstring]]>> @<providers-getstorageat> @SRC<providers/base-provider>
Returns the ``Bytes32`` value of the position //pos// at address //addr//, as of the //blockTag//.

_property: provider.getTransactionCount(address [ , blockTag = "latest" ]) => Promise<number>
_property: provider.getTransactionCount(address [ , blockTag = "latest" ]) => Promise<number> @<providers-gettransactioncount> @SRC<providers/base-provider>
Returns the number of transactions //address// has ever **sent**, as of //blockTag//.
This value is required to be the nonce for the next transaction from //address//
sent to the network.
Expand All @@ -30,11 +30,11 @@ _code: example-account.js

_subsection: Blocks Methods

_property: provider.getBlock(block) => Promise<[[provider-block]]>
_property: provider.getBlock(block) => Promise<[[provider-block]]> @<providers-getblock> @SRC<providers/base-provider>
Get the //block// from the network, where the ``result.transactions`` is a list
of transaction hashes.

_property: provider.getBlockWithTransactions(block) => Promise<[[provider-blocktxs]]>
_property: provider.getBlockWithTransactions(block) => Promise<[[provider-blocktxs]]> @<providers-getblockwithtransactions> @SRC<providers/base-provider>
Get the //block// from the network, where the ``result.transactions`` is
an Array of [[provider-transactionresponse]] objects.

Expand All @@ -43,12 +43,12 @@ _subsection: Ethereum Naming Service (ENS) Methods

TODO: Explain ENS here...

_property: provider.lookupAddress(address) => Promise<string>
_property: provider.lookupAddress(address) => Promise<string> @<providers-lookupaddress> @SRC<providers/base-provider>
Performs a reverse lookup of the //address// in ENS using the
//Reverse Registrar//. If the name does not exist, or the
forward lookup does not match, ``null`` is returned.

_property: provider.resovleName(name) => Promise<string>
_property: provider.resolveName(name) => Promise<string<[Address](address)>> @<providers-resolvename> @SRC<providers/base-provider>
Looks up the address of //name//. If the name is not owned, or
does not have a //Resolver// configured, or the //Resolver// does
not have an address configured, ``null`` is returned.
Expand All @@ -59,7 +59,7 @@ _code: example-ens.js

_subsection: Logs Methods

_property: provider.getLogs(filter) => Promise<Array<[[provider-log]]>>
_property: provider.getLogs(filter) => Promise<Array<[[provider-log]]>> @<providers-getlogs> @SRC<providers/base-provider>
Returns the Array of [[provider-log]] matching the //filter//.

Keep in mind that many backends will discard old events, and that requests
Expand All @@ -69,73 +69,73 @@ execute the query.

_subsection: Network Status Methods

_property: provider.getNetwork() => Promise<[[provider-network]]>
_property: provider.getNetwork() => Promise<[[provider-network]]> @<providers-getnetwork> @SRC<providers/base-provider:method.BaseProvider.getNetwork>
Returns the [[provider-network]] this Provider is connected to.

_property: provider.getBlockNumber() => Promise<number>
_property: provider.getBlockNumber() => Promise<number> @<providers-getblocknumber> @SRC<providers/base-provider>
Returns the block number (or height) of the most recently mined block.

_property: provider.getGasPrice() => Promise<[[bignumber]]>
_property: provider.getGasPrice() => Promise<[[bignumber]]> @<providers-getgasprice> @SRC<providers/base-provider>
Returns a //best guess// of the [[gas-price]] to use in a transaction.


_subsection: Transactions Methods

_property: provider.call(transaction [ , blockTag = "latest" ]) => Promise<[[hexstring]]>
Returns the result of executing the //transaction//, using //call//. A call
_property: provider.call(transaction [ , blockTag = "latest" ]) => Promise<string<[[hexstring]]>> @<providers-call> @SRC<providers/base-provider>
Returns the result of executing the //transaction//, using //call//. A call
does not require any ether, but cannot change any state. This is useful
for calling gettings on Contracts.

_property: provider.estimateGas(transaction) => Promise<[[bignumber]]>
_property: provider.estimateGas(transaction) => Promise<[[bignumber]]> @<providers-estimategas> @SRC<providers/base-provider>
Returns an estimate of the amount of gas that would be required to submit //transaction//
to the network.

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.

_property: provider.sendTransaction(transaction) => Promise<[[provider-transactionresponse]]>
_property: provider.sendTransaction(transaction) => Promise<[[provider-transactionresponse]]> @<providers-sendtransaction> @SRC<providers/base-provider>
Submits //transaction// to the network to be mined. The //transaction// **must** be signed,
and be valid (i.e. the nonce is correct and the account has sufficient balance to pay
for the transaction).

_property: provider.waitForTransaction(transactionHash) => Promise<[[provider-transactionreceipt]]>
_property: provider.waitForTransaction(transactionHash) => Promise<[[provider-transactionreceipt]]> @<providers-waitfortransaction> @SRC<providers/base-provider>
Returns a Promise which will not resolve until //transactionHash// is mined.


_subsection: Event Emitter Methods

Explain events here...

_property: provider.on(eventName, listener) => this
_property: provider.on(eventName, listener) => this @<providers-on> @SRC<providers/base-provider>
Add a //listener// to be triggered for each //eventName//.

_property: provider.once(eventName, listener) => this
_property: provider.once(eventName, listener) => this @<providers-once> @SRC<providers/base-provider>
Add a //listener// to be triggered for only the next //eventName//,
at which time it be removed.

_property: provider.emit(eventName, ...args) => boolean
_property: provider.emit(eventName, ...args) => boolean @<providers-emit> @SRC<providers/base-provider>
Notify all listeners of //eventName//, passing //args// to each listener. This
is generally only used internally.

_property: provider.off(eventName [ , listener ]) => this
_property: provider.off(eventName [ , listener ]) => this @<providers-off> @SRC<providers/base-provider>
Remove a //listener// for //eventName//. If no //listener// is provided,
all listeners for //eventName// are removed.

_property: provider.removeAllListeners([ eventName ]) => this
_property: provider.removeAllListeners([ eventName ]) => this @<providers-removealllisteners> @SRC<providers/base-provider>
Remove all the listeners for //eventName//. If no //eventName// is provided,
**all** events are removed.

_property: provider.listenerCount([ eventName ]) => number
_property: provider.listenerCount([ eventName ]) => number @<providers-listenercount> @SRC<providers/base-provider>
Returns the number of listeners for //eventName//. If no //eventName// is
provided, the total number of listeners is returned.

_property: provider.listeners(eventName) => Array<Listener>
_property: provider.listeners(eventName) => Array<Listener> @<providers-listeners> @SRC<providers/base-provider>
Returns the list of Listeners for //eventName//.


_subsection: Inspection Methods

_property: Provider.isProvider(object) => boolean
_property: Provider.isProvider(object) => boolean @<providers-isprovider> @SRC<abstract-provider>
Returns true if and only if //object// is a Provider.

Loading

0 comments on commit 381a72d

Please sign in to comment.