Pure JavaScript Zos library for node.js and browsers.
npm install zos-ecc-jsPure JavaScript Bitshares library for node.js and browsers. Can be used to construct, sign and broadcast transactions in JavaScript, and to easily obtain data from the blockchain via public apis.
Most of this code was written by jcalfee, my work was mostly just repackaging to a discrete npm package.


This library can be obtained through npm:
```
npm install zos-ecc-js
html usage like this
`#### Login
The login class uses the following format for keys:
`
keySeed = accountName + role + password
`Using this seed, private keys are generated for either the default roles
active, owner, memo, or as specified. A minimum password length of 12 characters is enforced, but an even longer password is recommended. Three methods are provided:`
generateKeys(account, password, [roles])
checkKeys(account, password, auths)
signTransaction(tr)
`The auths object should contain the auth arrays from the account object. An example is this:
`
{
active: [
["GPH5Abm5dCdy3hJ1C5ckXkqUH2Me7dXqi9Y7yjn9ACaiSJ9h8r8mL", 1]
]
}
`If checkKeys is successful, you can use signTransaction to sign a TransactionBuilder transaction using the private keys for that account.
`$3
The ECC library contains all the crypto functions for private and public keys as well as transaction creation/signing.#### Private keys
As a quick example, here's how to generate a new private key from a seed (a brainkey for example):
`
var {PrivateKey, key} = require("zos-ecc-js");let seed = "THIS IS A TERRIBLE BRAINKEY SEED WORD SEQUENCE";
let pkey = PrivateKey.fromSeed( key.normalize_brainKey(seed) );
console.log("\nPrivate key:", pkey.toWif());
console.log("Public key :", pkey.toPublicKey().toString(), "\n");
``