From cec023c6e11547ba1b935850447668a63582c6c5 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Tue, 31 Mar 2026 11:46:11 +0200 Subject: [PATCH 1/8] test: pay msat invoice --- test/specs/send.e2e.ts | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/test/specs/send.e2e.ts b/test/specs/send.e2e.ts index cbd4a20..4e36e9d 100644 --- a/test/specs/send.e2e.ts +++ b/test/specs/send.e2e.ts @@ -544,4 +544,77 @@ describe('@send - Send', () => { await elementById('Activity-1').waitForDisplayed(); await elementById('Activity-2').waitForDisplayed(); }); + + ciIt('@send_3 - Can pay regular invoices with msat precision', async () => { + await receiveOnchainFunds(); + + // send funds to LND node and open a channel + const { lnd, lndNodeID } = await setupLND(rpc, lndConfig); + await electrum?.waitForSync(); + + // get LDK Node id + const ldkNodeId = await getLDKNodeID(); + + // connect to LND + await connectToLND(lndNodeID); + + // wait for peer to be connected + await waitForPeerConnection(lnd, ldkNodeId); + + // open a channel and wait until active + await openLNDAndSync(lnd, rpc, ldkNodeId); + await electrum?.waitForSync(); + await waitForActiveChannel(lnd, ldkNodeId); + + await waitForToast('SpendingBalanceReadyToast'); + + // Ensure spending balance by paying ourselves from LND. + let receive: string; + try { + receive = await getReceiveAddress('lightning'); + } catch { + await swipeFullScreen('down'); + await sleep(10_000); + await attemptRefreshOnHomeScreen(); + await sleep(10_000); + await attemptRefreshOnHomeScreen(); + await sleep(1000); + receive = await getReceiveAddress('lightning'); + } + if (!receive) throw new Error('No lightning invoice received'); + await swipeFullScreen('down'); + await lnd.sendPaymentSync({ paymentRequest: receive, amt: '10000' }); + await acknowledgeReceivedPayment(); + if (driver.isIOS) { + await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS }); + await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS }); + } else { + await dismissQuickPayIntro({ triggerTimedSheet: true }); + } + await expectTextWithin('ActivitySpending', '10 000'); + + async function payMsatInvoice(valueMsat: string, acceptCameraPermission: boolean) { + const { paymentRequest } = await lnd.addInvoice({ valueMsat }); + console.info({ valueMsat, paymentRequest }); + await sleep(1000); + await enterAddress(paymentRequest, { acceptCameraPermission }); + await elementById('ReviewAmount-primary').waitForDisplayed({ timeout: 15_000 }); + await dragOnElement('GRAB', 'right', 0.95); + await elementById('SendSuccess').waitForDisplayed(); + await tap('Close'); + await elementById('ActivityShort-0').waitForDisplayed(); + await expectTextWithin('ActivityShort-0', '-'); + await expectTextWithin('ActivityShort-0', 'Sent'); + await sleep(1000); + await swipeFullScreen('down'); + await swipeFullScreen('down'); + } + + // >500 msat remainder + await payMsatInvoice('222538', true); + // <500 msat remainder + await payMsatInvoice('222222', false); + // exactly 500 msat remainder + await payMsatInvoice('500500', false); + }); }); From 74ffff931da2ae350bf1a2111343174008c907ee Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Tue, 31 Mar 2026 11:47:15 +0200 Subject: [PATCH 2/8] test: add lnurl msat pay/withdraw cases --- test/specs/lnurl.e2e.ts | 101 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/test/specs/lnurl.e2e.ts b/test/specs/lnurl.e2e.ts index d0f1304..fe2f309 100644 --- a/test/specs/lnurl.e2e.ts +++ b/test/specs/lnurl.e2e.ts @@ -54,6 +54,36 @@ function waitForEvent(lnurlServer: any, name: string): Promise { }); } +function spendingBalanceLabelSats(satsInteger: number): string { + return satsInteger.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' '); +} + +/** Balance in msats after pay (subtract) or withdraw (add) from a prior msat total. */ +function applyLnurlMsatDelta(balanceMsats: bigint, deltaMsats: number, direction: 'pay' | 'withdraw'): bigint { + const d = BigInt(deltaMsats); + return direction === 'pay' ? balanceMsats - d : balanceMsats + d; +} + +async function expectMoneyTextRoundedSats( + parentTestId: 'ReviewAmount-primary' | 'WithdrawAmount-primary', + msats: number, +) { + const money = await elementByIdWithin(parentTestId, 'MoneyText'); + const raw = await money.getText(); + const digits = raw.replace(/[^\d]/g, ''); + const displayed = Number(digits); + if (Number.isNaN(displayed)) { + throw new Error(`MoneyText is not numeric: raw=${JSON.stringify(raw)} msats=${msats}`); + } + const floorSats = Math.floor(msats / 1000); + const ceilSats = Math.ceil(msats / 1000); + if (displayed !== floorSats && displayed !== ceilSats) { + throw new Error( + `Unexpected MoneyText: raw=${JSON.stringify(raw)} displayed=${displayed} expected=${floorSats}|${ceilSats} msats=${msats}`, + ); + } +} + describe('@lnurl - LNURL', () => { let electrum: Awaited> | undefined; let lnurlServer: any; @@ -98,7 +128,7 @@ describe('@lnurl - LNURL', () => { }); ciIt( - '@lnurl_1 - Can process lnurl-channel, lnurl-pay, lnurl-withdraw, and lnurl-auth', + '@lnurl_1 - Can process lnurl-channel, lnurl-pay, lnurl-withdraw, lnurl-auth, and msat-precision pay/withdraw', async () => { await receiveOnchainFunds({ sats: 1000 }); @@ -309,6 +339,75 @@ describe('@lnurl - LNURL', () => { await swipeFullScreen('down'); await swipeFullScreen('down'); + // Fixed min==max LNURL amounts in msats (LND invoice uses value_msat). Each pair pays then withdraws the same amount so balance returns to 19 713 sats. + // 222538 — remainder 538 msats (regression: payment must not truncate msats). + // 222222 — remainder 222 msats (< 500). + // 500500 — remainder 500 msats exactly. + let balanceMsats = 19713000n; + + async function msatPayWithdraw(label: string, msats: number) { + const afterPay = applyLnurlMsatDelta(balanceMsats, msats, 'pay'); + const afterWithdraw = applyLnurlMsatDelta(afterPay, msats, 'withdraw'); + + const payReq = await lnurlServer.generateNewUrl('payRequest', { + minSendable: msats, + maxSendable: msats, + metadata: `[["text/plain","lnurl-msat-${label}"]]`, + commentAllowed: 0, + }); + console.log(`payRequest msat ${label}`, payReq); + + await enterAddressViaScanPrompt(payReq.encoded, { acceptCameraPermission: false }); + await sleep(2000); + await elementById('ReviewAmount-primary').waitForDisplayed({ timeout: 5000 }); + await elementById('CommentInput').waitForDisplayed({ reverse: true }); + await expectMoneyTextRoundedSats('ReviewAmount-primary', msats); + await dragOnElement('GRAB', 'right', 0.95); + await elementById('SendSuccess').waitForDisplayed(); + await tap('Close'); + balanceMsats = afterPay; + await expectTextWithin( + 'ActivitySpending', + spendingBalanceLabelSats(Number(balanceMsats / 1000n)), + ); + await elementById('ActivityShort-0').waitForDisplayed(); + await expectTextWithin('ActivityShort-0', '-'); + await expectTextWithin('ActivityShort-0', 'Sent'); + await sleep(1000); + await swipeFullScreen('down'); + await swipeFullScreen('down'); + + const wReq = await lnurlServer.generateNewUrl('withdrawRequest', { + minWithdrawable: msats, + maxWithdrawable: msats, + defaultDescription: `lnurl-withdraw-msat-${label}`, + }); + console.log(`withdrawRequest msat ${label}`, wReq); + + await enterAddressViaScanPrompt(wReq.encoded, { acceptCameraPermission: false }); + await sleep(2000); + await elementById('WithdrawAmount-primary').waitForDisplayed({ timeout: 5000 }); + await expectMoneyTextRoundedSats('WithdrawAmount-primary', msats); + await tap('WithdrawConfirmButton'); + await acknowledgeReceivedPayment(); + balanceMsats = afterWithdraw; + await expectTextWithin( + 'ActivitySpending', + spendingBalanceLabelSats(Number(balanceMsats / 1000n)), + ); + await elementById('ActivityShort-0').waitForDisplayed(); + await expectTextWithin('ActivityShort-0', '+'); + await expectTextWithin('ActivityShort-0', `lnurl-withdraw-msat-${label}`); + await expectTextWithin('ActivityShort-0', 'Received'); + await sleep(1000); + await swipeFullScreen('down'); + await swipeFullScreen('down'); + } + + await msatPayWithdraw('222538', 222_538); + await msatPayWithdraw('222222', 222_222); + await msatPayWithdraw('500500', 500_500); + // lnurl-auth const loginRequest1 = await lnurlServer.generateNewUrl('login'); console.log('loginRequest1', loginRequest1); From fd196c5ebabc1a526a98da1d2c60a0ba82f7d790 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Tue, 31 Mar 2026 15:21:32 +0200 Subject: [PATCH 3/8] extend bitcoin-cli: getlninvoice [sats] [--msat N] --- docker/bitcoin-cli | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/docker/bitcoin-cli b/docker/bitcoin-cli index 6700969..5106f57 100755 --- a/docker/bitcoin-cli +++ b/docker/bitcoin-cli @@ -27,6 +27,7 @@ Commands: send [amount] [address] [-m N] Send to address and optionally mine N blocks (default: 1) getInvoice Get a new BIP21 URI with a bech32 address LND: + getlninvoice [sats] [--msat N] Create Lightning invoice (supports msat precision) getinfo Show LND node info (for connectivity debugging) openchannel [amount] Open channel from LND to node (default: 500000 sats) payinvoice [amount] Pay a Lightning invoice via LND @@ -198,6 +199,80 @@ if [[ "$command" = "getinfo" ]]; then exit fi +# Create a Lightning invoice (LND) +if [[ "$command" = "getlninvoice" ]]; then + shift + + sats="" + msat="" + memo="" + + while [[ $# -gt 0 ]]; do + case "$1" in + --msat) + msat="${2:-}" + shift 2 + ;; + --sats) + sats="${2:-}" + shift 2 + ;; + -m|--memo) + memo="${2:-}" + shift 2 + ;; + -*) + echo "Unknown option $1" + echo "Usage: $CLI_NAME getlninvoice [sats] [--msat N] [--memo TEXT]" + exit 1 + ;; + *) + # Positional value is treated as sats if numeric. + if [[ "$1" =~ ^[0-9]+$ ]]; then + sats="$1" + shift + else + echo "Invalid amount '$1' (expected integer sats)" + exit 1 + fi + ;; + esac + done + + if [[ -n "$sats" && -n "$msat" ]]; then + echo "Use either sats or --msat, not both." + exit 1 + fi + + if [[ -n "$msat" ]]; then + echo "→ Creating Lightning invoice (${msat} msat)..." + result=$("${LNCLI_CMD[@]}" addinvoice --amt_msat "$msat" --memo "$memo" 2>&1) || true + elif [[ -n "$sats" ]]; then + echo "→ Creating Lightning invoice (${sats} sats)..." + result=$("${LNCLI_CMD[@]}" addinvoice --amt "$sats" --memo "$memo" 2>&1) || true + else + echo "→ Creating amountless Lightning invoice..." + result=$("${LNCLI_CMD[@]}" addinvoice --memo "$memo" 2>&1) || true + fi + + payment_request=$(echo "$result" | jq -r '.payment_request // empty' 2>/dev/null) || payment_request="" + if [ -z "$payment_request" ]; then + echo "${result:-LND command produced no output}" + exit 1 + fi + + echo "" + echo "$payment_request" + echo "" + + if command -v pbcopy &>/dev/null; then + echo "$payment_request" | pbcopy + echo "Invoice copied to clipboard." + fi + + exit +fi + # Open channel from LND to a node if [[ "$command" = "openchannel" ]]; then shift From e766dcfb5c6ad906f0d0eab6e5f2e0565469cc78 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Thu, 2 Apr 2026 14:31:13 +0200 Subject: [PATCH 4/8] feat: lnurl utility commands --- .gitignore | 1 + docker/bitcoin-cli | 336 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 337 insertions(+) diff --git a/.gitignore b/.gitignore index 4e38608..bbac4d7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ aut node_modules docker/lnd +docker/lnurl-server-data artifacts WARP.md .ai diff --git a/docker/bitcoin-cli b/docker/bitcoin-cli index 5106f57..847d7e1 100755 --- a/docker/bitcoin-cli +++ b/docker/bitcoin-cli @@ -3,12 +3,15 @@ set -euo pipefail CLI_NAME="$(basename $0)" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" BITCOIN_CONTAINER="bitcoind" LND_CONTAINER="lnd" LND_DIR="/home/lnd/.lnd" RPC_USER=polaruser RPC_PASS=polarpass RPC_PORT=43782 +LNURL_SERVER_PORT="${LNURL_SERVER_PORT:-30001}" +LNURL_SERVER_URL="${LNURL_SERVER_URL:-http://localhost:${LNURL_SERVER_PORT}}" BASE_COMMAND=(docker compose exec $BITCOIN_CONTAINER bitcoin-cli -rpcport=$RPC_PORT -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS) LNCLI_CMD=(docker compose exec -T $LND_CONTAINER lncli --lnddir "$LND_DIR" --network regtest) @@ -34,6 +37,12 @@ Commands: holdinvoice [amount] [-m memo] Create a hold invoice settleinvoice Reveal a preimage and use it to settle the corresponding invoice cancelinvoice Cancels a currently open invoice + LNURL (requires LNURL server, default: ${LNURL_SERVER_URL}): + startlnurlserver [--port N] Start LNURL server using current e2e Bitcoin/LND + stoplnurlserver Stop LNURL server container + checklnurl Diagnose LNURL health, routing, and adb reverse + getlnurlpay --msat N Create LNURL-pay with fixed msat amount + getlnurlwithdraw --msat N Create LNURL-withdraw with fixed msat amount EOF } @@ -273,6 +282,333 @@ if [[ "$command" = "getlninvoice" ]]; then exit fi +# Start LNURL server stack (bitkit-docker) +if [[ "$command" = "startlnurlserver" ]]; then + shift + + BITKIT_DOCKER_DIR="${BITKIT_DOCKER_DIR:-$SCRIPT_DIR/../../bitkit-docker}" + LNURL_IMAGE="${LNURL_IMAGE:-bitkit-lnurl-server:local}" + E2E_DOCKER_DIR="$SCRIPT_DIR" + LNURL_DATA_DIR="${LNURL_DATA_DIR:-$SCRIPT_DIR/lnurl-server-data}" + runtime_port="$LNURL_SERVER_PORT" + + while [[ $# -gt 0 ]]; do + case "$1" in + --port) + runtime_port="${2:-}" + shift 2 + ;; + -*) + echo "Unknown option $1" + echo "Usage: $CLI_NAME startlnurlserver [--port N]" + exit 1 + ;; + *) + if [[ "$1" =~ ^[0-9]+$ ]]; then + runtime_port="$1" + shift + else + echo "Invalid port '$1' (expected integer)" + exit 1 + fi + ;; + esac + done + + if ! [[ "$runtime_port" =~ ^[0-9]+$ ]]; then + echo "Invalid port '$runtime_port' (expected integer)" + exit 1 + fi + + if [[ ! -d "$BITKIT_DOCKER_DIR" ]]; then + echo "bitkit-docker directory not found at '$BITKIT_DOCKER_DIR'" + echo "Tip: set BITKIT_DOCKER_DIR to your path, e.g." + echo " BITKIT_DOCKER_DIR=../bitkit-docker $CLI_NAME startlnurlserver" + exit 1 + fi + + if [[ ! -f "$BITKIT_DOCKER_DIR/docker-compose.yml" ]]; then + echo "No docker-compose.yml found in '$BITKIT_DOCKER_DIR'" + exit 1 + fi + + if [[ ! -d "$E2E_DOCKER_DIR/lnd" ]]; then + echo "Expected LND data at '$E2E_DOCKER_DIR/lnd' but it was not found." + exit 1 + fi + + if ! docker image inspect "$LNURL_IMAGE" >/dev/null 2>&1; then + echo "→ Building LNURL image '$LNURL_IMAGE' from '$BITKIT_DOCKER_DIR/lnurl-server'..." + docker build -t "$LNURL_IMAGE" "$BITKIT_DOCKER_DIR/lnurl-server" >/dev/null || { + echo "Failed to build LNURL image" + exit 1 + } + fi + + mkdir -p "$LNURL_DATA_DIR" + + echo "→ Starting LNURL server wired to current e2e docker stack on port ${runtime_port}..." + docker rm -f lnurl-server >/dev/null 2>&1 || true + docker run -d \ + --name lnurl-server \ + -p "${runtime_port}:3000" \ + -e NODE_ENV=production \ + -e PORT=3000 \ + -e DOMAIN="http://localhost:${runtime_port}" \ + -e BITCOIN_RPC_HOST=host.docker.internal \ + -e BITCOIN_RPC_PORT=43782 \ + -e BITCOIN_RPC_USER=polaruser \ + -e BITCOIN_RPC_PASS=polarpass \ + -e LND_REST_HOST=host.docker.internal \ + -e LND_REST_PORT=8080 \ + -e LND_MACAROON_PATH=/lnd-certs/data/chain/bitcoin/regtest/admin.macaroon \ + -e LND_TLS_CERT_PATH=/lnd-certs/tls.cert \ + -v "$E2E_DOCKER_DIR/lnd:/lnd-certs:ro" \ + -v "$LNURL_DATA_DIR:/data" \ + "$LNURL_IMAGE" >/dev/null || { + echo "Failed to start LNURL server container" + exit 1 + } + + echo "✓ LNURL server started" + echo "Health check:" + echo " curl -s http://localhost:${runtime_port}/health | jq" + exit +fi + +# Stop LNURL server +if [[ "$command" = "stoplnurlserver" ]]; then + container_id=$(docker ps -a --filter "name=^lnurl-server$" --format "{{.ID}}" | head -n 1) + if [[ -n "$container_id" ]]; then + docker rm -f lnurl-server >/dev/null 2>&1 || true + echo "✓ LNURL server stopped" + else + echo "LNURL server is not running" + fi + exit +fi + +# Check LNURL setup and prerequisites +if [[ "$command" = "checklnurl" ]]; then + health_url="${LNURL_SERVER_URL%/}/health" + + echo "→ Checking LNURL health at ${health_url}..." + health_json="" + for _ in $(seq 1 10); do + health_json=$(curl -s "$health_url" 2>/dev/null || true) + if [[ -n "$health_json" ]]; then + break + fi + sleep 1 + done + if [[ -z "$health_json" ]]; then + echo "✗ LNURL health endpoint is unreachable" + echo " Start server: $CLI_NAME startlnurlserver --port ${LNURL_SERVER_PORT}" + echo " Or set LNURL_SERVER_URL to your endpoint." + exit 1 + fi + + status=$(echo "$health_json" | jq -r '.status // "unknown"' 2>/dev/null || echo "unknown") + btc_ok=$(echo "$health_json" | jq -r '.bitcoin_connected // false' 2>/dev/null || echo "false") + lnd_ok=$(echo "$health_json" | jq -r '.lnd_connected // false' 2>/dev/null || echo "false") + block_height=$(echo "$health_json" | jq -r '.block_height // "n/a"' 2>/dev/null || echo "n/a") + + echo " status: $status" + echo " bitcoin_connected: $btc_ok" + echo " lnd_connected: $lnd_ok" + echo " block_height: $block_height" + + echo "" + echo "→ Checking local LND channel/liquidity..." + channel_balance=$(docker compose -f "$SCRIPT_DIR/docker-compose.yml" exec -T "$LND_CONTAINER" \ + lncli --lnddir "$LND_DIR" --network regtest channelbalance 2>/dev/null || true) + channels=$(docker compose -f "$SCRIPT_DIR/docker-compose.yml" exec -T "$LND_CONTAINER" \ + lncli --lnddir "$LND_DIR" --network regtest listchannels 2>/dev/null || true) + + if [[ -z "$channel_balance" || -z "$channels" ]]; then + echo " ⚠ Could not read local LND state from e2e docker stack." + else + local_sat=$(echo "$channel_balance" | jq -r '.local_balance.sat // "0"' 2>/dev/null || echo "0") + remote_sat=$(echo "$channel_balance" | jq -r '.remote_balance.sat // "0"' 2>/dev/null || echo "0") + active_count=$(echo "$channels" | jq -r '[.channels[] | select(.active==true)] | length' 2>/dev/null || echo "0") + total_count=$(echo "$channels" | jq -r '.channels | length // 0' 2>/dev/null || echo "0") + + echo " channels: ${active_count} active / ${total_count} total" + echo " lnd outbound: ${local_sat} sats (can pay)" + echo " lnd inbound: ${remote_sat} sats (can receive)" + fi + + echo "" + echo "→ Checking Android adb reverse for port ${LNURL_SERVER_PORT}..." + if ! command -v adb >/dev/null 2>&1; then + echo " adb not found (skip)" + else + devices=$(adb devices 2>/dev/null | awk 'NR>1 && $2=="device" {print $1}') + if [[ -z "$devices" ]]; then + echo " no connected Android devices/emulators" + else + reverse_list=$(adb reverse --list 2>/dev/null || true) + if echo "$reverse_list" | grep -q "tcp:${LNURL_SERVER_PORT}[[:space:]]\+tcp:${LNURL_SERVER_PORT}"; then + echo " ✓ adb reverse is configured for tcp:${LNURL_SERVER_PORT}" + else + echo " ⚠ adb reverse missing for tcp:${LNURL_SERVER_PORT}" + echo " Run: adb reverse tcp:${LNURL_SERVER_PORT} tcp:${LNURL_SERVER_PORT}" + fi + fi + fi + + echo "" + if [[ "$status" = "healthy" && "$btc_ok" = "true" && "$lnd_ok" = "true" ]]; then + echo "✓ LNURL diagnostics look good." + exit 0 + fi + + echo "⚠ LNURL diagnostics found issues." + exit 1 +fi + +# Create LNURL-pay (fixed msat amount) +if [[ "$command" = "getlnurlpay" ]]; then + shift + + msat="" + comment_allowed=0 + + while [[ $# -gt 0 ]]; do + case "$1" in + --msat) + msat="${2:-}" + shift 2 + ;; + --comment-allowed) + comment_allowed="${2:-0}" + shift 2 + ;; + -*) + echo "Unknown option $1" + echo "Usage: $CLI_NAME getlnurlpay --msat N [--comment-allowed N]" + exit 1 + ;; + *) + if [[ "$1" =~ ^[0-9]+$ ]]; then + msat="$1" + shift + else + echo "Invalid value '$1' (expected integer msats)" + exit 1 + fi + ;; + esac + done + + if [[ -z "$msat" ]]; then + echo "Usage: $CLI_NAME getlnurlpay --msat N [--comment-allowed N]" + exit 1 + fi + + if ! [[ "$msat" =~ ^[0-9]+$ ]]; then + echo "Invalid msat '$msat' (expected integer)" + exit 1 + fi + + if ! [[ "$comment_allowed" =~ ^[0-9]+$ ]]; then + echo "Invalid comment length '$comment_allowed' (expected integer)" + exit 1 + fi + + url="${LNURL_SERVER_URL%/}/generate/pay?minSendable=${msat}&maxSendable=${msat}&commentAllowed=${comment_allowed}" + echo "→ Creating LNURL-pay (${msat} msat fixed amount) via ${LNURL_SERVER_URL}..." + + result=$(curl -sf "$url") || { + echo "Failed to reach LNURL server at ${LNURL_SERVER_URL}" + echo "Tip: verify server with '$CLI_NAME checklnurl' or set LNURL_SERVER_URL." + exit 1 + } + + lnurl=$(echo "$result" | jq -r '.lnurl // empty' 2>/dev/null) || lnurl="" + if [[ -z "$lnurl" ]]; then + echo "${result:-LNURL server returned no output}" + exit 1 + fi + + echo "" + echo "$lnurl" + echo "" + + if command -v pbcopy &>/dev/null; then + echo "$lnurl" | pbcopy + echo "LNURL copied to clipboard." + fi + + exit +fi + +# Create LNURL-withdraw (fixed msat amount) +if [[ "$command" = "getlnurlwithdraw" ]]; then + shift + + msat="" + + while [[ $# -gt 0 ]]; do + case "$1" in + --msat) + msat="${2:-}" + shift 2 + ;; + -*) + echo "Unknown option $1" + echo "Usage: $CLI_NAME getlnurlwithdraw --msat N" + exit 1 + ;; + *) + if [[ "$1" =~ ^[0-9]+$ ]]; then + msat="$1" + shift + else + echo "Invalid value '$1' (expected integer msats)" + exit 1 + fi + ;; + esac + done + + if [[ -z "$msat" ]]; then + echo "Usage: $CLI_NAME getlnurlwithdraw --msat N" + exit 1 + fi + + if ! [[ "$msat" =~ ^[0-9]+$ ]]; then + echo "Invalid msat '$msat' (expected integer)" + exit 1 + fi + + url="${LNURL_SERVER_URL%/}/generate/withdraw?minWithdrawable=${msat}&maxWithdrawable=${msat}" + echo "→ Creating LNURL-withdraw (${msat} msat fixed amount) via ${LNURL_SERVER_URL}..." + + result=$(curl -sf "$url") || { + echo "Failed to reach LNURL server at ${LNURL_SERVER_URL}" + echo "Tip: verify server with '$CLI_NAME checklnurl' or set LNURL_SERVER_URL." + exit 1 + } + + lnurl=$(echo "$result" | jq -r '.lnurl // empty' 2>/dev/null) || lnurl="" + if [[ -z "$lnurl" ]]; then + echo "${result:-LNURL server returned no output}" + exit 1 + fi + + echo "" + echo "$lnurl" + echo "" + + if command -v pbcopy &>/dev/null; then + echo "$lnurl" | pbcopy + echo "LNURL copied to clipboard." + fi + + exit +fi + # Open channel from LND to a node if [[ "$command" = "openchannel" ]]; then shift From f0cfd1a6b71ba76862ba511bd8f8638983dba841 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 3 Apr 2026 12:28:50 +0200 Subject: [PATCH 5/8] withdraw button stabilization --- test/specs/lnurl.e2e.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/specs/lnurl.e2e.ts b/test/specs/lnurl.e2e.ts index fe2f309..75aa521 100644 --- a/test/specs/lnurl.e2e.ts +++ b/test/specs/lnurl.e2e.ts @@ -327,6 +327,7 @@ describe('@lnurl - LNURL', () => { await enterAddressViaScanPrompt(withdrawRequest2.encoded, { acceptCameraPermission: false }); const reviewAmtWithdraw = await elementByIdWithin('WithdrawAmount-primary', 'MoneyText'); await expect(reviewAmtWithdraw).toHaveText('303'); + await sleep(1000); await tap('WithdrawConfirmButton'); await acknowledgeReceivedPayment(); await expectTextWithin('ActivitySpending', '19 713'); // 19 410 + 303 = 19 713 From b78265cdbbbff727266dc2f48e93fc5e2b4cde23 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 3 Apr 2026 14:17:57 +0200 Subject: [PATCH 6/8] feat: vendor lnurl server for adhoc use Made-with: Cursor --- docker/bitcoin-cli | 62 +- docker/docker-compose.yml | 28 + docker/lnurl-server/.dockerignore | 9 + docker/lnurl-server/Dockerfile | 22 + docker/lnurl-server/config.js | 49 + docker/lnurl-server/data/lnurl.db | Bin 0 -> 57344 bytes docker/lnurl-server/database.js | 241 ++ docker/lnurl-server/keys/private.pem | 28 + docker/lnurl-server/keys/public.pem | 9 + .../lnurl-server/middleware/errorHandler.js | 62 + docker/lnurl-server/middleware/httpLogger.js | 62 + docker/lnurl-server/package-lock.json | 3717 +++++++++++++++++ docker/lnurl-server/package.json | 19 + docker/lnurl-server/routes/admin.js | 266 ++ docker/lnurl-server/routes/auth.js | 97 + docker/lnurl-server/routes/channel.js | 82 + docker/lnurl-server/routes/decoder.js | 441 ++ docker/lnurl-server/routes/generate.js | 222 + docker/lnurl-server/routes/pay.js | 91 + docker/lnurl-server/routes/well-known.js | 39 + docker/lnurl-server/routes/withdraw.js | 93 + docker/lnurl-server/server.js | 76 + .../lnurl-server/services/backgroundJobs.js | 88 + docker/lnurl-server/services/bitcoin.js | 50 + docker/lnurl-server/services/lnd.js | 197 + docker/lnurl-server/templates.js | 1114 +++++ docker/lnurl-server/utils/logger.js | 54 + docker/lnurl-server/utils/validation.js | 224 + 28 files changed, 7390 insertions(+), 52 deletions(-) create mode 100644 docker/lnurl-server/.dockerignore create mode 100644 docker/lnurl-server/Dockerfile create mode 100644 docker/lnurl-server/config.js create mode 100644 docker/lnurl-server/data/lnurl.db create mode 100644 docker/lnurl-server/database.js create mode 100644 docker/lnurl-server/keys/private.pem create mode 100644 docker/lnurl-server/keys/public.pem create mode 100644 docker/lnurl-server/middleware/errorHandler.js create mode 100644 docker/lnurl-server/middleware/httpLogger.js create mode 100644 docker/lnurl-server/package-lock.json create mode 100644 docker/lnurl-server/package.json create mode 100644 docker/lnurl-server/routes/admin.js create mode 100644 docker/lnurl-server/routes/auth.js create mode 100644 docker/lnurl-server/routes/channel.js create mode 100644 docker/lnurl-server/routes/decoder.js create mode 100644 docker/lnurl-server/routes/generate.js create mode 100644 docker/lnurl-server/routes/pay.js create mode 100644 docker/lnurl-server/routes/well-known.js create mode 100644 docker/lnurl-server/routes/withdraw.js create mode 100644 docker/lnurl-server/server.js create mode 100644 docker/lnurl-server/services/backgroundJobs.js create mode 100644 docker/lnurl-server/services/bitcoin.js create mode 100644 docker/lnurl-server/services/lnd.js create mode 100644 docker/lnurl-server/templates.js create mode 100644 docker/lnurl-server/utils/logger.js create mode 100644 docker/lnurl-server/utils/validation.js diff --git a/docker/bitcoin-cli b/docker/bitcoin-cli index 847d7e1..c10ec6a 100755 --- a/docker/bitcoin-cli +++ b/docker/bitcoin-cli @@ -39,7 +39,7 @@ Commands: cancelinvoice Cancels a currently open invoice LNURL (requires LNURL server, default: ${LNURL_SERVER_URL}): startlnurlserver [--port N] Start LNURL server using current e2e Bitcoin/LND - stoplnurlserver Stop LNURL server container + stoplnurlserver Stop LNURL server service checklnurl Diagnose LNURL health, routing, and adb reverse getlnurlpay --msat N Create LNURL-pay with fixed msat amount getlnurlwithdraw --msat N Create LNURL-withdraw with fixed msat amount @@ -282,14 +282,10 @@ if [[ "$command" = "getlninvoice" ]]; then exit fi -# Start LNURL server stack (bitkit-docker) +# Start LNURL server service from local e2e docker-compose if [[ "$command" = "startlnurlserver" ]]; then shift - BITKIT_DOCKER_DIR="${BITKIT_DOCKER_DIR:-$SCRIPT_DIR/../../bitkit-docker}" - LNURL_IMAGE="${LNURL_IMAGE:-bitkit-lnurl-server:local}" - E2E_DOCKER_DIR="$SCRIPT_DIR" - LNURL_DATA_DIR="${LNURL_DATA_DIR:-$SCRIPT_DIR/lnurl-server-data}" runtime_port="$LNURL_SERVER_PORT" while [[ $# -gt 0 ]]; do @@ -320,53 +316,14 @@ if [[ "$command" = "startlnurlserver" ]]; then exit 1 fi - if [[ ! -d "$BITKIT_DOCKER_DIR" ]]; then - echo "bitkit-docker directory not found at '$BITKIT_DOCKER_DIR'" - echo "Tip: set BITKIT_DOCKER_DIR to your path, e.g." - echo " BITKIT_DOCKER_DIR=../bitkit-docker $CLI_NAME startlnurlserver" + if [[ ! -f "$SCRIPT_DIR/docker-compose.yml" ]]; then + echo "No docker-compose.yml found in '$SCRIPT_DIR'" exit 1 fi - if [[ ! -f "$BITKIT_DOCKER_DIR/docker-compose.yml" ]]; then - echo "No docker-compose.yml found in '$BITKIT_DOCKER_DIR'" - exit 1 - fi - - if [[ ! -d "$E2E_DOCKER_DIR/lnd" ]]; then - echo "Expected LND data at '$E2E_DOCKER_DIR/lnd' but it was not found." - exit 1 - fi - - if ! docker image inspect "$LNURL_IMAGE" >/dev/null 2>&1; then - echo "→ Building LNURL image '$LNURL_IMAGE' from '$BITKIT_DOCKER_DIR/lnurl-server'..." - docker build -t "$LNURL_IMAGE" "$BITKIT_DOCKER_DIR/lnurl-server" >/dev/null || { - echo "Failed to build LNURL image" - exit 1 - } - fi - - mkdir -p "$LNURL_DATA_DIR" - - echo "→ Starting LNURL server wired to current e2e docker stack on port ${runtime_port}..." - docker rm -f lnurl-server >/dev/null 2>&1 || true - docker run -d \ - --name lnurl-server \ - -p "${runtime_port}:3000" \ - -e NODE_ENV=production \ - -e PORT=3000 \ - -e DOMAIN="http://localhost:${runtime_port}" \ - -e BITCOIN_RPC_HOST=host.docker.internal \ - -e BITCOIN_RPC_PORT=43782 \ - -e BITCOIN_RPC_USER=polaruser \ - -e BITCOIN_RPC_PASS=polarpass \ - -e LND_REST_HOST=host.docker.internal \ - -e LND_REST_PORT=8080 \ - -e LND_MACAROON_PATH=/lnd-certs/data/chain/bitcoin/regtest/admin.macaroon \ - -e LND_TLS_CERT_PATH=/lnd-certs/tls.cert \ - -v "$E2E_DOCKER_DIR/lnd:/lnd-certs:ro" \ - -v "$LNURL_DATA_DIR:/data" \ - "$LNURL_IMAGE" >/dev/null || { - echo "Failed to start LNURL server container" + echo "→ Starting LNURL server service on port ${runtime_port}..." + LNURL_SERVER_PORT="$runtime_port" docker compose --profile adhoc -f "$SCRIPT_DIR/docker-compose.yml" up -d lnurl-server >/dev/null || { + echo "Failed to start LNURL server service" exit 1 } @@ -378,9 +335,10 @@ fi # Stop LNURL server if [[ "$command" = "stoplnurlserver" ]]; then - container_id=$(docker ps -a --filter "name=^lnurl-server$" --format "{{.ID}}" | head -n 1) + container_id=$(docker compose --profile adhoc -f "$SCRIPT_DIR/docker-compose.yml" ps -q lnurl-server) if [[ -n "$container_id" ]]; then - docker rm -f lnurl-server >/dev/null 2>&1 || true + docker compose --profile adhoc -f "$SCRIPT_DIR/docker-compose.yml" stop lnurl-server >/dev/null 2>&1 || true + docker compose --profile adhoc -f "$SCRIPT_DIR/docker-compose.yml" rm -f lnurl-server >/dev/null 2>&1 || true echo "✓ LNURL server stopped" else echo "LNURL server is not running" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index eb29ae5..2453e07 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -133,6 +133,34 @@ services: SECRET_KEY: 'e3e2d2e410569be1f2219e1ef21f188f7ccff1ce721ea2624263d3fe9878f69e' PUBLIC_KEY: '0319c4ff23820afec0c79ce3a42031d7fef1dff78b7bdd69b5560684f3e1827675' + lnurl-server: + profiles: + - adhoc + build: + context: ./lnurl-server + restart: unless-stopped + depends_on: + - bitcoind + - lnd + environment: + - NODE_ENV=production + - PORT=3000 + - DOMAIN=http://localhost:${LNURL_SERVER_PORT:-30001} + - DATABASE_URL=sqlite:///data/lnurl.db + - BITCOIN_RPC_HOST=bitcoind + - BITCOIN_RPC_PORT=43782 + - BITCOIN_RPC_USER=polaruser + - BITCOIN_RPC_PASS=polarpass + - LND_REST_HOST=lnd + - LND_REST_PORT=8080 + - LND_MACAROON_PATH=/lnd-certs/data/chain/bitcoin/regtest/admin.macaroon + - LND_TLS_CERT_PATH=/lnd-certs/tls.cert + volumes: + - ./lnurl-server-data:/data + - ./lnd:/lnd-certs:ro + ports: + - '${LNURL_SERVER_PORT:-30001}:3000' + volumes: bitcoin_home: diff --git a/docker/lnurl-server/.dockerignore b/docker/lnurl-server/.dockerignore new file mode 100644 index 0000000..1b44e0b --- /dev/null +++ b/docker/lnurl-server/.dockerignore @@ -0,0 +1,9 @@ +node_modules +npm-debug.log +.git +.gitignore +README.md +.env +*.log +data/ +.DS_Store diff --git a/docker/lnurl-server/Dockerfile b/docker/lnurl-server/Dockerfile new file mode 100644 index 0000000..8788106 --- /dev/null +++ b/docker/lnurl-server/Dockerfile @@ -0,0 +1,22 @@ +FROM node:18-alpine + +WORKDIR /app + +# Install build dependencies +RUN apk add --no-cache python3 make g++ sqlite curl + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy application files +COPY . . + +# Create data directory +RUN mkdir -p /data + +EXPOSE 3000 + +CMD ["node", "server.js"] diff --git a/docker/lnurl-server/config.js b/docker/lnurl-server/config.js new file mode 100644 index 0000000..fd705ee --- /dev/null +++ b/docker/lnurl-server/config.js @@ -0,0 +1,49 @@ +// Configuration file for LNURL server +const config = { + // Server configuration + port: process.env.PORT || 3000, + domain: process.env.DOMAIN || `http://localhost:${process.env.PORT || 3000}`, + nodeEnv: process.env.NODE_ENV || 'development', + + // Bitcoin RPC configuration + bitcoin: { + host: process.env.BITCOIN_RPC_HOST || 'host.docker.internal', + port: process.env.BITCOIN_RPC_PORT || '18443', + user: process.env.BITCOIN_RPC_USER || 'polaruser', + pass: process.env.BITCOIN_RPC_PASS || 'polarpass' + }, + + // LND configuration + lnd: { + restHost: process.env.LND_REST_HOST || 'host.docker.internal', + restPort: process.env.LND_REST_PORT || '8080', + macaroonPath: process.env.LND_MACAROON_PATH, + tlsCertPath: process.env.LND_TLS_CERT_PATH + }, + + // Database configuration + database: { + path: '/data/lnurl.db' + }, + + // LNURL limits and defaults + limits: { + minWithdrawable: 1000, // 1 sat minimum + maxWithdrawable: 100000000, // 100,000 sats maximum + minSendable: 1000, // 1 sat minimum + maxSendable: 1000000000, // 1M sats maximum + commentAllowed: 255, // Max comment length + k1Length: 32, // k1 random bytes length + idLength: 16, // ID random bytes length + defaultChannelAmount: 100000, // 100,000 sats default channel size + sessionTimeout: 600, // 10 minutes in seconds + }, + + // Background job intervals + intervals: { + paymentCheck: 10000, // 10 seconds + authSessionCleanup: 300 * 1000 // 5 minutes + } +}; + +module.exports = config; diff --git a/docker/lnurl-server/data/lnurl.db b/docker/lnurl-server/data/lnurl.db new file mode 100644 index 0000000000000000000000000000000000000000..b53743482c3385d015e191b70ae426cf4910865e GIT binary patch literal 57344 zcmeI(PfsFe0LSqePzF(C4^22UCX?92HrAE_6xgP*tUGQ@#a$7T?uiV;Lzyi9WU%U? zJ?QSGz4SG-Z=kn5Ha)j5p)aJz&fsDh{!}EfDdsy7oPWP+&4aMRFOVu{}hh=C54q;X}K2pE%N=+ zFUy}ThL=tj0---bKPbDw--ADnE6#ib5I_I{1pdzgm(LcJ=-Qh6I@d8uHDR1~szqDa zw$*Ido{6QMyq+!SY9ae%UspYg)DJ`Iz+jctg8o%OeUabGW%Do9FZGun53Te{yI$$| zVDIo)A70)%Exi&K-F1c+x_clR9m_O2qO3l7{(N809;i?C-R$vxL5&R;Fx$diwdkBI zJasBk*vsiRtM44=^ZG%d=*~PUWOFZui;MG?)fRStaZiOl%7g>a+?p&|jj}kmPioG| zNzvKKW_Q{h`vD28oYZR;B+n~7318m6e#CXBpUZ`H(ov=49e+o3@8Xk%RTgUZGD z;GD(ng*$CP8{9zX(g-Ng^>z96MYkEWjElN+a1_mEqhft+4@@eaMli5&L>uU>G0{O? zw;E0d(kQ#ViMn@C(4Xn~o8wH2#YP;Nb>sZsi#Vl57BrjnZZ(Zst$F4&iNTi}@mhE4 z1-vPLt^}fo>*G@HA-y9nY6CNZSHU?Yy0Rj_G5aIxWn<5e3dJ6g#zZL?_2#LQzio8v zp33lHR~EL}wptyhuOHLN_UceI?CRK6oE@5^`@PO;%vS!}BtM-GM0ZwhNz%TF&<{~Exh_}5zP89N~Jz-yYm$ygnfwAciME6$5 zarQwJ<9!ozo4!elX??}~&e>GZJ);V{PmkOu1_Tg5009ILKmY**5I_I{1Q2+r0wK3z zT>n4Rc&Qfx2q1s}0tg_000IagfB*tr0j~dP2nZm600IagfB*srAbSkBl%L;o{^GIt)kX6>oAGqoNTf@dO0rZ+Z)(X@T9itq z@@C9T32n>N^iaN7q1{QiIX5GaWN0tg_000IagfB*srAb`NE2=M#=SxJihL;wK<5I_I{1Q0*~ z0R#|0V0r { + // Withdrawals table + this.db.run(`CREATE TABLE IF NOT EXISTS withdrawals ( + id TEXT PRIMARY KEY, + k1 TEXT UNIQUE, + amount_sats INTEGER, + used BOOLEAN DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + )`); + + // Payments table + this.db.run(`CREATE TABLE IF NOT EXISTS payments ( + id TEXT PRIMARY KEY, + amount_sats INTEGER, + description TEXT, + payment_hash TEXT, + paid BOOLEAN DEFAULT 0, + comment TEXT, + comment_allowed INTEGER DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + )`); + + // Payment configs table + this.db.run(`CREATE TABLE IF NOT EXISTS payment_configs ( + payment_id TEXT PRIMARY KEY, + min_sendable INTEGER DEFAULT 1000, + max_sendable INTEGER DEFAULT 1000000000, + comment_allowed INTEGER DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + )`); + + // Channel requests table + this.db.run(`CREATE TABLE IF NOT EXISTS channel_requests ( + id TEXT PRIMARY KEY, + k1 TEXT UNIQUE, + remote_id TEXT, + private BOOLEAN DEFAULT 0, + cancelled BOOLEAN DEFAULT 0, + completed BOOLEAN DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + )`); + + // Auth sessions table + this.db.run(`CREATE TABLE IF NOT EXISTS auth_sessions ( + id TEXT PRIMARY KEY, + k1 TEXT UNIQUE, + pubkey TEXT, + authenticated BOOLEAN DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + expires_at DATETIME + )`); + }); + } + + // Promise-based database operations + run(sql, params = []) { + return new Promise((resolve, reject) => { + this.db.run(sql, params, function (err) { + if (err) { + reject(err); + } else { + resolve({ id: this.lastID, changes: this.changes }); + } + }); + }); + } + + get(sql, params = []) { + return new Promise((resolve, reject) => { + this.db.get(sql, params, (err, row) => { + if (err) { + reject(err); + } else { + resolve(row); + } + }); + }); + } + + all(sql, params = []) { + return new Promise((resolve, reject) => { + this.db.all(sql, params, (err, rows) => { + if (err) { + reject(err); + } else { + resolve(rows); + } + }); + }); + } + + // Withdrawal operations + async createWithdrawal(id, k1, amountSats = 0) { + return this.run( + 'INSERT INTO withdrawals (id, k1, amount_sats) VALUES (?, ?, ?)', + [id, k1, amountSats] + ); + } + + async getWithdrawal(k1) { + return this.get( + 'SELECT * FROM withdrawals WHERE k1 = ? AND used = 0', + [k1] + ); + } + + async updateWithdrawal(k1, amountSats) { + return this.run( + 'UPDATE withdrawals SET used = 1, amount_sats = ? WHERE k1 = ?', + [amountSats, k1] + ); + } + + async getAllWithdrawals() { + return this.all('SELECT * FROM withdrawals ORDER BY created_at DESC'); + } + + // Payment operations + async createPayment(id, amountSats, description, paymentHash, comment = null) { + return this.run( + 'INSERT INTO payments (id, amount_sats, description, payment_hash, comment) VALUES (?, ?, ?, ?, ?)', + [id, amountSats, description, paymentHash, comment] + ); + } + + async getPayment(id) { + return this.get('SELECT * FROM payments WHERE id = ?', [id]); + } + + async updatePaymentPaid(id) { + return this.run('UPDATE payments SET paid = 1 WHERE id = ?', [id]); + } + + async getAllPayments() { + return this.all('SELECT * FROM payments ORDER BY created_at DESC'); + } + + async getUnpaidPayments() { + return this.all('SELECT * FROM payments WHERE paid = 0'); + } + + // Payment config operations + async createPaymentConfig(paymentId, minSendable, maxSendable, commentAllowed) { + return this.run( + 'INSERT OR REPLACE INTO payment_configs (payment_id, min_sendable, max_sendable, comment_allowed) VALUES (?, ?, ?, ?)', + [paymentId, minSendable, maxSendable, commentAllowed] + ); + } + + async getPaymentConfig(paymentId) { + return this.get('SELECT * FROM payment_configs WHERE payment_id = ?', [paymentId]); + } + + // Channel operations + async createChannelRequest(id, k1) { + return this.run( + 'INSERT INTO channel_requests (id, k1) VALUES (?, ?)', + [id, k1] + ); + } + + async getChannelRequest(k1) { + return this.get( + 'SELECT * FROM channel_requests WHERE k1 = ? AND completed = 0 AND cancelled = 0', + [k1] + ); + } + + async updateChannelRequest(k1, remoteId, isPrivate) { + return this.run( + 'UPDATE channel_requests SET remote_id = ?, private = ? WHERE k1 = ?', + [remoteId, isPrivate ? 1 : 0, k1] + ); + } + + async cancelChannelRequest(k1) { + return this.run( + 'UPDATE channel_requests SET cancelled = 1 WHERE k1 = ?', + [k1] + ); + } + + async completeChannelRequest(k1) { + return this.run( + 'UPDATE channel_requests SET completed = 1 WHERE k1 = ?', + [k1] + ); + } + + async getAllChannelRequests() { + return this.all('SELECT * FROM channel_requests ORDER BY created_at DESC'); + } + + // Auth session operations + async createAuthSession(id, k1, expiresAt) { + return this.run( + 'INSERT INTO auth_sessions (id, k1, expires_at) VALUES (?, ?, ?)', + [id, k1, expiresAt] + ); + } + + async getAuthSession(k1) { + return this.get( + 'SELECT * FROM auth_sessions WHERE k1 = ? AND authenticated = 0 AND expires_at > datetime("now")', + [k1] + ); + } + + async authenticateSession(k1, pubkey) { + return this.run( + 'UPDATE auth_sessions SET authenticated = 1, pubkey = ? WHERE k1 = ?', + [pubkey, k1] + ); + } + + async cleanupExpiredAuthSessions() { + return this.run( + 'DELETE FROM auth_sessions WHERE expires_at <= datetime("now")' + ); + } + + async getAllAuthSessions() { + return this.all('SELECT * FROM auth_sessions ORDER BY created_at DESC'); + } + + close() { + this.db.close(); + } +} + +module.exports = new Database(); diff --git a/docker/lnurl-server/keys/private.pem b/docker/lnurl-server/keys/private.pem new file mode 100644 index 0000000..1e0bd9f --- /dev/null +++ b/docker/lnurl-server/keys/private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDRRjY15FsOkMdh +VZYk9zF1ydEPoobbTn+ODx6LgUXhi1QoG+AQHTC5GQt0eQ9/Hh9cVEkQsgW95i1Z +Q5bAUwZQN8xkMrBvp4xDD1ubZSMdzgITqM6LUTmr3d098Pw/KrrF05jr8WQNfY9r +4+LPTtvv/WNYtsS1fTa2E+pyw2vIFALr1AaFEeFda365eE3vZX+5N+hY5tLy/uAt +m6BrfL50Qqu2eYhh1bzpfEGdZt6K6OapUJ/YCc2JeAv4bAY5ySymtheZZcK86iMs +rQL8f1151rW84juSkD6ux4zoSBzjdSwRmtk+a47sLuXputOX9klMBvC8FruM9Dad +wftxvzpPAgMBAAECggEAW1x+oCpwQjycfnbB1KOCGT0hIuU+YJG1iAw7toWaP2v3 +Modw2zgTJEu1v4R2anV5FXLKbxp4/T12wMiMEKxuTij99yRV+Hi5+DDFOmL94K4m +I/UHLrUoK0rxonAJf34lCeZllWPN3UHakixrwTtZMz142Kr5142xi+3H5ZBBBphD +hf6aEFl+6Bg/RigezZDtzm/C9TSoOPl2eUKfiL1BWc6hjYUOY9GZhE3ONQ0exjYT +LjMxSAIuBJ6mfh+rFPommMTCdY15EzsfsNh+cYNJSLe++/P/gUuYnGxlRttcSNdy +U/eYR4r2yOXGMMoldvri5dAPIVsOCv0+yBegInWP2QKBgQD0SUzNwMy2RiAtZXND +ri5F0iv4diMET7xfQUmSZ6MM4cYrd40PU5vYOM8f4F4XPGn1ShfYPz2oDgK/bozQ +fNG3kmXCCBD58j4tJ/RB17jKJpdMnDN1GrhMOzAFeEFwfsKpnl64SejAbwYNW+vl +UEXL9KkxiAn1JWri1xNZ7AW2ZQKBgQDbTyBeVESaMnUwbuUPyYRcNFJwz+pr1SU/ +90oX3PT98sxtPV7OY9iMnqTcEI6pxIHY6mqYfGTD+Rgyt8D5Xy9GvYuwzbyyPMde +RG1QibdQDE+QUiUvDdlqUoxfwvuKlBqogCfp8/Q7hEkp9EhCEHYt3MQ3JGz8Ld3U +nBQ2Cv44owKBgCMEBsBPbIiMELyxGA6Rfwx/DdJ1jJtnmobE4vjbZiHIkxFT96JE +x8f8jKPzE0mdXUrNrhFPL1VRfM9X11NjMORxVai0Y0qQkJ0EZxyxAUnosjNHCJE2 +nUhAC6gdDrRDVz/c9ZLQ9U3wHBv6Gxwpn3eWwFHbQCIllOajEaEIFeGJAoGAQHJ5 +RZ8n5dRsIcaE4+XJUrtBestuzS9+2dRW3rpc+H+wWW3OfYJT8cbxFYZ8FiGcMt14 +Y8Uya3C5DrZ3LBEvuG8dLODY0dwQjoA3S5Kc3xYvD29EZBaCzL7jZ4TKHMg3KUs3 +74V0QUU3pu+ViGyD/ihBNR8sM9NavA791X/Xg1cCgYAZlbnncuNKsKD6m/gGgMfu +qvBtm/q199sODWPRmlxLX9wVYB40Ssq5j4nePlf6V4l+kdHBRo5SYaPvBJOc/HVG +7rba+QEmwpf1/Bw1S4grU6yDKAdqwkFT9xA2sNBJGinkYTBASLqFd0UwQe1LxJ+g +q2UpTGDkfSDPUjeYy7HXkg== +-----END PRIVATE KEY----- diff --git a/docker/lnurl-server/keys/public.pem b/docker/lnurl-server/keys/public.pem new file mode 100644 index 0000000..db2028e --- /dev/null +++ b/docker/lnurl-server/keys/public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0UY2NeRbDpDHYVWWJPcx +dcnRD6KG205/jg8ei4FF4YtUKBvgEB0wuRkLdHkPfx4fXFRJELIFveYtWUOWwFMG +UDfMZDKwb6eMQw9bm2UjHc4CE6jOi1E5q93dPfD8Pyq6xdOY6/FkDX2Pa+Piz07b +7/1jWLbEtX02thPqcsNryBQC69QGhRHhXWt+uXhN72V/uTfoWObS8v7gLZuga3y+ +dEKrtnmIYdW86XxBnWbeiujmqVCf2AnNiXgL+GwGOcksprYXmWXCvOojLK0C/H9d +eda1vOI7kpA+rseM6Egc43UsEZrZPmuO7C7l6brTl/ZJTAbwvBa7jPQ2ncH7cb86 +TwIDAQAB +-----END PUBLIC KEY----- diff --git a/docker/lnurl-server/middleware/errorHandler.js b/docker/lnurl-server/middleware/errorHandler.js new file mode 100644 index 0000000..38da044 --- /dev/null +++ b/docker/lnurl-server/middleware/errorHandler.js @@ -0,0 +1,62 @@ +const Logger = require('../utils/logger'); + +// Error handling middleware +function errorHandler(err, req, res, next) { + Logger.error('Unhandled error', err); + + // Default error response + const errorResponse = { + status: 'ERROR', + reason: err.message || 'Internal server error' + }; + + // Set appropriate status code + let statusCode = 500; + + if (err.name === 'ValidationError') { + statusCode = 400; + } else if (err.name === 'NotFoundError') { + statusCode = 404; + } else if (err.name === 'UnauthorizedError') { + statusCode = 401; + } + + res.status(statusCode).json(errorResponse); +} + +// Async error wrapper for route handlers +function asyncHandler(fn) { + return (req, res, next) => { + Promise.resolve(fn(req, res, next)).catch(next); + }; +} + +// Custom error classes +class ValidationError extends Error { + constructor(message) { + super(message); + this.name = 'ValidationError'; + } +} + +class NotFoundError extends Error { + constructor(message) { + super(message); + this.name = 'NotFoundError'; + } +} + +class UnauthorizedError extends Error { + constructor(message) { + super(message); + this.name = 'UnauthorizedError'; + } +} + +module.exports = { + errorHandler, + asyncHandler, + ValidationError, + NotFoundError, + UnauthorizedError +}; diff --git a/docker/lnurl-server/middleware/httpLogger.js b/docker/lnurl-server/middleware/httpLogger.js new file mode 100644 index 0000000..7a8ad54 --- /dev/null +++ b/docker/lnurl-server/middleware/httpLogger.js @@ -0,0 +1,62 @@ +const Logger = require('../utils/logger'); + +// Helper function to detect HTML content +const isHtmlContent = (data) => { + if (typeof data !== 'string') return false; + const htmlPattern = /<\s*html[^>]*>|<\s*!doctype\s+html|<\s*head[^>]*>|<\s*body[^>]*>/i; + return htmlPattern.test(data.trim()); +}; + +// Log HTTP requests and responses +const httpLogger = (req, res, next) => { + const fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl; + const method = req.method; + + // Log incoming request with separator + console.log('---'); + const requestData = { method, url: fullUrl }; + if (Object.keys(req.query).length > 0) requestData.query = req.query; + if (req.body && Object.keys(req.body).length > 0) { + requestData.body = isHtmlContent(req.body) ? 'html' : req.body; + } + + Logger.info(`HTTP REQUEST`, requestData); + + // Track if we've already logged the response to avoid duplicates + let responseLogged = false; + + const logResponse = (data) => { + if (responseLogged) return; + responseLogged = true; + + console.log('---'); + const responseData = { method, url: fullUrl, status: res.statusCode }; + if (Object.keys(req.query).length > 0) responseData.query = req.query; + if (data !== undefined && data !== null) { + responseData.body = isHtmlContent(data) ? 'html' : data; + } + + Logger.info(`HTTP RESPONSE`, responseData); + }; + + // Capture original res.json and res.send methods to log responses + const originalJson = res.json; + const originalSend = res.send; + + res.json = function(obj) { + logResponse(obj); + return originalJson.call(this, obj); + }; + + res.send = function(data) { + // Only log if it's not already logged by res.json + if (!responseLogged) { + logResponse(data); + } + return originalSend.call(this, data); + }; + + next(); +}; + +module.exports = httpLogger; \ No newline at end of file diff --git a/docker/lnurl-server/package-lock.json b/docker/lnurl-server/package-lock.json new file mode 100644 index 0000000..b568b22 --- /dev/null +++ b/docker/lnurl-server/package-lock.json @@ -0,0 +1,3717 @@ +{ + "name": "lnurl-server", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "lnurl-server", + "version": "1.0.0", + "dependencies": { + "bolt11": "^1.4.1", + "cors": "^2.8.5", + "express": "^4.18.2", + "lnurl": "^0.25.0", + "qrcode": "^1.5.3", + "secp256k1": "^5.0.1", + "sqlite3": "^5.1.6" + } + }, + "node_modules/@bleskomat/form": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@bleskomat/form/-/form-1.3.2.tgz", + "integrity": "sha512-7Q1/IWRTWs+WhCvnvRnH0XcmuVEfFChTpGiw6SgRCt9PbVtKXpse3QgvCjiIF3nLtIFq34CAVoA456tTLsu/Mg==", + "license": "MIT", + "dependencies": { + "express-handlebars": "6.0.7" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT", + "optional": true + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz", + "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.8.0" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", + "optional": true + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aproba": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", + "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", + "license": "ISC", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/async": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", + "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/base-x": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.1.tgz", + "integrity": "sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw==", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", + "license": "MIT" + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bip174": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bip174/-/bip174-2.1.1.tgz", + "integrity": "sha512-mdFV5+/v0XyNYXjBS6CQPLo9ekCx4gtKZFnJm5PMto7Fs9hTTDpkkzOB7/FtluRI6JbUUAu+snTYfJRgHLZbZQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/bitcoinjs-lib": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.7.tgz", + "integrity": "sha512-tlf/r2DGMbF7ky1MgUqXHzypYHakkEnm0SZP23CJKIqNY/5uNAnMbFhMJdhjrL/7anfb/U8+AlpdjPWjPnAalg==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bech32": "^2.0.0", + "bip174": "^2.1.1", + "bs58check": "^3.0.1", + "typeforce": "^1.11.3", + "varuint-bitcoin": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bolt11": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/bolt11/-/bolt11-1.4.1.tgz", + "integrity": "sha512-jR0Y+MO+CK2at1Cg5mltLJ+6tdOwNKoTS/DJOBDdzVkQ+R9D6UgZMayTWOsuzY7OgV1gEqlyT5Tzk6t6r4XcNQ==", + "license": "MIT", + "dependencies": { + "@types/bn.js": "^4.11.3", + "bech32": "^1.1.2", + "bitcoinjs-lib": "^6.0.0", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "lodash": "^4.17.11", + "safe-buffer": "^5.1.1", + "secp256k1": "^4.0.2" + } + }, + "node_modules/bolt11/node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "license": "MIT" + }, + "node_modules/bolt11/node_modules/secp256k1": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.4.tgz", + "integrity": "sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.7", + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "license": "MIT" + }, + "node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "license": "MIT", + "dependencies": { + "base-x": "^4.0.0" + } + }, + "node_modules/bs58check": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", + "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bs58": "^5.0.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/cacache/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/cacache/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cacache/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/cipher-base": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.6.tgz", + "integrity": "sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/commander": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT", + "optional": true + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", + "optional": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", + "optional": true + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "license": "MIT" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/elliptic": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT", + "optional": true + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-handlebars": { + "version": "6.0.7", + "resolved": "https://registry.npmjs.org/express-handlebars/-/express-handlebars-6.0.7.tgz", + "integrity": "sha512-iYeMFpc/hMD+E6FNAZA5fgWeXnXr4rslOSPkeEV6TwdmpJ5lEXuWX0u9vFYs31P2MURctQq2batR09oeNj0LIg==", + "license": "BSD-3-Clause", + "dependencies": { + "glob": "^8.1.0", + "graceful-fs": "^4.2.10", + "handlebars": "^4.7.7" + }, + "engines": { + "node": ">=v12.22.9" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", + "optional": true + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC", + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT", + "optional": true + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC", + "optional": true + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, + "node_modules/lightning-backends": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/lightning-backends/-/lightning-backends-1.6.3.tgz", + "integrity": "sha512-cUiwWSbuC9z14WOzo3SSb+5e+ZnRarieUp0HyK/TSHDt2bx/ian4qzyRPBMEX5kgT+7mh55R4rxzz/pBksbU8g==", + "license": "MIT", + "dependencies": { + "@bleskomat/form": "1.3.2", + "async": "3.2.4", + "bolt11": "1.4.1", + "secp256k1": "5.0.0", + "socks-proxy-agent": "7.0.0" + } + }, + "node_modules/lightning-backends/node_modules/secp256k1": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.0.tgz", + "integrity": "sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/lnurl": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/lnurl/-/lnurl-0.25.2.tgz", + "integrity": "sha512-i+NQ3gJKroUQnuGIhc9R/7QTxe7vJt9rcD1LCNrDDtSJfQRtsfk3uibaxzACtXS8ojzgvUBei4DtwpppimS+Ng==", + "license": "MIT", + "dependencies": { + "async": "3.2.4", + "bech32": "2.0.0", + "bignumber.js": "9.1.2", + "bolt11": "1.4.1", + "commander": "11.0.0", + "debug": "4.3.4", + "express": "4.18.2", + "lightning-backends": "1.6.3", + "lnurl-offline": "1.2.0", + "secp256k1": "5.0.0" + }, + "bin": { + "lnurl": "cli.js" + } + }, + "node_modules/lnurl-offline": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lnurl-offline/-/lnurl-offline-1.2.0.tgz", + "integrity": "sha512-orNcYGfRYgM5IFmLeCIG4Zm2bN29uYQSwDo4bK8KOrU4mEB+ff18Yg5sQ1vCJ/fz0qWUJx1Dd0/GsEs3d+eaqA==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/lnurl/node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lnurl/node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/lnurl/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/lnurl/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/lnurl/node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/lnurl/node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lnurl/node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/lnurl/node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lnurl/node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/lnurl/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/lnurl/node_modules/secp256k1": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.0.tgz", + "integrity": "sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/lnurl/node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lnurl/node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/lnurl/node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/lnurl/node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "license": "ISC", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-fetch-happen/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/make-fetch-happen/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/make-fetch-happen/node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "license": "MIT" + }, + "node_modules/node-abi": { + "version": "3.75.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.75.0.tgz", + "integrity": "sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "license": "MIT" + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "license": "MIT", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-gyp/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/node-gyp/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "license": "MIT", + "dependencies": { + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/secp256k1": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-5.0.1.tgz", + "integrity": "sha512-lDFs9AAIaWP9UCdtWrotXWWF9t8PWgQDcxqgAnpM9rMqxb3Oaq2J0thzPVSxBwdJgyQtkU/sYtFtbM1RSt/iYA==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.7", + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sha.js": { + "version": "2.4.12", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", + "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" + }, + "bin": { + "sha.js": "bin.js" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", + "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", + "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, + "node_modules/sqlite3": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", + "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.1", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/sqlite3/node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.3.tgz", + "integrity": "sha512-090nwYJDmlhwFwEW3QQl+vaNnxsO2yVsd45eTKRBzSzu+hlb1w2K9inVq5b0ngXuLVqQ4ApvsUHHnu/zQNkWAg==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/to-buffer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.1.tgz", + "integrity": "sha512-tB82LpAIWjhLYbqjx3X4zEeHN6M8CiuOEy2JY8SEQVdYRe3CCHOFaqrBW1doLDrfpWhplcW7BL+bO3/6S3pcDQ==", + "license": "MIT", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typeforce": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", + "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==", + "license": "MIT" + }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/undici-types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", + "license": "MIT" + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/varuint-bitcoin": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", + "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.1" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "license": "MIT" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/docker/lnurl-server/package.json b/docker/lnurl-server/package.json new file mode 100644 index 0000000..21e1ca2 --- /dev/null +++ b/docker/lnurl-server/package.json @@ -0,0 +1,19 @@ +{ + "name": "lnurl-server", + "version": "1.0.0", + "description": "LNURL server", + "main": "server.js", + "type": "commonjs", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "bolt11": "^1.4.1", + "cors": "^2.8.5", + "express": "^4.18.2", + "lnurl": "^0.25.0", + "qrcode": "^1.5.3", + "secp256k1": "^5.0.1", + "sqlite3": "^5.1.6" + } +} diff --git a/docker/lnurl-server/routes/admin.js b/docker/lnurl-server/routes/admin.js new file mode 100644 index 0000000..0669f92 --- /dev/null +++ b/docker/lnurl-server/routes/admin.js @@ -0,0 +1,266 @@ +const express = require('express'); +const router = express.Router(); + +const config = require('../config'); +const db = require('../database'); +const bitcoinService = require('../services/bitcoin'); +const lndService = require('../services/lnd'); +const Logger = require('../utils/logger'); +const { asyncHandler } = require('../middleware/errorHandler'); +const templates = require('../templates'); + +router.get('/', asyncHandler(async (req, res) => { + const connections = await checkConnections(); + const html = templates.renderRootPage({ + health: connections, + domain: config.domain + }); + res.setHeader('Content-Type', 'text/html'); + res.send(html); +})); + +// Health check endpoint +router.get('/health', asyncHandler(async (req, res) => { + const connections = await checkConnections(); + const sessions = await getSessions(); + + res.json({ + status: connections.bitcoin && connections.lnd ? 'healthy' : 'unhealthy', + lnurl_server: 'running', + bitcoin_connected: connections.bitcoin, + lnd_connected: connections.lnd, + block_height: connections.blockHeight, + lnd: connections.nodeInfo, + auth_sessions: sessions, + domain: config.domain + }); +})); + +// List all payments endpoint +router.get('/payments', asyncHandler(async (req, res) => { + const payments = await db.getAllPayments(); + + res.json({ + payments: payments.map(p => ({ + id: p.id, + amount_sats: p.amount_sats, + description: p.description, + comment: p.comment, + paid: Boolean(p.paid), + created_at: p.created_at + })) + }); +})); + +// List all withdrawals endpoint +router.get('/withdrawals', asyncHandler(async (req, res) => { + const withdrawals = await db.getAllWithdrawals(); + + res.json({ + withdrawals: withdrawals.map(w => ({ + id: w.id, + k1: w.k1, + amount_sats: w.amount_sats, + used: Boolean(w.used), + created_at: w.created_at + })) + }); +})); + +// List all channel requests endpoint +router.get('/channels', asyncHandler(async (req, res) => { + const channels = await db.getAllChannelRequests(); + + res.json({ + channels: channels.map(c => ({ + id: c.id, + k1: c.k1, + remote_id: c.remote_id, + private: Boolean(c.private), + cancelled: Boolean(c.cancelled), + completed: Boolean(c.completed), + created_at: c.created_at + })) + }); +})); + +// Check payment status endpoint +router.get('/payment/:paymentId/status', asyncHandler(async (req, res) => { + const { paymentId } = req.params; + + // Get payment from database + const payment = await db.getPayment(paymentId); + if (!payment) { + return res.status(404).json({ error: 'Payment not found' }); + } + + // If already marked as paid, return status + if (payment.paid) { + return res.json({ + paymentId, + paid: true, + amount_sats: payment.amount_sats, + description: payment.description, + comment: payment.comment, + created_at: payment.created_at + }); + } + + // Check with LND if invoice is settled + try { + const invoice = await lndService.getInvoice(payment.payment_hash); + + if (invoice.settled) { + await db.updatePaymentPaid(paymentId); + + res.json({ + paymentId, + paid: true, + amount_sats: payment.amount_sats, + description: payment.description, + comment: payment.comment, + created_at: payment.created_at, + settled_at: new Date().toISOString() + }); + } else { + res.json({ + paymentId, + paid: false, + amount_sats: payment.amount_sats, + description: payment.description, + comment: payment.comment, + created_at: payment.created_at + }); + } + } catch (lndError) { + Logger.error('Error checking invoice status', lndError); + res.json({ + paymentId, + paid: false, + amount_sats: payment.amount_sats, + description: payment.description, + comment: payment.comment, + created_at: payment.created_at, + error: 'Could not verify payment status' + }); + } +})); + +// Get new LND address for funding +router.get('/address', asyncHandler(async (req, res) => { + const addressInfo = await lndService.getNewAddress(); + res.json({ lnd: addressInfo.address }); +})); + +// Get LND wallet balance +router.get('/balance', asyncHandler(async (req, res) => { + const balance = await lndService.getWalletBalance(); + res.json(balance); +})); + + +// List all auth sessions endpoint +router.get('/sessions', asyncHandler(async (req, res) => { + const sessions = await db.getAllAuthSessions(); + + res.json({ + sessions: sessions.map(s => ({ + id: s.id, + k1: s.k1, + pubkey: s.pubkey, + authenticated: Boolean(s.authenticated), + created_at: s.created_at, + expires_at: s.expires_at + })) + }); +})); + + +// Helper function to check connections +async function checkConnections() { + const result = { bitcoin: false, lnd: false, error: null, blockHeight: null, nodeInfo: null }; + + // Test Bitcoin connection + try { + const blockHeight = await bitcoinService.getBlockCount(); + Logger.connection('Bitcoin', 'connected', { blockHeight }); + result.bitcoin = true; + result.blockHeight = blockHeight; + } catch (error) { + Logger.connection('Bitcoin', 'failed', { error: error.message }); + result.error = `Bitcoin: ${error.message}`; + } + + // Test LND connection + try { + const nodeInfo = await lndService.getInfo(); + Logger.connection('LND', 'connected', { identity: nodeInfo.identity_pubkey }); + result.lnd = true; + + // Fetch address and balance info + let addressInfo = null; + let balanceInfo = null; + + try { + const addrResponse = await lndService.getNewAddress(); + addressInfo = addrResponse?.address || addrResponse; + } catch (error) { + Logger.error('Failed to get LND address', error); + } + + try { + balanceInfo = await lndService.getWalletBalance(); + } catch (error) { + Logger.error('Failed to get LND balance', error); + } + + // Reorder properties: address and balance after uris, chains moved down + const { uris, chains, require_htlc_interceptor, store_final_htlc_resolutions, features, ...restNodeInfo } = nodeInfo; + result.nodeInfo = { + ...restNodeInfo, + uris, + address: addressInfo, + balance: balanceInfo, + require_htlc_interceptor, + store_final_htlc_resolutions, + chains, + features + }; + } catch (error) { + Logger.connection('LND', 'failed', { error: error.message }); + if (!result.error) { + result.error = `LND: ${error.message}`; + } else { + result.error += `, LND: ${error.message}`; + } + } + + return result; +} + +// Helper to get auth sessions +async function getSessions() { + try { + const allSessions = await db.getAllAuthSessions(); + const now = new Date().toISOString(); + + const activeSessions = allSessions.filter(s => s.expires_at > now); + const authenticatedSessions = allSessions.filter(s => s.authenticated && s.expires_at > now); + + return { + total_sessions: allSessions.length, + active_sessions: activeSessions.length, + authenticated_sessions: authenticatedSessions.length + }; + } catch (error) { + Logger.error('Error getting auth stats', error); + return { + total_sessions: 0, + active_sessions: 0, + authenticated_sessions: 0 + }; + } +} + + +module.exports = router; diff --git a/docker/lnurl-server/routes/auth.js b/docker/lnurl-server/routes/auth.js new file mode 100644 index 0000000..c54a3d1 --- /dev/null +++ b/docker/lnurl-server/routes/auth.js @@ -0,0 +1,97 @@ +const express = require('express'); +const router = express.Router(); +const { encode } = require('lnurl'); + +const config = require('../config'); +const db = require('../database'); +const Validation = require('../utils/validation'); +const Logger = require('../utils/logger'); +const { asyncHandler, ValidationError } = require('../middleware/errorHandler'); + +// LNURL-auth endpoint +router.get('/', asyncHandler(async (req, res) => { + const { sig, key, k1 } = req.query; + + if (sig && key && k1) { + // Verify signed request + await handleSignedRequest(req, res); + } else { + // Generate new auth challenge + await handleEmptyRequest(req, res); + } +})); + +async function handleSignedRequest(req, res) { + const { tag, k1, sig, key, action } = req.query; + + // Validate input params + if (!Validation.isValidK1(k1)) { + throw new ValidationError('Invalid k1 parameter - must be 32-byte hex string'); + } + + if (!Validation.isValidSignature(sig)) { + throw new ValidationError('Invalid sig parameter - must be DER-hex-encoded ECDSA signature'); + } + + if (!Validation.isValidPublicKey(key)) { + throw new ValidationError('Invalid key parameter - must be compressed 33-byte secp256k1 public key'); + } + + // action: optional, but if present must be valid enum + if (!Validation.isValidAuthAction(action)) { + throw new ValidationError('Invalid action parameter'); + } + + // Get session from db + const authSession = await db.getAuthSession(k1); + if (!authSession) { + Logger.error('Auth session not found or expired for k1:', k1); + return res.status(400).json({ + status: 'ERROR', + reason: 'Invalid or expired k1' + }); + } + + // Verify the signature + const isValidSignature = Validation.verifyLnurlAuthSignature(k1, sig, key); + if (!isValidSignature) { + Logger.error('Invalid auth signature', { k1, pubkey: key }); + return res.status(400).json({ + status: 'ERROR', + reason: 'Invalid signature' + }); + } + + await db.authenticateSession(k1, key); + + // Return success without JWT token + res.json({ + status: 'OK' + }); +} + +async function handleEmptyRequest(req, res) { + const { action = 'login' } = req.query; + + if (!Validation.isValidAuthAction(action)) { + throw new ValidationError('Invalid action parameter'); + } + + // Generate k1 and session + const k1 = Validation.generateK1(); + const sessionId = Validation.generateId(); + + // Calculate expiration time + const expiresAt = Validation.calculateSessionExpiry(); + + // Store auth session in db + await db.createAuthSession(sessionId, k1, expiresAt.toISOString()); + + // Build auth URL + const authUrl = `${config.domain}/auth?tag=login&k1=${k1}&action=${action}`; + + // Return raw callback URL (for ldk-node vss auth via LNURL) + res.type('text/plain').send(authUrl); +} + +module.exports = router; diff --git a/docker/lnurl-server/routes/channel.js b/docker/lnurl-server/routes/channel.js new file mode 100644 index 0000000..a9ecc80 --- /dev/null +++ b/docker/lnurl-server/routes/channel.js @@ -0,0 +1,82 @@ +const express = require('express'); +const router = express.Router(); + +const config = require('../config'); +const db = require('../database'); +const lndService = require('../services/lnd'); +const Validation = require('../utils/validation'); +const Logger = require('../utils/logger'); +const { asyncHandler, ValidationError } = require('../middleware/errorHandler'); + +// LNURL-channel endpoint +router.get('/', asyncHandler(async (req, res) => { + const k1 = Validation.generateK1(); + const channelId = Validation.generateId(); + + // Store channel request + await db.createChannelRequest(channelId, k1); + + // Get node URI + const uri = await lndService.getNodeURI(); + const callbackUrl = `${config.domain}/channel/callback?k1=${k1}`; + + Logger.channel('request created', { k1, channelId, uri }); + + res.json({ + tag: 'channelRequest', + uri: uri, + callback: callbackUrl, + k1: k1 + }); +})); + +// LNURL-channel callback +router.get('/callback', asyncHandler(async (req, res) => { + const { k1, remoteid, private: isPrivate, cancel } = req.query; + + // Validate input parameters + const validationErrors = Validation.validateChannelRequest({ k1, remoteid, private: isPrivate, cancel }); + if (validationErrors.length > 0) { + throw new ValidationError(validationErrors.join(', ')); + } + + // Get channel request from database + const channelRequest = await db.getChannelRequest(k1); + if (!channelRequest) { + throw new ValidationError('Invalid or used k1'); + } + + if (cancel === '1') { + // User cancelled the channel request + await db.cancelChannelRequest(k1); + Logger.channel('cancelled', { k1 }); + return res.json({ status: 'OK' }); + } + + // Store the remote node ID and private flag + const privateFlag = isPrivate === '1'; + await db.updateChannelRequest(k1, remoteid, privateFlag); + + Logger.channel('initiated', { k1, remoteid, private: privateFlag }); + + try { + // Open channel to the remote node + const channelAmount = config.limits.defaultChannelAmount; + await lndService.openChannel(remoteid, channelAmount, privateFlag); + + Logger.channel('opening', { k1, remoteid, amount: channelAmount, private: privateFlag }); + + // Mark channel request as completed + await db.completeChannelRequest(k1); + + Logger.channel('completed', { k1, remoteid }); + } catch (error) { + Logger.error('Channel opening failed', error); + // Don't fail the callback, just log the error + // The wallet will retry or handle the failure + } + + res.json({ status: 'OK' }); +})); + +module.exports = router; diff --git a/docker/lnurl-server/routes/decoder.js b/docker/lnurl-server/routes/decoder.js new file mode 100644 index 0000000..089f8f3 --- /dev/null +++ b/docker/lnurl-server/routes/decoder.js @@ -0,0 +1,441 @@ +const express = require('express'); +const router = express.Router(); +const bolt11 = require('bolt11'); +const lnurl = require('lnurl'); + +const templates = require('../templates'); +const Logger = require('../utils/logger'); +const { asyncHandler } = require('../middleware/errorHandler'); + +// ============================================================================ +// Helper Functions +// ============================================================================ + +/** + * Parse a BIP21 URI into its components + * Format: bitcoin:
?param1=value1¶m2=value2 + * Common params: amount, label, message, lightning + */ +function parseBIP21(uri) { + if (!uri.toLowerCase().startsWith('bitcoin:')) { + throw new Error('Invalid BIP21 URI: must start with "bitcoin:"'); + } + + const withoutScheme = uri.slice(8); + const questionIndex = withoutScheme.indexOf('?'); + + let address, queryString; + if (questionIndex === -1) { + address = withoutScheme; + queryString = ''; + } else { + address = withoutScheme.slice(0, questionIndex); + queryString = withoutScheme.slice(questionIndex + 1); + } + + if (!address) { + throw new Error('Invalid BIP21 URI: missing Bitcoin address'); + } + + const params = {}; + if (queryString) { + const urlParams = new URLSearchParams(queryString); + for (const [key, value] of urlParams) { + params[key.toLowerCase()] = value; + } + } + + return { + address, + amount: params.amount ? parseFloat(params.amount) : null, + label: params.label || null, + message: params.message || null, + lightning: params.lightning || null, + otherParams: Object.fromEntries( + Object.entries(params).filter(([k]) => + !['amount', 'label', 'message', 'lightning'].includes(k) + ) + ) + }; +} + +/** + * Detect the type of input string + * Returns: 'bip21', 'bolt11', 'lnurl', or 'unknown' + */ +function detectInputType(input) { + const trimmed = input.trim(); + const lower = trimmed.toLowerCase(); + + if (lower.startsWith('bitcoin:')) { + return 'bip21'; + } + + if (lower.startsWith('lnurl') || /^lnurl1[a-z0-9]+$/i.test(trimmed)) { + return 'lnurl'; + } + + if (/^ln(bc|bcrt|tb|tbs)/.test(lower)) { + return 'bolt11'; + } + + return 'unknown'; +} + +/** + * Helper to extract tag data from bolt11 tags array + */ +function getTagData(tags, tagName) { + if (!tags) return null; + const tag = tags.find(t => t.tagName === tagName); + return tag ? tag.data : null; +} + +/** + * Decode a BOLT11 invoice with comprehensive field extraction + * Matches fields shown by lightningdecoder.com + */ +function decodeBolt11Full(invoice) { + const decoded = bolt11.decode(invoice); + + // Extract values from tags array (bolt11 library stores most fields here) + const tags = decoded.tags || []; + const description = getTagData(tags, 'description'); + const descriptionHash = getTagData(tags, 'purpose_commit_hash'); + const paymentHash = getTagData(tags, 'payment_hash'); + const paymentSecret = getTagData(tags, 'payment_secret'); + const expireTime = getTagData(tags, 'expire_time'); + const minFinalCltvExpiry = getTagData(tags, 'min_final_cltv_expiry'); + const routingInfo = getTagData(tags, 'routing_info'); + const fallbackAddress = getTagData(tags, 'fallback_address'); + const featureBits = getTagData(tags, 'feature_bits'); + + // Calculate time expire date + const timeExpireDate = decoded.timeExpireDate || + (decoded.timestamp && expireTime ? decoded.timestamp + expireTime : null); + + // Extract prefix from decoded object or invoice string + const prefix = decoded.prefix || invoice.toLowerCase().match(/^(lnbcrt|lnbc|lntbs|lntb)/)?.[1] || null; + + // Signature and recovery flag + const signatureHex = typeof decoded.signature === 'string' ? decoded.signature : null; + const recoveryFlag = decoded.recoveryFlag !== undefined ? decoded.recoveryFlag : null; + + // Collect unknown tags (tags not in standard set) + const knownTags = ['description', 'purpose_commit_hash', 'payment_hash', 'payment_secret', + 'expire_time', 'min_final_cltv_expiry', 'routing_info', 'fallback_address', + 'feature_bits', 'payee_node_key']; + const unknownTags = tags + .filter(t => !knownTags.includes(t.tagName)) + .map(t => ({ + tagName: t.tagName, + tagCode: t.tagCode || null, + data: t.data + })); + + return { + // Network info + chain: decoded.network || null, + prefix: prefix, + + // Amount + amount: decoded.millisatoshis ? { + millisatoshis: decoded.millisatoshis, + satoshis: Math.floor(parseInt(decoded.millisatoshis) / 1000), + btc: parseInt(decoded.millisatoshis) / 100000000000 + } : (decoded.satoshis ? { + millisatoshis: decoded.satoshis * 1000, + satoshis: decoded.satoshis, + btc: decoded.satoshis / 100000000 + } : null), + + // Payee info + payeePubKey: decoded.payeeNodeKey || getTagData(tags, 'payee_node_key') || null, + + // Payment identification + paymentHash: paymentHash || null, + paymentSecret: paymentSecret || null, + + // Description + description: description || null, + descriptionHash: descriptionHash || null, + + // Timestamps + timestamp: decoded.timestamp || null, + timestampString: decoded.timestampString || + (decoded.timestamp ? new Date(decoded.timestamp * 1000).toISOString() : null), + + // Expiry + expiry: expireTime || null, + timeExpireDate: timeExpireDate || null, + timeExpireDateString: decoded.timeExpireDateString || + (timeExpireDate ? new Date(timeExpireDate * 1000).toISOString() : null), + + // CLTV + minFinalCltvExpiry: minFinalCltvExpiry || null, + + // Signature + recoveryFlag: recoveryFlag, + signature: decoded.signature || null, + signatureHex: signatureHex, + + // Routing info with detailed fields + routingInfo: routingInfo ? routingInfo.map(hop => ({ + pubKey: hop.pubkey || null, + shortChannelId: hop.short_channel_id || null, + feeBaseMsat: hop.fee_base_msat || null, + feeProportionalMillionths: hop.fee_proportional_millionths || null, + cltvExpiryDelta: hop.cltv_expiry_delta || null + })) : [], + + // Fallback addresses + fallbackAddresses: fallbackAddress ? [fallbackAddress] : (decoded.fallbackAddresses || []), + + // Features + features: featureBits || decoded.features || {}, + + // Unknown tags + unknownTags: unknownTags.length > 0 ? unknownTags : [], + + // Raw invoice + invoice: invoice + }; +} + +/** + * Decode LNURL string + */ +function decodeLNURL(lnurlString) { + return lnurl.decode(lnurlString); +} + +/** + * Decode BIP21 URI with embedded Lightning invoice + */ +function decodeBIP21Full(uri) { + const parsed = parseBIP21(uri); + + const result = { + onchain: { + address: parsed.address, + amount: parsed.amount, + amountSats: parsed.amount ? Math.round(parsed.amount * 100000000) : null, + label: parsed.label, + message: parsed.message, + otherParams: Object.keys(parsed.otherParams).length > 0 ? parsed.otherParams : undefined + } + }; + + // If there's a lightning invoice embedded, decode it + if (parsed.lightning) { + try { + result.lightning = { + invoice: parsed.lightning, + decoded: decodeBolt11Full(parsed.lightning) + }; + } catch (error) { + result.lightning = { + invoice: parsed.lightning, + error: 'Failed to decode embedded Lightning invoice: ' + error.message + }; + } + } + + return result; +} + +// Serve the decoder page UI +router.get('/', asyncHandler(async (req, res) => { + const html = templates.renderDecoderPage(); + res.setHeader('Content-Type', 'text/html'); + res.send(html); +})); + +// ============================================================================ +// API Endpoints +// ============================================================================ + +// Unified decode endpoint with auto-detection +router.post('/auto', asyncHandler(async (req, res) => { + const { input } = req.body; + + if (!input) { + return res.status(400).json({ + success: false, + error: 'Missing input parameter' + }); + } + + const inputType = detectInputType(input); + + try { + let decoded; + + switch (inputType) { + case 'bip21': + decoded = decodeBIP21Full(input); + Logger.info('BIP21 URI decoded', { address: decoded.onchain.address }); + break; + + case 'bolt11': + decoded = decodeBolt11Full(input); + Logger.info('BOLT11 invoice decoded', { paymentHash: decoded.paymentHash }); + break; + + case 'lnurl': + decoded = decodeLNURL(input); + Logger.info('LNURL decoded', { decoded }); + break; + + default: + return res.status(400).json({ + success: false, + error: 'Unable to detect input type. Supported types: BIP21 URI (bitcoin:...), BOLT11 invoice (lnbc...), LNURL (lnurl1...)' + }); + } + + res.json({ + success: true, + type: inputType, + input: input, + decoded: decoded + }); + + } catch (error) { + Logger.error('Error decoding input', { type: inputType, error: error.message }); + res.status(400).json({ + success: false, + type: inputType, + error: error.message + }); + } +})); + +// BIP21 decode endpoint +router.post('/bip21', asyncHandler(async (req, res) => { + const { uri } = req.body; + + if (!uri) { + return res.status(400).json({ + success: false, + error: 'Missing uri parameter' + }); + } + + try { + const decoded = decodeBIP21Full(uri); + Logger.info('BIP21 URI decoded', { address: decoded.onchain.address }); + + res.json({ + success: true, + type: 'bip21', + uri: uri, + decoded: decoded + }); + } catch (error) { + Logger.error('Error decoding BIP21 URI', error); + res.status(400).json({ + success: false, + error: 'Invalid BIP21 URI: ' + error.message + }); + } +})); + +// Decode Lightning invoice endpoint (enhanced with full fields) +router.post('/lightning', asyncHandler(async (req, res) => { + const { invoice } = req.body; + + if (!invoice) { + return res.status(400).json({ + error: 'Missing invoice parameter' + }); + } + + try { + const decoded = decodeBolt11Full(invoice); + Logger.info('Lightning invoice decoded', { + paymentHash: decoded.paymentHash, + amount: decoded.amount?.millisatoshis + }); + + res.json({ + success: true, + type: 'bolt11', + invoice: invoice, + decoded: decoded + }); + } catch (error) { + Logger.error('Error decoding Lightning invoice', error); + res.status(400).json({ + success: false, + error: 'Invalid Lightning invoice: ' + error.message + }); + } +})); + +// Decode LNURL endpoint +router.post('/lnurl/decode', asyncHandler(async (req, res) => { + const { lnurlString } = req.body; + + if (!lnurlString) { + return res.status(400).json({ + error: 'Missing lnurlString parameter' + }); + } + + try { + const decoded = lnurl.decode(lnurlString); + Logger.info('LNURL decoded', { + original: lnurlString, + decoded: decoded + }); + + res.json({ + success: true, + lnurl: lnurlString, + decoded: decoded + }); + } catch (error) { + Logger.error('Error decoding LNURL', error); + res.status(400).json({ + success: false, + error: 'Invalid LNURL: ' + error.message + }); + } +})); + +// Encode URL to LNURL endpoint +router.post('/lnurl/encode', asyncHandler(async (req, res) => { + const { url } = req.body; + + if (!url) { + return res.status(400).json({ + error: 'Missing url parameter' + }); + } + + try { + // Validate URL format + new URL(url); + + const encoded = lnurl.encode(url); + Logger.info('URL encoded to LNURL', { + original: url, + encoded: encoded + }); + + res.json({ + success: true, + url: url, + encoded: encoded + }); + } catch (error) { + Logger.error('Error encoding URL to LNURL', error); + res.status(400).json({ + success: false, + error: 'Invalid URL or encoding error: ' + error.message + }); + } +})); + +module.exports = router; \ No newline at end of file diff --git a/docker/lnurl-server/routes/generate.js b/docker/lnurl-server/routes/generate.js new file mode 100644 index 0000000..d0292b2 --- /dev/null +++ b/docker/lnurl-server/routes/generate.js @@ -0,0 +1,222 @@ +const express = require('express'); +const router = express.Router(); +const { encode } = require('lnurl'); +const QRCode = require('qrcode'); + +const config = require('../config'); +const db = require('../database'); +const lndService = require('../services/lnd'); +const Validation = require('../utils/validation'); +const Logger = require('../utils/logger'); +const { asyncHandler, ValidationError } = require('../middleware/errorHandler'); +const templates = require('../templates'); + +// Generate index HTML page +router.get('/', asyncHandler(async (req, res) => { + const html = templates.renderGeneratorPage({}); + res.setHeader('Content-Type', 'text/html'); + res.send(html); +})); + +// Generate LNURL +router.get('/:type', asyncHandler(async (req, res) => { + const { type } = req.params; + const data = await generateLnurl(type, req.query); + res.json(data); +})); + +// Generate QR code in HTML +router.get('/:type/qr', asyncHandler(async (req, res) => { + const { type } = req.params; + const data = await generateLnurl(type, req.query); + const html = templates.renderQrPage({ + type, + qrCode: data.qrCode, + url: data.url + }); + + res.setHeader('Content-Type', 'text/html'); + res.send(html); +})); + + +const generateLnurl = async (type, query) => { + switch (type) { + case 'withdraw': + return await generateLnurlWithdraw(query); + case 'pay': + return await generateLnurlPay(query); + case 'channel': + return await generateLnurlChannel(); + case 'auth': + return await generateLnurlAuth(query); + case 'bolt11': + return await generateBolt11(query); + default: + throw new ValidationError('Invalid type. Use "withdraw", "pay", "channel", "auth", or "bolt11"'); + } +}; + +const generateLnurlWithdraw = async (query) => { + const { minWithdrawable, maxWithdrawable } = query; + + // Build URL with optional params + let url = `${config.domain}/withdraw`; + const params = new URLSearchParams(); + if (minWithdrawable) params.append('minWithdrawable', minWithdrawable); + if (maxWithdrawable) params.append('maxWithdrawable', maxWithdrawable); + if (params.toString()) url += `?${params.toString()}`; + + const lnurl = encode(url); + const qrCode = await QRCode.toDataURL(lnurl, { + width: 256, + margin: 2, + color: { + dark: '#000000', + light: '#ffffff' + } + }); + + return { + url, + lnurl, + qrCode, + type: 'withdraw' + }; +}; + +const generateLnurlPay = async (query) => { + const { minSendable, maxSendable, commentAllowed } = query; + const paymentId = Validation.generateId(); + + // Store payment configuration in database + const minSendableValue = minSendable ? parseInt(minSendable) : config.limits.minSendable; + const maxSendableValue = maxSendable ? parseInt(maxSendable) : config.limits.maxSendable; + const commentAllowedValue = commentAllowed ? parseInt(commentAllowed) : config.limits.commentAllowed; + + await db.createPaymentConfig(paymentId, minSendableValue, maxSendableValue, commentAllowedValue); + + // Build URL (no query parameters needed since config is in DB) + const paymentUrl = `${config.domain}/pay/${paymentId}`; + const lnurl = encode(paymentUrl); + const qrCode = await QRCode.toDataURL(lnurl, { + width: 256, + margin: 2, + color: { + dark: '#000000', + light: '#ffffff' + } + }); + + Logger.info('Payment config created', { paymentId, minSendable: minSendableValue, maxSendable: maxSendableValue }); + + return { + url: paymentUrl, + lnurl, + qrCode, + paymentId, + type: 'pay', + minSendable: minSendableValue, + maxSendable: maxSendableValue, + commentAllowed: commentAllowedValue + }; +}; + +const generateLnurlChannel = async () => { + const channelUrl = `${config.domain}/channel`; + const lnurl = encode(channelUrl); + const qrCode = await QRCode.toDataURL(lnurl, { + width: 256, + margin: 2, + color: { + dark: '#000000', + light: '#ffffff' + } + }); + + return { + url: channelUrl, + lnurl, + qrCode, + type: 'channel' + }; +}; + +const generateLnurlAuth = async (query) => { + const { action = 'login' } = query; + + if (!Validation.isValidAuthAction(action)) { + throw new ValidationError('Invalid action parameter'); + } + + const k1 = Validation.generateK1(); + const sessionId = Validation.generateId(); + + // Calculate expiration time + const expiresAt = Validation.calculateSessionExpiry(); + + // Store session in db + await db.createAuthSession(sessionId, k1, expiresAt.toISOString()); + + // Build auth URL + const authUrl = `${config.domain}/auth?tag=login&k1=${k1}&action=${action}`; + + const lnurl = encode(authUrl); + const qrCode = await QRCode.toDataURL(lnurl, { + width: 256, + margin: 2, + color: { + dark: '#000000', + light: '#ffffff' + } + }); + + const responseData = { + status: 'OK', + url: authUrl, + lnurl, + qrCode, + type: 'auth', + k1: k1 + }; + + Logger.info('LNURL-auth generated', { authUrl, k1, sessionId }); + return responseData; +}; + +const generateBolt11 = async (query) => { + const { amount } = query; + + // Default to 0 (zero-amount invoice) if not specified + const amountSats = amount ? parseInt(amount) : 0; + + if (isNaN(amountSats) || amountSats < 0) { + throw new ValidationError('Invalid amount. Must be zero or a positive integer.'); + } + + // Create invoice with LND + const invoice = await lndService.createInvoice(amountSats, '', 3600); + const paymentRequest = invoice.payment_request; + + const qrCode = await QRCode.toDataURL(paymentRequest, { + width: 256, + margin: 2, + color: { + dark: '#000000', + light: '#ffffff' + } + }); + + Logger.info('Bolt11 invoice generated', { amount: amountSats, paymentHash: invoice.r_hash }); + + return { + bolt11: paymentRequest, + qrCode, + type: 'bolt11', + amount: amountSats, + paymentHash: invoice.r_hash + }; +}; + + +module.exports = router; diff --git a/docker/lnurl-server/routes/pay.js b/docker/lnurl-server/routes/pay.js new file mode 100644 index 0000000..1804b55 --- /dev/null +++ b/docker/lnurl-server/routes/pay.js @@ -0,0 +1,91 @@ +const express = require('express'); +const router = express.Router(); + +const config = require('../config'); +const db = require('../database'); +const lndService = require('../services/lnd'); +const Validation = require('../utils/validation'); +const Logger = require('../utils/logger'); +const { asyncHandler, ValidationError, NotFoundError } = require('../middleware/errorHandler'); + +// LNURL-pay endpoint +router.get('/:paymentId', asyncHandler(async (req, res) => { + const { paymentId } = req.params; + + if (!Validation.isValidPaymentId(paymentId)) { + throw new ValidationError('Invalid payment ID'); + } + + // Get payment configuration from database + const paymentConfig = await db.getPaymentConfig(paymentId); + if (!paymentConfig) { + throw new NotFoundError('Payment configuration not found'); + } + + const metadata = JSON.stringify([ + ['text/plain', `Payment for ${paymentId}`] + ]); + + res.json({ + tag: 'payRequest', + callback: `${config.domain}/pay/${paymentId}/callback`, + minSendable: paymentConfig.min_sendable, + maxSendable: paymentConfig.max_sendable, + metadata: metadata, + commentAllowed: paymentConfig.comment_allowed + }); +})); + +// LNURL-pay callback +router.get('/:paymentId/callback', asyncHandler(async (req, res) => { + const { amount, comment } = req.query; + const { paymentId } = req.params; + + // Validate input parameters + const validationErrors = Validation.validatePayCallback({ amount, comment }); + if (validationErrors.length > 0) { + throw new ValidationError(validationErrors.join(', ')); + } + + const amountMsat = parseInt(amount); + const amountSats = Math.floor(amountMsat / 1000); + + // Create invoice + const invoice = await lndService.createInvoice( + amountSats, + comment ? `LNURL Payment ${paymentId} - ${comment}` : `LNURL Payment ${paymentId}`, + 3600 + ); + + // Extract the payment hash in hex + let paymentHashHex = ''; + if (invoice.r_hash_str) { + paymentHashHex = invoice.r_hash_str; + } else if (invoice.r_hash) { + // Convert base64 to hex + paymentHashHex = Buffer.from(invoice.r_hash, 'base64').toString('hex'); + } else if (invoice.payment_hash) { + paymentHashHex = invoice.payment_hash; + } + + // Generate unique payment record ID (different from paymentId used in URL) + const uniquePaymentId = Validation.generateId(); + + // Store payment info + await db.createPayment( + uniquePaymentId, + amountSats, + `LNURL Payment ${paymentId}`, + paymentHashHex, + comment || null + ); + + Logger.payment('invoice created', { paymentId, uniquePaymentId, amountSats }); + + res.json({ + pr: invoice.payment_request, + routes: [] + }); +})); + +module.exports = router; diff --git a/docker/lnurl-server/routes/well-known.js b/docker/lnurl-server/routes/well-known.js new file mode 100644 index 0000000..8f14d9b --- /dev/null +++ b/docker/lnurl-server/routes/well-known.js @@ -0,0 +1,39 @@ +const express = require('express'); +const router = express.Router(); + +const config = require('../config'); +const db = require('../database'); +const Logger = require('../utils/logger'); +const { asyncHandler } = require('../middleware/errorHandler'); + +// LNURL-address resolution (well-known) +router.get('/.well-known/lnurlp/:username', asyncHandler(async (req, res) => { + const { username } = req.params; + + const domain = config.domain.replace(/^https?:\/\//, ''); + const lightningAddress = `${username}@${domain}`; + + // LUD-16 compliant metadata + const metadata = JSON.stringify([ + ["text/plain", `Payment to ${lightningAddress}`], + ["text/identifier", lightningAddress] + ]); + + const paymentId = require('crypto').createHash('sha256').update(username).digest('hex'); + + // Store or update payment configuration for this Lightning Address + await db.createPaymentConfig(paymentId, config.limits.minSendable, config.limits.maxSendable, 100); + + Logger.info('Lightning Address config created', { username, paymentId }); + + res.json({ + tag: 'payRequest', + callback: `${config.domain}/pay/${paymentId}/callback`, + minSendable: config.limits.minSendable, + maxSendable: config.limits.maxSendable, + metadata, + commentAllowed: config.limits.commentAllowed + }); +})); + +module.exports = router; \ No newline at end of file diff --git a/docker/lnurl-server/routes/withdraw.js b/docker/lnurl-server/routes/withdraw.js new file mode 100644 index 0000000..a57a05a --- /dev/null +++ b/docker/lnurl-server/routes/withdraw.js @@ -0,0 +1,93 @@ +const express = require('express'); +const router = express.Router(); + +const config = require('../config'); +const db = require('../database'); +const lndService = require('../services/lnd'); +const Validation = require('../utils/validation'); +const Logger = require('../utils/logger'); +const { asyncHandler, ValidationError } = require('../middleware/errorHandler'); + +// LNURL-withdraw endpoint +router.get('/', asyncHandler(async (req, res) => { + const { minWithdrawable, maxWithdrawable } = req.query; + + const minValue = minWithdrawable ? parseInt(minWithdrawable, 10) : config.limits.minWithdrawable; + const maxValue = maxWithdrawable ? parseInt(maxWithdrawable, 10) : config.limits.maxWithdrawable; + + const k1 = Validation.generateK1(); + const withdrawId = Validation.generateId(); + + // Store withdrawal request + await db.createWithdrawal(withdrawId, k1, 0); + + // Build callback with limits embedded + const callbackParams = new URLSearchParams({ k1 }); + callbackParams.append('minWithdrawable', minValue); + callbackParams.append('maxWithdrawable', maxValue); + const withdrawUrl = `${config.domain}/withdraw/callback?${callbackParams.toString()}`; + + Logger.withdrawal('request created', { k1, withdrawId, minWithdrawable: minValue, maxWithdrawable: maxValue }); + + res.json({ + tag: 'withdrawRequest', + callback: withdrawUrl, + k1: k1, + defaultDescription: 'LNURL Withdraw Test', + minWithdrawable: minValue, + maxWithdrawable: maxValue + }); +})); + +// LNURL-withdraw callback +router.get('/callback', asyncHandler(async (req, res) => { + const { k1, pr, minWithdrawable, maxWithdrawable } = req.query; + + // Validate input parameters + const validationErrors = Validation.validateWithdrawCallback({ k1, pr }); + if (validationErrors.length > 0) { + throw new ValidationError(validationErrors.join(', ')); + } + + // Get withdrawal from database + const withdrawal = await db.getWithdrawal(k1); + if (!withdrawal) { + throw new ValidationError('Invalid or used k1'); + } + + // Parse limits from URL params, falling back to config defaults + const minValue = minWithdrawable ? parseInt(minWithdrawable, 10) : config.limits.minWithdrawable; + const maxValue = maxWithdrawable ? parseInt(maxWithdrawable, 10) : config.limits.maxWithdrawable; + + // Convert msats to sats for validation + const minSats = Math.ceil(minValue / 1000); + const maxSats = Math.floor(maxValue / 1000); + + try { + // Decode the invoice to get the amount + const decodedInvoice = await lndService.decodePayReq(pr); + const invoiceAmountSats = decodedInvoice.num_satoshis; + + Logger.withdrawal('processing', { k1, amount: invoiceAmountSats, minSats, maxSats }); + + // Validate amount is within limits + if (!Validation.isAmountInRange(invoiceAmountSats, minSats, maxSats)) { + throw new ValidationError(`Amount out of range (${minSats} - ${maxSats} sats)`); + } + + // Pay the invoice + await lndService.payInvoice(pr); + + // Update withdrawal with actual amount and mark as used + await db.updateWithdrawal(k1, invoiceAmountSats); + + Logger.withdrawal('completed', { k1, amount: invoiceAmountSats }); + + res.json({ status: 'OK' }); + } catch (error) { + Logger.error('Payment error', error); + throw new Error('Payment failed: ' + error.message); + } +})); + +module.exports = router; diff --git a/docker/lnurl-server/server.js b/docker/lnurl-server/server.js new file mode 100644 index 0000000..8e87c0f --- /dev/null +++ b/docker/lnurl-server/server.js @@ -0,0 +1,76 @@ +const express = require('express'); +const cors = require('cors'); + +// Import configuration and services +const config = require('./config'); +const Logger = require('./utils/logger'); +const { errorHandler } = require('./middleware/errorHandler'); +const httpLogger = require('./middleware/httpLogger'); +const backgroundJobs = require('./services/backgroundJobs'); + +// Import route modules +const withdrawRoutes = require('./routes/withdraw'); +const channelRoutes = require('./routes/channel'); +const payRoutes = require('./routes/pay'); +const adminRoutes = require('./routes/admin'); +const generateRoutes = require('./routes/generate'); +const wellKnownRoutes = require('./routes/well-known'); +const authRoutes = require('./routes/auth'); +const decoderRoutes = require('./routes/decoder'); + +// Create Express app +const app = express(); + +// Middleware +app.use(cors()); +app.use(express.json()); +app.use(httpLogger); // Request logging middleware (must stay before routes) + +// Routes +app.use('/withdraw', withdrawRoutes); +app.use('/channel', channelRoutes); +app.use('/pay', payRoutes); +app.use('/', adminRoutes); // Health check and monitoring endpoints +app.use('/auth', authRoutes); +app.use('/', wellKnownRoutes); +app.use('/generate', generateRoutes); +app.use('/decode', decoderRoutes); + +// Error handling middleware (must be last) +app.use(errorHandler); + +// Graceful shutdown handling +process.on('SIGTERM', () => { + Logger.info('SIGTERM received, shutting down gracefully'); + backgroundJobs.stop(); + process.exit(0); +}); + +process.on('SIGINT', () => { + Logger.info('SIGINT received, shutting down gracefully'); + backgroundJobs.stop(); + process.exit(0); +}); + +// Start server +app.listen(config.port, async () => { + Logger.info('LNURL server starting', { + port: config.port, + domain: config.domain, + nodeEnv: config.nodeEnv + }); + + Logger.info('Configuration loaded', { + bitcoin: `${config.bitcoin.host}:${config.bitcoin.port}`, + lnd: `${config.lnd.restHost}:${config.lnd.restPort}`, + database: config.database.path + }); + + // Wait a bit for services to be ready + setTimeout(async () => { + Logger.info('Starting background jobs'); + backgroundJobs.start(); + }, 5000); +}); + +module.exports = app; diff --git a/docker/lnurl-server/services/backgroundJobs.js b/docker/lnurl-server/services/backgroundJobs.js new file mode 100644 index 0000000..57aee9d --- /dev/null +++ b/docker/lnurl-server/services/backgroundJobs.js @@ -0,0 +1,88 @@ +const db = require('../database'); +const lndService = require('./lnd'); +const Logger = require('../utils/logger'); +const config = require('../config'); + +class BackgroundJobs { + constructor() { + this.paymentCheckInterval = null; + this.authCleanupInterval = null; + } + + // Start all background jobs + start() { + this.startPaymentCheck(); + this.startAuthCleanup(); + Logger.info('Background jobs started'); + } + + // Stop all background jobs + stop() { + if (this.paymentCheckInterval) { + clearInterval(this.paymentCheckInterval); + this.paymentCheckInterval = null; + } + if (this.authCleanupInterval) { + clearInterval(this.authCleanupInterval); + this.authCleanupInterval = null; + } + Logger.info('Background jobs stopped'); + } + + // Start payment checking job + startPaymentCheck() { + this.paymentCheckInterval = setInterval(async () => { + await this.checkSettledInvoices(); + }, config.intervals.paymentCheck); + + Logger.info('Payment check job started', { interval: config.intervals.paymentCheck }); + } + + // Check for settled invoices and update payment status + async checkSettledInvoices() { + try { + // Get all unpaid payments + const payments = await db.getUnpaidPayments(); + + for (const payment of payments) { + try { + const invoice = await lndService.getInvoice(payment.payment_hash); + + if (invoice.settled) { + await db.updatePaymentPaid(payment.id); + Logger.payment('marked as paid', { + id: payment.id, + amount: payment.amount_sats + }); + } + } catch (error) { + Logger.error(`Error checking payment ${payment.id}`, error); + } + } + } catch (error) { + Logger.error('Error in checkSettledInvoices', error); + } + } + + // Start auth session cleanup job + startAuthCleanup() { + this.authCleanupInterval = setInterval(async () => { + await this.cleanupExpiredAuth(); + }, config.intervals.authSessionCleanup); + + Logger.info('Auth session cleanup job started', { interval: config.intervals.authSessionCleanup }); + } + + async cleanupExpiredAuth() { + try { + const result = await db.cleanupExpiredAuthSessions(); + if (result.changes > 0) { + Logger.info('Cleaned up expired auth sessions', { count: result.changes }); + } + } catch (error) { + Logger.error('Error cleaning up auth sessions', error); + } + } +} + +module.exports = new BackgroundJobs(); diff --git a/docker/lnurl-server/services/bitcoin.js b/docker/lnurl-server/services/bitcoin.js new file mode 100644 index 0000000..a978f13 --- /dev/null +++ b/docker/lnurl-server/services/bitcoin.js @@ -0,0 +1,50 @@ +const config = require('../config'); + +class BitcoinService { + constructor() { + this.host = config.bitcoin.host; + this.port = config.bitcoin.port; + this.user = config.bitcoin.user; + this.pass = config.bitcoin.pass; + } + + async rpc(method, params = []) { + const response = await fetch(`http://${this.host}:${this.port}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Basic ' + Buffer.from(`${this.user}:${this.pass}`).toString('base64') + }, + body: JSON.stringify({ + jsonrpc: '1.0', + id: 'lnurl', + method, + params + }) + }); + + const data = await response.json(); + if (data.error) { + throw new Error(`Bitcoin RPC error: ${data.error.message}`); + } + return data.result; + } + + async getBlockCount() { + return this.rpc('getblockcount'); + } + + async getBlockHash(height) { + return this.rpc('getblockhash', [height]); + } + + async getBlock(hash) { + return this.rpc('getblock', [hash]); + } + + async getBlockchainInfo() { + return this.rpc('getblockchaininfo'); + } +} + +module.exports = new BitcoinService(); diff --git a/docker/lnurl-server/services/lnd.js b/docker/lnurl-server/services/lnd.js new file mode 100644 index 0000000..2007355 --- /dev/null +++ b/docker/lnurl-server/services/lnd.js @@ -0,0 +1,197 @@ +const https = require('https'); +const fs = require('fs'); +const config = require('../config'); + +class LNDService { + constructor() { + this.host = config.lnd.restHost; + this.port = config.lnd.restPort; + this.macaroonPath = config.lnd.macaroonPath; + this.tlsCertPath = config.lnd.tlsCertPath; + } + + async rest(endpoint, method = 'POST', body = null) { + const url = `https://${this.host}:${this.port}${endpoint}`; + + // Read macaroon for authentication + let macaroon = ''; + try { + if (this.macaroonPath && fs.existsSync(this.macaroonPath)) { + macaroon = fs.readFileSync(this.macaroonPath).toString('hex'); + } + } catch (error) { + console.warn('Could not read macaroon:', error.message); + } + + return new Promise((resolve, reject) => { + const urlObj = new URL(url); + const postData = (method === 'POST' && body) ? JSON.stringify(body) : ''; + + const options = { + hostname: urlObj.hostname, + port: urlObj.port, + path: urlObj.pathname, + method: method, + headers: { + 'Content-Type': 'application/json' + }, + rejectUnauthorized: false + }; + + // Add Content-Length header only for POST requests with body + if (method === 'POST' && postData) { + options.headers['Content-Length'] = Buffer.byteLength(postData); + } + + // Add macaroon authentication if available + if (macaroon) { + options.headers['Grpc-Metadata-macaroon'] = macaroon; + } + + const req = https.request(options, (res) => { + let data = ''; + + res.on('data', (chunk) => { + data += chunk; + }); + + res.on('end', () => { + try { + if (!data || data.trim() === '') { + reject(new Error(`Empty response from LND REST API`)); + return; + } + + const jsonData = JSON.parse(data); + + if (res.statusCode >= 400) { + reject(new Error(`LND REST error: ${jsonData.message || res.statusMessage}`)); + } else { + resolve(jsonData); + } + } catch (error) { + reject(new Error(`Failed to parse LND response: ${error.message}`)); + } + }); + }); + + req.on('error', (error) => { + reject(new Error(`LND REST request failed: ${error.message}`)); + }); + + if (method === 'POST' && postData) { + req.write(postData); + } + + req.end(); + }); + } + + async call(method, params = {}) { + try { + const endpoint = `/v1/${method}`; + // Use GET for getinfo, POST for other methods + const httpMethod = method === 'getinfo' ? 'GET' : 'POST'; + return await this.rest(endpoint, httpMethod, params); + } catch (error) { + console.log(`LND REST API failed for ${method}:`, error.message); + throw error; + } + } + + async getInfo() { + return this.call('getinfo'); + } + + async createInvoice(value, memo, expiry = 3600) { + return this.call('invoices', { + value: value, + memo: memo, + expiry: expiry + }); + } + + async getInvoice(paymentHash) { + return this.rest(`/v1/invoice/${paymentHash}`, 'GET'); + } + + async decodePayReq(payReq) { + return this.rest(`/v1/payreq/${payReq}`, 'GET'); + } + + async payInvoice(paymentRequest) { + return this.rest('/v1/channels/transactions', 'POST', { + payment_request: paymentRequest + }); + } + + async getNodeURI() { + try { + const nodeInfo = await this.getInfo(); + const address = nodeInfo.uris && nodeInfo.uris.length > 0 ? nodeInfo.uris[0] : null; + + if (!address) { + throw new Error('No public URI available for this node'); + } + + return address; + } catch (error) { + console.error('Failed to get node URI:', error.message); + throw error; + } + } + + async getNewAddress() { + try { + return await this.rest('/v1/newaddress', 'GET'); + } catch (error) { + console.error('Failed to get new address:', error.message); + throw error; + } + } + + async getWalletBalance() { + try { + return await this.rest('/v1/balance/blockchain', 'GET'); + } catch (error) { + console.error('Failed to get wallet balance:', error.message); + throw error; + } + } + + async openChannel(nodePubkey, localFundingAmount, privateChannel = false) { + try { + const response = await this.rest('/v1/channels', 'POST', { + node_pubkey_string: nodePubkey, + local_funding_amount: localFundingAmount.toString(), + private: privateChannel + }); + + console.log('Channel opening initiated:', response); + return response; + } catch (error) { + console.error('Failed to open channel:', error.message); + throw error; + } + } + + async getPendingChannels() { + try { + return await this.rest('/v1/channels/pending', 'GET'); + } catch (error) { + console.error('Failed to get pending channels:', error.message); + throw error; + } + } + + async getChannels() { + try { + return await this.rest('/v1/channels', 'GET'); + } catch (error) { + console.error('Failed to get channels:', error.message); + throw error; + } + } +} + +module.exports = new LNDService(); diff --git a/docker/lnurl-server/templates.js b/docker/lnurl-server/templates.js new file mode 100644 index 0000000..41319a9 --- /dev/null +++ b/docker/lnurl-server/templates.js @@ -0,0 +1,1114 @@ +// All templates consolidated into single file + +// Vercel-inspired CSS design system +const getStyles = () => ` + /* Reset and base styles */ + * { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + /* Design tokens */ + :root { + /* Colors - Vercel/Geist design system */ + --geist-background: #ffffff; + --geist-foreground: #000000; + --geist-selection: #79ffe1; + --accents-1: #fafafa; + --accents-2: #eaeaea; + --accents-3: #999999; + --accents-4: #888888; + --accents-5: #666666; + --accents-6: #444444; + --accents-7: #333333; + --accents-8: #111111; + + /* Semantic colors */ + --geist-success: #0cad00; + --geist-error: #e00000; + --geist-warning: #f5a623; + --geist-cyan: #50e3c2; + --geist-violet: #7928ca; + + /* Typography */ + --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + + /* Spacing */ + --gap: 16px; + --gap-half: 8px; + --gap-quarter: 4px; + --gap-double: 32px; + --gap-triple: 48px; + + /* Radii */ + --radius: 6px; + --radius-small: 4px; + --radius-large: 8px; + + /* Shadows */ + --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.12); + --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12); + --shadow-large: 0 8px 32px rgba(0, 0, 0, 0.12); + + /* Transitions */ + --transition: 150ms ease; + } + + /* Dark theme */ + [data-theme="dark"] { + --geist-background: #000000; + --geist-foreground: #ffffff; + --accents-1: #111111; + --accents-2: #333333; + --accents-3: #444444; + --accents-4: #666666; + --accents-5: #888888; + --accents-6: #999999; + --accents-7: #eaeaea; + --accents-8: #fafafa; + + --shadow-small: 0 2px 8px rgba(0, 0, 0, 0.4); + --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4); + --shadow-large: 0 8px 32px rgba(0, 0, 0, 0.4); + } + + /* Base styles */ + body { + background-color: var(--geist-background); + color: var(--geist-foreground); + font-family: var(--font-sans); + line-height: 1.6; + min-height: 100vh; + padding: var(--gap-double) var(--gap); + transition: background-color var(--transition), color var(--transition); + } + + /* Layout */ + .container { + max-width: 1000px; + margin: 0 auto; + } + + /* Typography */ + h1, h2, h3, h4, h5, h6 { + font-weight: 600; + line-height: 1.25; + margin-bottom: var(--gap-half); + } + + h1 { + font-size: 2.5rem; + font-weight: 800; + display: flex; + align-items: center; + gap: var(--gap-half); + justify-content: center; + margin-bottom: var(--gap-quarter); + } + + h2 { + font-size: 1.5rem; + } + + h3 { + font-size: 1.2rem; + } + + p { + color: var(--accents-5); + margin-bottom: var(--gap); + } + + /* Header */ + .header { + text-align: center; + margin-bottom: var(--gap-double); + } + + .header p { + font-size: 1.1rem; + margin-bottom: 0; + } + + /* Icons */ + .icon, .icon-title, .btn-icon { + width: 24px; + height: 24px; + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + } + + .icon-title { + color: #f7931a; + width: 32px; + height: 32px; + } + + .btn-icon { + width: 16px; + height: 16px; + } + + /* Cards */ + .cards-container { + display: grid; + gap: var(--gap-double); + margin-bottom: var(--gap-double); + } + + .card { + padding: 0; + } + + + .card-header { + display: flex; + align-items: center; + gap: var(--gap-half); + margin-bottom: var(--gap); + } + + .card-title { + margin: 0; + color: var(--geist-foreground); + } + + .card-description { + color: var(--accents-5); + margin-bottom: var(--gap-double); + line-height: 1.5; + } + + /* Endpoints */ + .endpoints-list { + display: grid; + gap: var(--gap-half); + } + + .endpoint { + display: flex; + align-items: center; + gap: var(--gap-half); + padding: var(--gap-half) var(--gap); + background: var(--accents-1); + border: 1px solid var(--accents-2); + border-radius: var(--radius); + text-decoration: none; + color: inherit; + transition: background-color 100ms ease; + } + + .endpoint.clickable:hover { + background: rgba(0, 0, 0, 0.05); + } + + [data-theme="dark"] .endpoint.clickable:hover { + background: rgba(255, 255, 255, 0.05); + } + + .endpoint:focus { + outline: none; + } + + + .endpoint-method { + font-weight: 600; + font-size: 0.75rem; + color: var(--geist-success); + min-width: 35px; + font-family: var(--font-mono); + text-transform: uppercase; + } + + .endpoint-path { + font-family: var(--font-mono); + font-size: 0.875rem; + color: var(--geist-foreground); + flex: 1; + } + + + .endpoint-desc { + color: var(--accents-5); + font-size: 0.875rem; + margin-left: auto; + } + + /* Buttons */ + .btn { + display: inline-flex; + align-items: center; + gap: var(--gap-half); + padding: var(--gap-half) var(--gap); + text-decoration: none; + border-radius: var(--radius); + font-weight: 500; + font-size: 0.875rem; + border: 1px solid transparent; + cursor: pointer; + line-height: 1; + } + + .btn-primary { + background: var(--geist-foreground); + color: var(--geist-background); + border-color: var(--geist-foreground); + transition: all 0.2s ease; + } + + .btn-primary:hover { + background: var(--accents-7); + border-color: var(--accents-7); + } + + .btn-primary:focus { + outline: none; + box-shadow: 0 0 0 2px var(--accents-2); + } + + + .btn-secondary { + background: transparent; + color: var(--accents-5); + border-color: var(--accents-2); + } + + + .btn-group { + display: flex; + gap: var(--gap-half); + justify-content: center; + flex-wrap: wrap; + } + + + /* QR Code styles */ + .qr-container { + text-align: center; + max-width: 400px; + margin: 0 auto; + } + + .qr-code { + max-width: 100%; + height: auto; + margin: var(--gap-double) 0; + } + + .qr-title { + color: var(--geist-foreground); + margin-bottom: var(--gap); + font-size: 1.25rem; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; + gap: var(--gap-half); + } + + .qr-url { + font-family: var(--font-mono); + font-size: 0.875rem; + color: var(--accents-5); + word-break: break-all; + margin-top: var(--gap-double); + padding: var(--gap); + background: var(--accents-1); + border-radius: var(--radius); + border: 1px solid var(--accents-2); + } + + /* QR page specific */ + .qr-page { + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; + } + + .qr-page .container { + width: 100%; + padding: var(--gap); + } + + + /* Responsive design */ + @media (max-width: 768px) { + body { + padding: var(--gap) var(--gap-half); + } + + h1 { + font-size: 2rem; + flex-direction: column; + gap: var(--gap-quarter); + } + + .card { + padding: var(--gap); + } + + .btn-group { + flex-direction: column; + align-items: center; + } + + .qr-container { + padding: var(--gap-double); + margin: var(--gap); + } + + .endpoint { + flex-direction: column; + align-items: flex-start; + gap: var(--gap-quarter); + } + + .endpoint-desc { + margin-left: 0; + } + } + + + /* Focus styles */ + *:focus { + outline: 2px solid var(--geist-foreground); + outline-offset: 2px; + } +`; + +// Main layout template +const mainLayout = ({ title, content }) => ` + + + + + + ${title} + + + + + + ${content} + + +`; + +// Reusable HTML components +const header = ({ title, subtitle }) => ` +
+

${title}

+ ${subtitle ? `

${subtitle}

` : ''} +
+`; + +const endpoint = ({ method, path, description, clickable = false }) => ` + ${clickable ? + ` + ${method} + ${path} + ${description} + ` : + `
+ ${method} + ${path} + ${description} +
` + } +`; + +const card = ({ icon, title, description, endpoints }) => ` +
+
+ +

${title}

+
+ ${description ? `
${description}
` : ''} +
+ ${endpoints.map(ep => endpoint(ep)).join('')} +
+
+`; + +const container = ({ content }) => ` +
+ ${content} +
+`; + +// Page templates +const renderRootPage = ({ health, domain }) => { + const content = container({ + content: ` + ${header({ + title: 'Bitkit Dev Server' + })} + +
+ ${card({ + icon: 'wrench', + title: 'Generate', + endpoints: [ + { + method: 'GET', + path: '/generate', + description: 'Interactive generator UI', + clickable: true + }, + { + method: 'GET', + path: '/generate/auth', + description: 'Generate LNURL-auth', + clickable: true + }, + { + method: 'GET', + path: '/generate/pay', + description: 'Generate LNURL-pay', + clickable: true + }, + { + method: 'GET', + path: '/generate/withdraw', + description: 'Generate LNURL-withdraw', + clickable: true + }, + { + method: 'GET', + path: '/generate/channel', + description: 'Generate LNURL-channel', + clickable: true + }, + { + method: 'GET', + path: '/generate/bolt11', + description: 'Generate Bolt11 invoice', + clickable: true + } + ] + })} + + ${card({ + icon: 'code', + title: 'Decode', + endpoints: [ + { + method: 'GET', + path: '/decode', + description: 'Interactive decoder UI', + clickable: true + } + ] + })} + + ${card({ + icon: 'chart-bar', + title: 'Admin', + endpoints: [ + { + method: 'GET', + path: '/health', + description: 'Service health check', + clickable: true + }, + { + method: 'GET', + path: '/payments', + description: 'List all payments', + clickable: true + }, + { + method: 'GET', + path: '/withdrawals', + description: 'List all withdrawals', + clickable: true + }, + { + method: 'GET', + path: '/channels', + description: 'List channel requests', + clickable: true + }, + { + method: 'GET', + path: '/sessions', + description: 'List auth sessions', + clickable: true + }, + { + method: 'GET', + path: '/address', + description: 'Get LND funding address', + clickable: true + }, + { + method: 'GET', + path: '/balance', + description: 'Get LND wallet balance', + clickable: true + } + ] + })} +
+ ` + }); + + return mainLayout({ + title: 'Bitkit LNURL Dev Server - API Directory', + content + }); +}; + +const renderGeneratorPage = ({}) => { + const content = container({ + content: ` + ${header({ + title: 'Bitkit LNURL Generator' + })} + +
+ ${card({ + icon: 'key', + title: 'LNURL-auth', + endpoints: [ + { + method: 'GET', + path: '/generate/auth', + description: 'Generate LNURL-auth code', + clickable: true + }, + { + method: 'GET', + path: '/generate/auth/qr', + description: 'Generate LNURL-auth QR code', + clickable: true + } + ] + })} + + ${card({ + icon: 'credit-card', + title: 'LNURL-pay', + endpoints: [ + { + method: 'GET', + path: '/generate/pay', + description: 'Generate LNURL-pay code', + clickable: true + }, + { + method: 'GET', + path: '/generate/pay/qr', + description: 'Generate LNURL-pay QR code', + clickable: true + } + ] + })} + + ${card({ + icon: 'download', + title: 'LNURL-withdraw', + endpoints: [ + { + method: 'GET', + path: '/generate/withdraw', + description: 'Generate LNURL-withdraw code', + clickable: true + }, + { + method: 'GET', + path: '/generate/withdraw/qr', + description: 'Generate LNURL-withdraw QR code', + clickable: true + } + ] + })} + + ${card({ + icon: 'git-branch', + title: 'LNURL-channel', + endpoints: [ + { + method: 'GET', + path: '/generate/channel', + description: 'Generate LNURL-channel code', + clickable: true + }, + { + method: 'GET', + path: '/generate/channel/qr', + description: 'Generate LNURL-channel QR code', + clickable: true + } + ] + })} + + ${card({ + icon: 'zap', + title: 'Bolt11', + endpoints: [ + { + method: 'GET', + path: '/generate/bolt11', + description: 'Generate Bolt11 invoice code', + clickable: true + }, + { + method: 'GET', + path: '/generate/bolt11/qr', + description: 'Generate Bolt11 invoice QR code', + clickable: true + }, + { + method: 'GET', + path: '/generate/bolt11?amount=2000', + description: 'Generate Bolt11 with custom amount', + clickable: true + } + ] + })} +
+ ` + }); + + return mainLayout({ + title: 'Bitkit LNURL Generator', + content + }); +}; + +const renderQrPage = ({ type, qrCode, url }) => { + const content = ` +
+
+
+

+ + LNURL ${type.toUpperCase()} +

+ LNURL ${type} QR Code + ${url ? ` +
+ ${url} +
+ ` : ''} +
+
+
+ `; + + return mainLayout({ + title: `LNURL ${type.toUpperCase()} QR Code`, + content + }); +}; + +const renderDecoderPage = () => { + const content = container({ + content: ` + ${header({ + title: 'Lightning & Bitcoin Decoder', + subtitle: 'Decode BOLT11 invoices, LNURL strings, and BIP21 URIs' + })} + +
+
+
+ + +
+ Detected type: + Waiting for input... +
+
+ + +
+
+
+
+ + +
+
Enter data above and click Decode or LNURL Encode
+
+
+
+ + + + + ` + }); + + return mainLayout({ + title: 'Lightning & Bitcoin Decoder - Bitkit Dev Server', + content + }); +}; + +module.exports = { + renderRootPage, + renderGeneratorPage, + renderQrPage, + renderDecoderPage +}; diff --git a/docker/lnurl-server/utils/logger.js b/docker/lnurl-server/utils/logger.js new file mode 100644 index 0000000..79cb299 --- /dev/null +++ b/docker/lnurl-server/utils/logger.js @@ -0,0 +1,54 @@ +const config = require('../config'); + +class Logger { + static info(message, data = {}) { + const timestamp = new Date().toISOString(); + const output = Object.keys(data).length > 0 ? `\n${JSON.stringify(data, null, 2)}` : ''; + console.log(`[${timestamp}] INFO: ${message}${output}`); + } + + static error(message, error = null) { + const timestamp = new Date().toISOString(); + console.error(`[${timestamp}] ERROR: ${message}`, error ? error.message : ''); + if (error && error.stack && config.nodeEnv === 'development') { + console.error(error.stack); + } + } + + static warn(message, data = {}) { + const timestamp = new Date().toISOString(); + const output = Object.keys(data).length > 0 ? `\n${JSON.stringify(data, null, 2)}` : ''; + console.warn(`[${timestamp}] WARN: ${message}${output}`); + } + + static debug(message, data = {}) { + if (config.nodeEnv === 'development') { + const timestamp = new Date().toISOString(); + const output = Object.keys(data).length > 0 ? `\n${JSON.stringify(data, null, 2)}` : ''; + console.log(`[${timestamp}] DEBUG: ${message}${output}`); + } + } + + // Specific logging methods for different operations + static payment(operation, data = {}) { + this.info(`Payment ${operation}`, data); + } + + static withdrawal(operation, data = {}) { + this.info(`Withdrawal ${operation}`, data); + } + + static channel(operation, data = {}) { + this.info(`Channel ${operation}`, data); + } + + static connection(service, status, data = {}) { + this.info(`${service} connection ${status}`, data); + } + + static api(endpoint, method, status, data = {}) { + this.info(`API ${method} ${endpoint} - ${status}`, data); + } +} + +module.exports = Logger; diff --git a/docker/lnurl-server/utils/validation.js b/docker/lnurl-server/utils/validation.js new file mode 100644 index 0000000..073e0aa --- /dev/null +++ b/docker/lnurl-server/utils/validation.js @@ -0,0 +1,224 @@ +const crypto = require('crypto'); +const secp256k1 = require('secp256k1'); +const config = require('../config'); + +class Validation { + // Validate k1 parameter (32-byte hex string) + static isValidK1(k1) { + if (!k1 || typeof k1 !== 'string') { + return false; + } + return /^[a-fA-F0-9]{64}$/.test(k1); + } + + // Validate payment request (Lightning invoice) + static isValidPaymentRequest(pr) { + if (!pr || typeof pr !== 'string') { + return false; + } + // Basic validation - starts with 'lnbc' for mainnet or 'lntb' for testnet + return /^ln(bc|tb|rt)[a-zA-Z0-9]+$/.test(pr); + } + + // Validate amount in millisatoshis + static isValidAmount(amount) { + const num = parseInt(amount); + return !isNaN(num) && num > 0; + } + + // Validate amount is within limits + static isAmountInRange(amount, min, max) { + const num = parseInt(amount); + return !isNaN(num) && num >= min && num <= max; + } + + // Validate remote node ID (33-byte hex string starting with 02 or 03) + static isValidRemoteId(remoteId) { + if (!remoteId || typeof remoteId !== 'string') { + return false; + } + return /^0[23][a-fA-F0-9]{64}$/.test(remoteId); + } + + // Validate payment ID (hex string) + static isValidPaymentId(paymentId) { + if (!paymentId || typeof paymentId !== 'string') { + return false; + } + return /^[a-fA-F0-9]+$/.test(paymentId); + } + + // Validate comment length + static isValidComment(comment, maxLength = config.limits.commentAllowed) { + if (!comment) { + return true; // Comments are optional + } + return typeof comment === 'string' && comment.length <= maxLength; + } + + // Validate boolean parameter + static isValidBoolean(value) { + if (value === undefined || value === null) { + return true; // Optional boolean + } + return value === '0' || value === '1' || value === true || value === false; + } + + // Generate random k1 challenge + static generateK1() { + return crypto.randomBytes(config.limits.k1Length).toString('hex'); + } + + // Generate random ID + static generateId() { + return crypto.randomBytes(config.limits.idLength).toString('hex'); + } + + static calculateSessionExpiry() { + const expiresAt = new Date(); + expiresAt.setSeconds(expiresAt.getSeconds() + config.limits.sessionTimeout); + return expiresAt; + } + + static isValidPublicKey(pubkey) { + try { + if (!pubkey || typeof pubkey !== 'string') { + return false; + } + + // Check if it's a valid hex string of correct length (33 bytes = 66 hex chars) + if (!/^[a-fA-F0-9]{66}$/.test(pubkey)) { + return false; + } + + const keyBuffer = Buffer.from(pubkey, 'hex'); + return secp256k1.publicKeyVerify(keyBuffer); + } catch (error) { + return false; + } + } + + static isValidSignature(signature) { + try { + if (!signature || typeof signature !== 'string') { + return false; + } + + // Check if it's a valid hex string + if (!/^[a-fA-F0-9]+$/.test(signature)) { + return false; + } + + const sigBuffer = Buffer.from(signature, 'hex'); + + // Try to parse as DER-encoded signature + try { + secp256k1.signatureImport(sigBuffer); + return true; // Valid DER signature + } catch (derError) { + // If DER parsing fails, check if it's compact format (64 bytes = 128 hex chars) + if (sigBuffer.length === 64) { + return true; // Valid compact signature + } + return false; // Invalid format + } + } catch (error) { + return false; + } + } + + static verifyLnurlAuthSignature(k1, sig, key) { + try { + // Convert hex strings to buffers + const k1Buffer = Buffer.from(k1, 'hex'); + const sigBuffer = Buffer.from(sig, 'hex'); + const keyBuffer = Buffer.from(key, 'hex'); + + // Verify the public key is valid + if (!secp256k1.publicKeyVerify(keyBuffer)) { + return false; + } + + // Convert DER-encoded signature to compact format for secp256k1 verification + let compactSig; + try { + compactSig = secp256k1.signatureImport(sigBuffer); + } catch (derError) { + // If DER parsing fails, try as compact signature (backwards compatibility) + if (sigBuffer.length === 64) { + compactSig = sigBuffer; + } else { + return false; + } + } + + // Verify the signature + const isValid = secp256k1.ecdsaVerify(compactSig, k1Buffer, keyBuffer); + return isValid; + } catch (error) { + return false; + } + } + + static isValidAuthAction(action) { + if (!action) return true; // valid (no action provided) + + const validActions = ['register', 'login', 'link', 'auth']; + return validActions.includes(action); + } + + // Validate LNURL channel request parameters + static validateChannelRequest(params) { + const errors = []; + + if (params.cancel === '1') { + // For cancellation, only k1 is required + if (!this.isValidK1(params.k1)) { + errors.push('Invalid k1 parameter'); + } + } else { + // For channel opening, k1 and remoteid are required + if (!this.isValidK1(params.k1)) { + errors.push('Invalid k1 parameter'); + } + if (!this.isValidRemoteId(params.remoteid)) { + errors.push('Invalid remoteid parameter'); + } + if (params.private && !this.isValidBoolean(params.private)) { + errors.push('Invalid private parameter'); + } + } + + return errors; + } + + // Validate LNURL withdraw callback parameters + static validateWithdrawCallback(params) { + const errors = []; + + if (!this.isValidK1(params.k1)) { + errors.push('Invalid k1 parameter'); + } + if (!this.isValidPaymentRequest(params.pr)) { + errors.push('Invalid payment request'); + } + + return errors; + } + + // Validate LNURL pay callback parameters + static validatePayCallback(params) { + const errors = []; + + if (!this.isValidAmount(params.amount)) { + errors.push('Invalid amount parameter'); + } + if (params.comment && !this.isValidComment(params.comment)) { + errors.push('Comment too long'); + } + + return errors; + } +} + +module.exports = Validation; From 17d6405d0c0311469b462889d825f9e560199ee5 Mon Sep 17 00:00:00 2001 From: Piotr Stachyra Date: Fri, 3 Apr 2026 14:20:51 +0200 Subject: [PATCH 7/8] chore: ignore vendored lnurl db Made-with: Cursor --- .gitignore | 1 + docker/lnurl-server/data/lnurl.db | Bin 57344 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100644 docker/lnurl-server/data/lnurl.db diff --git a/.gitignore b/.gitignore index bbac4d7..beeb1b2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ aut node_modules docker/lnd docker/lnurl-server-data +docker/lnurl-server/data artifacts WARP.md .ai diff --git a/docker/lnurl-server/data/lnurl.db b/docker/lnurl-server/data/lnurl.db deleted file mode 100644 index b53743482c3385d015e191b70ae426cf4910865e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57344 zcmeI(PfsFe0LSqePzF(C4^22UCX?92HrAE_6xgP*tUGQ@#a$7T?uiV;Lzyi9WU%U? zJ?QSGz4SG-Z=kn5Ha)j5p)aJz&fsDh{!}EfDdsy7oPWP+&4aMRFOVu{}hh=C54q;X}K2pE%N=+ zFUy}ThL=tj0---bKPbDw--ADnE6#ib5I_I{1pdzgm(LcJ=-Qh6I@d8uHDR1~szqDa zw$*Ido{6QMyq+!SY9ae%UspYg)DJ`Iz+jctg8o%OeUabGW%Do9FZGun53Te{yI$$| zVDIo)A70)%Exi&K-F1c+x_clR9m_O2qO3l7{(N809;i?C-R$vxL5&R;Fx$diwdkBI zJasBk*vsiRtM44=^ZG%d=*~PUWOFZui;MG?)fRStaZiOl%7g>a+?p&|jj}kmPioG| zNzvKKW_Q{h`vD28oYZR;B+n~7318m6e#CXBpUZ`H(ov=49e+o3@8Xk%RTgUZGD z;GD(ng*$CP8{9zX(g-Ng^>z96MYkEWjElN+a1_mEqhft+4@@eaMli5&L>uU>G0{O? zw;E0d(kQ#ViMn@C(4Xn~o8wH2#YP;Nb>sZsi#Vl57BrjnZZ(Zst$F4&iNTi}@mhE4 z1-vPLt^}fo>*G@HA-y9nY6CNZSHU?Yy0Rj_G5aIxWn<5e3dJ6g#zZL?_2#LQzio8v zp33lHR~EL}wptyhuOHLN_UceI?CRK6oE@5^`@PO;%vS!}BtM-GM0ZwhNz%TF&<{~Exh_}5zP89N~Jz-yYm$ygnfwAciME6$5 zarQwJ<9!ozo4!elX??}~&e>GZJ);V{PmkOu1_Tg5009ILKmY**5I_I{1Q2+r0wK3z zT>n4Rc&Qfx2q1s}0tg_000IagfB*tr0j~dP2nZm600IagfB*srAbSkBl%L;o{^GIt)kX6>oAGqoNTf@dO0rZ+Z)(X@T9itq z@@C9T32n>N^iaN7q1{QiIX5GaWN0tg_000IagfB*srAb`NE2=M#=SxJihL;wK<5I_I{1Q0*~ z0R#|0V0r Date: Fri, 3 Apr 2026 14:46:45 +0200 Subject: [PATCH 8/8] fix: preserve msat precision in lnurl pay and withdraw --- docker/lnurl-server/routes/pay.js | 6 +++--- docker/lnurl-server/routes/withdraw.js | 17 ++++++++--------- docker/lnurl-server/services/lnd.js | 8 ++++++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/docker/lnurl-server/routes/pay.js b/docker/lnurl-server/routes/pay.js index 1804b55..3a004da 100644 --- a/docker/lnurl-server/routes/pay.js +++ b/docker/lnurl-server/routes/pay.js @@ -47,12 +47,12 @@ router.get('/:paymentId/callback', asyncHandler(async (req, res) => { throw new ValidationError(validationErrors.join(', ')); } - const amountMsat = parseInt(amount); + const amountMsat = parseInt(amount, 10); const amountSats = Math.floor(amountMsat / 1000); // Create invoice - const invoice = await lndService.createInvoice( - amountSats, + const invoice = await lndService.createInvoiceMsat( + amountMsat, comment ? `LNURL Payment ${paymentId} - ${comment}` : `LNURL Payment ${paymentId}`, 3600 ); diff --git a/docker/lnurl-server/routes/withdraw.js b/docker/lnurl-server/routes/withdraw.js index a57a05a..ad604f3 100644 --- a/docker/lnurl-server/routes/withdraw.js +++ b/docker/lnurl-server/routes/withdraw.js @@ -59,20 +59,19 @@ router.get('/callback', asyncHandler(async (req, res) => { const minValue = minWithdrawable ? parseInt(minWithdrawable, 10) : config.limits.minWithdrawable; const maxValue = maxWithdrawable ? parseInt(maxWithdrawable, 10) : config.limits.maxWithdrawable; - // Convert msats to sats for validation - const minSats = Math.ceil(minValue / 1000); - const maxSats = Math.floor(maxValue / 1000); - try { // Decode the invoice to get the amount const decodedInvoice = await lndService.decodePayReq(pr); - const invoiceAmountSats = decodedInvoice.num_satoshis; + const invoiceAmountSats = parseInt(decodedInvoice.num_satoshis, 10); + const invoiceAmountMsat = decodedInvoice.num_msat + ? parseInt(decodedInvoice.num_msat, 10) + : invoiceAmountSats * 1000; - Logger.withdrawal('processing', { k1, amount: invoiceAmountSats, minSats, maxSats }); + Logger.withdrawal('processing', { k1, amountSats: invoiceAmountSats, amountMsat: invoiceAmountMsat, minWithdrawable: minValue, maxWithdrawable: maxValue }); - // Validate amount is within limits - if (!Validation.isAmountInRange(invoiceAmountSats, minSats, maxSats)) { - throw new ValidationError(`Amount out of range (${minSats} - ${maxSats} sats)`); + // Validate msat amount is within limits + if (!Validation.isAmountInRange(invoiceAmountMsat, minValue, maxValue)) { + throw new ValidationError(`Amount out of range (${minValue} - ${maxValue} msat)`); } // Pay the invoice diff --git a/docker/lnurl-server/services/lnd.js b/docker/lnurl-server/services/lnd.js index 2007355..d36c1ce 100644 --- a/docker/lnurl-server/services/lnd.js +++ b/docker/lnurl-server/services/lnd.js @@ -111,6 +111,14 @@ class LNDService { }); } + async createInvoiceMsat(valueMsat, memo, expiry = 3600) { + return this.call('invoices', { + value_msat: valueMsat.toString(), + memo: memo, + expiry: expiry + }); + } + async getInvoice(paymentHash) { return this.rest(`/v1/invoice/${paymentHash}`, 'GET'); }