Skip to content

Modernization 1/4: Replace axios and feaxios with a native fetch client #1384

@Ryang-21

Description

@Ryang-21

Part of the js-stellar-sdk modernization epic.

Goal

Remove axios (Node) and feaxios (browser) in favor of a single fetch-based HTTP client with behavior parity.

Scope

  • Implement a fetch-based client in src/http-client/ covering request/response interceptors, timeout, custom headers, and error shape compatibility with the existing axios-style surface used across src/horizon/, src/rpc/, src/stellartoml/, src/federation/, and src/friendbot/.
  • Map non-2xx responses to the existing error shape (e.g., NetworkError, status code, response.data) so downstream catch blocks keep working.
  • Preserve configurable global timeout and user-agent header behavior.
  • Delete src/horizon/horizon_axios_client.ts, src/http-client/axios-client.ts, src/rpc/axios.ts, and the src/no-axios/ scratch directory once migration lands.

Acceptance

  • axios and feaxios removed from package.json and yarn.lock.
  • Existing unit and integration tests pass without changes to assertions (only mock setup may change).
  • Browser and Node bundles build and exercise the same code path.
  • No behavioral regression in CallBuilder pagination, streaming (SSE), or error propagation.

Risks

  • fetch's streaming semantics differ from axios; the Horizon streaming code path needs careful validation against a live network.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Needs Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions