-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from JoinColony/enhancement/add-and-update-docs
Add and update documentation and config
- Loading branch information
Showing
14 changed files
with
223 additions
and
85 deletions.
There are no files selected for viewing
File renamed without changes.
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,46 @@ | ||
# Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: https://contributor-covenant.org | ||
[version]: https://contributor-covenant.org/version/1/4/ |
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,29 @@ | ||
# Contributing | ||
|
||
Please read [Code of Conduct](CODE_OF_CONDUCT.md) before contributing. | ||
|
||
## Report Issues | ||
|
||
Report an issue using [GitHub Issues](https://github.com/JoinColony/node-metamask/issues). _Please fill out the template with as much detail as possible._ | ||
|
||
## GitHub Workflow | ||
|
||
- Fork the repository | ||
|
||
- Clone the forked repository into your working directory | ||
|
||
- Create a new branch using the following naming schema: | ||
|
||
- [fix/feature/...]/[issue-#]-[description-in-kebab-case] | ||
|
||
- For example, `feature/6-add-connect-rinkeby-example` | ||
|
||
- Commit your changes using the following guidelines: | ||
|
||
- In the commit message, the first line must be capitalized | ||
|
||
- Keep your branch up to date using `rebase` instead of `merge` | ||
|
||
- Push your new fix/feature branch to your forked repository | ||
|
||
- Create a pull request and fill out the pull request template |
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 @@ | ||
## Description | ||
|
||
_Write a detailed description of the issue/feature/question._ | ||
|
||
## Steps to Reproduce | ||
|
||
_If you are reporting a bug, list the steps you took that led to the issue._ |
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,31 @@ | ||
## Description | ||
|
||
_Write a detailed description of the changes you made._ | ||
|
||
## Other Changes | ||
|
||
_List any minor changes you may have made during development._ | ||
|
||
## Checklist | ||
|
||
_List items that need to be completed before the request is merged._ | ||
|
||
## Scripts | ||
|
||
_List any added/updated scripts._ | ||
|
||
**Added Scripts**: | ||
|
||
**Updated Scripts**: | ||
|
||
## Dependencies | ||
|
||
_List any added/updated dependencies._ | ||
|
||
**Added Dependencies**: | ||
|
||
**Updated Dependencies**: | ||
|
||
## Related Issues | ||
|
||
_If the pull request is related to an issue, add a link to the issue here._ |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,58 @@ | ||
<div align="center"> | ||
<img src="/docs/img/nodeMetamask_fullColor.svg" width="600" /> | ||
</div> | ||
<div align="center"> | ||
<a href="https://build.colony.io/"> | ||
<img src="https://img.shields.io/discourse/https/build.colony.io/status.svg" /> | ||
</a> | ||
</div> | ||
|
||
# node-metamask | ||
|
||
Connect Node.js to MetaMask. | ||
|
||
"Why would I ever want to do that?" - Sometimes you might have scripts or libraries that run in Node and require signed transactions that you would like to use MetaMask for (instead of dealing with private keys). This tool functions as a web3 provider that can be used with pretty much any MetaMask instance remotely. Please, only use this package locally to prevent PITM attacks (if you're brave enough to try it on mainnet). | ||
|
||
Sounds crazy? It probably is. Also highly experimental. Please use with caution. | ||
|
||
## Install | ||
|
||
``` | ||
yarn add node-metamask | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
|
||
const MetaMaskConnector = require('node-metamask'); | ||
const connector = new MetaMaskConnector({ | ||
port: 3333, // this is the default port | ||
onConnect() { console.log('MetaMask client connected') }, // Function to run when MetaMask is connected (optional) | ||
}); | ||
|
||
connector.start().then(() => { | ||
// Now go to http://localhost:3333 in your MetaMask enabled web browser. | ||
const web3 = new Web3(connector.getProvider()); | ||
// Use web3 as you would normally do. Sign transactions in the browser. | ||
}); | ||
|
||
``` | ||
|
||
When you're done with your MetaMask business, run the following code to clean up: | ||
|
||
```js | ||
|
||
connector.stop(); | ||
|
||
``` | ||
|
||
## Disclaimer | ||
|
||
As I said, this is highly experimental. Tested only with web3 v1.0 (in node) and web3 0.20.3 (MetaMask, in the browser). Also it might not work with all functions supported by web3. | ||
|
||
## Contribute | ||
|
||
Please report any bugs you find so we can improve this. | ||
|
||
- [Contributing](https://github.com/JoinColony/node-metamask/blob/master/.github/CONTRIBUTING.md) |
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,6 @@ | ||
{ | ||
"logo": "img/nodeMetamask_fullColor.svg", | ||
"logoSmall": "img/nodeMetamask_logomark_red.svg", | ||
"sectionOrder": ["Docs"], | ||
"description": "A JavaScript library that functions as a Web3 provider connecting Node to MetaMask." | ||
} |
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.
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 |
---|---|---|
|
@@ -2,12 +2,16 @@ | |
"name": "node-metamask", | ||
"version": "1.1.2", | ||
"description": "🦊 Connect to MetaMask from node.js", | ||
"author": "Christian Maniewski <[email protected]>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/JoinColony/node-metamask.git" | ||
}, | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "eslint *.js" | ||
}, | ||
"author": "Christian Maniewski <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"express": "^4.16.3", | ||
"ws": "^5.2.0" | ||
|