forked from matryer/xbar-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a plugin to show current mempool stats and transaction fees on mempool.space
- Loading branch information
1 parent
cecd46a
commit fc96b3c
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Shows latest Bitcoin network fees on mempool.space (slow, medium, and fast via dropdown), and allows the user to select a default view for the bar itself. | ||
# | ||
# <xbar.title>Mempool Bitcoin Fees Estimator</xbar.title> | ||
# <xbar.version>v1.0</xbar.version> | ||
# <xbar.author>Jonathan A Levi</xbar.author> | ||
# <xbar.author.github>entreprenewer</xbar.author.github> | ||
# <xbar.desc>Shows latest Bitcoin network fees on mempool.space (slow, medium, and fast via dropdown), and allows the user to select a default view for the bar itself. </xbar.desc> | ||
# <xbar.image>https://i.imgur.com/krOybyz.png</xbar.image> | ||
# | ||
# by Jonathan A Levi | ||
# Based on Bitfinex bitbar plugin by Roberto Santacroce Martins and Dash tickers: Coincap.io and Poloniex.com by UdjinM6 | ||
|
||
# Grab all info beforehand | ||
fee_info=$(curl -s "https://mempool.space/api/v1/fees/recommended") | ||
fast=$(curl -s "https://mempool.space/api/v1/fees/recommended" | egrep -o '"fastestFee":[0-9]+(\.)?([0-9]{0,2})?' | sed 's/"fastestFee"://') | ||
medium=$(curl -s "https://mempool.space/api/v1/fees/recommended" | egrep -o '"halfHourFee":[0-9]+(\.)?([0-9]{0,2})?' | sed 's/"halfHourFee"://') | ||
slow=$(curl -s "https://mempool.space/api/v1/fees/recommended" | egrep -o '"hourFee":[0-9]+(\.)?([0-9]{0,2})?' | sed 's/"hourFee"://') | ||
|
||
# SET DEFAULT VIEW HERE | ||
# (Replace with $slow, $medium, or $fast) | ||
default=$slow | ||
|
||
|
||
#Menu bar | ||
printf "%ld sat/vB\n" $default | ||
echo "---" | ||
printf "Slow: %ld sat/vB | color=red\n" $slow | ||
printf "Medium: %ld sat/vB | color=orange\n" $medium | ||
printf "Fast: %ld sat/vB | color=green\n" $fast | ||
echo "Visit Mempool | href=\"https://mempool.space\"" |