Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accounts #869

Merged
merged 32 commits into from
Jul 13, 2017
Merged

Accounts #869

merged 32 commits into from
Jul 13, 2017

Conversation

frozeman
Copy link
Contributor

@frozeman frozeman commented May 9, 2017

Adds account creation and signing tools

@frozeman frozeman mentioned this pull request May 9, 2017
this.length = 0;
}

Wallet.prototype.create = function (numberOfAccounts, entropy) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im unsure, if we shouldn't rename it to generate or so, as you can add new accounts with this function.

}

Wallet.prototype.encrypt = function (password) {
var accounts = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format and encryption should be the same as the geth keystore. See ~/Library/Ethereum/keystore
The go code is here i think: https://github.com/ethereum/go-ethereum/blob/master/accounts/keystore/keystore.go

Wallet.prototype.defaultKeyName = "web3js_wallet";

Wallet.prototype.save = function (password, keyName) {
localStorage.setItem(keyName || this.defaultKeyName, this.encrypt());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On node.js we have to throw an error in this functions i think.

@frozeman frozeman merged commit 0df2bb4 into 1.0 Jul 13, 2017
@frozeman frozeman deleted the accounts branch July 13, 2017 17:46
nachomazzara pushed a commit to nachomazzara/web3.js that referenced this pull request Jun 4, 2020
* Initial implementation of web3.eth.accounts

* Use EthFP internally

* Getting accounts closer to the desired api

* Style changes

* Partially implement web3.eth.accounts.wallet as specified

* moved accounts to its own package

* docs changes

* Change gasLimit to gas

* changed Accounts to class

* added wallet access to sendTransaction

* changing docs, in progress

* improved docs and changed accounts package

* fixed tests

* fixed jshints

* added wallet tests

* added signTransaction tests for async signing

* added signTransaction tests with iban addresses

* changed EthFP -> EthLib

* added account decrypt function

* added wallet decrypt and encryption function

* added decrypt and encryption tests

* added account generation tests

* made load save wallet work

* added more static tests

* added eth_sign tests

* fixed lint errors

* fixed travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants