0.7.7 • Published 5 years ago
@baaluo/bears-js v0.7.7
Bears.js
Bears.js the JavaScript API for Bears blockchain
Documentation
Here is full documentation: https://github.com/bearshares/bears-js/tree/master/doc
Clone and compile to get bears.min.js
git clone https://github.com/bearshares/bears-js.git
cd bears-js
npm install
Browser
<script src="./bears.min.js"></script>
<script>
bears.api.getAccounts(['bilalhaider'], function(err, response){
console.log(err, response);
});
</script>
Webpack
Please have a look at the webpack usage example.
Server
Install
$ npm install @baaluo/bears-js --save
RPC Servers
https://api.bearshares.com By Default
Examples
Broadcast Vote
var bears = require('@baaluo/bears-js');
var wif = bears.auth.toWif(username, password, 'posting');
bears.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
console.log(err, result);
});
Get Accounts
bears.api.getAccounts(['bilalhaider'], function(err, result) {
console.log(err, result);
});
Get State
bears.api.getState('/trends/funny', function(err, result) {
console.log(err, result);
});
Reputation Formatter
var reputation = bears.formatter.reputation(user.reputation);
console.log(reputation);
Contributions
Patches are welcome! Contributors are listed in the package.json file. Please run the tests before opening a pull request and make sure that you are passing all of them. If you would like to contribute, but don't know what to work on, check the issues list or on Bearshares Chat channel #bearsjs https://bearshares.chat/channel/bearsjs.
Issues
When you find issues, please report them!
License
MIT