For the mobile device run (it requires Docker to work):
./browserify.sh
The resultant single js file will be saved in bundle.js file in the same directory
To install the module globally for node.js run:
npm install eth-crypto -g
const EthCrypto = require('eth-crypto');
var ethCrypto = new EthCrypto();
Every method returns a promise with the result.
ethCrypto.signMessage(message,encryptedV3KeyPair,password)
.then(function(signature) {
//do something with the signature
}).catch(function handleError(error) {
//your error handling goes here
});
ethCrypto.ethCrypto.createAccount(password)
.then(function(encryptedV3KeyPair) {
//do something with the key pair
}).catch(function handleError(error) {
//your error handling goes here
});
ethCrypto.ethCrypto.validateSignature(message,signature,address);
.then(function(result) {
if(result) {
console.log("Bugger.");
} else {
console.log("Yupee!");
}
}).catch(function handleError(error) {
//your error handling goes here
});
- ethereumjs-wallet
npm install ethereumjs-wallet --save
- ethereumjs-util
npm install ethereumjs-util --save
- Q
npm install q --save