|
|
@ -1,5 +1,4 @@
|
|
|
|
# Twisted/Klein imports
|
|
|
|
# Twisted/Klein imports
|
|
|
|
from twisted.logger import Logger
|
|
|
|
|
|
|
|
from twisted.internet.task import LoopingCall
|
|
|
|
from twisted.internet.task import LoopingCall
|
|
|
|
from twisted.internet.threads import deferToThread
|
|
|
|
from twisted.internet.threads import deferToThread
|
|
|
|
|
|
|
|
|
|
|
@ -15,7 +14,7 @@ import logging
|
|
|
|
# Project imports
|
|
|
|
# Project imports
|
|
|
|
from settings import settings
|
|
|
|
from settings import settings
|
|
|
|
from db import r
|
|
|
|
from db import r
|
|
|
|
from util import convert
|
|
|
|
import util
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: secure ES traffic properly
|
|
|
|
# TODO: secure ES traffic properly
|
|
|
|
urllib3.disable_warnings()
|
|
|
|
urllib3.disable_warnings()
|
|
|
@ -26,7 +25,7 @@ tracer = logging.getLogger("elastic_transport.transport")
|
|
|
|
tracer.setLevel(logging.CRITICAL)
|
|
|
|
tracer.setLevel(logging.CRITICAL)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Transactions(object):
|
|
|
|
class Transactions(util.Base):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Handler class for incoming Revolut transactions.
|
|
|
|
Handler class for incoming Revolut transactions.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -36,7 +35,7 @@ class Transactions(object):
|
|
|
|
Initialise the Transaction object.
|
|
|
|
Initialise the Transaction object.
|
|
|
|
Set the logger.
|
|
|
|
Set the logger.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
self.log = Logger("transactions")
|
|
|
|
super().__init__()
|
|
|
|
if settings.ES.Enabled == "1":
|
|
|
|
if settings.ES.Enabled == "1":
|
|
|
|
self.es = Elasticsearch(
|
|
|
|
self.es = Elasticsearch(
|
|
|
|
f"https://{settings.ES.Host}:9200",
|
|
|
|
f"https://{settings.ES.Host}:9200",
|
|
|
@ -89,10 +88,10 @@ class Transactions(object):
|
|
|
|
# stored_trade here is actually TX
|
|
|
|
# stored_trade here is actually TX
|
|
|
|
stored_trade = r.hgetall(f"tx.{txid}")
|
|
|
|
stored_trade = r.hgetall(f"tx.{txid}")
|
|
|
|
if not stored_trade:
|
|
|
|
if not stored_trade:
|
|
|
|
self.log.error("Could not find entry in DB for typeless transaction: {id}", id=txid)
|
|
|
|
self.log.error(f"Could not find entry in DB for typeless transaction: {txid}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
print("BEFORE CONVERT STORED TRADE", stored_trade)
|
|
|
|
print("BEFORE CONVERT STORED TRADE", stored_trade)
|
|
|
|
stored_trade = convert(stored_trade)
|
|
|
|
stored_trade = util.convert(stored_trade)
|
|
|
|
if "old_state" in inside:
|
|
|
|
if "old_state" in inside:
|
|
|
|
if "new_state" in inside:
|
|
|
|
if "new_state" in inside:
|
|
|
|
# We don't care unless we're being told a transaction is now completed
|
|
|
|
# We don't care unless we're being told a transaction is now completed
|
|
|
@ -109,7 +108,7 @@ class Transactions(object):
|
|
|
|
r.hmset(f"tx.{txid}", stored_trade)
|
|
|
|
r.hmset(f"tx.{txid}", stored_trade)
|
|
|
|
# Check it's all been previously validated
|
|
|
|
# Check it's all been previously validated
|
|
|
|
if "valid" not in stored_trade:
|
|
|
|
if "valid" not in stored_trade:
|
|
|
|
self.log.error("Valid not in stored trade for {txid}, aborting.", txid=txid)
|
|
|
|
self.log.error(f"Valid not in stored trade for {txid}, aborting.")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
if stored_trade["valid"] == "1":
|
|
|
|
if stored_trade["valid"] == "1":
|
|
|
|
# Make it invalid immediately, as we're going to release now
|
|
|
|
# Make it invalid immediately, as we're going to release now
|
|
|
@ -124,7 +123,7 @@ class Transactions(object):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
txtype = inside["type"]
|
|
|
|
txtype = inside["type"]
|
|
|
|
if txtype == "card_payment":
|
|
|
|
if txtype == "card_payment":
|
|
|
|
self.log.info("Ignoring card payment: {id}", id=txid)
|
|
|
|
self.log.info(f"Ignoring card payment: {txid}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
state = inside["state"]
|
|
|
|
state = inside["state"]
|
|
|
@ -142,7 +141,7 @@ class Transactions(object):
|
|
|
|
|
|
|
|
|
|
|
|
amount = leg["amount"]
|
|
|
|
amount = leg["amount"]
|
|
|
|
if amount <= 0:
|
|
|
|
if amount <= 0:
|
|
|
|
self.log.info("Ignoring transaction with negative/zero amount: {id}", id=txid)
|
|
|
|
self.log.info(f"Ignoring transaction with negative/zero amount: {txid}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
currency = leg["currency"]
|
|
|
|
currency = leg["currency"]
|
|
|
|
description = leg["description"]
|
|
|
|
description = leg["description"]
|
|
|
@ -161,7 +160,7 @@ class Transactions(object):
|
|
|
|
"description": description,
|
|
|
|
"description": description,
|
|
|
|
"valid": 0, # All checks passed and we can release escrow?
|
|
|
|
"valid": 0, # All checks passed and we can release escrow?
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self.log.info("Transaction processed: {formatted}", formatted=dumps(to_store, indent=2))
|
|
|
|
self.log.info(f"Transaction processed: {dumps(to_store, indent=2)}")
|
|
|
|
self.irc.sendmsg(f"AUTO Incoming transaction: {amount}{currency} ({reference}) - {state} - {description}")
|
|
|
|
self.irc.sendmsg(f"AUTO Incoming transaction: {amount}{currency} ({reference}) - {state} - {description}")
|
|
|
|
# Partial reference implementation
|
|
|
|
# Partial reference implementation
|
|
|
|
# Account for silly people not removing the default string
|
|
|
|
# Account for silly people not removing the default string
|
|
|
@ -172,7 +171,7 @@ class Transactions(object):
|
|
|
|
# Get all parts of the given reference split that match the existing references
|
|
|
|
# Get all parts of the given reference split that match the existing references
|
|
|
|
stored_trade_reference = set(existing_refs).intersection(set(ref_split))
|
|
|
|
stored_trade_reference = set(existing_refs).intersection(set(ref_split))
|
|
|
|
if len(stored_trade_reference) > 1:
|
|
|
|
if len(stored_trade_reference) > 1:
|
|
|
|
self.log.error("Multiple references valid for TXID {txid}: {reference}", txid=txid, reference=reference)
|
|
|
|
self.log.error(f"Multiple references valid for TXID {txid}: {reference}")
|
|
|
|
self.irc.sendmsg(f"Multiple references valid for TXID {txid}: {reference}")
|
|
|
|
self.irc.sendmsg(f"Multiple references valid for TXID {txid}: {reference}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -181,21 +180,16 @@ class Transactions(object):
|
|
|
|
|
|
|
|
|
|
|
|
# Amount/currency lookup implementation
|
|
|
|
# Amount/currency lookup implementation
|
|
|
|
if not stored_trade_reference:
|
|
|
|
if not stored_trade_reference:
|
|
|
|
self.log.info(f"No reference in DB refs for {reference}", reference=reference)
|
|
|
|
self.log.info(f"No reference in DB refs for {reference}")
|
|
|
|
self.irc.sendmsg(f"No reference in DB refs for {reference}")
|
|
|
|
self.irc.sendmsg(f"No reference in DB refs for {reference}")
|
|
|
|
# Try checking just amount and currency, as some people (usually people buying small amounts)
|
|
|
|
# Try checking just amount and currency, as some people (usually people buying small amounts)
|
|
|
|
# are unable to put in a reference properly.
|
|
|
|
# are unable to put in a reference properly.
|
|
|
|
|
|
|
|
|
|
|
|
self.log.info("Checking against amount and currency for TXID {txid}", txid=txid)
|
|
|
|
self.log.info(f"Checking against amount and currency for TXID {txid}")
|
|
|
|
self.irc.sendmsg(f"Checking against amount and currency for TXID {txid}")
|
|
|
|
self.irc.sendmsg(f"Checking against amount and currency for TXID {txid}")
|
|
|
|
stored_trade = self.find_trade(txid, currency, amount)
|
|
|
|
stored_trade = self.find_trade(txid, currency, amount)
|
|
|
|
if not stored_trade:
|
|
|
|
if not stored_trade:
|
|
|
|
self.log.info(
|
|
|
|
self.log.info(f"Failed to get reference by amount and currency: {txid} {currency} {amount}")
|
|
|
|
"Failed to get reference by amount and currency: {txid} {currency} {amount}",
|
|
|
|
|
|
|
|
txid=txid,
|
|
|
|
|
|
|
|
currency=currency,
|
|
|
|
|
|
|
|
amount=amount,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
self.irc.sendmsg(f"Failed to get reference by amount and currency: {txid} {currency} {amount}")
|
|
|
|
self.irc.sendmsg(f"Failed to get reference by amount and currency: {txid} {currency} {amount}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
if currency == "USD":
|
|
|
|
if currency == "USD":
|
|
|
@ -215,7 +209,7 @@ class Transactions(object):
|
|
|
|
if not stored_trade:
|
|
|
|
if not stored_trade:
|
|
|
|
stored_trade = self.get_ref(stored_trade_reference.pop())
|
|
|
|
stored_trade = self.get_ref(stored_trade_reference.pop())
|
|
|
|
if not stored_trade:
|
|
|
|
if not stored_trade:
|
|
|
|
self.log.info("No reference in DB for {reference}", reference=reference)
|
|
|
|
self.log.info(f"No reference in DB for {reference}")
|
|
|
|
self.irc.sendmsg(f"No reference in DB for {reference}")
|
|
|
|
self.irc.sendmsg(f"No reference in DB for {reference}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -224,11 +218,7 @@ class Transactions(object):
|
|
|
|
|
|
|
|
|
|
|
|
# Make sure it was sent in the expected currency
|
|
|
|
# Make sure it was sent in the expected currency
|
|
|
|
if not stored_trade["currency"] == currency:
|
|
|
|
if not stored_trade["currency"] == currency:
|
|
|
|
self.log.info(
|
|
|
|
self.log.info(f"Currency mismatch, Agora: {stored_trade['currency']} / Sink: {currency}")
|
|
|
|
"Currency mismatch, Agora: {currency_agora} / Sink: {currency}",
|
|
|
|
|
|
|
|
currency_agora=stored_trade["currency"],
|
|
|
|
|
|
|
|
currency=currency,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
self.irc.sendmsg(f"Currency mismatch, Agora: {stored_trade['currency']} / Sink: {currency}")
|
|
|
|
self.irc.sendmsg(f"Currency mismatch, Agora: {stored_trade['currency']} / Sink: {currency}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -238,19 +228,10 @@ class Transactions(object):
|
|
|
|
return
|
|
|
|
return
|
|
|
|
# If the amount does not match exactly, get the min and max values for our given acceptable margins for trades
|
|
|
|
# If the amount does not match exactly, get the min and max values for our given acceptable margins for trades
|
|
|
|
min_amount, max_amount = self.money.get_acceptable_margins(currency, stored_trade["amount"])
|
|
|
|
min_amount, max_amount = self.money.get_acceptable_margins(currency, stored_trade["amount"])
|
|
|
|
self.log.info(
|
|
|
|
self.log.info(f"Amount does not match exactly, trying with margins: min: {min_amount} / max: {max_amount}")
|
|
|
|
"Amount does not match exactly, trying with margins: min: {min_amount} / max: {max_amount}",
|
|
|
|
|
|
|
|
min_amount=min_amount,
|
|
|
|
|
|
|
|
max_amount=max_amount,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
self.irc.sendmsg(f"Amount does not match exactly, trying with margins: min: {min_amount} / max: {max_amount}")
|
|
|
|
self.irc.sendmsg(f"Amount does not match exactly, trying with margins: min: {min_amount} / max: {max_amount}")
|
|
|
|
if not min_amount < amount < max_amount:
|
|
|
|
if not min_amount < amount < max_amount:
|
|
|
|
self.log.info(
|
|
|
|
self.log.info("Amount mismatch - not in margins: {stored_trade['amount']} (min: {min_amount} / max: {max_amount}")
|
|
|
|
"Amount mismatch - not in margins: {amount} (min: {min_amount} / max: {max_amount}",
|
|
|
|
|
|
|
|
amount=stored_trade["amount"],
|
|
|
|
|
|
|
|
min_amount=min_amount,
|
|
|
|
|
|
|
|
max_amount=max_amount,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
self.irc.sendmsg(f"Amount mismatch - not in margins: {stored_trade['amount']} (min: {min_amount} / max: {max_amount}")
|
|
|
|
self.irc.sendmsg(f"Amount mismatch - not in margins: {stored_trade['amount']} (min: {min_amount} / max: {max_amount}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -260,7 +241,7 @@ class Transactions(object):
|
|
|
|
# Store the trade ID so we can release it easily
|
|
|
|
# Store the trade ID so we can release it easily
|
|
|
|
to_store["trade_id"] = stored_trade["id"]
|
|
|
|
to_store["trade_id"] = stored_trade["id"]
|
|
|
|
if not state == "completed":
|
|
|
|
if not state == "completed":
|
|
|
|
self.log.info("Storing incomplete trade: {id}", id=txid)
|
|
|
|
self.log.info(f"Storing incomplete trade: {txid}")
|
|
|
|
r.hmset(f"tx.{txid}", to_store)
|
|
|
|
r.hmset(f"tx.{txid}", to_store)
|
|
|
|
# Don't procees further if state is not "completed"
|
|
|
|
# Don't procees further if state is not "completed"
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -270,7 +251,7 @@ class Transactions(object):
|
|
|
|
self.ux.notify.notify_complete_trade(amount, currency)
|
|
|
|
self.ux.notify.notify_complete_trade(amount, currency)
|
|
|
|
|
|
|
|
|
|
|
|
def release_funds(self, trade_id, reference):
|
|
|
|
def release_funds(self, trade_id, reference):
|
|
|
|
self.log.info("All checks passed, releasing funds for {trade_id} {reference}", trade_id=trade_id, reference=reference)
|
|
|
|
self.log.info(f"All checks passed, releasing funds for {trade_id} {reference}")
|
|
|
|
self.irc.sendmsg(f"All checks passed, releasing funds for {trade_id} / {reference}")
|
|
|
|
self.irc.sendmsg(f"All checks passed, releasing funds for {trade_id} / {reference}")
|
|
|
|
rtrn = self.agora.release_funds(trade_id)
|
|
|
|
rtrn = self.agora.release_funds(trade_id)
|
|
|
|
self.agora.agora.contact_message_post(trade_id, "Thanks! Releasing now :)")
|
|
|
|
self.agora.agora.contact_message_post(trade_id, "Thanks! Releasing now :)")
|
|
|
@ -300,14 +281,14 @@ class Transactions(object):
|
|
|
|
"reference": reference,
|
|
|
|
"reference": reference,
|
|
|
|
"provider": provider,
|
|
|
|
"provider": provider,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
self.log.info("Storing trade information: {info}", info=str(to_store))
|
|
|
|
self.log.info(f"Storing trade information: {str(to_store)}")
|
|
|
|
r.hmset(f"trade.{reference}", to_store)
|
|
|
|
r.hmset(f"trade.{reference}", to_store)
|
|
|
|
self.irc.sendmsg(f"Generated reference for {trade_id}: {reference}")
|
|
|
|
self.irc.sendmsg(f"Generated reference for {trade_id}: {reference}")
|
|
|
|
self.ux.notify.notify_new_trade(amount, currency)
|
|
|
|
self.ux.notify.notify_new_trade(amount, currency)
|
|
|
|
if settings.Agora.Send == "1":
|
|
|
|
if settings.Agora.Send == "1":
|
|
|
|
self.agora.agora.contact_message_post(trade_id, f"Hi! When sending the payment please use reference code: {reference}")
|
|
|
|
self.agora.agora.contact_message_post(trade_id, f"Hi! When sending the payment please use reference code: {reference}")
|
|
|
|
if existing_ref:
|
|
|
|
if existing_ref:
|
|
|
|
return convert(existing_ref)
|
|
|
|
return util.convert(existing_ref)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return reference
|
|
|
|
return reference
|
|
|
|
|
|
|
|
|
|
|
@ -332,7 +313,7 @@ class Transactions(object):
|
|
|
|
if stored_trade["currency"] == currency and float(stored_trade["amount"]) == float(amount):
|
|
|
|
if stored_trade["currency"] == currency and float(stored_trade["amount"]) == float(amount):
|
|
|
|
matching_refs.append(stored_trade)
|
|
|
|
matching_refs.append(stored_trade)
|
|
|
|
if len(matching_refs) != 1:
|
|
|
|
if len(matching_refs) != 1:
|
|
|
|
self.log.error("Find trade returned multiple results for TXID {txid}: {matching_refs}", txid=txid, matching_refs=matching_refs)
|
|
|
|
self.log.error(f"Find trade returned multiple results for TXID {txid}: {matching_refs}")
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return matching_refs[0]
|
|
|
|
return matching_refs[0]
|
|
|
|
|
|
|
|
|
|
|
@ -346,7 +327,7 @@ class Transactions(object):
|
|
|
|
ref_keys = r.keys("trade.*.reference")
|
|
|
|
ref_keys = r.keys("trade.*.reference")
|
|
|
|
for key in ref_keys:
|
|
|
|
for key in ref_keys:
|
|
|
|
references.append(r.get(key))
|
|
|
|
references.append(r.get(key))
|
|
|
|
return convert(references)
|
|
|
|
return util.convert(references)
|
|
|
|
|
|
|
|
|
|
|
|
def get_ref_map(self):
|
|
|
|
def get_ref_map(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -357,9 +338,9 @@ class Transactions(object):
|
|
|
|
references = {}
|
|
|
|
references = {}
|
|
|
|
ref_keys = r.keys("trade.*.reference")
|
|
|
|
ref_keys = r.keys("trade.*.reference")
|
|
|
|
for key in ref_keys:
|
|
|
|
for key in ref_keys:
|
|
|
|
tx = convert(key).split(".")[1]
|
|
|
|
tx = util.convert(key).split(".")[1]
|
|
|
|
references[tx] = r.get(key)
|
|
|
|
references[tx] = r.get(key)
|
|
|
|
return convert(references)
|
|
|
|
return util.convert(references)
|
|
|
|
|
|
|
|
|
|
|
|
def get_ref(self, reference):
|
|
|
|
def get_ref(self, reference):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -370,7 +351,7 @@ class Transactions(object):
|
|
|
|
:rtype: dict
|
|
|
|
:rtype: dict
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
ref_data = r.hgetall(f"trade.{reference}")
|
|
|
|
ref_data = r.hgetall(f"trade.{reference}")
|
|
|
|
ref_data = convert(ref_data)
|
|
|
|
ref_data = util.convert(ref_data)
|
|
|
|
if not ref_data:
|
|
|
|
if not ref_data:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return ref_data
|
|
|
|
return ref_data
|
|
|
@ -394,7 +375,7 @@ class Transactions(object):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
for tx, reference in self.get_ref_map().items():
|
|
|
|
for tx, reference in self.get_ref_map().items():
|
|
|
|
if reference not in references:
|
|
|
|
if reference not in references:
|
|
|
|
self.log.info("Archiving trade reference: {reference} / TX: {tx}", reference=reference, tx=tx)
|
|
|
|
self.log.info(f"Archiving trade reference: {reference} / TX: {tx}")
|
|
|
|
r.rename(f"trade.{tx}.reference", f"archive.trade.{tx}.reference")
|
|
|
|
r.rename(f"trade.{tx}.reference", f"archive.trade.{tx}.reference")
|
|
|
|
r.rename(f"trade.{reference}", f"archive.trade.{reference}")
|
|
|
|
r.rename(f"trade.{reference}", f"archive.trade.{reference}")
|
|
|
|
|
|
|
|
|
|
|
@ -408,7 +389,7 @@ class Transactions(object):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
refs = self.get_refs()
|
|
|
|
refs = self.get_refs()
|
|
|
|
for reference in refs:
|
|
|
|
for reference in refs:
|
|
|
|
ref_data = convert(r.hgetall(f"trade.{reference}"))
|
|
|
|
ref_data = util.convert(r.hgetall(f"trade.{reference}"))
|
|
|
|
if not ref_data:
|
|
|
|
if not ref_data:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
if ref_data["id"] == tx:
|
|
|
|
if ref_data["id"] == tx:
|
|
|
@ -422,7 +403,7 @@ class Transactions(object):
|
|
|
|
:return: trade ID
|
|
|
|
:return: trade ID
|
|
|
|
:rtype: string
|
|
|
|
:rtype: string
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
ref_data = convert(r.hgetall(f"trade.{reference}"))
|
|
|
|
ref_data = util.convert(r.hgetall(f"trade.{reference}"))
|
|
|
|
if not ref_data:
|
|
|
|
if not ref_data:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return ref_data["id"]
|
|
|
|
return ref_data["id"]
|
|
|
@ -448,12 +429,12 @@ class Transactions(object):
|
|
|
|
# Get the BTC -> USD exchange rate
|
|
|
|
# Get the BTC -> USD exchange rate
|
|
|
|
btc_usd = self.agora.cg.get_price(ids="bitcoin", vs_currencies=["USD"])
|
|
|
|
btc_usd = self.agora.cg.get_price(ids="bitcoin", vs_currencies=["USD"])
|
|
|
|
|
|
|
|
|
|
|
|
# Convert the Agora XMR total to USD
|
|
|
|
|
|
|
|
total_usd_agora_xmr = float(total_xmr_agora) * xmr_usd["monero"]["usd"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Convert the Agora BTC total to USD
|
|
|
|
# Convert the Agora BTC total to USD
|
|
|
|
total_usd_agora_btc = float(total_btc_agora) * btc_usd["bitcoin"]["usd"]
|
|
|
|
total_usd_agora_btc = float(total_btc_agora) * btc_usd["bitcoin"]["usd"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Convert the Agora XMR total to USD
|
|
|
|
|
|
|
|
total_usd_agora_xmr = float(total_xmr_agora) * xmr_usd["monero"]["usd"]
|
|
|
|
|
|
|
|
|
|
|
|
# Add it all up
|
|
|
|
# Add it all up
|
|
|
|
total_usd_agora = total_usd_agora_xmr + total_usd_agora_btc
|
|
|
|
total_usd_agora = total_usd_agora_xmr + total_usd_agora_btc
|
|
|
|
# total_usd = total_usd_agora + total_usd_revolut
|
|
|
|
# total_usd = total_usd_agora + total_usd_revolut
|
|
|
|