referrerpolicy=no-referrer-when-downgrade

mint

Function mint 

Source
pub fn mint<T: Config>(
    asset_id: T::AssetId,
    external_amount: <<T as Config>::Fungibles as FungiblesInspect<<T as Config>::AccountId>>::Balance,
)
Expand description

Swap external stablecoin for internal.

§Dispatch Origin

Must be Signed by the user performing the swap.

§Details

Transfers external_amount of the specified external stablecoin from the caller to the PSM account, then mints internal to the caller minus the minting fee. The fee is calculated using ceiling rounding (mul_ceil), ensuring the protocol never undercharges. The fee is transferred to Config::FeeDestination.

§Parameters

  • asset_id: The external stablecoin to deposit (must be in ExternalAssets)
  • external_amount: Amount of external stablecoin to deposit

§Errors

§Events

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::mint.