Is There a Super Nerd That Can Tell Me What I'm Doing Wrong Here? [SOLVED]

in #steemdev6 years ago (edited)

SCROLL DOWN FOR SOLUTION

What am I doing wrong when serializing this "claim_reward_balance" operation? The server doesn't seem to like it ...
keyboard-smash.gif
src

Json
["claim_reward_balance",
{"account":"fulltimegeek",
"reward_steem":"0.442 STEEM",
"reward_sbd":"0.364 SBD",
"reward_vests":"1481.978010 VESTS"}]

Buffer
390c66756c6c74696d656765656bba0100000000000003535445454d00006c0100000000000003534244000000009a305558000000000656455354530000

operation_id (39)

bytevalue
0139

string_len (fulltimegeek)

bytevalue
020c

"fulltimegeek" string encoded

bytevalue
0366
0475
056c
066c
0774
0869
096d
1065
1167
1265
1365
146b

STEEM amount (0.442 x 1000 == 442 == 0x1BA)

bytevalue
15ba
1601
1700
1800
1900
2000
2100
2200

STEEM precision

bytevalue
2303

STEEM symbol ("STEEM")

bytevalue
2453
2554
2645
2745
284d
2900
3000

My methods for serializing STEEM, SBD and VESTS are identical, except for the precision ... any thoughts? The sooner I resolve this the sooner I can finish my Steem Android application.

Paging super nerds: @vandeberg @theoretical @roadscape @anyx


SOLUTION: Byte01 is suppose to be 0x27 not decimal 39

Sort:  
Loading...

Hey @fulltimegeek,

I think I don't really understand your issue. Maybe it's that you want to automate the process auf claiming your rewards and you struggle with this?

Can you tell me which programming language you are using? And how your current code actually looks like? Here is an issue related to "claiming rewards" in the javascript repo of steemit. https://github.com/steemit/steem-js/issues/215

Maybe this already solves your issue? Otherwise more information would be appreciated to be able to help you. :)

Best

Can you tell me which programming language you are using?

Java

Here is an issue related to "claiming rewards" in the javascript repo of steemit.

I will look into this issue and see if it's related to mine. Thank you for the pointers.

@fulltimegeek So you are directly interacting with the RPC node and creating the operations on your own? Then I'm pretty sure that your need to handle the order also on your own. The RPC API needs an array of parameters, and not an object. But normally the RPC node wrappers are handling this. What are you using? Is there a java implementation for steem?

Otherwise checkout my other comment, I've described my theory there.

So you are directly interacting with the RPC node and creating the operations on your own?

That is correct.

Then I'm pretty sure that your need to handle the order also on your own.

Order should only matter in serialization I believe. Json have maps with keys so order shouldn't be that critical. I'm not 100% sure tho on that. But, I'll play around with it.

I wish STINC had a utility or website that allowed anyone to construct operations and then spit out the raw buffer for one to sign. That would help A LOT ...

This the json that is getting send to the RPC node. Please adapt it and it will work. :)

{"id":2,"jsonrpc":"2.0","method":"call","params":["network_broadcast_api","claim_reward_balance",[account, steem, sbd, vests]]}

in case it does not work, I'll have a look in a couple of hours.

Well it looks like you are having immense fun here!

Sadly, this is beyond my pay grade, but I've put the link into the Utopian development discord room in the hope some bright spark picks it up and can help you out.

Good luck!

Thank you Asher for passing this on to the Utopian dev crew! Much appreciated :)

lol... well I'm ruled out then... :)

We can sit warming the bench together today Dave :)

I was sitting on the sideline too. Cheering on. :)

good go have you helping too @beeyou! :P

We had to let the brains tackle this one. 😁

lol... yes you and Asher had it covered! I was standing on the sidelines with a megaphone saying "good luck and keep up the good work" :)

This reminds me of the comments I used to receive, until the price fell!

lol... glad it got solved without us Asher because this one wasn't anywhere near my wheelhouse! :P

Sorry, can't help... But I loved the gif. It's how I feel when I deal with people and try and explain cryptocurrency!

Hope you get it resolved

The server doesn't seem to like it ...

Do you have a specific error message you are receiving? That may help pinpoint the issue. Also, are you connecting to api.steemit.com or a different node? Lastly, are other operations working for you and it's just this one that is causing a problem, or is this the first operation you are trying to code?

Server is telling me "missing required posting authority:Missing Posting Authority fulltimegeek"

I'm signing this operation+tx just like I do all the other ones, which do work, so I guess there is a problem with serialization before it's signed ...

Appreciate you stopping by Matt. I saw FTG updated the post with a solution. World of finicky numbers that I am lucky to not be involved in. :)

SOLUTION: Byte01 is suppose to be 0x27 not decimal 39

dear @yabapmatt plz check your steem chat i waiting your reply and and check memo in your wallet

@yabapmatt i configure bidding bot with you plz reply

Passing to @bennierex . I'm wondering whether he encountered while developing Steemify.

Steemify is more of a consumer in this regard, but @fulltimegeek, what encoding are you using and how do you sign your transaction?

The problem was I wasn't converting the operation id (39) to hex.

what encoding are you using and how do you sign your transaction?

I'm encoding the strings with UTF-8 and using my own Java lib for signing.

Thanks for stopping by @bennierex and trying to help a nerd in distress :)

Glad you figured it out!

I really don't know.

What I do know that if you're trying to freeze the whole blockchain again, like happened a few weeks ago, then we're lucky that you didn't succeed 😋😆😜

What I do know that if you're trying to freeze the whole blockchain again

Which blockchain was that? I'm only aware of that happening to EOS.

Steem was also gone for some hours. I think even over half a day.

To the question in your title, my Magic 8-Ball says:

Yes

Hi! I'm a bot, and this answer was posted automatically. Check this post out for more information.

I'm also beginning to understand why people downvote bots

Lol

Of he really was a magic ball he would have answered this question correctly.

At least he tried to help, poor bot xD

I wish I could help with this but I don't know much about coding.

Are you developing an steem application? By any chance do you have more info about this?

Android app and not IOS? :( I understand the proprietary limitations though.

Beyond my skillset, unfortunately. The only developer I 'know via the blockchain' is @yabapmatt. I don't know if he check mentions, but I can resteem. From what I can tell about him, he would assist if he has the knowledge.

Reasons why I program for Android and not iOS:

  • Android is open source
  • Java/Groovy are my preferred languages

I don't know if he check mentions, but I can resteem.

Thank you for the resteem! Much appreciated :)

I am fortunate to have my answers readily available on google when I need help with excel formulas or the dreaded photoshop. Don't believe this issue can be 'googled'.

Good luck with finding a solution. I saw others passing it around too; hopefully a nerd will come to the rescue. :)