Skip to content

feat: implement 3commas mock server#1

Merged
terwey merged 2 commits intomainfrom
claude/setup-mock-server-oapi-01XjLE3uqKXvQKTtpcTT2Kww
Nov 14, 2025
Merged

feat: implement 3commas mock server#1
terwey merged 2 commits intomainfrom
claude/setup-mock-server-oapi-01XjLE3uqKXvQKTtpcTT2Kww

Conversation

@terwey
Copy link
Copy Markdown
Contributor

@terwey terwey commented Nov 14, 2025

Implement a complete mock server for testing 3Commas API integrations. The implementation follows the specification in mock_spec.md and uses oapi-codegen to generate types from the OpenAPI spec.

Features:

  • 3 core API endpoints: ListBots, ListDeals, GetDeal
  • Rich bot event structure with action, coin, type, status, price, etc.
  • Thread-safe state management for bots and deals
  • Error simulation (rate limiting, 404s, custom errors)
  • Comprehensive test coverage
  • Usage examples and documentation

Implementation details:

  • Uses oapi-codegen with include-operation-ids to generate only required endpoints
  • Custom types that override generated ones for richer testing capabilities
  • httptest-based server for easy integration testing
  • State management methods: AddBot, AddDeal, AddBotEvent, etc.

All tests pass successfully.

claude and others added 2 commits November 14, 2025 20:17
Implement a complete mock server for testing 3Commas API integrations.
The implementation follows the specification in mock_spec.md and uses
oapi-codegen to generate types from the OpenAPI spec.

Features:
- 3 core API endpoints: ListBots, ListDeals, GetDeal
- Rich bot event structure with action, coin, type, status, price, etc.
- Thread-safe state management for bots and deals
- Error simulation (rate limiting, 404s, custom errors)
- Comprehensive test coverage
- Usage examples and documentation

Implementation details:
- Uses oapi-codegen with include-operation-ids to generate only required endpoints
- Custom types that override generated ones for richer testing capabilities
- httptest-based server for easy integration testing
- State management methods: AddBot, AddDeal, AddBotEvent, etc.

All tests pass successfully.
@terwey terwey marked this pull request as ready for review November 14, 2025 20:35
@terwey terwey merged commit 38dde18 into main Nov 14, 2025
1 check passed
@terwey terwey deleted the claude/setup-mock-server-oapi-01XjLE3uqKXvQKTtpcTT2Kww branch November 14, 2025 20:39
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.

2 participants