create account

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

View this thread on: hive.blogpeakd.comecency.com
· @mahdiyari ·
$42.56
Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!
<center>
![hivejshivetx.jpg](https://files.peakd.com/file/peakd-hive/mahdiyari/uMVfF55Y-hive-js-hive-tx.jpg)
</center>

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

<b>Installation</b>:
```
npm install @hiveio/hive-js --save
```
<b>Browser usage</b>:
```
<script src="https://cdn.jsdelivr.net/npm/@hiveio/hive-js/dist/hive.min.js"></script>
```

<b>New config option:</b>
```
hive.config.set('alternative_api_endpoints', ['https://api.hive.blog', 'https://anyx.io']);
```

<b>Breaking changes (Only on browsers)</b>:
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.

<b>Example usage</b>:
```
hive.api.getAccounts(['mahdiyari', 'hiveio'], function(err, result) {
	console.log(err, result);
});
```

<b>Deprecated method:</b>
`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);
```


<b>Source code and full documentation</b>: https://gitlab.syncad.com/hive/hive-js
<b>Npm package</b>: 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.

<b>Source code and full documentation</b>: https://github.com/mahdiyari/hive-tx-js
<b>Npm package</b>: 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.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 241 others
properties (23)
authormahdiyari
permlinkhive-js-and-hive-tx-migration-to-hive-breaking-changes-for-browsers
categoryhive-139531
json_metadata{"app":"peakd/2020.04.5","format":"markdown","tags":["hive","dev","hive-js","hive-tx","update"],"users":["hiveio"],"links":["https://gitlab.syncad.com/hive/hive-js","https://www.npmjs.com/package/@hiveio/hive-js","https://github.com/mahdiyari/hive-tx-js","https://www.npmjs.com/package/hive-tx","https://gitlab.syncad.com/hive"],"image":["https://files.peakd.com/file/peakd-hive/mahdiyari/uMVfF55Y-hive-js-hive-tx.jpg"]}
created2020-04-27 17:08:15
last_update2020-04-27 17:08:15
depth0
children30
last_payout2020-05-04 17:08:15
cashout_time1969-12-31 23:59:59
total_payout_value22.656 HBD
curator_payout_value19.907 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,783
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,034,180
net_rshares59,728,451,881,156
author_curate_reward""
vote details (305)
@amico ·
Thanks for developing and sharing this *"toy"*, @mahdiyari!
Bookmarked and reblogged!
!tip & hugs! 🤗
@tipu curate
properties (22)
authoramico
permlinkre-mahdiyari-q9gjth
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 17:41:42
last_update2020-04-27 17:41:42
depth1
children0
last_payout2020-05-04 17:41:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length113
author_reputation51,076,240,298,517
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,034,746
net_rshares0
@clumsysilverdad ·
sweet
properties (22)
authorclumsysilverdad
permlinkre-mahdiyari-2020427t123536919z
categoryhive-139531
json_metadata{"tags":["hive","dev","hive-js","hive-tx","update"],"app":"esteem/2.2.5-surfer","format":"markdown+html","community":"esteem.app"}
created2020-04-27 17:35:42
last_update2020-04-27 17:35:42
depth1
children0
last_payout2020-05-04 17:35:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5
author_reputation28,166,630,869,767
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,034,635
net_rshares0
@drakos ·
I like the new `alternative_api_endpoints`, does it failover to the next endpoint when one errors?
properties (22)
authordrakos
permlinkre-mahdiyari-q9gjdw
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 17:32:24
last_update2020-04-27 17:32:24
depth1
children2
last_payout2020-05-04 17:32:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length98
author_reputation112,280,226,665,329
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,034,582
net_rshares0
@mahdiyari ·
Yes. The expected behavior is a failover to the next endpoint.
properties (22)
authormahdiyari
permlinkq9gjlf
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-04-27 17:36:51
last_update2020-04-27 17:36:51
depth2
children1
last_payout2020-05-04 17:36:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length62
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,034,662
net_rshares0
@keys-defender ·
Nice! I don't have to re-invent the wheel swapping nodes in my code anymore.
properties (22)
authorkeys-defender
permlinkq9qjat
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-05-03 03:06:30
last_update2020-05-03 03:06:30
depth3
children0
last_payout2020-05-10 03:06:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length76
author_reputation91,066,495,448,589
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,151,501
net_rshares0
@eturnerx ·
Thanks for doing this important work.
👍  
properties (23)
authoreturnerx
permlinkre-mahdiyari-2020428t5208922z
categoryhive-139531
json_metadata{"tags":["hive","dev","hive-js","hive-tx","update"],"app":"esteem/2.2.5-mobile","format":"markdown+html","community":"hive-125125"}
created2020-04-27 17:20:12
last_update2020-04-27 17:20:12
depth1
children0
last_payout2020-05-04 17:20:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length37
author_reputation103,695,946,143,660
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,034,376
net_rshares19,691,143,157
author_curate_reward""
vote details (1)
@howo ·
hive.config.set('alternative_api_endpoints', ['https://api.hive.blog', 'https://anyx.io']); 

OMG THANK YOU
properties (22)
authorhowo
permlinkre-mahdiyari-q9glqz
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 18:23:24
last_update2020-04-27 18:23:24
depth1
children2
last_payout2020-05-04 18:23:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length107
author_reputation515,737,941,459,006
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,035,545
net_rshares0
@mahdiyari ·
For just clarification: `alternative_api_endpoints` is added by someone else. I just documented it.
properties (22)
authormahdiyari
permlinkre-howo-q9glxi
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 18:27:18
last_update2020-04-27 18:27:18
depth2
children1
last_payout2020-05-04 18:27:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length99
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,035,604
net_rshares0
@howo ·
aw 
properties (22)
authorhowo
permlinkre-mahdiyari-q9gm10
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 18:29:27
last_update2020-04-27 18:29:27
depth3
children0
last_payout2020-05-04 18:29:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3
author_reputation515,737,941,459,006
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,035,639
net_rshares0
@lemouth ·
Thanks for the work!
properties (22)
authorlemouth
permlinkre-mahdiyari-q9gybk
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 22:54:57
last_update2020-04-27 22:54:57
depth1
children0
last_payout2020-05-04 22:54:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length20
author_reputation338,011,164,701,274
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,039,971
net_rshares0
@lemouth ·
Note the typo:
```
I20200506-13:22:30.477(2)? Alternate endpoitns:  [ 'https://api.hive.blog', 'https://anyx.io' ]
I20200506-13:22:30.524(2)? Error Failover Threshold:  3
```

'endpoitns' should be replaced by 'endpoints' :)
properties (22)
authorlemouth
permlinkre-mahdiyari-q9wqd8
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-05-06 11:24:45
last_update2020-05-06 11:24:45
depth1
children1
last_payout2020-05-13 11:24:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length224
author_reputation338,011,164,701,274
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,217,657
net_rshares0
@mahdiyari ·
thank you
properties (22)
authormahdiyari
permlinkq9wqs1
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-05-06 11:33:36
last_update2020-05-06 11:33:36
depth2
children0
last_payout2020-05-13 11:33:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length9
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,217,767
net_rshares0
@memehub ·
Are there types for typescript with hive-js?
properties (22)
authormemehub
permlinkre-mahdiyari-q9kjyz
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-29 21:35:24
last_update2020-04-29 21:35:24
depth1
children3
last_payout2020-05-06 21:35:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length44
author_reputation62,861,005,302,918
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,083,370
net_rshares0
@mahdiyari · (edited)
I might not understand what's your mean. But hive-js should work with typescript too.
```
import * as hive from 'hive-js'
```
properties (22)
authormahdiyari
permlinkq9kklq
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-04-29 21:49:00
last_update2020-04-29 21:49:30
depth2
children2
last_payout2020-05-06 21:49:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length125
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,083,564
net_rshares0
@memehub · (edited)
kools, I started off on dsteem and it worked with typescript. For clarity I was tryina ensure that hive-js had types to work with typescript. Do you know if dsteem will be ported over and which is the recommend lib for deving for hive?
properties (22)
authormemehub
permlinkre-mahdiyari-q9kmfb
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-29 22:28:24
last_update2020-04-29 22:28:57
depth3
children1
last_payout2020-05-06 22:28:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length235
author_reputation62,861,005,302,918
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,084,073
net_rshares0
@pixelfan ·
How much time do we have to make the transition?
properties (22)
authorpixelfan
permlinkre-mahdiyari-q9gsaw
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.04.5"}
created2020-04-27 20:45:00
last_update2020-04-27 20:45:00
depth1
children2
last_payout2020-05-04 20:45:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length48
author_reputation297,577,030,796,383
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,037,937
net_rshares0
@mahdiyari ·
Hive-js is the official library (for now) and will get updated regularly. You can use whatever works for you.
I think after next hf, steem libraries will not work on Hive.
properties (22)
authormahdiyari
permlinkq9gsm6
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-04-27 20:51:42
last_update2020-04-27 20:51:42
depth2
children1
last_payout2020-05-04 20:51:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length171
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,038,066
net_rshares0
@pixelfan ·
ok, great... I still have some time then...
Thx for the quick reply! 👍
properties (22)
authorpixelfan
permlinkq9gsxy
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-04-27 20:58:48
last_update2020-04-27 20:58:48
depth3
children0
last_payout2020-05-04 20:58:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length70
author_reputation297,577,030,796,383
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,038,188
net_rshares0
@sn0n ·
Anyone else having issues with old data being pulled? Seems `hive.api.getAccounts` is pulling old hive information, not the most recent update. I've tried multiple browsers and even a second computer to verify, example page is the console.log history on https://profile.blokz.io/?hive=sn0n
properties (22)
authorsn0n
permlinkre-mahdiyari-qab90d
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.05.2"}
created2020-05-14 07:33:51
last_update2020-05-14 07:33:51
depth1
children7
last_payout2020-05-21 07:33:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length290
author_reputation25,801,997,535,483
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,362,514
net_rshares0
@sn0n ·
https://hiveblocks.com/@sn0n I'm noticing has 2 different versions of json metadata, the text in red is incorrect, but I see a posting json metadata on top that is showing updated information.... Assistance is more then welcomed. 
properties (22)
authorsn0n
permlinkre-sn0n-qab9pk
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.05.2"}
created2020-05-14 07:48:57
last_update2020-05-14 07:48:57
depth2
children6
last_payout2020-05-21 07:48:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length230
author_reputation25,801,997,535,483
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,362,664
net_rshares0
@sn0n ·
https://github.com/steemit/steem/issues/3274 has more information, apparently it's a artifact from pre-hf21... Could this be updated to use posting_json_metadata with a json_metadata fallback? Or something? 
properties (22)
authorsn0n
permlinkre-sn0n-qabai0
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2020.05.2"}
created2020-05-14 08:06:03
last_update2020-05-14 08:06:03
depth3
children5
last_payout2020-05-21 08:06:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length207
author_reputation25,801,997,535,483
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,362,879
net_rshares0
@wehmoen · (edited)
 
