diff --git a/monero/backends/jsonrpc.py b/monero/backends/jsonrpc.py index d7c5efd..8dcf2b9 100644 --- a/monero/backends/jsonrpc.py +++ b/monero/backends/jsonrpc.py @@ -237,7 +237,7 @@ class JSONRPCWallet(object): laddr = data.get('address', None) if laddr: laddr = address(laddr) - return { + result = { 'payment_id': None if pid is None else PaymentID(pid), 'amount': from_atomic(data['amount']), 'timestamp': datetime.fromtimestamp(data['timestamp']) if 'timestamp' in data else None, @@ -245,6 +245,13 @@ class JSONRPCWallet(object): 'transaction': self._tx(data), 'local_address': laddr, } + if 'destinations' in data: + result['destinations'] = [ + {'address': address(x['address']), 'amount': from_atomic(data['amount'])} + for x in data.get('destinations') + ] + return result + def _inpayment(self, data): return IncomingPayment(**self._paymentdict(data)) diff --git a/monero/transaction.py b/monero/transaction.py index 64bdecc..23eb9aa 100644 --- a/monero/transaction.py +++ b/monero/transaction.py @@ -47,6 +47,12 @@ class OutgoingPayment(Payment): An outgoing payment (one that decreases the balance of an :class:`Account `) """ + destinations = None + + def __init__(self, **kwargs): + self.destinations = kwargs.pop('destinations', self.destinations) + super().__init__(**kwargs) + _reprstr = "out: {} @ {} {:.12f} id={}"