feat(cli): zap --with <ndebit> settles the invoice via CLINK debit

amy zap printed the invoice but never paid it. With --with <ndebit> it now
settles the fetched BOLT-11 in-place through a CLINK debit pointer (kind-21002,
reusing DebitCommands.settle), mirroring how the app routes a zap through its
default payment source. Works for both single-recipient (zap user) and
split zaps (zap event) — each recipient reports paid + preimage (or pay_error).

Adds a --with validation case to the headless harness; 16/16 pass.

https://claude.ai/code/session_01NM2TyJtosLdY5ycjyabSRS
This commit is contained in:
Claude
2026-06-10 21:27:36 +00:00
parent e77658c292
commit 2635bd90a5
2 changed files with 72 additions and 11 deletions
+8
View File
@@ -138,3 +138,11 @@ if amy_a profile edit --clink-offer "not-a-noffer" >>"$LOG_FILE" 2>&1; then
else
record_result profile.clinkoffer.bad pass "bad --clink-offer exits non-zero"
fi
# --- zap --with: rejects a non-ndebit funding pointer (validated before any network) ---
step "zap user rejects a non-ndebit --with"
if amy_a zap user "$EXPECTED_PUB" 1000 --with "not-an-ndebit" >>"$LOG_FILE" 2>&1; then
record_result zap.with.bad fail "bad --with should exit non-zero"
else
record_result zap.with.bad pass "bad --with exits non-zero"
fi