Freeze and Unfreeze Unspents
Reserve unspents to prevent automatic inclusion in transactions, or release them. See the Guide.
-
Freeze unspents to make them ineligible for automatic inclusion in your transactions. Frozen unspents are still spendable, but only if you explicitly specify them in your transactions. This is useful if you do not want to commingle certain unspents in a wallet. Unspents remain frozen until their specified expiration time or until you unfreeze them. You can extend the freeze duration by modifying the unspent reservation.
Prerequisites: Complete Get Started and Create Wallets.
-
Release previously frozen unspents so they are once again eligible for automatic inclusion in transactions. You specify the unspent IDs and their expiration times to release the reservations.
// 1. Freeze Unspents
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X POST \
https://app.bitgo-test.com/api/v2/wallet/$WALLET_ID/reservedunspents \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"unspentIds": [
"003f688cc349f1fca8ac5ffa21671ca911b6ef351085c60733ed8c2ebf162cb8:2"
],
"expireTime": "string"
}'
// 2. Unfreeze Unspents
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X DELETE \
https://app.bitgo-test.com/api/v2/wallet/$WALLET_ID/reservedunspents \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"unspents": [
{
"id": "003f688cc349f1fca8ac5ffa21671ca911b6ef351085c60733ed8c2ebf162cb8:2",
"expireTime": "2023-08-24T14:15:22Z"
}
]
}'
// 1. Freeze Unspents
// Use the REST API for this step (see cURL tab)
// 2. Unfreeze Unspents
// Use the REST API for this step (see cURL tab)
// 1. Freeze Unspents Response
{
"unspents": [
{
"id": "003f688cc349f1fca8ac5ffa21671ca911b6ef351085c60733ed8c2ebf162cb8:2",
"expireTime": "2019-08-24T14:15:22Z"
}
]
}
// 2. Unfreeze Unspents Response
{
"error": "string",
"requestId": "string",
"context": {},
"name": "string"
}