Skip to content

Conversation

@lokesh-bitgo
Copy link
Contributor

Ticket: WP-5430

@lokesh-bitgo lokesh-bitgo marked this pull request as ready for review October 29, 2025 08:13
@lokesh-bitgo lokesh-bitgo requested a review from a team as a code owner October 29, 2025 08:13
@lokesh-bitgo
Copy link
Contributor Author

@claude

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a V2 API endpoint for consolidating unspents in wallets with typed routes. The endpoint follows the V2 API pattern by including a coin parameter in the URL path and uses typed request/response handling.

Key changes:

  • New typed route definition for POST /api/v2/{coin}/wallet/{id}/consolidateunspents
  • Comprehensive test suite with 1150 lines covering request/response validation, bulk mode, error cases, and codec tests
  • Migration from untyped express route to typed route handler with proper parameter decoding

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
modules/express/src/typedRoutes/api/v2/consolidateunspents.ts Defines typed route, request/response schemas with support for single and bulk consolidation modes
modules/express/test/unit/typedRoutes/consolidateunspentsV2.ts Comprehensive test suite validating codecs, API behavior, framework integration, and edge cases
modules/express/src/typedRoutes/api/index.ts Registers the new V2 endpoint in the API spec alongside the existing V1 endpoint
modules/express/src/clientRoutes.ts Updates handler to use typed route with decoded parameters and registers route with typed router

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lokesh-bitgo lokesh-bitgo merged commit 5ccb89d into master Oct 29, 2025
19 checks passed
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