Joystream / orion

Atlas backend
GNU General Public License v3.0
7 stars 15 forks source link

Notifications for inboudn channel payments #294

Open bedeho opened 7 months ago

bedeho commented 7 months ago

Channels can be paid either through a direct transfer or through the channel payout proposals. Being able to process these, and then trigger notifications to the appropriate channel, would be a great way to re-engage creators when there is a positive event. Processing channel payout proposals is much harder, as it requires processing thew whole manifest and determining who is able to claim what, while normal direct payments is easier. So perhaps best to just start with the easiest for now.

zeeshanakram3 commented 7 months ago

The notifications for direct channel transfers are already implemented in the Orion, and they work as expected (provided that users have enabled notifications for this notification type). So both in-app/email notifications for YPP rewards and for any other direct channel transfer are sent already.

Processing channel payout proposals is much harder, as it requires processing thew whole manifest and determining who is able to claim what

The logic for processing the channel payouts proposal manifest/payload is already implemented in the @joystream/js monorepo package (i.e. fetching the payload header, getting the channel offset from the header, getting the payout record for a specific channel etc). And the joystream CLI commands for Channel payout proposals use the same reusable logic.

So, Orion would also use the same @joystream/js logic to determine the channel payments after processing mappings for Content.ChannelPayoutsUpdated runtime event, and dispatch notifications.