You have three different options:
- requesting the account with
jsonParsed
encoding should parse all of the extension data for you
- in Rust:
use spl_token_2022::{
extension::{BaseStateWithExtensions, StateWithExtensions},
state::Mint,
};
... assuming you have the mint data from fetching the account ...
let mint = StateWithExtensions::<PodMint>::unpack(&mint_data).unwrap();
let extension_types = mint.get_extension_types().unwrap();
import { getMint, getExtensionTypes, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
...
const mint = await getMint(connection, address, 'confirmed', TOKEN_2022_PROGRAM_ID);
const extensionTypes = getExtensionTypes(mint.tlvData);