-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: global staking overview #10
Conversation
WalkthroughThe recent updates focus on enhancing the staking functionality across multiple services by introducing new configuration variables, updating enums with additional endpoints, and integrating new methods for fetching and caching staking-related data. Key additions include the introduction of global staking overview variables, methods for retrieving validators, total supply, and APR, as well as updates to caching mechanisms to support these new features. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (15)
- .env.example (1 hunks)
- src/core/config/config.dto.ts (1 hunks)
- src/core/config/config.schema.ts (1 hunks)
- src/core/config/config.ts (1 hunks)
- src/core/lib/okp4/enums/endpoints.enum.ts (1 hunks)
- src/core/lib/okp4/okp4.service.ts (2 hunks)
- src/core/lib/okp4/responses/supply.response.ts (1 hunks)
- src/core/lib/osmosis/enums/endpoints.enum.ts (1 hunks)
- src/core/lib/osmosis/osmosis.service.ts (1 hunks)
- src/modules/stacking/dtos/global-staked-overview.dto.ts (1 hunks)
- src/modules/stacking/enums/stacking-endpoints.enum.ts (1 hunks)
- src/modules/stacking/services/stacking.cache.ts (2 hunks)
- src/modules/stacking/services/stacking.service.ts (3 hunks)
- src/modules/stacking/stacking.controller.ts (1 hunks)
- src/modules/stacking/stacking.module.ts (1 hunks)
Files skipped from review due to trivial changes (4)
- .env.example
- src/core/lib/osmosis/enums/endpoints.enum.ts
- src/modules/stacking/dtos/global-staked-overview.dto.ts
- src/modules/stacking/enums/stacking-endpoints.enum.ts
Additional comments not posted (14)
src/core/lib/okp4/responses/supply.response.ts (1)
3-8
: The newSupplyResponse
type andSupply
interface are well-defined and align with TypeScript best practices.src/core/lib/okp4/enums/endpoints.enum.ts (1)
7-8
: The addition ofVALIDATORS
andTOTAL_SUPPLY
endpoints to theEndpoints
enum is correctly implemented and follows the established URL pattern.src/core/config/config.dto.ts (1)
32-32
: The addition of theglobalStakingOverview
property to theCacheConfig
interface is correctly implemented and appropriately typed.src/core/config/config.schema.ts (1)
15-15
: The addition of theGLOBAL_STAKING_OVERVIEW
field to theConfigSchema
is correctly defined as a required number, following Joi validation best practices.src/core/config/config.ts (1)
23-23
: The addition of theglobalStakingOverview
property to theconfig
object is correctly implemented, appropriately retrieving and converting the environment variable value.src/modules/stacking/stacking.module.ts (1)
13-13
: The addition ofOsmosisService
to the providers in theStackingModule
is correctly implemented and aligns with the module's functionalities.src/modules/stacking/stacking.controller.ts (1)
23-26
: The addition of thegetGlobalOverview
method to theStackingController
is correctly implemented, using appropriate NestJS decorators and service calls.src/modules/stacking/services/stacking.cache.ts (1)
Line range hint
9-46
: The additions ofsetGlobalStakedOverview
,getGlobalStakedOverview
, and theglobalOverviewPrefix
in theStackingCache
service are correctly implemented, effectively utilizing caching mechanisms and JSON serialization.src/core/lib/osmosis/osmosis.service.ts (1)
64-68
: The implementation ofgetStakingApr
method is consistent with existing patterns and correctly uses utility functions.src/core/lib/okp4/okp4.service.ts (2)
75-81
: The implementation ofgetValidators
method is consistent with existing patterns and correctly uses utility functions and constants.
83-87
: The implementation ofgetTotalSupply
method is consistent with existing patterns and correctly uses utility functions.src/modules/stacking/services/stacking.service.ts (3)
68-76
: The implementation ofgetGlobalOverview
method correctly handles caching and data fetching.
79-98
: The implementation offetchAndCacheGlobalStakedOverview
method is robust, correctly handling asynchronous operations and data calculations.
100-103
: The implementation ofcalculateTotalStaked
method correctly uses theBig
library for precise arithmetic operations.
No description provided.