-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Conversation
packages/web3-eth/src/accounts.js
Outdated
this.length = 0; | ||
} | ||
|
||
Wallet.prototype.create = function (numberOfAccounts, entropy) { |
There was a problem hiding this comment.
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.
packages/web3-eth/src/accounts.js
Outdated
} | ||
|
||
Wallet.prototype.encrypt = function (password) { | ||
var accounts = []; |
There was a problem hiding this comment.
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
packages/web3-eth/src/accounts.js
Outdated
Wallet.prototype.defaultKeyName = "web3js_wallet"; | ||
|
||
Wallet.prototype.save = function (password, keyName) { | ||
localStorage.setItem(keyName || this.defaultKeyName, this.encrypt()); |
There was a problem hiding this comment.
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.
* 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
Adds account creation and signing tools