Skip to content

feat(stellar): add createHorizonClient with exponential backoff and retry support#155

Open
Marvelg256 wants to merge 1 commit into
wraith-protocol:developfrom
Marvelg256:develop
Open

feat(stellar): add createHorizonClient with exponential backoff and retry support#155
Marvelg256 wants to merge 1 commit into
wraith-protocol:developfrom
Marvelg256:develop

Conversation

@Marvelg256

Copy link
Copy Markdown

Summary

Adds createHorizonClient — a lightweight, retry-capable HTTP client for Stellar Horizon with exponential backoff, jitter, Retry-After support, and configurable retry policies.

Changes

New files

  • src/chains/stellar/horizon.tscreateHorizonClient factory with configurable retry policy, exponential backoff with jitter, Retry-After header support, retries on retryable HTTP statuses and network errors, GET/POST support, custom fetch injection, per-call retry override, trailing slash normalization, full TypeScript generics
  • test/chains/stellar/horizon.test.ts — 18 tests covering all retry scenarios, error types, and edge cases

Modified files

  • src/chains/stellar/index.ts — re-exports createHorizonClient and types

Error handling

Reuses existing RPCRequestError and RPCRetryExhaustedError from src/errors.ts.

Closes #135

…etry support

Adds a lightweight HTTP client for Stellar Horizon with:
- Configurable retry policy (max retries, base/max delay, retryable statuses)
- Exponential backoff with jitter
- Respects Retry-After header with max delay cap
- Retries on network errors (fetch throwing)
- Supports GET and POST with URLSearchParams
- Custom fetch injection for testing
- Per-call retry policy override support
- Trailing slash normalization on Horizon URL
- TypeScript generics for typed responses

Closes wraith-protocol#135
@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@Marvelg256 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Stellar Horizon retry / backoff policy config

1 participant