core icon indicating copy to clipboard operation
core copied to clipboard

chore: adds non-evm staking

Open zone-live opened this issue 2 months ago • 0 comments

Explanation

Adds a tron_staking state structure to support staking APY data for Tron.

Tron staking uses a different approach than EVM pooled staking, so rather than forcing Tron into the existing pooled_staking structure (which would require nullable vault-specific fields and conditional logic), this introduces a dedicated Tron specific state.

We opted for a chain-specific key (tron_staking) rather than a generic non_evm_staking map because different non-EVM chains may have significantly different data requirements. This approach is more explicit and if we add other non-EVM chains later, they can have their own state structures.

The idea next is for the mobile client to: 1 - Call EarnController.refreshNonEvmStakingApy() with Tron witness API fetcher 2 - Use the selectors in selectEarnTokens to populate earnToken.experience.apr with the Tron APY 3- Get rid of the useTronStakeApy hook calls from components

References

Checklist

  • [ ] I've updated the test suite for new or updated code as appropriate
  • [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • [ ] I've communicated my changes to consumers by updating changelogs for packages I've changed
  • [ ] I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

[!NOTE] Adds tron_staking state with APY fetch/get, new selectors, exports, and tests; also tightens selector typings.

  • EarnController:
    • Add TronStakingState and include tron_staking in EarnControllerState and metadata; default is null.
    • Implement refreshTronStakingApy(apyFetcher) and getTronStakingApy(); update state with { apy, lastUpdated }.
  • Selectors:
    • Add selectTronStaking and selectTronStakingApy; export from index.ts.
    • Minor: strengthen return types on existing lending selectors.
  • Tests:
    • Add tests for TRON staking defaults, APY refresh/overwrite/error, and selectors.
    • Update metadata-related snapshots to account for tron_staking.

Written by Cursor Bugbot for commit 4ca7f0da9713627e29c05b612325eb32504433d7. This will update automatically on new commits. Configure here.

zone-live avatar Dec 11 '25 14:12 zone-live