This implementation adds a comprehensive Transaction History page to the Wuta-Wuta AI Art Marketplace, allowing users to view their last 10 Stellar transactions related to the Wuta-Wuta contract via the Horizon API.
- Table Display: Shows transaction details including type, hash, amount, status, and date
- Filtering: Filter transactions by status (all, successful, failed)
- Search: Search transactions by hash, type, or memo
- Pagination: Navigate through multiple pages of transactions
- Statistics: Display total transactions, successful count, total fees, and current page
- Explorer Integration: Direct links to Stellar Explorer for each transaction
- Responsive Design: Mobile-friendly table with proper formatting
- Horizon API Integration: Added Horizon server initialization
- Transaction Fetching: Functions to fetch transactions from Horizon API
- Wuta-Wuta Filtering: Filter transactions related to the Wuta-Wuta contract
- Transaction Formatting: Standardize transaction data for UI display
- Error Handling: Comprehensive error handling for API failures
- New Menu Item: Added "Transactions" to the main navigation
- Icon Integration: Added Activity icon for the transactions menu
- Route Handling: Proper routing to the Transaction History component
- Account Transactions:
/accounts/{address}/transactions - Parameters:
limit=10(last 10 transactions)order=desc(most recent first)page={page}(pagination support)
- Filters transactions related to Wuta-Wuta contract
- Checks for
invoke_host_functionoperations - Matches contract ID with Wuta-Wuta marketplace contract
- Header Section: Title and description
- Filters Section: Search, status filter, and refresh button
- Statistics Cards: Transaction metrics display
- Transactions Table: Detailed transaction information
- Pagination Controls: Navigate through transaction pages
- Payment
- Contract Call (invoke_host_function)
- Account Creation
- Data Management
- Account Settings
- Trust Line operations
- Buy/Sell Offers
- Path Payments
- And more...
- Success: Green indicator for successful transactions
- Failed: Red indicator for failed transactions
- Loading: Spinner during data fetching
REACT_APP_HORIZON_URL=https://horizon-testnet.stellar.org
REACT_APP_WUTA_WUTA_CONTRACT=your_contract_address- Horizon URL: Testnet by default
- Transaction Limit: 10 transactions per page
- Network: Test SDF Future Network
- Wallet not connected
- API fetch failures
- No transactions found
- Network connectivity issues
- Success messages for actions
- Error messages for failures
- Loading indicators
- Colors: Purple theme matching existing design
- Typography: Consistent with other components
- Animations: Smooth transitions and micro-interactions
- Responsive: Works on all screen sizes
- Semantic HTML structure
- Proper ARIA labels
- Keyboard navigation support
- Screen reader compatibility
- Component rendering
- API integration
- Filter functionality
- Search functionality
- Store integration
- Navigation routing
- Error handling
- Connect wallet functionality
- Transaction loading
- Filter operations
- Pagination
- Explorer links
- Real-time Updates: WebSocket integration for live transaction updates
- Advanced Filtering: Date range, amount range, specific operation types
- Export Functionality: CSV/Excel export of transaction history
- Transaction Details: Modal with detailed transaction information
- Analytics: Transaction trends and insights
- Multi-network Support: Mainnet and other testnet support
- Caching: Local storage caching for transaction data
- Lazy Loading: Load transactions as needed
- Virtual Scrolling: For large transaction lists
- Optimistic Updates: Immediate UI updates
src/components/TransactionHistory.js- Main transaction history component
src/App.js- Added navigation and routingsrc/store/museStore.js- Added Horizon API integration and transaction functions
@stellar/stellar-sdk- Stellar SDK for Horizon APIframer-motion- Animationslucide-react- Iconsreact-hot-toast- Toast notificationszustand- State management
All functionality uses existing project dependencies.
- Connect Wallet: Connect your Stellar wallet to the application
- Navigate: Click on "Transactions" in the sidebar menu
- View History: See your last 10 Wuta-Wuta related transactions
- Filter: Use filters to narrow down transactions
- Search: Search for specific transactions
- Explore: Click "Explorer" to view detailed transaction info
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
- No sensitive data stored in component state
- API calls made through secure HTTPS endpoints
- Contract addresses validated before use
- Error messages sanitized for display
This implementation provides a comprehensive transaction history feature that integrates seamlessly with the existing Wuta-Wuta marketplace architecture. It follows established patterns and maintains consistency with the existing codebase while providing valuable functionality for users to track their Stellar transactions related to the platform.