Spaces:
Running
Running
File size: 1,537 Bytes
da0ce7b | 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 | #!/usr/bin/env python3
"""Show raw Binance balances"""
from aureon_baton_link import link_system as _baton_link; _baton_link(__name__)
import os
import json
from dotenv import load_dotenv
from binance.client import Client
load_dotenv()
try:
client = Client(
os.getenv('BINANCE_API_KEY'),
os.getenv('BINANCE_API_SECRET')
)
print("\n=== RAW BINANCE ACCOUNT DATA ===\n")
# Get account info
account = client.get_account()
print("All balances with any value:")
for balance in account['balances']:
free = float(balance['free'])
locked = float(balance['locked'])
total = free + locked
if total > 0:
print(f"{balance['asset']}: free={free}, locked={locked}, total={total}")
print("\n=== CHECKING EARN PRODUCTS ===\n")
# Try to get Earn holdings
try:
savings = client.get_lending_position()
if savings:
print("Savings/Earn positions found:")
print(json.dumps(savings, indent=2))
else:
print("No Earn positions found")
except Exception as e:
print(f"Cannot check Earn positions: {e}")
print("\n=== ACCOUNT STATUS ===")
print(f"Can Trade: {account['canTrade']}")
print(f"Can Withdraw: {account['canWithdraw']}")
print(f"Can Deposit: {account['canDeposit']}")
except Exception as e:
print(f"\n❌ ERROR: {e}")
import traceback
traceback.print_exc()
|