|
import streamlit as st |
|
import requests |
|
|
|
st.title("Verify π»") |
|
|
|
|
|
TOKEN_MINT_ADDRESSES = { |
|
"$TRICK": "EAXn2aA4GRE4p7r5q77NynHnQhaWnU5Pw66GSWQ4pump", |
|
"$TREAT": "3JqD4oUp1YzvzGWF2WJjrELr4QkW1GDLyFdtYnukpump" |
|
} |
|
|
|
|
|
wallet_address = st.text_input("Enter your Solana wallet address:") |
|
|
|
if st.button("Verify"): |
|
if wallet_address: |
|
try: |
|
|
|
rpc_endpoint = "https://api.mainnet-beta.solana.com" |
|
|
|
total_adjusted_amount = 0 |
|
|
|
|
|
for token_name, token_mint_address in TOKEN_MINT_ADDRESSES.items(): |
|
|
|
payload = { |
|
"jsonrpc": "2.0", |
|
"id": 1, |
|
"method": "getTokenAccountsByOwner", |
|
"params": [ |
|
wallet_address, |
|
{"mint": token_mint_address}, |
|
{"encoding": "jsonParsed"} |
|
] |
|
} |
|
|
|
|
|
response = requests.post(rpc_endpoint, json=payload) |
|
result = response.json() |
|
|
|
|
|
if ( |
|
'result' in result and |
|
'value' in result['result'] and |
|
len(result['result']['value']) > 0 |
|
): |
|
|
|
token_account = result['result']['value'][0] |
|
balance_info = token_account['account']['data']['parsed']['info']['tokenAmount'] |
|
amount = int(balance_info['amount']) |
|
|
|
|
|
decimals = balance_info['decimals'] |
|
adjusted_amount = amount / (10 ** decimals) |
|
|
|
|
|
total_adjusted_amount += adjusted_amount |
|
|
|
|
|
st.write(f"You hold {adjusted_amount:,.0f} {token_name} tokens.") |
|
else: |
|
st.write(f"No {token_name} tokens found.") |
|
|
|
|
|
if total_adjusted_amount >= 333333: |
|
st.success("β
Guaranteed OG Status") |
|
elif total_adjusted_amount >= 33333: |
|
st.success("β
Guaranteed Trencher Status") |
|
elif total_adjusted_amount >= 3333: |
|
st.success("β
Guaranteed Raider Status") |
|
else: |
|
st.error("You don't have enough tokens yet π»") |
|
|
|
|
|
try: |
|
form_url = "https://docs.google.com/forms/d/e/1FAIpQLSfsLawJnLd14ZGd8-fsbTdqGSsCSESe1w8Zd39wigDn6pvokQ/formResponse" |
|
|
|
form_data = { |
|
'entry.1721628210': wallet_address, |
|
'entry.1357327531': f"{total_adjusted_amount:,.0f}" |
|
} |
|
|
|
response = requests.post(form_url, data=form_data) |
|
if response.status_code != 200: |
|
st.warning("Failed to log data to Google Form.") |
|
except Exception as e: |
|
st.warning(f"Failed to log data to Google Form: {e}") |
|
|
|
except Exception as e: |
|
st.error(f"An error occurred: {e}") |
|
else: |
|
st.warning("Please enter your wallet address.") |
|
|