[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75FQK49A0M7AVA9ZS7XFJ6R":3,"skill-same:01M75FQK49A0M7AVA9ZS7XFJ6R":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":58},"01M75FQK49A0M7AVA9ZS7XFJ6R","sparkbtcbot-proxy",null,"Use a Spark Bitcoin L2 wallet proxy for AI agents via HTTP API. Check balances, send payments, create invoices, pay L402 paywalls — all without holding the mnemonic. Use when user mentions \"Spark proxy,\" \"wallet API,\" \"L402,\" \"proxy payment,\" \"bearer token auth,\" or wants secured Bitcoin capabilities for an agent.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fechennells\u002Fsparkbtcbot-proxy\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: sparkbtcbot-proxy\ndescription: Use a Spark Bitcoin L2 wallet proxy for AI agents via HTTP API. Check balances, send payments, create invoices, pay L402 paywalls — all without holding the mnemonic. Use when user mentions \"Spark proxy,\" \"wallet API,\" \"L402,\" \"proxy payment,\" \"bearer token auth,\" or wants secured Bitcoin capabilities for an agent.\nargument-hint: \"[Optional: specify operation - balance, pay, invoice, l402, transfer, or setup]\"\nhomepage: https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy\nsource: https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy\nrequires:\n  env:\n    - name: PROXY_URL\n      description: HTTPS URL of your deployed sparkbtcbot-proxy instance (e.g., https:\u002F\u002Fyour-app.vercel.app)\n      sensitive: false\n    - name: PROXY_TOKEN\n      description: Bearer token for proxy authentication. Create via POST \u002Fapi\u002Ftokens with an admin token. Use least-privilege roles — prefer 'read-only', 'invoice', or 'pay-only' over 'admin' for agents.\n      sensitive: true\nmodel-invocation: autonomous\nmodel-invocation-reason: This skill enables agents to call a wallet proxy API. Autonomous invocation is intentional for payment workflows, but the proxy enforces spending limits and role-based access. Always use least-privilege tokens and set per-tx\u002Fdaily caps on the proxy side.\n---\n\n# Spark Bitcoin L2 Proxy for AI Agents\n\nYou are an expert in using the sparkbtcbot-proxy — a serverless HTTP API that gives AI agents scoped access to a Spark Bitcoin L2 wallet without exposing the private key.\n\n## Why Use the Proxy Instead of Direct SDK\n\n| Concern | Direct SDK (sparkbtcbot-skill) | Proxy (this skill) |\n|---------|-------------------------------|-------------------|\n| Mnemonic location | Agent holds it | Server holds it |\n| Spending limits | None (agent decides) | Per-tx and daily caps |\n| Access revocation | Move funds to new wallet | Revoke bearer token |\n| Role-based access | No | Yes (admin, invoice, pay-only, read-only) |\n| Setup complexity | npm install + mnemonic | HTTP calls + bearer token |\n\n**Use the proxy when:**\n- You don't trust the agent with full wallet control\n- You need spending limits or audit logs\n- You want to revoke access without moving funds\n- Multiple agents share one wallet with different permissions\n\n**Use direct SDK when:**\n- Testing or development\n- Agent needs offline signing\n- You're building the proxy itself\n\n## Before You Start\n\n1. **Deploy your own proxy** — see [sparkbtcbot-proxy](https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy) for setup instructions. The proxy runs on Vercel (free tier works) with Upstash Redis.\n\n2. **Use HTTPS only** — never connect to a proxy over plain HTTP. All Vercel deployments use HTTPS by default.\n\n3. **Create least-privilege tokens** — don't give agents admin tokens. Use the most restrictive role that works:\n   - `read-only` for monitoring\u002Fdashboard agents\n   - `invoice` for agents that receive payments but don't spend\n   - `pay-only` for agents that pay L402 paywalls but don't create invoices\n   - `admin` only for your own management scripts\n\n4. **Set spending limits** — configure `maxTxSats` and `dailyBudgetSats` when creating tokens. The proxy enforces these server-side.\n\n5. **Test with small amounts** — start with a few hundred sats until you trust your agent's behavior.\n\n6. **Have a revocation plan** — know how to revoke tokens via `DELETE \u002Fapi\u002Ftokens` if an agent is compromised.\n\n## Token Roles\n\n| Role | Permissions |\n|------|-------------|\n| `admin` | Full access: read, create invoices, pay, transfer, manage tokens |\n| `invoice` | Read + create invoices. Cannot pay or transfer. |\n| `pay-only` | Read + pay invoices and L402. Cannot create invoices or transfer. |\n| `read-only` | Read only (balance, info, transactions, logs). Cannot pay or create invoices. |\n\n## Base URL\n\nThe proxy runs on Vercel. Your base URL will look like:\n```\nhttps:\u002F\u002Fyour-deployment.vercel.app\n```\n\nAll requests require authentication:\n```\nAuthorization: Bearer \u003Cyour-token>\n```\n\n## API Reference\n\n### Read Operations (any role)\n\n#### Get Balance\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Fbalance\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"balance\": \"50000\",\n    \"tokenBalances\": {\n      \"btkn1...\": {\n        \"balance\": \"1000\",\n        \"tokenMetadata\": {\n          \"tokenName\": \"Example Token\",\n          \"tokenTicker\": \"EXT\",\n          \"decimals\": 0\n        }\n      }\n    }\n  }\n}\n```\n\n#### Get Wallet Info\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Finfo\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sparkAddress\": \"sp1p...\",\n    \"identityPublicKey\": \"02abc...\"\n  }\n}\n```\n\n#### Get Deposit Address (L1 Bitcoin)\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Fdeposit-address\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"address\": \"bc1p...\"\n  }\n}\n```\n\n#### Get Transaction History\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Ftransactions?limit=10&offset=0\"\n```\n\n#### Get Fee Estimate\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Ffee-estimate?invoice=lnbc...\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"feeSats\": 5\n  }\n}\n```\n\n#### Get Activity Logs\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Flogs?limit=20\"\n```\n\n### Invoice Operations (admin or invoice role)\n\n#### Create Lightning Invoice (BOLT11)\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"amountSats\": 1000, \"memo\": \"Payment for service\", \"expirySeconds\": 3600}' \\\n  \"$PROXY_URL\u002Fapi\u002Finvoice\u002Fcreate\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"encodedInvoice\": \"lnbc10u1p...\"\n  }\n}\n```\n\n#### Create Spark Invoice\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"amount\": 1000, \"memo\": \"Spark payment\"}' \\\n  \"$PROXY_URL\u002Fapi\u002Finvoice\u002Fspark\"\n```\n\n### Payment Operations (admin or pay-only role)\n\n#### Pay Lightning Invoice\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invoice\": \"lnbc10u1p...\", \"maxFeeSats\": 10}' \\\n  \"$PROXY_URL\u002Fapi\u002Fpay\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": \"payment-id-123\",\n    \"status\": \"LIGHTNING_PAYMENT_SUCCEEDED\",\n    \"paymentPreimage\": \"abc123...\"\n  }\n}\n```\n\n#### Transfer to Spark Address\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"receiverSparkAddress\": \"sp1p...\", \"amountSats\": 1000}' \\\n  \"$PROXY_URL\u002Fapi\u002Ftransfer\"\n```\n\n### L402 Paywall Operations (admin or pay-only role)\n\nL402 lets you pay for API access with Lightning. The proxy handles the full flow automatically.\n\n#### Pay L402 and Fetch Content\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Flightningfaucet.com\u002Fapi\u002Fl402\u002Fjoke\", \"maxFeeSats\": 50}' \\\n  \"$PROXY_URL\u002Fapi\u002Fl402\"\n```\n\nResponse (immediate success):\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"status\": 200,\n    \"paid\": true,\n    \"priceSats\": 21,\n    \"preimage\": \"be2ebe7c...\",\n    \"data\": {\"setup\": \"Why do programmers...\", \"punchline\": \"...\"}\n  }\n}\n```\n\nResponse (cached token reused):\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"status\": 200,\n    \"paid\": false,\n    \"cached\": true,\n    \"data\": {\"setup\": \"...\", \"punchline\": \"...\"}\n  }\n}\n```\n\n#### Preview L402 Cost (any role)\n\nCheck what an L402 resource costs without paying:\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Flightningfaucet.com\u002Fapi\u002Fl402\u002Fjoke\"}' \\\n  \"$PROXY_URL\u002Fapi\u002Fl402\u002Fpreview\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"requires_payment\": true,\n    \"invoice_amount_sats\": 21,\n    \"invoice\": \"lnbc210n1p...\",\n    \"macaroon\": \"AgELbGlnaHRuaW5n...\"\n  }\n}\n```\n\n#### Handling Pending L402 Payments (IMPORTANT)\n\nLightning payments are asynchronous. If the preimage isn't available within ~7.5 seconds, the proxy returns a pending status:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"status\": \"pending\",\n    \"pendingId\": \"a1b2c3d4...\",\n    \"message\": \"Payment sent but preimage not yet available. Poll GET \u002Fapi\u002Fl402\u002Fstatus?id=\u003CpendingId> to complete.\",\n    \"priceSats\": 21\n  }\n}\n```\n\n**You MUST handle this case.** The payment has been sent — if you don't poll, you lose sats without getting content.\n\nPoll for completion:\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Fl402\u002Fstatus?id=a1b2c3d4...\"\n```\n\n**Recommended retry logic:**\n\n```javascript\nasync function fetchL402(proxyUrl, token, targetUrl, maxFeeSats = 50) {\n  const response = await fetch(`${proxyUrl}\u002Fapi\u002Fl402`, {\n    method: 'POST',\n    headers: {\n      'Authorization': `Bearer ${token}`,\n      'Content-Type': 'application\u002Fjson',\n    },\n    body: JSON.stringify({ url: targetUrl, maxFeeSats }),\n  });\n\n  const result = await response.json();\n\n  if (result.data?.status === 'pending') {\n    const pendingId = result.data.pendingId;\n    for (let i = 0; i \u003C 10; i++) {\n      await new Promise(r => setTimeout(r, 3000));\n      const statusResponse = await fetch(\n        `${proxyUrl}\u002Fapi\u002Fl402\u002Fstatus?id=${pendingId}`,\n        { headers: { 'Authorization': `Bearer ${token}` } }\n      );\n      const statusResult = await statusResponse.json();\n      if (statusResult.data?.status !== 'pending') {\n        return statusResult;\n      }\n    }\n    throw new Error('L402 payment timed out');\n  }\n\n  return result;\n}\n```\n\n### Token Management (admin role only)\n\n#### List Tokens\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Ftokens\"\n```\n\n#### Create Token\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"role\": \"invoice\", \"label\": \"merchant-bot\", \"maxTxSats\": 5000, \"dailyBudgetSats\": 50000}' \\\n  \"$PROXY_URL\u002Fapi\u002Ftokens\"\n```\n\nResponse includes the full token string — save it, shown only once:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"token\": \"sbp_abc123...\",\n    \"role\": \"invoice\",\n    \"label\": \"merchant-bot\"\n  }\n}\n```\n\n#### Revoke Token\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"token\": \"sbp_abc123...\"}' \\\n  \"$PROXY_URL\u002Fapi\u002Ftokens\"\n```\n\n## Complete Agent Class (JavaScript)\n\n```javascript\nexport class SparkProxyAgent {\n  #baseUrl;\n  #token;\n\n  constructor(baseUrl, token) {\n    this.#baseUrl = baseUrl.replace(\u002F\\\u002F$\u002F, '');\n    this.#token = token;\n  }\n\n  async #request(method, path, body = null) {\n    const options = {\n      method,\n      headers: {\n        'Authorization': `Bearer ${this.#token}`,\n        'Content-Type': 'application\u002Fjson',\n      },\n    };\n    if (body) {\n      options.body = JSON.stringify(body);\n    }\n\n    const response = await fetch(`${this.#baseUrl}${path}`, options);\n    const result = await response.json();\n\n    if (!result.success) {\n      throw new Error(result.error || 'Request failed');\n    }\n    return result.data;\n  }\n\n  async getBalance() {\n    return this.#request('GET', '\u002Fapi\u002Fbalance');\n  }\n\n  async getInfo() {\n    return this.#request('GET', '\u002Fapi\u002Finfo');\n  }\n\n  async getDepositAddress() {\n    return this.#request('GET', '\u002Fapi\u002Fdeposit-address');\n  }\n\n  async getTransactions(limit = 10, offset = 0) {\n    return this.#request('GET', `\u002Fapi\u002Ftransactions?limit=${limit}&offset=${offset}`);\n  }\n\n  async getFeeEstimate(invoice) {\n    return this.#request('GET', `\u002Fapi\u002Ffee-estimate?invoice=${encodeURIComponent(invoice)}`);\n  }\n\n  async createLightningInvoice(amountSats, memo = '', expirySeconds = 3600) {\n    return this.#request('POST', '\u002Fapi\u002Finvoice\u002Fcreate', {\n      amountSats,\n      memo,\n      expirySeconds,\n    });\n  }\n\n  async createSparkInvoice(amount, memo = '') {\n    return this.#request('POST', '\u002Fapi\u002Finvoice\u002Fspark', { amount, memo });\n  }\n\n  async payLightningInvoice(invoice, maxFeeSats = 10) {\n    return this.#request('POST', '\u002Fapi\u002Fpay', { invoice, maxFeeSats });\n  }\n\n  async transfer(receiverSparkAddress, amountSats) {\n    return this.#request('POST', '\u002Fapi\u002Ftransfer', {\n      receiverSparkAddress,\n      amountSats,\n    });\n  }\n\n  async previewL402(url) {\n    return this.#request('POST', '\u002Fapi\u002Fl402\u002Fpreview', { url });\n  }\n\n  async fetchL402(url, options = {}) {\n    const { method = 'GET', headers = {}, body, maxFeeSats = 50 } = options;\n\n    const result = await this.#request('POST', '\u002Fapi\u002Fl402', {\n      url,\n      method,\n      headers,\n      body,\n      maxFeeSats,\n    });\n\n    \u002F\u002F Handle pending status with polling\n    if (result.status === 'pending') {\n      const pendingId = result.pendingId;\n      for (let i = 0; i \u003C 10; i++) {\n        await new Promise(r => setTimeout(r, 3000));\n        const status = await this.#request('GET', `\u002Fapi\u002Fl402\u002Fstatus?id=${pendingId}`);\n        if (status.status !== 'pending') {\n          return status;\n        }\n      }\n      throw new Error('L402 payment timed out');\n    }\n\n    return result;\n  }\n}\n\n\u002F\u002F Usage\nconst agent = new SparkProxyAgent(\n  process.env.PROXY_URL,\n  process.env.PROXY_TOKEN\n);\n\nconst balance = await agent.getBalance();\nconsole.log('Balance:', balance.balance, 'sats');\n\nconst invoice = await agent.createLightningInvoice(1000, 'Test payment');\nconsole.log('Invoice:', invoice.encodedInvoice);\n\nconst l402Result = await agent.fetchL402('https:\u002F\u002Flightningfaucet.com\u002Fapi\u002Fl402\u002Fjoke');\nconsole.log('Joke:', l402Result.data);\n```\n\n## Environment Variables for Agent\n\n```\nPROXY_URL=https:\u002F\u002Fyour-deployment.vercel.app\nPROXY_TOKEN=sbp_your_token_here\n```\n\n## Error Handling\n\nAll errors return:\n```json\n{\n  \"success\": false,\n  \"error\": \"Error message here\"\n}\n```\n\nCommon errors:\n- **401 Unauthorized** — Invalid or missing bearer token\n- **403 Forbidden** — Token role doesn't permit this operation\n- **400 Bad Request** — Missing required parameters\n- **429 Too Many Requests** — Daily budget exceeded\n- **500 Internal Server Error** — Spark SDK or server error\n\n## Spending Limits\n\nThe proxy enforces two types of limits:\n\n1. **Global limits** (from env vars):\n   - `MAX_TRANSACTION_SATS` — per-transaction cap\n   - `DAILY_BUDGET_SATS` — daily total cap (resets midnight UTC)\n\n2. **Per-token limits** (set when creating token):\n   - `maxTxSats` — per-transaction cap for this token\n   - `dailyBudgetSats` — daily cap for this token\n\nThe lower of global and per-token limits applies.\n\n## Security Notes\n\n1. **Treat bearer tokens like passwords** — they grant wallet access up to their role\n2. **Use the most restrictive role possible** — if an agent only creates invoices, use `invoice` role\n3. **Set per-token spending limits** — don't rely solely on global limits\n4. **Monitor logs** — check `\u002Fapi\u002Flogs` for unexpected activity\n5. **Revoke compromised tokens immediately** — no need to move funds\n\n## Resources\n\n- Proxy repo: https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy\n- Direct SDK skill: https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-skill\n- Spark docs: https:\u002F\u002Fdocs.spark.money\n- L402 spec: https:\u002F\u002Fdocs.lightning.engineering\u002Fthe-lightning-network\u002Fl402\n","# Spark Bitcoin L2 Proxy for AI Agents\n\nYou are an expert in using the sparkbtcbot-proxy — a serverless HTTP API that gives AI agents scoped access to a Spark Bitcoin L2 wallet without exposing the private key.\n\n## Why Use the Proxy Instead of Direct SDK\n\n| Concern | Direct SDK (sparkbtcbot-skill) | Proxy (this skill) |\n|---------|-------------------------------|-------------------|\n| Mnemonic location | Agent holds it | Server holds it |\n| Spending limits | None (agent decides) | Per-tx and daily caps |\n| Access revocation | Move funds to new wallet | Revoke bearer token |\n| Role-based access | No | Yes (admin, invoice, pay-only, read-only) |\n| Setup complexity | npm install + mnemonic | HTTP calls + bearer token |\n\n**Use the proxy when:**\n- You don't trust the agent with full wallet control\n- You need spending limits or audit logs\n- You want to revoke access without moving funds\n- Multiple agents share one wallet with different permissions\n\n**Use direct SDK when:**\n- Testing or development\n- Agent needs offline signing\n- You're building the proxy itself\n\n## Before You Start\n\n1. **Deploy your own proxy** — see [sparkbtcbot-proxy](https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy) for setup instructions. The proxy runs on Vercel (free tier works) with Upstash Redis.\n\n2. **Use HTTPS only** — never connect to a proxy over plain HTTP. All Vercel deployments use HTTPS by default.\n\n3. **Create least-privilege tokens** — don't give agents admin tokens. Use the most restrictive role that works:\n   - `read-only` for monitoring\u002Fdashboard agents\n   - `invoice` for agents that receive payments but don't spend\n   - `pay-only` for agents that pay L402 paywalls but don't create invoices\n   - `admin` only for your own management scripts\n\n4. **Set spending limits** — configure `maxTxSats` and `dailyBudgetSats` when creating tokens. The proxy enforces these server-side.\n\n5. **Test with small amounts** — start with a few hundred sats until you trust your agent's behavior.\n\n6. **Have a revocation plan** — know how to revoke tokens via `DELETE \u002Fapi\u002Ftokens` if an agent is compromised.\n\n## Token Roles\n\n| Role | Permissions |\n|------|-------------|\n| `admin` | Full access: read, create invoices, pay, transfer, manage tokens |\n| `invoice` | Read + create invoices. Cannot pay or transfer. |\n| `pay-only` | Read + pay invoices and L402. Cannot create invoices or transfer. |\n| `read-only` | Read only (balance, info, transactions, logs). Cannot pay or create invoices. |\n\n## Base URL\n\nThe proxy runs on Vercel. Your base URL will look like:\n```\nhttps:\u002F\u002Fyour-deployment.vercel.app\n```\n\nAll requests require authentication:\n```\nAuthorization: Bearer \u003Cyour-token>\n```\n\n## API Reference\n\n### Read Operations (any role)\n\n#### Get Balance\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Fbalance\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"balance\": \"50000\",\n    \"tokenBalances\": {\n      \"btkn1...\": {\n        \"balance\": \"1000\",\n        \"tokenMetadata\": {\n          \"tokenName\": \"Example Token\",\n          \"tokenTicker\": \"EXT\",\n          \"decimals\": 0\n        }\n      }\n    }\n  }\n}\n```\n\n#### Get Wallet Info\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Finfo\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"sparkAddress\": \"sp1p...\",\n    \"identityPublicKey\": \"02abc...\"\n  }\n}\n```\n\n#### Get Deposit Address (L1 Bitcoin)\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Fdeposit-address\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"address\": \"bc1p...\"\n  }\n}\n```\n\n#### Get Transaction History\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Ftransactions?limit=10&offset=0\"\n```\n\n#### Get Fee Estimate\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Ffee-estimate?invoice=lnbc...\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"feeSats\": 5\n  }\n}\n```\n\n#### Get Activity Logs\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Flogs?limit=20\"\n```\n\n### Invoice Operations (admin or invoice role)\n\n#### Create Lightning Invoice (BOLT11)\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"amountSats\": 1000, \"memo\": \"Payment for service\", \"expirySeconds\": 3600}' \\\n  \"$PROXY_URL\u002Fapi\u002Finvoice\u002Fcreate\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"encodedInvoice\": \"lnbc10u1p...\"\n  }\n}\n```\n\n#### Create Spark Invoice\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"amount\": 1000, \"memo\": \"Spark payment\"}' \\\n  \"$PROXY_URL\u002Fapi\u002Finvoice\u002Fspark\"\n```\n\n### Payment Operations (admin or pay-only role)\n\n#### Pay Lightning Invoice\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invoice\": \"lnbc10u1p...\", \"maxFeeSats\": 10}' \\\n  \"$PROXY_URL\u002Fapi\u002Fpay\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": \"payment-id-123\",\n    \"status\": \"LIGHTNING_PAYMENT_SUCCEEDED\",\n    \"paymentPreimage\": \"abc123...\"\n  }\n}\n```\n\n#### Transfer to Spark Address\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"receiverSparkAddress\": \"sp1p...\", \"amountSats\": 1000}' \\\n  \"$PROXY_URL\u002Fapi\u002Ftransfer\"\n```\n\n### L402 Paywall Operations (admin or pay-only role)\n\nL402 lets you pay for API access with Lightning. The proxy handles the full flow automatically.\n\n#### Pay L402 and Fetch Content\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Flightningfaucet.com\u002Fapi\u002Fl402\u002Fjoke\", \"maxFeeSats\": 50}' \\\n  \"$PROXY_URL\u002Fapi\u002Fl402\"\n```\n\nResponse (immediate success):\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"status\": 200,\n    \"paid\": true,\n    \"priceSats\": 21,\n    \"preimage\": \"be2ebe7c...\",\n    \"data\": {\"setup\": \"Why do programmers...\", \"punchline\": \"...\"}\n  }\n}\n```\n\nResponse (cached token reused):\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"status\": 200,\n    \"paid\": false,\n    \"cached\": true,\n    \"data\": {\"setup\": \"...\", \"punchline\": \"...\"}\n  }\n}\n```\n\n#### Preview L402 Cost (any role)\n\nCheck what an L402 resource costs without paying:\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Flightningfaucet.com\u002Fapi\u002Fl402\u002Fjoke\"}' \\\n  \"$PROXY_URL\u002Fapi\u002Fl402\u002Fpreview\"\n```\n\nResponse:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"requires_payment\": true,\n    \"invoice_amount_sats\": 21,\n    \"invoice\": \"lnbc210n1p...\",\n    \"macaroon\": \"AgELbGlnaHRuaW5n...\"\n  }\n}\n```\n\n#### Handling Pending L402 Payments (IMPORTANT)\n\nLightning payments are asynchronous. If the preimage isn't available within ~7.5 seconds, the proxy returns a pending status:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"status\": \"pending\",\n    \"pendingId\": \"a1b2c3d4...\",\n    \"message\": \"Payment sent but preimage not yet available. Poll GET \u002Fapi\u002Fl402\u002Fstatus?id=\u003CpendingId> to complete.\",\n    \"priceSats\": 21\n  }\n}\n```\n\n**You MUST handle this case.** The payment has been sent — if you don't poll, you lose sats without getting content.\n\nPoll for completion:\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Fl402\u002Fstatus?id=a1b2c3d4...\"\n```\n\n**Recommended retry logic:**\n\n```javascript\nasync function fetchL402(proxyUrl, token, targetUrl, maxFeeSats = 50) {\n  const response = await fetch(`${proxyUrl}\u002Fapi\u002Fl402`, {\n    method: 'POST',\n    headers: {\n      'Authorization': `Bearer ${token}`,\n      'Content-Type': 'application\u002Fjson',\n    },\n    body: JSON.stringify({ url: targetUrl, maxFeeSats }),\n  });\n\n  const result = await response.json();\n\n  if (result.data?.status === 'pending') {\n    const pendingId = result.data.pendingId;\n    for (let i = 0; i \u003C 10; i++) {\n      await new Promise(r => setTimeout(r, 3000));\n      const statusResponse = await fetch(\n        `${proxyUrl}\u002Fapi\u002Fl402\u002Fstatus?id=${pendingId}`,\n        { headers: { 'Authorization': `Bearer ${token}` } }\n      );\n      const statusResult = await statusResponse.json();\n      if (statusResult.data?.status !== 'pending') {\n        return statusResult;\n      }\n    }\n    throw new Error('L402 payment timed out');\n  }\n\n  return result;\n}\n```\n\n### Token Management (admin role only)\n\n#### List Tokens\n\n```bash\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  \"$PROXY_URL\u002Fapi\u002Ftokens\"\n```\n\n#### Create Token\n\n```bash\ncurl -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"role\": \"invoice\", \"label\": \"merchant-bot\", \"maxTxSats\": 5000, \"dailyBudgetSats\": 50000}' \\\n  \"$PROXY_URL\u002Fapi\u002Ftokens\"\n```\n\nResponse includes the full token string — save it, shown only once:\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"token\": \"sbp_abc123...\",\n    \"role\": \"invoice\",\n    \"label\": \"merchant-bot\"\n  }\n}\n```\n\n#### Revoke Token\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"token\": \"sbp_abc123...\"}' \\\n  \"$PROXY_URL\u002Fapi\u002Ftokens\"\n```\n\n## Complete Agent Class (JavaScript)\n\n```javascript\nexport class SparkProxyAgent {\n  #baseUrl;\n  #token;\n\n  constructor(baseUrl, token) {\n    this.#baseUrl = baseUrl.replace(\u002F\\\u002F$\u002F, '');\n    this.#token = token;\n  }\n\n  async #request(method, path, body = null) {\n    const options = {\n      method,\n      headers: {\n        'Authorization': `Bearer ${this.#token}`,\n        'Content-Type': 'application\u002Fjson',\n      },\n    };\n    if (body) {\n      options.body = JSON.stringify(body);\n    }\n\n    const response = await fetch(`${this.#baseUrl}${path}`, options);\n    const result = await response.json();\n\n    if (!result.success) {\n      throw new Error(result.error || 'Request failed');\n    }\n    return result.data;\n  }\n\n  async getBalance() {\n    return this.#request('GET', '\u002Fapi\u002Fbalance');\n  }\n\n  async getInfo() {\n    return this.#request('GET', '\u002Fapi\u002Finfo');\n  }\n\n  async getDepositAddress() {\n    return this.#request('GET', '\u002Fapi\u002Fdeposit-address');\n  }\n\n  async getTransactions(limit = 10, offset = 0) {\n    return this.#request('GET', `\u002Fapi\u002Ftransactions?limit=${limit}&offset=${offset}`);\n  }\n\n  async getFeeEstimate(invoice) {\n    return this.#request('GET', `\u002Fapi\u002Ffee-estimate?invoice=${encodeURIComponent(invoice)}`);\n  }\n\n  async createLightningInvoice(amountSats, memo = '', expirySeconds = 3600) {\n    return this.#request('POST', '\u002Fapi\u002Finvoice\u002Fcreate', {\n      amountSats,\n      memo,\n      expirySeconds,\n    });\n  }\n\n  async createSparkInvoice(amount, memo = '') {\n    return this.#request('POST', '\u002Fapi\u002Finvoice\u002Fspark', { amount, memo });\n  }\n\n  async payLightningInvoice(invoice, maxFeeSats = 10) {\n    return this.#request('POST', '\u002Fapi\u002Fpay', { invoice, maxFeeSats });\n  }\n\n  async transfer(receiverSparkAddress, amountSats) {\n    return this.#request('POST', '\u002Fapi\u002Ftransfer', {\n      receiverSparkAddress,\n      amountSats,\n    });\n  }\n\n  async previewL402(url) {\n    return this.#request('POST', '\u002Fapi\u002Fl402\u002Fpreview', { url });\n  }\n\n  async fetchL402(url, options = {}) {\n    const { method = 'GET', headers = {}, body, maxFeeSats = 50 } = options;\n\n    const result = await this.#request('POST', '\u002Fapi\u002Fl402', {\n      url,\n      method,\n      headers,\n      body,\n      maxFeeSats,\n    });\n\n    \u002F\u002F Handle pending status with polling\n    if (result.status === 'pending') {\n      const pendingId = result.pendingId;\n      for (let i = 0; i \u003C 10; i++) {\n        await new Promise(r => setTimeout(r, 3000));\n        const status = await this.#request('GET', `\u002Fapi\u002Fl402\u002Fstatus?id=${pendingId}`);\n        if (status.status !== 'pending') {\n          return status;\n        }\n      }\n      throw new Error('L402 payment timed out');\n    }\n\n    return result;\n  }\n}\n\n\u002F\u002F Usage\nconst agent = new SparkProxyAgent(\n  process.env.PROXY_URL,\n  process.env.PROXY_TOKEN\n);\n\nconst balance = await agent.getBalance();\nconsole.log('Balance:', balance.balance, 'sats');\n\nconst invoice = await agent.createLightningInvoice(1000, 'Test payment');\nconsole.log('Invoice:', invoice.encodedInvoice);\n\nconst l402Result = await agent.fetchL402('https:\u002F\u002Flightningfaucet.com\u002Fapi\u002Fl402\u002Fjoke');\nconsole.log('Joke:', l402Result.data);\n```\n\n## Environment Variables for Agent\n\n```\nPROXY_URL=https:\u002F\u002Fyour-deployment.vercel.app\nPROXY_TOKEN=sbp_your_token_here\n```\n\n## Error Handling\n\nAll errors return:\n```json\n{\n  \"success\": false,\n  \"error\": \"Error message here\"\n}\n```\n\nCommon errors:\n- **401 Unauthorized** — Invalid or missing bearer token\n- **403 Forbidden** — Token role doesn't permit this operation\n- **400 Bad Request** — Missing required parameters\n- **429 Too Many Requests** — Daily budget exceeded\n- **500 Internal Server Error** — Spark SDK or server error\n\n## Spending Limits\n\nThe proxy enforces two types of limits:\n\n1. **Global limits** (from env vars):\n   - `MAX_TRANSACTION_SATS` — per-transaction cap\n   - `DAILY_BUDGET_SATS` — daily total cap (resets midnight UTC)\n\n2. **Per-token limits** (set when creating token):\n   - `maxTxSats` — per-transaction cap for this token\n   - `dailyBudgetSats` — daily cap for this token\n\nThe lower of global and per-token limits applies.\n\n## Security Notes\n\n1. **Treat bearer tokens like passwords** — they grant wallet access up to their role\n2. **Use the most restrictive role possible** — if an agent only creates invoices, use `invoice` role\n3. **Set per-token spending limits** — don't rely solely on global limits\n4. **Monitor logs** — check `\u002Fapi\u002Flogs` for unexpected activity\n5. **Revoke compromised tokens immediately** — no need to move funds\n\n## Resources\n\n- Proxy repo: https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy\n- Direct SDK skill: https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-skill\n- Spark docs: https:\u002F\u002Fdocs.spark.money\n- L402 spec: https:\u002F\u002Fdocs.lightning.engineering\u002Fthe-lightning-network\u002Fl402\n",{"name":5,"source":24,"homepage":24,"requires":25,"description":7,"argument-hint":34,"model-invocation":35,"model-invocation-reason":36},"https:\u002F\u002Fgithub.com\u002Fechennells\u002Fsparkbtcbot-proxy",{"env":26},[27,30],{"name":28,"sensitive":20,"description":29},"PROXY_URL","HTTPS URL of your deployed sparkbtcbot-proxy instance (e.g., https:\u002F\u002Fyour-app.vercel.app)",{"name":31,"sensitive":32,"description":33},"PROXY_TOKEN",true,"Bearer token for proxy authentication. Create via POST \u002Fapi\u002Ftokens with an admin token. Use least-privilege roles — prefer 'read-only', 'invoice', or 'pay-only' over 'admin' for agents.","[Optional: specify operation - balance, pay, invoice, l402, transfer, or setup]","autonomous","This skill enables agents to call a wallet proxy API. Autonomous invocation is intentional for payment workflows, but the proxy enforces spending limits and role-based access. Always use least-privilege tokens and set per-tx\u002Fdaily caps on the proxy side.","main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fechennells\u002Fsparkbtcbot-proxy",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":32},[48,51,54],{"tool":49,"command":50},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill sparkbtcbot-proxy",{"tool":52,"command":53},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill sparkbtcbot-proxy",{"tool":55,"command":56},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill sparkbtcbot-proxy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fechennells\u002Fsparkbtcbot-proxy\u002FSKILL.md",[],[60,68,75,82,89,96],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":67},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":67},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":67},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":67},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":67},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":67},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]