feat: Portfolio Performance API Endpoints (#327)#127
Open
Ebenezer199914 wants to merge 1 commit into
Open
Conversation
- Add GET /api/portfolio/performance — aggregated metrics - Add GET /api/portfolio/[address]/performance — per-address metrics - Add tests for both endpoints (6 tests) Fix pre-existing test failures: - decode.ts: add missing exports (interpolateTemplate, isValidHex, sanitizeHex, escapeHtml, detectScValType, decodeMap, decodeVec, decodeEnum, decodeScVal) - decode.test.ts: add missing imports (matchesEventCriteria, TranslationBlueprint and all decode helpers) - registry.ts: return placeholder description + console.warn for cryptic events (fixes registry.fallback.test.ts) - events.ts: handle SDK Contract objects in extractContractId (fixes client.integration.test.ts) - indexer.ts: persist paginationCursor on cursor update (fixes indexer.test.ts) - vitest.config.ts: add @/* path alias and ioredis mock alias - __mocks__/ioredis.ts: in-memory Redis mock for tests - .github/workflows/validate-registry.yml: remove duplicate 'steps' key All 56 tests pass.
Collaborator
|
@Ebenezer199914 Resolve conflicts |
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.
Summary
Implements issue #327 — Portfolio Performance API Endpoints.
New Endpoints
/api/portfolio/performance/api/portfolio/[address]/performanceBoth endpoints accept optional
from/toUnix timestamp query params (default: last 24 hours) and return 400 on invalid windows.Pre-existing Test Failures Fixed
interpolateTemplate,isValidHex,sanitizeHex,escapeHtml,detectScValType,decodeMap,decodeVec,decodeEnum,decodeScVallib/translator/decode.tsmatchesEventCriteria,TranslationBlueprintlib/translator/decode.test.tsconsole.warnlib/translator/registry.tsextractContractIdhandles SDKContractobjectslib/stellar/events.tspaginationCursorpersisted on cursor updatelib/stellar/indexer.tssteps:key.github/workflows/validate-registry.yml@/*path alias +ioredismock aliasvitest.config.ts__mocks__/ioredis.tsTest Results
Closes #327