Overview
The MintClient handles all operations related to the GLAM vault’s share token, including initialization, minting, burning, freezing, and force transfers.
Methods
initialize
Initializes a new GLAM vault mint with the specified parameters.
initialize(
initMintParams: InitMintParams,
txOptions?: TxOptions
): Promise<TransactionSignature>
Mint initialization parameters including name, symbol, decimals, and base asset
Example
const signature = await glamClient.mint.initialize({
accountType: StateAccountType.TOKENIZED_VAULT,
name: Array.from(Buffer.from("My Fund")),
symbol: "MYFUND",
uri: "https://example.com/metadata.json",
baseAssetMint: usdcMint,
decimals: 6
});
initializeWithStateParams
Initializes a new GLAM vault mint with both mint and state parameters.
initializeWithStateParams(
initMintParams: InitMintParams,
stateParams: UpdateStateParams,
txOptions?: TxOptions
): Promise<TransactionSignature>
Mint initialization parameters
stateParams
UpdateStateParams
required
State configuration parameters
update
Updates mint configuration parameters.
update(
mintModel: Partial<MintIdlModel>,
txOptions?: TxOptions
): Promise<TransactionSignature>
mintModel
Partial<MintIdlModel>
required
Mint parameters to update (e.g., lockup period, caps, allowlists)
Example
const signature = await glamClient.mint.update({
lockupPeriod: 86400, // 24 hours
maxCap: new BN(1000000),
minSubscription: new BN(1000)
});
mint
Mints new share tokens to a recipient.
mint(
to: PublicKey,
amount: BN | number,
unfreeze?: boolean,
txOptions?: TxOptions
): Promise<TransactionSignature>
Amount to mint in base units
Whether to unfreeze the recipient’s token account
Example
import { BN } from "@coral-xyz/anchor";
const signature = await glamClient.mint.mint(
recipientAddress,
new BN(1000000), // 1 USDC worth of shares (6 decimals)
true // Unfreeze account
);
burn
Burns share tokens from an account.
burn(
from: PublicKey,
amount: BN | number,
unfreeze?: boolean,
txOptions?: TxOptions
): Promise<TransactionSignature>
Whether to unfreeze the account before burning
Example
const signature = await glamClient.mint.burn(
holderAddress,
new BN(500000),
true
);
forceTransfer
Force transfers tokens between accounts (manager only).
forceTransfer(
from: PublicKey,
to: PublicKey,
amount: BN | number,
unfreeze?: boolean,
txOptions?: TxOptions
): Promise<TransactionSignature>
Whether to unfreeze accounts before transfer
createTokenAccount
Creates a token account for an owner and optionally sets its frozen state.
createTokenAccount(
owner: PublicKey,
setFrozen: boolean,
txOptions?: TxOptions
): Promise<TransactionSignature>
setTokenAccountsStates
Sets the frozen state of multiple token accounts.
setTokenAccountsStates(
tokenAccounts: PublicKey[],
frozen: boolean,
txOptions?: TxOptions
): Promise<TransactionSignature>
Array of token account addresses
Example
const signature = await glamClient.mint.setTokenAccountsStates(
[account1, account2, account3],
true // Freeze all accounts
);
pauseSubscription
Pauses new subscriptions to the vault.
pauseSubscription(
txOptions?: TxOptions
): Promise<TransactionSignature>
unpauseSubscription
Resumes subscriptions to the vault.
unpauseSubscription(
txOptions?: TxOptions
): Promise<TransactionSignature>
pauseRedemption
Pauses redemptions from the vault.
pauseRedemption(
txOptions?: TxOptions
): Promise<TransactionSignature>
unpauseRedemption
Resumes redemptions from the vault.
unpauseRedemption(
txOptions?: TxOptions
): Promise<TransactionSignature>
close
Closes the mint account.
close(
txOptions?: TxOptions
): Promise<TransactionSignature>
fetchTokenHolders
Fetches all token holders using Helius RPC (mainnet only) or falls back to on-chain scanning.
fetchTokenHolders(
showZeroBalance?: boolean
): Promise<TokenAccount[]>
Whether to include accounts with zero balance
Example
const holders = await glamClient.mint.fetchTokenHolders(false);
console.log(`Found ${holders.length} holders`);
holders.forEach(holder => {
console.log(`${holder.owner.toBase58()}: ${holder.uiAmount}`);
});
getHolders
Gets token holders by scanning on-chain accounts (slower than fetchTokenHolders).
getHolders(
showZeroBalance?: boolean
): Promise<TokenAccount[]>
Whether to include accounts with zero balance
Types
InitMintParams
type InitMintParams = {
accountType: StateAccountType;
name: number[];
symbol: string;
uri: string;
baseAssetMint: PublicKey;
decimals?: number;
} & Partial<MintIdlModel>;
TokenAccount
interface TokenAccount {
owner: PublicKey;
pubkey: PublicKey;
mint: PublicKey;
programId: PublicKey;
decimals: number;
amount: string;
uiAmount: number;
frozen: boolean;
}