From 3efb81d48448bc23a4eeccd900f93278ffab1b11 Mon Sep 17 00:00:00 2001 From: Bortlesboat Date: Thu, 30 Apr 2026 00:10:14 -0400 Subject: [PATCH] Allow mempool blocks URL override --- commands/fee.js | 2 +- commands/mempool.js | 4 ++-- example.env | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/fee.js b/commands/fee.js index 438eae5..9d8990b 100644 --- a/commands/fee.js +++ b/commands/fee.js @@ -2,7 +2,7 @@ const axios = require('axios'); // eslint-disable-next-line no-unused-vars async function feeCommand(message, args) { - const api = "https://mempool.space/api/v1/fees/mempool-blocks"; + const api = process.env.MEMPOOL_BLOCKS_URL || "https://mempool.space/api/v1/fees/mempool-blocks"; let data; try { const response = await axios.get(api); diff --git a/commands/mempool.js b/commands/mempool.js index 2481cc7..a206444 100644 --- a/commands/mempool.js +++ b/commands/mempool.js @@ -2,7 +2,7 @@ const axios = require('axios'); // eslint-disable-next-line no-unused-vars async function mempoolCommand(message, args) { - const api = "https://mempool.space/api/v1/fees/mempool-blocks"; + const api = process.env.MEMPOOL_BLOCKS_URL || "https://mempool.space/api/v1/fees/mempool-blocks"; let data; try { const response = await axios.get(api); @@ -21,7 +21,7 @@ async function mempoolCommand(message, args) { // Build the message string with a code block const messageString = `\`\`\` -Mempool.space's mempool has ${f(nTx)} TX and is ${f(aggSize / 1_000_000)} vMB +The mempool has ${f(nTx)} TX and is ${f(aggSize / 1_000_000)} vMB Total fees in mempool are ${f(totalFees/ 1_0000_0000)} BTC The next projected block (mempool tip) ranges between ${f(data[0].feeRange[data[0].feeRange.length - 1])} sat/vbyte and ${f(data[0].feeRange[0])} sat/vbyte 1-2 blocks = ${f(data[0].feeRange[data[0].feeRange.length - 1])}-${f(data[1].feeRange[0])} sat/vbyte diff --git a/example.env b/example.env index fa97f15..1ccce35 100644 --- a/example.env +++ b/example.env @@ -1,5 +1,6 @@ DISCORD_TOKEN=your-discord-bot-token BOT_PREFIX=! +MEMPOOL_BLOCKS_URL=https://mempool.space/api/v1/fees/mempool-blocks RULES_CHANNEL=782750797480984598