feat: read nip-58 badges (#394)

This commit is contained in:
Alejandro
2023-03-09 11:13:10 +01:00
committed by GitHub
parent 2f20d03e2b
commit cd4dcbd0a2
12 changed files with 282 additions and 22 deletions

View File

@ -9,18 +9,12 @@ import { formatShort } from "Number";
import Text from "Element/Text";
import ProfileImage from "Element/ProfileImage";
import { RootState } from "State/Store";
import { findTag } from "Util";
import { ZapperSpam } from "Const";
import { UserCache } from "State/Users/UserCache";
import messages from "./messages";
function findTag(e: TaggedRawEvent, tag: string) {
const maybeTag = e.tags.find(evTag => {
return evTag[0] === tag;
});
return maybeTag && maybeTag[1];
}
function getInvoice(zap: TaggedRawEvent): InvoiceDetails | undefined {
const bolt11 = findTag(zap, "bolt11");
if (!bolt11) {