1// This file is part of Substrate.
23// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
56// 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.
1718//! Runtime API definition for the FRAME NFTs pallet.
1920#![cfg_attr(not(feature = "std"), no_std)]
2122extern crate alloc;
2324use alloc::vec::Vec;
25use codec::{Decode, Encode};
2627sp_api::decl_runtime_apis! {
28pub trait NftsApi<AccountId, CollectionId, ItemId>
29where
30AccountId: Encode + Decode,
31 CollectionId: Encode,
32 ItemId: Encode,
33 {
34fn owner(collection: CollectionId, item: ItemId) -> Option<AccountId>;
3536fn collection_owner(collection: CollectionId) -> Option<AccountId>;
3738fn attribute(
39 collection: CollectionId,
40 item: ItemId,
41 key: Vec<u8>,
42 ) -> Option<Vec<u8>>;
4344fn custom_attribute(
45 account: AccountId,
46 collection: CollectionId,
47 item: ItemId,
48 key: Vec<u8>,
49 ) -> Option<Vec<u8>>;
5051fn system_attribute(
52 collection: CollectionId,
53 item: Option<ItemId>,
54 key: Vec<u8>,
55 ) -> Option<Vec<u8>>;
5657fn collection_attribute(collection: CollectionId, key: Vec<u8>) -> Option<Vec<u8>>;
58 }
59}