Author

Topic: [HELP] Alerts from coinb.in/#fees https://mempool.space/api (Read 166 times)

legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
--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
legendary
Activity: 1596
Merit: 1288
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.
legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
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
legendary
Activity: 3612
Merit: 5297
https://merel.mobi => buy facemasks with BTC/LTC
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)
copper member
Activity: 1666
Merit: 1901
Amazon Prime Member #7
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.
legendary
Activity: 1596
Merit: 1288
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.
Jump to: