Documentation Index
Fetch the complete documentation index at: https://v2-docs.exponent.finance/llms.txt
Use this file to discover all available pages before exploring further.
createSentinelSetVaultFlagsInstruction
Sets or clears vault status flags to block specific operation categories. Only the vault sentinel role can call this instruction. This provides an emergency kill switch for compromised or malfunctioning vaults.
Usage
import {
createSentinelSetVaultFlagsInstruction,
vaultFlagAction,
} from "@exponent-labs/exponent-sdk/client/vaults";
// Block all withdrawals
const ix = createSentinelSetVaultFlagsInstruction(
{
sentinel: sentinelWallet.publicKey,
vault: vaultAddress,
},
{
action: vaultFlagAction("SetFlag", [4]), // FLAG_WITHDRAWALS_BLOCKED
},
);
// Clear the withdrawal block
const clearIx = createSentinelSetVaultFlagsInstruction(
{
sentinel: sentinelWallet.publicKey,
vault: vaultAddress,
},
{
action: vaultFlagAction("ClearFlag", [4]), // FLAG_WITHDRAWALS_BLOCKED
},
);
Accounts
| Name | Signer | Writable | Description |
|---|
sentinel | Yes | No | Sentinel wallet (must have sentinel role) |
vault | No | Yes | The vault account |
Args
| Name | Type | Description |
|---|
action | VaultFlagAction | The flag operation to perform |
VaultFlagAction
| Action | Description |
|---|
SetFlag(u8) | Enable a specific status flag |
ClearFlag(u8) | Disable a specific status flag |
SetAllFlags(u8) | Replace all flags at once with a bitmask |
For available flag values, see Status Flags.
Returns
TransactionInstruction — a transaction instruction ready to be added to a transaction.
Setting flags is an emergency action that immediately affects all vault users. Use with caution — blocked operations will fail until the flag is cleared.