Destinations adresses support in outgoing payment transactions.

This commit is contained in:
Alexey V. Litvinov 2018-10-18 13:44:54 +10:00
parent 915590780f
commit ee8aea69bd
2 changed files with 14 additions and 1 deletions

View File

@ -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))

View File

@ -47,6 +47,12 @@ class OutgoingPayment(Payment):
An outgoing payment (one that decreases the balance of an
:class:`Account <monero.account.Account>`)
"""
destinations = None
def __init__(self, **kwargs):
self.destinations = kwargs.pop('destinations', self.destinations)
super().__init__(**kwargs)
_reprstr = "out: {} @ {} {:.12f} id={}"