feat(api): map all known Stellar result codes to friendly error messages - #2
Open
vickydve wants to merge 7 commits into
Open
feat(api): map all known Stellar result codes to friendly error messages#2vickydve wants to merge 7 commits into
vickydve wants to merge 7 commits into
Conversation
Extend the Horizon error mapper with the full set of documented transaction and operation result codes (tx_too_late, tx_bad_auth, op_low_reserve, op_no_issuer, and others) so callers get an actionable message instead of falling through to the generic 502 network-error response. Closes BigNathan1#166
Formalizes BigNathan1 as sole maintainer with write access to main, and replaces the old maintainer-nomination path with the CONTRIBUTORS.md leaderboard for recognition.
Closes BigNathan1#153. Adds full Stellar account details endpoint (sequence, thresholds, flags, balances, signers, data) with Zod validation, exponential backoff retries on Horizon 429/503, mapped error responses, unit + testnet integration tests, and OpenAPI/CHANGELOG updates.
Closes BigNathan1#155. Adds POST /api/v1/trustlines/build for unsigned changeTrust XDR (Freighter/Albedo client-side signing), with optional custom limits, Zod validation, mapped Horizon errors, tests, and OpenAPI/CHANGELOG updates. Rebased onto main by the maintainer to resolve a trivial add/add conflict on transactions.ts against BigNathan1#586 — re-verified with tsc --noEmit and the full trustlines/accounts test suite before merge.
…elpers Closes BigNathan1#172. Adds isTestnet()/isMainnet() boolean helpers to StellarService, with unit tests and CHANGELOG update. Rebased onto main by the maintainer to resolve a CHANGELOG.md conflict; re-verified with tsc --noEmit and the stellar.test.ts suite before merge.
Closes BigNathan1#137. Adds GET /api/v1/prices/xlm with CoinGecko/Binance/Coinbase failover, 3.5s per-provider timeout, 30s Redis caching, Zod validation, and unit/integration tests plus OpenAPI/CHANGELOG updates. Rebased onto main by the maintainer to resolve conflicts against BigNathan1#586/BigNathan1#587/BigNathan1#588 (all merged just ahead of this one) in CHANGELOG.md, routes/index.ts, and openapi.yaml; re-verified with tsc --noEmit and the full price/account/trustline test suites before merge.
# Conflicts: # CHANGELOG.md
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.
What does this PR do?
Expands
backend/src/api/utils/horizonError.tsto map the full set of documented Stellar transaction- and operation-level result codes (tx_bad_seq,tx_too_late,op_underfunded,op_low_reserve,op_no_issuer, etc.) to clear, actionable error messages, instead of falling through to the generic 502 network-error response.Addresses BigNathan1/CoopLumen#166 (backlog reference BigNathan1#135).
Type of change
Testing
backend/src/api/utils/__tests__/horizonError.test.tswith full coverage of every mapped transaction and operation result code, plus fallback paths (unmapped code, 404, detail/title fallback, generic error).npx jest src/api/utils/__tests__/horizonError.test.ts— 63 passing.npx eslinton changed files — clean.npx tsc --noEmit— no new errors (one pre-existing, unrelated error onmainincontracts/transactionsis untouched by this change).Checklist
Generated by Claude Code