i['prevout_hash'] = i['txid']
i['prevout_n'] = i['vout']
outputs = map(lambda x: (x[0],int(1e8*x[1])), outputs.items())
- tx = Transaction.from_io(inputs, outputs)
+ tx = Transaction(inputs, outputs)
return tx
def signrawtransaction(self, raw_tx, private_keys):
- tx = Transaction(raw_tx)
+ tx = Transaction.deserialize(raw_tx)
self.wallet.signrawtransaction(tx, private_keys, self.password)
return tx
def decoderawtransaction(self, raw):
- tx = Transaction(raw)
- return tx.deserialize()
+ tx = Transaction.deserialize(raw)
+ return {'inputs':tx.inputs, 'outputs':tx.outputs}
def sendrawtransaction(self, raw):
- tx = Transaction(raw)
+ tx = Transaction.deserialize(raw)
return self.network.synchronous_get([('blockchain.transaction.broadcast', [str(tx)])])[0]
def createmultisig(self, num, pubkeys):
def getpubkeys(self, addr):
out = { 'address':addr }
- out['pubkeys'] = self.wallet.getpubkeys(addr)
+ out['pubkeys'] = self.wallet.get_public_keys(addr)
return out
def getbalance(self, account= None):
return bitcoin.verify_message(address, signature, message)
def _mktx(self, outputs, fee = None, change_addr = None, domain = None):
-
for to_address, amount in outputs:
if not is_valid(to_address):
raise Exception("Invalid Bitcoin address", to_address)
break
amount = int(100000000*amount)
- final_outputs.append((to_address, amount))
+ final_outputs.append(('address', to_address, amount))
if fee: fee = int(100000000*fee)
return self.wallet.mktx(final_outputs, self.password, fee , change_addr, domain)
if tx:
return tx
- r = self.network.synchronous_get([ ('blockchain.transaction.get',[tx_hash]) ])[0]
- if r:
- return Transaction(r)
+ raw = self.network.synchronous_get([ ('blockchain.transaction.get',[tx_hash]) ])[0]
+ if raw:
+ return Transaction.deserialize(raw)
else:
return "unknown transaction"