---
name: wallet-rotation
description: Use when rotating BSC/TRON funds or checking balances.
---

# Wallet-Rotation (BSC + TRON)

System in `~/wallet-rotation/` (rotate.py EVM, rotate_tron.py TRON, status.py, txlog.py, config.json, tests/).

## Commands
- Cross-Chain-Tausch (BNB→USDT etc.): siehe `references/sideshift-tausch.md` (SideShift-API, Account in ~/.secrets/sideshift_acct.json)
- Status (no keys read): `cd ~/wallet-rotation && ./status.py`
- Dry-run BSC: `./rotate.py` (add `--hop <name>` for one hop)
- Dry-run TRON: `/usr/bin/python3 rotate_tron.py`
- Real send (owner approval only): add `--send`
- Tests: `~/goldcoin-launch/.venv/bin/python -m pytest tests/ -q` (19 must pass)
- TX-Log: `./txlog.py list`, crash recovery: `./txlog.py resolve <id> confirmed|failed`

## Rules
- Real sends ONLY after dry-run + green tests; never run with --send unprompted.
- Keys live in ~/.secrets (chmod 600), never print them; outputs show addresses only.
- USDT-BEP20 on this chain is 0x55d398326f99059fF775485246999027B3197955 — the 0x55d3…f001 variant has no contract code here (verified via multiple RPCs).
- Idempotency key is chain|hop|from->to|token|amount; confirmed TXs never resend; pending entries block runs until resolved.
- rotate.py needs the goldcoin venv interpreter (shebang), rotate_tron.py needs /usr/bin/python3 (tronpy).
- web3 v8: HTTPProvider takes no request_timeout kwarg.
- tronpy get_account_balance returns Decimal; unactivated TRON wallets raise AddressNotFound → treat as 0.
