Skip to content

feat(sdk-core): add list operation for reserved (frozen) unspents#9161

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
T1-3661/frozen-unspent
Draft

feat(sdk-core): add list operation for reserved (frozen) unspents#9161
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
T1-3661/frozen-unspent

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Add a list operation to manageUnspentReservations in wallet.ts that calls GET /reservedunspents to retrieve currently frozen UTXOs on a wallet
  • Add ReservedUnspent and ListReservedUnspentsResponse types to iWallet.ts
  • Expose manageUnspentReservations on the IWallet interface (it was previously only on the concrete Wallet class)
  • Add list option to ManageUnspentReservationOptions with optional limit, prevId, and expireTimeGt pagination/filter params
  • Add unit tests covering list with pagination, expireTimeGt filter, and the no-op error path
  • Update the reserve-unspents.ts example with a listUnspentReservations function

Why

  • The BitGo API already supports GET /reservedunspents (used by the admin tool and documented in the developer portal recipe "Freeze and Unfreeze Unspents"), but the SDK had no way to call it — customers could freeze UTXOs but not programmatically inspect which ones were frozen
  • Completing the CRUD surface (create, modify, delete, list) makes the feature usable end-to-end from the SDK

Test plan

  • Unit tests in modules/bitgo/test/v2/unit/unspents.ts pass (nock-based, no network)
  • TypeScript compiles cleanly for changed files (tsc --noEmit --skipLibCheck passes with no new errors)
  • Manually verify wallet.manageUnspentReservations({ list: { limit: 25 } }) issues GET /reservedunspents?limit=25

Ticket: T1-3661

Add a `list` operation to `manageUnspentReservations` that calls
GET `/reservedunspents` to retrieve currently reserved UTXOs on a
wallet. The server already supports this endpoint (used by the admin
tool); the SDK was missing the client-side wrapper.

Changes:
- `iWallet.ts`: Add `ReservedUnspent` and `ListReservedUnspentsResponse`
  types; add `list` option to `ManageUnspentReservationOptions`; expose
  `manageUnspentReservations` on the `IWallet` interface.
- `wallet.ts`: Handle the new `list` branch by issuing a GET with
  optional `limit`, `prevId`, and `expireTimeGt` query params; update
  return type to include `ListReservedUnspentsResponse`.
- `unspents.ts`: Add unit tests for list with pagination, expireTimeGt
  filter, and no-op error case.
- `reserve-unspents.ts` example: Add `listUnspentReservations` function.

Ticket: T1-3661
Session-Id: bd80c424-20de-47fa-9497-9a8189d7073e
Task-Id: 6636b6c9-9798-4980-8188-ec263bab643d
@linear-code

linear-code Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

T1-3661

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the T1-3661/frozen-unspent branch from 30738c5 to b7194f1 Compare July 1, 2026 14:59
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.

0 participants