Trait pallet_nfts::pallet::Config
source · pub trait Config<I: 'static = ()>: Config {
Show 26 associated items
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
type CollectionId: Member + Parameter + MaxEncodedLen + Copy + Incrementable;
type ItemId: Member + Parameter + MaxEncodedLen + Copy;
type Currency: ReservableCurrency<Self::AccountId>;
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>;
type CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::CollectionId, Success = Self::AccountId>;
type Locker: Locker<Self::CollectionId, Self::ItemId>;
type CollectionDeposit: Get<DepositBalanceOf<Self, I>>;
type ItemDeposit: Get<DepositBalanceOf<Self, I>>;
type MetadataDepositBase: Get<DepositBalanceOf<Self, I>>;
type AttributeDepositBase: Get<DepositBalanceOf<Self, I>>;
type DepositPerByte: Get<DepositBalanceOf<Self, I>>;
type StringLimit: Get<u32>;
type KeyLimit: Get<u32>;
type ValueLimit: Get<u32>;
type ApprovalsLimit: Get<u32>;
type ItemAttributesApprovalsLimit: Get<u32>;
type MaxTips: Get<u32>;
type MaxDeadlineDuration: Get<BlockNumberFor<Self, I>>;
type MaxAttributesPerCall: Get<u32>;
type Features: Get<PalletFeatures>;
type OffchainSignature: Verify<Signer = Self::OffchainPublic> + Parameter;
type OffchainPublic: IdentifyAccount<AccountId = Self::AccountId>;
type Helper: BenchmarkHelper<Self::CollectionId, Self::ItemId, Self::OffchainPublic, Self::AccountId, Self::OffchainSignature>;
type WeightInfo: WeightInfo;
type BlockNumberProvider: BlockNumberProvider;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait. The module configuration trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype CollectionId: Member + Parameter + MaxEncodedLen + Copy + Incrementable
type CollectionId: Member + Parameter + MaxEncodedLen + Copy + Incrementable
Identifier for the collection of item.
SAFETY: The functions in the Incrementable
trait are fallible. If the functions
of the implementation both return None
, the automatic CollectionId generation
should not be used. So the create
and force_create
extrinsics and the
create_collection
function will return an UnknownCollection
Error. Instead use
the create_collection_with_id
function. However, if the Incrementable
trait
implementation has an incremental order, the create_collection_with_id
function
should not be used as it can claim a value in the ID sequence.
sourcetype ItemId: Member + Parameter + MaxEncodedLen + Copy
type ItemId: Member + Parameter + MaxEncodedLen + Copy
The type used to identify a unique item within a collection.
sourcetype Currency: ReservableCurrency<Self::AccountId>
type Currency: ReservableCurrency<Self::AccountId>
The currency mechanism, used for paying for reserves.
sourcetype ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>
type ForceOrigin: EnsureOrigin<Self::RuntimeOrigin>
The origin which may forcibly create or destroy an item or otherwise alter privileged attributes.
sourcetype CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::CollectionId, Success = Self::AccountId>
type CreateOrigin: EnsureOriginWithArg<Self::RuntimeOrigin, Self::CollectionId, Success = Self::AccountId>
Standard collection creation is only allowed if the origin attempting it and the collection are in this set.
sourcetype Locker: Locker<Self::CollectionId, Self::ItemId>
type Locker: Locker<Self::CollectionId, Self::ItemId>
Locker trait to enable Locking mechanism downstream.
sourcetype CollectionDeposit: Get<DepositBalanceOf<Self, I>>
type CollectionDeposit: Get<DepositBalanceOf<Self, I>>
The basic amount of funds that must be reserved for collection.
sourcetype ItemDeposit: Get<DepositBalanceOf<Self, I>>
type ItemDeposit: Get<DepositBalanceOf<Self, I>>
The basic amount of funds that must be reserved for an item.
sourcetype MetadataDepositBase: Get<DepositBalanceOf<Self, I>>
type MetadataDepositBase: Get<DepositBalanceOf<Self, I>>
The basic amount of funds that must be reserved when adding metadata to your item.
sourcetype AttributeDepositBase: Get<DepositBalanceOf<Self, I>>
type AttributeDepositBase: Get<DepositBalanceOf<Self, I>>
The basic amount of funds that must be reserved when adding an attribute to an item.
sourcetype DepositPerByte: Get<DepositBalanceOf<Self, I>>
type DepositPerByte: Get<DepositBalanceOf<Self, I>>
The additional funds that must be reserved for the number of bytes store in metadata, either “normal” metadata or attribute metadata.
sourcetype StringLimit: Get<u32>
type StringLimit: Get<u32>
The maximum length of data stored on-chain.
sourcetype ValueLimit: Get<u32>
type ValueLimit: Get<u32>
The maximum length of an attribute value.
sourcetype ApprovalsLimit: Get<u32>
type ApprovalsLimit: Get<u32>
The maximum approvals an item could have.
sourcetype ItemAttributesApprovalsLimit: Get<u32>
type ItemAttributesApprovalsLimit: Get<u32>
The maximum attributes approvals an item could have.
sourcetype MaxDeadlineDuration: Get<BlockNumberFor<Self, I>>
type MaxDeadlineDuration: Get<BlockNumberFor<Self, I>>
The max duration in blocks for deadlines.
sourcetype MaxAttributesPerCall: Get<u32>
type MaxAttributesPerCall: Get<u32>
The max number of attributes a user could set per call.
sourcetype Features: Get<PalletFeatures>
type Features: Get<PalletFeatures>
Disables some of pallet’s features.
sourcetype OffchainSignature: Verify<Signer = Self::OffchainPublic> + Parameter
type OffchainSignature: Verify<Signer = Self::OffchainPublic> + Parameter
Off-Chain signature type.
Can verify whether an Self::OffchainPublic
created a signature.
sourcetype OffchainPublic: IdentifyAccount<AccountId = Self::AccountId>
type OffchainPublic: IdentifyAccount<AccountId = Self::AccountId>
Off-Chain public key.
Must identify as an on-chain Self::AccountId
.
sourcetype Helper: BenchmarkHelper<Self::CollectionId, Self::ItemId, Self::OffchainPublic, Self::AccountId, Self::OffchainSignature>
type Helper: BenchmarkHelper<Self::CollectionId, Self::ItemId, Self::OffchainPublic, Self::AccountId, Self::OffchainSignature>
A set of helper functions for benchmarking.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
sourcetype BlockNumberProvider: BlockNumberProvider
type BlockNumberProvider: BlockNumberProvider
Provider for the block number. Normally this is the frame_system
pallet.