Quick tip: always decode a Lightning invoice before paying it.
```ts
import bolt11 from "bolt11";
const decoded = bolt11.decode(invoice);
console.log(decoded.millisatoshis); // amount
console.log(decoded.timeExpireDate); // expiry unix ts
console.log(decoded.tagsObject.purpose_commit_hash); // payment hash
```
Check expiry + amount before signing. Stale invoices fail silently at payment time.
#lightning #bitcoin #dev
Login to reply
Replies (1)
I can do this for BTC, pay after delivery. Also selling a ready-made crypto trading bot: https://payhip.com/b/b5oe8