Some SteemConnect Chrome Debugger Fun for the Conversion

in code •  7 years ago  (edited)

First of all, let me preface this post by saying that it is basically worthless, unless you like to tinker and are just curious. Recently, I've been poking at ways to access the conversion mechanism of the blockchain. It used to be in the Steemit UI but was removed in this condenser change, after too many people were using it to convert SBD to STEEM at a loss (when SBD was worth more than 1 USD). Now that it has recently been trading under 1 USD, I've been looking for ways to access this functionality. I know of the following mechanisms at the moment:

  1. Vessel Desktop App
  2. SBD to STEEM Converter by @mwfiae (Thanks @Tiger-zaps for answering my musing question). Since the github hosted page runs what's checked in, one can wait for a third party to audit the code at a specific revision before using it. The code is here and has remained unchanged since Jun 25th. Looking at it myself it is written in a way to simplify the audit, as it pulls the official dsteem javascript library and it's easy to trace how the private key is being passed around. And it's fine for that version. At this point you've likely already trusted the active key to Steemconnect anyway, but yeah in general make sure you have done your due diligence. I'm sure all this text is just scaring you away from using it now though...
  3. (Edit) Steemcomnect now works! Click the sample URL below and tweak to what you like.

Because I've become accustomed to using SteemConnect to sign and broadcast transactions, I wanted to see if there was a corresponding URL that could be used to do the convert operation. Well, turns out that yes, there is one. But it doesn't quite work!

I filed this issue on the Steemconnect Github for what went wrong, and as I looked just now, it's already got a pending fix. Hooray!

Anyway, with a bit of tinkering with using the Chrome debugger, I was able to get it past the issue, and I'm dumping my journey here just for fun. Obviously, use the below sequence at your own risk. Actually, don't. A fix is coming.

First, I used a link like:
https://v2.steemconnect.com/sign/convert?requestid=1&owner=eonwarped&amount=5.000%20SBD

When it failed, I right clicked in chrome and hit "Inspect" (or Ctrl+Shift+I), and looked into the console. The error was that the requestid needs to be an integer, and at the time it was a string.

notinteger.PNG

Then I hit Ctrl-P to search for source, and typed broadcast/index.js, popping up a relevant file (there were a lot of investigation steps prior to landing on this page, and I'm leaving that out).

I set a breakpoint on line 90 by clicking the number 90 on the left, which marked the line in blue. The line in question was

debug('Sending operation "' + operationName + '" with', { options: options, callback: callback });

Then I refreshed the page and tried the signature again. It paused the execution exactly at this line.

Now I hovered my mouse over "options".

debuggeroptions.PNG

I doubleclicked the "1" in the requestid field, and replaced it with a request ID that was not a string, e.g. 2018081401 (guess how I came up with this one...), making sure that it was not in double-quotes.

After the replacement, I clicked the play button to resume the execution. Voila! I guess... Again, this will be fixed pretty soon. Though I really should just go download Vessel. Hell, why haven't I just downloaded it yet? I think I'll go do that now...

Edit: it works now! Nice quick turnaround :)

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:  

Very interesting. I've been digging around this space a bit myself. Thanks for sharing.

Thanks for this! I use Steemconnect for every transaction. Following.

Hey, this is awesome. I followed the link from reddit.
If this is really going to be available then that's great news if the price continues to tank.

Yup. I have been using it already, so it's live!

learning post i understood about how to write quality post.