Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Ethereum crypto module

Installation

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

Usage

const EthCrypto = require('eth-crypto');
var ethCrypto = new EthCrypto();

Every method returns a promise with the result.

Signing message

ethCrypto.signMessage(message,encryptedV3KeyPair,password)
.then(function(signature) {
    //do something with the signature
}).catch(function handleError(error) {
    //your error handling goes here
});

Creating a new account

ethCrypto.ethCrypto.createAccount(password)
.then(function(encryptedV3KeyPair) {
  //do something with the key pair
}).catch(function handleError(error) {
    //your error handling goes here
});

Validate signature

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
});

Dependencies

About

npm module to do general purpose ethereum crypto ops

Resources

License

Releases

No releases published

Packages

No packages published