lemojs-keygen

1.0.0 • Public • Published

NPM

Repository

General purpose library for private key storage and key management.

Usage

let {Keystore, Keygen} = require('lemojs-keygen')
Lemo = require('lemojs')
 
sessionConfig = {
  timeoutInMin: 30,
  uriRules: {
    'owner' : '/account_recovery',
    'active': '/(transfer|contracts)',
    'active/**': '/producers'
  }
}
 
keystore = Keystore('myaccount', sessionConfig)
lemo = Lemo.Testnet({keyProvider: keystore.keyProvider})
 
Keygen.generateMasterKeys().then(keys => {
  // create blockchain account called 'myaccount'
  console.log(keys)
 
  lemo.getAccount('myaccount').then(account => {
    keystore.deriveKeys({
      parent: keys.masterPrivateKey,
      accountPermissions: account.permissions
    })
  })
 
})

See ./API

Development

let {Keystore, Keygen} = require('./src')

Use Node v8+ (updates package-lock.json)

Browser

git clone https://github.com/LemoFoundationLtd/lemojs-keygen.git
cd lemojs-keygen
npm install
npm run build
# builds: ./dist/lemojs-keygen.js 
<script src="lemojs-keygen.js"></script>
<script>
//kos.Keystore
//kos.Keygen
//...
</script> 

Runtime Environment

Node 6+ and browser (browserify, webpack, etc)

Built with React Native in mind, create an issue if you find a bug.

Readme

Keywords

Package Sidebar

Install

npm i lemojs-keygen

Weekly Downloads

0

Version

1.0.0

License

GPL-3.0

Unpacked Size

153 kB

Total Files

25

Last publish

Collaborators

  • lemofoundationltd