scrobble.life
#steem

Steem-tx | Lightweight JavaScript library for creating and signing transactions on the Steem blockchain

steem-tx.jpg

steem-tx-js

Lightweight JavaScript library for creating, signing, and broadcasting transactions on the Steem blockchain


Important: As this post gets older, please check official GitHub repository for the latest instructions and updates.

---

Why this?

steem-js and dsteem libraries are not easy to integrate and in some cases are incompatible with some frameworks like Nativescript

NativeScript is an open-source framework to develop apps on the Apple iOS and Android platforms. It was originally conceived and developed by Progress. NativeScript apps are built using JavaScript, or by using any language that transpiles to JavaScript, such as TypeScript. - Wikipedia

This library is a solution to such cases when official libraries are not working. And also an alternative for just creating, signing, and broadcasting transactions.

How Steem-tx works:

I'm preparing another post about this library. A full instruction on how to serialize and sign Steem transactions with JavaScript. It will take a few days to be ready.

Installation

npm install steem-tx --save

Usage

Create transaction:

const steemTx = require('steem-tx')
const operations = [
  [
    'vote',
    {
      voter: 'guest123',
      author: 'guest123',
      permlink: '20191107t125713486z-post',
      weight: 9900
    }
  ]
]

const tx = new steemTx.Transaction()
tx.create(operations).then(() => console.log(tx.transaction))

Sign transaction:

(multi signature is supported)

// please use this key just for testing purposes
const myKey = '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'
const privateKey = steemTx.PrivateKey.from(myKey)

tx.sign(privateKey)
console.log(tx.signedTransaction)

Broadcast transaction:

tx.broadcast().then(res => console.log(res))

Make node call:

steemTx.call('condenser_api.get_accounts', [['mahdiyari']]).then(res => console.log(res))

GitHub: https://github.com/mahdiyari/steem-tx-js npm package: https://www.npmjs.com/package/steem-tx


Feel free to test, use, share!

Future plans?

I'm building different applications mainly for Steem blockchain and I will try to keep this library as light as possible but also, useful with main functions for interacting with Steem blockchain. I believe having more tools will help grow use cases of Steem blockchain.

Many features, like getting posts and accounts are easy to implement with basic api calls. But serializing and signing transactions are a little bit complex to be implemented. That's why I decided to prepare another post about it and explain as much as I can.

Let's hope and work for a better future for the people in the World and on the Steem blockchain ❤

And remember, you can vote for mahdiyari as a witness

