A Fuel wallet integration demo using Dynamic SDK for seamless wallet connections and blockchain interactions.
This project demonstrates how to integrate Fuel blockchain with Dynamic SDK, enabling users to connect various wallets and interact with Fuel contracts through a unified interface.
This project was migrated from Para SDK v2.0.0-alpha.29 to Dynamic SDK v4.22.1, maintaining all original functionality while providing a better user experience.
- Wallet Connection: Replaced Para SDK with Dynamic SDK for wallet management
- Predicate Integration: Uses Fuel predicates to enable EVM wallet interactions with Fuel blockchain
- UI/UX: Maintained original interface while using Dynamic SDK components
- Functionality: All features preserved - wallet connection, balance checking, transfers, counter contract interactions
- 🔗 Universal Wallet Support: Connect with MetaMask, WalletConnect, and other EVM wallets
- 🚀 Fuel Integration: Seamless interaction with Fuel blockchain through predicates
- 💰 Balance Management: Check and manage ETH balances on Fuel testnet
- 🔄 Token Transfers: Send ETH to other addresses on Fuel network
- 📊 Contract Interaction: Interact with smart contracts (counter demo)
- 🎨 Modern UI: Clean, responsive interface with dark theme
- Node.js (v16 or higher)
- pnpm package manager
- Git
-
Clone the repository:
git clone https://github.com/rishabhkeshan/fuel-dynamic.git cd fuel-dynamic -
Install dependencies:
pnpm install
-
Start the development server:
pnpm dev
-
Open your browser: Navigate to
http://localhost:5173
Create a .env file in the root directory:
VITE_DYNAMIC_ENVIRONMENT_ID=your_dynamic_environment_idThis project uses Dynamic SDK for wallet connections. The configuration is in src/main.tsx:
<DynamicContextProvider
settings={{
environmentId: import.meta.env.VITE_DYNAMIC_ENVIRONMENT_ID,
walletConnectors: [EthereumWalletConnectors],
}}
>src/hooks/useDynamicWallet.ts: Dynamic SDK wallet integrationsrc/hooks/useFuelWallet.ts: Fuel address generation from EVM addressessrc/connectors/DynamicFuelConnector.ts: Connector for Fuel blockchain interactionssrc/utils/dynamicHelper.ts: Helper functions for transfers and contract interactionssrc/utils/hideSandboxIndicator.ts: Utility to hide Dynamic SDK sandbox indicator
- Wallet Connection: Users connect their EVM wallet through Dynamic SDK
- Address Generation: EVM addresses are converted to Fuel addresses using predicates
- Transaction Signing: Transactions are signed with the connected EVM wallet
- Blockchain Interaction: Signed transactions are submitted to Fuel network
- Click "Connect Wallet" button
- Choose your preferred wallet from Dynamic SDK modal
- Authorize the connection
- Your Fuel address and ETH balance will be displayed automatically
- Balance updates in real-time
- Enter recipient Fuel address
- Click "Transfer 0.00001 ETH"
- Sign the transaction in your wallet
- Wait for confirmation
- Use the counter contract demo
- Click "Increment" to increase the counter
- Sign the transaction
- View the updated counter value
src/
├── components/ # React components
├── connectors/ # Blockchain connectors
├── context/ # React context providers
├── hooks/ # Custom React hooks
├── utils/ # Utility functions
├── types/ # TypeScript type definitions
└── main.tsx # Application entry point
- Dynamic SDK: Wallet connection and management
- Fuel SDK: Blockchain interactions
- React: UI framework
- TypeScript: Type safety
- Tailwind CSS: Styling
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the Dynamic SDK documentation
- Review the Fuel SDK documentation
- Dynamic Labs for the wallet SDK
- Fuel Network for the blockchain infrastructure
- Original Para SDK implementation for the foundation