3

I want to implement pallet-assets on a type which is:

pub trait Config<I: 'static = ()>: Config {
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
type Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize + MaxEncodedLen + TypeInfo;
type RemoveItemsLimit: Get<u32>;
type AssetId: Member + Parameter + Copy + MaybeSerializeDeserialize + MaxEncodedLen;
type AssetIdParameter: Parameter + Copy + From<Self::AssetId> + Into<Self::AssetId> + MaxEncodedLen;
type Currency: ReservableCurrency<Self::AccountId>;
type CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::AssetId, Success = Self::AccountId>;
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type AssetDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type AssetAccountDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type MetadataDepositBase: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type MetadataDepositPerByte: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type ApprovalDeposit: Get<<<Self as Config<I>>::Currency as Currency<<Self as SystemConfig>::AccountId>>::Balance>;
type StringLimit: Get<u32>;
type Freezer: FrozenBalance<Self::AssetId, Self::AccountId, Self::Balance>;
type Extra: Member + Parameter + Default + MaxEncodedLen;
type CallbackHandle: AssetsCallback<Self::AssetId, Self::AccountId>;

in order to use in runtime/src/lib.rs could you pls help me?

2 Answers 2

1

You are trying to implement a trait called Config with several associated types and constants for a pallet that deals with assets. Please have a look at this for implementation of pallets-assets in the runtime of your code

0

Please walk through this topic:

https://docs.substrate.io/build/pallet-coupling/

Then you can understand how to use pallet in src/runtime/lib.rs ( Implement specific pallet for Runtime) by using existing implementation or new implementation by yourself

Some resources that you can learn:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.