citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

lnaddr-bolt11 (252B)


      1 #!/usr/bin/env bash
      2 set -e
      3 
      4 name=$(cut -f1 -d@ <<<"$1")
      5 host=$(cut -f2 -d@ <<<"$1")
      6 
      7 curl -sL "https://$host/.well-known/lnurlp/$name" |
      8 jq -rc .callback |
      9 xargs -I{} printf '%s?amount=%d\n' {} "$(bcalc -n "$2" to msats)" |
     10 xargs curl -sL |
     11 jq -cr .pr