spl_simplified::simplespl

Function mint_simple

source
pub fn mint_simple<'info>(
    token_name: String,
    token_symbol: String,
    token_uri: String,
    token_tax: u16,
    payer: AccountInfo<'info>,
    token_metadata_program: AccountInfo<'info>,
    update_authority: AccountInfo<'info>,
    metadata: AccountInfo<'info>,
    mint_authority: AccountInfo<'info>,
    system_program: AccountInfo<'info>,
    rent: AccountInfo<'info>,
    token_program: AccountInfo<'info>,
    mint: AccountInfo<'info>,
    to: AccountInfo<'info>,
    owner: AccountInfo<'info>,
    signer_seeds: &[&[u8]],
    amount: u64,
) -> Result<()>
Expand description

Mints a new token and creates its associated metadata.

§Arguments

  • token_name - The name of the token being minted.
  • token_symbol - The symbol associated with the token.
  • token_uri - The URI pointing to the token’s metadata.
  • token_tax - The seller fee basis points for the token.
  • payer - The account that will pay for the transaction.
  • token_metadata_program - The metadata program account.
  • update_authority - The authority responsible for updating the token metadata.
  • metadata - The account where metadata for the token will be stored.
  • mint_authority - The account that has the authority to mint new tokens.
  • system_program - The system program account for account management.
  • rent - The rent account for Solana’s rent exemption.
  • token_program - The SPL token program account.
  • mint - The account of the mint being created.
  • to - The account where the newly minted tokens will be sent.
  • owner - The account that will own the minted tokens.
  • signer_seeds - The seeds used for signing the transaction.
  • amount - The number of tokens to mint.

§Returns

A Result that is Ok(()) on success or an error if the minting or metadata creation fails.