Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.glam.systems/llms.txt

Use this file to discover all available pages before exploring further.

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. The uri should point to a publicly hosted JSON document, see Token Metadata for the schema and hosting guidance.
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: "https://raw.githubusercontent.com/your-org/token-metadata/main/gfund.json",
  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),
});

Permanent Delegate

The permanentDelegate field on mint.initialize controls the Token-2022 Permanent Delegate extension. It accepts three meaningfully different values:
ValueBehavior
null (default)Extension not enabled. No party can force-transfer or burn investor shares.
System Program IDSentinel. The mint PDA itself is set as the permanent delegate, meaning the GLAM Mint Program retains programmatic control.
Any other keyThe provided key holds the permanent-delegate authority directly and unconditionally.
import { SystemProgram } from "@solana/web3.js";

await glamClient.mint.initialize({
  // ...other fields
  permanentDelegate: SystemProgram.programId, // recommended when the extension is required
});
  • Why the sentinel matters: When the delegate is set to SystemProgram.programId, initialize_mint substitutes the mint PDA as the on-chain authority. Any forced transfer or burn must therefore be invoked through a GLAM Mint Program instruction signed by the program via PDA seeds, gated by GLAM access control rather than a single keypair.
  • Rotation rules: mint.update can rotate the permanent delegate only if the current delegate is the mint itself. Once a non-mint key has been set, that key must rotate the authority directly (spl-token authorize <mint> permanent-delegate <new>); the vault manager cannot reclaim it through GLAM.

Best practices

  • Default to null unless you have a documented compliance reason to enable the extension.
  • Prefer the SystemProgram.programId sentinel over an external key. It keeps the authority programmatic and rotatable through GLAM.
  • Never use a single EOA as the delegate. If you must point it at an external account, use a multisig (e.g., Squads).
  • Disclose the configuration. If the extension is enabled, document who holds the authority and under what conditions it will be exercised.
  • Plan for the lifetime of the key. Once a non-mint delegate is set, your operational procedures (custody, multisig membership, recovery) become load-bearing for the vault.

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();