From bb1734142df4fbae1ef37973f150e57d095c757e Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Fri, 21 Jan 2022 13:25:33 +0000 Subject: [PATCH] Update dashboard getter to understand BTC --- handler/agora.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/handler/agora.py b/handler/agora.py index 4a68b86..9cd626f 100644 --- a/handler/agora.py +++ b/handler/agora.py @@ -95,11 +95,16 @@ class Agora(object): reference = self.tx.tx_to_ref(contact_id) buyer = contact["data"]["buyer"]["username"] amount = contact["data"]["amount"] - amount_xmr = contact["data"]["amount_xmr"] + if "amount_xmr" in contact["data"]: + amount_crypto = contact["data"]["amount_xmr"] + crypto = "XMR" + elif "amount_btc" in contact["data"]: + amount_crypto = contact["data"]["amount_btc"] + crypto = "BTC" currency = contact["data"]["currency"] if not contact["data"]["is_selling"]: continue - rtrn.append(f"{reference}: {buyer} {amount}{currency} {amount_xmr}XMR") + rtrn.append(f"{reference}: {buyer} {amount}{currency} {amount_crypto}{crypto}") return rtrn def dashboard_hook(self, dash):