Steem-Tx | Now on Browsers + benchmark

in #steem3 years ago


Steem-Tx is a lightweight and complete JavaScript library for using Steem blockchain in Javascript environments such as Web or NodeJS.

Two months ago Steem-tx has been announced. At that time, using it only was possible in the NodeJS applications (and not Websites).

With the help of browserify and tinyify now it's possible to use Steem-tx on the browser too.

Thanks to JSDeliver, minified Javascript file is available on the CDN and also on the GitHub repository:

<script src=""></script>

Everything works like NodeJS apps.
A full example of Web usage which you can copy and run in your browser too:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <script src=""></script>
    <title>Test steem-tx</title>
      // change api
      steemTx.config.node = ''

      const operations = [
            voter: 'guest123',
            author: 'guest123',
            permlink: '20191107t125713486z-post',
            weight: 9900
      const myKey = '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'
      const privateKey = steemTx.PrivateKey.from(myKey)

      const tx = new steemTx.Transaction()

      // create transaction
      tx.create(operations).then(() => {
        console.log('Created transaction:', tx.transaction)

        // sign the transaction
        console.log('Signed transaction:', tx.signedTransaction)

        // broadcast the transaction
        tx.broadcast().then(res => console.log('Broadcast result:', res))

      // get accounts
        .call('condenser_api.get_accounts', [['mahdiyari']])
        .then(res => console.log('Get accounts:', res))

This example is also available in the GitHub repository


I don't know how precise is, but here is the benchmark link.
I believe results should be bigger than 1,000 ops/sec for both dsteem and steem-tx. (maybe I'm wrong)

Also, on the NodeJS:

GitHub repository:
NPM package:

Feel free to test, use, and share. With the hope for better Steem!


hi @mahdiyari when trying to use steemauto - "error":"access_token is wrong"

Already answered you off the chain.

For other users:
This type of error about "access_token" usually means "Steemconnect" is not working correctly at that moment. And usually gets fixed in a few hours.

Steemconnect is a third-party app that we use to authorize our users with more security.

Nice work!

Slight noob question: What's the difference between using this vs. embedding Steem KeyChain into a project? Does one do more than the other?

Or is it simply an alternative?

Steem keychain is for users to interact with steem blockchain and perform actions like sending STEEM.
Libraries like this (steem-tx, steem-js, dsteem) give the ability to the Steem keychain to communicate with Steem blockchain and perform such actions.

Ah, so, in terms of hierarchy, it would be:

  • steem blockchain stores transactions
  • steem-tx communicates with steem blockchain
  • keychain uses steem-tx ( theoretically ) to allow users access

Got ya. Thanks! :^)

My account(@june0620) has not been able to automatically upvote recently. Can you help me find out why? (I recently modified my master key)

Explained under that section you sent here. Change "Upvote Mana threshold" to something like 70%

Coin Marketplace

STEEM 0.18
TRX 0.08
JST 0.025
BTC 27054.81
ETH 1884.37
USDT 1.00
SBD 2.25