properties (22)
authorwehmoen
permlinkre-mahdiyari-q9gz8i
categoryhive-139531
json_metadata{}
created2020-04-27 23:14:45
last_update2020-06-03 06:16:39
depth1
children2
last_payout2020-05-04 23:14:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation86,504,380,503,125
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,040,211
net_rshares0
@mahdiyari ·
$0.47
lol
Of course ;P
👍  ,
properties (23)
authormahdiyari
permlinkq9gzb8
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2020-04-27 23:16:18
last_update2020-04-27 23:16:18
depth2
children1
last_payout2020-05-04 23:16:18
cashout_time1969-12-31 23:59:59
total_payout_value0.232 HBD
curator_payout_value0.233 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length16
author_reputation199,864,818,197,856
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,040,232
net_rshares1,045,099,894,626
author_curate_reward""
vote details (2)
@wehmoen · (edited)
 
properties (22)
authorwehmoen
permlinkre-mahdiyari-q9h0t0
categoryhive-139531
json_metadata{}
created2020-04-27 23:48:39
last_update2020-06-03 06:16:33
depth3
children0
last_payout2020-05-04 23:48:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation86,504,380,503,125
root_title"Hive-js & Hive-tx migration to Hive - Breaking changes for browsers!"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id97,040,624
net_rshares0