You are viewing a single comment's thread from:

RE: Steem Tutorials Are Severely Lacking (Where is Hello World?)

in #tutorial6 years ago (edited)

Seriously, all I'm trying to do is upvote a permlink with JavaScript and there are no instructions on how to accomplish the basics.

<script src="https://unpkg.com/dsteem@latest/dist/dsteem.js"></script>
<script>
var client = new dsteem.Client('https://api.steemit.com')
var key = dsteem.PrivateKey.fromLogin('bigpun', 'master-password-goes-here', 'posting')

client.broadcast.vote({
voter: 'bigpun',
author: 'edicted',
permlink: 'steem-tutorials-are-severely-lacking-where-is-hello-world',
weight: 10000}, key).then(function(result){
      document.write('Included in block: ' + result.block_num)
}, function(error) {
      document.write(error)
})
</script>

Sort:  

Seriously though? I have to put my master password in there?

I have zero experience with that api except for that code I just shared. There is probably another api call that doesn't require the master.

yeah well it totally worked... my brain would not allow me to even test the master password... that seems really really dumb.

I dug around a bit and found the PrivateKey.fromString() call 😊

var key = dsteem.PrivateKey.fromString('posting-key-goes-here')

much appreciated! works!

I'm glad my tech support worked :) ... time to celebrate with a nerd rap

What API are you using?

I made my own.

For reading the blockchain it's quite easy to do. But, when you start introducing private keys and having to sign a message, that's a whole nother level of complexity.

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 61937.20
ETH 3004.64
USDT 1.00
SBD 2.49