git.delta.rocks / unique-network / refs/commits / b70e369d3c1a

difftreelog

source

primitives/rpc/src/lib.rs1.1 KiBsourcehistory
1#![cfg_attr(not(feature = "std"), no_std)]23use nft_data_structs::{CollectionId, TokenId};4use sp_std::vec::Vec;5use sp_core::H160;67sp_api::decl_runtime_apis! {8	pub trait NftApi<CrossAccountId, AccountId> where9		CrossAccountId: pallet_common::account::CrossAccountId<AccountId>,10	{11		fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Vec<TokenId>;12		fn token_exists(collection: CollectionId, token: TokenId) -> bool;1314		fn token_owner(collection: CollectionId, token: TokenId) -> CrossAccountId;15		fn const_metadata(collection: CollectionId, token: TokenId) -> Vec<u8>;16		fn variable_metadata(collection: CollectionId, token: TokenId) -> Vec<u8>;1718		fn collection_tokens(collection: CollectionId) -> u32;19		fn account_balance(collection: CollectionId, account: CrossAccountId) -> u32;20		fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> u128;21		fn allowance(22			collection: CollectionId,23			sender: CrossAccountId,24			spender: CrossAccountId,25			token: TokenId,26		) -> u128;2728		/// Used for ethereum integration29		fn eth_contract_code(account: H160) -> Option<Vec<u8>>;30	}31}