From ea9c405dfab52561b3097c1ad58df0ba012c1321 Mon Sep 17 00:00:00 2001 From: keyan Date: Thu, 10 Aug 2023 18:33:57 -0500 Subject: [PATCH] add sat amounts to invoices --- api/resolvers/wallet.js | 3 ++- api/typeDefs/wallet.js | 1 + components/invoice.js | 2 +- components/qr.js | 3 ++- fragments/wallet.js | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api/resolvers/wallet.js b/api/resolvers/wallet.js index 7938d9c05..d987a85eb 100644 --- a/api/resolvers/wallet.js +++ b/api/resolvers/wallet.js @@ -296,7 +296,8 @@ export default { }, Invoice: { - satsReceived: i => msatsToSats(i.msatsReceived) + satsReceived: i => msatsToSats(i.msatsReceived), + satsRequested: i => msatsToSats(i.msatsRequested) }, Fact: { diff --git a/api/typeDefs/wallet.js b/api/typeDefs/wallet.js index 2bde43e04..3328bc902 100644 --- a/api/typeDefs/wallet.js +++ b/api/typeDefs/wallet.js @@ -23,6 +23,7 @@ export default gql` cancelled: Boolean! confirmedAt: Date satsReceived: Int + satsRequested: Int! nostr: JSONObject hmac: String } diff --git a/components/invoice.js b/components/invoice.js index 5d2e7ed6d..fe5aa52dc 100644 --- a/components/invoice.js +++ b/components/invoice.js @@ -41,7 +41,7 @@ export function Invoice ({ invoice, onConfirmation, successVerb }) { return ( <> - +
{nostr ? { @@ -28,6 +28,7 @@ export default function Qr ({ asIs, value, webLn, statusVariant, status }) { className='h-auto mw-100' value={qrValue} renderAs='svg' size={300} /> + {description &&
{description}
}
diff --git a/fragments/wallet.js b/fragments/wallet.js index adc402211..0315ed4f5 100644 --- a/fragments/wallet.js +++ b/fragments/wallet.js @@ -7,6 +7,7 @@ export const INVOICE = gql` id hash bolt11 + satsRequested satsReceived cancelled confirmedAt