Skip to content

feat(sdk-core): add freeze/unfreeze unspent methods and frozen filter#9162

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

feat(sdk-core): add freeze/unfreeze unspent methods and frozen filter#9162
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
T1-3662-frozen-unspent

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Add freezeUnspent(params: FreezeUnspentOptions) method to Wallet and IWallet that calls POST /api/v2/{coin}/wallet/{id}/unspents/{unspentId}/freeze
  • Add unfreezeUnspent(params: UnfreezeUnspentOptions) method to Wallet and IWallet that calls DELETE /api/v2/{coin}/wallet/{id}/unspents/{unspentId}/freeze
  • Add frozen?: boolean filter to UnspentsOptions so callers can list only frozen or non-frozen unspents via the existing unspents() method
  • Add 7 unit tests covering freeze, unfreeze, frozen listing, and error cases

Why

  • Operators reported a ZEC unspent (52d9e671...:0) stuck in a frozen state on a hot withdrawal wallet (T1-3661), leaving the balance spendable short of confirmed
  • The SDK had no programmatic API surface to inspect which UTXOs are frozen or to unfreeze them, leaving operators with no self-service path to resolve stuck funds
  • These new methods expose the existing BitGo platform freeze API so operators and integrators can manage frozen UTXOs without manual support intervention

Test plan

  • modules/bitgo/test/v2/unit/unspents.ts — 7 new passing tests covering:
    • unspents({ frozen: true }) includes frozen query param
    • unspents({ frozen: false }) includes frozen=false query param
    • unspents({}) omits frozen param
    • freezeUnspent({ unspentId }) calls correct POST endpoint
    • unfreezeUnspent({ unspentId }) calls correct DELETE endpoint
    • freezeUnspent({ unspentId: '' }) throws unspentId is required
    • unfreezeUnspent({ unspentId: '' }) throws unspentId is required
  • TypeScript compiles cleanly in both sdk-core and bitgo modules

Ticket: T1-3662

Add freezeUnspent() and unfreezeUnspent() methods to the Wallet class
and IWallet interface. These methods call the BitGo API to freeze or
unfreeze a specific UTXO by its ID (txid:vout format), preventing or
allowing it to be selected during transaction building.

Also add a frozen filter to UnspentsOptions so callers can list only
frozen or non-frozen unspents via the existing unspents() method.

Why: UTXOs can become frozen on BitGo's platform (e.g. the ZEC unspent
52d9e671...:0 reported in T1-3661). The SDK previously had no way to
inspect or manage the frozen state of individual UTXOs programmatically,
leaving operators with no self-service path to unfreeze stuck funds.

Ticket: T1-3662
Session-Id: efcc06e2-ce7b-46e0-a938-bf99174ce650
Task-Id: 267141cf-1bb3-4cad-ae90-bd7ed76a54d0
@linear-code

linear-code Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

T1-3662

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the T1-3662-frozen-unspent branch from a43474c to a656b45 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