Closed TomaszGol closed 1 month ago
This update introduces new types and classes to manage market and historical market prices, alongside various utility improvements. Significant changes include the introduction of MarketPrices
and HistoricalMarketPrice
types to the GraphQL schema, the addition of new resolvers and providers for handling blockchain safe modes, and a refactor of the OraclePriceProvider
class to leverage a new Provider
class for API initialization.
File | Change Summary |
---|---|
schema.graphql |
Added new types MarketPrices and HistoricalMarketPrice with fields id , price , timestamp , and market . |
src/model/generated/index.ts |
Added export statement for "marketPrices.model" . |
src/model/generated/marketPrices.model.ts |
Introduced MarketPrices class representing market prices. |
src/model/generated/historicalMarketPrice.model.ts |
Introduced HistoricalMarketPrice class representing historical market prices. |
src/server-extension/resolvers/blockchainSafeModeResolver.ts |
Introduced BlockchainSafeMode and BlockchainSafeModeResolver classes for blockchain safe mode information. |
src/server-extension/resolvers/playerLeaderboardPlace.ts |
Introduced PlayerLeaderBoardResolver class for retrieving player leaderboard places. |
src/utils/blockchainSafeModeProvider.ts |
Introduced BlockchainSafeModeProvider class for interacting with blockchain API to retrieve safe mode info. |
src/utils/oraclePriceProvider.ts |
Refactored to use Provider class for API initialization, modified method signature. |
src/utils/provider.ts |
Introduced Provider class for setting up RPC connections and API initialization. |
src/utils/userLeaderboardPlaceProvider.ts |
Introduced function getUserPlace to retrieve user position in a general leaderboard. |
src/eventprocessor/market/marketRemovedEventProcessor.ts |
Modified query method to delete records from multiple tables related to specific market_id . |
sequenceDiagram
participant Client
participant GraphQLServer
participant MarketPricesModel
participant HistoricalMarketPriceModel
Client->>GraphQLServer: Query MarketPrices
GraphQLServer->>MarketPricesModel: Fetch current market prices
MarketPricesModel-->>GraphQLServer: Return market prices
GraphQLServer-->>Client: Return market prices
Client->>GraphQLServer: Query HistoricalMarketPrice
GraphQLServer->>HistoricalMarketPriceModel: Fetch historical market prices
HistoricalMarketPriceModel-->>GraphQLServer: Return historical prices
GraphQLServer-->>Client: Return historical prices
In fields of code where updates bloom,
New types and classes lift the gloom.
Market prices, safe modes too,
With these changes, skies turn blue.
APIs now with ease we steer,
A future bright, the path is clear.
🐇✨
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?
Summary by CodeRabbit
New Features
MarketPrices
andHistoricalMarketPrice
types to support querying market price data.BlockchainSafeMode
andBlockchainSafeModeResolver
for retrieving blockchain safe mode information.PlayerLeaderBoardResolver
for fetching player leaderboard positions.getUserPlace
function for retrieving user leaderboard positions.Refactor
OraclePriceProvider
to utilize the newProvider
class for API initialization.MarketRemovedEventProcessor
to delete records from multiple tables related to a specificmarket_id
.New Utility Classes
BlockchainSafeModeProvider
for fetching blockchain safe mode data.Provider
class for initializing connections to an RPC URL.