feat(sdk-core): add list operation for reserved (frozen) unspents#9161
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
feat(sdk-core): add list operation for reserved (frozen) unspents#9161bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
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
Contributor
30738c5 to
b7194f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
listoperation tomanageUnspentReservationsinwallet.tsthat callsGET /reservedunspentsto retrieve currently frozen UTXOs on a walletReservedUnspentandListReservedUnspentsResponsetypes toiWallet.tsmanageUnspentReservationson theIWalletinterface (it was previously only on the concreteWalletclass)listoption toManageUnspentReservationOptionswith optionallimit,prevId, andexpireTimeGtpagination/filter paramsexpireTimeGtfilter, and the no-op error pathreserve-unspents.tsexample with alistUnspentReservationsfunctionWhy
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 frozenTest plan
modules/bitgo/test/v2/unit/unspents.tspass (nock-based, no network)tsc --noEmit --skipLibCheckpasses with no new errors)wallet.manageUnspentReservations({ list: { limit: 25 } })issuesGET /reservedunspents?limit=25Ticket: T1-3661