A Wretch Like You avatar

Python Hot Signing Link Generation Tool for HiveEngine transfers

anthonyadavisii

Published: 24 Oct 2020 › Updated: 24 Oct 2020Python Hot Signing Link Generation Tool for HiveEngine transfers

Python Hot Signing Link Generation Tool for HiveEngine transfers

    Generating hot signing links using python had been a roadblock for our bot development.

After a bit of trial by error, found the issue and the solution.

     Long story short, it was a encoding issue corrected by enclosing the required_auths and required_posting_auths arrays in doublequotes as follows:

...
        "required_auths": "[\"anthonyadavisii\"]",
        "required_posting_auths": "[]",
...

     The latter didn't matter so much as it was an empy array but the former had double quotes which were being encoded as single quotations(%27) as a result. This led to an "Invalid cast from string_type to Array" error when attempting the link.

Anyways, glad this was figured out so we can move forward with the next phases of development.

image.png

Repository:

https://github.com/anthonyadavisii/get_hive_engine_hc_hot_link

get_hive_engine_hc_hot_link

Python utility generates Hive Connect hot signing links for perform Hive-Engine token transactions

Prerequisites:

Installation:

pip install hivesigner
  • Usage:

Import script as module.

import get_hive_engine_hc_hot_link

#Example usage
get_hive_engine_hc_hot_link.get_he_hc_hot_link('anthonyadavisii','HDR','1','test post id')

Should output as follows:

'https://hivesigner.com/sign/custom_json?authority=active&required_auths=%5B%22anthonyadavisii%22%5D&required_posting_auths=%5B%5D&id=ssc-mainnet-hive&json=%7B%22contractName%22%3A%22tokens%22%2C%22contractAction%22%3A%22transfer%22%2C%22contractPayload%22%3A%7B%22symbol%22%3A%22HDR%22%2C%22to%22%3A%22hive-dr%22%2C%22quantity%22%3A%221%22%2C%22memo%22%3A%22test+post+id%22%7D%7D'

Test Results

image.png
https://hiveblocks.com/tx/602b425598f18fb2ca2d6d0b1da274dd64f1fb9f

image.png

I plan on refining this so it may be run as a script in addition to interactively. Feel free to fork and suit to your purpose. I will be using it as part of the abuse reporting functionality for Hive Downvote Rewards project (hive-dr@hive-dr) formerly steemflagrewards@steemflagrewards.

Thank you for your time and supporting this work


Additional Links:

HiveEngine

https://hive-engine.com/

(Below included in Github repo for onboarding potential)
Are you interested in the HIVE social media blockchain? Get started with my links below:

Ecency Referral Link

https://ecency.com/?referral=anthonyadavisii

HiveOnboard

https://hiveonboard.com?ref=anthonyadavisii

Leave Python Hot Signing Link Generation Tool for HiveEngine transfers to:

Written by

Jack of all trades IT Pro, Flag Enthusiast, Sovereign Grace, USMC, Technically a Cyborg

Read more #hive-139531 posts


Best Posts From A Wretch Like You

We have not curated any of anthonyadavisii's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From A Wretch Like You