Problem
The Trade and Donate panels have no balance awareness — users can't see how much they have or easily input the max amount.
1. Show relevant token balance
- Buy tab: Show user's reserve token balance (WETH on testnet / $PLOT on mainnet)
- Sell tab: Show user's storyline token balance
- Donate: Show user's reserve token balance
Display format: Balance: 0.05 WETH below the input field
2. Pre-validate before tx submission
- If user enters an amount exceeding their balance, show inline error and disable the button
- Prevents failed transactions and wasted gas
- Check: balance >= input amount (for sell/donate), balance >= estimated cost (for buy)
3. Max input button
- Add a "MAX" button next to the input field
- Clicking it fills the input with the user's full available balance
- For buy: use balance of reserve token
- For sell: use balance of storyline token
- For donate: use balance of reserve token
Acceptance Criteria
Files likely affected
src/components/TradingWidget.tsx
src/components/DonateWidget.tsx
Problem
The Trade and Donate panels have no balance awareness — users can't see how much they have or easily input the max amount.
1. Show relevant token balance
Display format:
Balance: 0.05 WETHbelow the input field2. Pre-validate before tx submission
3. Max input button
Acceptance Criteria
Files likely affected
src/components/TradingWidget.tsxsrc/components/DonateWidget.tsx