Fix LBTC ad response parsing

This commit is contained in:
Mark Veidemanis 2022-05-02 13:18:18 +01:00
parent 9fb99d90a3
commit 36a73e9f41
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 6 additions and 4 deletions

View File

@ -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: