Bitcoin Forum
May 06, 2024, 10:19:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [HELP] Alerts from coinb.in/#fees https://mempool.space/api  (Read 129 times)
Husires (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 1285



View Profile WWW
February 18, 2021, 07:07:18 AM
 #1

Sometimes mempool is empty life changes quickly and there is no time to track down.
I created a request for anyone who knows any service gives us Noification when Bitcoin TX fees reduce.

If you know one of these services, share it with that topic.

I want to create a service that tracks the number of XX Sat/Byte from https://coinb.in/#fees or use https://mempool.space/api and gives me a notification when it falls below a certain limit.

I don't think it is complicated, I have some technical experience using Python, tell me what Libraries, educational courses or videos that I must watch if I want to design this service.
A simple program or a Chrome extension would be appropriate.
I don't want GUI simple notification or cmd line will be good.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
1715033992
Hero Member
*
Offline Offline

Posts: 1715033992

View Profile Personal Message (Offline)

Ignore
1715033992
Reply with quote  #2

1715033992
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
February 25, 2021, 02:49:46 PM
Last edit: February 25, 2021, 03:53:37 PM by PrimeNumber7
 #2

If you want to ping an API, you could use the Requests library to query the API.

I would also note that required fees often fall below a threshold because several blocks were found in a short time and the required fee may be higher in the next block.

Edit to add: you will also want to use the Time library so you can delay the time between your queries to the API.
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
February 25, 2021, 02:56:13 PM
 #3

if you find a free or public api, or if you run your own node, this is pretty trivial (especially since you say you have python experience)

basically importing requests, and adding a little bit of logic would be sufficient...

If i have some spare time, i'll see if i can whip something up in python or go (no promises tough, but i think it would be finished in 15 minutes)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
March 01, 2021, 06:58:25 AM
Merited by LoyceV (6), Husires (5), pooya87 (1), dkbit98 (1)
 #4

I'm not a fan of unmerged double posting, but since my last post was several days ago, and i'm actually replying to myself here:

I did a quick-and-dirty 10 minute sollution for your problem in go... No fancy clean code, just a quick and dirty code that should do the job...

https://github.com/mocacinno/autofeechecker

You'll need go (which is available for most platforms)

It'll need some tweaking from YOU in order to work properly tough...
You'll need to edit lines:
https://github.com/mocacinno/autofeechecker/blob/main/checker.go#L41
https://github.com/mocacinno/autofeechecker/blob/main/checker.go#L42
(replace "ls" by the command you want to see executed if the feerate drops, and "-ltrh" by the parameters for this command... I don't know, play a sound, open an image with irfanview, send a mail... whatever gets your attention)

Then build (how-to is in the README.md)
Then add checker (or checker.exe) with parameter "-altertfee xx" in your systems cron (or task sheduler).
Once the fee drops below the alertfee, the command you entered on line 41 with parameter on line 42 will be executed.

If you want to, you can add a loop and a sleep around line 25-51 to continue running it in the background Smiley

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Husires (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 1285



View Profile WWW
March 01, 2021, 09:19:32 AM
 #5

I'm not a fan of unmerged double posting, but since my last post was several days ago, and i'm actually replying to myself here:
I did a quick-and-dirty 10 minute sollution for your problem in go... No fancy clean code, just a quick and dirty code that should do the job...
Thank you, that's what I wanted. I'm going to make some tweaking.
I apologize for the late reply. I travel a lot these days so I don't have much time left.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
March 01, 2021, 09:37:20 AM
 #6

--snip--
Thank you, that's what I wanted. I'm going to make some tweaking.
I apologize for the late reply. I travel a lot these days so I don't have much time left.

no problem Smiley

It's a really basic framework... There are many things you could do... Like for example, import "net/smtp", add the following function and invoke it after line "if responseObject.Fastfee < triggerfee {"

Code:
func mail() {
from := "--your mail--"
password := "--your password--"
to := []string{
    "--your mail--",
}
smtpHost := "--an smpt server--"
smtpPort := "--an smpt port--"
message := []byte("Fee currently low")
auth := smtp.PlainAuth("", from, password, smtpHost)
err := smtp.SendMail(smtpHost+":"+smtpPort, auth, from, to, message)
  if err != nil {
fmt.Println(err)
return
  }
}

or, you could download irfanview portable and make an image with a big red text "fee currently low" and just replace L41-42 with
Code:
app := "c:\\irfanview.exe"
arg := "c:\\alertimage.jpg"

or, you can have a look at https://github.com/faiface/beep

I picked go because it's so easy to create binaries and crosscompile... But a python, perl or php version should also only take 10 minutes to create in case you want a different language Smiley

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!