Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/fee.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions commands/mempool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -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

Expand Down