sys.path.append('..')
from armoryengine.ALL import *
receivingAddresses = [...]
walletFile = "..."
wallet = PyBtcWallet().readWalletFile(walletFile)
TheBDM.registerWallet(wallet.cppWallet)
TheBDM.setBlocking(doblock=True, newTimeout=60*60)
TheBDM.setOnlineMode()
for address in wallet.getAddrList():
uxto = wallet.getAddrTxOutList(address.getAddr160())
if len(uxto) == 0:
continue
addressBalance = sum([o.getValue() for o in uxto])
keyMap = {o.getRecipientScrAddr(): address.binPublicKey65.toBinStr() for o in uxto}
outputs = [[addrStr_to_script(receivingAddresses.pop()), addressBalance]]
tx = UnsignedTransaction().createFromTxOutSelection(uxto, outputs, keyMap)
fileName = "armory_{0}_{1}BTC.unsigned.tx".format(tx.asciiID, coin2str(addressBalance, 0, False, 0))
with open(fileName, 'w') as txFile:
txFile.write(tx.serializeAscii())
TheBDM.execCleanShutdown()
Basically, I wanted these unsigned transactions handy to more easily transfer funds to the Trezor as needed/became more comfortable with its security model. I wanted a 1-1 address correspondence between my Armory and Trezor addresses, with no mixing. Fees are negligible because they've been sitting around for so long.