Skip to main content
The mint sub-client manages the lifecycle of tokenized vault mints, including initialization, configuration updates, subscription/redemption pausing, and token account management. For creating a tokenized vault with a mint, see Create a Vault.

Initialize Mint

Create a new tokenized vault by initializing a mint. The vault state is automatically created by the underlying initialize_mint instruction:
import {
  GlamClient,
  WSOL,
  nameToChars,
  StateAccountType,
} from "@glamsystems/glam-sdk";
import { BN } from "@coral-xyz/anchor";

const glamClient = new GlamClient();

const txSig = await glamClient.mint.initialize({
  accountType: StateAccountType.TOKENIZED_VAULT,
  name: nameToChars("My Fund"),
  symbol: "gFUND",
  uri: "",
  baseAssetMint: WSOL,
  maxCap: new BN(1_000_000_000_000),
  minSubscription: new BN(1_000_000_000),
  minRedemption: new BN(100_000_000),
  lockupPeriod: new BN(0),
});

Update Mint

Update mint configuration parameters:
await glamClient.mint.update({
  maxCap: new BN(5_000_000_000_000), // increase max cap
  minSubscription: new BN(500_000_000), // lower minimum
});

Pause and Unpause

Temporarily halt subscriptions or redemptions:
// Pause subscriptions
await glamClient.mint.pauseSubscription();

// Resume subscriptions
await glamClient.mint.unpauseSubscription();

// Pause redemptions
await glamClient.mint.pauseRedemption();

// Resume redemptions
await glamClient.mint.unpauseRedemption();

Token Account Management

Create Token Account

Create a token account for a user to hold vault shares:
await glamClient.mint.createTokenAccount(
  new PublicKey("User1111111111111111111111111111"),
  true, // frozen by default
);

Freeze and Unfreeze Accounts

Control the transferability of vault shares by freezing or unfreezing token accounts:
// Freeze token accounts
await glamClient.mint.setTokenAccountsStates(
  [new PublicKey("TokenAcc111111111111111111111111")],
  true, // frozen
);

// Unfreeze token accounts
await glamClient.mint.setTokenAccountsStates(
  [new PublicKey("TokenAcc111111111111111111111111")],
  false, // unfrozen
);

Fetch Token Holders

Retrieve all token holders for the vault mint:
// Get holders with non-zero balances
const holders = await glamClient.mint.fetchTokenHolders();

// Include zero-balance holders
const allHolders = await glamClient.mint.fetchTokenHolders(true);

Close Mint

Close the mint account. The vault must have zero outstanding shares:
await glamClient.mint.close();