{"id":31445106,"url":"https://github.com/zh/ecash-cli-wallet","last_synced_at":"2025-09-30T22:41:49.065Z","repository":{"id":312657594,"uuid":"1041410266","full_name":"zh/ecash-cli-wallet","owner":"zh","description":"A command-line eCash (XEC) wallet using minimal-xec-wallet","archived":false,"fork":false,"pushed_at":"2025-09-01T06:04:01.000Z","size":190,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T08:49:23.804Z","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-20T12:53:35.000Z","updated_at":"2025-08-21T05:04:08.000Z","dependencies_parsed_at":"2025-09-01T08:49:26.105Z","dependency_job_id":"ac94b815-89d4-4f9e-b877-3109624e7468","html_url":"https://github.com/zh/ecash-cli-wallet","commit_stats":null,"previous_names":["zh/ecash-cli-wallet"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zh/ecash-cli-wallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fecash-cli-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fecash-cli-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fecash-cli-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fecash-cli-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zh","download_url":"https://codeload.github.com/zh/ecash-cli-wallet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fecash-cli-wallet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277767641,"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:44.834Z","updated_at":"2025-09-30T22:41:49.055Z","avatar_url":"https://github.com/zh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eCash CLI Wallet\n\nA command-line interface (CLI) wallet for eCash (XEC) cryptocurrency using the minimal-xec-wallet library.\n\n## Features\n\n- 🆕 Create new XEC wallets with mnemonic phrases\n- 📋 List existing wallets\n- 💰 Check XEC and eToken balances (SLP/ALP protocols)\n- 📍 Display addresses with QR codes\n- 📤 Send XEC transactions\n- 🪙 Send eTokens (SLP and ALP tokens)\n- 📊 View eToken information and transaction history\n- ⚡ UTXO optimization for better transaction efficiency\n- 🔐 Secure JSON wallet storage\n\n## Installation\n\nThis CLI wallet requires the minimal-xec-wallet library. Make sure it's built and available in the parent directory.\n\n```bash\n# Install dependencies\nnpm install\n\n# (optional) Make CLI executable\nchmod +x xec-wallet.js\n```\n\nIf you make CLI executable, no need to add `node` in front of every command.\n\n## Usage\n\n### Create a New Wallet\n\nGenerate a new XEC wallet with a mnemonic phrase:\n\n```bash\nnode xec-wallet.js wallet-create -n my-wallet -d \"Personal XEC wallet\"\n```\n\n**⚠️ Important**: Save the mnemonic phrase securely! It's your only way to recover the wallet.\n\n### List Existing Wallets\n\nView all created wallets:\n\n```bash\nnode xec-wallet.js wallet-list\n```\n\n### Check Wallet Balance\n\nGet the XEC balance for a wallet:\n\n```bash\nnode xec-wallet.js wallet-balance -n my-wallet\n```\n\n### View Addresses and QR Codes\n\nDisplay wallet addresses with optional QR codes:\n\n```bash\n# Show addresses only\nnode xec-wallet.js wallet-addrs -n my-wallet\n\n# Show addresses with QR codes\nnode xec-wallet.js wallet-addrs -n my-wallet -q\n\n# Show additional HD address at index 1\nnode xec-wallet.js wallet-addrs -n my-wallet --index 1 -q\n```\n\n### Send XEC\n\nSend XEC to another address:\n\n```bash\nnode xec-wallet.js send-xec -n my-wallet -a ecash:qz9wjfr4e6aj0cq9akd23jm9nflecjpj8sze2fdyfl -q 100\n```\n\n## Command Reference\n\n### wallet-create\nCreate a new XEC wallet.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `-d, --description \u003cstring\u003e` - Wallet description (optional)\n\n**Example:**\n\n```bash\nnode xec-wallet.js wallet-create -n trading-wallet -d \"Wallet for trading activities\"\n```\n\n### wallet-list\nList all existing wallets.\n\n**Example:**\n\n```bash\nnode xec-wallet.js wallet-list\n```\n\n### wallet-balance\nCheck XEC and eToken balances for a wallet.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n\n**Example:**\n\n```bash\nnode xec-wallet.js wallet-balance -n my-wallet\n```\n\n**Output includes:**\n\n- XEC balance (confirmed/unconfirmed/total)\n- SLP token balances\n- ALP token balances\n- UTXO breakdown for fee calculation debugging\n\n### wallet-addrs\nDisplay wallet addresses and QR codes.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `-q, --qr` - Show QR codes (optional)\n- `--xec` - Show only XEC address (default)\n- `--wif` - Show WIF private key for sweeping\n- `--index \u003cnumber\u003e` - Show additional HD address at index (optional)\n\n**Examples:**\n\n```bash\n# Basic addresses\nnode xec-wallet.js wallet-addrs -n my-wallet\n\n# With QR codes\nnode xec-wallet.js wallet-addrs -n my-wallet -q\n\n# Show WIF private key\nnode xec-wallet.js wallet-addrs -n my-wallet --wif\n\n# Additional HD address\nnode xec-wallet.js wallet-addrs -n my-wallet --index 5 -q\n```\n\n### send-xec\nSend XEC to an address.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `-a, --addr \u003cstring\u003e` - Recipient eCash address (required)\n- `-q, --qty \u003cstring\u003e` - Amount in XEC (required)\n\n**Example:**\n\n```bash\nnode xec-wallet.js send-xec -n my-wallet -a ecash:qz9wjfr4e6aj0cq9akd23jm9nflecjpj8sze2fdyfl -q 50.5\n```\n\n### etoken-info\nGet detailed information about an eToken including metadata and wallet balance.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `-t, --tokenId \u003cstring\u003e` - 64-character hex token ID (required)\n\n**Example:**\n\n```bash\nnode xec-wallet.js etoken-info -n my-wallet -t a436c8e1b6bee3139a4d16a43e81c00c6e44be3a4df39e8c228985e6e5158b94\n```\n\n### etoken-tx-history\nView transaction history for a specific eToken.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `-t, --tokenId \u003cstring\u003e` - 64-character hex token ID (required)\n\n**Example:**\n\n```bash\nnode xec-wallet.js etoken-tx-history -n my-wallet -t a436c8e1b6bee3139a4d16a43e81c00c6e44be3a4df39e8c228985e6e5158b94\n```\n\n### send-etokens\nSend eTokens (SLP or ALP) to an address.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `-t, --tokenId \u003cstring\u003e` - 64-character hex token ID (required)\n- `-a, --addr \u003cstring\u003e` - Recipient eCash address (required)\n- `-q, --qty \u003cstring\u003e` - Amount of tokens to send (required)\n\n**Example:**\n\n```bash\nnode xec-wallet.js send-etokens -n my-wallet -t a436c8e1b6bee3139a4d16a43e81c00c6e44be3a4df39e8c228985e6e5158b94 -a ecash:qz9wjfr4e6aj0cq9akd23jm9nflecjpj8sze2fdyfl -q 100.5\n```\n\n### wallet-optimize\nOptimize wallet by consolidating UTXOs to improve transaction efficiency.\n\n**Options:**\n\n- `-n, --name \u003cstring\u003e` - Wallet name (required)\n- `--dry-run` - Show optimization plan without executing (optional)\n\n**Examples:**\n\n```bash\n# See optimization plan\nnode xec-wallet.js wallet-optimize -n my-wallet --dry-run\n\n# Execute optimization\nnode xec-wallet.js wallet-optimize -n my-wallet\n```\n\n## Wallet Storage\n\nWallets are stored as JSON files in the `.wallets/` directory. Each wallet contains:\n\n```json\n{\n  \"wallet\": {\n    \"mnemonic\": \"twelve word mnemonic phrase...\",\n    \"privateKey\": \"hex_private_key\",\n    \"publicKey\": \"hex_public_key\", \n    \"xecAddress\": \"ecash:qz9wjfr4e6aj0cq9akd23jm9nflecjpj8sze2fdyfl\",\n    \"hdPath\": \"m/44'/899'/0'/0/0\"\n  },\n  \"description\": \"Wallet description\",\n  \"created\": \"2025-08-18T10:30:00.000Z\"\n}\n```\n\n## Security Notes\n\n- 🔐 Mnemonic phrases are stored in plaintext JSON files\n- ⚠️ Keep your `.wallets/` directory secure\n- 💡 Consider using file system encryption for production use\n- 🚫 Never share your mnemonic phrase or private keys\n\n## eToken Support\n\n### Supported Protocols\n\n- **SLP (Simple Ledger Protocol)** - Original eCash token standard\n- **ALP (Arbitrarily Lockable Protocol)** - Advanced token protocol with enhanced features\n\n### Token Operations\n\n- View token information and metadata\n- Check token balances for your wallet\n- Send tokens to other addresses\n- View complete transaction history for specific tokens\n- Automatic protocol detection (SLP/ALP)\n\n### Token ID Format\neTokens are identified by 64-character hexadecimal token IDs:\n```\na436c8e1b6bee3139a4d16a43e81c00c6e44be3a4df39e8c228985e6e5158b94\n```\n\n### Fee Requirements\neToken transactions require XEC for fees:\n\n- Keep at least 1-2 XEC in your wallet for transaction fees\n- UTXOs with tokens lock XEC that can't be used for fees\n- Use `wallet-optimize` to consolidate UTXOs for better fee efficiency\n\n## Address Formats\n\n- **XEC Address**: `ecash:` prefix - for receiving XEC coins\n- **eToken Address**: Same as XEC address - tokens use the same address format\n\n## Block Explorers\n\nView transactions on these eCash block explorers:\n\n- https://explorer.e.cash/\n- https://3xpl.com/ecash/\n\n## Troubleshooting\n\n### eToken Transaction Failures\n\n**\"Insufficient XEC for transaction fees\"**\n\n- eToken transactions need pure XEC UTXOs for fees\n- Solution: Send 1-2 XEC to your wallet from an external source\n- Alternative: Use `wallet-optimize` to consolidate UTXOs\n\n**\"ALP transaction failed due to dust outputs\"**\n\n- ALP tokens require larger XEC UTXOs to avoid dust issues\n- Solution: Send more XEC to wallet, then try `wallet-optimize`\n\n**\"Token not found or not supported\"**\n\n- Check token ID format (must be 64-character hex)\n- Verify token exists by checking on block explorer\n- Ensure wallet has synced recent transactions\n\n### UTXO Management\n\n**When to optimize UTXOs:**\n\n- Before sending large eToken amounts\n- When getting frequent \"insufficient XEC\" errors\n- When wallet has many small UTXOs (dust)\n\n**Safe optimization:**\n\n- Only pure XEC UTXOs are consolidated\n- Token UTXOs remain untouched and safe\n- Use `--dry-run` first to see the plan\n\n### General Issues\n\n**Wallet not found:**\n- Check wallet name spelling\n- Use `wallet-list` to see available wallets\n\n**Network errors:**\n- Check internet connection\n- eCash network may be temporarily unavailable\n\n## Dependencies\n\n- **minimal-xec-wallet**: Core XEC wallet functionality (requires v1.0.5+ for eToken support)\n- **commander**: CLI argument parsing\n- **qrcode-terminal**: QR code generation in terminal\n- **qrcode**: QR code generation library\n\n## Development\n\nThe CLI follows the same patterns as psf-slp-wallet but enhanced for XEC and eToken operations:\n\n- No server configuration (chronik handles infrastructure automatically)\n- Comprehensive eToken support (SLP and ALP protocols)\n- Simple JSON file storage\n- Direct minimal-xec-wallet integration\n- Hybrid token management for cross-protocol compatibility\n\n### Recent Updates\n- Added full eToken transaction support (send, history, info)\n- Implemented UTXO optimization for better fee efficiency\n- Enhanced balance display with token categorization\n- Added comprehensive error handling for token operations\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fecash-cli-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzh%2Fecash-cli-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fecash-cli-wallet/lists"}