You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wait for payment settlement, LNURL support, --no-wait flag
- `pay` now waits for settlement via SSE (like `invoice create`)
- `pay` accepts LNURL targets alongside Lightning addresses and BOLT11 invoices
- Add `--no-wait` flag to both `pay` and `invoice create` to return immediately
- `invoice create --json` now waits for settlement by default (use --no-wait to skip)
- Upgrade go-sdk to v0.3.0
- Bump version to 0.3.0
Made-with: Cursor
Short: "Send sats to a Lightning address or BOLT11 invoice",
19
+
Use: "pay <target>",
20
+
Short: "Send sats to a Lightning address, LNURL, or BOLT11 invoice",
21
21
Long: `Send sats via the Lightning Network. The target can be:
22
22
23
23
- A Lightning address (user@domain) — requires --amount
24
+
- An LNURL (lnurl1...) — requires --amount
24
25
- A BOLT11 invoice (starts with lnbc/lntb/lnbs) — amount is encoded
25
26
26
-
A confirmation prompt is shown before sending. Use --yes to skip it.`,
27
+
A confirmation prompt is shown before sending. Use --yes to skip it.
28
+
The CLI waits for settlement via SSE. Use --no-wait to return immediately.`,
27
29
Example: ` # Pay a Lightning address
28
30
lnbot pay alice@ln.bot --amount 1000
29
31
30
32
# Pay a BOLT11 invoice (amount is in the invoice)
31
33
lnbot pay lnbc10u1pj9x...
32
34
35
+
# Pay an LNURL
36
+
lnbot pay lnurl1dp68gurn8ghj7... --amount 500
37
+
38
+
# Return immediately without waiting for settlement
39
+
lnbot pay alice@ln.bot --amount 500 --no-wait
40
+
33
41
# Skip the confirmation prompt
34
42
lnbot pay alice@ln.bot --amount 500 --yes`,
35
43
Args: cobra.ExactArgs(1),
@@ -46,22 +54,23 @@ A confirmation prompt is shown before sending. Use --yes to skip it.`,
46
54
strings.HasPrefix(lower, "lntb") ||
47
55
strings.HasPrefix(lower, "lnbs")
48
56
isAddress:=strings.Contains(target, "@")
57
+
isLNURL:=strings.HasPrefix(lower, "lnurl")
49
58
50
59
amount, _:=cmd.Flags().GetInt64("amount")
51
60
maxFee, _:=cmd.Flags().GetInt64("max-fee")
52
61
53
62
ifamount>0 {
54
63
params.Amount=lnbot.Ptr(amount)
55
-
} elseifisAddress {
56
-
returnfmt.Errorf("--amount is required when paying a Lightning address\n\n lnbot pay %s --amount <sats>", target)
64
+
} elseifisAddress||isLNURL{
65
+
returnfmt.Errorf("--amount is required when paying a Lightning address or LNURL\n\n lnbot pay %s --amount <sats>", format.Truncate(target, 40))
57
66
}
58
67
59
68
ifmaxFee>0 {
60
69
params.MaxFee=lnbot.Ptr(maxFee)
61
70
}
62
71
63
-
if!isBolt11&&!isAddress {
64
-
returnfmt.Errorf("unrecognized target: %s\n\nTarget must be a Lightning address (user@domain) or BOLT11 invoice (lnbc...)", format.Truncate(target, 40))
72
+
if!isBolt11&&!isAddress&&!isLNURL{
73
+
returnfmt.Errorf("unrecognized target: %s\n\nTarget must be a Lightning address (user@domain), LNURL (lnurl1...), or BOLT11 invoice (lnbc...)", format.Truncate(target, 40))
65
74
}
66
75
67
76
ln, _, _, err:=cfg.Client(walletFlag)
@@ -84,47 +93,110 @@ A confirmation prompt is shown before sending. Use --yes to skip it.`,
0 commit comments