Skip to content

npm module to do general purpose ethereum crypto ops

License

Notifications You must be signed in to change notification settings

auth0/ethereum-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages