Skip to content

ma-moon/rustchain-mobile-wallet

Repository files navigation

RustChain Mobile Wallet 📱

A cross-platform mobile wallet application for RustChain (RTC) built with React Native and Expo.

Platform React Native Expo TypeScript

✨ Features

  • 💰 Balance Tracking: Real-time RTC balance monitoring
  • 📊 Transaction History: View all incoming and outgoing transactions
  • 📱 QR Code Receive: Generate QR codes for easy payment receiving
  • 🔄 Auto-refresh: Balance and transactions update every 30 seconds
  • 🎨 Modern UI: Dark theme with smooth animations
  • 🔒 Secure: Local state management, no sensitive data storage

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Expo CLI (will be installed automatically)
  • iOS Simulator (Mac) or Android Emulator

Installation

  1. Clone the repository

    cd rustchain-mobile-wallet
  2. Install dependencies

    npm install
  3. Start the development server

    npm start
  4. Run on your device

    • Press i to open iOS simulator
    • Press a to open Android emulator
    • Scan QR code with Expo Go app on physical device

📱 Screenshots

Home Screen

  • Display RTC balance
  • Quick action buttons (Send, Receive, History)
  • Network status indicator
  • Miner ID management

Receive Screen

  • QR code generation
  • Copy address to clipboard
  • Share functionality

Send Screen

  • Recipient address input
  • Amount entry with MAX button
  • Balance display
  • Transaction preview

History Screen

  • Complete transaction list
  • Transaction details (hash, date, status)
  • Filter by incoming/outgoing

🏗️ Architecture

src/
├── components/     # Reusable UI components
│   ├── BalanceCard.tsx
│   ├── QuickActions.tsx
│   ├── QRCodeDisplay.tsx
│   └── TransactionList.tsx
├── screens/        # App screens
│   ├── HomeScreen.tsx
│   ├── SendScreen.tsx
│   ├── ReceiveScreen.tsx
│   └── HistoryScreen.tsx
├── services/       # API integration
│   └── rustchain.ts
└── context/        # State management
    └── WalletContext.tsx

🔌 API Integration

The wallet connects to the RustChain node at https://50.28.86.131

Endpoints Used

  • GET /wallet/balance?miner_id={id} - Get wallet balance
  • GET /epoch - Get current epoch information
  • GET /health - Node health check
  • GET /api/miners - List active miners

Adding Transaction Support

To enable actual transaction sending (currently demo-only):

  1. Implement key generation and storage
  2. Add transaction signing logic
  3. Integrate with RustChain transaction API
  4. Add QR code scanning for recipient addresses
// Example: Future transaction sending implementation
async function sendTransaction(from: string, to: string, amount: number) {
  const signedTx = await signTransaction({ from, to, amount });
  const response = await api.post('/transactions', signedTx);
  return response.data;
}

🛠️ Development

Build for Production

Android APK:

npm run build:android

iOS IPA:

npm run build:ios

Both platforms:

npm run build

Code Style

The project uses TypeScript with strict mode enabled.

npm run lint

📋 Requirements

  • iOS 13.4+
  • Android 6.0+ (API level 23+)
  • React Native 0.76.3+
  • Expo SDK 52+

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

💬 Support

For issues and feature requests, please open an issue on the rustchain-bounties repository.

🎯 Bounty Information

Issue: #1616
Bounty: 20 RTC
Status: ✅ Complete

Deliverables

  • ✅ React Native mobile wallet app
  • ✅ Balance check functionality
  • ✅ Transaction history display
  • ✅ QR code receive feature
  • ✅ Build configuration for iOS and Android
  • ✅ Complete documentation

Built with ❤️ for the RustChain Community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors