feat: Add btc lightning to crypto options

This commit is contained in:
Nathan Woodburn 2024-04-19 20:15:10 +10:00
parent a24a6b599e
commit d58a6196eb
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 17 additions and 1 deletions

View File

@ -58,5 +58,11 @@
"symbol": "CAKE", "symbol": "CAKE",
"name": "PancakeSwap", "name": "PancakeSwap",
"chain": "BNB" "chain": "BNB"
},
{
"symbol": "BTC",
"name": "Bitcoin Lightning",
"chain": "null",
"address": "hushedmercury55@walletofsatoshi.com"
} }
] ]

View File

@ -262,7 +262,10 @@ def donate():
coins += f'<a class="dropdown-item" style="{"display:none;" if file.lower() not in default_coins else ""}" href="?c={file.lower()}">{file}</a>' coins += f'<a class="dropdown-item" style="{"display:none;" if file.lower() not in default_coins else ""}" href="?c={file.lower()}">{file}</a>'
for token in tokenList: for token in tokenList:
if token["chain"] != 'null':
coins += f'<a class="dropdown-item" style="display:none;" href="?t={token["symbol"].lower()}&c={token["chain"].lower()}">{token["name"]} ({token["symbol"] + " on " if token["symbol"] != token["name"] else ""}{token["chain"]})</a>' coins += f'<a class="dropdown-item" style="display:none;" href="?t={token["symbol"].lower()}&c={token["chain"].lower()}">{token["name"]} ({token["symbol"] + " on " if token["symbol"] != token["name"] else ""}{token["chain"]})</a>'
else:
coins += f'<a class="dropdown-item" style="display:none;" href="?t={token["symbol"].lower()}&c={token["chain"].lower()}">{token["name"]} ({token["symbol"] if token["symbol"] != token["name"] else ""})</a>'
crypto = request.args.get('c') crypto = request.args.get('c')
if not crypto: if not crypto:
@ -295,6 +298,13 @@ def donate():
else: else:
cryptoHTML += f'<br>Donate with {token["name"]} {"("+token["symbol"]+") " if token["symbol"] != token["name"] else ""}on {crypto}:' cryptoHTML += f'<br>Donate with {token["name"]} {"("+token["symbol"]+") " if token["symbol"] != token["name"] else ""}on {crypto}:'
cryptoHTML += f'<code data-bs-toggle="tooltip" data-bss-tooltip="" id="crypto-address" class="address" style="color: rgb(242,90,5);display: block;" data-bs-original-title="Click to copy">{address}</code>' cryptoHTML += f'<code data-bs-toggle="tooltip" data-bss-tooltip="" id="crypto-address" class="address" style="color: rgb(242,90,5);display: block;" data-bs-original-title="Click to copy">{address}</code>'
elif token:
if 'address' in token:
address = token['address']
cryptoHTML += f'<br>Donate with {token["name"]} {"("+token["symbol"]+")" if token["symbol"] != token["name"] else ""}{" on "+crypto if crypto != "NULL" else ""}:'
cryptoHTML += f'<code data-bs-toggle="tooltip" data-bss-tooltip="" id="crypto-address" class="address" style="color: rgb(242,90,5);display: block;" data-bs-original-title="Click to copy">{address}</code>'
else:
cryptoHTML += f'<br>Invalid token: {token["name"]} ({token["symbol"]})<br>'
else: else:
cryptoHTML += f'<br>Invalid coin: {crypto}<br>' cryptoHTML += f'<br>Invalid coin: {crypto}<br>'