BitShares Forum

Main => Technical Support => Topic started by: alt on December 21, 2015, 09:35:45 am

Title: howto signature the transaction from python?
Post by: alt on December 21, 2015, 09:35:45 am
If I got a transaction like this:
Code: [Select]
{'expiration': '2015-12-21T09:33:30',
 'extensions': [],
 'operations': [[1,
                 {'amount_to_sell': {'amount': 900000000,
                                     'asset_id': '1.3.0'},
                  'expiration': '1969-12-31T23:59:59',
                  'extensions': [],
                  'fee': {'amount': 500000, 'asset_id': '1.3.0'},
                  'fill_or_kill': False,
                  'min_to_receive': {'amount': 1900000,
                                     'asset_id': '1.3.1'},
                  'seller': '1.2.18'}],
                [1,
                 {'amount_to_sell': {'amount': 2000000,
                                     'asset_id': '1.3.1'},
                  'expiration': '1969-12-31T23:59:59',
                  'extensions': [],
                  'fee': {'amount': 500000, 'asset_id': '1.3.0'},
                  'fill_or_kill': False,
                  'min_to_receive': {'amount': 1100000000,
                                     'asset_id': '1.3.0'},
                  'seller': '1.2.18'}]],
 'ref_block_num': 30631,
 'ref_block_prefix': 2405814624,
 'signatures': []}
how to signature it with a private key from python? thanks

#edit: seems xeroc have provid this tools, but don't know how to use it
https://github.com/xeroc/python-graphenelib/blob/master/graphenebase/transactions.py
Title: Re: howto signature the transaction from python?
Post by: xeroc on December 21, 2015, 10:41:44 am
That script is NOT OPERATIONAL yet ..
Hopefully I can complete it in Q1 2016 .. but at the current stage it does not yet do what it should ..

I would recommend you use the transaction builder of the cli_wallet as described here:
http://docs.bitshares.eu/bitshares/tutorials/construct-transaction.html
Title: Re: howto signature the transaction from python?
Post by: alt on December 21, 2015, 11:08:40 am
I'm  tring to write an application run without cli_wallet
Title: Re: howto signature the transaction from python?
Post by: xeroc on December 21, 2015, 12:33:28 pm
Transaction signing is currently only implemented in C++ (cli_wallet) and javascript/coffee script for the Web wallet ..
Title: Re: howto signature the transaction from python?
Post by: alt on December 22, 2015, 06:16:32 am
Transaction signing is currently only implemented in C++ (cli_wallet) and javascript/coffee script for the Web wallet ..
it's very hard to understand these code, after a hard try,  I have to give up ....
BTW, can you upload python-graphine to the Python Package Index?
then I can add your package as dependency.
https://pypi.python.org/pypi
Title: Re: howto signature the transaction from python?
Post by: xeroc on December 22, 2015, 07:35:51 am
it's very hard to understand these code, after a hard try,  I have to give up ....
BTW, can you upload python-graphine to the Python Package Index?
then I can add your package as dependency.
https://pypi.python.org/pypi
Just did so .. the package should be called "graphenelib". Please tell me if you find anything not ok. Never used Pypi for distribution ..

Gonna work more on the transaction signing next year
Title: Re: howto signature the transaction from python?
Post by: alt on December 22, 2015, 08:49:38 am
it's very hard to understand these code, after a hard try,  I have to give up ....
BTW, can you upload python-graphine to the Python Package Index?
then I can add your package as dependency.
https://pypi.python.org/pypi
Just did so .. the package should be called "graphenelib". Please tell me if you find anything not ok. Never used Pypi for distribution ..

Gonna work more on the transaction signing next year
it's available now, thanks