Contracts
Explain what contracts are...
diff --git a/docs.wrm/README.md b/docs.wrm/README.md new file mode 100644 index 000000000..64b29053a --- /dev/null +++ b/docs.wrm/README.md @@ -0,0 +1,16 @@ +Documentation +============= + +These docs are built using [Flatworm Docs](https://github.com/ricmoo/flatworm). + +The output is placed in [docs](../docs) and generates both HTML and Markdown +files. + + +Building +-------- + +``` +/home/ricmoo/ethers.js> npm run build-docs +``` + diff --git a/docs.wrm/api/providers/provider.wrm b/docs.wrm/api/providers/provider.wrm index 981edffb5..a2b1dd131 100644 --- a/docs.wrm/api/providers/provider.wrm +++ b/docs.wrm/api/providers/provider.wrm @@ -137,5 +137,5 @@ Returns the list of Listeners for //eventName//. _subsection: Inspection Methods _property: Provider.isProvider(object) => boolean -Returns true if and only if object is a Provider. +Returns true if and only if //object// is a Provider. diff --git a/docs.wrm/config.json b/docs.wrm/config.json new file mode 100644 index 000000000..c44f8b1aa --- /dev/null +++ b/docs.wrm/config.json @@ -0,0 +1,9 @@ +{ + "title": "ethers", + "subtitle": "v5.0-beta", + "logo": "logo.svg", + "link": "https://docs-beta.ethers.io", + "markdown": { + "banner": "-----\n\nDocumentation: [html](https://docs-beta.ethers.io/)\n\n-----\n\n" + } +} diff --git a/docs.wrm/logo.svg b/docs.wrm/logo.svg new file mode 100644 index 000000000..bac18e568 --- /dev/null +++ b/docs.wrm/logo.svg @@ -0,0 +1,12 @@ + + + diff --git a/docs/README.md b/docs/README.md index 37fe1bb4a..6bc5c4694 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,9 +1,10 @@ ----- -test +Documentation: [html](https://docs-beta.ethers.io/) ----- + What is ethers? =============== @@ -140,4 +141,4 @@ older versions of the library. ----- -**Content Hash:** 488687b8320fc7da1517bdf2b1ac582250593622aca6b0b3244f61fc14973e42 +**Content Hash:** 6abeb4fa3f15b3443d89a26a6b0320f602a12368bc5ebbfb14a6cce682836167 \ No newline at end of file diff --git a/docs/api/README.md b/docs/api/README.md index cb03aa068..dd54277aa 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -1,3 +1,9 @@ +----- + +Documentation: [html](https://docs-beta.ethers.io/) + +----- + Application Programming Interface (API) ======================================= @@ -74,4 +80,4 @@ Here... ----- -**Content Hash:** 3b51f44082b56d5b7fd9be77c92e6871df8642a3307b24d478ee625dbe1d8585 \ No newline at end of file +**Content Hash:** cbd0b8ac4ada4bfee211c0553ac53e171a6900127d874743a0dedf7fa30618f3 \ No newline at end of file diff --git a/docs/api/contract/README.md b/docs/api/contract/README.md index 0fa29ad5e..8c91d1ffe 100644 --- a/docs/api/contract/README.md +++ b/docs/api/contract/README.md @@ -1,3 +1,9 @@ +----- + +Documentation: [html](https://docs-beta.ethers.io/) + +----- + Contracts @@ -14,4 +20,4 @@ Buckets ----- -**Content Hash:** c703f8cc79e5372fb818572209c72eaa54c68385c2021e6fc412594379d834e0 \ No newline at end of file +**Content Hash:** 190c93691014eae64ffcb66549f127aa73f4645fc7a4b3a2be9ae00216c79cf6 \ No newline at end of file diff --git a/docs/api/contract/index.html b/docs/api/contract/index.html index 00b794daa..316431dc4 100644 --- a/docs/api/contract/index.html +++ b/docs/api/contract/index.html @@ -1,6 +1,6 @@ -
Explain what contracts are...
Here...
-There are many services which offer a web API for accessing the Ethereum Blockchain. These Providers allow connecting to them, which simplifies development, since you do not need to run your own instance or cluster of Ethereum nodes.
However, this reliance on third-party services can reduce resiliance, security and increase the amount of required trust. To mitigate these issues, it is recommended you use a Default Provider.
Tra la la...
Tra la la...
Tra la la...
A Provider is an abstraction of a connection to the Ethereum network, providing a concise, consistent interface to standard Ethereum node functionality.
The ethers.js library provides several options which should cover the vast majority of use-cases, but also includes the necessary functions and classes for sub-classing if a more custom configuration is necessary.
Most users should be able to simply use the Default Provider.
Returns a new Provider, backed by multiple services, connected to network. Is no network is provided, homestead (i.e. mainnet) is used.
Explain here...
TODO... Explain
TODO... Explain
TODO... Explain
Others...
The quorum the backend responses must agree upon before a result will be resolved. By default this is half the sum of the weights.
The weight each of the Providers adds to a results acceptance.
Explain...
Explain...
Explain what a provider is...
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.
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.
Returns the list of Listeners for eventName.
Returns true if and only if object is a Provider.
Returns true if and only if object is a Provider.
A TransactionResponse ..
TODO
TODO
Tra la la...
TODO
TODO
TODO
Explain addresses,formats and checksumming here.
Also see: Constants.AddressZero
TODO
TODO
TODO
TODO
TODO
Explain about BigNumber here...
Returns an instance of a BigNumber for aBigNumberish.
The BigNumber class is immutable, so no operations can change the value it represents.
@@ -55,11 +55,11 @@Returns true if and only if the object is a BigNumber object.
A few short notes on numbers...
The first problem many encounter when dealing with Ethereum is the concept of numbers. Most common currencies are broken down with very little granularity. For example, there are only 100 cents in a single dollar. However, there are 1018 wei in a single ether.
JavaScript uses IEEE 754 double-precision binary floating point numbers to represent numeric values. As a result, there are holes in the integer set after 9,007,199,254,740,991; which is problematic for Ethereum because that is only around 0.009 ether (in wei), which means any value over that will begin to experience rounding errors.
To demonstrate how this may be an issue in your code, consider:
-To remedy this, all numbers (which can be large) are stored and manipulated as Big Numbers.
The functions parseEther( etherString ) and formatEther( wei ) can be used to convert between string representations, which are displayed to or entered by the user and Big Number representations which can have mathematical operations handled safely.
To remedy this, all numbers (which can be large) are stored and manipulated as Big Numbers.
The functions parseEther( etherString ) and formatEther( wei ) can be used to convert between string representations, which are displayed to or entered by the user and Big Number representations which can have mathematical operations handled safely.
Tra la la...
Converts aBigNumberish to a Hexstring, with no unecessary leading zeros. The result of this function can be of odd-length.
Return the flat-format of a SignatureLike, which is 65 bytes (130 nibbles) long, concatenating the r, s and v of a Signature.
Return the full expanded-format of a SignatureLike or a flat-format Hexstring. Any missing properties will be computed.
Return the full expanded-format of a SignatureLike or a flat-format Hexstring. Any missing properties will be computed.
The ethers.contants Object contains commonly used values.
The BigNumber value representing "1"
.
The BigNumber value representing "2"
.
The BigNumber value representing "1000000000000000000"
, which is the number of Wei per Ether.
The BigNumber value representing the maximum uint256
value.
The BigNumber value representing the maximum uint256
value.
When creating an Application, it is useful to convert between user-friendly strings (usually displaying ether) and the machine-readable values that contracts and maths depend on (usually in wei).
For example, a Wallet may specify the balance in ether, and gas prices in gwei for the User Interface, but when sending a transaction, both must be specified in wei.
The parseUnits will parse a string representing ether, such as 1.1
into a BigNumber in wei, and is useful when a user types in a value, such as sending 1.1 ether.
The formatUnits will format a BigNumberish into a string, which is useful when displaying a balance.
Returns a string representation of value formatted with unit digits (if it is a number) or to the unit specified (if a string).
The equivalent to calling formatUnits(value, "ether")
.
Returns a BigNumber representation of value, parsed with unit digits (if it is a number) or from the unit specified (if a string).
The equivalent to calling parseUnits(value, "ether")
.
The equivalent to calling parseUnits(value, "ether")
.
Returns a floating-point JavaScript number value of fixednumber. Due to rounding in JavaScript numbers, the value is only approximate.
Returns true if and only if value is a FixedNumber.
Returns true if and only if value is a FixedNumber.
Explain what hash functions are?
When using the Solidity abi.packEncoded(...)
function, a non-standard tightly packed version of encoding is used. These functions implement the tightly packing algorithm.
Returns the non-standard encoded arrayOfValues packed according to their respecive type in arrayOfTypes.
Returns the KECCAK256 of the non-standard encoded arrayOfValues packed according to their respective type in arrayOfTypes.
Returns the SHA2-256 of the non-standard encoded arrayOfValues packed according to their respective type in arrayOfTypes.
Returns the SHA2-256 of the non-standard encoded arrayOfValues packed according to their respective type in arrayOfTypes.
These utilities are used extensively within the library, but are also quite useful for application developers.
-Tra la la
The Decomposed Normalization Form. This form uses multiple codepoints (when necessary) to compose a character.
For example, the é is made up of two codepoints, "0x0065"
(which is the letter "e"
) and "0x0301"
which is a special diacritic UTF-8 codepoint which indicates the previous character should have an acute accent.
The Composed Normalization Form with Canonical Equivalence. The Canonical representation folds characters which have the same syntactic representation but different semantic meaning.
For example, the Roman Numeral I, which has a UTF-8 codepoint "0x2160"
, is folded into the capital letter I, "0x0049"
.
The Decomposed Normalization Form with Canonical Equivalence. See NFKC for more an example.
Only certain specified characters are folded in Canonical Equivalence, and thus it should not be considered a method to acheive any level of security from homoglyph attacks.
Only certain specified characters are folded in Canonical Equivalence, and thus it should not be considered a method to acheive any level of security from homoglyph attacks.
Explain how topics and such work
Explain how topics and such work
The gas price is used somewhat like a bid, indicating an amount you are willing to pay (per unit of execution) to have your transaction processed.
This is a very breif overview of some aspects of Ethereum which developers can make use of or should be aware of.
-The ethers.js library is something that I've written out of necessity, and has grown somewhat organically over time.
Many things are the way they are for good (at the time, at least) reasons, but I always welcome criticism, and am completely willing to have my mind changed on things.
So, pull requests are always welcome, but please keep a few points in mind:
In general, please start an issue before beginning a pull request, so we can have a public discussion and figure out the best way to address to problem/feature. :)
use npm run auto-build
use npm run update-version
use npm run auto-build
use npm run update-version
Cooking...
Cooking...
The Flatworm Docs rendering script is designed to be very simple, but provide enough formatting necessary for documenting JavaScript libraries.
A lot of its inspiration came from Read the Docs and the Sphinx project.
The markdown is simple and does not have the flexibility of other dialects, but allows for bold, italic, underlined, monospaced
, super-scripted text, supporting links and lists.
It is generally better practice (for security reasons) to copy the ethers library to your own webserver and serve it yourself.
For quick demos or prototyping though, it can be loaded in your Web Applications from our CDN.
The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally designed for use with ethers.io and has since expanded into a much more general-purpose library.
This section will be kept up to date, linking to documentation of older versions of the library.
This section will be kept up to date, linking to documentation of older versions of the library.
The ethers library (including all dependencies) are available under the MIT License, which permits a wide variety of uses.
Copyright © 2019 Richard Moore.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2019 Richard Moore.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Migratimg...
test
test
test
Here goes info about testing
Here goes info about testing