Compare commits

..

3 Commits

Author SHA1 Message Date
keyan
13eda4c120 add geninvites script 2024-04-24 13:30:08 -05:00
ekzyis
cc7d9d734c
Support LNURL-verify (#1103) 2024-04-23 20:28:25 -05:00
Ben Allen
255f97a2b3
flip the icons for consistent UX (#1100) 2024-04-23 09:46:27 -05:00
4 changed files with 33 additions and 3 deletions

View File

@ -1061,10 +1061,10 @@ function PasswordHider ({ onClick, showPass }) {
onClick={onClick}
>
{!showPass
? <EyeClose
? <Eye
fill='var(--bs-body-color)' height={20} width={20}
/>
: <Eye
: <EyeClose
fill='var(--bs-body-color)' height={20} width={20}
/>}
</InputGroup.Text>

View File

@ -90,7 +90,8 @@ export default async ({ query: { username, amount, nostr, comment, payerdata: pa
return res.status(200).json({
pr: invoice.request,
routes: []
routes: [],
verify: `${process.env.NEXT_PUBLIC_URL}/api/lnurlp/${username}/verify/${invoice.id}`
})
} catch (error) {
console.log(error)

View File

@ -0,0 +1,15 @@
import lnd from '@/api/lnd'
import { getInvoice } from 'ln-service'
export default async ({ query: { hash } }, res) => {
try {
const inv = await getInvoice({ id: hash, lnd })
const settled = inv.is_confirmed
return res.status(200).json({ status: 'OK', settled, preimage: settled ? inv.secret : null, pr: inv.request })
} catch (err) {
if (err[1] === 'UnexpectedLookupInvoiceErr') {
return res.status(404).json({ status: 'ERROR', reason: 'not found' })
}
return res.status(500).json({ status: 'ERROR', reason: 'internal server error' })
}
}

14
scripts/geninvites.js Normal file
View File

@ -0,0 +1,14 @@
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient();
(async () => {
for (let i = 0; i < process.env.NUM; i++) {
await prisma.invite.create({
data: {
userId: Number(process.env.USER_ID),
gift: Number(process.env.GIFT)
}
})
}
})()