Skip to content

feat: Implement robust Soroban RPC Client with retry logic (#149)#225

Merged
Baskarayelu merged 6 commits intoRemitwise-Org:mainfrom
edehvictor:feat/soroban-rpc-client
Feb 25, 2026
Merged

feat: Implement robust Soroban RPC Client with retry logic (#149)#225
Baskarayelu merged 6 commits intoRemitwise-Org:mainfrom
edehvictor:feat/soroban-rpc-client

Conversation

@edehvictor
Copy link
Contributor

Overview

This PR implements a server-side Soroban RPC client utility to allow the application to interact with the Stellar network. It provides a robust foundation for reading contract state and building transactions.

Changes Made

  • Client Implementation: Created lib/soroban/client.ts as a singleton to manage the connection to the Soroban RPC node.
  • Resilience: Added a withRetry helper that uses AbortController to handle request timeouts (10s) and automatic retries for transient network errors.
  • Health Check: Implemented a new API route at /api/health/soroban that returns the current ledger sequence to verify connectivity.
  • Documentation: Updated README.md to include environment variable configurations for both Testnet and Mainnet.

Technical Details

  • Used the SorobanRpc.Server class from @stellar/stellar-sdk.
  • Ensured the client is server-side only by omitting the NEXT_PUBLIC_ prefix on sensitive environment variables.

Verification

  • Connection initialized with Testnet defaults.
  • Error handling verified through custom SorobanClientError class.

Closes #149

@edehvictor
Copy link
Contributor Author

@Baskarayelu, please review

@Baskarayelu
Copy link
Contributor

resolve the conflicts

@edehvictor
Copy link
Contributor Author

@Baskarayelu, I have resolved conflict. Pls kindly review

@Baskarayelu
Copy link
Contributor

LGTM!

@Baskarayelu Baskarayelu merged commit c2406fb into Remitwise-Org:main Feb 25, 2026
1 check passed
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.

Create Base Soroban RPC Client

2 participants