pallet_nfts_runtime_api/
lib.rs1#![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}