Using pallet-assets, how do I create a pallet that has hardcoded (pallet-)asset id's for it's on-chain assets that the pallet handles?
I wasnt able to find a good documented way to do this
Because AssetId's are mostly a fancy way of saying u32, It's as simple as:
let first_asset_id: T::AssetId = 1u32.into();
Don't forget to Add From<u32>
in :
type AssetId: IsType<<Self as pallet_assets::Config>::AssetId>
+ Parameter
+ From<u32>
+ Ord
+ Copy;
The implementation can be found here: https://github.com/liberland/liberland_substrate/blob/65edb6bab3/frame/llm/src/lib.rs
for some reason, the answer above does not work for me. if I try:
let nbr:u32 = 10;
let val:AssetId = nbr.into();
I get:
the trait From<u32> is not implemented for <T as pallet_assets::Config>::AssetId
Any advice on how to solve it? Kazu.