A React example application demonstrating the usage of the Zcash Router SDK for routing assets to and from Zcash.
- Route to Zcash: Swap assets from Solana (SOL) to Zcash (ZEC)
- Route from Zcash: Swap assets from Zcash to Solana
- Real-time swap status tracking
- Clean, modern UI with Material-UI and Tailwind CSS
- Node.js 18+
- pnpm (recommended) or npm
From the root of the monorepo:
pnpm installCreate a .env file in the example-app directory:
VITE_LIGHTWALLETD_URL=https://zcash-mainnet.chainsafe.devcd packages/example-app
pnpm devOr from the root:
pnpm --filter @zcash-router-sdk/example-app run devThe app will be available at http://localhost:3000
- Enter Solana Mnemonic: Your BIP39 mnemonic phrase (12 or 24 words)
- Enter Zcash Mnemonic: Destination Zcash account mnemonic
- Enter Amount: Amount of SOL to swap
- Click "Swap to Zcash": Initiates the cross-chain swap
The app will display real-time progress through the swap stages.
- Enter Zcash Mnemonic: Your Zcash account mnemonic
- Enter Solana Mnemonic: Destination Solana account mnemonic
- Enter Amount: Amount of ZEC to swap
- Click "Swap from Zcash": Initiates the cross-chain swap
- App.tsx: Main application entry point
- App.mui.tsx: Material-UI version of the app
- App.minimal.tsx: Minimal version without UI framework
- RouteToZecForm: Form component for swapping to Zcash
- RouteFromZecForm: Form component for swapping from Zcash
- SwapStatus: Reusable status display component
- @zcash-router-sdk/core: Core swap and routing functionality
- @zcash-router-sdk/solana-account-mnemonic: Solana account management with mnemonic support
- @zcash-router-sdk/zcash-account-mnemonic: Zcash account management with mnemonic support
- React 18: UI framework
- Vite: Build tool and dev server with WASM support plugins
- Material-UI: UI component library (optional)
- Tailwind CSS: Utility-first CSS framework
- WASM support is enabled via
vite-plugin-wasmandvite-plugin-top-level-awaitto support the Zcash cryptographic libraries - The Zcash packages use
@chainsafe/webzjs-walletwhich requires WASM - Node.js polyfills are configured for browser compatibility
pnpm buildThe production build will be output to the dist/ directory.
pnpm previewpnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm typecheck- Run TypeScript type checkingpnpm lint- Run ESLintpnpm lint:fix- Fix ESLint errors
MIT