UNPKG

@scoopmedia/scoop-js

Version:

Scoop.js the JavaScript API for the Scoop blockchain

103 lines (84 loc) 3.85 kB
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/scoopmediaa/scoop-js/blob/master/LICENSE) [![Scoop.js channel on scoopit.chat](https://img.shields.io/badge/chat-scoopit.chat-1c56a4.svg)](https://scoopit.chat/channel/scoopjs) # Scoop.js Scoop.js the JavaScript API for Scoop blockchain # Documentation - [Install](https://github.com/scoopmediaa/scoop-js/tree/master/doc#install) - [Browser](https://github.com/scoopmediaa/scoop-js/tree/master/doc#browser) - [Config](https://github.com/scoopmediaa/scoop-js/tree/master/doc#config) - [Database API](https://github.com/scoopmediaa/scoop-js/tree/master/doc#api) - [Subscriptions](https://github.com/scoopmediaa/scoop-js/tree/master/doc#subscriptions) - [Tags](https://github.com/scoopmediaa/scoop-js/tree/master/doc#tags) - [Blocks and transactions](https://github.com/scoopmediaa/scoop-js/tree/master/doc#blocks-and-transactions) - [Globals](https://github.com/scoopmediaa/scoop-js/tree/master/doc#globals) - [Keys](https://github.com/scoopmediaa/scoop-js/tree/master/doc#keys) - [Accounts](https://github.com/scoopmediaa/scoop-js/tree/master/doc#accounts) - [Market](https://github.com/scoopmediaa/scoop-js/tree/master/doc#market) - [Authority / validation](https://github.com/scoopmediaa/scoop-js/tree/master/doc#authority--validation) - [Votes](https://github.com/scoopmediaa/scoop-js/tree/master/doc#votes) - [Content](https://github.com/scoopmediaa/scoop-js/tree/master/doc#content) - [Witnesses](https://github.com/scoopmediaa/scoop-js/tree/master/doc#witnesses) - [Login API](https://github.com/scoopmediaa/scoop-js/tree/master/doc#login) - [Follow API](https://github.com/scoopmediaa/scoop-js/tree/master/doc#follow-api) - [Broadcast API](https://github.com/scoopmediaa/scoop-js/tree/master/doc#broadcast-api) - [Broadcast](https://github.com/scoopmediaa/scoop-js/tree/master/doc#broadcast) - [Auth](https://github.com/scoopmediaa/scoop-js/tree/master/doc#auth) Here is full documentation: https://github.com/scoopmediaa/scoop-js/tree/master/doc ## Browser ```html <script src="./scoop.min.js"></script> <script> scoop.api.getAccounts(['ned', 'dan'], function(err, response){ console.log(err, response); }); </script> ``` ## CDN https://cdn.scoopjs.com/lib/latest/scoop.min.js<br/> ```html <script src="//cdn.scoopjs.com/lib/latest/scoop.min.js"></script> ``` ## Webpack [Please have a look at the webpack usage example.](https://github.com/scoopmediaa/scoop-js/blob/master/examples/webpack-example) ## Server ## Install ``` $ npm install scoop --save ``` ## RPC Servers https://api.scoopit.app By Default<br/> https://node.scoop.ws<br/> https://this.piston.rocks<br/> ## Examples ### Broadcast Vote ```js var scoop = require('scoop'); var wif = scoop.auth.toWif(username, password, 'posting'); scoop.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) { console.log(err, result); }); ``` ### Get Accounts ```js scoop.api.getAccounts(['ned', 'dan'], function(err, result) { console.log(err, result); }); ``` ### Get State ```js scoop.api.getState('/trends/funny', function(err, result) { console.log(err, result); }); ``` ### Reputation Formatter ```js var reputation = scoop.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 Scoopit Chat channel #scoopjs https://scoopit.chat/channel/scoopjs. ## Issues When you find issues, please report them! ## License MIT