import { AssetService, BidService, BuyerProfileService, CategoriesService, ChainTypeEnum, CheckInService, CreatorProfileService, EventService, IChainService, ListingService, OrdersService, OrganizationService, SellerProfileService, UserService, WishlistService, } from '@bit-ui-libs/common'; import { create } from 'zustand'; import { useInferChainType } from '../hooks'; interface ServicesStoreState { chainToken: { [key in ChainTypeEnum]: IChainService; }; asset: { [key in ChainTypeEnum]: AssetService; }; marketplace: { listings: ListingService; categories: CategoriesService; bids: BidService; orders: OrdersService; wishlist: WishlistService; }; endUser: UserService; seller: SellerProfileService; buyer: BuyerProfileService; creator: CreatorProfileService; organization: OrganizationService; checkIn: CheckInService; coreEvents: EventService; } export const useServicesStore = create(() => ({} as ServicesStoreState)); export const useChainService = (chainType?: ChainTypeEnum) => { const inferredChainType = useInferChainType(); const _chainType = chainType ?? inferredChainType; return useServicesStore((s) => s.chainToken[_chainType]); };