|
|
@ -365,10 +365,10 @@ class Transactions(util.Base):
|
|
|
|
total_xmr_agora = agora_wallet_xmr["response"]["data"]["total"]["balance"]
|
|
|
|
total_xmr_agora = agora_wallet_xmr["response"]["data"]["total"]["balance"]
|
|
|
|
total_btc_agora = agora_wallet_btc["response"]["data"]["total"]["balance"]
|
|
|
|
total_btc_agora = agora_wallet_btc["response"]["data"]["total"]["balance"]
|
|
|
|
# Get the XMR -> USD exchange rate
|
|
|
|
# Get the XMR -> USD exchange rate
|
|
|
|
xmr_usd = self.agora.cg.get_price(ids="monero", vs_currencies=["USD"])
|
|
|
|
xmr_usd = self.money.cg.get_price(ids="monero", vs_currencies=["USD"])
|
|
|
|
|
|
|
|
|
|
|
|
# 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.money.cg.get_price(ids="bitcoin", vs_currencies=["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"]
|
|
|
@ -416,10 +416,10 @@ class Transactions(util.Base):
|
|
|
|
total_xmr_agora = agora_wallet_xmr["response"]["data"]["total"]["balance"]
|
|
|
|
total_xmr_agora = agora_wallet_xmr["response"]["data"]["total"]["balance"]
|
|
|
|
total_btc_agora = agora_wallet_btc["response"]["data"]["total"]["balance"]
|
|
|
|
total_btc_agora = agora_wallet_btc["response"]["data"]["total"]["balance"]
|
|
|
|
# Get the XMR -> USD exchange rate
|
|
|
|
# Get the XMR -> USD exchange rate
|
|
|
|
xmr_usd = self.agora.cg.get_price(ids="monero", vs_currencies=["USD"])
|
|
|
|
xmr_usd = self.money.cg.get_price(ids="monero", vs_currencies=["USD"])
|
|
|
|
|
|
|
|
|
|
|
|
# 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.money.cg.get_price(ids="bitcoin", vs_currencies=["USD"])
|
|
|
|
|
|
|
|
|
|
|
|
# Convert the Agora XMR total to USD
|
|
|
|
# Convert the Agora XMR total to USD
|
|
|
|
total_usd_agora_xmr = float(total_xmr_agora) * xmr_usd["monero"]["usd"]
|
|
|
|
total_usd_agora_xmr = float(total_xmr_agora) * xmr_usd["monero"]["usd"]
|
|
|
@ -510,11 +510,11 @@ class Transactions(util.Base):
|
|
|
|
asset = contact["data"]["advertisement"]["asset"]
|
|
|
|
asset = contact["data"]["advertisement"]["asset"]
|
|
|
|
if asset == "XMR":
|
|
|
|
if asset == "XMR":
|
|
|
|
amount_crypto = contact["data"]["amount_xmr"]
|
|
|
|
amount_crypto = contact["data"]["amount_xmr"]
|
|
|
|
history = self.agora.cg.get_coin_history_by_id(id="monero", date=date_formatted)
|
|
|
|
history = self.money.cg.get_coin_history_by_id(id="monero", date=date_formatted)
|
|
|
|
crypto_usd = float(history["market_data"]["current_price"]["usd"])
|
|
|
|
crypto_usd = float(history["market_data"]["current_price"]["usd"])
|
|
|
|
elif asset == "BTC":
|
|
|
|
elif asset == "BTC":
|
|
|
|
amount_crypto = contact["data"]["amount_btc"]
|
|
|
|
amount_crypto = contact["data"]["amount_btc"]
|
|
|
|
history = self.agora.cg.get_coin_history_by_id(id="bitcoin", date=date_formatted)
|
|
|
|
history = self.money.cg.get_coin_history_by_id(id="bitcoin", date=date_formatted)
|
|
|
|
crypto_usd = float(history["market_data"]["current_price"]["usd"])
|
|
|
|
crypto_usd = float(history["market_data"]["current_price"]["usd"])
|
|
|
|
# Convert crypto to fiat
|
|
|
|
# Convert crypto to fiat
|
|
|
|
amount = float(amount_crypto) * crypto_usd
|
|
|
|
amount = float(amount_crypto) * crypto_usd
|
|
|
|