Post
Topic
Board Armory
Re: Armory - Discussion Thread
by
etotheipi
on 13/08/2013, 22:50:00 UTC
I was working on my script and everything is going well

following the samples as you suggested was helpful.  What I'm stuck on now is converting the createTxFromAddrList.py to make it so at the end instead of signing and checking etc, it would export the unsigned tx file that I can copy to my offline wallet.  Basically everything works perfectly how I want it to build the transaction, but I am having a hell of a time finding how to export the details to a tx file.

So up to and including:

Code:
print 'Creating Unsigned Transaction...'
txdp = createTxFromAddrList(wlt, addrList, recipList, 50000, sendChangeTo)
txdp.pprint()

works well.  and it prints out a lot of details showing where the unspent outputs are coming from and where they are going etc.  I am trying to do this while having a hell of a time with the documentation so finding the right functions becomes a bit more challenging.

I also have the other side setup (using cli_sign_txdp.py as an example) to fit exactly how I need it to, just having trouble with the saving of the unsigned tx file.

Anyone have any suggestions?

Open a *.unsigned.tx file for writing and use the txdp.serializeAscii() method to dump it in the BIP 10 format which will be recognized by Armory GUI or cli_sign_txdp.py script.

Also note that since the Armory GUI does most of these things, you can probably find examples of what you're looking for, by simply searching the Armory codebase.   I haven't done it, but I'm sure if you search for "txdp" in the ArmoryQt.py and qtdialogs.py, there will only be a few hits, and one of them will be serializeAscii() and another one unserializeAscii().  I use ASCII/text for the encoding so that the data could theoretically be copied into emails, like ASCII-armored PGP data.