Skip to main content
The timelock sub-client manages timelock configuration for vaults. Timelocks add a mandatory delay between proposing and applying vault configuration changes, providing protection against unauthorized or hasty modifications. For conceptual details, see Timelock.

Set Timelock Duration

Configure the timelock duration in seconds. Once set, any subsequent vault state or mint updates will require waiting for this duration before they can be applied:
import { GlamClient } from "@glamsystems/glam-sdk";

const glamClient = new GlamClient();

// Set a 24-hour timelock (86400 seconds)
const txSig = await glamClient.timelock.set(86400);

Apply Timelock

After the timelock duration has elapsed, apply the pending changes:
const txSig = await glamClient.timelock.apply();
The apply method automatically detects the vault type:
  • For Vault types, it applies state timelock changes
  • For TokenizedVault types, it applies mint timelock changes

Cancel Timelock

Cancel pending timelock changes before they are applied:
const txSig = await glamClient.timelock.cancel();