Skip to content

Commit 209f3a8

Browse files
committed
Updated docs and added redirects.
1 parent 5b0e839 commit 209f3a8

File tree

120 files changed

+2719
-967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2719
-967
lines changed

docs.wrm/api/contract/contract-factory.wrm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
_section: ContractFactory @<ContractFactory> @SRC<contracts:class.ContractFactory>
22

3+
@TODO: Fill this in, including @SRC links
34

45
_subsection: Creating Instances @<ContractFactory--creating>
56

67
_property: new ethers.ContractFactory(interface, bydecode [ , signer ]) @SRC<contracts:constructor.ContractFactory>
78

89
_property: ContractFactory.fromSolidity(compilerOutput [ , signer ]) => [[ContractFactory]]
910

10-
_property: contractFactory.connect(signer) => [[Contract]]
11+
_property: contractFactory.connect(signer) => [[Contract]] @<ContractFactory-connect>
1112

1213

1314
_subsection: Properties @<ContractFactory--properties>
@@ -21,10 +22,10 @@ _property: contractFactory.signer => [[Signer]]
2122

2223
_subsection: Methods @<ContractFactory--methods>
2324

24-
_property: contractFactory.attach(address) => [[Contract]]
25+
_property: contractFactory.attach(address) => [[Contract]] @<ContractFactory-attach>
2526

2627
Return an instance of a [[Contract]] attched to //address//. This is the
27-
same as using the [Contract constructor](contract--creating) with
28+
same as using the [Contract constructor](Contract--creating) with
2829
//address// and this the the //interface// and //signerOrProvider// passed
2930
in when creating the ContractFactory.
3031

