0.7.6 • Published 6 years ago

dpayjs v0.7.6

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

dPay.js

dPay.js the JavaScript API for dPay blockchain

Documentation

Here is full documentation: https://github.com/dpays/dpayjs/tree/master/doc

Browser

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

CDN

https://cdn.benchx.io/lib/latest/dpay.min.js

<script src="//cdn.benchx.io/lib/latest/dpay.min.js"></script>

Webpack

Please have a look at the webpack usage example.

Server

Install

$ npm install dpayjs --save

RPC Servers

https://greatchain.dpays.io By Default https://jackson.dpays.io https://jefferson.dpays.io

Examples

Broadcast Vote

var dpay = require('dpayjs');

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

Get Accounts

dpay.api.getAccounts(['jared', 'michaelx'], function(err, result) {
	console.log(err, result);
});

Get State

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

Reputation Formatter

var reputation = dpay.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 dPay Telegram Channel https://t.me/dpayio.

Issues

When you find issues, please report them!

License

MIT