Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
extends: '@ethereumjs/eslint-config-defaults',
parserOptions: {
project: ['./tsconfig.json'],
},
env: {
mocha: true,
},
rules: {
'no-constant-condition': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
},
overrides: [
{
files: ['test/index.spec.ts'],
rules: {
'no-invalid-this': 'off',
'no-prototype-builtins': 'off',
'@typescript-eslint/no-floating-promises': 'off',
},
},
],
}
26 changes: 8 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
node-version: [12.x, 13.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- uses: actions/checkout@v1

- run: npm install
- run: npm run test
- run: npm run coverage
- run: npm run test:browser

- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

test-browser:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12.x

- uses: actions/checkout@v1

- run: npm install
- run: npm run test:browser


2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
package-lock.json

# Optional npm cache directory
.npm
Expand All @@ -42,3 +41,4 @@ package-lock.json

# build output
dist
dist.browser
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

3 changes: 0 additions & 3 deletions .nycrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.vscode
package.json
dist
dist.browser
.nyc_output
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
(modification: no type change headlines) and this project adheres to
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.2] - 2021-10-08

- Updated dependencies to latest, added browser build, PR [#157](https://github.com/ethereumjs/ethereumjs-wallet/pull/157)

#### Included Source Files

Source files from the `src` folder are now included in the distribution build. This allows for a better debugging experience in debug tools like Chrome DevTools by having working source map references to the original sources available for inspection.

[1.0.2]: https://github.com/ethereumjs/ethereumjs-wallet/compare/v1.0.1...v1.0.2

## [1.0.1] - 2020-09-25

- Fixed a browser issue in `Wallet.fromV3()` and `Wallet.toV3()` triggered when using web bundlers using Buffer v4 shim (Webpack 4),
Expand Down Expand Up @@ -46,7 +56,7 @@ This leads to cases where some input - while not having been the intended way to
One example for this is the `Wallet.fromPublicKey()` function, here is the old code of the function:

```js
Wallet.fromPublicKey = function(pub, nonStrict) {
Wallet.fromPublicKey = function (pub, nonStrict) {
if (nonStrict) {
pub = ethUtil.importPublic(pub)
}
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# ethereumjs-wallet

[![NPM Package](https://img.shields.io/npm/v/ethereumjs-wallet.svg)](https://www.npmjs.org/package/ethereumjs-wallet)
[![Actions Status](https://github.com/ethereumjs/ethereumjs-wallet/workflows/Build/badge.svg)](https://github.com/ethereumjs/ethereumjs-wallet/actions)
[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-wallet.svg)](https://coveralls.io/r/ethereumjs/ethereumjs-wallet)
[![NPM Package][npm-badge]][npm-link]
[![Actions Status][actions-badge]][actions-link]
[![Coverage Status][coverage-badge]][coverage-link]
[![Discord][discord-badge]][discord-link]

A lightweight wallet implementation. At the moment it supports key creation and conversion between various formats.

It is complemented by the following packages:

- [ethereumjs-tx](https://github.com/ethereumjs/ethereumjs-tx) to sign transactions
- [@ethereumjs/tx](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx) to sign transactions
- [ethereumjs-icap](https://github.com/ethereumjs/ethereumjs-icap) to manipulate ICAP addresses
- [store.js](https://github.com/marcuswestin/store.js) to use browser storage

Motivations are:

- be lightweight
- work in a browser
- use a single, maintained version of crypto library (and that should be in line with `ethereumjs-util` and `ethereumjs-tx`)
- use a single, maintained version of crypto library (and that should be in line with [`ethereumjs-util`](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/util) and `@ethereumjs/tx`)
- support import/export between various wallet formats
- support BIP32 HD keys

Expand All @@ -35,7 +35,7 @@ You can import the `Wallet` class like this
Node.js / ES5:

```js
const { Wallet } = require('ethereumjs-wallet').default
const Wallet = require('ethereumjs-wallet').default
```

ESM / TypeScript:
Expand Down Expand Up @@ -135,5 +135,11 @@ MIT License

Copyright (C) 2016 Alex Beregszaszi

[actions-badge]: https://github.com/ethereumjs/ethereumjs-wallet/workflows/Build/badge.svg
[actions-link]: https://github.com/ethereumjs/ethereumjs-wallet/actions
[coverage-badge]: https://img.shields.io/coveralls/ethereumjs/ethereumjs-wallet.svg
[coverage-link]: https://coveralls.io/r/ethereumjs/ethereumjs-wallet
[discord-badge]: https://img.shields.io/static/v1?logo=discord&label=discord&message=Join&color=blue
[discord-link]: https://discord.gg/TNwARpR
[npm-badge]: https://img.shields.io/npm/v/ethereumjs-wallet.svg
[npm-link]: https://www.npmjs.org/package/ethereumjs-wallet
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = function(config) {
},
plugins: ['karma-mocha', 'karma-typescript', 'karma-chrome-launcher', 'karma-firefox-launcher'],
karmaTypescriptConfig: {
tsconfig: './tsconfig.json',
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
},
Expand All @@ -15,7 +16,7 @@ module.exports = function(config) {
reporters: ['progress', 'karma-typescript'],
browsers: ['FirefoxHeadless', 'ChromeHeadless'],
singleRun: true,
concurrency: Infinity,
concurrency: 1,
// Extend timeouts for long tests
browserDisconnectTimeout: 1000000,
browserNoActivityTimeout: 1000000,
Expand Down
Loading