Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
628 B
2
Indexable
Never
import requests

wallets = [
"wallet1",
"wallet2",
]

total_tokens = 0

for wallet in wallets:
    response = requests.get(f"https://jup-airdrop.zhen8558.workers.dev/allocation/{wallet.lower()}")

    if response.status_code == 200 and response.text.strip():
        try:
            tokens_final = response.json().get("tokens_final", "Not available")
            print(f"{wallet} Tokens:", tokens_final)
            total_tokens += int(tokens_final)
        except ValueError:
            print(f"{wallet} Tokens: Error parsing JSON")
    else:
        print(f"{wallet} Tokens: 0")

print(f"Your Total tokens: {total_tokens}")
Leave a Comment