spl_token_wrap/mint_customizer/interface.rs
1use {
2 solana_account_info::AccountInfo,
3 solana_program_error::{ProgramError, ProgramResult},
4 solana_pubkey::Pubkey,
5};
6
7/// The interface for customizing attributes of the new wrapped mint.
8pub trait MintCustomizer {
9 /// Calculates the space required for a new spl-token-2022 mint
10 /// account, including any custom extensions
11 fn get_token_2022_mint_space() -> Result<usize, ProgramError>;
12
13 /// Customizes extensions for the wrapped mint *before* the base mint is
14 /// initialized. This is for extensions that must be initialized on an
15 /// uninitialized mint account, like `ConfidentialTransferMint`.
16 fn initialize_extensions(
17 _wrapped_mint_account: &AccountInfo,
18 _wrapped_token_program_account: &AccountInfo,
19 ) -> ProgramResult {
20 Ok(())
21 }
22
23 /// Customize the freeze authority and decimals for the wrapped mint
24 fn get_freeze_auth_and_decimals(
25 unwrapped_mint_account: &AccountInfo,
26 ) -> Result<(Option<Pubkey>, u8), ProgramError>;
27}