Skip to content

Add per-method request timeout configuration #398

Description

@Kingsman-99

Overview

All SDK calls share a single global timeout. Read-heavy methods like getLeaderboard may need longer timeouts than quick lookups like getInvoice. Add per-method timeout overrides.

Acceptance Criteria

  • StellarSplitSDK({ timeout: { default: 10000, getLeaderboard: 30000, getInvoiceHistory: 20000 } }) config
  • default timeout applies to any method not explicitly listed; defaults to 10 000 ms
  • Per-call override: sdk.getLeaderboard({ timeout: 60000 }) for one-off extension
  • Timeout implemented via AbortController — request aborted (not just ignored) on timeout
  • Throws RequestTimeoutError with { method, timeoutMs } when timed out
  • Retry logic respects per-attempt timeout — each retry gets a fresh timeout window
  • sdk.getTimeoutConfig() returns the resolved timeout for each known method
  • Unit tests: fast method times out correctly; slow method with long timeout succeeds

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions