howto signature the transaction from python?

Started by alt, December 21, 2015, 09:35:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alt

Quote from: xeroc on December 22, 2015, 07:35:51 AM
Quote from: alt on December 22, 2015, 06:16:32 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

xeroc

Quote from: alt on December 22, 2015, 06:16:32 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

alt

Quote from: 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 ..
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

xeroc

Transaction signing is currently only implemented in C++ (cli_wallet) and javascript/coffee script for the Web wallet ..

alt

I'm  tring to write an application run without cli_wallet

xeroc

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

alt

#1
If I got a transaction like this:

{'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