Destinations adresses support in outgoing payment transactions.
This commit is contained in:
parent
915590780f
commit
ee8aea69bd
|
@ -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))
|
||||
|
|
|
@ -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={}"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue