StellarConnect is a production-ready, chain-agnostic wallet integration dApp built with React 19 and TypeScript. It connects users to the Stellar Network through a beautiful, responsive interface that abstracts all blockchain complexity behind a clean provider interface.
Originally built for the Base (EVM) ecosystem, StellarConnect was fully migrated to Stellar, trimming the bundle from 2.5 MB β 1.02 MB and replacing EVM-specific tooling with a leaner, purpose-built Stellar stack.
Connect your Stellar wallet (Freighter, xBull, Rabet), view real-time balances, send assets, manage trustlines, claim testnet XLM via Friendbot, and invoke Soroban smart contracts β all in one UI.
| Feature | Description |
|---|---|
| π Multi-Wallet Support | Connects via Freighter, xBull, and Rabet using the Stellar Wallets Kit |
| π° Real-time Balances | Fetches native XLM + all custom trustline tokens from Horizon |
| π€ Send Transactions | Builds, signs, and submits Stellar payments for any asset |
| πͺ Trustline Manager | Establishes trustlines for custom Stellar assets (with testnet USDC preset) |
| π Recent Payments Feed | Displays last 10 on-chain operations with StellarExpert explorer links |
| π° Friendbot Faucet | One-click testnet XLM funding via Stellar's Friendbot API |
| π€ Soroban Smart Contracts | Reads and increments a counter value on a deployed WASM contract via Soroban RPC |
| π¨ Premium UI | Fluid animations (Framer Motion + GSAP), dark mode, glassmorphism cards |
| π Testnet / Mainnet Toggle | Single env variable switches the entire network stack |
StellarConnect is built around a strict ChainProvider interface. React components never import chain-specific SDKs β they only interact with useWallet(), making the UI fully portable.
src/
βββ chain/
β βββ types.ts # ChainProvider interface + shared types
β βββ stellar/
β βββ horizon.ts # Horizon API + Soroban RPC helpers
β βββ network.ts # Network passphrase / label constants
β βββ provider.ts # StellarProvider class (implements ChainProvider)
βββ hooks/
β βββ useWallet.ts # Central hook β connects UI to the active provider
βββ components/
β βββ WalletInfo.tsx # Main dashboard card
β βββ Hero.tsx # Landing section
β βββ Layout.tsx # Page shell
β βββ Features.tsx # Marketing feature cards
β βββ ThemeToggle.tsx # Dark/light mode switcher
β βββ AnimatedBackground.tsx # Particle / bubble background effects
βββ contexts/ # React context providers
βββ providers/ # App-level provider wrappers
βββ utils/
β βββ address.ts # Stellar address validation utility
βββ index.css # Design tokens + global styles
graph TD
A["React UI Components"] -->|consumes| B("useWallet() Hook")
B -->|reads VITE_CHAIN| C{Provider Selection}
C -->|stellar| D[StellarProvider]
D --> E["@creit.tech/stellar-wallets-kit"]
D --> F["Horizon REST API"]
D --> G["Soroban RPC Server"]
F -->|payments / trustlines / XLM| D
G -->|WASM contract read/write| D
| Layer | Technology |
|---|---|
| Framework | React 19 + TypeScript 5.9 |
| Build Tool | Vite 7 |
| Stellar SDK | @stellar/stellar-sdk v16 |
| Wallet Kit | @creit.tech/stellar-wallets-kit v2.5 |
| Animations | Framer Motion + GSAP 3 |
| UI Components | Geist UI + Lucide Icons |
| Styling | Tailwind CSS v4 + custom design tokens |
| Linting | ESLint 9 + TypeScript-ESLint |
- Node.js v20 or higher
- npm v10 or higher
- A Stellar-compatible browser wallet: Freighter, xBull, or Rabet
# 1. Clone the repository
git clone https://github.com/<your-org>/stellar-connect.git
cd stellar-connect
# 2. Install dependencies
npm install
# 3. Configure environment
cp .env.example .env
# 4. Start the development server
npm run devOpen http://localhost:5173 in your browser.
Create a .env file (or copy .env.example) in the project root:
# Active blockchain chain (currently only 'stellar' is supported)
VITE_CHAIN=stellar
# Stellar network β 'testnet' for development, 'mainnet' for production
VITE_STELLAR_NETWORK=testnet| Variable | Values | Default | Description |
|---|---|---|---|
VITE_CHAIN |
stellar |
stellar |
Selects the active ChainProvider implementation |
VITE_STELLAR_NETWORK |
testnet | mainnet |
testnet |
Targets Stellar Testnet or Mainnet Horizon endpoints |
Note: Switching to
mainnetautomatically changes the Horizon endpoint, network passphrase, and Soroban RPC endpoint. Never use a funded mainnet wallet with an untested contract ID.
Click "Connect Wallet" in the hero section. The Stellar Wallets Kit modal will appear, letting you choose Freighter, xBull, or Rabet.
Once connected, the dashboard displays:
- Your wallet address (with copy + StellarExpert links)
- Native XLM balance
- All custom token balances (established via trustlines)
- Current network label
Click the "Friendbot" button on the balances card to instantly fund your testnet wallet with 10,000 XLM. The balance auto-refreshes after a 2-second ledger ingestion delay.
Fill in a recipient Stellar address (G...) and an amount. If you hold multiple assets, a dropdown lets you select which to send. Click "Send Transaction" and sign in your wallet.
Enter an Asset Code (e.g., USDC) and Issuer Address, then click "Establish Trustline". Use the quick-fill "+ USDC (Testnet)" preset to avoid manual copy-pasting of issuer addresses.
The payments table auto-populates with your last 10 operations:
- π’ Received β incoming payments (green)
- π΄ Sent β outgoing payments (red)
- π‘ Create Account β account creation ops (amber)
Each row links directly to StellarExpert for full transaction details.
The "Soroban WASM Smart Contract Counter" card lets you interact with an on-chain counter contract:
- Fetch Value β Simulates a read-only call to get the current counter integer
- Increment β Builds, simulates, signs, submits, and polls a WASM increment transaction
The default Contract ID is pre-populated with a testnet counter contract for immediate demonstration.
All blockchain logic is isolated behind this interface in src/chain/types.ts:
export interface ChainProvider {
connect(): Promise<{ address: string }>;
disconnect(): Promise<void>;
getAddress(): string | null;
getBalances(address: string): Promise<BalanceInfo[]>;
getNetworkLabel(): string;
isConnected(): boolean;
sendTransaction(to: string, amount: string, assetCode?: string, assetIssuer?: string): Promise<{ hash: string }>;
getRecentPayments(address: string): Promise<PaymentRecord[]>;
addTrustline(assetCode: string, assetIssuer: string): Promise<{ hash: string }>;
fundAccount(address: string): Promise<boolean>;
getContractValue(contractId: string): Promise<number>;
incrementContractValue(contractId: string): Promise<{ hash: string }>;
}To add support for a new blockchain (e.g., Solana), create a new class that implements this interface and swap it in via the VITE_CHAIN environment variable. No UI changes required.
# Start the development server with HMR
npm run dev
# Type-check + build the production bundle
npm run build
# Run ESLint across all source files
npm run lint
# Preview the production build locally
npm run preview| File | Purpose |
|---|---|
src/chain/types.ts |
ChainProvider interface + BalanceInfo / PaymentRecord types |
src/chain/stellar/provider.ts |
Full Stellar implementation: connect, balances, payments, trustlines, Soroban |
src/chain/stellar/horizon.ts |
Horizon REST client, Friendbot helper, Soroban RPC server instance |
src/chain/stellar/network.ts |
Network constants and passphrase resolution |
src/hooks/useWallet.ts |
Reactive hook exposing all provider actions to UI |
src/components/WalletInfo.tsx |
Main dashboard component (balances, send, trustlines, Soroban, payments) |
src/utils/address.ts |
Stellar G... address validation regex |
We warmly welcome contributions from the community! Please read our full Contributing Guide before opening a pull request.
- Fork the repository and clone locally
- Branch using the naming convention:
feat/feature-nameβ new featuresfix/bug-descriptionβ bug fixesdocs/doc-nameβ documentationrefactor/scopeβ internal improvements
- Commit following Conventional Commits:
feat: add soroban contract read support fix(ui): correct overflow on mobile wallet card docs: update environment setup instructions - Ensure
npm run lintandnpm run buildpass cleanly - Open a Pull Request against the
devbranch and fill out the PR template
- Adding support for a new Stellar wallet (e.g., Lobstr, Solar)
- Improving error messages and UX for failed transactions
- Adding unit tests for the
useWallethook - Writing E2E tests with Playwright
- Never commit
.envor.env.localfiles β they are gitignored by default - All transaction signing happens inside your wallet extension β private keys never touch the app
- The Soroban RPC endpoint is public testnet only; production deployments should use an authenticated RPC provider
- Please report security vulnerabilities privately to the maintainers rather than opening a public issue
This project is licensed under the MIT License β see the LICENSE file for full details.
- Stellar Development Foundation for the incredible open-source tooling
- Creit Technologies for the Stellar Wallets Kit
- Geist UI for the clean component library
- The open-source community for continuous inspiration and feedback