referrerpolicy=no-referrer-when-downgrade

mint

Function mint 

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

Swap external asset for internal on a specific PSM instance.

§Dispatch Origin

Must be Signed by the user performing the swap.

§Details

Transfers external_amount of external_asset from the caller to the internal_asset’s PSM reserve account, then mints internal_asset 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 PsmInfo::fee_destination of the targeted instance.

§Parameters

  • internal_asset: The internal stablecoin that identifies the PSM instance.
  • external_asset: The external asset to deposit (must be approved on internal_asset).
  • external_amount: Amount of external asset to deposit.
  • max_fee: Maximum minting fee rate accepted by the caller.

§Errors

§Events

§Warning: Doc-Only

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