{"id":48654218,"url":"https://github.com/lnbits/spark_sidecar","last_synced_at":"2026-04-10T09:00:15.721Z","repository":{"id":332696334,"uuid":"1133530282","full_name":"lnbits/spark_sidecar","owner":"lnbits","description":"Simple sidecar for Spark L2","archived":false,"fork":false,"pushed_at":"2026-03-24T08:47:02.000Z","size":276,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T09:00:07.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lnbits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-13T13:27:44.000Z","updated_at":"2026-03-24T08:45:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lnbits/spark_sidecar","commit_stats":null,"previous_names":["lnbits/spark_sidecar"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lnbits/spark_sidecar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Fspark_sidecar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Fspark_sidecar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Fspark_sidecar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Fspark_sidecar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lnbits","download_url":"https://codeload.github.com/lnbits/spark_sidecar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lnbits%2Fspark_sidecar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31635969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-10T09:00:13.842Z","updated_at":"2026-04-10T09:00:15.660Z","avatar_url":"https://github.com/lnbits.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://lnbits.com\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/QE6SIrs.png\"\u003e\n    \u003cimg src=\"https://i.imgur.com/fyKPgVT.png\" alt=\"LNbits\" style=\"width:280px\"\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-success?logo=open-source-initiative\u0026logoColor=white)](./LICENSE)\n[![Built for LNbits](https://img.shields.io/badge/Built%20for-LNbits-4D4DFF?logo=lightning\u0026logoColor=white)](https://github.com/lnbits/lnbits)\n\n# Spark L2 sidecar\n\nThis sidecar exposes a small HTTP API for LNbits to talk to the Spark L2 SDK.\nhttps://www.spark.money/\n\n## Install\n\n```\ngit clone https://github.com/lnbits/spark_sidecar.git\ncd spark_sidecar\nnpm install\n```\n\n## Run\n\n```\nchmod +x server.mjs\n\nSPARK_MNEMONIC=\"bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom\" \\\nSPARK_NETWORK=MAINNET \\\nSPARK_SIDECAR_PORT=8765 \\\nSPARK_PAY_WAIT_MS=20000 \\\nnode server.mjs\n```\n\n**Spark Multiplicity Setting**\n\nOptional multiplicity tuning for [Spark leaf optimization](https://docs.spark.money/api-reference/wallet/initialize#multiplicity-levels)\n\nDefault multiplicity is 3\n\n```\nSPARK_MULTIPLICITY=3\n```\n\n**Optional API Key**\n\n```\nSPARK_SIDECAR_API_KEY=\"mykey\"\n```\n\nSet the same key in LNbits as `SPARK_L2_API_KEY`.\n\nIf you prefer to provide the mnemonic after startup, omit `SPARK_MNEMONIC` and\nPOST it to the sidecar:\n\n```bash\ncurl -X POST http://127.0.0.1:8765/v1/mnemonic \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"mnemonic\":\"bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom\"}'\n```\n\n## Nix (flake)\n\nBuild:\n\n```\nnix build\n```\n\nRun:\n\n```\nSPARK_MNEMONIC=\"bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom bottom\" \\\nSPARK_NETWORK=MAINNET \\\nSPARK_SIDECAR_PORT=8765 \\\nSPARK_PAY_WAIT_MS=20000 \\\nnix run\n```\n\nNotes:\n\n- The flake includes `flake.nix` and `flake.lock`. Commit both.\n- The `result` symlink from `nix build` should not be committed.\n\n## Endpoints\n\n- `POST /v1/mnemonic`\n- `POST /v1/balance`\n- `POST /v1/invoices`\n- `POST /v1/payments`\n- `GET /v1/invoices/stream` (SSE stream of paid Lightning receive requests)\n- `GET /v1/invoices/{id}`\n- `GET /v1/payments/{id}`\n\n### Invoice Stream\n\nThe stream endpoint emits Server-Sent Events when a Lightning invoice is paid.\n\nExample:\n\n```bash\ncurl -N http://127.0.0.1:8765/v1/invoices/stream\n```\n\nEach event payload is a JSON object:\n\n```json\n{\n  \"checking_id\": \"\u003creceive_request_id\u003e\",\n  \"payment_hash\": \"\u003chash\u003e\",\n  \"status\": \"LIGHTNING_PAYMENT_RECEIVED\"\n}\n```\n\nOptional tuning:\n\n- `SPARK_STREAM_KEEPALIVE_MS` (default `15000`)\n- `SPARK_STREAM_HEARTBEAT_MS` (default `30000`)\n- `SPARK_TRANSFER_LOOKUP_CONCURRENCY` (default `20`)\n- `SPARK_TRANSFER_QUEUE_MAX` (default `5000`)\n- `SPARK_INVOICE_POLL_MS` (default `2000`)\n- `SPARK_INVOICE_POLL_LIMIT` (default `100`)\n- `SPARK_INVOICE_CACHE_TTL_MS` (default `3600000`)\n\n## Powered by LNbits\n\n[LNbits](https://lnbits.com) is a free and open-source lightning accounts system.\n\n[![Visit LNbits Shop](https://img.shields.io/badge/Visit-LNbits%20Shop-7C3AED?logo=shopping-cart\u0026logoColor=white\u0026labelColor=5B21B6)](https://shop.lnbits.com/)\n[![Try myLNbits SaaS](https://img.shields.io/badge/Try-myLNbits%20SaaS-2563EB?logo=lightning\u0026logoColor=white\u0026labelColor=1E40AF)](https://my.lnbits.com/login)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnbits%2Fspark_sidecar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flnbits%2Fspark_sidecar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flnbits%2Fspark_sidecar/lists"}