referrerpolicy=no-referrer-when-downgrade

pallet_nfts_runtime_api/
lib.rs

1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// 	http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18//! Runtime API definition for the FRAME NFTs pallet.
19
20#![cfg_attr(not(feature = "std"), no_std)]
21
22extern crate alloc;
23
24use alloc::vec::Vec;
25use codec::{Decode, Encode};
26
27sp_api::decl_runtime_apis! {
28	pub trait NftsApi<AccountId, CollectionId, ItemId>
29	where
30		AccountId: Encode + Decode,
31		CollectionId: Encode,
32		ItemId: Encode,
33	{
34		fn owner(collection: CollectionId, item: ItemId) -> Option<AccountId>;
35
36		fn collection_owner(collection: CollectionId) -> Option<AccountId>;
37
38		fn attribute(
39			collection: CollectionId,
40			item: ItemId,
41			key: Vec<u8>,
42		) -> Option<Vec<u8>>;
43
44		fn custom_attribute(
45			account: AccountId,
46			collection: CollectionId,
47			item: ItemId,
48			key: Vec<u8>,
49		) -> Option<Vec<u8>>;
50
51		fn system_attribute(
52			collection: CollectionId,
53			item: Option<ItemId>,
54			key: Vec<u8>,
55		) -> Option<Vec<u8>>;
56
57		fn collection_attribute(collection: CollectionId, key: Vec<u8>) -> Option<Vec<u8>>;
58	}
59}