diff --git a/bitcoin/rpc.py b/bitcoin/rpc.py index f949d296..7ae1b22b 100644 --- a/bitcoin/rpc.py +++ b/bitcoin/rpc.py @@ -218,6 +218,16 @@ def __init__(self, service_url=None, timeout=timeout, **kwargs) + def createrawtransaction(self, *args): + """Get rawtransactions when provided vin and vout + + FIXME: Implement options and accept outpoints instead of user args + """ + r = self._call('createrawtransaction', *args) + r = str(r) + tx = CTransaction.deserialize(unhexlify(r)) + return tx + def dumpprivkey(self, addr): """Return the private key matching an address """ @@ -385,6 +395,19 @@ def gettxout(self, outpoint, includemempool=True): r['bestblock'] = lx(r['bestblock']) return r + def importaddress(self, addr, label=None, rescan=True): + """Adds an address or pubkey to wallet without the associated privkey.""" + addr = str(addr) + + if label is not None: + if rescan: + r = self._call('importaddress', addr, label, True) + else: + r = self._call('importaddress', addr, label) + else: + r = self._call('importaddress', addr) + return r + def listunspent(self, minconf=0, maxconf=9999999, addrs=None): """Return unspent transaction outputs in wallet