Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IStakingApi #1823

Merged
merged 4 commits into from
Aug 19, 2024
Merged

Add IStakingApi #1823

merged 4 commits into from
Aug 19, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Aug 14, 2024

Summary

This adds the new IStakingApi datasource with Kiln-based implementation and relative manager:

  • getDeployments - returns deployments of the relative contracts for staking/vaults
  • getNetworkStats - returns overall ETH stats, e.g. entry/exit/withdrawal times
  • getDedicatedStakingStats - returns native staking stats, e.g. APY
  • getPooledStakingStats - returns pooled staking stats, e.g. GRR
  • getDefiVaultStats - returns vault stats, e.g. GRR

Note: these methods facilitate confirmation view integration. For transaction decoding, we will likely need add others for fetching historical transactions.

Changes

  • Add IStakingApi and relative IStakingApiManager instantiating on call and clearing on CHAIN_UPDATE event:
    • Add KilnStakingApi implementation of IStakingApi
  • Add respective schemas, with inferred types, builders and tests:
    • Deployment
    • NetworkStats
    • DedicatedStakingStats
    • PooledStakingStats
    • DefiVaultStats
  • Add IStakingRepository which calls the above API and parses against the respective schemas
  • Add appropriate test coverage

@iamacook iamacook self-assigned this Aug 14, 2024
@coveralls
Copy link

coveralls commented Aug 14, 2024

Pull Request Test Coverage Report for Build 10389904110

Details

  • 62 of 126 (49.21%) changed or added relevant lines in 14 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 46.893%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/domain/hooks/hooks.repository.ts 3 5 60.0%
src/datasources/staking-api/staking-api.manager.ts 13 21 61.9%
src/domain/staking/staking.repository.ts 10 28 35.71%
src/datasources/staking-api/kiln-api.service.ts 1 37 2.7%
Totals Coverage Status
Change from base Build 10366659967: -0.01%
Covered Lines: 4613
Relevant Lines: 7958

💛 - Coveralls

@iamacook iamacook marked this pull request as ready for review August 19, 2024 15:31
@iamacook iamacook requested a review from a team as a code owner August 19, 2024 15:31
@iamacook iamacook merged commit d71d5e7 into main Aug 19, 2024
16 checks passed
@iamacook iamacook deleted the staking-datasource branch August 19, 2024 15:32
DenSmolonski pushed a commit to Zilliqa/safe-client-gateway that referenced this pull request Oct 24, 2024
Wdds the new `IStakingApi` datasource with Kiln-based implementation and relative manager:

- Add `IStakingApi` and relative `IStakingApiManager` instantiating on call and clearing on `CHAIN_UPDATE` event:
  - Add `KilnStakingApi` implementation of `IStakingApi`
- Add respective schemas, with inferred types, builders and tests:
  - `Deployment`
  - `NetworkStats`
  - `DedicatedStakingStats`
  - `PooledStakingStats`
  - `DefiVaultStats`
- Add `IStakingRepository` which calls the above API and parses against the respective schemas
- Add appropriate test coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants