MostroP2P / mostrui

Mostro TUI
MIT License
8 stars 7 forks source link

Take sell order #8

Open grunch opened 1 month ago

grunch commented 1 month ago

When a buyer takes a sell order at market price they don't know the exact amount of Sats. Buyer will send a message in a Nostr gift wrap event to Mostro with the order that wants to take. Mostro will calculate the amount of sats for that order, then Mostro will send back to a buyer a message asking for a lightning network invoice with the correct amount of sats that the invoice should have. If the order has a defined amount of sats, Mostro will send the invoice with the correct amount of sats.

Also, Mostro updates the 38383 event about that order to change the status to waiting-buyer-invoice

Then the buyer have to send a gift wrap event to Mostro with the lightning invoice, and Mostro will send a gift wrap event to the buyer saying that it is waiting for payment from the seller. Also Mostro updates the 38383 Nostr event about that order to change the status to waiting-payment

This issue should address cases with range orders, sending the amount.

References: https://mostro.network/messages/take_sell.html https://mostro.network/messages/take_sell_range_order.html

Catrya commented 1 week ago

Hi @grunch i want to take this issue