commit 691ff054edbe896b52594070d1109980288729b9 parent e1fd63ea27937b81e09e8bdb7ad8627e458263a9 Author: William Casarin <jb55@jb55.com> Date: Sun, 28 Jan 2024 12:44:50 -0800 add lnurl utils Diffstat:
A | bin/lnaddr-bolt11 | | | 11 | +++++++++++ |
A | bin/lnurl-bolt11 | | | 8 | ++++++++ |
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/bin/lnaddr-bolt11 b/bin/lnaddr-bolt11 @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e + +name=$(cut -f1 -d@ <<<"$1") +host=$(cut -f2 -d@ <<<"$1") + +curl -sL "https://$host/.well-known/lnurlp/$name" | +jq -rc .callback | +xargs -I{} printf '%s?amount=%d\n' {} "$(bcalc -n "$2" to msats)" | +xargs curl -sL | +jq -cr .pr diff --git a/bin/lnurl-bolt11 b/bin/lnurl-bolt11 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +curl -sL $(bech32 -d "$1") | +jq -rc .callback | +xargs -I{} printf '%s?amount=%d\n' {} "$(bcalc -n "$2" to msats)" | +xargs curl -sL | +jq -cr .pr