{"id":31445104,"url":"https://github.com/zh/minimal-xec-wallet","last_synced_at":"2025-09-30T22:41:23.710Z","repository":{"id":310676117,"uuid":"1040749015","full_name":"zh/minimal-xec-wallet","owner":"zh","description":"A minimalist eCash (XEC) wallet npm library, for use in web apps. Supports eTokens.","archived":false,"fork":false,"pushed_at":"2025-09-11T11:28:38.000Z","size":1655,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T14:09:46.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T12:58:25.000Z","updated_at":"2025-08-20T23:28:11.000Z","dependencies_parsed_at":"2025-08-19T16:29:27.597Z","dependency_job_id":"e0245a75-4378-4cce-8abd-bf55c02cac37","html_url":"https://github.com/zh/minimal-xec-wallet","commit_stats":null,"previous_names":["zh/minimal-xec-wallet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zh/minimal-xec-wallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fminimal-xec-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fminimal-xec-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fminimal-xec-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fminimal-xec-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zh","download_url":"https://codeload.github.com/zh/minimal-xec-wallet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fminimal-xec-wallet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277767639,"owners_count":25873630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-30T22:41:22.544Z","updated_at":"2025-09-30T22:41:23.704Z","avatar_url":"https://github.com/zh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimal-xec-wallet\n\nA minimalist eCash (XEC) wallet npm library for web applications with full SLP and ALP token support.\n\n[![npm version](https://badge.fury.io/js/minimal-xec-wallet.svg)](https://badge.fury.io/js/minimal-xec-wallet)\n[![Test Coverage](https://img.shields.io/badge/coverage-424%20tests-green.svg)](./test/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## 🎯 Features\n\n### ✅ Core Wallet Operations\n- **HD Wallets**: BIP44 hierarchical deterministic key generation\n- **Import/Export**: Support for mnemonic phrases, WIF, and hex private keys\n- **Address Management**: XEC address generation and validation\n- **Balance Queries**: Real-time XEC balance with confirmed/unconfirmed breakdown\n\n### ✅ XEC Transactions\n- **Send XEC**: Single and multi-output transactions\n- **Send All**: Empty wallet functionality\n- **Fee Optimization**: Intelligent UTXO selection and fee calculation\n- **UTXO Consolidation**: Automatic optimization for better performance\n\n### ✅ eToken Support (SLP + ALP)\n- **Protocol Auto-Detection**: Automatic SLP/ALP protocol identification\n- **Token Operations**: Send, burn, list tokens across both protocols\n- **Token Metadata**: Automatic fetching of token info (name, symbol, decimals)\n- **Hybrid Management**: Unified API for both SLP and ALP tokens\n\n### ✅ Advanced Features\n- **OP_RETURN**: Embed data in blockchain transactions\n- **Security**: AES-256 mnemonic encryption, dust attack protection\n- **Network Resilience**: Multiple Chronik endpoint failover\n- **Price Queries**: Real-time XEC/USD pricing\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\nnpm install minimal-xec-wallet\n```\n\n### Basic Usage\n\n```javascript\nconst MinimalXECWallet = require('minimal-xec-wallet')\n\n// Create new wallet\nconst wallet = new MinimalXECWallet()\nawait wallet.initialize()\n\n// Check balance\nconst balance = await wallet.getXecBalance()\nconsole.log(`Balance: ${balance} XEC`)\n\n// Send XEC\nconst txid = await wallet.sendXec([\n  { address: 'ecash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy', amountSats: 10000 }\n])\n\n// List all tokens (SLP + ALP)\nconst tokens = await wallet.listETokens()\ntokens.forEach(token =\u003e {\n  console.log(`${token.ticker}: ${token.balance}`)\n})\n\n// Send tokens\nawait wallet.sendETokens('tokenId...', [\n  { address: 'ecash:qp123...', amount: 100 }\n])\n```\n\n### Browser Usage\n\n```html\n\u003cscript src=\"https://unpkg.com/minimal-xec-wallet/dist/minimal-xec-wallet.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  const wallet = new MinimalXecWallet()\n\n  // Initialize with automatic browser compatibility\n  wallet.initialize().then(() =\u003e {\n    console.log('Wallet ready for all browsers!')\n    // Use same API as Node.js\n  })\n\u003c/script\u003e\n```\n\n**Browser Compatibility**: Automatic WebAssembly loading with JavaScript fallbacks for older browsers. See [Browser Compatibility Guide](./docs/BROWSER_COMPATIBILITY.md) for details.\n\n## 📚 Documentation\n\n### API Reference\n- **[Complete API Documentation](./WALLET_API.md)** - All methods with examples\n- **[Examples Collection](./examples/README.md)** - 25+ working examples\n- **[Development Docs](./docs/README.md)** - Architecture and implementation details\n- **[Browser Compatibility Guide](./docs/BROWSER_COMPATIBILITY.md)** - WebAssembly and fallback support\n\n### Quick Links\n- **[Wallet Creation Examples](./examples/wallet-creation/)** - Create, restore, import wallets\n- **[Transaction Examples](./examples/transactions/)** - Send XEC, multi-output, send-all\n- **[Token Examples](./examples/tokens/)** - SLP/ALP token operations\n- **[Advanced Examples](./examples/advanced/)** - OP_RETURN, optimization, price queries, compatibility testing\n\n## 🧪 Testing\n\n### Run Tests\n\n```bash\n# All tests (424 unit + 29 integration)\nnpm run test:all\n\n# Unit tests only (fast)\nnpm run test:unit\n\n# Integration tests (requires network)\nnpm run test:integration\n\n# Test coverage report\nnpm run test:coverage\n\n# Browser compatibility test\nnode examples/advanced/browser-compatibility-test.js\n```\n\n### Example Testing\n\n```bash\n# Run all examples with guided testing\nnode examples/test-examples.js\n\n# Test specific functionality\nnode examples/tokens/list-all-tokens.js\nnode examples/transactions/send-xec.js\n\n# Test browser compatibility\nnode examples/advanced/browser-compatibility-test.js\n```\n\n## 🏗️ Architecture\n\n### Modern Design\n- **Modular Architecture**: Clean separation of concerns\n- **Protocol Agnostic**: Supports both SLP and ALP token standards\n- **Network Resilient**: Multiple Chronik endpoint failover\n- **Security First**: Built-in protections against common attacks\n\n### Core Components\n- **HybridTokenManager**: Unified SLP/ALP token operations\n- **RobustChronikRouter**: Network failover and error handling\n- **ConsolidateUtxos**: UTXO optimization engine\n- **KeyDerivation**: HD wallet key management\n\n### Dependencies\n- **chronik-client**: eCash blockchain indexer\n- **ecash-lib**: Core eCash transaction building\n- **@scure/bip39**: Secure mnemonic generation\n- **crypto-js**: AES encryption for mnemonics\n\n## 🔧 Advanced Configuration\n\n### Custom Options\n\n```javascript\nconst wallet = new MinimalXECWallet(mnemonic, {\n  hdPath: \"m/44'/899'/0'/0/0\",        // Custom derivation path\n  fee: 2.0,                          // Fee rate in sats/byte\n  chronikUrls: ['https://chronik.e.cash'], // Custom endpoints\n  enableDonations: false,            // Privacy mode\n  password: 'secure123'              // Mnemonic encryption\n})\n```\n\n### Environment Variables\n\n```bash\n# Test mode\nNODE_ENV=test npm test\n\n# Development mode\nNODE_ENV=development npm start\n```\n\n## 🤝 Contributing\n\n### Development Setup\n\n```bash\ngit clone https://github.com/zh/minimal-xec-wallet\ncd minimal-xec-wallet\nnpm install\nnpm run test:unit\n```\n\n### Code Quality\n\n```bash\n# Linting\nnpm run lint\n\n# Build for browser\nnpm run build\n\n# Generate API docs\nnpm run docs\n```\n\n## 📊 Project Stats\n\n- **424 Unit Tests** - Comprehensive coverage of all features\n- **29 Integration Tests** - Real network validation\n- **25+ Examples** - Working code for all use cases\n- **6 Token Protocols** - SLP Type 1, ALP Standard, auto-detection\n- **7 Chronik Endpoints** - Robust network failover\n\n## 🔗 Resources\n\n### eCash Ecosystem\n- **[eCash](https://e.cash)** - Official eCash website\n- **[CashTab Wallet](https://cashtab.com)** - Reference web wallet\n- **[Block Explorer](https://explorer.e.cash)** - Transaction lookup\n\n### Development\n- **[Chronik Indexer](https://chronik.e.cash/)** - Blockchain API\n- **[ecash-lib Documentation](https://www.npmjs.com/package/ecash-lib)** - Core library\n- **[SLP and ALP tokens](https://github.com/Bitcoin-ABC/bitcoin-abc/tree/master/cashtab/src/token-protocols)** - CashTab token protocols\n\n## 📄 License\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n\n## 🤔 Support\n\n- **Issues**: [GitHub Issues](https://github.com/your-repo/minimal-xec-wallet/issues)\n- **Examples**: See `./examples` directory for working code\n- **API Docs**: Run `npm run docs` for detailed API documentation\n- **Community**: eCash developer channels\n\n---\n\n**Security Notice**: This library handles real cryptocurrency. Always test with small amounts first and keep your mnemonic phrases secure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fminimal-xec-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzh%2Fminimal-xec-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fminimal-xec-wallet/lists"}