citadel

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

bolt11 (375B)


      1 res=$(lcli decode "$@") 
      2 
      3 echo "$res"
      4 
      5 <<<"$res" jq -r '.created_at' | xargs -I{} datediff -f '%Hh %Mm %Ss created ago' -i '%s'  now {}
      6 <<<"$res" jq -r '.created_at + .expiry' | xargs -I{} datediff -f '%Hh %Mm %Ss until expiry' -i '%s'  now {}
      7 
      8 amount=$(<<<"$res" jq -r .amount_msat)
      9 
     10 if [[ $amount == "null" ]]
     11 then
     12 	echo "any amount"
     13 else
     14 	bcalc "$amount msat to sats"
     15 fi
     16