feat: read nip-58 badges #394
@ -43,7 +43,9 @@ export default function useProfileBadges(pubkey?: HexKey) {
|
|||||||
(acc: BadgeAwards, addr) => {
|
(acc: BadgeAwards, addr) => {
|
||||||
const [, pubkey, d] = (addr as string).split(":");
|
const [, pubkey, d] = (addr as string).split(":");
|
||||||
acc.pubkeys.push(pubkey);
|
acc.pubkeys.push(pubkey);
|
||||||
|
if (d?.length > 0) {
|
||||||
acc.ds.push(d);
|
acc.ds.push(d);
|
||||||
|
}
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{ pubkeys: [], ds: [] } as BadgeAwards
|
{ pubkeys: [], ds: [] } as BadgeAwards
|
||||||
|
Loading…
Reference in New Issue
Block a user