MostroP2P / mobile

Mobile client for Mostro p2p
6 stars 4 forks source link

Take sell order #8

Open Catrya opened 5 months ago

Catrya commented 5 months 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 nip59 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 nip59 event to Mostro with the lightning invoice, and Mostro will send a nip59 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/protocol/take_sell.html https://mostro.network/protocol/take_sell_range_order.html

Must adhere to this design.