Skip to content

feat(express): add cancel wallet share express route - #9369

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-1164-cancel-wallet-share-request
Draft

feat(express): add cancel wallet share express route#9369
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-1164-cancel-wallet-share-request

Conversation

@bitgo-ai-agent-dev

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot commented Jul 28, 2026

Copy link
Copy Markdown

What

  • Add a new typed DELETE /api/v2/{coin}/walletshare/{id} route to BitGo Express that lets callers cancel outgoing wallet share requests
  • New typed route definition in modules/express/src/typedRoutes/api/v2/cancelWalletShare.ts
  • Route registered under 'express.wallet.cancelShare' in ExpressWalletManagementApiSpec
  • New handler handleV2CancelWalletShare exported from clientRoutes.ts
  • Unit tests for the express handler and for Wallets.cancelShare() in the SDK

Why

  • BitGo Express was missing a handler for the cancel-wallet-share endpoint. The SDK's Wallets.cancelShare() already issued the correct DELETE /api/v2/:coin/walletshare/:id to the BitGo API, but Express had no typed route wired up for it. This meant any client using BitGo Express to cancel a wallet share would get a 404 or fall through to the generic REST proxy without proper request validation or typed response handling.

Test plan

  • Unit test: modules/express/test/unit/clientRoutes/cancelWalletShare.ts — verifies handleV2CancelWalletShare calls cancelShare({ walletShareId }) and returns a typed response
  • Unit test: modules/bitgo/test/v2/unit/wallets.ts — verifies Wallets.cancelShare() sends DELETE /api/v2/tbtc/walletshare/:id and throws when walletShareId is missing

Ticket: CUS-1301

Add a typed DELETE /api/v2/{coin}/walletshare/{id} route to the
BitGo Express server so callers can cancel outgoing wallet share
requests.

The SDK's Wallets.cancelShare() already issued the correct HTTP
DELETE to the BitGo API, but BitGo Express had no handler for
this endpoint. The accept-share endpoint had a similar gap that
was addressed with app.post(); this change adds a first-class
typed route following the same pattern as shareWallet.

Changes:
- modules/express/src/typedRoutes/api/v2/cancelWalletShare.ts:
  new typed route definition (params, response codecs,
  httpRoute export)
- modules/express/src/typedRoutes/api/index.ts: register
  DeleteCancelWalletShare under 'express.wallet.cancelShare'
  inside ExpressWalletManagementApiSpec
- modules/express/src/clientRoutes.ts: export
  handleV2CancelWalletShare handler and register it with
  router.delete
- modules/express/test/unit/clientRoutes/cancelWalletShare.ts:
  unit tests for the new handler
- modules/bitgo/test/v2/unit/wallets.ts: unit tests for
  Wallets.cancelShare() (DELETE /walletshare/:id)

Ticket: WCI-1164
Session-Id: 39708184-a685-4405-b0cf-0c296a1bf0d3
Task-Id: 7c07317a-7a0a-4ead-8e23-6f96f60d1755
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1164-cancel-wallet-share-request branch from 09383ed to 2a06fe4 Compare July 28, 2026 09:53
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1164-cancel-wallet-share-request branch from 2a06fe4 to 1c4aac0 Compare July 28, 2026 09:53
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