Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:value #5

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions safe_transaction_service/history/services/balance_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,14 @@ def get_usd_balances(
fiat_balance = fiat_conversion * (balance.balance / 10**18)
else:
# fiat_conversion = eth_price * token_eth_value
if token_address.lower() == "0x3AB4E696E31173409dbfBb1FEB5b9A7cC55A212c".lower():
if token_address.lower() == "0x3AB4E696E31173409dbfBb1FEB5b9A7cC55A212c".lower() or token_address.lower() == "0x7c6b91d9be155a6db01f749217d76ff02a7227f2".lower():
fiat_conversion = self.price_service.get_btc_usd_price()
elif token_address.lower() == "0x584f7b986d9942B0859a1E6921efA5342A673d04".lower():
elif token_address.lower() == "0x584f7b986d9942B0859a1E6921efA5342A673d04".lower() or token_address.lower() == "0xe7798f023fc62146e8aa1b36da45fb70855a77ea".lower():
fiat_conversion = self.price_service.get_eth_usd_price()
elif token_address.lower() == "0xCF712f20c85421d00EAa1B6F6545AaEEb4492B75".lower() or token_address.lower() == "0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3".lower():
fiat_conversion = 1.0
elif token_address.lower() == "0x50c5725949a6f0c72e6c4a641f24049a917db0cb":
fiat_conversion = 1.0
balance_with_decimals = balance.balance / 10**balance.token.decimals
fiat_balance = fiat_conversion * balance_with_decimals

Expand Down
8 changes: 3 additions & 5 deletions safe_transaction_service/tokens/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,10 @@ def set_spam(self) -> None:
return self.save(update_fields=["spam"])

def get_full_logo_uri(self) -> str:
if self.address.lower() == "0x3AB4E696E31173409dbfBb1FEB5b9A7cC55A212c".lower():
return "https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bitcoin.svg/1200px-Bitcoin.svg.png"
elif self.address.lower() == "0x0000000000000000000000000000000000000000".lower():
return "https://s2.coinmarketcap.com/static/img/coins/200x200/1839.png"
elif self.address.lower() == "0x584f7b986d9942B0859a1E6921efA5342A673d04":
if self.address.lower() == "0x584f7b986d9942B0859a1E6921efA5342A673d04".lower():
return "https://thegivingblock.com/wp-content/uploads/2021/07/Ethereum-ETH-Logo.png"
elif self.address.lower() == "0x3AB4E696E31173409dbfBb1FEB5b9A7cC55A212c".lower():
return "https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bitcoin.svg/1200px-Bitcoin.svg.png"

if self.logo:
return self.logo.url
Expand Down
Loading