feat: display rFOX reward transactions on dashboard
Description
Upgrades the rFOX dashboard to show all rewards received for the current rFOX staking account.
Supports display of rewards sent to any thorchain account currently connected to the app, corresponding to the staking account on the rFOX page. Includes historically changed thorchain addresses as long as they are connected to the app.
Refactoring and general improvements:
- Makes
getReadStakingInfoQueryFnandgetReadStakingInfoQueryKeyfunctions for re-usable application to the newuseStakingInfoHistoryQuery - Added loading skeleton to
TransactionsGroupByDate - Safer selectors
selectRuneAddressandselectStakingBalancereplacing repeated, less safe equivalents
Cleanup:
- Moves types into
types.tsfiles - Moves helpers into
helpers.tsfiles - Moves constants into
constants.tsfiles - Removed unused
selectHighestAccountNumberForChainId - Fixed incorrect naming of some functions noticed while devving
Doesnt do:
- Does not support displaying rewards received to thorchain accounts not connected to the app
- Does not support multiple staking accounts
Pull Request Type
- [ ] :bug: Bug fix (Non-breaking Change: Fixes an issue)
- [ ] :hammer_and_wrench: Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
- [x] :nail_care: New Feature (Breaking/Non-breaking Change)
Issue (if applicable)
closes #7281
Risk
High Risk PRs Require 2 approvals
Moderate risk, affects rFOX hooks responsible for fetching rFOX data for dashboard. Does not affect sending of funds or transacting.
What protocols, transaction types or contract interactions might be affected by this PR?
Testing
Impossible to thoroughly test without mock data (engineers please test this, see below). Smoke test of rFOX dashboard to ensure no crashing or insane behavior.
Engineering
Set up your .env for testing with mock data:
REACT_APP_FEATURE_RFOX_REWARDS_TX_HISTORY=true
REACT_APP_FEATURE_RFOX_MOCK_REWARDS_TX_HISTORY=true
REACT_APP_RFOX_REWARDS_MOCK_RUNE_ADDRESS=<your connected rune address>
Clear cache when finished testing to remove mock txs.
Operations
Screenshots (if applicable)
https://jam.dev/c/cfb51e7a-5e95-46ea-a655-0181a8000ec6
Note: we should avoid any requests that would require an archive node in the front end.
We can get the historic rune address from the tx data directly vs having to pull that at a given block height / state.
Blocking: we cannot fetch rune address historically from the node as this would require an archive node in production. ~~Instead we should lookup the logs with rune address changes, and then grab the tx data associated with that log, decode it to get the rune address.~~
Scheduled to move directly to IPFS for all of this
Merging now so we can re-work all dashboard queries to work without archive node, and instead use IPFS https://github.com/shapeshift/web/issues/7343