aboutsummaryrefslogtreecommitdiffstats
path: root/lib/notifications.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
committerAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
commit32f01e3e328db0006a55c6324625b49d60244b66 (patch)
treeb97866549b919964957365e1e05681e85af7021a /lib/notifications.ts
parenta1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff)
downloadcoinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz
coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip
fix typescript issues
Diffstat (limited to 'lib/notifications.ts')
-rw-r--r--lib/notifications.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/notifications.ts b/lib/notifications.ts
index 261ad4bb..da6eae92 100644
--- a/lib/notifications.ts
+++ b/lib/notifications.ts
@@ -57,8 +57,8 @@ export const notify = async (p, user, withdrawal) => {
url: `/payment/${p.id}`,
};
- for (const s of subscriptions) {
- webpush.sendNotification(JSON.parse(s), JSON.stringify(payload)).catch((e) => {
+ for (const s of subscriptions as any) {
+ webpush.sendNotification(JSON.parse(s as string), JSON.stringify(payload)).catch((e) => {
warn("sub failed", e.message);
db.sRem(`${user.id}:subscriptions`, s);
});
@@ -77,7 +77,7 @@ export const nwcNotify = async (p) => {
try {
const user = await getUser(p.uid);
const pubkeys = await db.sMembers(`${user.id}:apps`);
- if (pubkeys.length) {
+ if ((pubkeys as any).length) {
let payment_hash = "";
if (p.type === "lightning") ({ payment_hash } = await ln.decode(p.hash));
for (const pubkey of pubkeys) {
@@ -102,7 +102,7 @@ export const nwcNotify = async (p) => {
notification,
});
- const content = await nip04.encrypt(serverSecret2, pubkey, payload);
+ const content = await nip04.encrypt(serverSecret2 as any, pubkey as string, payload);
const unsigned = {
content,
@@ -111,7 +111,7 @@ export const nwcNotify = async (p) => {
created_at: Math.floor(Date.now() / 1000),
};
- const event = finalizeEvent(unsigned, hexToBytes(serverSecret2));
+ const event = finalizeEvent(unsigned as any, hexToBytes(serverSecret2));
publish(event).catch(nada);
}