SuperPull Mobile is a Flutter application that enables users to participate in NFT auctions with dynamic bonding curves on the Solana blockchain. The app integrates with Temporal.io workflows for reliable transaction processing and state management.
- Riverpod: Used for dependency injection and state management
- StateNotifier: For complex state handling with immutable state updates
- FutureProvider: For async data fetching with automatic caching
-
WorkflowService: Manages long-running operations via Temporal.io
- Handles workflow execution, querying, and signaling
- Implements polling with backoff for workflow status
- Provides error handling and retry mechanisms
-
TokenService: Manages SPL/MPL token interactions
- Implements 5-minute caching for token metadata
- Handles fallback to cached data on errors
- Provides automatic metadata refresh
-
WalletService: Secure wallet management
- BIP39 mnemonic generation and storage
- Secure key derivation and storage
- Integration with Solana web3.js
-
AuthService: Authentication and session management
- JWT-based authentication
- Secure token storage
- Automatic session refresh
User Login/Registration -> JWT Generation -> Secure Storage -> Session Management
- Supports social authentication providers
- Implements secure token refresh mechanism
- Handles session expiration and auto-logout
Create/Import Wallet -> Generate/Validate Mnemonic -> Secure Storage -> Key Derivation
- Supports BIP39 mnemonic generation
- Implements hierarchical deterministic wallets
- Provides secure key storage and recovery
Image Upload -> Metadata Generation -> Workflow Initiation -> Status Tracking -> Completion
- User uploads auction image
- System generates and uploads metadata to Arweave
- Temporal workflow creates Merkle tree
- Creates collection NFT
- Initializes auction with bonding curve parameters
- Returns auction details for UI display
Fetch Token List -> Metadata Retrieval -> Cache Management -> UI Updates
- Retrieves list of accepted tokens
- Fetches SPL token information (supply, decimals)
- Retrieves MPL metadata if available
- Implements fallback to default values
- Caches results for 5 minutes
- Provides automatic refresh mechanism
Price Check -> Balance Verification -> Transaction Creation -> Signature -> Submission
- Retrieves current token price
- Verifies user balance
- Creates bid transaction
- Gets user signature
- Submits to blockchain
- Monitors transaction status
Periodic Polling -> State Updates -> Cache Management -> UI Refresh
- Polls auction status every 30 seconds
- Updates local state cache
- Triggers UI updates
- Handles auction completion
- Manages token distribution
- Flutter SDK (3.0.0 or higher)
- Dart SDK (3.0.0 or higher)
- Solana CLI tools (optional, for testing)
- iOS/Android development setup
- Temporal.io server (for workflow execution)
- Clone and setup dependencies:
git clone <repository-url>
cd superpull_mobile
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs- Environment Configuration:
// lib/config/env.dart
const API_URL = String.fromEnvironment('API_URL',
defaultValue: 'https://api.superpull.world');- Run with specific environment:
flutter run --dart-define=API_URL=https://api.dev.superpull.worldlib/
├── main.dart # Application entry point
├── config/ # Configuration and environment
│ └── env.dart
├── models/ # Freezed data models
│ ├── token_metadata.dart
│ └── auction_state.dart
├── providers/ # Riverpod providers
│ ├── token_provider.dart
│ └── auth_provider.dart
├── services/ # Business logic layer
│ ├── workflow_service.dart
│ ├── token_service.dart
│ └── wallet_service.dart
├── pages/ # UI screens
└── widgets/ # Reusable components
- Mnemonics stored using Flutter Secure Storage
- Keys never exposed to JavaScript bridge
- Automatic session timeout
- JWT-based authentication
- HTTPS-only communication
- Request signing for blockchain transactions
- Graceful degradation with cached data
- Comprehensive error logging
- User-friendly error messages
# Run all tests
flutter test
# Run with coverage
flutter test --coverageThe app uses a workflow-based architecture for reliable transaction processing:
-
Workflow Initialization
- Client initiates workflow
- Server generates workflow ID
- Client polls for status
-
State Management
- Workflows maintain transaction state
- Automatic retry on failures
- Consistent state across crashes
-
Error Handling
- Graceful degradation
- Automatic retries
- Fallback to cached data
See CONTRIBUTING.md for detailed contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.