Comments · 42

  • @pijush6061(40)· 2470d

    looks great..... love it...😍

  • @andresigirow(6)· 2470d

    It is like

  • @alla312(25)· 2470d

    Great job!!!!

  • @thesobuz(63)· 2470d

    Amazing!! 🤪🤪

  • @jekhy(7)· 2470d

    Thanks for the post.

  • @laxyasaru(58)· 2470d

    please follow me

    Posted using Partiko Android

  • @trendotoken(59)· 2470d

    Congratulations @mahdiyari, your post successfully recieved 0.15870938 TRDO from below listed TRENDO callers:

    @pandaparker earned : 0.10580625 TRDO curation


    To view or trade TRDO go to steem-engine.com Join TRDO Discord Channel or Join TRDO Web Site

  • @chireerocks(75)· 2471d

    @mahdiyari, These efforts are really appreciable. An Ecosystem which have diversified Alternatives performs very flexibly and developers like you definitely deserve appreciation and recognition.

    Good wishes from my side and have a successful journey ahead. Stay blessed.

    Posted using Partiko Android

  • @greatesteem(59)· 2471d

    Best post on the blockchain right now! This is where everybody with investment (SP) should upvote right now. This post will pillage all the small posts with under $10 payout, for even greater returns for all curators. Get your upvotes in now!! #NewSteem #HF21

  • @marcniv(41)· 2471d

    Perfect, it looks great !!

  • @technologix(61)· 2471d

    Thanks @mahdiyari for sharing this info!

    Posted using Partiko Android

  • @rudyardcatling(65)· 2472d

    to ppl readin i havent tested it

    but steem can use some interesting

    he's also not my friend he downvoted me, but

    saving the sinking ship is always a good idea if you wanna stay on it

    its okay

    my next target would be

    "being able to downvote patrice IF I CHOSE TO DO SO "

    we cool

  • @sugarandspiceng(25)· 2472d

    Blockchain way

  • @bigso(57)· 2472d

    Yes i do

  • @mgthitsar(51)· 2472d

    i love it.😍😍

  • @weke(25)· 2472d

    wow, it's hot !

  • @darmianto5(60)· 2472d

    Very good javacrib

  • @jferdous(67)· 2472d

    Good writing.

  • @mama.anarchy(58)· 2472d

    .

  • @smooth(74)· 2472d

    Somewhat echoing the comments of @vandeberg, I'd love to see similar minimal yet complete Steem libraries for other popular languages.

  • @sexycarmen(44)· 2472d

    I'm planning to join dtube and I think it's an interesting app. There are particular tags where your videos can be shared with, I'm planning to add more of these tags in my videos and you can try it too, it will help your video to be generated with the right audience or people and it's going to be fun. Best of luck to you and me too.

  • @dadaozhijian(22)· 2472d

    it's cool

  • @izbitco(25)· 2472d

    Hi

    Posted using Partiko Android

  • @ahmedkhamich(25)· 2472d

    very good poste and i would like to tell you that this information that you have shared with us is really important information and i hope you share this important things with regards to ''steem''

  • @sniki003(67)· 2473d

    Nice post man! :D

  • @steemitblog(75)· 2473d

    Congratulations, this post is now Featured on steemit.com and was tweeted by @steemit to over 100,000 followers! Thanks for your valuable contribution to the Steem ecosystem!

  • @pandaparker(59)· 2473d

    Steem is the present and future of crypto and web3.0 $trdo

    Posted using Partiko Android

  • @vandeberg(66)· 2473d

    I love how this is a minimal, yet complete, Javascript library for Steem. It is very similar to how I would design a Javascript library if we were to move away from steem-js and dsteem. Great job! I hope it gains traction.

  • @sugarandspiceng(25)· 2473d

    Java!!!

  • @arcange(79)· 2473d

    Congratulations @mahdiyari! Your post was mentioned in the Steem Hit Parade in the following category:

    • Pending payout - Ranked 1 with $ 102,37
  • @ackza(74)· 2473d

    WOW glad to se you getting upvotes from non bid bots . ocdb won! this is crazy cool to see developers getting funded this much at 15 cent steem! ,

    i hope to see this formlized this into a develoepr wps, just for developers, i can use SQRL and get us a token and our own proposal system, like imagine , giuthub inside vessel wallet sort of thing :D ok man im so tired g2g but good job!

    @mahdiyari id like to recruit you to work with telos community, not to take you away from steem just to enhance it... please come check out https://t.me/hellotelos id love to gfet your helpo with cross chain work, telos is a land of opportunity and IBC i can help steem with telos and this is great stuff i will send u 1 TLOSP right now with @banjo bot by inertia :0

  • @bitcoiz(27)· 2473d

    ★★★★★ Get up to 1 BCH, 1 LTC per week

    ▪️Legit, Auto withdraw direct wallet ▪️No investment needed ▪️No Scam ▪️No Ads ▪️No Captcha

    BCH Install now https://t.co/uODZP0sxXu

    LTC Install now https://t.co/tFCdKlJYqV

    Posted using Partiko Android

  • @steemslotgames(72)· 2473d

    At the first look it seems pretty good! 💪

  • @mhboobahmed(26)· 2473d

    can't even understand it, but still love it

  • @kingscrown(82)· 2473d

    good stuff man

  • @stuffbyspencer(62)· 2473d

    looks helpful!

    thanks for making & releasing this, it'll for sure be useful for lots of us :^)

  • @epic-fail(70)· 2473d

    the code looks perfect to me

  • @mstafford(68)· 2473d

    Right when I'm starting to look at developing an Android app. What timing!

  • @contrabourdon(73)· 2473d

    You have my witness vote too ;) @untersatz curate 100

  • @contrabourdon(73)· 2473d

    Bookmarking this for later! Thanks. !steem2email

  • @cardboard(65)· 2473d

    Neat :) @tipu curate

  • @inertia(75)· 2473d

    I love it! This looks great!