Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate mempool.space fee rate api to provide users recommendations on fee rate #1254

Open
saubyk opened this issue Jun 9, 2023 · 3 comments
Labels
All Implementations General non-implementation specific change enhancement New feature or request

Comments

@saubyk
Copy link
Collaborator

saubyk commented Jun 9, 2023

Mempool.space API can be integrated in the channel opening and on-chain spend interfaces to give users recommendation based on the current fee rates in the mempool

API: https://mempool.space/docs/api/rest#get-recommended-fees

@saubyk saubyk added All Implementations General non-implementation specific change enhancement New feature or request labels Jun 9, 2023
@ghost
Copy link

ghost commented Jun 9, 2023

Oh cool, I see this API call works out the box on my self hosted mempool.space.

Err... not to be that feature guy, but would be cool to see this implemented in a way that allows overriding to one's own mempool.space instance. If it's done in a config file and not the UI, it's probably safe to assume the user knows what they are doing.

Just thinking about the whole third party thing

@saubyk
Copy link
Collaborator Author

saubyk commented Jun 9, 2023

Hi @shyfire131 wondering how would the API url look like if you have self host mempool.space
If you can post a sample, that would be helpful

@ghost
Copy link

ghost commented Jun 9, 2023

It's the same really

Details

Running this:

curl --socks5 localhost:9050 --socks5-hostname localhost:9050 -s http://myhiddenservice.onion/api/v1/fees/recommended | jq

Response:

{
  "fastestFee": 27,
  "halfHourFee": 24,
  "hourFee": 20,
  "economyFee": 2,
  "minimumFee": 1
}

Verbose response from curl -v

*   Trying 127.0.0.1:9050...
* Connected to localhost (127.0.0.1) port 9050 (#0)
* SOCKS5 connect to myhiddenservice.onion:80 (remotely resolved)
* SOCKS5 request granted.
* Connected to localhost (127.0.0.1) port 9050 (#0)
> GET /api/v1/fees/recommended HTTP/1.1
> Host: myhiddenservice.onion
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 09 Jun 2023 05:15:21 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 312
< Connection: keep-alive
< X-Powered-By: Express
< Access-Control-Allow-Origin: *
< ETag: W/"138-WLg27yQG9EjCtCnCYKTKRFnIT9M"
< Cache-Control: public, no-transform
< Vary: Accept-Language
< Vary: Cookie
<
{ [312 bytes data]
* Connection #0 to host localhost left intact 
{
  "fastestFee": 27,
  "halfHourFee": 24,
  "hourFee": 20,
  "economyFee": 2,
  "minimumFee": 1
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
All Implementations General non-implementation specific change enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant