Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
1import type { Maybe, MetadataAttributeFragment } from "@hey/indexer";
2
3type Key = "location" | "website" | "x" | "creatorCoinAddress";
4
5const getAccountAttribute = (
6 key: Key,
7 attributes: Maybe<MetadataAttributeFragment[]> = []
8): string => {
9 const attribute = attributes?.find((attr) => attr.key === key);
10 return attribute?.value || "";
11};
12
13export default getAccountAttribute;