Steemsnippets v1.2.1 (I am slowing down on the versioning)

in utopian-io •  7 years ago  (edited)

This is the fourth update for steemsnippets an open source collection of code snippets on steem-related libraries. You can find more info in it here.

I've added two new snippets for steemjs :

Work done :

Added snippets :

Transfer (steemjs)

https://github.com/drov0/steemsnippets/blob/master/steemjs/transfer/transfer.js

Function header :

function transfer(wif, from, to, amount, memo)

It's pretty straightforward, the only thing you need to be carefull about is the amount, it must be written like this : x.xxx unit eg : '1.265 STEEM' or '44.000 SBD'

get voting power

https://github.com/drov0/steemsnippets/blob/master/steemjs/voting_power/voting_power.js

This one is very easy to use, just input the username and you're done. It's very usefull for your voting bots out here.

function header :

function getvotingpower(account, callback)

Next time we'll see some other functions like delegating, and some more "get" functions like how to calculate the payouts in steem/sbd etc.

commits :

image.png

github repos : https://github.com/drov0/steemsnippets

Proof of work can be found in the readme.



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thanks for assembling these @howo. Your helpful snippets have accelerated my dive into steemit related dev.

A question for you, or anyone reading that may have the answer—In the vote.js snippet voting power can be assigned a weight...

* @param {int} weight - Power of the vote, can range from -10000 to 10000, 10000 equals a 100% upvote. -10000 equals a 100% flag.

While the Steemit FAQ indicates we need 500 SP to see the voting power slider.

So, is this 500 SP limitation built into STEEM or is it more a feature of Steemit and the slider just a convenience?

In other words can any user adjust their voting power if voting through code or an tool that implements the adjustment? Or are the adjustments ignored below a certain SP?

Thanks for any insights! I will also experiment when I have time and STEEM Power to spare ;) I starred this on github and am looking into utopian-io for the first time.

Super post!

  ·  7 years ago (edited)

Thanks a lot for your interest ! Well yes any user can ajust their voting power but if you vote with a percentage that's too low then your vote will be worth nothing and since the steem blockchain only allows for three decimals (0.001) if the vote can't even generate 0.001 then it forbids to vote since it would fill the blockchain with useless transactions.

So on steemit they put the slider limit at 500 sp because it's kind of where even an 1% vote has value. But in reality you can upvote at any weight as long as you have enough sp to cast it ;)

at any weight <= then it's about time they let me upvote at 3000%! :P

"can range from -10000 to 10000" though :p

Upvoted on GitHub. Your snippets will be very useful when I start developing something for Steemit. Cheers.

Thanks a lot ! Github support means a lot :p

Really cool

Thanks :)

Hey @howo I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

#Very good content and great efforts in #publishing
#Deserves more #votes
I was #happy to pass from here to see your #publication
I wish my follow-up in my publications and# attention
#Greetings to you and wish more #wonderful publications
@WalidSalah