A dApp for burning and transferring GALA tokens, featuring an interactive community pixel board.
- Connect wallet and burn GALA tokens
- Transfer GALA tokens to other users
- Interactive Community Pixel Board
- Draw pixels by burning GALA tokens
- Real-time updates across all users
- Each pixel costs 1 GALA to place
- Shared canvas persisted in Firebase
- Clone the repository
- Install dependencies:
npm install
- Create a Firebase project:
- Go to Firebase Console
- Create a new project
- Add a web app to get your config
- Create a Realtime Database
- Create a
.env
file with your configuration:VITE_BURN_GATEWAY_API=https://gateway-mainnet.galachain.com/api/asset/token-contract VITE_BURN_GATEWAY_PUBLIC_KEY_API=https://api-galaswap.gala.com/galachain/api/asset/public-key-contract/GetPublicKey VITE_GALASWAP_API=https://api-galaswap.gala.com/galachain VITE_PROJECT_ID=your_project_id # Firebase Config VITE_FIREBASE_API_KEY=your_firebase_api_key VITE_FIREBASE_PROJECT_ID=your_firebase_project_id VITE_FIREBASE_DATABASE_URL=your_firebase_database_url
- Run the development server:
npm run dev
The pixel board uses Firebase Realtime Database for real-time collaboration:
- Canvas data is stored as pixel coordinates and RGB values
- Real-time updates using Firebase listeners
- Automatic synchronization across all connected users
- Optimized data structure for performance
- Transaction-based updates ensure data consistency
- Node.js (v14 or later)
- npm or yarn
- MetaMask wallet
- Firebase account
src/App.vue
- Main application componentsrc/components/
Balance.vue
- Displays GALA balanceBurnGala.vue
- Handles token burningTransferGala.vue
- Handles token transfersPixelBoard.vue
- Interactive community canvasWalletConnect.vue
- Handles wallet connection
- Environment variables are defined in
.env
- Vite configuration in
vite.config.ts
- Open your browser and navigate to
http://localhost:3000
- Click "Connect Wallet" to connect your MetaMask wallet
- Once connected, you'll see your GALA balance
- Navigate to the Pixel Board tab to start drawing
- Each pixel costs 1 GALA to place
- Click "Claim Pixels" to burn GALA and save your changes
The application is built with:
- Vue 3 (Composition API)
- TypeScript
- Vite
- Firebase Realtime Database
- GalaChain Connect library