astra-modal
v1.0.35
Published
Astra SDK is a powerful React library that enables seamless asset bridging between EVM-compatible blockchains and the Bitcoin Lightning Network. Built with modern web technologies, it provides developers with an easy-to-integrate solution for cross-chain
Readme
Astra SDK
Astra SDK is a powerful React library that enables seamless asset bridging between EVM-compatible blockchains and the Bitcoin Lightning Network. Built with modern web technologies, it provides developers with an easy-to-integrate solution for cross-chain liquidity and payments.
✨ Features
- Cross-Chain Bridge: Bridge assets between EVM chains and Lightning Network
- Multi-Chain Support: Support for Ethereum, Base, BSC, Botanix testnet, and more
- Wallet Integration: Built-in support for WalletConnect and popular Web3 wallets
- TypeScript Ready: Full TypeScript support with type definitions
- Responsive Design: Mobile-first design with responsive UI components
- Real-time Updates: Live transaction status and balance updates
- Customizable Theme: Dark theme with customizable styling
🚀 Quick Start
Installation
npm install astra-modal
# or
yarn add astra-modalBasic Usage
import React from 'react';
import { AstraProvider, AstraModal, astraSend, astraReceive } from 'astra-modal';
function App() {
return (
<AstraProvider
projectId="your-project-id"
>
<AstraModal />
{/* Lightning to EVM */}
<button onClick={() => astraSend({
assetId: "your-asset-id",
amount: 1000
})}>
Bridge from Lightning
</button>
{/* EVM to Lightning */}
<button onClick={() => astraReceive({
assetId: "your-asset-id",
invoice: "lnbc..."
})}>
Bridge to Lightning
</button>
</AstraProvider>
);
}📖 API Reference
AstraProvider
The main provider component that wraps your application.
<AstraProvider
projectId={string} // WalletConnect project ID (required)
>
{children}
</AstraProvider>astraSend
Bridge assets from Lightning Network to EVM chains.
astraSend({
assetId: string, // Asset identifier
amount: number, // Amount to bridge (in satoshis)
onAstraInvoice?: (invoice, tx, txUrl) => void, // Callback for invoice
});astraReceive
Bridge assets from EVM chains to Lightning Network.
astraReceive({
assetId: string, // Asset identifier
invoice: string // Lightning invoice
});🏗️ Development
Prerequisites
- Node.js 16+
- npm or yarn
- React 18+
Local Development
# Clone the repository
git clone <repository-url>
cd astrasdk
# Install dependencies (use npm only)
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run linter
npm run lintNote: This project uses npm as the package manager. Please avoid using yarn to prevent compatibility issues.
Environment Configuration
For development, you can use the provided test configuration:
const projectId = "your-test-project-id";🔧 Technical Stack
- React 18 - UI library
- Wagmi - React hooks for Ethereum
- Viem - TypeScript interface for Ethereum
- Reown AppKit - Wallet connection
- Ant Design - UI components
- Styled Components - CSS-in-JS styling
- Zustand - State management
- Axios - HTTP client
- Decimal.js - Precise decimal arithmetic
🌐 Supported Networks
Production Networks
- BSC - Binance Smart Chain
- Base - Coinbase Layer 2
Development Networks
- Sepolia - Ethereum testnet
- Base Sepolia - Base testnet
- Botanix - Bitcoin EVM testnet
📱 Mobile Support
The SDK is fully responsive and optimized for mobile devices with:
- Touch-friendly interfaces
- Responsive modal design
- Mobile wallet compatibility
- Optimized font sizes and spacing
🔐 Security Features
- Secure wallet connections via WalletConnect
- Transaction validation and verification
- Real-time status monitoring
- Error handling and user feedback
- Safe contract interactions
📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📞 Support
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation
- Review example implementations
🔄 Changelog
v1.0.34
- Initial public release
- EVM ↔ Lightning bridge functionality
- Multi-chain support
- Wallet integration
- Responsive design
Built with ❤️ by the Astra Labs team
