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

@ -13,7 +13,7 @@ import Modal from "Element/Modal";
import QrCode from "Element/QrCode";
import Copy from "Element/Copy";
import { LNURL, LNURLError, LNURLErrorCode, LNURLInvoice, LNURLSuccessAction } from "LNURL";
import { debounce } from "Util";
import { chunks, debounce } from "Util";
import messages from "./messages";
import { useWallet } from "Wallet";
@ -37,18 +37,6 @@ export interface SendSatsProps {
author?: HexKey;
}
function chunks<T>(arr: T[], length: number) {
const result = [];
let idx = 0;
let n = arr.length / length;
while (n > 0) {
result.push(arr.slice(idx, idx + length));
idx += length;
n -= 1;
}
return result;
}
export default function SendSats(props: SendSatsProps) {
const onClose = props.onClose || (() => undefined);
const { note, author, target } = props;