JS Stellar Base
![Code Climate](https://codeclimate.com/github/stellar/js-stellar-base/badges/gpa.svg)
The stellar-base library is the lowest-level stellar helper library. It consists of classes
to read, write, hash, and sign the xdr structures that are used in stellar-core.
Installation
Using npm:
npm install --save stellar-base
Usage
Examples are here
In addition to the code generated from the XDR definition files (see js-xdr for example usage), this library also provides some stellar specific features. Let's look at some of them:
var StellarBase = require("stellar-base");
var signer = StellarBase.Keypair.fromSeed("SDSIBVHCCWHK7MZSGWJRLYTAESAZ6O4OQU4QS4YJQAQ2EGJXRJW7PYD3");
var verifier = StellarBase.Keypair.fromAddress("GDADKSW7B4WZAKFZ7YHESAEZQ5JC7WYSLTUNRTBTAY3R3JRZWXMNKXPN")
var sig = signer.signDecorated("Hello world!")
console.log(sig.hint())
console.log(sig.signature())
This library also provides an impementation of StrCheck encoding:
var StellarBase = require("stellar-base");
StellarBase.encodeCheck("accountId", [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
StellarBase.encodeCheck("seed", [0,0,0])
var encoded = StellarBase.encodeCheck("accountId", [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
StellarBase.decodeCheck("accountId", encoded)
StellarBase.decodeCheck("seed", encoded)
Contributing
Please see CONTRIBUTING.md for details.