From 7fd784b83b071b384597a1f168e988b676a6cec3 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 28 Dec 2021 15:28:28 +0000 Subject: [PATCH] Hook in Transactions to incoming trades --- handler/agora.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/handler/agora.py b/handler/agora.py index f4118d7..356144d 100644 --- a/handler/agora.py +++ b/handler/agora.py @@ -34,6 +34,9 @@ class Agora(object): def set_irc(self, irc): self.irc = irc + def set_tx(self, tx): + self.tx = tx + def setup_loop(self): """ Set up the LoopingCall to get all active trades. @@ -80,8 +83,9 @@ class Agora(object): currency = contact["data"]["currency"] if not contact["data"]["is_selling"]: 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") dash_tmp.append(f"{contact_id}: {buyer} {amount}{currency} {amount_xmr}XMR")