Lunie: Add claimed rewards event

Created on 3 Sep 2020  路  7Comments  路  Source: luniehq/lunie

To make it transparent in Polkadot that you received your rewards we want to show the user the events when this happened.

How?

  • Listen to claiming extrinsics
  • When a claim is detected, get all rewards for all the users and create a notification for each user summing up the rewards they get
  • use the db rewards to increase the performance of the query
    ~- but we need to query the unclaimed rewards per user~ you can't claim an era twice

All 7 comments

Rewards notifications, such a killer feature!

Listen to claiming extrinsics

To listen for these, shouldn't we be listening for every kind of extrinsic to be able to tell?

We are already listening to all extrinsics I think. We just need to react to the claim extrinsics.

We are already listening to all extrinsics I think. We just need to react to the claim extrinsics.

I don't find this bit in the code :eyes: Unless eventSubscription is doing more than it seems at first sight? Is it also reacting like userTransactionAdded?

Check polkadot-node-subscription > newBlockHandler (line 198)

Check polkadot-node-subscription > newBlockHandler (line 198)

Oh, I see! Amazing, I can do this !!!

We could standardize events per block on a key: value basis and then analyze those respective the protocol

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NodeGuy picture NodeGuy  路  4Comments

okwme picture okwme  路  3Comments

faboweb picture faboweb  路  3Comments

faboweb picture faboweb  路  3Comments

thebkr7 picture thebkr7  路  3Comments