1.0.0 • Published 2 years ago

@blurtfoundation/blurtjs v1.0.0

Weekly downloads
256
License
MIT
Repository
gitlab
Last release
2 years ago

GitHub license

Blurt.js

Blurt.js the Official JavaScript API for Blurt blockchain

Documentation

Here is full documentation: https://gitlab.com/blurt/blurt/-/tree/dev/client-libs/blurtjs/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 Blurt nodes

Examples

Broadcast Vote

var blurt = require("@blurtfoundation/blurtjs");

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);
});

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