Mahdi Yari avatar

Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!

mahdiyari

Published: 27 Apr 2020 › Updated: 27 Apr 2020Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!

Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!

hivejshivetx.jpg

Hive-js

Hive-js is the official javascript library for Hive. All the apps previously using Steem-js should use Hive-js instead.

Installation:

npm install @hiveio/hive-js --save

Browser usage:

<script src="https://cdn.jsdelivr.net/npm/@hiveio/hive-js/dist/hive.min.js"></script>

New config option:

hive.config.set('alternative_api_endpoints', ['https://api.hive.blog', 'https://anyx.io']);

Breaking changes (Only on browsers):
The only breaking change is the variable name on the browsers. You must use hive instead of steem in the browsers to access Hive-js library.

Example usage:

hive.api.getAccounts(['mahdiyari', 'hiveio'], function(err, result) {
    console.log(err, result);
});

Deprecated method:
hive.formatter.vestToSteem() is deprecated and will be removed in the future releases. Use hive.formatter.vestToHive() instead.

var hivePower = hive.formatter.vestToHive(vestingShares, totalVestingShares, totalVestingFundHive);

Source code and full documentation: https://gitlab.syncad.com/hive/hive-js
Npm package: https://www.npmjs.com/package/@hiveio/hive-js


Hive-tx

Lightweight and complete JavaScript library for using Hive blockchain in Javascript environments such as Web or NodeJS.

Previously introduced as Steem-tx and now fully migrated to Hive.

Source code and full documentation: https://github.com/mahdiyari/hive-tx-js
Npm package: https://www.npmjs.com/package/hive-tx


Contribution is more than welcome in all repositories on https://gitlab.syncad.com/hive
Development is in the hands of the community.

Leave Hive-js & Hive-tx migration to Hive - Breaking changes for browsers! to:

Written by

Hive witness - hive.vote - hivedex.io - HafSQL - hive-tx - hive-php - rpc.mahdiyari.info

Read more #hive posts


Best Posts From Mahdi Yari

We have not curated any of mahdiyari's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Mahdi Yari