0.1.4 • Published 3 years ago

@balvinder294/blurtjs v0.1.4

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years ago

GitHub license

Blurt.js

Blurt.js the Official JavaScript API for Blurt blockchain

Documentation

Here is full documentation: https://gitlab.com/blurt/openblurt/blurtjs/-/tree/master/doc

Browser

<script src="./blurt.min.js"></script>
<script>
  blurt.api.getAccounts(
    ["baabeetaa", "jacobgadikian"],
    function (err, response) {
      console.log(err, response);
    }
  );
</script>

CDN

https://cdn.jsdelivr.net/npm/@blurtfoundation/blurtjs/dist/blurt.min.js

<script src="https://cdn.jsdelivr.net/npm/@blurtfoundation/blurtjs/dist/blurt.min.js"></script>

Webpack

Please have a look at the webpack usage example.

Server

Install

$ npm install @blurtfoundation/blurtjs --save

RPC Servers

https://rpc.blurt.world By Default List of Hive nodes

Examples

Broadcast Vote

var blurt = require("@blurtfoundation/blurt-js");

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

Get Accounts

blurt.api.getAccounts(["megadrive", "jacobgadikian"], function (err, result) {
  console.log(err, result);
});

Get State

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

Reputation Formatter

var reputation = blurt.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.

Issues

When you find issues, please report them!

License

MIT