Near Qr Skill
Verified@ussyalfaks
npx machina-cli add skill @ussyalfaks/near-qr-skill --openclawNEAR QR Code Skill
Generate and read QR codes for NEAR Protocol addresses and payment requests.
Setup
Install the required Python dependencies:
pip install -r requirements.txt
Commands
1. Generate Address QR — near_qr_address
Generate a QR code containing a NEAR account address.
Usage:
python near_qr.py address <account_id> [--output <path>] [--size <pixels>]
Parameters:
account_id(required) — The NEAR account address (e.g.alice.near)--output— Output file path (default:<account_id>_qr.png)--size— QR image size in pixels (default:400)
Example:
python near_qr.py address alice.near --output alice_qr.png --size 500
2. Generate Payment QR — near_qr_payment
Generate a QR code for a NEAR payment request, encoding recipient, amount, and optional memo.
Usage:
python near_qr.py payment <to> <amount> [--memo <text>] [--output <path>] [--size <pixels>]
Parameters:
to(required) — Recipient NEAR account (e.g.bob.near)amount(required) — Amount of NEAR to request (e.g.2.5)--memo— Optional memo or reference note--output— Output file path (default:payment_qr.png)--size— QR image size in pixels (default:400)
Example:
python near_qr.py payment bob.near 5.0 --memo "Invoice #42" --output pay_bob.png
3. Read QR Code — near_qr_read
Decode a NEAR QR code from an image file and extract the embedded data.
Usage:
python near_qr.py read <image_path>
Parameters:
image_path(required) — Path to the QR code image
Example:
python near_qr.py read alice_qr.png
Output: Returns a JSON object with the decoded type and data:
{
"type": "near_address",
"account": "alice.near"
}
or for payment QR codes:
{
"type": "near_payment",
"to": "bob.near",
"amount": "5.0",
"memo": "Invoice #42"
}
Overview
Generates and reads NEAR QR codes for addresses and payments. It can encode a NEAR account ID into a QR or create a payment request QR that includes recipient, amount, and optional memo, then decode QR images back into structured data. This supports quick transfers and easy invoice payments on NEAR.
How This Skill Works
The tool uses a Python script near_qr.py with three commands: address to generate a NEAR account QR, payment to encode a transfer request, and read to decode a NEAR QR from an image. It writes address QR images to a default file like <account_id>_qr.png and payment QR images to payment_qr.png, with a default size of 400 pixels; read outputs a JSON object describing the embedded data.
When to Use It
- Share your NEAR address via a printable QR on business cards or invoices
- Request a payment by sending a payment QR to a client or partner
- Print payment QR codes on receipts or invoices for easy scanning
- Scan a colleague's NEAR address from an image to quickly populate address fields
- Create high resolution QR codes for posters or events to accept NEAR payments
Quick Start
- Step 1: Install dependencies via pip install -r requirements.txt
- Step 2: Generate an address QR by running python near_qr.py address alice.near --output alice_qr.png --size 500
- Step 3: Read a QR by running python near_qr.py read alice_qr.png
Best Practices
- Verify the decoded data after reading a QR to ensure the address or payment details are correct
- Specify size and output paths to fit your printing or sharing workflow
- Use unique file names to avoid overwriting existing QR images
- Include clear memos in payment QR codes to avoid confusion for recipients
- Test both address and payment QR generation before deploying in invoices or cards
Example Use Cases
- Generate an address QR for alice.near to print on a business card
- Generate a payment QR for bob.near 5.0 with memo Invoice #42 and output pay_bob.png
- Read aQR image alice_qr.png to retrieve the address data
- Read a payment QR from invoice_payment_qr.png to extract to, amount, and memo
- Create a high resolution address QR for carol.near with size 600 to print on a conference badge