Hook in Transactions to incoming trades

pull/1/head
Mark Veidemanis 3 years ago
parent 535f890554
commit 7fd784b83b
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -34,6 +34,9 @@ class Agora(object):
def set_irc(self, irc): def set_irc(self, irc):
self.irc = irc self.irc = irc
def set_tx(self, tx):
self.tx = tx
def setup_loop(self): def setup_loop(self):
""" """
Set up the LoopingCall to get all active trades. Set up the LoopingCall to get all active trades.
@ -80,8 +83,9 @@ class Agora(object):
currency = contact["data"]["currency"] currency = contact["data"]["currency"]
if not contact["data"]["is_selling"]: if not contact["data"]["is_selling"]:
continue continue
if send_irc:
if contact_id not in self.last_dash: if contact_id not in self.last_dash:
self.tx.new_trade(contact_id, buyer, currency, amount, amount_xmr)
if send_irc:
self.irc.client.msg(self.irc.client.channel, f"AUTO {contact_id}: {buyer} {amount}{currency} {amount_xmr}XMR") self.irc.client.msg(self.irc.client.channel, f"AUTO {contact_id}: {buyer} {amount}{currency} {amount_xmr}XMR")
dash_tmp.append(f"{contact_id}: {buyer} {amount}{currency} {amount_xmr}XMR") dash_tmp.append(f"{contact_id}: {buyer} {amount}{currency} {amount_xmr}XMR")

Loading…
Cancel
Save