A sample service that pushes a phone notification when a Bitcoin Lightning
payment is received in an Arkade-enabled wallet, built on the official
@arkade-os/sdk and @arkade-os/boltz-swap packages.
Receiving Lightning uses a Boltz reverse submarine swap; the wallet registers
each invoice's pending swap per-payment (opt-in, privacy-friendly), and the
service notifies when it reaches invoice.settled.
- swapWatcher.ts: monitor-only @arkade-os/boltz-swap SwapManager
(enableAutoActions: false) — needs no wallet keys. SwapManager owns the
multiplexed Boltz websocket, polling fallback, and reconnect/backoff.
- paymentService.ts: wires SwapManager events to pushes via
isReverseSuccessStatus (invoice.settled).
- registry.ts: persisted swapId -> {topic, swap} map, resubscribed on restart;
the wallet may redact the preimage since monitoring never claims.
- notifier/: pluggable Notifier interface with an ntfy.sh implementation.
- server.ts: POST/GET/DELETE /register, /health, /simulate (Fastify + zod).
- scripts/demo-receive.ts: wallet side — creates an invoice via
ArkadeSwaps.createLightningInvoice and registers the swap (no raw REST).
- Tests: registry persistence, plus a component test driving the REAL
SwapManager with a mocked globalThis.WebSocket through
register -> settle -> push.
https://claude.ai/code/session_018HhVgswGG7LynM25qTpejq
22 lines
556 B
JSON
22 lines
556 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2022",
|
|
"module": "NodeNext",
|
|
"moduleResolution": "NodeNext",
|
|
"lib": ["ES2022"],
|
|
"outDir": "dist",
|
|
"rootDir": ".",
|
|
"strict": true,
|
|
"esModuleInterop": true,
|
|
"skipLibCheck": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"resolveJsonModule": true,
|
|
"declaration": false,
|
|
"sourceMap": true,
|
|
"noUncheckedIndexedAccess": true,
|
|
"noImplicitOverride": true
|
|
},
|
|
"include": ["src/**/*.ts", "scripts/**/*.ts", "test/**/*.ts"],
|
|
"exclude": ["node_modules", "dist"]
|
|
}
|