Skip to content

Move the API response types into a single shared types module #351

Description

@mikewheeleer

Move the API response types into a single shared types module

Description

Response shapes for pairs, quotes, events, keys, and webhooks are declared ad hoc inside each client under src/app, so drift between pages is invisible to the compiler.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-frontend only.
  • Create src/lib/types.ts exporting the shared response interfaces.
  • Import those types in every client instead of redeclaring them.
  • Keep src/lib/quote.ts and src/lib/events.ts as the validation owners.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b refactor/types-move-the-api-response
  • Write code in: src/lib/types.ts
  • Write comprehensive tests in: src/lib/__tests__/types.test.ts
  • Add documentation: docs/api-client.md

Test and commit

  • Run npm run lint, npm test, npm run build
  • Cover edge cases; include test output

Example commit message

refactor(types): centralize API response types

Guidelines

  • Minimum 95 percent test coverage for impacted modules
  • Clear documentation
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the StableRoute community on Discord: https://discord.gg/37aCpusvx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — a 5-star rating is much appreciated.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions