Production-Ready Cross-Chain Wallet SDK for Third-Party Applications
Create real blockchain wallets for any social identifier on both Ethereum and Solana with a single API call. Perfect for gaming platforms, enterprise applications, NFT marketplaces, and DeFi protocols.
npm install @nexuspay/sdk
import { NexusSDK } from '@nexuspay/sdk';
const sdk = new NexusSDK({
apiKey: 'your-api-key', // Get from https://backend-amber-zeta-94.vercel.app/
environment: 'production',
chains: ['ethereum', 'solana']
});
await sdk.initialize();
// Create real blockchain wallets instantly
const wallet = await sdk.createWallet({
socialId: 'user@yourapp.com',
socialType: 'email',
chains: ['ethereum', 'solana'],
paymaster: true // Your app pays gas fees
});
console.log('✅ Real wallets deployed!');
console.log('🔗 Ethereum:', wallet.addresses.ethereum);
console.log('⚡ Solana:', wallet.addresses.solana);
- Request Caching: Automatic 5-minute caching for better performance
- Batch Operations: Create multiple wallets efficiently
- Health Monitoring: Built-in health checks and statistics
- Webhook Support: Safe identifier generation for webhook systems
- Configuration Validation: Ensure proper SDK setup
- EVM Chains: Smart contract wallets on Ethereum, Polygon, Arbitrum, Base, Optimism
- SVM Chains: Native account creation on Solana
- Instant Deployment: Wallets are immediately visible on block explorers
- Unified Addresses: Same address across all EVM chains
- Paymaster ON: Your app pays all gas fees (perfect for gaming/enterprise)
- Paymaster OFF: Users pay their own gas fees (great for DeFi/marketplaces)
- Real-time Control: Set gas payment per wallet creation
Create wallets for ANY identifier type:
// Gaming
{ socialId: 'player_123', socialType: 'gamePlayerId' }
// Enterprise
{ socialId: 'emp_jane_doe', socialType: 'employeeId' }
// NFT Communities
{ socialId: 'ape_holder_rare', socialType: 'nftCollectorId' }
// Custom Business Logic
{ socialId: 'premium_tier_3', socialType: 'customerTierId' }
// Create wallets for 1000 players instantly
const playerWallets = await sdk.createWalletBatch([
{ socialId: 'player_001', socialType: 'gameId', chains: ['polygon'], paymaster: true },
{ socialId: 'player_002', socialType: 'gameId', chains: ['polygon'], paymaster: true },
// ... more players
]);
// All gas fees sponsored by your game
console.log(`🎮 ${playerWallets.length} player wallets ready!`);
// Employee wallet system
const employeeWallet = await sdk.createWallet({
socialId: 'emp_engineering_jane_doe_001',
socialType: 'enterpriseEmployeeId',
chains: ['ethereum', 'base'],
paymaster: true, // Company sponsors all transactions
metadata: {
department: 'Engineering',
clearanceLevel: 'L5',
startDate: '2024-01-15'
}
});
// Webhook integration
const webhookId = sdk.generateWebhookId(
'emp_engineering_jane_doe_001',
'enterpriseEmployeeId'
);
// Collector wallets with metadata
const collectorWallet = await sdk.createWallet({
socialId: 'whale_collector_ultra_rare',
socialType: 'nftCollectorTier',
chains: ['ethereum'],
paymaster: false, // Collectors pay their own gas
metadata: {
tier: 'Ultra Rare',
collections: ['BoredApes', 'CryptoPunks'],
totalValue: '500 ETH'
}
});
const health = await sdk.healthCheck();
console.log('API Status:', health.status);
console.log('SDK Version:', health.sdk.version);
const stats = sdk.getStats();
console.log('Cache Hit Rate:', stats.cacheSize);
console.log('Supported Chains:', stats.supportedChains);
// Efficient bulk operations
const results = await sdk.createWalletBatch(requests);
const wallets = await sdk.getWalletBatch(walletIds);
// Safe webhook identifiers
const webhookId = sdk.generateWebhookId(socialId, socialType);
const { socialId, socialType } = sdk.parseWebhookId(webhookId);
Base URL: https://backend-amber-zeta-94.vercel.app
Visit https://backend-amber-zeta-94.vercel.app/ to generate your production API key.
-
POST /api/wallets/deploy
- Create and deploy wallets -
GET /api/wallets/{socialId}
- Get wallet information -
GET /health
- API health check -
POST /api/payments
- Cross-chain payments
const sdk = new NexusSDK({
apiKey: 'your-api-key', // Required: Get from production URL
environment: 'production', // 'production' | 'development'
chains: ['ethereum', 'solana'], // Supported chains to use
endpoints: {
api: 'https://backend-amber-zeta-94.vercel.app' // Production endpoint
}
});
- Quick Start Guide - Get started in 5 minutes
- Complete API Reference - All methods and endpoints
- GitHub Repository - Source code and examples
import { NexusSDK } from '@nexuspay/sdk';
function useWallet() {
const [sdk] = useState(() => new NexusSDK({
apiKey: process.env.REACT_APP_NEXUS_API_KEY,
environment: 'production'
}));
useEffect(() => {
sdk.initialize();
}, []);
return { sdk };
}
// pages/api/create-wallet.ts
const sdk = new NexusSDK({
apiKey: process.env.NEXUS_API_KEY!,
environment: 'production'
});
export default async function handler(req, res) {
const wallet = await sdk.createWallet(req.body);
res.json({ success: true, wallet });
}
import { NexusSDK } from '@nexuspay/sdk';
const sdk = new NexusSDK({
apiKey: process.env.NEXUS_API_KEY,
environment: 'production'
});
app.post('/wallets', async (req, res) => {
const wallet = await sdk.createWallet(req.body);
res.json(wallet);
});
// ✅ Good: Server-side environment variable
const sdk = new NexusSDK({
apiKey: process.env.NEXUS_API_KEY
});
// ❌ Bad: Client-side exposure
const sdk = new NexusSDK({
apiKey: 'npay_your_key_here' // Never expose keys!
});
try {
const wallet = await sdk.createWallet(options);
return { success: true, wallet };
} catch (error) {
if (error.message.includes('rate limit')) {
return { error: 'Rate limited, try again later' };
}
return { error: 'Wallet creation failed' };
}
- Request Caching: 5-minute cache for GET requests
- Batch Operations: Create multiple wallets efficiently
- Connection Pooling: Optimized for high-throughput applications
- Rate Limiting: 1000 requests/minute in production
- Ethereum - Mainnet + Sepolia Testnet
- Polygon - Mainnet + Mumbai Testnet
- Arbitrum - Mainnet + Goerli Testnet
- Base - Mainnet + Goerli Testnet
- Optimism - Mainnet + Goerli Testnet
- Avalanche - Mainnet + Fuji Testnet
- BSC - Mainnet + Testnet
- Solana - Mainnet + Devnet + Testnet
- Player wallet creation with game currency
- Guild treasury management
- NFT reward distribution
- Sponsored gas for better UX
- Employee crypto payment systems
- Company treasury management
- Compliance-ready wallet tracking
- Department-specific wallet organization
- Collector wallet management
- Creator payout systems
- Royalty distribution
- Community membership wallets
- User wallet abstraction
- Protocol treasury management
- Yield farming automation
- Cross-chain liquidity management
- Documentation: Complete guides in this repository
- API Key Generation: https://backend-amber-zeta-94.vercel.app/
- GitHub Issues: Report bugs or request features
- NPM Package: @nexuspay/sdk
MIT License - see LICENSE for details.
Ready to deploy real blockchain wallets in your app? 🚀
Get your API key at https://backend-amber-zeta-94.vercel.app/ and start building!