alakeygen1

1.3.2 • Public • Published

NPM

Repository

Provides hierarchical deterministic key generation, storage, and management.

General purpose cryptography is found in ala-ecc4 library.

Usage

let {Keystore, Keygen} = require('alakeygen1')
Ala = require('alaexplorerjs4')
 
sessionConfig = {
  timeoutInMin: 30,
  uriRules: {
    'owner' : '/account_recovery',
    'active': '/(transfer|contracts)',
    'active/**': '/producers'
  }
}
 
keystore = Keystore('myaccount', sessionConfig)
ala = Ala.Testnet({keyProvider: keystore.keyProvider})
 
Keygen.generateMasterKeys().then(keys => {
  // create blockchain account called 'myaccount'
  console.log(keys)
 
  ala.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/ALADIN-Network/alakeygen1.git
cd alakeygen1
npm install
npm run build
# builds: ./dist/alakeygen1.js 
<script src="alakeygen1.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 alakeygen1

Weekly Downloads

1

Version

1.3.2

License

MIT

Unpacked Size

29.2 kB

Total Files

4

Last publish

Collaborators

  • aladinnetwork