Skip to content

Conversation

@nmorgan-cb
Copy link
Contributor

@nmorgan-cb nmorgan-cb commented Jul 23, 2025

Summary

Comprehensive update to the Coinbase Prime .NET SDK bringing it to v0.4.0 with complete API coverage, full alignment with the OpenAPI specification, and enhanced HTTP client functionality.

Key Changes

HTTP Client Enhancements

  • Dynamic SDK Version Header: Replaced hardcoded SdkVersion with dynamic assembly version extraction
  • All HTTP requests now include User-Agent: prime-sdk-dotnet/{version} header using actual package version (0.4.0)
  • Added comprehensive test suite for version header functionality following TDD principles

PaginatedRequest Base Class Implementation

  • Added PaginatedRequest abstract base class with standardized Cursor and Limit properties
  • Added PaginatedRequestBuilder<T,TBuilder> generic base class for type-safe fluent pagination API
  • Added IntegerCursorPaginatedRequest for special case handling (ListInvoicesRequest uses int? cursor)
  • Updated 25 request classes to inherit from pagination base classes, eliminating ~300 lines of duplicated code
  • Maintained 100% backwards compatibility with existing builder method signatures
  • Added comprehensive test suite with 30 tests covering base classes and backwards compatibility
  • All paginated endpoints now follow consistent patterns for improved maintainability

New API Endpoints

  • OrdersService.EditOrder - Modify existing order parameters
  • ActivitiesService.GetActivity - Retrieve individual activity details
  • FuturesService.GetFcmMarginCallDetails / GetFcmRiskLimits - FCM trading support
  • WalletsService.GetWallet / CreateWalletDepositAddress / ListWalletAddresses - Enhanced wallet management
  • StakingService.CreatePortfolioStake / CreatePortfolioUnstake - Portfolio staking operations
  • BalancesService.ListWeb3WalletBalances - Web3 wallet integration
  • OnchainAddressGroupsService - Complete onchain address group management

OpenAPI Spec Alignment

  • Replaced string parameters with proper enum types as defined in API spec
  • Added missing ActivityCategory, ActivityStatus, ActivityLevel, SortDirection, TransactionType enums
  • Updated 25+ request models to match OpenAPI schema definitions
  • Added missing model properties to align with current API specification

Method Renaming

  • GetActivityByActivityIdGetActivity
  • GetPortfolioAddressBookListAddressBookEntries
  • GetPortfolioByIdGetPortfolio
  • GetTransactionByTransactionIdGetTransaction

Testing Infrastructure

  • Added CoinbaseSdk.Prime.Tests project with comprehensive test coverage
  • Implemented TDD approach for version header functionality and pagination base classes
  • All tests pass, ensuring robust SDK behavior

Examples

  • Converted all examples to standalone .csx scripts using dotnet-script
  • Added new example scripts for EditOrder, GetActivity, FCM operations, and wallet management

Documentation

  • Updated CHANGELOG.md with comprehensive v0.4.0 release notes
  • Enhanced CLAUDE.md with improved architecture documentation

Test Plan

  • All existing functionality preserved
  • New version header correctly applied to all requests
  • Test suite passes (30/30 tests)
  • Build succeeds without warnings
  • Version extraction works correctly (prime-sdk-dotnet/0.4.0)
  • Pagination base classes work correctly with all 25 request types
  • Backwards compatibility maintained for all existing builder APIs

@nmorgan-cb nmorgan-cb requested review from cfluke-cb, jc-cb and rcbgr July 23, 2025 03:24
@nmorgan-cb nmorgan-cb force-pushed the sdk-updates-new-endpoints branch from 5f344b2 to 4aa5abf Compare July 23, 2025 22:11
@nmorgan-cb nmorgan-cb requested review from cfluke-cb and rcbgr July 23, 2025 22:14
@nmorgan-cb nmorgan-cb requested a review from cfluke-cb July 24, 2025 22:43
@nmorgan-cb nmorgan-cb requested a review from rcbgr July 29, 2025 19:44
Copy link
Contributor

@cfluke-cb cfluke-cb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a Paginated Request base class to handle Cursor and Limit? they are consistent across api.
SortDirection is in some places, and not others. your discretion to put in PaginatedRequest as optional or not

Copy link

@rcbgr rcbgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the following header to the .net and java SDKs for all requests

prime-sdk-java|dotnet/$version

@nmorgan-cb nmorgan-cb changed the title SDK Updates: New Endpoints and Top-Level Examples add EditOrder endpoint and merge changelog updates Sep 18, 2025
@nmorgan-cb nmorgan-cb changed the title add EditOrder endpoint and merge changelog updates comprehensive SDK update with new endpoints and type safety enhancements Sep 18, 2025
@nmorgan-cb nmorgan-cb changed the title comprehensive SDK update with new endpoints and type safety enhancements comprehensive SDK update with new endpoints and OpenAPI spec alignment Sep 18, 2025
@nmorgan-cb nmorgan-cb force-pushed the sdk-updates-new-endpoints branch 2 times, most recently from 2723659 to 486ddd0 Compare September 18, 2025 23:23
@nmorgan-cb nmorgan-cb force-pushed the sdk-updates-new-endpoints branch from a7b4a8c to 4ca5958 Compare September 18, 2025 23:51
@nmorgan-cb nmorgan-cb force-pushed the sdk-updates-new-endpoints branch 2 times, most recently from 119d00c to a8b72ea Compare October 16, 2025 14:35
@nmorgan-cb nmorgan-cb requested a review from cfluke-cb October 21, 2025 22:55
@nmorgan-cb nmorgan-cb force-pushed the sdk-updates-new-endpoints branch from da422c7 to 16df2a7 Compare December 10, 2025 03:54
@nmorgan-cb nmorgan-cb requested review from jc-cb and rcbgr December 23, 2025 17:27
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.

5 participants