fund-metanet
v1.3.1
Published
fund a metanet wallet
Readme
fund-metanet
A command-line tool to fund a Metanet wallet with Bitcoin SV (BSV).
Installation
This tool can be run directly using npx without installation:
npx fund-metanetOr install globally:
npm install -g fund-metanetUsage
Command-Line Mode (Recommended)
Run the tool with command-line arguments for quick, non-interactive funding:
npx fund-metanet --chain <network> --private-key <hex> [OPTIONS]Required Arguments
--chain <network>- Network to use:testormain--private-key <hex>- Wallet private key in hexadecimal format
Optional Arguments
--storage-url <url>- Storage provider URL (default:https://store-us-1.bsvb.tech)--satoshis <amount>- Amount to fund in satoshis (omit to check balance only)
Interactive Mode
Run without arguments to use interactive prompts:
npx fund-metanetThe tool will prompt you for:
- Network (test or main)
- Storage URL
- Private key
- Amount in satoshis
Help
Display usage information:
npx fund-metanet --helpExamples
Fund a wallet with 1000 satoshis
npx fund-metanet \
--chain main \
--private-key 0123456789abcdef... \
--satoshis 1000Check wallet balance only
Omit the --satoshis argument to check the balance without funding:
npx fund-metanet \
--chain main \
--private-key 0123456789abcdef...Use a custom storage provider
npx fund-metanet \
--chain main \
--private-key 0123456789abcdef... \
--storage-url https://store-us-1.bsvb.tech \
--satoshis 500Test network example
npx fund-metanet \
--chain test \
--private-key 0123456789abcdef... \
--satoshis 10000Requirements
- Node.js - Required to run the tool
- Metanet Desktop - Must be installed and running for funding operations
- Download: https://metanet.bsvb.tech
- Note: Metanet Desktop is only required when funding (not for balance checks)
How It Works
- Connects to storage provider - Establishes connection to the specified wallet storage URL
- Checks wallet balance - Displays current wallet balance from the remote storage
- Connects to local wallet - If funding, connects to Metanet Desktop (local wallet)
- Creates transaction - Derives keys and builds a payment transaction
- Funds remote wallet - Sends the transaction and internalizes it in the remote wallet
- Displays confirmation - Shows transaction ID and WhatsOnChain link
Security Notes
- Private keys are sensitive information - handle with care
- Use test network for development and testing
- Never share your private keys
- Consider using environment variables for private keys in scripts
Error Messages
❌ Invalid network- Network must be either "test" or "main"❌ Invalid storage URL- URL must start with "https://"❌ Invalid private key- Private key must be valid hexadecimal format❌ Metanet Desktop is not installed or not running- Start Metanet Desktop before funding
License
See package.json for license information.
Related Projects
- @bsv/sdk - Bitcoin SV SDK
- @bsv/wallet-toolbox - Wallet management tools
- Metanet Desktop - Local BSV wallet application
