Skip to content

Steem.js the official JavaScript library for Steem blockchain

License

Notifications You must be signed in to change notification settings

DoctorLai/steem-js

This branch is 2 commits ahead of, 10 commits behind steemit/steem-js:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

111d99d · Sep 26, 2024
Dec 6, 2023
Sep 26, 2024
Sep 26, 2024
Sep 26, 2024
Sep 26, 2024
Sep 22, 2017
Jun 22, 2017
Oct 24, 2016
Jun 22, 2017
Feb 13, 2017
Feb 13, 2017
May 20, 2017
Aug 6, 2017
Nov 20, 2023
Jul 17, 2017
Jan 2, 2018
Oct 24, 2016
Oct 24, 2016
Sep 26, 2024
Oct 4, 2016
Sep 26, 2024

Repository files navigation

GitHub license Steem.js channel on steemit.chat

Steem.js

Steem.js the JavaScript API for Steem blockchain

Documentation

Here is full documentation: https://github.com/steemit/steem-js/tree/master/doc

Browser

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

CDN

https://cdn.jsdelivr.net/npm/steem/dist/steem.min.js

<script src="https://cdn.jsdelivr.net/npm/steem/dist/steem.min.js"></script>

Webpack

Please have a look at the webpack usage example.

Server

Install

$ npm install steem --save

RPC Servers

https://api.steemit.com By Default

Examples

Broadcast Vote

var steem = require('steem');

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

Get Accounts

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

Get State

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

Reputation Formatter

var reputation = steem.formatter.reputation(user.reputation);
console.log(reputation);

Steem Testnet

Steem-js requires some configuration to work on the public Steem testnet.

You need to set two Steem API options, address_prefix and chain_id.

steem.api.setOptions({
  address_prefix: 'TST',
  chain_id: '46d82ab7d8db682eb1959aed0ada039a6d49afa1602491f93dde9cac3e8e6c32',
  useTestNet: true,
});

The Chain ID could change. If it does, it may not be reflected here, but will be documented on any testnet launch announcements.

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.

Issues

When you find issues, please report them!

License

MIT

About

Steem.js the official JavaScript library for Steem blockchain

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Other 0.2%