Freeze Wallets

Overview

Wallet admins can freeze wallets for a set period of time, preventing any outgoing transactions until the wallet is unfrozen. While frozen, wallet users, including admins, can't make outgoing transactions from the wallet, but the wallet can receive incoming transactions. This is useful if you need to immediately stop all spending from a wallet, but you don't want to delete it. For example, you may want to freeze wallets during organizational changes or during periods when your enterprise needs to reduce spending.

Note: You can't unfreeze a wallet before the specified time expires. Ensure that you won't need to spend from the wallet during the specified period.

Prerequisites

Steps

  • SDK
  • API
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import * as dotenv from "dotenv"; import {EnvironmentName} from "bitgo"; import {BitGoAPI} from "@bitgo/sdk-api"; import {Tbtc4} from "@bitgo/sdk-coin-btc"; dotenv.config(); const bitgo = new BitGoAPI({ env: process.env.ENV as EnvironmentName, accessToken: process.env.TESTNET_ACCESS_TOKEN }); const coin = 'tbtc4'; bitgo.register(coin, Tbtc4.createInstance); const walletId = process.env.WALLET_ID; async function main() { const walletInstance = await bitgo.coin(coin).wallets().get({id: walletId}); // BitGo measures the duration of the freeze in seconds walletInstance.freeze({ otp: '0000000' }).then(function (freeze) { console.dir(freeze); }); } main().catch((err) => console.error(err));

Step Result

1 2 3 4 { "time": "2019-08-24T14:15:22Z", "expires": "2019-08-24T14:15:22Z" }

See Also

API Reference: Freeze Wallet