A comprehensive demonstration application showcasing the capabilities of the Avail Nexus SDK for cross-chain interactions and asynchronous composability on blockchain networks.
This demo application demonstrates the power of the Avail Nexus SDK, enabling seamless communication and information sharing among diverse application chains. It showcases scenarios where transactions can occur on one chain while related operations happen on different chains, highlighting the exciting possibilities of asynchronous blockchain composability.
- π Cross-Chain Bridging: Transfer tokens between supported blockchain networks
- πΈ Token Transfers: Send tokens to any address across different chains
- π Smart Contract Interactions: Execute arbitrary smart contract functions with cost estimation
- π Transaction History: Track and monitor all your transactions with real-time status updates
- π Multi-Wallet Support: Connect with various wallets using ConnectKit integration
- π¨ Modern UI: Clean, responsive interface built with Next.js and Tailwind CSS
- β‘ Real-time Updates: Live transaction progress tracking and notifications
The application demonstrates three core functionalities of the Nexus SDK:
Cross-chain token bridging with automatic route optimization and cost estimation.
Direct token transfers with recipient validation and gas estimation.
Smart contract interactions with ABI parsing, function simulation, and execution.
- Node.js 18+
- npm, yarn, pnpm, or bun
- A Web3 wallet (MetaMask, WalletConnect, etc.)
-
Clone the repository
git clone https://github.com/your-username/nexus-sample-app.git cd nexus-sample-app
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables
cp .env.example .env.local
Edit
.env.local
with your configuration (see Environment Variables) -
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open your browser Navigate to http://localhost:3000
Create a .env.local
file in the root directory:
# WalletConnect Project ID (required for wallet connections)
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here
- Visit WalletConnect Cloud
- Create a new project
- Copy your Project ID
- Add it to your
.env.local
file
- Click "Connect Wallet" in the header
- Choose your preferred wallet
- Approve the connection
- Navigate to the "Bridge" tab
- Select destination chains
- Choose token and amount
- Review transaction details and fees
- Execute the bridge transaction
- Go to the "Transfer" tab
- Select the destination chain
- Choose token and enter amount
- Input recipient address
- Review and confirm the transfer
- Access the "Deposit" tab
- Enter contract address and select target chain
- Input function name and parameters
- Load or paste contract ABI
- Simulate and execute the transaction
- View real-time progress in the transaction tracker
- Check transaction history for past operations
- Click on any transaction to view details on block explorer
The demo supports multiple blockchain networks including:
- Ethereum Mainnet
- Base
- Arbitrum
- Optimism
- Polygon
- Avalanche
- Linea
- Scroll
- Frontend: Next.js 15, React 18, TypeScript
- Styling: Tailwind CSS, Radix UI Components
- Web3: Wagmi, Viem, ConnectKit
- State Management: Zustand with persistence
- SDK: Avail Nexus SDK v0.0.5
- Notifications: Sonner toast notifications
src/
βββ app/ # Next.js app directory
βββ components/ # React components
β βββ bridge/ # Bridge-related components
β βββ layout/ # Layout components
β βββ shared/ # Shared/reusable components
β βββ ui/ # UI library components
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions and constants
βββ provider/ # Context providers
βββ store/ # Zustand stores
βββ types/ # TypeScript type definitions
- NexusBridge: Cross-chain token bridging interface
- NexusTransfer: Token transfer functionality
- NexusDeposit: Smart contract interaction component
- TransactionHistory: Historical transaction tracking
- TransactionProgress: Real-time progress monitoring
- Persistent transaction history in local storage
- Real-time status updates using SDK events
- Comprehensive error handling and user feedback
- Automatic retry mechanisms for failed transactions
- Form validation with real-time feedback
- Gas estimation and cost calculation
- Transaction simulation before execution
- Responsive design for all device sizes
- Comprehensive TypeScript types
- Error boundary implementation
- Modular component architecture
- Easy SDK integration examples
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is open source and available under the MIT License.
If you encounter any issues or have questions:
- Check the Issues page
- Review the SDK documentation
- Join the Avail Discord community
Made with β€οΈ by the Amartya Singh