跳到正文
TakoAPI
返回技能列表

lnget

由 roasbeef 提供

Browser & Automation
781下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Install and use lnget, a Lightning-native HTTP client with automatic L402 payment support.

描述

该技能的功能

lnget is a command-line HTTP client that handles L402 (Lightning HTTP 402) paywalls automatically. When a server responds with a 402 challenge, lnget pays the Lightning invoice and retries the request with the earned token. Tokens are cached per domain to avoid repeated payments on subsequent requests.

Handles the full L402 flow, including parsing the 402 challenge, paying the invoice, caching the token, and retrying, so scripts need no custom payment logic.

何时使用

  • Downloading files from Lightning-paywalled APIs
  • Previewing paywall costs before committing payment
  • Managing and clearing cached L402 tokens per domain
  • Making scripted HTTP requests with automatic micropayment handling
  • Checking Lightning node connection status and wallet balance

示例工作流

输入

User asks: fetch JSON data from an L402-protected endpoint, but only if it costs under 500 satoshis

智能体
  1. 1

    Run lnget --no-pay --json on the target URL to retrieve the 402 challenge details without paying

  2. 2

    Parse the invoice_amount_sat field from the JSON output

  3. 3

    Compare the cost against the 500 sat budget

  4. 4

    Run lnget --max-cost 500 -q to pay and fetch if within budget

  5. 5

    Pipe the response through jq to extract the body field

输出

The API response body is printed to stdout; the paid token is cached at ~/.lnget/tokens/<domain>/ for reuse on future requests

前置要求

  • Access to a Lightning Network node: local lnd instance (with TLS cert and macaroon), LNC pairing phrase, or a neutrino embedded wallet funded with Bitcoin

安装

clawhub install roasbeef/lnget

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接