-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* web3-core readme fix * web3-eth-account package init
- Loading branch information
Showing
26 changed files
with
1,778 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.eslintignore.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
extends: '../../.eslintrc.js', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.npmignore.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.npmrc.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.prettierignore.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/.prettierrc.json.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- EXAMPLE | ||
## [1.0.0] | ||
### Added | ||
- I've added feature XY (#1000) | ||
### Changed | ||
- I've cleaned up XY (#1000) | ||
### Deprecated | ||
- I've deprecated XY (#1000) | ||
### Removed | ||
- I've removed XY (#1000) | ||
### Fixed | ||
- I've fixed XY (#1000) | ||
### Security | ||
- I've improved the security in XY (#1000) | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<p align="center"> | ||
<img src="assets/logo/web3js.jpg" width="500" alt="web3.js" /> | ||
</p> | ||
|
||
# web3.js - Web3 Eth Accounts | ||
|
||
![ES Version](https://img.shields.io/badge/ES-2020-yellow) | ||
![Node Version](https://img.shields.io/badge/node-14.x-green) | ||
[![NPM Package][npm-image]][npm-url] | ||
[![Dependency Status][deps-image]][deps-url] | ||
[![Dev Dependency Status][deps-dev-image]][deps-dev-url] | ||
|
||
This is a sub-package of [web3.js][repo]. | ||
|
||
`web3-eth-accounts` contains functionality for managing Ethereum accounts and signing. | ||
|
||
###### Get it from the NPM Registry | ||
|
||
```bash | ||
yarn add web3-eth-accounts | ||
``` | ||
|
||
## Getting Started | ||
|
||
- :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new) or join us on [Discord](https://discord.gg/yjyvFRP) | ||
![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord) | ||
|
||
## Prerequisites | ||
|
||
- :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium) | ||
- :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/) | ||
|
||
## Package.json Scripts | ||
|
||
| Script | Description | | ||
| ---------------- | -------------------------------------------------- | | ||
| clean | Uses `rimraf` to remove `dist/` | | ||
| build | Uses `tsc` to build package and dependent packages | | ||
| lint | Uses `eslint` to lint package | | ||
| lint:fix | Uses `eslint` to check and fix any warnings | | ||
| format | Uses `prettier` to format the code | | ||
| test | Uses `jest` to run unit tests | | ||
| test:integration | Uses `jest` to run tests under `/test/integration` | | ||
| test:unit | Uses `jest` to run tests under `/test/unit` | | ||
|
||
[docs]: http://web3js.readthedocs.io/en/4.0/ | ||
[repo]: https://github.com/ethereum/web3.js | ||
[npm-image]: https://img.shields.io/npm/v/web3-core-method.svg | ||
[npm-url]: https://npmjs.org/packages/web3-package-tempalte | ||
[deps-image]: https://david-dm.org/ethereum/web3.js/4.x/status.svg?path=tools/web3-package-tempalte | ||
[deps-url]: https://david-dm.org/ethereum/web3.js/4.x?path=tools/web3-package-tempalte | ||
[deps-dev-image]: https://david-dm.org/ethereum/web3.js/4.x/dev-status.svg?path=tools/web3-package-tempalte | ||
[deps-dev-url]: https://david-dm.org/ethereum/web3.js/4.x?type=dev&path=tools/web3-package-tempalte |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "web3-eth-accounts", | ||
"version": "4.0.0-alpha.0", | ||
"description": "Package for managing Ethereum accounts and signing", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/ChainSafe/web3.js", | ||
"author": "ChainSafe Systems", | ||
"license": "LGPL-3.0", | ||
"files": [ | ||
"dist/**/*" | ||
], | ||
"scripts": { | ||
"clean": "rimraf dist", | ||
"prebuild": "rimraf dist", | ||
"build": "tsc --build", | ||
"build:check": "node -e \"require('./dist')\"", | ||
"lint": "eslint --ext .js,.ts .", | ||
"lint:fix": "eslint --fix --ext .js,.ts .", | ||
"format": "prettier --write '**/*'", | ||
"test": "jest --config=./test/unit/jest.config.js", | ||
"test:coverage": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text", | ||
"test:ci": "jest --coverage=true --coverage-reporters=json --verbose", | ||
"test:watch": "npm test -- --watch", | ||
"test:unit": "jest --config=./test/unit/jest.config.js", | ||
"test:integration": "jest --config=./test/integration/jest.config.js" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^27.0.2", | ||
"@typescript-eslint/eslint-plugin": "^4.31.2", | ||
"@typescript-eslint/parser": "^4.31.2", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-config-web3-base": "0.1.0", | ||
"eslint-plugin-import": "^2.24.2", | ||
"jest": "^27.2.1", | ||
"jest-extended": "^0.11.5", | ||
"prettier": "^2.4.1", | ||
"ts-jest": "^27.0.5", | ||
"typescript": "^4.4.3" | ||
} | ||
} |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
extends: '../../../.eslintrc.test.js', | ||
parserOptions: { | ||
project: './tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../templates/jest.config.js.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Have to use `require` because of Jest issue https://jestjs.io/docs/ecmascript-modules | ||
// eslint-disable-next-line @typescript-eslint/no-require-imports | ||
require('jest-extended'); | ||
|
||
// @todo extend jest to have "toHaveBeenCalledOnceWith" matcher. | ||
|
||
process.env.NODE_ENV = 'test'; |
33 changes: 33 additions & 0 deletions
33
packages/web3-eth-accounts/test/integration/jest.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
|
||
const base = require('../config/jest.config'); | ||
|
||
module.exports = { | ||
...base, | ||
setupFilesAfterEnv: ['<rootDir>/test/integration/setup.js'], | ||
testMatch: ['<rootDir>/test/integration/**/*.(spec|test).(js|ts)'], | ||
/** | ||
* restoreMocks [boolean] | ||
* | ||
* Default: false | ||
* | ||
* Automatically restore mock state between every test. | ||
* Equivalent to calling jest.restoreAllMocks() between each test. | ||
* This will lead to any mocks having their fake implementations removed | ||
* and restores their initial implementation. | ||
*/ | ||
restoreMocks: true, | ||
|
||
/** | ||
* resetModules [boolean] | ||
* | ||
* Default: false | ||
* | ||
* By default, each test file gets its own independent module registry. | ||
* Enabling resetModules goes a step further and resets the module registry before running each individual test. | ||
* This is useful to isolate modules for every test so that local module state doesn't conflict between tests. | ||
* This can be done programmatically using jest.resetModules(). | ||
*/ | ||
resetModules: true, | ||
coverageDirectory: '.coverage/integration', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Have to use `require` because of Jest issue https://jestjs.io/docs/ecmascript-modules | ||
// eslint-disable-next-line @typescript-eslint/no-require-imports | ||
require('../config/setup'); | ||
|
||
const jestTimeout = 15000; | ||
|
||
jest.setTimeout(jestTimeout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../templates/test/tsconfig.json.tmpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// import Web3ProviderBase from '../../src/index' | ||
// import {ProviderOptions} from '../../types' | ||
|
||
describe('constructs a PLACEHOLDER instance with expected properties', () => { | ||
// let providerOptions: ProviderOptions | ||
|
||
beforeEach(() => { | ||
// providerOptions = { | ||
// providerUrl: 'http://127.0.0.1:8545' | ||
// } | ||
}); | ||
|
||
it('should construct with expected properties', () => { | ||
// const web3ProviderBase = new Web3ProviderBase(providerOptions) | ||
// expect(web3ProviderBase).toMatchObject({ | ||
// _providerUrl: providerOptions.providerUrl | ||
// }) | ||
expect(true).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const base = require('../config/jest.config'); | ||
|
||
module.exports = { | ||
...base, | ||
testMatch: ['<rootDir>/test/unit/**/*.(spec|test).(js|ts)'], | ||
|
||
coverageDirectory: '.coverage/unit', | ||
collectCoverageFrom: ['src/controller/**', 'src/application/**'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../templates/tsconfig.json.tmpl |