parent
8ae386904a
commit
a16ae37a94
@ -1,45 +1,48 @@
|
||||
class Transaction(object):
|
||||
hash = None
|
||||
height = None
|
||||
class Payment(object):
|
||||
tx_hash = None
|
||||
payment_id = None
|
||||
amount = None
|
||||
timestamp = None
|
||||
fee = None
|
||||
blob = None
|
||||
transaction = None
|
||||
|
||||
def __init__(self, hash=None, **kwargs):
|
||||
self.hash = hash
|
||||
self.height = kwargs.get('height', self.height)
|
||||
def __init__(self, **kwargs):
|
||||
self.tx_hash = kwargs.get('tx_hash', self.tx_hash)
|
||||
self.amount = kwargs.get('amount', self.amount)
|
||||
self.timestamp = kwargs.get('timestamp', self.timestamp)
|
||||
self.fee = kwargs.get('fee', self.fee)
|
||||
self.blob = kwargs.get('blob', self.blob)
|
||||
|
||||
def __repr__(self):
|
||||
return self.hash
|
||||
self.payment_id = kwargs.get('payment_id', self.payment_id)
|
||||
self.transaction = kwargs.get('transaction', self.transaction)
|
||||
|
||||
|
||||
class LocalTransaction(Transaction):
|
||||
"""A transaction that concerns local wallet, either incoming or outgoing."""
|
||||
payment_id = None
|
||||
amount = None
|
||||
local_address = None
|
||||
class IncomingPayment(Payment):
|
||||
received_by = None
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(LocalTransaction, self).__init__(**kwargs)
|
||||
self.payment_id = kwargs.get('payment_id', self.payment_id)
|
||||
self.amount = kwargs.get('amount', self.amount)
|
||||
self.local_address = kwargs.get('local_address', self.local_address)
|
||||
super(IncomingPayment, self).__init__(**kwargs)
|
||||
self.received_by = kwargs.get('received_by', self.received_by)
|
||||
|
||||
|
||||
class Payment(LocalTransaction):
|
||||
"""Incoming Transaction"""
|
||||
pass
|
||||
class OutgoingPayment(Payment):
|
||||
sent_from = None
|
||||
note = ''
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(OutgoingPayment, self).__init__(**kwargs)
|
||||
self.sent_from = kwargs.get('sent_from', self.sent_from)
|
||||
self.note = kwargs.get('note', self.sent_from)
|
||||
|
||||
|
||||
class Transfer(LocalTransaction):
|
||||
"""Outgoing Transaction"""
|
||||
class Transaction(object):
|
||||
hash = None
|
||||
fee = None
|
||||
height = None
|
||||
timestamp = None
|
||||
key = None
|
||||
note = ''
|
||||
blob = None
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(Transfer, self).__init__(**kwargs)
|
||||
self.hash = kwargs.get('hash', self.hash)
|
||||
self.fee = kwargs.get('fee', self.fee)
|
||||
self.height = kwargs.get('height', self.height)
|
||||
self.timestamp = kwargs.get('timestamp', self.timestamp)
|
||||
self.key = kwargs.get('key', self.key)
|
||||
self.note = kwargs.get('note', self.note)
|
||||
self.blob = kwargs.get('blob', self.blob)
|
||||
|
Loading…
Reference in new issue