This tool is a modernized fork of nimiq/cashlink-generator originally created by @danimoh.
Improvements:
- Complete TypeScript rewrite with enhanced type safety
- Modern environment configuration handling
- Updated dependencies for latest Node.js compatibility
- Nimiq 2.0 (Albatross PoS) support
- Improved development experience with proper typing
- Enhanced QR code generation capabilities
A tool for creating, managing, and handling Nimiq cashlinks. This tool allows you to create, fund, claim, and modify cashlinks in bulk.
- Install dependencies:
pnpm install
- Generate secrets:
- Run the secret generation script:
pnpm run secret
- Configure environment:
- Edit
.env
with your settings:NODE_IP
: Your Nimiq node IP (default: 127.0.0.1)NODE_PORT
: RPC port (default: 8648)NETWORK
: Choose 'main' or 'test' networkTOKEN_LENGTH
: Length of cashlink tokensSALT
: Base64 encoded salt for cashlink generation
- Edit
Run the tool:
pnpm start
-
Create New Cashlinks
- Specify quantity
- Set value in NIM
- Add custom message
- Choose theme (STANDARD, CHRISTMAS, LUNAR_NEW_YEAR, etc.)
- Optional short link generation
-
Load Existing Cashlinks
- Import from CSV file
- Modify existing cashlinks
- Generate new QR codes or coin images
-
Available Operations
create-images
: Generate QR codes or coin imageschange-message
: Update message for all cashlinkschange-theme
: Change theme of all cashlinksfund
: Fund cashlinks from a walletclaim
: Claim unclaimed cashlinks to an addressstatistics
: Generate usage statistics
-
QR Code Generation
- Generate Nimiq-styled QR codes
- Choose between light-blue or indigo color schemes
- Set custom error correction levels
- Output as SVG files in generated-qr directory
The tool uses CSV files with the following format:
token,shortlink,image-file,cashlink-url,private-key-base64
Example:
abc123,,qr-abc123.svg,https://hub.nimiq.com/cashlink/#...,...
-
Create New Cashlinks
> pnpm start > [Enter] for new cashlinks > Number of cashlinks: 10 > Value in NIM: 1 > Message: Welcome to Nimiq! > Theme: christmas
-
Modify Existing Cashlinks
> pnpm start > Enter path to CSV: ./generated-cashlinks/2024-01-25/cashlinks.csv > Operation: change-theme > New theme: lunar_new_year
-
Generate Statistics
> pnpm start > Enter path to CSV: ./generated-cashlinks/2024-01-25/cashlinks.csv > Operation: statistics
-
Generate QR Code
> pnpm run qr > QR Content: https://nimiq.com > Color (light-blue/indigo; default indigo): light-blue > Error Correction (L/M/Q/H; default M): H > Filename (default nimiq-com-light-blue-H):
This will generate a QR code in the
generated-qr
directory with:- Nimiq's radial gradient style
- Light blue color scheme
- High error correction level
- SVG format output
- Node.js 16+
- Running Nimiq node
- Network access to Nimiq node
- Keep your
.env
file secure - Back up generated CSV files safely
- Never share private keys
- Test with small amounts first