All chains
    Preparing search index...

    Type Alias mint

    mint: TxDescriptor<
        {
            asset_id: { interior: XcmV5Junctions; parents: number };
            external_amount: bigint;
        },
    >

    Swap external stablecoin for internal.

    Must be Signed by the user performing the swap.

    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].

    • asset_id: The external stablecoin to deposit (must be in ExternalAssets)
    • external_amount: Amount of external stablecoin to deposit
    • [Error::UnsupportedAsset]: If asset_id is not an approved external stablecoin
    • [Error::MintingStopped]: If circuit breaker is at MintingDisabled or higher
    • [Error::BelowMinimumSwap]: If external_amount is below [Config::MinSwapAmount]
    • [Error::ExceedsMaxIssuance]: If minting would exceed system-wide internal issuance cap
    • [Error::ExceedsMaxPsmDebt]: If minting would exceed PSM debt ceiling (aggregate or per-asset)
    • [Error::DecimalsMismatch]: If the asset's decimals do not match the internal asset's decimals
    • [Error::AmountTooSmallAfterConversion]: if the conversion to the counter-asset rounds to zero; swap would transfer nothing
    • [Event::Minted]: Emitted on successful mint