Skip to content

jp244btc/Strike-Lightning-Deposit-Generator-GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Strike Lightning Invoice Generator

This is a simple Python application that allows you to generate Lightning Network invoices using the Strike API. It displays your account balances (in BTC and USD), generates invoices for deposits, shows a QR code for the invoice, and allows copying the invoice text to your clipboard.

Prerequisites

  • A Strike API key with the appropriate permissions (scopes). The app requires the partner.balances.read scope for fetching balances and the partner.invoice.create scope for creating invoices. See the section below for detailed instructions on how to obtain one.
  • Python 3.8 or later (the app uses features compatible with modern Python versions).

Obtaining a Strike API Key

To use this app, you'll need a Strike API key. Here's how to create one:

  1. Sign up for a Strike account if you don't already have one at strike.me.
  2. Log in to your Strike Dashboard at dashboard.strike.me.
  3. Navigate to the "API Key" section in the dashboard.
  4. Click to create a new API key. Assign it a name (e.g., "Invoice Generator") and an optional description.
  5. Select the required scopes: partner.balances.read for accessing account balances and partner.invoice.create for generating invoices. It's best to assign only the minimum scopes needed.
  6. Click "Create API Key" to generate it.
  7. Copy and securely store the API key immediately—it will only be shown once. Do not share it publicly or commit it to source code.
  8. If your key is ever compromised, return to the dashboard to revoke it and create a new one.

For more details, refer to the official Strike API documentation at docs.strike.me/api-keys/overview.

Installation Instructions

Step 1: Download and Install Python

If you don't have Python installed, follow these steps:

  1. Go to the official Python website: python.org/downloads.
  2. Download the latest stable release (e.g., Python 3.12.x or higher) for your operating system (Windows, macOS, or Linux).
  3. Run the installer:
    • Windows/macOS: During installation, check the box that says "Add Python to PATH" (this is crucial for running Python from the command line without specifying the full path).
    • Linux: Python is often pre-installed, but if not, use your package manager (e.g., sudo apt install python3 on Ubuntu). Ensure pip is installed (e.g., sudo apt install python3-pip).
  4. Verify the installation by opening a terminal/command prompt and running:
    python --version
    
    It should display the Python version (e.g., "Python 3.12.3"). If it doesn't, you may need to restart your terminal or manually add Python to your PATH (see below).

Manually Adding Python to PATH (If Needed)

If you forgot to check "Add Python to PATH" during installation or encounter issues:

  • Windows:

    1. Search for "Environment Variables" in the Start menu and open "Edit the system environment variables."
    2. Click "Environment Variables" > Under "System variables," find and select "Path" > Click "Edit."
    3. Click "New" and add the path to your Python installation (e.g., C:\Python312 or C:\Users\YourUsername\AppData\Local\Programs\Python\Python312).
    4. Also add the Scripts folder (e.g., C:\Python312\Scripts).
    5. Click OK to save, then restart your command prompt.
  • macOS:

    1. Open Terminal.
    2. Edit your shell profile (e.g., nano ~/.zshrc for zsh or nano ~/.bash_profile for bash).
    3. Add: export PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:$PATH" (adjust the version/path as needed).
    4. Save and run source ~/.zshrc (or equivalent).
  • Linux:

    1. Open Terminal.
    2. Edit your shell profile (e.g., nano ~/.bashrc).
    3. Add: export PATH="$HOME/.local/bin:$PATH" (or the path to your Python bin).
    4. Save and run source ~/.bashrc.

Step 2: Download the App

  • Clone this repository or download the ZIP file from GitHub.
  • Extract the files if needed. The main script is StrikeAppDepositsV1.0.py.

Step 3: Install Dependencies

The app requires a few Python libraries. Open a terminal/command prompt, navigate to the folder containing StrikeAppDepositsV1.0.py (using cd path/to/folder), and run:

pip install requests qrcode pillow
  • requests: For making API calls to Strike.
  • qrcode: For generating QR codes.
  • pillow: For handling images (used with qrcode and tkinter).

Note: tkinter and json are standard libraries included with Python, so no extra installation is needed for them.

If you encounter permission issues, try:

  • Windows/macOS: Run the command prompt/terminal as administrator.
  • Or use: pip install --user requests qrcode pillow

Step 4: Run the App

  1. In the terminal/command prompt, navigate to the folder with the script.
  2. Run:
    python StrikeAppDepositsV1.0.py
    
    (Or python3 StrikeAppDepositsV1.0.py on some systems.)

This will launch the GUI window.

Usage

  1. Enter your Strike API key in the "Strike API Key" field and click "Set Key & Refresh." This will load your account balances.
  2. In the "Generate Lightning Invoice" section:
    • Enter the amount (e.g., 0.0001 for BTC or 5 for USD).
    • Select the currency (BTC or USD).
    • Click "Generate Invoice."
  3. The QR code will appear, along with a truncated invoice ID and LN invoice text.
  4. Click "Copy Invoice Text" to copy the full LN invoice to your clipboard.
  5. Scan the QR code with a Lightning wallet (e.g., Wallet of Satoshi, Muun) to pay the invoice and deposit funds.

Troubleshooting

  • API Errors: Ensure your API key has the correct scopes (partner.balances.read and partner.invoice.create). Check Strike's API docs for details: docs.strike.me.
  • QR Code Not Generating: Make sure Pillow and qrcode are installed correctly (run pip show pillow qrcode to verify).
  • Tkinter Issues: If tkinter is missing (rare on Windows/macOS), install it via your package manager (e.g., sudo apt install python3-tk on Ubuntu).
  • Balances Not Loading: Verify your internet connection and API key validity.

If you run into issues, feel free to open an issue on this GitHub repo!

About

Generate bitcoin lightning invoices for Strike App on a PC or MAC w/ GUI

Resources

License

Stars

Watchers

Forks

Packages