unich-connectors
v0.1.1
Published
A unified wallet connector for EVM and Solana chains with mobile-first design
Readme
Unich Connectors
A unified blockchain wallet connector library for EVM and Solana chains with mobile-first design.
Overview
Unich Connectors simplifies blockchain wallet integration with a consistent interface for connecting to EVM and Solana chains. Built with React and TypeScript, it handles the complexities of wallet interactions, state management, and error handling.
Key Features
- Multi-chain Support: EVM and Solana chains with a unified API
- Mobile-first Design: Deep linking and responsive behavior for mobile devices
- State Management: Persistent connection state with Zustand
- Error Handling: Structured error system with recovery options
- Type-safe: Full TypeScript support
- Provider Integration: Built on top of Wagmi and Solana Wallet Adapter
Installation
npm install unich-connectorsPeer Dependencies
This package has several peer dependencies that need to be installed in your host application:
npm install @solana/wallet-adapter-phantom @solana/wallet-adapter-solflare @tabler/icons-react @tanstack/react-query react react-domDevelopment Setup
- Clone the repository
- Install dependencies:
npm install- Install peer dependencies for development:
npm run install-peers- Start development build with watch mode:
npm run devQuick Start
import { WalletProvider, useWalletContext } from 'unich-connectors';
function App() {
return (
<WalletProvider>
<MyDApp />
</WalletProvider>
);
}
function ConnectButton() {
const { connect, disconnect, isConnected, account } = useWalletContext();
return (
<button onClick={isConnected ? disconnect : () => connect('metamask')}>
{isConnected ? `Disconnect ${account.slice(0, 6)}...` : 'Connect'}
</button>
);
}Documentation
- Getting Started
- Basic Usage
- Advanced Usage
- Architecture
- Error Handling
- API Reference
- Provider Integration
- Troubleshooting
- Migration Guide
- Examples
Supported Wallets
EVM
- MetaMask
- Coinbase Wallet
- WalletConnect
- Trust Wallet
- OKX Wallet
- Brave Wallet
Solana
- Phantom
- Solflare
- Backpack
- Coin98
Troubleshooting
Module not found errors
If you encounter "module not found" errors in your host application:
- Make sure all peer dependencies are installed in your host application
- Try running
npm run install-peersin this package if developing locally - Check that your bundler is correctly configured to handle the dependencies
License
MIT
Developed by Unich Labs
