@creativechain-fdn/crea-js

0.6.0 • Public • Published

Crea.js

GitHub license Version Downloads

Crea.js the JavaScript API for Crea blockchain

Documentation

Here is full documentation: https://github.com/creativechain/crea-js/tree/master/doc

Browser

<script src="./crea.min.js"></script>
<script>
crea.api.getAccounts(['ned', 'dan'], function(err, response){
    console.log(err, response);
});
</script>

Webpack

Please have a look at the webpack usage example.

Server

Install

$ npm install crea --save

RPC Servers

https://nodes.creary.net

Examples

Broadcast Vote

var crea = require('crea');

var wif = crea.auth.toWif(username, password, 'posting');
crea.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) {
	console.log(err, result);
});

Get Accounts

crea.api.getAccounts(['ned', 'dan'], function(err, result) {
	console.log(err, result);
});

Get State

crea.api.getState('/trends/funny', function(err, result) {
	console.log(err, result);
});

Reputation Formatter

var reputation = crea.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 Crea Chat channel #creajs https://creativechain.chat/channel/creajs.

Issues

When you find issues, please report them!

License

MIT

Package Sidebar

Install

npm i @creativechain-fdn/crea-js

Weekly Downloads

0

Version

0.6.0

License

MIT

Unpacked Size

18.7 MB

Total Files

82

Last publish

Collaborators

  • creativechain
  • ander7agar