File size: 2,340 Bytes
c896c68
 
 
ff8e009
 
c896c68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff8e009
c896c68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# app.py

import streamlit as st
import requests

st.title("Solana Wallet Verifier")

# Input fields for the wallet address and token mint address
wallet_address = st.text_input("Enter your Solana wallet address:")
token_mint_address = st.text_input("Enter the token mint address:")

if st.button("Verify"):
    if wallet_address and token_mint_address:
        try:
            # Solana RPC endpoint
            rpc_endpoint = "https://api.mainnet-beta.solana.com"

            # Prepare the request payload
            payload = {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "getTokenAccountsByOwner",
                "params": [
                    wallet_address,
                    {"mint": token_mint_address},
                    {"encoding": "jsonParsed"}
                ]
            }

            # Send the request
            response = requests.post(rpc_endpoint, json=payload)
            result = response.json()

            # Check if any token accounts were found
            if 'result' in result and 'value' in result['result'] and len(result['result']['value']) > 0:
                # Get the balance (assuming only one account for simplicity)
                token_account = result['result']['value'][0]
                balance_info = token_account['account']['data']['parsed']['info']['tokenAmount']
                amount = int(balance_info['amount'])  # amount in the smallest unit

                # Adjust for token decimals
                decimals = balance_info['decimals']
                adjusted_amount = amount / (10 ** decimals)

                # Compare the adjusted amount to thresholds
                if adjusted_amount >= 3333333:
                    st.success("✅ Guaranteed OG Status")
                elif adjusted_amount >= 333333:
                    st.success("✅ Guaranteed WLT Status")
                elif adjusted_amount >= 33333:
                    st.success("✅ Guaranteed WLR Status")
                else:
                    st.error("You do not meet any status requirements.")
            else:
                st.error("Token account not found or zero balance.")
        except Exception as e:
            st.error(f"An error occurred: {e}")
    else:
        st.warning("Please enter both wallet address and token mint address.")