From 36a73e9f4103122b996c35e30a47505c3cc3841c Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 2 May 2022 13:18:18 +0100 Subject: [PATCH] Fix LBTC ad response parsing --- handler/sources/localbitcoins.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/handler/sources/localbitcoins.py b/handler/sources/localbitcoins.py index 6401a39..6cf9dfb 100644 --- a/handler/sources/localbitcoins.py +++ b/handler/sources/localbitcoins.py @@ -64,7 +64,7 @@ class LBTC(util.Base): return dash_tmp if dash["response"]["data"]["contact_count"] > 0: for contact in dash["response"]["data"]["contact_list"]: - contact_id = contact["data"]["contact_id"] + contact_id = str(contact["data"]["contact_id"]) dash_tmp[contact_id] = contact return dash_tmp @@ -93,7 +93,8 @@ class LBTC(util.Base): reference = self.tx.tx_to_ref(contact_id) buyer = contact["data"]["buyer"]["username"] amount = contact["data"]["amount"] - asset = contact["data"]["advertisement"]["asset"] + # asset = contact["data"]["advertisement"]["asset"] + asset = "BTC" amount_crypto = contact["data"]["amount_btc"] currency = contact["data"]["currency"] provider = contact["data"]["advertisement"]["payment_method"] @@ -118,7 +119,8 @@ class LBTC(util.Base): current_trades.append(reference) buyer = contact["data"]["buyer"]["username"] amount = contact["data"]["amount"] - asset = contact["data"]["advertisement"]["asset"] + # asset = contact["data"]["advertisement"]["asset"] + asset = "BTC" provider = contact["data"]["advertisement"]["payment_method"] amount_crypto = contact["data"]["amount_btc"] currency = contact["data"]["currency"] @@ -167,7 +169,7 @@ class LBTC(util.Base): return False open_tx = self.tx.get_ref_map().keys() for message in messages["response"]["data"]["message_list"]: - contact_id = message["contact_id"] + contact_id = str(message["contact_id"]) username = message["sender"]["username"] msg = message["msg"] if contact_id not in open_tx: