import PySimpleGUI as sg from secretsharing import PlaintextToHexSecretSharer from web3 import Web3 import requests import json import time
def get_all_tokens(address): url = f"https://api.ethplorer.io/getAddressInfo/{address}?apiKey=freekey" resp = requests.get(url) data = resp.json() tokens = [] for t in data.get("tokens", []): token_info = t['tokenInfo'] tokens.append({ "contract": token_info['address'], "symbol": token_info.get('symbol', ''), "decimals": int(token_info.get('decimals', 18)), "balance": int(t['balance']) }) return tokens