haveno-dex / haveno

Decentralized P2P exchange platform built on Monero and Tor
https://haveno.exchange
GNU Affero General Public License v3.0
980 stars 110 forks source link

Add new notification listeners #1236

Open KewbitXMR opened 2 weeks ago

KewbitXMR commented 2 weeks ago

Add a notifications for the following:

  1. New Dispute on Trade (sending Dispute with Trade object deep embedded)
  2. Dispute State Update
  3. Trade Phase Updates
  4. Wallet Transaction Received (Or I think there is a PayoutState which might be more appropriate to send each time it changes)
  5. My understanding is there is 2 ways of paying into the wallet, 1 is via a funding wallet and the other is by the primary or stealth addresses oft that primary. Notifications for situations where a user has deposited money in, outside of a Haveno trade, should receive a notifications also.
  6. Trade Payout State (sending Trade object deep)

It would be good where appropriate to send the full proto to Json buffer deeply, containing all properties, this avoids having to poll the gRPC necessarily after getting a notification. Something to consider is that this implementation may have been originally intended as notifications the user would 'see' as a push notification and no necessarily helping with state updates for the app :P

So maybe building a separate model rather than implementing to NotificationsListener perhaps a StateListener with separate endpoints, just a thought!

Let me know what you think or if it's too much, not sure what this means in terms of load?

KewbitXMR commented 1 week ago

I made some changes for clarity, I also added trade.payoutState, as that would be useful to send notifications for too.

KewbitXMR commented 1 week ago

Add another edit after some thought