Skip to content

Phase 1: Fix 8 bugs, add Cancel Orders and Get Order endpoints#1

Merged
milesangelo merged 1 commit into
mainfrom
phase1/bug-fixes-and-core-order-management
Apr 6, 2026
Merged

Phase 1: Fix 8 bugs, add Cancel Orders and Get Order endpoints#1
milesangelo merged 1 commit into
mainfrom
phase1/bug-fixes-and-core-order-management

Conversation

@milesangelo

Copy link
Copy Markdown
Contributor

Summary

  • Fix 8 confirmed bugs: CancellationToken propagation, OrderSearchRequest serialization, duplicate model types with type mismatches, non-cryptographic JWT nonce RNG, non-compiling examples, incorrect README, wrong SandboxBaseUrl default, untyped GetProduct return
  • Add Cancel Orders endpoint (POST /orders/batch_cancel) with CancelOrdersAsync, CancelOrdersRequest/CancelOrdersResponse models
  • Add Get Order by ID endpoint (GET /orders/historical/{orderId}) with GetOrderAsync, GetOrderResponse model
  • Add typed GetProduct wrapperGetProductAsync now returns AdvancedTradeProduct instead of raw string

Bug Details

# Bug Severity
B1 CancellationToken accepted but never passed to Polly or ICoinbaseApi High
B7 OrderSearchRequest sent PascalCase query params instead of snake_case High
B2 Duplicate order config types with decimal/double/string mismatches Medium
B5 JWT nonce used new Random() instead of RandomNumberGenerator Medium
B3 Examples called non-existent methods and used wrong property names Medium
B4 README showed non-existent CoinbaseApiException, wrong OrderSide.Buy Medium
B6 SandboxBaseUrl defaulted to localhost instead of Coinbase sandbox Low
B8 GetProduct returned Task<string> instead of typed model Low

Test plan

  • 12 new unit tests added (CancelOrders, GetOrder, GetProduct, CancellationToken propagation, serialization)
  • All 62 tests passing (48 unit + 14 integration)
  • dotnet build — 0 errors
  • dotnet format --verify-no-changes — clean
  • No breaking changes to existing public API (CancellationToken params have defaults)

🤖 Generated with Claude Code

Bug fixes:
- Fix CancellationToken never propagated through Polly policies or ICoinbaseApi
- Fix OrderSearchRequest missing [AliasAs] attributes (sent PascalCase instead of snake_case)
- Remove unused duplicate order config types from GetOrdersResponse.cs
- Fix BaseSize type inconsistencies (decimal/double → string) in order models
- Replace non-cryptographic Random with RandomNumberGenerator in JWT nonce
- Fix SandboxBaseUrl default to actual Coinbase sandbox URL
- Fix GetProduct return type from Task<string> to Task<AdvancedTradeProduct>
- Fix non-compiling examples and incorrect README code samples

New endpoints:
- CancelOrdersAsync (POST /orders/batch_cancel)
- GetOrderAsync (GET /orders/historical/{orderId})
- GetProductAsync wrapper on typed GetProduct

Tests: 12 new tests (62 total), all passing. Formatting clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@milesangelo
milesangelo merged commit 05a87fb into main Apr 6, 2026
7 of 9 checks passed
@milesangelo
milesangelo deleted the phase1/bug-fixes-and-core-order-management branch April 6, 2026 18:56
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.

1 participant