I'm writing a custom pallet that uses AssetsPallet. The idea is to create a call/function that can be called only by the creator of an Asset/Token. I know I need that info from the following struct of Assets pallet:
#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, MaxEncodedLen, TypeInfo)]
pub struct AssetDetails<Balance, AccountId, DepositBalance> {
/// Can change `owner`, `issuer`, `freezer` and `admin` accounts.
pub(super) owner: AccountId,
/// Can mint tokens.
pub(super) issuer: AccountId,
/// Can thaw tokens, force transfers and burn tokens from any account.
pub(super) admin: AccountId,
/// Can freeze tokens.
pub(super) freezer: AccountId,
/// The total supply across all accounts.
pub(super) supply: Balance,
/// The balance deposited for this asset. This pays for the data stored here.
pub(super) deposit: DepositBalance,
/// The ED for virtual accounts.
pub(super) min_balance: Balance,
/// If `true`, then any account with this asset is given a provider reference. Otherwise, it
/// requires a consumer reference.
pub(super) is_sufficient: bool,
/// The total number of accounts.
pub(super) accounts: u32,
/// The total number of accounts for which we have placed a self-sufficient reference.
pub(super) sufficients: u32,
/// The total number of approvals.
pub(super) approvals: u32,
/// The status of the asset
pub(super) status: AssetStatus,
}
That is Stored in the following storage when created:
#[pallet::storage]
/// Details of an asset.
pub(super) type Asset<T: Config<I>, I: 'static = ()> = StorageMap<
_,
Blake2_128Concat,
T::AssetId,
AssetDetails<T::Balance, T::AccountId, DepositBalanceOf<T, I>>,
>;
I know this is related to the topic of loose coupling, but the examples I found use a frame_support trait as the link. So I'm not getting how to do it.