Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ethers-io/ethers.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.2
Choose a base ref
...
head repository: ethers-io/ethers.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.3
Choose a head ref
  • 13 commits
  • 75 files changed
  • 1 contributor

Commits on Jun 13, 2020

  1. Create security policy.

    Create security policy.
    ricmoo authored Jun 13, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    88e6849 View commit details

Commits on Jun 14, 2020

  1. Copy the full SHA
    f99029b View commit details

Commits on Jun 15, 2020

  1. Fixed typo in docs (#885).

    ricmoo committed Jun 15, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8ed67a5 View commit details
  2. Updated badges in docs.

    ricmoo committed Jun 15, 2020
    Copy the full SHA
    d00362e View commit details

Commits on Jun 18, 2020

  1. Copy the full SHA
    f9e9347 View commit details
  2. Updated docs.

    ricmoo committed Jun 18, 2020
    Copy the full SHA
    1a4f7d1 View commit details

Commits on Jun 29, 2020

  1. Copy the full SHA
    987b535 View commit details
  2. Copy the full SHA
    8c1ff4c View commit details
  3. Copy the full SHA
    c53864d View commit details
  4. Copy the full SHA
    08c74e9 View commit details
  5. Updated elliptic package to address possible malleability issue; whic…

    …h should not affect Ethereum.
    ricmoo committed Jun 29, 2020
    Copy the full SHA
    9e14345 View commit details
  6. Fixed typo in error string.

    ricmoo committed Jun 29, 2020
    Copy the full SHA
    7fe702d View commit details
  7. Updated dist files.

    ricmoo committed Jun 29, 2020
    Copy the full SHA
    96cb440 View commit details
Showing with 1,177 additions and 8,382 deletions.
  1. +13 −0 CHANGELOG.md
  2. +7 −7 README.md
  3. +33 −0 SECURITY.md
  4. +100 −0 admin/cmds/serve-docs.js
  5. +15 −1 docs.wrm/api/providers/api-providers.wrm
  6. +18 −1 docs.wrm/api/providers/other.wrm
  7. +77 −6 docs.wrm/contributing.wrm
  8. +4 −3 docs.wrm/documentation.wrm
  9. +9 −16 package-lock.json
  10. +3 −1 package.json
  11. +1 −1 packages/bignumber/lib.esm/_version.d.ts
  12. +1 −1 packages/bignumber/lib.esm/_version.js
  13. +1 −0 packages/bignumber/lib.esm/fixednumber.d.ts
  14. +13 −0 packages/bignumber/lib.esm/fixednumber.js
  15. +1 −1 packages/bignumber/lib/_version.d.ts
  16. +1 −1 packages/bignumber/lib/_version.js
  17. +1 −0 packages/bignumber/lib/fixednumber.d.ts
  18. +13 −0 packages/bignumber/lib/fixednumber.js
  19. +2 −2 packages/bignumber/package.json
  20. +1 −1 packages/bignumber/src.ts/_version.ts
  21. +16 −0 packages/bignumber/src.ts/fixednumber.ts
  22. +0 −7 packages/errors/.npmignore
  23. +0 −21 packages/errors/LICENSE.md
  24. +0 −6 packages/errors/README.md
  25. +0 −1 packages/errors/lib.esm/_version.d.ts
  26. +0 −1 packages/errors/lib.esm/_version.js
  27. +0 −29 packages/errors/lib.esm/index.d.ts
  28. +0 −245 packages/errors/lib.esm/index.js
  29. +0 −1 packages/errors/lib/_version.d.ts
  30. +0 −3 packages/errors/lib/_version.js
  31. +0 −29 packages/errors/lib/index.d.ts
  32. +0 −266 packages/errors/lib/index.js
  33. +0 −26 packages/errors/package.json
  34. +0 −1 packages/errors/src.ts/_version.ts
  35. +0 −344 packages/errors/src.ts/index.ts
  36. +0 −11 packages/errors/tsconfig.json
  37. +84 −9 packages/ethers/README.md
  38. +2 −2 packages/ethers/dist/ethers-all.esm.min.js
  39. +2 −2 packages/ethers/dist/ethers-all.umd.min.js
  40. +281 −3,636 packages/ethers/dist/ethers.esm.js
  41. +2 −2 packages/ethers/dist/ethers.esm.min.js
  42. +298 −3,640 packages/ethers/dist/ethers.umd.js
  43. +2 −2 packages/ethers/dist/ethers.umd.min.js
  44. +1 −1 packages/ethers/lib.esm/_version.d.ts
  45. +1 −1 packages/ethers/lib.esm/_version.js
  46. +1 −1 packages/ethers/lib/_version.d.ts
  47. +1 −1 packages/ethers/lib/_version.js
  48. +2 −2 packages/ethers/package.json
  49. +1 −1 packages/ethers/src.ts/_version.ts
  50. +1 −1 packages/providers/lib.esm/_version.d.ts
  51. +1 −1 packages/providers/lib.esm/_version.js
  52. +2 −1 packages/providers/lib.esm/index.d.ts
  53. +19 −2 packages/providers/lib.esm/index.js
  54. +4 −2 packages/providers/lib.esm/url-json-rpc-provider.d.ts
  55. +24 −6 packages/providers/lib.esm/url-json-rpc-provider.js
  56. +1 −1 packages/providers/lib.esm/websocket-provider.d.ts
  57. +1 −1 packages/providers/lib/_version.d.ts
  58. +1 −1 packages/providers/lib/_version.js
  59. +2 −1 packages/providers/lib/index.d.ts
  60. +19 −0 packages/providers/lib/index.js
  61. +4 −2 packages/providers/lib/url-json-rpc-provider.d.ts
  62. +35 −8 packages/providers/lib/url-json-rpc-provider.js
  63. +1 −1 packages/providers/lib/websocket-provider.d.ts
  64. +2 −2 packages/providers/package.json
  65. +1 −1 packages/providers/src.ts/_version.ts
  66. +22 −1 packages/providers/src.ts/index.ts
  67. +20 −5 packages/providers/src.ts/url-json-rpc-provider.ts
  68. +1 −1 packages/providers/src.ts/websocket-provider.ts
  69. +1 −1 packages/signing-key/lib.esm/_version.d.ts
  70. +1 −1 packages/signing-key/lib.esm/_version.js
  71. +1 −1 packages/signing-key/lib/_version.d.ts
  72. +1 −1 packages/signing-key/lib/_version.js
  73. +3 −3 packages/signing-key/package.json
  74. +1 −1 packages/signing-key/src.ts/_version.ts
  75. +0 −3 tsconfig.project.json
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,19 @@ Changelog

This change log is managed by `scripts/cmds/update-versions` but may be manually updated.

ethers/v5.0.3 (2020-06-29 00:50)
--------------------------------

- Fixed typo in error string. ([7fe702d](https://github.com/ethers-io/ethers.js/commit/7fe702d59b0b81d2812e407b99a1e98e0e18ba03))
- Updated elliptic package to address possible malleability issue; which should not affect Ethereum. ([9e14345](https://github.com/ethers-io/ethers.js/commit/9e1434503e2a0280e9918c4eadb4d972b062b3b0))
- Fixed FixedNumber unguarded constructor and added isZero. ([#898](https://github.com/ethers-io/ethers.js/issues/898); [08c74e9](https://github.com/ethers-io/ethers.js/commit/08c74e9a132f37ab8cc3fb5dab3bd1fd708ee702))
- Added StaticJsonRpcProvider for reducing calls to chainId in certain cases. ([#901](https://github.com/ethers-io/ethers.js/issues/901); [c53864d](https://github.com/ethers-io/ethers.js/commit/c53864de0af55dd8ec8ca5681e78da380d85250a))
- Allow getDefaultProvider to accept a URL as a network. ([8c1ff4c](https://github.com/ethers-io/ethers.js/commit/8c1ff4c862b8cecb04c98d71910870e0b73867a0))
- Make network an optional parameter to WebSocketProvider. ([987b535](https://github.com/ethers-io/ethers.js/commit/987b5354cc18ed41620c43910ac163f358d91b5d))
- Removed deprecated errors package. ([f9e9347](https://github.com/ethers-io/ethers.js/commit/f9e9347e69133354c3d65c1f47475ddac8a793cf))
- Updated badges in docs. ([d00362e](https://github.com/ethers-io/ethers.js/commit/d00362eb706cfbf9911611e8d934260061cfbbd2))
- Create security policy. Create security policy. ([88e6849](https://github.com/ethers-io/ethers.js/commit/88e68495b67d9268ee66362b08c9b691d03ab58a))

ethers/v5.0.2 (2020-06-13 21:36)
--------------------------------

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The Ethers Project
==================

[![npm (tag)](https://img.shields.io/npm/v/ethers/next)](https://www.npmjs.com/package/ethers/v/next)
[![npm (tag)](https://img.shields.io/npm/v/ethers)](https://www.npmjs.com/package/ethers)
[![Node.js CI](https://github.com/ethers-io/ethers.js/workflows/Node.js%20CI/badge.svg?branch=ethers-v5-beta)](https://github.com/ethers-io/ethers.js/actions?query=workflow%3A%22Node.js+CI%22)

A complete Ethereum wallet implementation and utilities in JavaScript (and TypeScript).
@@ -38,13 +38,13 @@ Installing
**node.js**

```
/home/ricmoo/some_project> npm install --save ethers@next
/home/ricmoo/some_project> npm install --save ethers
```

**browser (UMD)**

```
<script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js" type="text/javasctipt">
<script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js" type="text/javascript">
</script>
```

@@ -60,13 +60,13 @@ Installing
Documentation
-------------

Browse the documentation online:
Browse the [documentation](https://docs.ethers.io/v5/) online:

- [Getting Started](https://docs.ethers.io/)
- [Full API Documentation](https://docs.ethers.io/)
- [Getting Started](https://docs.ethers.io/v5/getting-started/)
- [Full API Documentation](https://docs.ethers.io/v5/api/)
- [Various Ethereum Articles](https://blog.ricmoo.com/)

Or browser the entire documentations as a [single page](https://docs.ethers.io/single-page/).
Or browser the entire documentations as a [single page](https://docs.ethers.io/single-page/) to make searching easier.


Ancillary Packages
33 changes: 33 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Security Policy

## Supported Versions

Maintaining multiple versions of the library is quite time consuming, so
the majority of the effort is focused on the latest major release.

If you do require a version outside of this chart updated with patch fix,
please [contact me](mailto:github@ricmoo.com).

| Version | Supported | Initial Release |
| ------- | ------------------------------------------ | ----------------- |
| 5.0.x | :white_check_mark: | 2020-06-12 |
| 4.0.x | :white_check_mark: (security patches only) | 2018-10-01 |
| 3.0.x | :x: | 2018-03-05 |
| 2.2.x | :x: | 2018-01-11 |
| 2.1.x | :x: | 2017-05-22 |
| 2.0.x | :x: | 2017-04-05 |
| 1.0.x | :x: | 2016-08-23 |
| 0.0.x | :x: | 2016-07-14 |


## Reporting a Vulnerability

If you identify a security vulnerability with this library (or any dependency),
please do not hesitate to contact [github@ricmoo.com](mailto:github@ricmoo.com)
immediately.

I try to respond within the same day and will address any concern as quickly
as possible (including code fixes and publishing to NPM).

Any vulnerability will also be published to this file, along with credits,
pertinent information and links to fixes.
100 changes: 100 additions & 0 deletions admin/cmds/serve-docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
const fs = require("fs");
const http = require("http");
const path = require("path");

function getMime(filename) {
const comps = filename.split('.');
const ext = comps[comps.length - 1];
switch (ext.toLowerCase()) {
case 'css': return 'text/css';
case 'doctree': return 'application/x-doctree';
case 'eot': return 'application/vnd.ms-fontobject';
case 'gif': return 'image/gif';
case 'html': return 'text/html';
case 'js': return 'application/javascript';
case 'jpg': return 'image/jpeg';
case 'jpeg': return 'image/jpeg';
case 'md': return 'text/markdown';
case 'pickle': return 'application/x-pickle';
case 'png': return 'image/png';
case 'svg': return 'image/svg+xml';
case 'ttf': return 'application/x-font-ttf';
case 'txt': return 'text/plain';
case 'woff': return 'application/font-woff';
}
console.log('NO MIME', filename);
return undefined;
}

function start(root, options) {
if (root == null) { throw new Error("root required"); }
if (options == null) { options = { }; }
if (options.port == null) { options.port = 8000; }
root = path.resolve(root);

const server = http.createServer((req, resp) => {

// Follow redirects in options
if (options.redirects && options.redirects[req.url]) {
resp.writeHead(301, { Location: options.redirects[req.url] });
resp.end();
return;
}

let filename = path.resolve(root, "." + req.url);

// Make sure we aren't crawling out of our sandbox
if (req.url[0] !== "/" || filename.substring(0, filename.length) !== filename) {
resp.writeHead(403);
resp.end();
return;
}

try {
const stat = fs.statSync(filename);
if (stat.isDirectory()) {

// Redirect bare directory to its path (i.e. "/foo" => "/foo/")
if (req.url[req.url.length - 1] !== "/") {
resp.writeHead(301, { Location: req.url + "/" });
resp.end();
return;
}

filename += "/index.html";
}

const content = fs.readFileSync(filename);

resp.writeHead(200, {
"Content-Length": content.length,
"Content-Type": getMime(filename)
});
resp.end(content);
return;

} catch (error) {
if (error.code === "ENOENT") {
resp.writeHead(404, { });
resp.end();
return;
}

resp.writeHead(500, { });
resp.end();
return;
}
});

server.listen(options.port, () => {
console.log(`Listening on port: ${ options.port }`);
});

return server;
}

start(path.resolve(__dirname, "../../docs"), {
redirects: {
"/": "/v5/"
}
});
16 changes: 15 additions & 1 deletion docs.wrm/api/providers/api-providers.wrm
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ _subsection: InfuraProvider @<InfuraProvider> @INHERIT<[[UrlJsonRpcProvider]]> @
The **InfuraProvider** is backed by the popular [INFURA](link-infura)
Ethereum service.

_property: new ethers.providers.InfuraProvider([ network = "homestead", [ apiKey ] ])
_property: new ethers.providers.InfuraProvider([ network = "homestead", [ apiKey ] ]) @SRC<providers>
Create a new **InfuraProvider** connected to //network// with
the optional //apiKey//.

@@ -96,6 +96,12 @@ specify a [Project Secret](link-infura-secret) which can be used
on non-public sources (like on a server) to further secure your
API access and quotas.

_property: InfuraProvider.getWebSocketProvider([ network [ , apiKey ] ]) => [[WebSocketProvider]] @<InfuraProvider-getWebSocketProvider> @SRC<providers>
Create a new [[WebSocketProvider]] using the INFURA web-socket endpoint
to connect to //network// with the optional //apiKey//.

The //network// and //apiKey// are specified the same as [the constructor](InfuraProvider).

_note: Note: Default API keys
If no //apiKey// is provided, a shared API key will be used,
which may result in reduced performance and throttled requests.
@@ -136,6 +142,14 @@ provider = new InfuraProvider("homestead", {
projectSecret: projectSecret
});

// Connect to the INFURA WebSocket endpoints with a WebSocketProvider
provider = InfuraProvider.getWebSocketProvider()
// <hide>
provider._websocket.onopen = function(){
provider._websocket.close();
};
// </hide>


_subsection: AlchemyProvider @<AlchemyProvider> @inherit<[[UrlJsonRpcProvider]]> @src<providers:class.AlchemyProvider>

19 changes: 18 additions & 1 deletion docs.wrm/api/providers/other.wrm
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ The URL to use for the JsonRpcProvider instance.



_subsection: Web3Provider @<Web3Provider> @INHERIT<[[JsonRpcProvider]]>
_subsection: Web3Provider @<Web3Provider> @INHERIT<[[JsonRpcProvider]]> @SRC<providers:class.Web3Provider>

The Web3Provider is meant to ease moving from a [web3.js based](link-web3)
application to ethers by wraping an existing Web3-compatible (such as a
@@ -144,3 +144,20 @@ This is identical to ``sendAsync``. Historically, this used a synchronous
web request, but no current browsers support this, so its use this way
was deprecated quite a long time ago


_subsection: WebSocketProvider @<WebSocketProvider> @INHERIT<[[JsonRpcProvider]]> @SRC<providers:class.WebSocketProvider>

The **WebSocketProvider** connects to a JSON-RPC WebSocket-compatible backend
which allows for a persistent connection, multiplexing requests and pub-sub
events for a more immediate event dispatching.

The WebSocket API is newer, and if running your own infrastructure, note that
WebSockets are much more intensive on your server resourses, as they must manage
and maintain the state for each client. For this reason, many services may also
charge additional fees for using their WebSocket endpoints.

_property: new ethers.provider.WebSockerProvider([ url [ , network ] ])
Returns a new [[WebSocketProvider]] connected to //url// as the //network//.

If //url// is unspecified, the default ``"ws:/\/localhost:8546"`` will be used.
If //network// is unspecified, it will be queried from the network.
83 changes: 77 additions & 6 deletions docs.wrm/contributing.wrm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_section: Contributing and Hacking
_section: Contributing and Hacking @<contributing>

The ethers.js library is something that I've written out of necessity,
and has grown somewhat organically over time.
@@ -25,14 +25,19 @@ have a public discussion and figure out the best way to address to problem/featu
**:)**


_subsection: Building
_subsection: Building @<contributing--building>

If you wish to modify the source code, there are a few steps involved in setting up
your environment.
If you wish to modify the source code, there are a few steps involved in
setting up your environment.

_code: Preparing the Package @lang<shell>
Since the library uses a monorepo, you must install an initial required
set of libraries, which can then be used to install the remaining libraries
used within each package, as well as link all the packages within the repo
with each other.

# Clone the REPO
_code: Preparing for builds @lang<shell>

# Clone the repository
/home/ricmoo> git clone git@github.com:ethers-io/ethers.js.git
/home/ricmoo> cd ethers.js

@@ -44,6 +49,10 @@ _code: Preparing the Package @lang<shell>
/home/ricmoo/ethers.js> npm run bootstrap


_subsection: Making your changes @<contributing--updating>

TODO: Add more information here.

_code: Watching and Building @lang<shell>

# Begin watching the files and re-building whenever they change
@@ -72,3 +81,65 @@ _code: Preparing the Distribution @lang<shell>

/home/ricmoo/ethers.js> npm run update-version


_subsection: Documentation @<contributing--documentation>

The documents are generated using [Flatworm](flatworm) documentation
generation tool, which was written for the purpose of writing the documentation
for ethers.

Style Guide (this section will have much more coming):

- Try to keep lines no longer than //around// 80 characters
- Avoid inline links in the source; use the ``externalLinks`` field in the config.js
- Prefix external links with ``link-``
- Changing an anchor name must be well justified, as it will break all existing links
to that section; flatworm will support symblinks in the future
- In general, I aim for xonsistency; look to similar situations throughout the documentation


_heading: Building

To build the documentation, you should first follow the
[above steps](contributing--building) to build the ethers library.

Building the docs will generate several types of output:

- A full set of HTML pages, linking across each other
- A single one-page HTML page with all pages linking to local anchors
- A full set of README.md pages organized to be browsable and linkable in GitHub
- A metadata dump for tool ingestion (still needs more work)
- (@TODO; only half done) The documentation as a LaTeX and generated PDF

_code: Building the Documentations @lang<shell>

/home/ricmoo/ethers.js> npm run build-docs


_heading: Evaluation

When building the documentation, all code samples are run through a JavaScript
VM to ensure there are no typos in the example code, as well the exact output
of results are injected into the output, so there is no need to keep the results
and code in-sync.

However, this can be a bit of a headache when making many small changes, so to
build the documentation faster, you can skip the evaluation step, which will
inject the code directly.

_code: Build docs skipping evaluation @lang<shell>

/home/ricmoo/ethers.js> npm run build-docs -- --skip-eval


_heading: Previewing Changes

To preview the changes locally, you can use any standard web server and run
from the ``/docs/`` folder, or use the built-in web server.

The same caveats as normal web development apply, such flushing browser
caches after changing (and re-building) the docs.

_code: Running a webserver @lang<shell>

/home/ricmoo/ethers.js> npm run serve-docs
7 changes: 4 additions & 3 deletions docs.wrm/documentation.wrm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_section: Flatworm Docs
_section: Flatworm Docs @<flatworm>

The //Flatworm Docs// rendering engine is designed to be **very**
simple, but provide enough formatting necessary for documenting
@@ -102,7 +102,7 @@ _definition: **_table:** //FOOTER//

Creates a [Table](flatworm--table) structured according to the body.

Each cell support and variables support markdown.
Each cell contents supports markdown and variables supports markdown.

**Extensions:** [@style](flatworm--ext-style)

@@ -173,7 +173,8 @@ This is placed in an orange box.


\_null:
This breaks out of a directive. For example, to end a
This breaks out of a directive. For example, to end
a ``_note:`` or ``_code:``.


_subsection: Markdown @<flatworm-markdown>
Loading