Skip to content

Instantly share code, notes, and snippets.

let bitpostInterface: BitpostInterfaceForBitcoinJS = new BitpostInterfaceForBitcoinJS({testnet: true})
let bitpostRequest:BitpostRequest=bitpostInterface.createBitpostRequest(['a', 'b'], 1604188800, 0)
let response = bitpostRequest.sendRequest()
@pedr0-fr
pedr0-fr / lndecode.html
Created June 5, 2019 14:39
Decode lightning invoice courtesy of /u/kinoshitajona
<html>
<input id="text" type="text"></input>
<button onclick="decode()">Decode</button>
<div id="output"></div>
<script>
function decode() {
const el = document.getElementById('text')
const out = document.getElementById('output')
const decoded = JSON.stringify(bolt11.decode(el.value), null, 8)
console.log(decoded)
This file has been truncated, but you can view the full file.
{
"49ccbe785e12a90d680e8eaffcab73ea0a1bbe796796d5667cd71ae96563ab32": {
"size": 815,
"fee": 0.00005141,
"modifiedfee": 0.00005141,
"time": 1535995526,
"height": 539813,
"descendantcount": 1,
"descendantsize": 815,
"descendantfees": 5141,