feat: Soroban RPC read client (/api/v1/chain) - #17
Merged
Conversation
First slice of the on-chain integration roadmap item: an injectable service wrapping @stellar/stellar-sdk's SorobanRpc.Server, reading the RPC URL from ConfigService (stellar.sorobanRpcUrl, already validated/defaulted since the config module PR). Exposes read-only methods: getHealth, getLatestLedger, getNetwork, getAccount. No write/submit methods yet - this is explicitly read-only per the roadmap item's scope. Wired into AppModule; no HTTP surface yet (next commit). Verified against the real Stellar testnet Soroban RPC (not mocked): getHealth, getLatestLedger, and getNetwork all returned real, correctly-shaped responses from https://soroban-testnet.stellar.org via a throwaway script, not committed. The RPC endpoint is occasionally slow/flaky from this sandbox (same as Docker Hub pulls in the Dockerfile PR) but consistently reachable on retry.
Adds SorobanController: GET /api/v1/chain/health, /ledger, /network, /account/:publicKey - all backed by the real SorobanService added in the previous commit. Verified against the real Stellar testnet through the live app (not mocked): all three no-arg routes returned real testnet data, and GET /account/:publicKey with a real (if arbitrary) well-formed public key returned that account's real sequence number. Also checked the honest failure path: a malformed public key throws the SDK's raw "invalid encoded string" error, which the existing global exception filter correctly catches, logs, and returns as a 500 - no special key-format validation yet, which is fine for this read-only first slice but worth knowing about.
This was referenced Jul 25, 2026
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
First slice of the on-chain integration roadmap item — read-only Soroban RPC access, no writes/transaction submission yet:
SorobanService— injectable wrapper around@stellar/stellar-sdk'sSorobanRpc.Server, reading the RPC URL fromConfigService(stellar.sorobanRpcUrl, already validated/defaulted since the config module PR). Methods:getHealth,getLatestLedger,getNetwork,getAccount.SorobanController—GET /api/v1/chain/health,/ledger,/network,/account/:publicKey.Test plan
npm run typecheck/lint/build/test/test:e2eall pass (23 e2e + 18 unit, confirmsSorobanService's constructor makes no network calls, so e2e tests stay fast/offline-safe)/health,/network,/ledger→ real current testnet data/account/:publicKeywith a well-formed key → real account sequence numbersoroban-testnet.stellar.orgis occasionally slow/flaky (same as Docker Hub was in the Dockerfile PR) but consistently reachable on retry; real users won't see this.