Custody Starter Architecture: Create Whitelists (Standby-Deposit)
Update standby wallet whitelist to include deposit/withdraw wallet. See the Guide.
-
Add the deposit/withdraw wallet address to the standby wallet existing whitelist. This is an update to the whitelist policy you created earlier. The standby wallet whitelist now includes both the custody wallet and the deposit/withdraw wallet addresses.
For self-custody wallets, whitelist updates are subject to the same 48-hour lock period as new whitelists.
// 1. Update Standby Wallet Whitelist
export COIN="<ASSET_ID>"
export STANDBY_WALLET_ID="<STANDBY_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export WHITELIST_RULE_ID="Standby to Custody Whitelist"
export DEPOSIT_WITHDRAW_ADDRESS="<DEPOSIT_WITHDRAW_WALLET_ADDRESS>"
curl -X PUT \
"https://app.bitgo-test.com/api/v2/$COIN/wallet/$STANDBY_WALLET_ID/policy/rule" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"id": "'"$WHITELIST_RULE_ID"'",
"type": "advancedWhitelist",
"condition": {
"add": {
"type": "address",
"item": "'"$DEPOSIT_WITHDRAW_ADDRESS"'",
"metaData": {
"label": "Deposit-Withdraw Wallet"
}
}
},
"action": {
"type": "deny"
}
}'
// 1. Update Standby Wallet Whitelist
const BitGoJS = require('bitgo');
const bitgo = new BitGoJS.BitGo({ env: 'prod' });
const accessToken = '<YOUR_ACCESS_TOKEN>';
const coin = '<ASSET_ID>';
const standbyWalletId = '<STANDBY_WALLET_ID>';
const depositWithdrawAddress = '<DEPOSIT_WITHDRAW_WALLET_ADDRESS>';
async function updateStandbyWhitelist() {
bitgo.authenticateWithAccessToken({ accessToken });
const wallet = await bitgo.coin(coin).wallets().get({ id: standbyWalletId });
console.log(`Updating whitelist policy on standby wallet ${wallet.label()}`);
const policy = {
action: {
type: 'deny'
},
condition: {
add: {
item: depositWithdrawAddress,
type: 'address',
metaData: {
label: 'Deposit-Withdraw Wallet'
}
}
},
id: 'Standby to Custody Whitelist', // Use existing rule ID to update
type: 'advancedWhitelist'
};
const result = await wallet.setPolicyRule(policy);
console.log('Whitelist updated:', result);
}
updateStandbyWhitelist();
Response
// 1. Update Standby Wallet Whitelist Response
{
"id": "6849948ac0623f81f74f63dbd8351d4f",
"coin": "btc",
"label": "Standby Wallet - Hot",
"admin": {
"policy": {
"rules": [
{
"id": "Standby to Custody Whitelist",
"lockDate": "2025-09-18T22:05:21.219Z",
"coin": "btc",
"type": "advancedWhitelist",
"action": { "type": "deny", "userIds": [] },
"condition": {
"entries": [
{
"item": "bc1q...",
"type": "address",
"metaData": {
"label": "Custody Wallet"
}
},
{
"item": "bc1p...",
"type": "address",
"metaData": {
"label": "Deposit-Withdraw Wallet"
}
}
]
}
}
]
}
}
}