cashubtc / nuts

Cashu protocol specifications https://cashubtc.github.io/nuts/
MIT License
143 stars 49 forks source link

NUT-05: Melting tokens without blocking #37

Open callebtc opened 1 year ago

callebtc commented 1 year ago

Currently, calling POST /melt is blocking until either the Lightning invoice succeeds or fails. This is not necessary anymore because we now have a new pending state in the POST /check response (see here: https://github.com/cashubtc/nuts/pull/21).

POST /melt should have an option to immediately return. I'm unsure what the best way would be to spec this out.

Input is very much appreciated.

Options:

gohumble commented 1 year ago

Have you thought about using the HTTP Header Prefer: respond-async from RFC7240?

callebtc commented 1 year ago

Have you thought about using the HTTP Header Prefer: respond-async from RFC7240?

I didn't know about that, will add it as a fourth option :)