Skip to content

Implement SDK compression middleware #140

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Large batch responses from the RPC can be slow to transfer. This issue adds optional compression middleware that compresses outgoing request bodies and decompresses incoming responses using the browser's CompressionStream API or Node.js zlib.

Technical Context

Involves a new src/compression.ts. Detect environment and use CompressionStream (browser) or zlib.gzip (Node.js). Add compression?: { enabled: boolean; algorithm: 'gzip' | 'deflate' } to StellarSplitClientConfig. Apply via request/response interceptors. Only compress payloads > 1KB.

Acceptance Criteria

  • Compression disabled by default
  • Compresses request bodies > 1KB when enabled
  • Decompresses compressed responses automatically
  • Works in both browser and Node.js environments
  • Test verifies compressed payload smaller than original
  • All existing tests pass
  • TypeScript strict mode — zero any types

Metadata

Metadata

Assignees

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