feat(api): implement prices feature with REST endpoints for signed#35
Open
JosueBrenes wants to merge 1 commit intoNeko-Protocol:mainfrom
Open
Conversation
…ice feeds - Added PricesModule, PricesController, and PricesService to manage signed price proofs. - Implemented endpoints to retrieve the latest prices for all symbols and for individual symbols. - Updated README.md with new API documentation for price feeds. - Added unit tests for PricesController and PricesService to ensure functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ice feeds
🚀 Neko Pull Request
Mark with an
xall the checkboxes that apply (like[x])📌 Type of Change
📝 Changes description
Implements REST endpoints for signed price feeds (API Publisher) as described in #32.
New files:
apps/api/src/prices/prices.module.ts— NestJS feature module for pricesapps/api/src/prices/prices.service.ts— In-memory store forSignedPriceProofwithupdatePrice(),getLatestPrice(),getAllLatestPrices(), andisReady()apps/api/src/prices/prices.controller.ts— Two endpoints:GET /prices/latest— returns all latest signed price proofs (503 if no data)GET /prices/latest/:symbol— returns proof for a single symbol (404 if unknown, 503 if no data)apps/api/src/prices/prices.controller.spec.ts— 6 unit tests for controllerapps/api/src/prices/prices.service.spec.ts— 8 unit tests for serviceModified files:
apps/api/src/app.module.ts— RegisteredPricesModuleapps/api/package.json— Added@oracle-stocks/signerdependencyapps/api/README.md— Documented new routes, response shapes, and how the store is populatedNo breaking changes — existing
GET /andGET /healthendpoints remain untouched.Response format uses
SignedPriceProoffrom@oracle-stocks/signer:{ "data": { "symbol": "AAPL", "price": 189.45, "timestamp": 1719500000000, "source": "aggregator" }, "signature": "3045022100...", "publicKey": "04abc123...", "timestamp": 1719500000000 }Test results: 4 suites, 23 tests passing. Build succeeds with
npm run build.📸 Evidence (A Loom/Cap video is required as evidence, we WON'T merge if there's no proof)
(pending — will attach Loom/Cap recording)
⏰ Time spent breakdown
🌌 Comments
PricesServiceuses an in-memoryMap<string, SignedPriceProof>as a stub store. TheupdatePrice()method is exported so the aggregator/signer pipeline can push data in a future integration.Thank you for contributing to Neko, you just helped us make RWAs consumer friendly on Stellar! We hope you can continue contributing to this project.