Skip to content

feat(core): add GET /tx/:hash/raw endpoint returning unprocessed Horizon response#145

Merged
Tinna23 merged 1 commit intoStellarCommons:mainfrom
demilade18-git:feat/backend-30-raw-tx-endpoint
Feb 26, 2026
Merged

feat(core): add GET /tx/:hash/raw endpoint returning unprocessed Horizon response#145
Tinna23 merged 1 commit intoStellarCommons:mainfrom
demilade18-git:feat/backend-30-raw-tx-endpoint

Conversation

@demilade18-git
Copy link
Contributor

Summary

  • Adds GET /tx/:hash/raw route that proxies the raw Horizon JSON body directly to the caller with Content-Type: application/json
  • Adds fetch_transaction_raw to HorizonClient using res.bytes() to avoid deserialisation
  • Applies identical error handling to /tx/:hash — 400 for invalid hash, 404 for not found, 502 for upstream failures
  • Registers the route in the router and OpenAPI spec
  • Documents the endpoint in the README
  • Wires up horizon_test.rs into the module tree (was previously unreachable) and adds 3 tests covering the happy path, 404, and 5xx cases

Test plan

  • cargo test passes (170 tests, 0 failures)
  • GET /tx/:hash/raw returns the full Horizon JSON body unmodified
  • GET /tx/:hash/raw with an invalid hash returns 400
  • GET /tx/:hash/raw with an unknown hash returns 404

Closes #85

@Tinna23 Tinna23 merged commit 59c80a9 into StellarCommons:main Feb 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue #30 Add /tx/:hash/raw endpoint returning unprocessed Horizon response

2 participants