2017-12-27 00:49:59 +00:00
|
|
|
class Transaction(object):
|
|
|
|
hash = None
|
|
|
|
height = None
|
|
|
|
timestamp = None
|
|
|
|
payment_id = '0000000000000000'
|
|
|
|
amount = None
|
|
|
|
fee = None
|
2018-01-06 15:44:38 +00:00
|
|
|
local_address = None
|
2017-12-27 00:49:59 +00:00
|
|
|
|
|
|
|
def __init__(self, hash=None, **kwargs):
|
|
|
|
self.hash = hash
|
|
|
|
self.height = kwargs.get('height', self.height)
|
|
|
|
self.timestamp = kwargs.get('timestamp', self.timestamp)
|
|
|
|
self.payment_id = kwargs.get('payment_id', self.payment_id)
|
|
|
|
self.amount = kwargs.get('amount', self.amount)
|
|
|
|
self.fee = kwargs.get('fee', self.fee)
|
2018-01-06 15:44:38 +00:00
|
|
|
self.local_address = kwargs.get('local_address', self.local_address)
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return self.hash
|
2017-12-27 00:49:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Payment(Transaction):
|
|
|
|
"""Incoming Transaction"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class Transfer(Transaction):
|
|
|
|
"""Outgoing Transaction"""
|
|
|
|
key = None
|
|
|
|
blob = None
|
|
|
|
note = ''
|
|
|
|
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
super(Transfer, self).__init__(**kwargs)
|
|
|
|
self.key = kwargs.get('key', self.key)
|
|
|
|
self.note = kwargs.get('note', self.note)
|
|
|
|
self.blob = kwargs.get('blob', self.blob)
|