@@ -33,7 +34,7 @@ _property: contractFactory.getDeployTransaction(...args) => [[UnsignedTransactio
3334
Returns the unsigned transaction which would deploy this Contract with //args// passed
3435
to the Contract's constructor.
3536

36-
_property: contractFactory.deploy(...args) => Promise<[[Contract]]>
37+
_property: contractFactory.deploy(...args) => Promise<[[Contract]]> @<ContractFactory-deploy>
3738

3839
Uses the signer to deploy the Contract with //args// passed into tgee constructor and
3940
retruns a Contract which is attached to the address where this contract **will** be

docs.wrm/api/contract/contract.wrm

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ _section: Contract @<Contract> @SRC<contracts:class.Contract>
22

33
Explain contract here...
44

5-
_subsection: Creating Instances @<contract--creating>
5+
_subsection: Creating Instances @<Contract--creating>
66

77
_property: new ethers.Contract(address, abi, signerOrProvider) @src<contracts:constructor.Contract>
88

9-
_property: contract.attach(addressOrName) => [[Contract]] @<contract-attach> @SRC<contracts:Contract.attach>
9+
_property: contract.attach(addressOrName) => [[Contract]] @<Contract-attach> @SRC<contracts:Contract.attach>
1010
Returns a new instance of the **Contract** attached to a new
1111
address. This is useful if there are multiple similar or identical
1212
copies of a Contract on the network and you wish to interact with
1313
each of them.
1414

15-
_property: contract.connect(providerOrSigner) => [[Contract]] @<contract-connect> @SRC<contracts:Contract.connect>
15+
_property: contract.connect(providerOrSigner) => [[Contract]] @<Contract-connect> @SRC<contracts:Contract.connect>
1616
Returns a new instance of the Contract, but connected to
1717
//providerOrSigner//.
1818

@@ -23,7 +23,7 @@ By passing in a [[Signer]]. the will return a **Contract** which
2323
will act on behalf of that signer.
2424

2525

26-
_subsection: Properties @<contrct--properties>
26+
_subsection: Properties @<Contract--properties>
2727

2828
_property: contract.address => string<[[address]]>
2929
This is the address (or ENS name) the contract was constructed with.
@@ -49,41 +49,41 @@ _property: contract.signer => [[Signer]]
4949
If a signer was provided to the constructor, this is that signer.
5050

5151

52-
_subsection: Methods
52+
_subsection: Methods @<Contract--methods>
5353

54-
_property: contract.deployed() => Promise<[[Contract]]> @<contract-deployed> @SRC<contracts>
54+
_property: contract.deployed() => Promise<[[Contract]]> @<Contract-deployed> @SRC<contracts>
5555

56-
_property: Contract.isIndexed(value) => boolean @<contract-isIndexed> @SRC<contracts>
56+
_property: Contract.isIndexed(value) => boolean @<Contract-isIndexed> @SRC<contracts>
5757

5858

59-
_subsection: Events
59+
_subsection: Events @<Contract--events>
6060

61-
_property: contract.queryFilter(event [ , fromBlockOrBlockHash [ , toBlock ]) => Promise<Array<Event>> @<contract-queryFilter> @SRC<contracts>
61+
_property: contract.queryFilter(event [ , fromBlockOrBlockHash [ , toBlock ]) => Promise<Array<Event>> @<Contract-queryFilter> @SRC<contracts>
6262
Return Events that match the //event//.
6363

64-
_property: contract.listenerCount([ event ]) => number @<contract-listenerCount> @SRC<contracts:Contract.listenerCount>
64+
_property: contract.listenerCount([ event ]) => number @<Contract-listenerCount> @SRC<contracts:Contract.listenerCount>
6565
Return the number of listeners that are subscribed to //event//. If
6666
no event is provided, returns the total count of all events.
6767

68-
_property: contract.listeners(event) => Array<Listener> @<contract-listeners> @SRC<contracts:Contract.listeners>
68+
_property: contract.listeners(event) => Array<Listener> @<Contract-listeners> @SRC<contracts:Contract.listeners>
6969
Return a list of listeners that are subscribed to //event//.
7070

71-
_property: contract.off(event, listener) => this @<contract-off> @SRC<contracts>
71+
_property: contract.off(event, listener) => this @<Contract-off> @SRC<contracts>
7272
Unsubscribe //listener// to //event//.
7373

74-
_property: contract.on(event, listener) => this @<contract-on> @SRC<contracts>
74+
_property: contract.on(event, listener) => this @<Contract-on> @SRC<contracts>
7575
Subscribe to //event// calling //listener// when the event occurs.
7676

77-
_property: contract.once(event, listener) => this @<contract-once> @SRC<contracts>
77+
_property: contract.once(event, listener) => this @<Contract-once> @SRC<contracts>
7878
Subscribe once to //event// calling //listener// when the event
7979
occurs.
8080

81-
_property: contract.removeAllListeners([ event ]) => this @<contract-removeAllListeners> @SRC<contracts:Contract.removeAllListeners>
81+
_property: contract.removeAllListeners([ event ]) => this @<Contract-removeAllListeners> @SRC<contracts:Contract.removeAllListeners>
8282
Unsubscribe all listeners for //event//. If no event is provided,
8383
all events are unsubscribed.
8484

8585

86-
_subsection: Meta-Class @<contract--metaclass>
86+
_subsection: Meta-Class @<Contract--metaclass>
8787

8888
A Meta-Class is a Class which has any of its properties determined
8989
at run-time. The **Contract** object uses a Contract's ABI to
@@ -92,15 +92,15 @@ describe the generic ways to interact with the properties added
9292
at run-time during the **Contract** constructor.
9393

9494

95-
_heading: Read-Only Methods (constant) @<contract--readonly>
95+
_heading: Read-Only Methods (constant) @<Contract--readonly>
9696

9797
A constant method is read-only and evaluates a small amount of EVM
9898
code against the current blockchain state and can be computed by
9999
asking a single node, which can return a result. It is therefore
100100
free and does not require any ether, but **cannot make changes** to
101101
the blockchain state..
102102

103-
_property: contract.METHOD_NAME(...args [ overrides ]) => Promise<any> @<contract-functionsCall>
103+
_property: contract.METHOD_NAME(...args [, overrides ]) => Promise<any> @<Contract-functionsCall>
104104
The type of the result depends on the ABI.
105105

106106
For values that have a simple meaning in JavaScript, the types are fairly
@@ -113,8 +113,24 @@ number is used. Otherwise a [[BigNumber]] is returned.
113113

114114
For bytes (both fixed length and dynamic), a [[DataHexString]] is returned.
115115

116+
_property: contract.functions.METHOD_NAME(...args [, overrides ]) => Promise<[[Result]]>
116117

117-
_heading: Write Methods (non-constant) @<contract--write>
118+
The result will always be a [[Result]], even if there is only a single
119+
return value type.
120+
121+
This simplifies frameworks which wish to use the [[Contract]] object,
122+
since they do not need to inspect the return types to unwrap simplified
123+
functions.
124+
125+
Another use for this method is for error recovery. For example, if a
126+
function result is an invalid UTF-8 string, the normal call using the
127+
above meta-class function will throw an exception. This allows using the
128+
Result access error to access the low-level bytes and reason for the error
129+
allowing an alternate UTF-8 error strategy to be used.
130+
131+
Most developers should not require this.
132+
133+
_heading: Write Methods (non-constant) @<Contract--write>
118134

119135
A non-constant method requires a transaction to be signed and requires
120136
payment in the form of a fee to be paid to a miner. This transaction
@@ -132,7 +148,7 @@ it is sent to the network. This requires the **Contract** has a
132148
signer.
133149

134150

135-
_heading: Write Methods Analysis @<contract--check>
151+
_heading: Write Methods Analysis @<Contract--check>
136152

137153
There are secveral options to analyze properties and results of a
138154
write method without actually executing it.
@@ -154,9 +170,9 @@ return the result.
154170
This does not actually chagne any state, but is free. This in some cases
155171
can be used to determine if a transaction will fail or succeed.
156172

157-
This otherwise functions the same as a [Read-Only Method](contract--readonly).
173+
This otherwise functions the same as a [Read-Only Method](Contract--readonly).
158174

159-
_heading: Event Filters @<contract-filters>
175+
_heading: Event Filters @<Contract--filters>
160176
An event filter is made up of topics, which are values logged in a
161177
[[link-wiki-bloomfilter]], allowing efficient searching for entries
162178
which match a filter.

docs.wrm/api/index.wrm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_section: Application Programming Interface @NAV<API>
1+
_section: Application Programming Interface @<api> @NAV<API>
22

33
An Application Programming Interface (API) is the formal
44
specification of the library.

docs.wrm/api/other/assembly/index.wrm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
_section: Assembly
22

3+
This module should still be considered fairly experimental.
4+
35
_toc:
46
dialect
57
api

docs.wrm/api/providers/api-providers.wrm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ _property: provider.getHistory(address) => Array<History> @src<providers>
7777
@TODO... Explain
7878

7979

80-
_subsection: InfuraProvider @INHERIT<[[UrlJsonRpcProvider]]> @src<providers:class.InfuraProvider>
80+
_subsection: InfuraProvider @<InfuraProvider> @INHERIT<[[UrlJsonRpcProvider]]> @src<providers:class.InfuraProvider>
8181

8282
The **InfuraProvider** is backed by the popular [INFURA](link-infura)
8383
Ethereum service.
@@ -137,7 +137,7 @@ provider = new InfuraProvider("homestead", {
137137
});
138138

139139

140-
_subsection: AlchemyProvider @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.AlchemyProvider>
140+
_subsection: AlchemyProvider @<AlchemyProvider> @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.AlchemyProvider>
141141

142142
The **AlchemyProvider** is backed by [Alchemy](link-alchemy).
143143

@@ -183,7 +183,7 @@ provider = new AlchemyProvider(null, apiKey);
183183
provider = new AlchemyProvider("homestead", apiKey);
184184

185185

186-
_subsection: CloudflareProvider @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.CloudflareProvider>
186+
_subsection: CloudflareProvider @<CloudflareProvider> @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.CloudflareProvider>
187187

188188
The CloudflareProvider is backed by the [Cloudflare Ethereum Gateway](link-cloudflare).
189189

docs.wrm/api/providers/index.wrm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_section: Providers
1+
_section: Providers @<providers>
22

33
A **Provider** is an abstraction of a connection to the
44
Ethereum network, providing a concise, consistent interface
@@ -41,14 +41,14 @@ _table: Option Properties
4141
$Alchemy: [[link-alchemy]] API Token
4242
$Etherscan: [[link-etherscan]] API Token
4343
$Infura: [[link-infura]] Project ID or ProjectID and Project Secret
44-
$Quroum: The number of backends that must agree
44+
$Quorum: The number of backends that must agree
4545
//(default: 2 for mainnet, 1 for testnets)//
4646

47-
| **Property** | **Description** |
48-
| alchemy | $Alchemt |
49-
| etherscan | $Etherscan |
50-
| infura | $Infura |
51-
| quorum | $Quorum |
47+
| **Property** | **Description** |
48+
| //alchemy// | $Alchemy |
49+
| //etherscan// | $Etherscan |
50+
| //infura// | $Infura |
51+
| //quorum// | $Quorum |
5252

5353
_note: Note: API Keys
5454

docs.wrm/api/providers/other.wrm

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,50 @@ _subsection: Web3Provider @<Web3Provider> @INHERIT<[[JsonRpcProvider]]>
9797

9898
The Web3Provider is meant to ease moving from a [web3.js based](link-web3)
9999
application to ethers by wraping an existing Web3-compatible (such as a
100-
[Web3HttpProvider](link-web3-http)[Web3IpcProvider](link-web3-ipc) or
100+
[Web3HttpProvider](link-web3-http), [Web3IpcProvider](link-web3-ipc) or
101101
[Web3WsProvider](link-web3-ws)) and exposing it as an ethers.js [[Provider]]
102102
which can then be used with the rest of the library.
103103

104-
_property: new ethers.providers.Web3Provider(web3Provider [, network ])
105-
Create a new **Web3Provider**, which wraps an [EIP-1193 Provider]() or
104+
This may also be used to wrap a standard [EIP-1193 Provider](link-eip-1193].
105+
106+
_property: new ethers.providers.Web3Provider(externalProvider [, network ])
107+
Create a new **Web3Provider**, which wraps an [EIP-1193 Provider](link-eip-1193) or
106108
Web3Provider-compatible Provider.
107109

108110
_property: web3Provider.provider => Web3CompatibleProvider
109111
The provider used to create this instance.
110112

113+
_heading: ExternalProvider @<Web3Provider--ExternalProvider>
114+
115+
An **ExternalProvider** can be either one for the above mentioned Web3
116+
Providers (or otherwise compatible) or an [[link-eip-1193]] provider.
117+
118+
An ExternalProvider must offer one of the following signatures, and the
119+
first matching is used:
120+
121+
_property: externalProvider.request(request) => Promise<any>
122+
123+
This follows the [[link-eip-1193]] API signature.
124+
125+
The //request// should be a standard JSON-RPC payload, which should at
126+
a minimum specify the ``method`` and ``params``.
127+
128+
The result should be the actual result, which differs from the Web3.js
129+
response, which is a wrapped JSON-RPC response.
130+
131+
_property: externalProvider.sendAsync(request, callback) => void
132+
133+
This follows the [Web3.js Provider Signature](link-web3-send).
134+
135+
The //request// should be a standard JSON-RPC payload, which should at
136+
a minimum specify the ``method`` and ``params``.
137+
138+
The //callback// should use the error-first calling semantics, so
139+
``(error, result)`` where the result is a JSON-RPC wrapped result.
140+
141+
_property: externalProvider.send(request, callback) => void
142+
143+
This is identical to ``sendAsync``. Historically, this used a synchronous
144+
web request, but no current browsers support this, so its use this way
145+
was deprecated quite a long time ago
146+

0 commit comments

Comments
 (0)