Spaces:
Running
Running
Deploy Aureon OS (deploy/selfhost stack: nginx edge + fusion API x2 + console + HNC organ + redis + postgres; paper mode) (part 19)
da0ce7b verified Download scripts/python/show_binance_raw.py from GaryLeckey/aureon-os: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/GaryLeckey/aureon-os/resolve/main/scripts/python/show_binance_raw.py
- Command line
-
hf download hf://spaces/GaryLeckey/aureon-os/scripts/python/show_binance_raw.py
-
curl -L -o show_binance_raw.py https://huggingface.co/spaces/GaryLeckey/aureon-os/resolve/main/scripts/python/show_binance_raw.py
1.54 kB
| #!/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() | |