pub fn add_external_asset<T: Config>(
internal_asset: T::AssetId,
external_asset: T::AssetId,
)Expand description
Approve an external asset for a given internal asset.
Snapshots the external asset’s live decimals at registration time and
increments PsmInfo::external_count.
§Dispatch Origin
Must match the PSM instance’s full_admin (the Full privilege level).
§Parameters
internal_asset: The PSM instance to approve the external on.external_asset: The external asset to approve.
§Errors
Error::InsufficientPrivilege: If the origin only hasEmergencyprivileges.Error::PsmNotFound: If no PSM is registered forinternal_asset.Error::TooManyAssets: If the PSM is already atConfig::MaxExternals.Error::AssetAlreadyApproved: Ifexternal_assetis already approved on this PSM.Error::AssetDoesNotExist: Ifexternal_assetdoes not exist in the underlying fungibles backend.Error::DecimalsMismatch: If the internal asset’s live decimals diverged from the snapshot inPsmInfo.Error::DecimalsRangeExceeded: If|asset_decimals − internal_decimals|exceedsMAX_DECIMALS_DIFF.
§Events
Event::ExternalAssetAdded: Emitted on a successful approval.
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::add_external_asset.